From 5e8e36f10a8c52315dcbb311319d78acb9c3bf83 Mon Sep 17 00:00:00 2001 From: xibz Date: Tue, 13 Feb 2018 08:58:34 -0800 Subject: [PATCH] private/mode/api: refactoring paginators (#119) * Refactoring paginator * Fixing docs and tests * regenerating services * Introducing Copy method on API Requests * regenerating services * Updating tests to use new paginator and add mocking of paginators --- aws/request_pagination.go | 94 +- aws/request_pagination_test.go | 829 ++---- example/service/s3/listObjects/listObjects.go | 21 +- .../service/s3/mockPaginator/mockPaginator.go | 44 + .../s3/mockPaginator/mockPaginator_test.go | 94 + private/model/api/api.go | 10 +- private/model/api/operation.go | 94 +- private/model/api/passes.go | 23 +- private/protocol/ec2query/build_test.go | 36 +- private/protocol/ec2query/unmarshal_test.go | 30 +- private/protocol/jsonrpc/build_test.go | 48 +- private/protocol/jsonrpc/unmarshal_test.go | 24 +- private/protocol/query/build_test.go | 81 +- private/protocol/query/unmarshal_test.go | 48 +- private/protocol/restjson/build_test.go | 108 +- private/protocol/restjson/unmarshal_test.go | 48 +- private/protocol/restxml/build_test.go | 123 +- private/protocol/restxml/unmarshal_test.go | 48 +- service/acm/acmiface/interface.go | 4 - service/acm/api.go | 104 +- .../alexaforbusinessiface/interface.go | 22 - service/alexaforbusiness/api.go | 654 ++--- service/apigateway/api.go | 1296 ++++----- .../apigateway/apigatewayiface/interface.go | 37 - service/applicationautoscaling/api.go | 264 +- .../applicationautoscalingiface/interface.go | 10 - service/applicationdiscoveryservice/api.go | 57 +- service/appstream/api.go | 96 +- service/appsync/api.go | 78 +- service/athena/api.go | 255 +- service/athena/athenaiface/interface.go | 10 - service/autoscaling/api.go | 780 +++--- .../autoscaling/autoscalingiface/interface.go | 24 - service/batch/api.go | 48 +- service/budgets/api.go | 39 +- service/cloud9/api.go | 178 +- service/cloud9/cloud9iface/interface.go | 7 - service/clouddirectory/api.go | 1590 ++++++----- .../clouddirectoryiface/interface.go | 55 - service/cloudformation/api.go | 591 ++-- .../cloudformationiface/interface.go | 18 - service/cloudfront/api.go | 396 +-- .../cloudfront/cloudfrontiface/interface.go | 12 - service/cloudhsm/api.go | 60 +- service/cloudhsmv2/api.go | 252 +- .../cloudhsmv2/cloudhsmv2iface/interface.go | 10 - service/cloudsearch/api.go | 72 +- service/cloudsearchdomain/api.go | 9 +- service/cloudtrail/api.go | 120 +- .../cloudtrail/cloudtrailiface/interface.go | 4 - service/cloudwatch/api.go | 279 +- .../cloudwatch/cloudwatchiface/interface.go | 9 - service/cloudwatchevents/api.go | 45 +- service/cloudwatchlogs/api.go | 645 ++--- .../cloudwatchlogsiface/interface.go | 22 - service/codebuild/api.go | 45 +- service/codecommit/api.go | 651 ++--- .../codecommit/codecommitiface/interface.go | 22 - service/codedeploy/api.go | 588 ++-- .../codedeploy/codedeployiface/interface.go | 18 - service/codepipeline/api.go | 81 +- service/codestar/api.go | 54 +- service/cognitoidentity/api.go | 54 +- service/cognitoidentityprovider/api.go | 282 +- service/cognitosync/api.go | 51 +- service/comprehend/api.go | 107 +- .../comprehend/comprehendiface/interface.go | 4 - service/configservice/api.go | 159 +- .../configserviceiface/interface.go | 4 - service/costandusagereportservice/api.go | 83 +- .../interface.go | 4 - service/costexplorer/api.go | 12 +- service/databasemigrationservice/api.go | 1140 ++++---- .../interface.go | 40 - service/datapipeline/api.go | 291 +- .../datapipelineiface/interface.go | 10 - service/dax/api.go | 63 +- service/devicefarm/api.go | 1239 +++++---- .../devicefarm/devicefarmiface/interface.go | 43 - service/directconnect/api.go | 132 +- service/directoryservice/api.go | 198 +- .../directoryserviceiface/interface.go | 4 - service/dynamodb/api.go | 399 +-- service/dynamodb/dynamodbiface/interface.go | 12 - service/dynamodbstreams/api.go | 12 +- service/ec2/api.go | 1656 +++++++----- service/ec2/ec2iface/interface.go | 33 - service/ecr/api.go | 300 ++- service/ecr/ecriface/interface.go | 10 - service/ecs/api.go | 561 ++-- service/ecs/ecsiface/interface.go | 18 - service/efs/api.go | 33 +- service/elasticache/api.go | 1056 ++++---- .../elasticache/elasticacheiface/interface.go | 36 - service/elasticbeanstalk/api.go | 207 +- .../elasticbeanstalkiface/interface.go | 4 - service/elasticsearchservice/api.go | 190 +- .../elasticsearchserviceiface/interface.go | 7 - service/elastictranscoder/api.go | 347 +-- .../elastictranscoderiface/interface.go | 12 - service/elb/api.go | 165 +- service/elb/elbiface/interface.go | 3 - service/elbv2/api.go | 336 +-- service/elbv2/elbv2iface/interface.go | 9 - service/emr/api.go | 549 ++-- service/emr/emriface/interface.go | 18 - service/firehose/api.go | 21 +- service/gamelift/api.go | 192 +- service/glacier/api.go | 411 +-- service/glacier/glacieriface/interface.go | 12 - service/glue/api.go | 1239 ++++----- service/glue/glueiface/interface.go | 40 - service/greengrass/api.go | 222 +- service/guardduty/api.go | 579 ++-- service/guardduty/guarddutyiface/interface.go | 19 - service/health/api.go | 314 ++- service/health/healthiface/interface.go | 13 - service/iam/api.go | 2394 +++++++++-------- service/iam/iamiface/interface.go | 78 - service/inspector/api.go | 723 ++--- service/inspector/inspectoriface/interface.go | 25 - service/iot/api.go | 369 ++- service/iotdataplane/api.go | 12 +- service/iotjobsdataplane/api.go | 12 +- service/kinesis/api.go | 222 +- service/kinesis/kinesisiface/interface.go | 6 - service/kinesisanalytics/api.go | 51 +- service/kinesisvideo/api.go | 30 +- service/kinesisvideoarchivedmedia/api.go | 6 +- service/kinesisvideomedia/api.go | 3 +- service/kms/api.go | 417 +-- service/kms/kmsiface/interface.go | 13 - service/lambda/api.go | 246 +- service/lambda/lambdaiface/interface.go | 7 - service/lexmodelbuildingservice/api.go | 882 +++--- .../lexmodelbuildingserviceiface/interface.go | 31 - service/lexruntimeservice/api.go | 6 +- service/lightsail/api.go | 213 +- service/machinelearning/api.go | 396 +-- .../machinelearningiface/interface.go | 12 - service/marketplacecommerceanalytics/api.go | 6 +- service/marketplaceentitlementservice/api.go | 3 +- service/marketplacemetering/api.go | 9 +- service/mediaconvert/api.go | 60 +- service/medialive/api.go | 264 +- service/medialive/medialiveiface/interface.go | 10 - service/mediapackage/api.go | 181 +- .../mediapackageiface/interface.go | 7 - service/mediastore/api.go | 21 +- service/mediastoredata/api.go | 15 +- service/migrationhub/api.go | 48 +- service/mobile/api.go | 175 +- service/mobile/mobileiface/interface.go | 7 - service/mobileanalytics/api.go | 3 +- service/mq/api.go | 51 +- service/mturk/api.go | 897 +++--- service/mturk/mturkiface/interface.go | 31 - service/opsworks/api.go | 297 +- service/opsworks/opsworksiface/interface.go | 3 - service/opsworkscm/api.go | 45 +- service/organizations/api.go | 1140 ++++---- .../organizationsiface/interface.go | 40 - service/pinpoint/api.go | 180 +- service/polly/api.go | 18 +- service/pricing/api.go | 231 +- service/pricing/pricingiface/interface.go | 10 - service/rds/api.go | 1599 +++++------ service/rds/rdsiface/interface.go | 51 - service/redshift/api.go | 1359 +++++----- service/redshift/redshiftiface/interface.go | 45 - service/rekognition/api.go | 801 +++--- .../rekognition/rekognitioniface/interface.go | 28 - service/resourcegroups/api.go | 258 +- .../resourcegroupsiface/interface.go | 10 - service/resourcegroupstaggingapi/api.go | 249 +- .../interface.go | 10 - service/route53/api.go | 402 +-- service/route53/route53iface/interface.go | 9 - service/route53domains/api.go | 220 +- .../route53domainsiface/interface.go | 7 - service/s3/api.go | 621 +++-- service/s3/s3iface/interface.go | 15 - service/s3/s3manager/batch.go | 20 +- service/s3/s3manager/batch_test.go | 42 +- service/sagemaker/api.go | 555 ++-- service/sagemaker/sagemakeriface/interface.go | 18 - service/sagemakerruntime/api.go | 3 +- .../serverlessapplicationrepository/api.go | 27 +- service/servicecatalog/api.go | 939 +++---- .../servicecatalogiface/interface.go | 31 - service/servicediscovery/api.go | 441 ++- .../servicediscoveryiface/interface.go | 16 - service/ses/api.go | 366 +-- service/ses/sesiface/interface.go | 6 - service/sfn/api.go | 369 +-- service/sfn/sfniface/interface.go | 13 - service/shield/api.go | 30 +- service/simpledb/api.go | 178 +- service/simpledb/simpledbiface/interface.go | 7 - service/sms/api.go | 329 ++- service/sms/smsiface/interface.go | 13 - service/snowball/api.go | 207 +- service/snowball/snowballiface/interface.go | 7 - service/sns/api.go | 460 ++-- service/sns/snsiface/interface.go | 16 - service/sqs/api.go | 60 +- service/ssm/api.go | 993 +++---- service/ssm/ssmiface/interface.go | 28 - service/storagegateway/api.go | 657 ++--- .../storagegatewayiface/interface.go | 19 - service/sts/api.go | 21 +- service/support/api.go | 198 +- service/support/supportiface/interface.go | 7 - service/swf/api.go | 639 ++--- service/swf/swfiface/interface.go | 22 - service/translate/api.go | 3 +- service/waf/api.go | 198 +- service/wafregional/api.go | 210 +- service/workdocs/api.go | 354 +-- service/workdocs/workdocsiface/interface.go | 10 - service/workmail/api.go | 528 ++-- service/workmail/workmailiface/interface.go | 19 - service/workspaces/api.go | 276 +- .../workspaces/workspacesiface/interface.go | 10 - service/xray/api.go | 314 ++- service/xray/xrayiface/interface.go | 13 - 226 files changed, 24706 insertions(+), 23925 deletions(-) create mode 100644 example/service/s3/mockPaginator/mockPaginator.go create mode 100644 example/service/s3/mockPaginator/mockPaginator_test.go diff --git a/aws/request_pagination.go b/aws/request_pagination.go index e7edaace165..15594c900d4 100644 --- a/aws/request_pagination.go +++ b/aws/request_pagination.go @@ -1,31 +1,29 @@ package aws import ( - "reflect" "sync/atomic" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) -// A Pagination provides paginating of SDK API operations which are paginatable. +// A Pager provides paginating of SDK API operations which are paginatable. // Generally you should not use this type directly, but use the "Pages" API // operations method to automatically perform pagination for you. Such as, // "S3.ListObjectsPages", and "S3.ListObjectsPagesWithContext" methods. // -// Pagination differs from a Paginator type in that pagination is the type that +// Pagier differs from a Paginator type in that pagination is the type that // does the pagination between API operations, and Paginator defines the // configuration that will be used per page request. // -// cont := true -// for p.Next() && cont { -// data := p.Page().(*s3.ListObjectsOutput) +// for p.Next() { +// data := p.CurrentPage().(*s3.ListObjectsOutput) // // process the page's data // } // return p.Err() // // See service client API operation Pages methods for examples how the SDK will -// use the Pagination type. -type Pagination struct { +// use the Pager type. +type Pager struct { // Function to return a Request value for each pagination request. // Any configuration or handlers that need to be applied to the request // prior to getting the next page should be done here before the request @@ -42,24 +40,24 @@ type Pagination struct { curPage interface{} } -// HasNextPage will return true if Pagination is able to determine that the API +// hasNextPage will return true if Pager is able to determine that the API // operation has additional pages. False will be returned if there are no more // pages remaining. // // Will always return true if Next has not been called yet. -func (p *Pagination) HasNextPage() bool { +func (p *Pager) hasNextPage() bool { return !(p.started && len(p.nextTokens) == 0) } -// Err returns the error Pagination encountered when retrieving the next page. -func (p *Pagination) Err() error { +// Err returns the error Pager encountered when retrieving the next page. +func (p *Pager) Err() error { return p.err } -// Page returns the current page. Page should only be called after a successful +// CurrentPage returns the current page. Page should only be called after a successful // call to Next. It is undefined what Page will return if Page is called after // Next returns false. -func (p *Pagination) Page() interface{} { +func (p *Pager) CurrentPage() interface{} { return p.curPage } @@ -71,8 +69,8 @@ func (p *Pagination) Page() interface{} { // to be cast to the API operation's output type. // // Use the Err method to determine if an error occurred if Page returns false. -func (p *Pagination) Next() bool { - if !p.HasNextPage() { +func (p *Pager) Next() bool { + if !p.hasNextPage() { return false } @@ -105,7 +103,7 @@ func (p *Pagination) Next() bool { // should be paginated. This type is used by the API service models to define // the generated pagination config for service APIs. // -// The Pagination type is what provides iterating between pages of an API. It +// The Pager type is what provides iterating between pages of an API. It // is only used to store the token metadata the SDK should use for performing // pagination. type Paginator struct { @@ -187,65 +185,3 @@ var ( logDeprecatedNextPage int32 logDeprecatedEachPage int32 ) - -// HasNextPage returns true if this request has more pages of data available. -// -// Deprecated Use Pagination type for configurable pagination of API operations -func (r *Request) HasNextPage() bool { - logDeprecatedf(r.Config.Logger, &logDeprecatedHasNextPage, - "Request.HasNextPage deprecated. Use Pagination type for configurable pagination of API operations") - - return len(r.nextPageTokens()) > 0 -} - -// NextPage returns a new Request that can be executed to return the next -// page of result data. Call .Send() on this request to execute it. -// -// Deprecated Use Pagination type for configurable pagination of API operations -func (r *Request) NextPage() *Request { - logDeprecatedf(r.Config.Logger, &logDeprecatedNextPage, - "Request.NextPage deprecated. Use Pagination type for configurable pagination of API operations") - - tokens := r.nextPageTokens() - if len(tokens) == 0 { - return nil - } - - data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface() - nr := New(r.Config, r.Metadata, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data) - for i, intok := range nr.Operation.InputTokens { - awsutil.SetValueAtPath(nr.Params, intok, tokens[i]) - } - return nr -} - -// EachPage iterates over each page of a paginated request object. The fn -// parameter should be a function with the following sample signature: -// -// func(page *T, lastPage bool) bool { -// return true // return false to stop iterating -// } -// -// Where "T" is the structure type matching the output structure of the given -// operation. For example, a request object generated by -// DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput -// as the structure "T". The lastPage value represents whether the page is -// the last page of data or not. The return value of this function should -// return true to keep iterating or false to stop. -// -// Deprecated Use Pagination type for configurable pagination of API operations -func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error { - logDeprecatedf(r.Config.Logger, &logDeprecatedEachPage, - "Request.EachPage deprecated. Use Pagination type for configurable pagination of API operations") - - for page := r; page != nil; page = page.NextPage() { - if err := page.Send(); err != nil { - return err - } - if getNextPage := fn(page.Data, !page.HasNextPage()); !getNextPage { - return page.Error - } - } - - return nil -} diff --git a/aws/request_pagination_test.go b/aws/request_pagination_test.go index c61daa3f30b..18eebffa238 100644 --- a/aws/request_pagination_test.go +++ b/aws/request_pagination_test.go @@ -1,678 +1,311 @@ package aws_test import ( - "reflect" "testing" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/awstesting" + "github.com/aws/aws-sdk-go-v2/aws/defaults" "github.com/aws/aws-sdk-go-v2/internal/awstesting/unit" - "github.com/aws/aws-sdk-go-v2/service/dynamodb" - "github.com/aws/aws-sdk-go-v2/service/route53" - "github.com/aws/aws-sdk-go-v2/service/s3" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) -// Use DynamoDB methods for simplicity -func TestPaginationQueryPage(t *testing.T) { - db := dynamodb.New(unit.Config()) - tokens, pages, numPages, gotToEnd := []map[string]dynamodb.AttributeValue{}, []map[string]dynamodb.AttributeValue{}, 0, false +func TestPagination(t *testing.T) { + type mockInput struct { + Foo *string + } - reqNum := 0 - resps := []*dynamodb.QueryOutput{ + type mockOutput struct { + Bar *string + NextToken *string + } + + cases := []struct { + input *mockInput + resps []*mockOutput + }{ { - LastEvaluatedKey: map[string]dynamodb.AttributeValue{"key": {S: aws.String("key1")}}, - Count: aws.Int64(1), - Items: []map[string]dynamodb.AttributeValue{ - { - "key": {S: aws.String("key1")}, - }, + input: &mockInput{ + Foo: aws.String("foo"), + }, + resps: []*mockOutput{ + {aws.String("1"), aws.String("token")}, + {aws.String("2"), aws.String("token")}, + {aws.String("3"), aws.String("")}, + {aws.String("4"), aws.String("token")}, }, }, { - LastEvaluatedKey: map[string]dynamodb.AttributeValue{"key": {S: aws.String("key2")}}, - Count: aws.Int64(1), - Items: []map[string]dynamodb.AttributeValue{ - { - "key": {S: aws.String("key2")}, - }, + input: &mockInput{ + Foo: aws.String("foo"), + }, + resps: []*mockOutput{ + {aws.String("1"), aws.String("token")}, + {aws.String("2"), aws.String("token")}, + {aws.String("3"), nil}, + {aws.String("4"), aws.String("token")}, }, }, { - LastEvaluatedKey: map[string]dynamodb.AttributeValue{}, - Count: aws.Int64(1), - Items: []map[string]dynamodb.AttributeValue{ - { - "key": {S: aws.String("key3")}, - }, + input: nil, + resps: []*mockOutput{ + {aws.String("1"), aws.String("token")}, + {aws.String("2"), aws.String("token")}, + {aws.String("3"), nil}, + {aws.String("4"), aws.String("token")}, }, }, } - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *aws.Request) { - in := r.Params.(*dynamodb.QueryInput) - if in == nil { - tokens = append(tokens, nil) - } else if len(in.ExclusiveStartKey) != 0 { - tokens = append(tokens, in.ExclusiveStartKey) - } - }) - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.QueryInput{ - Limit: aws.Int64(2), - TableName: aws.String("tablename"), - } - err := db.QueryPages(params, func(p *dynamodb.QueryOutput, last bool) bool { - numPages++ - for _, item := range p.Items { - pages = append(pages, item) - } - if last { - if gotToEnd { - t.Fatal("last == true, happened twice") - } - gotToEnd = true - } - return true - }) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - if e, a := []map[string]dynamodb.AttributeValue{ - {"key": {S: aws.String("key1")}}, - {"key": {S: aws.String("key2")}}, - }, tokens; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - - if e, a := []map[string]dynamodb.AttributeValue{ - {"key": {S: aws.String("key1")}}, - {"key": {S: aws.String("key2")}}, - {"key": {S: aws.String("key3")}}, - }, pages; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - - if e, a := 3, numPages; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if !gotToEnd { - t.Error("did not reach of the end of the pagination") - } - if params.ExclusiveStartKey != nil { - t.Errorf("expected a nil value, but received %v", params.ExclusiveStartKey) + retryer := aws.DefaultRetryer{2} + op := aws.Operation{ + Name: "Operation", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + }, } -} -// Use DynamoDB methods for simplicity -func TestPagination(t *testing.T) { - db := dynamodb.New(unit.Config()) - tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false + for _, c := range cases { + resps := c.resps + input := c.input - reqNum := 0 - resps := []*dynamodb.ListTablesOutput{ - {TableNames: []string{"Table1", "Table2"}, LastEvaluatedTableName: aws.String("Table2")}, - {TableNames: []string{"Table3", "Table4"}, LastEvaluatedTableName: aws.String("Table4")}, - {TableNames: []string{"Table5"}}, - } + inValues := []string{} + reqNum := 0 + p := aws.Pager{ + NewRequest: func() (*aws.Request, error) { + h := defaults.Handlers() - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *aws.Request) { - in := r.Params.(*dynamodb.ListTablesInput) - if in == nil { - tokens = append(tokens, "") - } else if in.ExclusiveStartTableName != nil { - tokens = append(tokens, *in.ExclusiveStartTableName) - } - }) - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { - numPages++ - for _, t := range p.TableNames { - pages = append(pages, t) - } - if last { - if gotToEnd { - t.Fatal("last == true, happened twice") - } - gotToEnd = true + var inCpy *mockInput + var tmp mockInput + if input != nil { + tmp = *input + inCpy = &tmp + } + var output mockOutput + req := aws.New(unit.Config(), aws.Metadata{}, h, retryer, &op, inCpy, &output) + req.Handlers.Send.Clear() + req.Handlers.Unmarshal.Clear() + req.Handlers.UnmarshalMeta.Clear() + req.Handlers.ValidateResponse.Clear() + req.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + r.Data = resps[reqNum] + reqNum++ + }) + req.Handlers.Build.PushBack(func(r *aws.Request) { + in := r.Params.(*mockInput) + if in == nil { + inValues = append(inValues, "") + } else if in.Foo != nil { + inValues = append(inValues, *in.Foo) + } + }) + req.SetContext(aws.BackgroundContext()) + + return req, nil + }, } - return true - }) - - if e, a := []string{"Table2", "Table4"}, tokens; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := 3, numPages; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if !gotToEnd { - t.Error("did not reach of the end of the pagination") - } - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if params.ExclusiveStartTableName != nil { - t.Errorf("expected nil value, but received %v", params.ExclusiveStartTableName) - } -} - -// Use DynamoDB methods for simplicity -func TestPaginationEachPage(t *testing.T) { - db := dynamodb.New(unit.Config()) - tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false - - reqNum := 0 - resps := []*dynamodb.ListTablesOutput{ - {TableNames: []string{"Table1", "Table2"}, LastEvaluatedTableName: aws.String("Table2")}, - {TableNames: []string{"Table3", "Table4"}, LastEvaluatedTableName: aws.String("Table4")}, - {TableNames: []string{"Table5"}}, - } - - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *aws.Request) { - in := r.Params.(*dynamodb.ListTablesInput) - if in == nil { - tokens = append(tokens, "") - } else if in.ExclusiveStartTableName != nil { - tokens = append(tokens, *in.ExclusiveStartTableName) + results := []*string{} + for p.Next() { + page := p.CurrentPage() + output := page.(*mockOutput) + results = append(results, output.Bar) } - }) - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - req := db.ListTablesRequest(params) - err := req.EachPage(func(p interface{}, last bool) bool { - numPages++ - for _, t := range p.(*dynamodb.ListTablesOutput).TableNames { - pages = append(pages, t) - } - if last { - if gotToEnd { - t.Fatal("last == true, happened twice") - } - gotToEnd = true - } - - return true - }) - if e, a := []string{"Table2", "Table4"}, tokens; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := 3, numPages; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if !gotToEnd { - t.Error("did not reach of the end of the pagination") - } - if err != nil { - t.Errorf("expected no error, but received %v", err) - } -} - -// Use DynamoDB methods for simplicity -func TestPaginationEarlyExit(t *testing.T) { - db := dynamodb.New(unit.Config()) - numPages, gotToEnd := 0, false - - reqNum := 0 - resps := []*dynamodb.ListTablesOutput{ - {TableNames: []string{"Table1", "Table2"}, LastEvaluatedTableName: aws.String("Table2")}, - {TableNames: []string{"Table3", "Table4"}, LastEvaluatedTableName: aws.String("Table4")}, - {TableNames: []string{"Table5"}}, - } - - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { - numPages++ - if numPages == 2 { - return false + if err := p.Err(); err != nil { + t.Error("unexpected error", err) } - if last { - if gotToEnd { - t.Fatal("last == true, happened twice") - } - gotToEnd = true + + expected := []*string{ + aws.String("1"), + aws.String("2"), + aws.String("3"), } - return true - }) - if e, a := 2, numPages; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if gotToEnd { - t.Error("should not have reached the end of pagination") - } - if err != nil { - t.Errorf("expected no error, but received %v", err) - } -} + if e, a := expected, results; !awsutil.DeepEqual(e, a) { + t.Log("\n-------------------------\nexpected\n-------------------------\n") + for i, v := range e { + t.Errorf("\t%d: %v", i, *v) + } -func TestSkipPagination(t *testing.T) { - client := s3.New(unit.Config()) - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = &s3.HeadBucketOutput{} - }) - - req := client.HeadBucketRequest(&s3.HeadBucketInput{Bucket: aws.String("bucket")}) - - numPages, gotToEnd := 0, false - req.EachPage(func(p interface{}, last bool) bool { - numPages++ - if last { - gotToEnd = true + t.Log("\n\n-------------------------\nactual\n-------------------------\n") + for i, v := range a { + t.Errorf("\t%d: %v", i, *v) + } } - return true - }) - if e, a := 1, numPages; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if !gotToEnd { - t.Error("did not reach of the end of the pagination") } } -// Use S3 for simplicity func TestPaginationTruncation(t *testing.T) { - client := s3.New(unit.Config()) - - reqNum := 0 - resps := []*s3.ListObjectsOutput{ - {IsTruncated: aws.Bool(true), Contents: []s3.Object{{Key: aws.String("Key1")}}}, - {IsTruncated: aws.Bool(true), Contents: []s3.Object{{Key: aws.String("Key2")}}}, - {IsTruncated: aws.Bool(false), Contents: []s3.Object{{Key: aws.String("Key3")}}}, - {IsTruncated: aws.Bool(true), Contents: []s3.Object{{Key: aws.String("Key4")}}}, + type mockInput struct { + Foo *string } - - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &s3.ListObjectsInput{Bucket: aws.String("bucket")} - - results := []string{} - err := client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { - results = append(results, *p.Contents[0].Key) - return true - }) - - if e, a := []string{"Key1", "Key2", "Key3"}, results; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - if err != nil { - t.Errorf("expected no error, but received %v", err) + input := mockInput{ + Foo: aws.String("foo"), } - // Try again without truncation token at all - reqNum = 0 - resps[1].IsTruncated = nil - resps[2].IsTruncated = aws.Bool(true) - results = []string{} - err = client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { - results = append(results, *p.Contents[0].Key) - return true - }) - - if e, a := []string{"Key1", "Key2"}, results; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - if err != nil { - t.Errorf("expected no error, but received %v", err) + type mockOutput struct { + Bar *string + NextToken *string + IsTruncated *bool } -} -func TestPaginationNilToken(t *testing.T) { - client := route53.New(unit.Config()) + resps := []*mockOutput{ + {aws.String("1"), aws.String("token"), aws.Bool(true)}, + {aws.String("2"), aws.String("token"), aws.Bool(true)}, + {aws.String("3"), aws.String(""), aws.Bool(false)}, + {aws.String("4"), aws.String(""), aws.Bool(true)}, + } reqNum := 0 - resps := []*route53.ListResourceRecordSetsOutput{ + retryer := aws.DefaultRetryer{2} + ops := []aws.Operation{ { - ResourceRecordSets: []route53.ResourceRecordSet{ - {Name: aws.String("first.example.com.")}, + Name: "Operation", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + TruncationToken: "IsTruncated", }, - IsTruncated: aws.Bool(true), - NextRecordName: aws.String("second.example.com."), - NextRecordType: route53.RRTypeMx, - NextRecordIdentifier: aws.String("second"), - MaxItems: aws.String("1"), }, { - ResourceRecordSets: []route53.ResourceRecordSet{ - {Name: aws.String("second.example.com.")}, + Name: "Operation", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + TruncationToken: "IsTruncated", }, - IsTruncated: aws.Bool(true), - NextRecordName: aws.String("third.example.com."), - NextRecordType: route53.RRTypeMx, - MaxItems: aws.String("1"), }, { - ResourceRecordSets: []route53.ResourceRecordSet{ - {Name: aws.String("third.example.com.")}, + Name: "Operation", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + TruncationToken: "IsTruncated", + }, + }, + { + Name: "Operation", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + TruncationToken: "IsTruncated", }, - IsTruncated: aws.Bool(false), - MaxItems: aws.String("1"), }, } - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - - idents := []string{} - client.Handlers.Build.PushBack(func(r *aws.Request) { - p := r.Params.(*route53.ListResourceRecordSetsInput) - idents = append(idents, aws.StringValue(p.StartRecordIdentifier)) - - }) - client.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &route53.ListResourceRecordSetsInput{ - HostedZoneId: aws.String("id-zone"), + + p := aws.Pager{ + NewRequest: func() (*aws.Request, error) { + h := defaults.Handlers() + + tmp := input + inCpy := &tmp + op := ops[reqNum] + + var output mockOutput + req := aws.New(unit.Config(), aws.Metadata{}, h, retryer, &op, inCpy, &output) + req.Handlers.Send.Clear() + req.Handlers.Unmarshal.Clear() + req.Handlers.UnmarshalMeta.Clear() + req.Handlers.ValidateResponse.Clear() + req.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + output := resps[reqNum] + r.Data = output + reqNum++ + }) + req.SetContext(aws.BackgroundContext()) + + return req, nil + }, } results := []string{} - err := client.ListResourceRecordSetsPages(params, func(p *route53.ListResourceRecordSetsOutput, last bool) bool { - results = append(results, *p.ResourceRecordSets[0].Name) - return true - }) + for p.Next() { + page := p.CurrentPage() + output := page.(*mockOutput) + results = append(results, *output.Bar) + } - if err != nil { + if err := p.Err(); err != nil { t.Errorf("expected no error, but received %v", err) } - if e, a := []string{"", "second", ""}, idents; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := []string{"first.example.com.", "second.example.com.", "third.example.com."}, results; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } -} - -func TestPaginationNilInput(t *testing.T) { - // Code generation doesn't have a great way to verify the code is correct - // other than being run via unit tests in the SDK. This should be fixed - // So code generation can be validated independently. - - client := s3.New(unit.Config()) - client.Handlers.Validate.Clear() - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = &s3.ListObjectsOutput{} - }) - - gotToEnd := false - numPages := 0 - err := client.ListObjectsPages(nil, func(p *s3.ListObjectsOutput, last bool) bool { - numPages++ - if last { - gotToEnd = true - } - return true - }) - if err != nil { - t.Fatalf("expect no error, but got %v", err) + if e, a := 3, len(results); e != a { + t.Errorf("expected %d, but received %d", e, a) } - if e, a := 1, numPages; e != a { - t.Errorf("expect %d number pages but got %d", e, a) - } - if !gotToEnd { - t.Errorf("expect to of gotten to end, did not") - } -} - -func TestPaginationWithContextNilInput(t *testing.T) { - // Code generation doesn't have a great way to verify the code is correct - // other than being run via unit tests in the SDK. This should be fixed - // So code generation can be validated independently. - - client := s3.New(unit.Config()) - client.Handlers.Validate.Clear() - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = &s3.ListObjectsOutput{} - }) - - gotToEnd := false - numPages := 0 - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - err := client.ListObjectsPagesWithContext(ctx, nil, func(p *s3.ListObjectsOutput, last bool) bool { - numPages++ - if last { - gotToEnd = true - } - return true - }) - if err != nil { - t.Fatalf("expect no error, but got %v", err) - } - if e, a := 1, numPages; e != a { - t.Errorf("expect %d number pages but got %d", e, a) - } - if !gotToEnd { - t.Errorf("expect to of gotten to end, did not") + if e, a := []string{"1", "2", "3"}, results; !awsutil.DeepEqual(e, a) { + t.Errorf("expected %v, but received %v", e, a) } } -func TestPagination_Standalone(t *testing.T) { - type testPageInput struct { - NextToken *string +func BenchmarkPagination(b *testing.B) { + type mockInput struct { + Foo *string } - type testPageOutput struct { - Value *string + + type mockOutput struct { + Bar *string NextToken *string } - type testCase struct { - Value, PrevToken, NextToken *string - } - cases := map[string][]testCase{ - "nil NextToken": { - testCase{aws.String("FirstValue"), aws.String("InitalToken"), aws.String("FirstToken")}, - testCase{aws.String("SecondValue"), aws.String("FirstToken"), aws.String("SecondToken")}, - testCase{aws.String("ThirdValue"), aws.String("SecondToken"), nil}, - }, - "zero NextToken": { - testCase{aws.String("FirstValue"), aws.String("InitalToken"), aws.String("FirstToken")}, - testCase{aws.String("SecondValue"), aws.String("FirstToken"), aws.String("SecondToken")}, - testCase{aws.String("ThirdValue"), aws.String("SecondToken"), aws.String("")}, + input := &mockInput{ + Foo: aws.String("foo"), + } + resps := []*mockOutput{ + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("1"), aws.String("token")}, + {aws.String("3"), aws.String("")}, + } + + retryer := aws.DefaultRetryer{2} + op := aws.Operation{ + Name: "Operation", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, }, } - for cName, c := range cases { - t.Run(cName, func(t *testing.T) { - input := testPageInput{ - NextToken: c[0].PrevToken, - } - - svc := awstesting.NewClient(unit.Config()) - i := 0 - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - r := svc.NewRequest( - &aws.Operation{ - Name: "Operation", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - }, - }, - &input, &testPageOutput{}, - ) - // Setup handlers for testing - r.Handlers.Clear() - r.Handlers.Build.PushBack(func(req *aws.Request) { - if e, a := len(c), i; a >= e { - t.Fatalf("expect no more than %d requests, got %d", e, a) - } - in := req.Params.(*testPageInput) - if e, a := aws.StringValue(c[i].PrevToken), aws.StringValue(in.NextToken); e != a { - t.Errorf("%d, expect NextToken input %q, got %q", i, e, a) - } - }) - r.Handlers.Unmarshal.PushBack(func(req *aws.Request) { - out := &testPageOutput{ - Value: c[i].Value, - } - if c[i].NextToken != nil { - next := *c[i].NextToken - out.NextToken = aws.String(next) - } - req.Data = out - }) - return r, nil - }, - } - - for p.Next() { - data := p.Page().(*testPageOutput) - - if e, a := aws.StringValue(c[i].Value), aws.StringValue(data.Value); e != a { - t.Errorf("%d, expect Value to be %q, got %q", i, e, a) - } - if e, a := aws.StringValue(c[i].NextToken), aws.StringValue(data.NextToken); e != a { - t.Errorf("%d, expect NextToken to be %q, got %q", i, e, a) - } - - i++ - } - if e, a := len(c), i; e != a { - t.Errorf("expected to process %d pages, did %d", e, a) - } - if err := p.Err(); err != nil { - t.Fatalf("%d, expected no error, got %v", i, err) - } - }) - } -} - -// Benchmarks -var benchResps = []dynamodb.ListTablesOutput{ - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE", "NXT"}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []string{"TABLE"}}, -} - -var benchDb = func() *dynamodb.DynamoDB { - db := dynamodb.New(unit.Config()) - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - return db -} - -func BenchmarkCodegenIterator(b *testing.B) { reqNum := 0 - db := benchDb() - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = benchResps[reqNum] - reqNum++ - }) - - input := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - iter := func(fn func(*dynamodb.ListTablesOutput, bool) bool) error { - page := db.ListTablesRequest(input) - for ; page.Request != nil; page.Request = page.NextPage() { - page.Send() - out := page.Data.(*dynamodb.ListTablesOutput) - if result := fn(out, !page.HasNextPage()); page.Error != nil || !result { - return page.Error + p := aws.Pager{ + NewRequest: func() (*aws.Request, error) { + h := defaults.Handlers() + + var inCpy *mockInput + var tmp mockInput + if input != nil { + tmp = *input + inCpy = &tmp } - } - return nil - } - - for i := 0; i < b.N; i++ { - reqNum = 0 - iter(func(p *dynamodb.ListTablesOutput, last bool) bool { - return true - }) + var output mockOutput + req := aws.New(unit.Config(), aws.Metadata{}, h, retryer, &op, inCpy, &output) + req.Handlers.Send.Clear() + req.Handlers.Unmarshal.Clear() + req.Handlers.UnmarshalMeta.Clear() + req.Handlers.ValidateResponse.Clear() + req.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + r.Data = resps[reqNum] + reqNum++ + }) + req.SetContext(aws.BackgroundContext()) + + return req, nil + }, } -} -func BenchmarkEachPageIterator(b *testing.B) { - reqNum := 0 - db := benchDb() - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = benchResps[reqNum] - reqNum++ - }) - - input := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - for i := 0; i < b.N; i++ { - reqNum = 0 - req := db.ListTablesRequest(input) - req.EachPage(func(p interface{}, last bool) bool { - return true - }) + for p.Next() { + p.CurrentPage() } } diff --git a/example/service/s3/listObjects/listObjects.go b/example/service/s3/listObjects/listObjects.go index d65ec6e4888..8df65050a84 100644 --- a/example/service/s3/listObjects/listObjects.go +++ b/example/service/s3/listObjects/listObjects.go @@ -31,19 +31,16 @@ func main() { svc := s3.New(cfg) - i := 0 - err = svc.ListObjectsPages(&s3.ListObjectsInput{ - Bucket: &os.Args[1], - }, func(p *s3.ListObjectsOutput, last bool) (shouldContinue bool) { - fmt.Println("Page,", i) - i++ - - for _, obj := range p.Contents { - fmt.Println("Object:", *obj.Key) + req := svc.ListObjectsRequest(&s3.ListObjectsInput{Bucket: &os.Args[1]}) + p := req.Paginate() + for p.Next() { + page := p.CurrentPage() + for _, obj := range page.Contents { + fmt.Println("Object: ", *obj.Key) } - return true - }) - if err != nil { + } + + if err := p.Err(); err != nil { exitErrorf("failed to list objects, %v", err) } } diff --git a/example/service/s3/mockPaginator/mockPaginator.go b/example/service/s3/mockPaginator/mockPaginator.go new file mode 100644 index 00000000000..76701dc9845 --- /dev/null +++ b/example/service/s3/mockPaginator/mockPaginator.go @@ -0,0 +1,44 @@ +// +build example + +package main + +import ( + "fmt" + "os" + + "github.com/aws/aws-sdk-go-v2/aws/external" + "github.com/aws/aws-sdk-go-v2/service/s3" + "github.com/aws/aws-sdk-go-v2/service/s3/s3iface" +) + +func main() { + if len(os.Args) < 2 { + panic("you must specify a bucket") + } + + cfg, err := external.LoadDefaultAWSConfig() + if err != nil { + panic(fmt.Sprintf("failed to load config, %v\n", err)) + } + + bucket := os.Args[1] + svc := s3.New(cfg) + keys := getKeys(svc, bucket) + + fmt.Printf("keys for bucket %q,\n%v\n", bucket, keys) +} + +func getKeys(svc s3iface.S3API, bucket string) []string { + req := svc.ListObjectsRequest(&s3.ListObjectsInput{ + Bucket: &bucket, + }) + p := req.Paginate() + keys := []string{} + for p.Next() { + page := p.CurrentPage() + for _, obj := range page.Contents { + keys = append(keys, *obj.Key) + } + } + return keys +} diff --git a/example/service/s3/mockPaginator/mockPaginator_test.go b/example/service/s3/mockPaginator/mockPaginator_test.go new file mode 100644 index 00000000000..65ddf0fd7a9 --- /dev/null +++ b/example/service/s3/mockPaginator/mockPaginator_test.go @@ -0,0 +1,94 @@ +// +build example + +package main + +import ( + "testing" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awstesting/unit" + "github.com/aws/aws-sdk-go-v2/service/s3" +) + +type mockS3Client struct { + *s3.S3 + index int + objects []s3.ListObjectsOutput +} + +func (c *mockS3Client) ListObjectsRequest(input *s3.ListObjectsInput) s3.ListObjectsRequest { + req := c.S3.ListObjectsRequest(input) + req.Copy = func(v *s3.ListObjectsInput) s3.ListObjectsRequest { + r := c.S3.ListObjectsRequest(v) + r.Handlers.Send.Clear() + r.Handlers.Unmarshal.Clear() + r.Handlers.UnmarshalMeta.Clear() + r.Handlers.UnmarshalError.Clear() + r.Handlers.ValidateResponse.Clear() + r.Handlers.Send.PushBack(func(r *aws.Request) { + object := c.objects[c.index] + r.Data = &object + c.index++ + }) + return r + } + + return req +} + +func TestListObjectsPagination(t *testing.T) { + svc := &mockS3Client{} + objects := []s3.ListObjectsOutput{ + { + Contents: []s3.Object{ + { + Key: aws.String("1"), + }, + }, + NextMarker: aws.String("marker"), + IsTruncated: aws.Bool(true), + }, + { + Contents: []s3.Object{ + { + Key: aws.String("2"), + }, + }, + NextMarker: aws.String("marker"), + IsTruncated: aws.Bool(true), + }, + { + Contents: []s3.Object{ + { + Key: aws.String("3"), + }, + }, + IsTruncated: aws.Bool(false), + }, + { + Contents: []s3.Object{ + { + Key: aws.String("2"), + }, + }, + NextMarker: aws.String("marker"), + IsTruncated: aws.Bool(true), + }, + } + + svc.S3 = s3.New(unit.Config()) + svc.objects = objects + + keys := getKeys(svc, "foo") + expected := []string{"1", "2", "3"} + + if e, a := 3, len(keys); e != a { + t.Errorf("expected %d, but received %d", e, a) + } + + for i := 0; i < 3; i++ { + if keys[i] != expected[i] { + t.Errorf("expected %q, but received %q", expected[i], keys[i]) + } + } +} diff --git a/private/model/api/api.go b/private/model/api/api.go index a51e24f4162..f128efd22f6 100644 --- a/private/model/api/api.go +++ b/private/model/api/api.go @@ -679,20 +679,12 @@ var _ {{ .StructName }}API = (*{{ .PackageName }}.{{ .StructName }})(nil) // interface{}. Assumes that the interface is being created in a different // package than the service API's package. func (a *API) InterfaceGoCode() string { - var hasPaginator bool - for _, op := range a.Operations { - if op.Paginator != nil { - hasPaginator = true - break - } - } - a.resetImports() a.imports = map[string]bool{ path.Join(a.SvcClientImportPath, a.PackageName()): true, } - if hasPaginator || len(a.Waiters) > 0 { + if len(a.Waiters) > 0 { a.imports["github.com/aws/aws-sdk-go-v2/aws"] = true } diff --git a/private/model/api/operation.go b/private/model/api/operation.go index f4a834d7161..2b98da1fc0b 100644 --- a/private/model/api/operation.go +++ b/private/model/api/operation.go @@ -70,12 +70,14 @@ var tplOperation = template.Must(template.New("operation").Funcs(template.FuncMa "GetCrosslinkURL": GetCrosslinkURL, }).Parse(` {{ $reqType := printf "%sRequest" .ExportedName -}} +{{ $pagerType := printf "%sPager" .ExportedName -}} const op{{ .ExportedName }} = "{{ .Name }}" // {{ $reqType }} is a API request type for the {{ .ExportedName }} API operation. type {{ $reqType}} struct { *aws.Request Input {{ .InputRef.GoType }} + Copy func({{ .InputRef.GoType }}) {{ $reqType }} } // Send marshals and sends the {{ .ExportedName }} API request. @@ -141,64 +143,56 @@ func (c *{{ .API.StructName }}) {{ $reqType }}(input {{ .InputRef.GoType }}) ({{ {{ if ne .AuthType "" }}{{ .GetSigner }}{{ end -}} - return {{ $reqType}}{Request: req, Input: input} + return {{ $reqType}}{Request: req, Input: input, Copy: c.{{ $reqType }} } } {{ if .Paginator }} -// {{ .ExportedName }}Pages iterates over the pages of a {{ .ExportedName }} operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See {{ .ExportedName }} method for more information on how to use this operation. +// Paginate pages iterates over the pages of a {{ $reqType }} operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a {{ .ExportedName }} operation. -// pageNum := 0 -// err := client.{{ .ExportedName }}Pages(params, -// func(page {{ .OutputRef.GoType }}, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *{{ .API.StructName }}) {{ .ExportedName }}Pages(` + - `input {{ .InputRef.GoType }}, fn func({{ .OutputRef.GoType }}, bool) bool) error { - return c.{{ .ExportedName }}PagesWithContext(aws.BackgroundContext(), input, fn) -} - -// {{ .ExportedName }}PagesWithContext same as {{ .ExportedName }}Pages except -// it takes a Context and allows setting request options on the pages. +// req := client.{{ $reqType }}(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *{{ .API.StructName }}) {{ .ExportedName }}PagesWithContext(` + - `ctx aws.Context, ` + - `input {{ .InputRef.GoType }}, ` + - `fn func({{ .OutputRef.GoType }}, bool) bool, ` + - `opts ...aws.Option) error { - p := aws.Pagination { - NewRequest: func() (*aws.Request, error) { - var inCpy {{ .InputRef.GoType }} - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.{{ .ExportedName }}Request(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *{{ $reqType }}) Paginate(opts ...aws.Option) {{ $pagerType }} { + return {{ $pagerType }}{ + Pager: aws.Pager { + NewRequest: func() (*aws.Request, error) { + var inCpy {{ .InputRef.GoType }} + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().({{ .OutputRef.GoType }}), !p.HasNextPage()) - } - return p.Err() +// {{ $pagerType }} is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type {{ $pagerType }} struct { + aws.Pager +} + +func (p *{{ $pagerType}}) CurrentPage() {{ .OutputRef.GoType }} { + return p.Pager.CurrentPage().({{ .OutputRef.GoType }}) } + {{ end }} `)) @@ -214,13 +208,7 @@ func (o *Operation) GoCode() string { } // tplInfSig defines the template for rendering an Operation's signature within an Interface definition. -var tplInfSig = template.Must(template.New("opsig").Parse(` -{{ .ExportedName }}Request({{ .InputRef.GoTypeWithPkgName }}) {{ .API.PackageName }}.{{ .ExportedName }}Request - -{{ if .Paginator -}} -{{ .ExportedName }}Pages({{ .InputRef.GoTypeWithPkgName }}, func({{ .OutputRef.GoTypeWithPkgName }}, bool) bool) error -{{ .ExportedName }}PagesWithContext(aws.Context, {{ .InputRef.GoTypeWithPkgName }}, func({{ .OutputRef.GoTypeWithPkgName }}, bool) bool, ...aws.Option) error -{{- end }} +var tplInfSig = template.Must(template.New("opsig").Parse(`{{ .ExportedName }}Request({{ .InputRef.GoTypeWithPkgName }}) {{ .API.PackageName }}.{{ .ExportedName }}Request `)) // InterfaceSignature returns a string representing the Operation's interface{} diff --git a/private/model/api/passes.go b/private/model/api/passes.go index 8b7e2cb3d30..b248d33264d 100644 --- a/private/model/api/passes.go +++ b/private/model/api/passes.go @@ -252,10 +252,14 @@ func (a *API) renameExportable() { // specific name. func (a *API) renameCollidingFields() { for _, v := range a.Shapes { - namesWithSet := map[string]struct{}{} + namesWithFixes := map[string]struct{}{} for k, field := range v.MemberRefs { if strings.HasPrefix(k, "Set") { - namesWithSet[k] = struct{}{} + namesWithFixes[k] = struct{}{} + } + + if strings.HasSuffix(k, "Pager") { + namesWithFixes[k] = struct{}{} } if collides(k) { @@ -264,10 +268,19 @@ func (a *API) renameCollidingFields() { } // checks if any field names collide with setters. - for name := range namesWithSet { - if field, ok := v.MemberRefs["Set"+name]; ok { - renameCollidingField(name, v, field) + for name := range namesWithFixes { + if strings.HasPrefix(name, "Set") { + if field, ok := v.MemberRefs["Set"+name]; ok { + renameCollidingField(name, v, field) + } } + + if strings.HasSuffix(name, "Pager") { + if field, ok := v.MemberRefs[name+"Pager"]; ok { + renameCollidingField(name, v, field) + } + } + } } } diff --git a/private/protocol/ec2query/build_test.go b/private/protocol/ec2query/build_test.go index 596f990d373..b73dc0afe6b 100644 --- a/private/protocol/ec2query/build_test.go +++ b/private/protocol/ec2query/build_test.go @@ -101,6 +101,7 @@ const opInputService1TestCaseOperation1 = "OperationName" type InputService1TestCaseOperation1Request struct { *aws.Request Input *InputService1TestShapeInputService1TestCaseOperation1Input + Copy func(*InputService1TestShapeInputService1TestCaseOperation1Input) InputService1TestCaseOperation1Request } // Send marshals and sends the InputService1TestCaseOperation1 API request. @@ -139,7 +140,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService1TestCaseOperation1Request{Request: req, Input: input} + return InputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService1TestCaseOperation1Request} } type InputService1TestShapeInputService1TestCaseOperation1Input struct { @@ -221,6 +222,7 @@ const opInputService2TestCaseOperation1 = "OperationName" type InputService2TestCaseOperation1Request struct { *aws.Request Input *InputService2TestShapeInputService2TestCaseOperation1Input + Copy func(*InputService2TestShapeInputService2TestCaseOperation1Input) InputService2TestCaseOperation1Request } // Send marshals and sends the InputService2TestCaseOperation1 API request. @@ -259,7 +261,7 @@ func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService2TestCaseOperation1Request{Request: req, Input: input} + return InputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService2TestCaseOperation1Request} } type InputService2TestShapeInputService2TestCaseOperation1Input struct { @@ -343,6 +345,7 @@ const opInputService3TestCaseOperation1 = "OperationName" type InputService3TestCaseOperation1Request struct { *aws.Request Input *InputService3TestShapeInputService3TestCaseOperation1Input + Copy func(*InputService3TestShapeInputService3TestCaseOperation1Input) InputService3TestCaseOperation1Request } // Send marshals and sends the InputService3TestCaseOperation1 API request. @@ -381,7 +384,7 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService3TestCaseOperation1Request{Request: req, Input: input} + return InputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService3TestCaseOperation1Request} } type InputService3TestShapeInputService3TestCaseOperation1Input struct { @@ -467,6 +470,7 @@ const opInputService4TestCaseOperation1 = "OperationName" type InputService4TestCaseOperation1Request struct { *aws.Request Input *InputService4TestShapeInputService4TestCaseOperation1Input + Copy func(*InputService4TestShapeInputService4TestCaseOperation1Input) InputService4TestCaseOperation1Request } // Send marshals and sends the InputService4TestCaseOperation1 API request. @@ -505,7 +509,7 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService4TestCaseOperation1Request{Request: req, Input: input} + return InputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService4TestCaseOperation1Request} } type InputService4TestShapeInputService4TestCaseOperation1Input struct { @@ -591,6 +595,7 @@ const opInputService5TestCaseOperation1 = "OperationName" type InputService5TestCaseOperation1Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation1Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation1Input) InputService5TestCaseOperation1Request } // Send marshals and sends the InputService5TestCaseOperation1 API request. @@ -629,7 +634,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation1Request{Request: req, Input: input} + return InputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation1Request} } type InputService5TestShapeInputService5TestCaseOperation1Input struct { @@ -709,6 +714,7 @@ const opInputService6TestCaseOperation1 = "OperationName" type InputService6TestCaseOperation1Request struct { *aws.Request Input *InputService6TestShapeInputService6TestCaseOperation1Input + Copy func(*InputService6TestShapeInputService6TestCaseOperation1Input) InputService6TestCaseOperation1Request } // Send marshals and sends the InputService6TestCaseOperation1 API request. @@ -747,7 +753,7 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService6TestCaseOperation1Request{Request: req, Input: input} + return InputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService6TestCaseOperation1Request} } type InputService6TestShapeInputService6TestCaseOperation1Input struct { @@ -827,6 +833,7 @@ const opInputService7TestCaseOperation1 = "OperationName" type InputService7TestCaseOperation1Request struct { *aws.Request Input *InputService7TestShapeInputService7TestCaseOperation1Input + Copy func(*InputService7TestShapeInputService7TestCaseOperation1Input) InputService7TestCaseOperation1Request } // Send marshals and sends the InputService7TestCaseOperation1 API request. @@ -865,7 +872,7 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService7TestCaseOperation1Request{Request: req, Input: input} + return InputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService7TestCaseOperation1Request} } type InputService7TestShapeInputService7TestCaseOperation1Input struct { @@ -946,6 +953,7 @@ const opInputService8TestCaseOperation1 = "OperationName" type InputService8TestCaseOperation1Request struct { *aws.Request Input *InputService8TestShapeInputService8TestCaseOperation1Input + Copy func(*InputService8TestShapeInputService8TestCaseOperation1Input) InputService8TestCaseOperation1Request } // Send marshals and sends the InputService8TestCaseOperation1 API request. @@ -984,7 +992,7 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService8TestCaseOperation1Request{Request: req, Input: input} + return InputService8TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService8TestCaseOperation1Request} } type InputService8TestShapeInputService8TestCaseOperation1Input struct { @@ -1064,6 +1072,7 @@ const opInputService9TestCaseOperation1 = "OperationName" type InputService9TestCaseOperation1Request struct { *aws.Request Input *InputService9TestShapeInputService9TestCaseOperation2Input + Copy func(*InputService9TestShapeInputService9TestCaseOperation2Input) InputService9TestCaseOperation1Request } // Send marshals and sends the InputService9TestCaseOperation1 API request. @@ -1102,7 +1111,7 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService9TestCaseOperation1Request{Request: req, Input: input} + return InputService9TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService9TestCaseOperation1Request} } const opInputService9TestCaseOperation2 = "OperationName" @@ -1111,6 +1120,7 @@ const opInputService9TestCaseOperation2 = "OperationName" type InputService9TestCaseOperation2Request struct { *aws.Request Input *InputService9TestShapeInputService9TestCaseOperation2Input + Copy func(*InputService9TestShapeInputService9TestCaseOperation2Input) InputService9TestCaseOperation2Request } // Send marshals and sends the InputService9TestCaseOperation2 API request. @@ -1149,7 +1159,7 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService9TestCaseOperation2Request{Request: req, Input: input} + return InputService9TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService9TestCaseOperation2Request} } type InputService9TestShapeInputService9TestCaseOperation1Output struct { @@ -1240,6 +1250,7 @@ const opInputService10TestCaseOperation1 = "OperationName" type InputService10TestCaseOperation1Request struct { *aws.Request Input *InputService10TestShapeInputService10TestCaseOperation2Input + Copy func(*InputService10TestShapeInputService10TestCaseOperation2Input) InputService10TestCaseOperation1Request } // Send marshals and sends the InputService10TestCaseOperation1 API request. @@ -1278,7 +1289,7 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService10TestCaseOperation1Request{Request: req, Input: input} + return InputService10TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService10TestCaseOperation1Request} } const opInputService10TestCaseOperation2 = "OperationName" @@ -1287,6 +1298,7 @@ const opInputService10TestCaseOperation2 = "OperationName" type InputService10TestCaseOperation2Request struct { *aws.Request Input *InputService10TestShapeInputService10TestCaseOperation2Input + Copy func(*InputService10TestShapeInputService10TestCaseOperation2Input) InputService10TestCaseOperation2Request } // Send marshals and sends the InputService10TestCaseOperation2 API request. @@ -1325,7 +1337,7 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService10TestCaseOperation2Request{Request: req, Input: input} + return InputService10TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService10TestCaseOperation2Request} } type InputService10TestShapeInputService10TestCaseOperation1Output struct { diff --git a/private/protocol/ec2query/unmarshal_test.go b/private/protocol/ec2query/unmarshal_test.go index 80bad0ae03c..66394fa5812 100644 --- a/private/protocol/ec2query/unmarshal_test.go +++ b/private/protocol/ec2query/unmarshal_test.go @@ -101,6 +101,7 @@ const opOutputService1TestCaseOperation1 = "OperationName" type OutputService1TestCaseOperation1Request struct { *aws.Request Input *OutputService1TestShapeOutputService1TestCaseOperation1Input + Copy func(*OutputService1TestShapeOutputService1TestCaseOperation1Input) OutputService1TestCaseOperation1Request } // Send marshals and sends the OutputService1TestCaseOperation1 API request. @@ -137,7 +138,7 @@ func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService1TestCaseOperation1Request{Request: req, Input: input} + return OutputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService1TestCaseOperation1Request} } type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { @@ -231,6 +232,7 @@ const opOutputService2TestCaseOperation1 = "OperationName" type OutputService2TestCaseOperation1Request struct { *aws.Request Input *OutputService2TestShapeOutputService2TestCaseOperation1Input + Copy func(*OutputService2TestShapeOutputService2TestCaseOperation1Input) OutputService2TestCaseOperation1Request } // Send marshals and sends the OutputService2TestCaseOperation1 API request. @@ -267,7 +269,7 @@ func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService2TestCaseOperation1Request{Request: req, Input: input} + return OutputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService2TestCaseOperation1Request} } type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { @@ -348,6 +350,7 @@ const opOutputService3TestCaseOperation1 = "OperationName" type OutputService3TestCaseOperation1Request struct { *aws.Request Input *OutputService3TestShapeOutputService3TestCaseOperation1Input + Copy func(*OutputService3TestShapeOutputService3TestCaseOperation1Input) OutputService3TestCaseOperation1Request } // Send marshals and sends the OutputService3TestCaseOperation1 API request. @@ -384,7 +387,7 @@ func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService3TestCaseOperation1Request{Request: req, Input: input} + return OutputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService3TestCaseOperation1Request} } type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { @@ -464,6 +467,7 @@ const opOutputService4TestCaseOperation1 = "OperationName" type OutputService4TestCaseOperation1Request struct { *aws.Request Input *OutputService4TestShapeOutputService4TestCaseOperation1Input + Copy func(*OutputService4TestShapeOutputService4TestCaseOperation1Input) OutputService4TestCaseOperation1Request } // Send marshals and sends the OutputService4TestCaseOperation1 API request. @@ -500,7 +504,7 @@ func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService4TestCaseOperation1Request{Request: req, Input: input} + return OutputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService4TestCaseOperation1Request} } type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { @@ -580,6 +584,7 @@ const opOutputService5TestCaseOperation1 = "OperationName" type OutputService5TestCaseOperation1Request struct { *aws.Request Input *OutputService5TestShapeOutputService5TestCaseOperation1Input + Copy func(*OutputService5TestShapeOutputService5TestCaseOperation1Input) OutputService5TestCaseOperation1Request } // Send marshals and sends the OutputService5TestCaseOperation1 API request. @@ -616,7 +621,7 @@ func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService5TestCaseOperation1Request{Request: req, Input: input} + return OutputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService5TestCaseOperation1Request} } type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { @@ -696,6 +701,7 @@ const opOutputService6TestCaseOperation1 = "OperationName" type OutputService6TestCaseOperation1Request struct { *aws.Request Input *OutputService6TestShapeOutputService6TestCaseOperation1Input + Copy func(*OutputService6TestShapeOutputService6TestCaseOperation1Input) OutputService6TestCaseOperation1Request } // Send marshals and sends the OutputService6TestCaseOperation1 API request. @@ -732,7 +738,7 @@ func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService6TestCaseOperation1Request{Request: req, Input: input} + return OutputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService6TestCaseOperation1Request} } type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { @@ -818,6 +824,7 @@ const opOutputService7TestCaseOperation1 = "OperationName" type OutputService7TestCaseOperation1Request struct { *aws.Request Input *OutputService7TestShapeOutputService7TestCaseOperation1Input + Copy func(*OutputService7TestShapeOutputService7TestCaseOperation1Input) OutputService7TestCaseOperation1Request } // Send marshals and sends the OutputService7TestCaseOperation1 API request. @@ -854,7 +861,7 @@ func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService7TestCaseOperation1Request{Request: req, Input: input} + return OutputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService7TestCaseOperation1Request} } type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { @@ -934,6 +941,7 @@ const opOutputService8TestCaseOperation1 = "OperationName" type OutputService8TestCaseOperation1Request struct { *aws.Request Input *OutputService8TestShapeOutputService8TestCaseOperation1Input + Copy func(*OutputService8TestShapeOutputService8TestCaseOperation1Input) OutputService8TestCaseOperation1Request } // Send marshals and sends the OutputService8TestCaseOperation1 API request. @@ -970,7 +978,7 @@ func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService8TestCaseOperation1Request{Request: req, Input: input} + return OutputService8TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService8TestCaseOperation1Request} } type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { @@ -1050,6 +1058,7 @@ const opOutputService9TestCaseOperation1 = "OperationName" type OutputService9TestCaseOperation1Request struct { *aws.Request Input *OutputService9TestShapeOutputService9TestCaseOperation1Input + Copy func(*OutputService9TestShapeOutputService9TestCaseOperation1Input) OutputService9TestCaseOperation1Request } // Send marshals and sends the OutputService9TestCaseOperation1 API request. @@ -1086,7 +1095,7 @@ func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService9TestCaseOperation1Request{Request: req, Input: input} + return OutputService9TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService9TestCaseOperation1Request} } type OutputService9TestShapeOutputService9TestCaseOperation1Input struct { @@ -1166,6 +1175,7 @@ const opOutputService10TestCaseOperation1 = "OperationName" type OutputService10TestCaseOperation1Request struct { *aws.Request Input *OutputService10TestShapeOutputService10TestCaseOperation1Input + Copy func(*OutputService10TestShapeOutputService10TestCaseOperation1Input) OutputService10TestCaseOperation1Request } // Send marshals and sends the OutputService10TestCaseOperation1 API request. @@ -1202,7 +1212,7 @@ func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService10TestCaseOperation1Request{Request: req, Input: input} + return OutputService10TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService10TestCaseOperation1Request} } type OutputService10TestShapeOutputService10TestCaseOperation1Input struct { diff --git a/private/protocol/jsonrpc/build_test.go b/private/protocol/jsonrpc/build_test.go index e991d6221af..321dd53bd0c 100644 --- a/private/protocol/jsonrpc/build_test.go +++ b/private/protocol/jsonrpc/build_test.go @@ -103,6 +103,7 @@ const opInputService1TestCaseOperation1 = "OperationName" type InputService1TestCaseOperation1Request struct { *aws.Request Input *InputService1TestShapeInputService1TestCaseOperation1Input + Copy func(*InputService1TestShapeInputService1TestCaseOperation1Input) InputService1TestCaseOperation1Request } // Send marshals and sends the InputService1TestCaseOperation1 API request. @@ -141,7 +142,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService1TestCaseOperation1Request{Request: req, Input: input} + return InputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService1TestCaseOperation1Request} } type InputService1TestShapeInputService1TestCaseOperation1Input struct { @@ -223,6 +224,7 @@ const opInputService2TestCaseOperation1 = "OperationName" type InputService2TestCaseOperation1Request struct { *aws.Request Input *InputService2TestShapeInputService2TestCaseOperation1Input + Copy func(*InputService2TestShapeInputService2TestCaseOperation1Input) InputService2TestCaseOperation1Request } // Send marshals and sends the InputService2TestCaseOperation1 API request. @@ -261,7 +263,7 @@ func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService2TestCaseOperation1Request{Request: req, Input: input} + return InputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService2TestCaseOperation1Request} } type InputService2TestShapeInputService2TestCaseOperation1Input struct { @@ -343,6 +345,7 @@ const opInputService3TestCaseOperation1 = "OperationName" type InputService3TestCaseOperation1Request struct { *aws.Request Input *InputService3TestShapeInputService3TestCaseOperation2Input + Copy func(*InputService3TestShapeInputService3TestCaseOperation2Input) InputService3TestCaseOperation1Request } // Send marshals and sends the InputService3TestCaseOperation1 API request. @@ -381,7 +384,7 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService3TestCaseOperation1Request{Request: req, Input: input} + return InputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService3TestCaseOperation1Request} } const opInputService3TestCaseOperation2 = "OperationName" @@ -390,6 +393,7 @@ const opInputService3TestCaseOperation2 = "OperationName" type InputService3TestCaseOperation2Request struct { *aws.Request Input *InputService3TestShapeInputService3TestCaseOperation2Input + Copy func(*InputService3TestShapeInputService3TestCaseOperation2Input) InputService3TestCaseOperation2Request } // Send marshals and sends the InputService3TestCaseOperation2 API request. @@ -428,7 +432,7 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService3TestCaseOperation2Request{Request: req, Input: input} + return InputService3TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService3TestCaseOperation2Request} } type InputService3TestShapeInputService3TestCaseOperation1Output struct { @@ -524,6 +528,7 @@ const opInputService4TestCaseOperation1 = "OperationName" type InputService4TestCaseOperation1Request struct { *aws.Request Input *InputService4TestShapeInputService4TestCaseOperation1Input + Copy func(*InputService4TestShapeInputService4TestCaseOperation1Input) InputService4TestCaseOperation1Request } // Send marshals and sends the InputService4TestCaseOperation1 API request. @@ -562,7 +567,7 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService4TestCaseOperation1Request{Request: req, Input: input} + return InputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService4TestCaseOperation1Request} } type InputService4TestShapeInputService4TestCaseOperation1Input struct { @@ -644,6 +649,7 @@ const opInputService5TestCaseOperation1 = "OperationName" type InputService5TestCaseOperation1Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation6Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation6Input) InputService5TestCaseOperation1Request } // Send marshals and sends the InputService5TestCaseOperation1 API request. @@ -682,7 +688,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation1Request{Request: req, Input: input} + return InputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation1Request} } const opInputService5TestCaseOperation2 = "OperationName" @@ -691,6 +697,7 @@ const opInputService5TestCaseOperation2 = "OperationName" type InputService5TestCaseOperation2Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation6Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation6Input) InputService5TestCaseOperation2Request } // Send marshals and sends the InputService5TestCaseOperation2 API request. @@ -729,7 +736,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation2Request{Request: req, Input: input} + return InputService5TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation2Request} } const opInputService5TestCaseOperation3 = "OperationName" @@ -738,6 +745,7 @@ const opInputService5TestCaseOperation3 = "OperationName" type InputService5TestCaseOperation3Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation6Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation6Input) InputService5TestCaseOperation3Request } // Send marshals and sends the InputService5TestCaseOperation3 API request. @@ -776,7 +784,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation3Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation3Request{Request: req, Input: input} + return InputService5TestCaseOperation3Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation3Request} } const opInputService5TestCaseOperation4 = "OperationName" @@ -785,6 +793,7 @@ const opInputService5TestCaseOperation4 = "OperationName" type InputService5TestCaseOperation4Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation6Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation6Input) InputService5TestCaseOperation4Request } // Send marshals and sends the InputService5TestCaseOperation4 API request. @@ -823,7 +832,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation4Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation4Request{Request: req, Input: input} + return InputService5TestCaseOperation4Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation4Request} } const opInputService5TestCaseOperation5 = "OperationName" @@ -832,6 +841,7 @@ const opInputService5TestCaseOperation5 = "OperationName" type InputService5TestCaseOperation5Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation6Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation6Input) InputService5TestCaseOperation5Request } // Send marshals and sends the InputService5TestCaseOperation5 API request. @@ -870,7 +880,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation5Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation5Request{Request: req, Input: input} + return InputService5TestCaseOperation5Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation5Request} } const opInputService5TestCaseOperation6 = "OperationName" @@ -879,6 +889,7 @@ const opInputService5TestCaseOperation6 = "OperationName" type InputService5TestCaseOperation6Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation6Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation6Input) InputService5TestCaseOperation6Request } // Send marshals and sends the InputService5TestCaseOperation6 API request. @@ -917,7 +928,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation6Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation6Request{Request: req, Input: input} + return InputService5TestCaseOperation6Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation6Request} } type InputService5TestShapeInputService5TestCaseOperation1Output struct { @@ -1066,6 +1077,7 @@ const opInputService6TestCaseOperation1 = "OperationName" type InputService6TestCaseOperation1Request struct { *aws.Request Input *InputService6TestShapeInputService6TestCaseOperation1Input + Copy func(*InputService6TestShapeInputService6TestCaseOperation1Input) InputService6TestCaseOperation1Request } // Send marshals and sends the InputService6TestCaseOperation1 API request. @@ -1104,7 +1116,7 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService6TestCaseOperation1Request{Request: req, Input: input} + return InputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService6TestCaseOperation1Request} } type InputService6TestShapeInputService6TestCaseOperation1Input struct { @@ -1184,6 +1196,7 @@ const opInputService7TestCaseOperation1 = "OperationName" type InputService7TestCaseOperation1Request struct { *aws.Request Input *InputService7TestShapeInputService7TestCaseOperation2Input + Copy func(*InputService7TestShapeInputService7TestCaseOperation2Input) InputService7TestCaseOperation1Request } // Send marshals and sends the InputService7TestCaseOperation1 API request. @@ -1222,7 +1235,7 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService7TestCaseOperation1Request{Request: req, Input: input} + return InputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService7TestCaseOperation1Request} } const opInputService7TestCaseOperation2 = "OperationName" @@ -1231,6 +1244,7 @@ const opInputService7TestCaseOperation2 = "OperationName" type InputService7TestCaseOperation2Request struct { *aws.Request Input *InputService7TestShapeInputService7TestCaseOperation2Input + Copy func(*InputService7TestShapeInputService7TestCaseOperation2Input) InputService7TestCaseOperation2Request } // Send marshals and sends the InputService7TestCaseOperation2 API request. @@ -1269,7 +1283,7 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService7TestCaseOperation2Request{Request: req, Input: input} + return InputService7TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService7TestCaseOperation2Request} } type InputService7TestShapeInputService7TestCaseOperation1Output struct { @@ -1360,6 +1374,7 @@ const opInputService8TestCaseOperation1 = "OperationName" type InputService8TestCaseOperation1Request struct { *aws.Request Input *InputService8TestShapeInputService8TestCaseOperation2Input + Copy func(*InputService8TestShapeInputService8TestCaseOperation2Input) InputService8TestCaseOperation1Request } // Send marshals and sends the InputService8TestCaseOperation1 API request. @@ -1398,7 +1413,7 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService8TestCaseOperation1Request{Request: req, Input: input} + return InputService8TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService8TestCaseOperation1Request} } const opInputService8TestCaseOperation2 = "OperationName" @@ -1407,6 +1422,7 @@ const opInputService8TestCaseOperation2 = "OperationName" type InputService8TestCaseOperation2Request struct { *aws.Request Input *InputService8TestShapeInputService8TestCaseOperation2Input + Copy func(*InputService8TestShapeInputService8TestCaseOperation2Input) InputService8TestCaseOperation2Request } // Send marshals and sends the InputService8TestCaseOperation2 API request. @@ -1445,7 +1461,7 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService8TestCaseOperation2Request{Request: req, Input: input} + return InputService8TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService8TestCaseOperation2Request} } type InputService8TestShapeInputService8TestCaseOperation1Output struct { diff --git a/private/protocol/jsonrpc/unmarshal_test.go b/private/protocol/jsonrpc/unmarshal_test.go index d9ec0b93fad..3f7c67f9540 100644 --- a/private/protocol/jsonrpc/unmarshal_test.go +++ b/private/protocol/jsonrpc/unmarshal_test.go @@ -101,6 +101,7 @@ const opOutputService1TestCaseOperation1 = "OperationName" type OutputService1TestCaseOperation1Request struct { *aws.Request Input *OutputService1TestShapeOutputService1TestCaseOperation1Input + Copy func(*OutputService1TestShapeOutputService1TestCaseOperation1Input) OutputService1TestCaseOperation1Request } // Send marshals and sends the OutputService1TestCaseOperation1 API request. @@ -137,7 +138,7 @@ func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService1TestCaseOperation1Request{Request: req, Input: input} + return OutputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService1TestCaseOperation1Request} } type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { @@ -231,6 +232,7 @@ const opOutputService2TestCaseOperation1 = "OperationName" type OutputService2TestCaseOperation1Request struct { *aws.Request Input *OutputService2TestShapeOutputService2TestCaseOperation1Input + Copy func(*OutputService2TestShapeOutputService2TestCaseOperation1Input) OutputService2TestCaseOperation1Request } // Send marshals and sends the OutputService2TestCaseOperation1 API request. @@ -267,7 +269,7 @@ func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService2TestCaseOperation1Request{Request: req, Input: input} + return OutputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService2TestCaseOperation1Request} } type OutputService2TestShapeBlobContainer struct { @@ -357,6 +359,7 @@ const opOutputService3TestCaseOperation1 = "OperationName" type OutputService3TestCaseOperation1Request struct { *aws.Request Input *OutputService3TestShapeOutputService3TestCaseOperation1Input + Copy func(*OutputService3TestShapeOutputService3TestCaseOperation1Input) OutputService3TestCaseOperation1Request } // Send marshals and sends the OutputService3TestCaseOperation1 API request. @@ -393,7 +396,7 @@ func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService3TestCaseOperation1Request{Request: req, Input: input} + return OutputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService3TestCaseOperation1Request} } type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { @@ -481,6 +484,7 @@ const opOutputService4TestCaseOperation1 = "OperationName" type OutputService4TestCaseOperation1Request struct { *aws.Request Input *OutputService4TestShapeOutputService4TestCaseOperation1Input + Copy func(*OutputService4TestShapeOutputService4TestCaseOperation1Input) OutputService4TestCaseOperation1Request } // Send marshals and sends the OutputService4TestCaseOperation1 API request. @@ -517,7 +521,7 @@ func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService4TestCaseOperation1Request{Request: req, Input: input} + return OutputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService4TestCaseOperation1Request} } const opOutputService4TestCaseOperation2 = "OperationName" @@ -526,6 +530,7 @@ const opOutputService4TestCaseOperation2 = "OperationName" type OutputService4TestCaseOperation2Request struct { *aws.Request Input *OutputService4TestShapeOutputService4TestCaseOperation2Input + Copy func(*OutputService4TestShapeOutputService4TestCaseOperation2Input) OutputService4TestCaseOperation2Request } // Send marshals and sends the OutputService4TestCaseOperation2 API request. @@ -562,7 +567,7 @@ func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation2Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService4TestCaseOperation2Request{Request: req, Input: input} + return OutputService4TestCaseOperation2Request{Request: req, Input: input, Copy: c.OutputService4TestCaseOperation2Request} } type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { @@ -654,6 +659,7 @@ const opOutputService5TestCaseOperation1 = "OperationName" type OutputService5TestCaseOperation1Request struct { *aws.Request Input *OutputService5TestShapeOutputService5TestCaseOperation1Input + Copy func(*OutputService5TestShapeOutputService5TestCaseOperation1Input) OutputService5TestCaseOperation1Request } // Send marshals and sends the OutputService5TestCaseOperation1 API request. @@ -690,7 +696,7 @@ func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService5TestCaseOperation1Request{Request: req, Input: input} + return OutputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService5TestCaseOperation1Request} } type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { @@ -770,6 +776,7 @@ const opOutputService6TestCaseOperation1 = "OperationName" type OutputService6TestCaseOperation1Request struct { *aws.Request Input *OutputService6TestShapeOutputService6TestCaseOperation1Input + Copy func(*OutputService6TestShapeOutputService6TestCaseOperation1Input) OutputService6TestCaseOperation1Request } // Send marshals and sends the OutputService6TestCaseOperation1 API request. @@ -806,7 +813,7 @@ func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService6TestCaseOperation1Request{Request: req, Input: input} + return OutputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService6TestCaseOperation1Request} } type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { @@ -886,6 +893,7 @@ const opOutputService7TestCaseOperation1 = "OperationName" type OutputService7TestCaseOperation1Request struct { *aws.Request Input *OutputService7TestShapeOutputService7TestCaseOperation1Input + Copy func(*OutputService7TestShapeOutputService7TestCaseOperation1Input) OutputService7TestCaseOperation1Request } // Send marshals and sends the OutputService7TestCaseOperation1 API request. @@ -922,7 +930,7 @@ func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService7TestCaseOperation1Request{Request: req, Input: input} + return OutputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService7TestCaseOperation1Request} } type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { diff --git a/private/protocol/query/build_test.go b/private/protocol/query/build_test.go index 44e2a456f6b..b4156ec38f3 100644 --- a/private/protocol/query/build_test.go +++ b/private/protocol/query/build_test.go @@ -101,6 +101,7 @@ const opInputService1TestCaseOperation1 = "OperationName" type InputService1TestCaseOperation1Request struct { *aws.Request Input *InputService1TestShapeInputService1TestCaseOperation3Input + Copy func(*InputService1TestShapeInputService1TestCaseOperation3Input) InputService1TestCaseOperation1Request } // Send marshals and sends the InputService1TestCaseOperation1 API request. @@ -139,7 +140,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService1TestCaseOperation1Request{Request: req, Input: input} + return InputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService1TestCaseOperation1Request} } const opInputService1TestCaseOperation2 = "OperationName" @@ -148,6 +149,7 @@ const opInputService1TestCaseOperation2 = "OperationName" type InputService1TestCaseOperation2Request struct { *aws.Request Input *InputService1TestShapeInputService1TestCaseOperation3Input + Copy func(*InputService1TestShapeInputService1TestCaseOperation3Input) InputService1TestCaseOperation2Request } // Send marshals and sends the InputService1TestCaseOperation2 API request. @@ -186,7 +188,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService1TestCaseOperation2Request{Request: req, Input: input} + return InputService1TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService1TestCaseOperation2Request} } const opInputService1TestCaseOperation3 = "OperationName" @@ -195,6 +197,7 @@ const opInputService1TestCaseOperation3 = "OperationName" type InputService1TestCaseOperation3Request struct { *aws.Request Input *InputService1TestShapeInputService1TestCaseOperation3Input + Copy func(*InputService1TestShapeInputService1TestCaseOperation3Input) InputService1TestCaseOperation3Request } // Send marshals and sends the InputService1TestCaseOperation3 API request. @@ -233,7 +236,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation3Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService1TestCaseOperation3Request{Request: req, Input: input} + return InputService1TestCaseOperation3Request{Request: req, Input: input, Copy: c.InputService1TestCaseOperation3Request} } type InputService1TestShapeInputService1TestCaseOperation1Output struct { @@ -339,6 +342,7 @@ const opInputService2TestCaseOperation1 = "OperationName" type InputService2TestCaseOperation1Request struct { *aws.Request Input *InputService2TestShapeInputService2TestCaseOperation1Input + Copy func(*InputService2TestShapeInputService2TestCaseOperation1Input) InputService2TestCaseOperation1Request } // Send marshals and sends the InputService2TestCaseOperation1 API request. @@ -377,7 +381,7 @@ func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService2TestCaseOperation1Request{Request: req, Input: input} + return InputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService2TestCaseOperation1Request} } type InputService2TestShapeInputService2TestCaseOperation1Input struct { @@ -463,6 +467,7 @@ const opInputService3TestCaseOperation1 = "OperationName" type InputService3TestCaseOperation1Request struct { *aws.Request Input *InputService3TestShapeInputService3TestCaseOperation2Input + Copy func(*InputService3TestShapeInputService3TestCaseOperation2Input) InputService3TestCaseOperation1Request } // Send marshals and sends the InputService3TestCaseOperation1 API request. @@ -501,7 +506,7 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService3TestCaseOperation1Request{Request: req, Input: input} + return InputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService3TestCaseOperation1Request} } const opInputService3TestCaseOperation2 = "OperationName" @@ -510,6 +515,7 @@ const opInputService3TestCaseOperation2 = "OperationName" type InputService3TestCaseOperation2Request struct { *aws.Request Input *InputService3TestShapeInputService3TestCaseOperation2Input + Copy func(*InputService3TestShapeInputService3TestCaseOperation2Input) InputService3TestCaseOperation2Request } // Send marshals and sends the InputService3TestCaseOperation2 API request. @@ -548,7 +554,7 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService3TestCaseOperation2Request{Request: req, Input: input} + return InputService3TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService3TestCaseOperation2Request} } type InputService3TestShapeInputService3TestCaseOperation1Output struct { @@ -639,6 +645,7 @@ const opInputService4TestCaseOperation1 = "OperationName" type InputService4TestCaseOperation1Request struct { *aws.Request Input *InputService4TestShapeInputService4TestCaseOperation2Input + Copy func(*InputService4TestShapeInputService4TestCaseOperation2Input) InputService4TestCaseOperation1Request } // Send marshals and sends the InputService4TestCaseOperation1 API request. @@ -677,7 +684,7 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService4TestCaseOperation1Request{Request: req, Input: input} + return InputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService4TestCaseOperation1Request} } const opInputService4TestCaseOperation2 = "OperationName" @@ -686,6 +693,7 @@ const opInputService4TestCaseOperation2 = "OperationName" type InputService4TestCaseOperation2Request struct { *aws.Request Input *InputService4TestShapeInputService4TestCaseOperation2Input + Copy func(*InputService4TestShapeInputService4TestCaseOperation2Input) InputService4TestCaseOperation2Request } // Send marshals and sends the InputService4TestCaseOperation2 API request. @@ -724,7 +732,7 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService4TestCaseOperation2Request{Request: req, Input: input} + return InputService4TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService4TestCaseOperation2Request} } type InputService4TestShapeInputService4TestCaseOperation1Output struct { @@ -819,6 +827,7 @@ const opInputService5TestCaseOperation1 = "OperationName" type InputService5TestCaseOperation1Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation1Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation1Input) InputService5TestCaseOperation1Request } // Send marshals and sends the InputService5TestCaseOperation1 API request. @@ -857,7 +866,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation1Request{Request: req, Input: input} + return InputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation1Request} } type InputService5TestShapeInputService5TestCaseOperation1Input struct { @@ -937,6 +946,7 @@ const opInputService6TestCaseOperation1 = "OperationName" type InputService6TestCaseOperation1Request struct { *aws.Request Input *InputService6TestShapeInputService6TestCaseOperation1Input + Copy func(*InputService6TestShapeInputService6TestCaseOperation1Input) InputService6TestCaseOperation1Request } // Send marshals and sends the InputService6TestCaseOperation1 API request. @@ -975,7 +985,7 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService6TestCaseOperation1Request{Request: req, Input: input} + return InputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService6TestCaseOperation1Request} } type InputService6TestShapeInputService6TestCaseOperation1Input struct { @@ -1055,6 +1065,7 @@ const opInputService7TestCaseOperation1 = "OperationName" type InputService7TestCaseOperation1Request struct { *aws.Request Input *InputService7TestShapeInputService7TestCaseOperation1Input + Copy func(*InputService7TestShapeInputService7TestCaseOperation1Input) InputService7TestCaseOperation1Request } // Send marshals and sends the InputService7TestCaseOperation1 API request. @@ -1093,7 +1104,7 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService7TestCaseOperation1Request{Request: req, Input: input} + return InputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService7TestCaseOperation1Request} } type InputService7TestShapeInputService7TestCaseOperation1Input struct { @@ -1175,6 +1186,7 @@ const opInputService8TestCaseOperation1 = "OperationName" type InputService8TestCaseOperation1Request struct { *aws.Request Input *InputService8TestShapeInputService8TestCaseOperation1Input + Copy func(*InputService8TestShapeInputService8TestCaseOperation1Input) InputService8TestCaseOperation1Request } // Send marshals and sends the InputService8TestCaseOperation1 API request. @@ -1213,7 +1225,7 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService8TestCaseOperation1Request{Request: req, Input: input} + return InputService8TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService8TestCaseOperation1Request} } type InputService8TestShapeInputService8TestCaseOperation1Input struct { @@ -1293,6 +1305,7 @@ const opInputService9TestCaseOperation1 = "OperationName" type InputService9TestCaseOperation1Request struct { *aws.Request Input *InputService9TestShapeInputService9TestCaseOperation1Input + Copy func(*InputService9TestShapeInputService9TestCaseOperation1Input) InputService9TestCaseOperation1Request } // Send marshals and sends the InputService9TestCaseOperation1 API request. @@ -1331,7 +1344,7 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService9TestCaseOperation1Request{Request: req, Input: input} + return InputService9TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService9TestCaseOperation1Request} } type InputService9TestShapeInputService9TestCaseOperation1Input struct { @@ -1411,6 +1424,7 @@ const opInputService10TestCaseOperation1 = "OperationName" type InputService10TestCaseOperation1Request struct { *aws.Request Input *InputService10TestShapeInputService10TestCaseOperation1Input + Copy func(*InputService10TestShapeInputService10TestCaseOperation1Input) InputService10TestCaseOperation1Request } // Send marshals and sends the InputService10TestCaseOperation1 API request. @@ -1449,7 +1463,7 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService10TestCaseOperation1Request{Request: req, Input: input} + return InputService10TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService10TestCaseOperation1Request} } type InputService10TestShapeInputService10TestCaseOperation1Input struct { @@ -1530,6 +1544,7 @@ const opInputService11TestCaseOperation1 = "OperationName" type InputService11TestCaseOperation1Request struct { *aws.Request Input *InputService11TestShapeInputService11TestCaseOperation1Input + Copy func(*InputService11TestShapeInputService11TestCaseOperation1Input) InputService11TestCaseOperation1Request } // Send marshals and sends the InputService11TestCaseOperation1 API request. @@ -1568,7 +1583,7 @@ func (c *InputService11ProtocolTest) InputService11TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService11TestCaseOperation1Request{Request: req, Input: input} + return InputService11TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService11TestCaseOperation1Request} } type InputService11TestShapeInputService11TestCaseOperation1Input struct { @@ -1648,6 +1663,7 @@ const opInputService12TestCaseOperation1 = "OperationName" type InputService12TestCaseOperation1Request struct { *aws.Request Input *InputService12TestShapeInputService12TestCaseOperation1Input + Copy func(*InputService12TestShapeInputService12TestCaseOperation1Input) InputService12TestCaseOperation1Request } // Send marshals and sends the InputService12TestCaseOperation1 API request. @@ -1686,7 +1702,7 @@ func (c *InputService12ProtocolTest) InputService12TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService12TestCaseOperation1Request{Request: req, Input: input} + return InputService12TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService12TestCaseOperation1Request} } type InputService12TestShapeInputService12TestCaseOperation1Input struct { @@ -1766,6 +1782,7 @@ const opInputService13TestCaseOperation1 = "OperationName" type InputService13TestCaseOperation1Request struct { *aws.Request Input *InputService13TestShapeInputService13TestCaseOperation6Input + Copy func(*InputService13TestShapeInputService13TestCaseOperation6Input) InputService13TestCaseOperation1Request } // Send marshals and sends the InputService13TestCaseOperation1 API request. @@ -1804,7 +1821,7 @@ func (c *InputService13ProtocolTest) InputService13TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService13TestCaseOperation1Request{Request: req, Input: input} + return InputService13TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService13TestCaseOperation1Request} } const opInputService13TestCaseOperation2 = "OperationName" @@ -1813,6 +1830,7 @@ const opInputService13TestCaseOperation2 = "OperationName" type InputService13TestCaseOperation2Request struct { *aws.Request Input *InputService13TestShapeInputService13TestCaseOperation6Input + Copy func(*InputService13TestShapeInputService13TestCaseOperation6Input) InputService13TestCaseOperation2Request } // Send marshals and sends the InputService13TestCaseOperation2 API request. @@ -1851,7 +1869,7 @@ func (c *InputService13ProtocolTest) InputService13TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService13TestCaseOperation2Request{Request: req, Input: input} + return InputService13TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService13TestCaseOperation2Request} } const opInputService13TestCaseOperation3 = "OperationName" @@ -1860,6 +1878,7 @@ const opInputService13TestCaseOperation3 = "OperationName" type InputService13TestCaseOperation3Request struct { *aws.Request Input *InputService13TestShapeInputService13TestCaseOperation6Input + Copy func(*InputService13TestShapeInputService13TestCaseOperation6Input) InputService13TestCaseOperation3Request } // Send marshals and sends the InputService13TestCaseOperation3 API request. @@ -1898,7 +1917,7 @@ func (c *InputService13ProtocolTest) InputService13TestCaseOperation3Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService13TestCaseOperation3Request{Request: req, Input: input} + return InputService13TestCaseOperation3Request{Request: req, Input: input, Copy: c.InputService13TestCaseOperation3Request} } const opInputService13TestCaseOperation4 = "OperationName" @@ -1907,6 +1926,7 @@ const opInputService13TestCaseOperation4 = "OperationName" type InputService13TestCaseOperation4Request struct { *aws.Request Input *InputService13TestShapeInputService13TestCaseOperation6Input + Copy func(*InputService13TestShapeInputService13TestCaseOperation6Input) InputService13TestCaseOperation4Request } // Send marshals and sends the InputService13TestCaseOperation4 API request. @@ -1945,7 +1965,7 @@ func (c *InputService13ProtocolTest) InputService13TestCaseOperation4Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService13TestCaseOperation4Request{Request: req, Input: input} + return InputService13TestCaseOperation4Request{Request: req, Input: input, Copy: c.InputService13TestCaseOperation4Request} } const opInputService13TestCaseOperation5 = "OperationName" @@ -1954,6 +1974,7 @@ const opInputService13TestCaseOperation5 = "OperationName" type InputService13TestCaseOperation5Request struct { *aws.Request Input *InputService13TestShapeInputService13TestCaseOperation6Input + Copy func(*InputService13TestShapeInputService13TestCaseOperation6Input) InputService13TestCaseOperation5Request } // Send marshals and sends the InputService13TestCaseOperation5 API request. @@ -1992,7 +2013,7 @@ func (c *InputService13ProtocolTest) InputService13TestCaseOperation5Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService13TestCaseOperation5Request{Request: req, Input: input} + return InputService13TestCaseOperation5Request{Request: req, Input: input, Copy: c.InputService13TestCaseOperation5Request} } const opInputService13TestCaseOperation6 = "OperationName" @@ -2001,6 +2022,7 @@ const opInputService13TestCaseOperation6 = "OperationName" type InputService13TestCaseOperation6Request struct { *aws.Request Input *InputService13TestShapeInputService13TestCaseOperation6Input + Copy func(*InputService13TestShapeInputService13TestCaseOperation6Input) InputService13TestCaseOperation6Request } // Send marshals and sends the InputService13TestCaseOperation6 API request. @@ -2039,7 +2061,7 @@ func (c *InputService13ProtocolTest) InputService13TestCaseOperation6Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService13TestCaseOperation6Request{Request: req, Input: input} + return InputService13TestCaseOperation6Request{Request: req, Input: input, Copy: c.InputService13TestCaseOperation6Request} } type InputService13TestShapeInputService13TestCaseOperation1Output struct { @@ -2186,6 +2208,7 @@ const opInputService14TestCaseOperation1 = "OperationName" type InputService14TestCaseOperation1Request struct { *aws.Request Input *InputService14TestShapeInputService14TestCaseOperation2Input + Copy func(*InputService14TestShapeInputService14TestCaseOperation2Input) InputService14TestCaseOperation1Request } // Send marshals and sends the InputService14TestCaseOperation1 API request. @@ -2224,7 +2247,7 @@ func (c *InputService14ProtocolTest) InputService14TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService14TestCaseOperation1Request{Request: req, Input: input} + return InputService14TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService14TestCaseOperation1Request} } const opInputService14TestCaseOperation2 = "OperationName" @@ -2233,6 +2256,7 @@ const opInputService14TestCaseOperation2 = "OperationName" type InputService14TestCaseOperation2Request struct { *aws.Request Input *InputService14TestShapeInputService14TestCaseOperation2Input + Copy func(*InputService14TestShapeInputService14TestCaseOperation2Input) InputService14TestCaseOperation2Request } // Send marshals and sends the InputService14TestCaseOperation2 API request. @@ -2271,7 +2295,7 @@ func (c *InputService14ProtocolTest) InputService14TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService14TestCaseOperation2Request{Request: req, Input: input} + return InputService14TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService14TestCaseOperation2Request} } type InputService14TestShapeInputService14TestCaseOperation1Output struct { @@ -2362,6 +2386,7 @@ const opInputService15TestCaseOperation1 = "OperationName" type InputService15TestCaseOperation1Request struct { *aws.Request Input *InputService15TestShapeInputService15TestCaseOperation3Input + Copy func(*InputService15TestShapeInputService15TestCaseOperation3Input) InputService15TestCaseOperation1Request } // Send marshals and sends the InputService15TestCaseOperation1 API request. @@ -2400,7 +2425,7 @@ func (c *InputService15ProtocolTest) InputService15TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService15TestCaseOperation1Request{Request: req, Input: input} + return InputService15TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService15TestCaseOperation1Request} } const opInputService15TestCaseOperation2 = "OperationName" @@ -2409,6 +2434,7 @@ const opInputService15TestCaseOperation2 = "OperationName" type InputService15TestCaseOperation2Request struct { *aws.Request Input *InputService15TestShapeInputService15TestCaseOperation3Input + Copy func(*InputService15TestShapeInputService15TestCaseOperation3Input) InputService15TestCaseOperation2Request } // Send marshals and sends the InputService15TestCaseOperation2 API request. @@ -2447,7 +2473,7 @@ func (c *InputService15ProtocolTest) InputService15TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService15TestCaseOperation2Request{Request: req, Input: input} + return InputService15TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService15TestCaseOperation2Request} } const opInputService15TestCaseOperation3 = "OperationName" @@ -2456,6 +2482,7 @@ const opInputService15TestCaseOperation3 = "OperationName" type InputService15TestCaseOperation3Request struct { *aws.Request Input *InputService15TestShapeInputService15TestCaseOperation3Input + Copy func(*InputService15TestShapeInputService15TestCaseOperation3Input) InputService15TestCaseOperation3Request } // Send marshals and sends the InputService15TestCaseOperation3 API request. @@ -2494,7 +2521,7 @@ func (c *InputService15ProtocolTest) InputService15TestCaseOperation3Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService15TestCaseOperation3Request{Request: req, Input: input} + return InputService15TestCaseOperation3Request{Request: req, Input: input, Copy: c.InputService15TestCaseOperation3Request} } type InputService15TestShapeInputService15TestCaseOperation1Output struct { diff --git a/private/protocol/query/unmarshal_test.go b/private/protocol/query/unmarshal_test.go index ead23c1c8d2..52750553bf5 100644 --- a/private/protocol/query/unmarshal_test.go +++ b/private/protocol/query/unmarshal_test.go @@ -101,6 +101,7 @@ const opOutputService1TestCaseOperation1 = "OperationName" type OutputService1TestCaseOperation1Request struct { *aws.Request Input *OutputService1TestShapeOutputService1TestCaseOperation1Input + Copy func(*OutputService1TestShapeOutputService1TestCaseOperation1Input) OutputService1TestCaseOperation1Request } // Send marshals and sends the OutputService1TestCaseOperation1 API request. @@ -137,7 +138,7 @@ func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService1TestCaseOperation1Request{Request: req, Input: input} + return OutputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService1TestCaseOperation1Request} } type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { @@ -233,6 +234,7 @@ const opOutputService2TestCaseOperation1 = "OperationName" type OutputService2TestCaseOperation1Request struct { *aws.Request Input *OutputService2TestShapeOutputService2TestCaseOperation1Input + Copy func(*OutputService2TestShapeOutputService2TestCaseOperation1Input) OutputService2TestCaseOperation1Request } // Send marshals and sends the OutputService2TestCaseOperation1 API request. @@ -269,7 +271,7 @@ func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService2TestCaseOperation1Request{Request: req, Input: input} + return OutputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService2TestCaseOperation1Request} } type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { @@ -351,6 +353,7 @@ const opOutputService3TestCaseOperation1 = "OperationName" type OutputService3TestCaseOperation1Request struct { *aws.Request Input *OutputService3TestShapeOutputService3TestCaseOperation1Input + Copy func(*OutputService3TestShapeOutputService3TestCaseOperation1Input) OutputService3TestCaseOperation1Request } // Send marshals and sends the OutputService3TestCaseOperation1 API request. @@ -387,7 +390,7 @@ func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService3TestCaseOperation1Request{Request: req, Input: input} + return OutputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService3TestCaseOperation1Request} } type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { @@ -468,6 +471,7 @@ const opOutputService4TestCaseOperation1 = "OperationName" type OutputService4TestCaseOperation1Request struct { *aws.Request Input *OutputService4TestShapeOutputService4TestCaseOperation1Input + Copy func(*OutputService4TestShapeOutputService4TestCaseOperation1Input) OutputService4TestCaseOperation1Request } // Send marshals and sends the OutputService4TestCaseOperation1 API request. @@ -504,7 +508,7 @@ func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService4TestCaseOperation1Request{Request: req, Input: input} + return OutputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService4TestCaseOperation1Request} } type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { @@ -584,6 +588,7 @@ const opOutputService5TestCaseOperation1 = "OperationName" type OutputService5TestCaseOperation1Request struct { *aws.Request Input *OutputService5TestShapeOutputService5TestCaseOperation1Input + Copy func(*OutputService5TestShapeOutputService5TestCaseOperation1Input) OutputService5TestCaseOperation1Request } // Send marshals and sends the OutputService5TestCaseOperation1 API request. @@ -620,7 +625,7 @@ func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService5TestCaseOperation1Request{Request: req, Input: input} + return OutputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService5TestCaseOperation1Request} } type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { @@ -700,6 +705,7 @@ const opOutputService6TestCaseOperation1 = "OperationName" type OutputService6TestCaseOperation1Request struct { *aws.Request Input *OutputService6TestShapeOutputService6TestCaseOperation1Input + Copy func(*OutputService6TestShapeOutputService6TestCaseOperation1Input) OutputService6TestCaseOperation1Request } // Send marshals and sends the OutputService6TestCaseOperation1 API request. @@ -736,7 +742,7 @@ func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService6TestCaseOperation1Request{Request: req, Input: input} + return OutputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService6TestCaseOperation1Request} } type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { @@ -816,6 +822,7 @@ const opOutputService7TestCaseOperation1 = "OperationName" type OutputService7TestCaseOperation1Request struct { *aws.Request Input *OutputService7TestShapeOutputService7TestCaseOperation1Input + Copy func(*OutputService7TestShapeOutputService7TestCaseOperation1Input) OutputService7TestCaseOperation1Request } // Send marshals and sends the OutputService7TestCaseOperation1 API request. @@ -852,7 +859,7 @@ func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService7TestCaseOperation1Request{Request: req, Input: input} + return OutputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService7TestCaseOperation1Request} } type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { @@ -932,6 +939,7 @@ const opOutputService8TestCaseOperation1 = "OperationName" type OutputService8TestCaseOperation1Request struct { *aws.Request Input *OutputService8TestShapeOutputService8TestCaseOperation1Input + Copy func(*OutputService8TestShapeOutputService8TestCaseOperation1Input) OutputService8TestCaseOperation1Request } // Send marshals and sends the OutputService8TestCaseOperation1 API request. @@ -968,7 +976,7 @@ func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService8TestCaseOperation1Request{Request: req, Input: input} + return OutputService8TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService8TestCaseOperation1Request} } type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { @@ -1058,6 +1066,7 @@ const opOutputService9TestCaseOperation1 = "OperationName" type OutputService9TestCaseOperation1Request struct { *aws.Request Input *OutputService9TestShapeOutputService9TestCaseOperation1Input + Copy func(*OutputService9TestShapeOutputService9TestCaseOperation1Input) OutputService9TestCaseOperation1Request } // Send marshals and sends the OutputService9TestCaseOperation1 API request. @@ -1094,7 +1103,7 @@ func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService9TestCaseOperation1Request{Request: req, Input: input} + return OutputService9TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService9TestCaseOperation1Request} } type OutputService9TestShapeOutputService9TestCaseOperation1Input struct { @@ -1184,6 +1193,7 @@ const opOutputService10TestCaseOperation1 = "OperationName" type OutputService10TestCaseOperation1Request struct { *aws.Request Input *OutputService10TestShapeOutputService10TestCaseOperation1Input + Copy func(*OutputService10TestShapeOutputService10TestCaseOperation1Input) OutputService10TestCaseOperation1Request } // Send marshals and sends the OutputService10TestCaseOperation1 API request. @@ -1220,7 +1230,7 @@ func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService10TestCaseOperation1Request{Request: req, Input: input} + return OutputService10TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService10TestCaseOperation1Request} } type OutputService10TestShapeOutputService10TestCaseOperation1Input struct { @@ -1300,6 +1310,7 @@ const opOutputService11TestCaseOperation1 = "OperationName" type OutputService11TestCaseOperation1Request struct { *aws.Request Input *OutputService11TestShapeOutputService11TestCaseOperation1Input + Copy func(*OutputService11TestShapeOutputService11TestCaseOperation1Input) OutputService11TestCaseOperation1Request } // Send marshals and sends the OutputService11TestCaseOperation1 API request. @@ -1336,7 +1347,7 @@ func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService11TestCaseOperation1Request{Request: req, Input: input} + return OutputService11TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService11TestCaseOperation1Request} } type OutputService11TestShapeOutputService11TestCaseOperation1Input struct { @@ -1422,6 +1433,7 @@ const opOutputService12TestCaseOperation1 = "OperationName" type OutputService12TestCaseOperation1Request struct { *aws.Request Input *OutputService12TestShapeOutputService12TestCaseOperation1Input + Copy func(*OutputService12TestShapeOutputService12TestCaseOperation1Input) OutputService12TestCaseOperation1Request } // Send marshals and sends the OutputService12TestCaseOperation1 API request. @@ -1458,7 +1470,7 @@ func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService12TestCaseOperation1Request{Request: req, Input: input} + return OutputService12TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService12TestCaseOperation1Request} } type OutputService12TestShapeOutputService12TestCaseOperation1Input struct { @@ -1538,6 +1550,7 @@ const opOutputService13TestCaseOperation1 = "OperationName" type OutputService13TestCaseOperation1Request struct { *aws.Request Input *OutputService13TestShapeOutputService13TestCaseOperation1Input + Copy func(*OutputService13TestShapeOutputService13TestCaseOperation1Input) OutputService13TestCaseOperation1Request } // Send marshals and sends the OutputService13TestCaseOperation1 API request. @@ -1574,7 +1587,7 @@ func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService13TestCaseOperation1Request{Request: req, Input: input} + return OutputService13TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService13TestCaseOperation1Request} } type OutputService13TestShapeOutputService13TestCaseOperation1Input struct { @@ -1654,6 +1667,7 @@ const opOutputService14TestCaseOperation1 = "OperationName" type OutputService14TestCaseOperation1Request struct { *aws.Request Input *OutputService14TestShapeOutputService14TestCaseOperation1Input + Copy func(*OutputService14TestShapeOutputService14TestCaseOperation1Input) OutputService14TestCaseOperation1Request } // Send marshals and sends the OutputService14TestCaseOperation1 API request. @@ -1690,7 +1704,7 @@ func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService14TestCaseOperation1Request{Request: req, Input: input} + return OutputService14TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService14TestCaseOperation1Request} } type OutputService14TestShapeOutputService14TestCaseOperation1Input struct { @@ -1770,6 +1784,7 @@ const opOutputService15TestCaseOperation1 = "OperationName" type OutputService15TestCaseOperation1Request struct { *aws.Request Input *OutputService15TestShapeOutputService15TestCaseOperation1Input + Copy func(*OutputService15TestShapeOutputService15TestCaseOperation1Input) OutputService15TestCaseOperation1Request } // Send marshals and sends the OutputService15TestCaseOperation1 API request. @@ -1806,7 +1821,7 @@ func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService15TestCaseOperation1Request{Request: req, Input: input} + return OutputService15TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService15TestCaseOperation1Request} } type OutputService15TestShapeOutputService15TestCaseOperation1Input struct { @@ -1886,6 +1901,7 @@ const opOutputService16TestCaseOperation1 = "OperationName" type OutputService16TestCaseOperation1Request struct { *aws.Request Input *OutputService16TestShapeOutputService16TestCaseOperation1Input + Copy func(*OutputService16TestShapeOutputService16TestCaseOperation1Input) OutputService16TestCaseOperation1Request } // Send marshals and sends the OutputService16TestCaseOperation1 API request. @@ -1922,7 +1938,7 @@ func (c *OutputService16ProtocolTest) OutputService16TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService16TestCaseOperation1Request{Request: req, Input: input} + return OutputService16TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService16TestCaseOperation1Request} } type OutputService16TestShapeOutputService16TestCaseOperation1Input struct { diff --git a/private/protocol/restjson/build_test.go b/private/protocol/restjson/build_test.go index e9e8aa7970f..7ac5ae11db7 100644 --- a/private/protocol/restjson/build_test.go +++ b/private/protocol/restjson/build_test.go @@ -101,6 +101,7 @@ const opInputService1TestCaseOperation1 = "OperationName" type InputService1TestCaseOperation1Request struct { *aws.Request Input *InputService1TestShapeInputService1TestCaseOperation1Input + Copy func(*InputService1TestShapeInputService1TestCaseOperation1Input) InputService1TestCaseOperation1Request } // Send marshals and sends the InputService1TestCaseOperation1 API request. @@ -139,7 +140,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService1TestCaseOperation1Request{Request: req, Input: input} + return InputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService1TestCaseOperation1Request} } type InputService1TestShapeInputService1TestCaseOperation1Input struct { @@ -228,6 +229,7 @@ const opInputService2TestCaseOperation1 = "OperationName" type InputService2TestCaseOperation1Request struct { *aws.Request Input *InputService2TestShapeInputService2TestCaseOperation1Input + Copy func(*InputService2TestShapeInputService2TestCaseOperation1Input) InputService2TestCaseOperation1Request } // Send marshals and sends the InputService2TestCaseOperation1 API request. @@ -266,7 +268,7 @@ func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService2TestCaseOperation1Request{Request: req, Input: input} + return InputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService2TestCaseOperation1Request} } type InputService2TestShapeInputService2TestCaseOperation1Input struct { @@ -363,6 +365,7 @@ const opInputService3TestCaseOperation1 = "OperationName" type InputService3TestCaseOperation1Request struct { *aws.Request Input *InputService3TestShapeInputService3TestCaseOperation1Input + Copy func(*InputService3TestShapeInputService3TestCaseOperation1Input) InputService3TestCaseOperation1Request } // Send marshals and sends the InputService3TestCaseOperation1 API request. @@ -401,7 +404,7 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService3TestCaseOperation1Request{Request: req, Input: input} + return InputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService3TestCaseOperation1Request} } type InputService3TestShapeInputService3TestCaseOperation1Input struct { @@ -498,6 +501,7 @@ const opInputService4TestCaseOperation1 = "OperationName" type InputService4TestCaseOperation1Request struct { *aws.Request Input *InputService4TestShapeInputService4TestCaseOperation1Input + Copy func(*InputService4TestShapeInputService4TestCaseOperation1Input) InputService4TestCaseOperation1Request } // Send marshals and sends the InputService4TestCaseOperation1 API request. @@ -536,7 +540,7 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService4TestCaseOperation1Request{Request: req, Input: input} + return InputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService4TestCaseOperation1Request} } type InputService4TestShapeInputService4TestCaseOperation1Input struct { @@ -639,6 +643,7 @@ const opInputService5TestCaseOperation1 = "OperationName" type InputService5TestCaseOperation1Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation1Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation1Input) InputService5TestCaseOperation1Request } // Send marshals and sends the InputService5TestCaseOperation1 API request. @@ -677,7 +682,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation1Request{Request: req, Input: input} + return InputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation1Request} } type InputService5TestShapeInputService5TestCaseOperation1Input struct { @@ -788,6 +793,7 @@ const opInputService6TestCaseOperation1 = "OperationName" type InputService6TestCaseOperation1Request struct { *aws.Request Input *InputService6TestShapeInputService6TestCaseOperation1Input + Copy func(*InputService6TestShapeInputService6TestCaseOperation1Input) InputService6TestCaseOperation1Request } // Send marshals and sends the InputService6TestCaseOperation1 API request. @@ -826,7 +832,7 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService6TestCaseOperation1Request{Request: req, Input: input} + return InputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService6TestCaseOperation1Request} } type InputService6TestShapeInputService6TestCaseOperation1Input struct { @@ -942,6 +948,7 @@ const opInputService7TestCaseOperation1 = "OperationName" type InputService7TestCaseOperation1Request struct { *aws.Request Input *InputService7TestShapeInputService7TestCaseOperation2Input + Copy func(*InputService7TestShapeInputService7TestCaseOperation2Input) InputService7TestCaseOperation1Request } // Send marshals and sends the InputService7TestCaseOperation1 API request. @@ -980,7 +987,7 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService7TestCaseOperation1Request{Request: req, Input: input} + return InputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService7TestCaseOperation1Request} } const opInputService7TestCaseOperation2 = "OperationName" @@ -989,6 +996,7 @@ const opInputService7TestCaseOperation2 = "OperationName" type InputService7TestCaseOperation2Request struct { *aws.Request Input *InputService7TestShapeInputService7TestCaseOperation2Input + Copy func(*InputService7TestShapeInputService7TestCaseOperation2Input) InputService7TestCaseOperation2Request } // Send marshals and sends the InputService7TestCaseOperation2 API request. @@ -1027,7 +1035,7 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService7TestCaseOperation2Request{Request: req, Input: input} + return InputService7TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService7TestCaseOperation2Request} } type InputService7TestShapeInputService7TestCaseOperation1Output struct { @@ -1140,6 +1148,7 @@ const opInputService8TestCaseOperation1 = "OperationName" type InputService8TestCaseOperation1Request struct { *aws.Request Input *InputService8TestShapeInputService8TestCaseOperation1Input + Copy func(*InputService8TestShapeInputService8TestCaseOperation1Input) InputService8TestCaseOperation1Request } // Send marshals and sends the InputService8TestCaseOperation1 API request. @@ -1178,7 +1187,7 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService8TestCaseOperation1Request{Request: req, Input: input} + return InputService8TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService8TestCaseOperation1Request} } type InputService8TestShapeInputService8TestCaseOperation1Input struct { @@ -1291,6 +1300,7 @@ const opInputService9TestCaseOperation1 = "OperationName" type InputService9TestCaseOperation1Request struct { *aws.Request Input *InputService9TestShapeInputService9TestCaseOperation1Input + Copy func(*InputService9TestShapeInputService9TestCaseOperation1Input) InputService9TestCaseOperation1Request } // Send marshals and sends the InputService9TestCaseOperation1 API request. @@ -1329,7 +1339,7 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService9TestCaseOperation1Request{Request: req, Input: input} + return InputService9TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService9TestCaseOperation1Request} } type InputService9TestShapeInputService9TestCaseOperation1Input struct { @@ -1475,6 +1485,7 @@ const opInputService10TestCaseOperation1 = "OperationName" type InputService10TestCaseOperation1Request struct { *aws.Request Input *InputService10TestShapeInputService10TestCaseOperation1Input + Copy func(*InputService10TestShapeInputService10TestCaseOperation1Input) InputService10TestCaseOperation1Request } // Send marshals and sends the InputService10TestCaseOperation1 API request. @@ -1513,7 +1524,7 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService10TestCaseOperation1Request{Request: req, Input: input} + return InputService10TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService10TestCaseOperation1Request} } type InputService10TestShapeInputService10TestCaseOperation1Input struct { @@ -1667,6 +1678,7 @@ const opInputService11TestCaseOperation1 = "OperationName" type InputService11TestCaseOperation1Request struct { *aws.Request Input *InputService11TestShapeInputService11TestCaseOperation1Input + Copy func(*InputService11TestShapeInputService11TestCaseOperation1Input) InputService11TestCaseOperation1Request } // Send marshals and sends the InputService11TestCaseOperation1 API request. @@ -1705,7 +1717,7 @@ func (c *InputService11ProtocolTest) InputService11TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService11TestCaseOperation1Request{Request: req, Input: input} + return InputService11TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService11TestCaseOperation1Request} } type InputService11TestShapeInputService11TestCaseOperation1Input struct { @@ -1833,6 +1845,7 @@ const opInputService12TestCaseOperation1 = "OperationName" type InputService12TestCaseOperation1Request struct { *aws.Request Input *InputService12TestShapeInputService12TestCaseOperation1Input + Copy func(*InputService12TestShapeInputService12TestCaseOperation1Input) InputService12TestCaseOperation1Request } // Send marshals and sends the InputService12TestCaseOperation1 API request. @@ -1871,7 +1884,7 @@ func (c *InputService12ProtocolTest) InputService12TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService12TestCaseOperation1Request{Request: req, Input: input} + return InputService12TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService12TestCaseOperation1Request} } type InputService12TestShapeInputService12TestCaseOperation1Input struct { @@ -1992,6 +2005,7 @@ const opInputService13TestCaseOperation1 = "OperationName" type InputService13TestCaseOperation1Request struct { *aws.Request Input *InputService13TestShapeInputService13TestCaseOperation2Input + Copy func(*InputService13TestShapeInputService13TestCaseOperation2Input) InputService13TestCaseOperation1Request } // Send marshals and sends the InputService13TestCaseOperation1 API request. @@ -2030,7 +2044,7 @@ func (c *InputService13ProtocolTest) InputService13TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService13TestCaseOperation1Request{Request: req, Input: input} + return InputService13TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService13TestCaseOperation1Request} } const opInputService13TestCaseOperation2 = "OperationName" @@ -2039,6 +2053,7 @@ const opInputService13TestCaseOperation2 = "OperationName" type InputService13TestCaseOperation2Request struct { *aws.Request Input *InputService13TestShapeInputService13TestCaseOperation2Input + Copy func(*InputService13TestShapeInputService13TestCaseOperation2Input) InputService13TestCaseOperation2Request } // Send marshals and sends the InputService13TestCaseOperation2 API request. @@ -2077,7 +2092,7 @@ func (c *InputService13ProtocolTest) InputService13TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService13TestCaseOperation2Request{Request: req, Input: input} + return InputService13TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService13TestCaseOperation2Request} } type InputService13TestShapeInputService13TestCaseOperation1Output struct { @@ -2190,6 +2205,7 @@ const opInputService14TestCaseOperation1 = "OperationName" type InputService14TestCaseOperation1Request struct { *aws.Request Input *InputService14TestShapeInputService14TestCaseOperation2Input + Copy func(*InputService14TestShapeInputService14TestCaseOperation2Input) InputService14TestCaseOperation1Request } // Send marshals and sends the InputService14TestCaseOperation1 API request. @@ -2228,7 +2244,7 @@ func (c *InputService14ProtocolTest) InputService14TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService14TestCaseOperation1Request{Request: req, Input: input} + return InputService14TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService14TestCaseOperation1Request} } const opInputService14TestCaseOperation2 = "OperationName" @@ -2237,6 +2253,7 @@ const opInputService14TestCaseOperation2 = "OperationName" type InputService14TestCaseOperation2Request struct { *aws.Request Input *InputService14TestShapeInputService14TestCaseOperation2Input + Copy func(*InputService14TestShapeInputService14TestCaseOperation2Input) InputService14TestCaseOperation2Request } // Send marshals and sends the InputService14TestCaseOperation2 API request. @@ -2275,7 +2292,7 @@ func (c *InputService14ProtocolTest) InputService14TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService14TestCaseOperation2Request{Request: req, Input: input} + return InputService14TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService14TestCaseOperation2Request} } type InputService14TestShapeFooShape struct { @@ -2405,6 +2422,7 @@ const opInputService15TestCaseOperation1 = "OperationName" type InputService15TestCaseOperation1Request struct { *aws.Request Input *InputService15TestShapeInputService15TestCaseOperation2Input + Copy func(*InputService15TestShapeInputService15TestCaseOperation2Input) InputService15TestCaseOperation1Request } // Send marshals and sends the InputService15TestCaseOperation1 API request. @@ -2443,7 +2461,7 @@ func (c *InputService15ProtocolTest) InputService15TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService15TestCaseOperation1Request{Request: req, Input: input} + return InputService15TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService15TestCaseOperation1Request} } const opInputService15TestCaseOperation2 = "OperationName" @@ -2452,6 +2470,7 @@ const opInputService15TestCaseOperation2 = "OperationName" type InputService15TestCaseOperation2Request struct { *aws.Request Input *InputService15TestShapeInputService15TestCaseOperation2Input + Copy func(*InputService15TestShapeInputService15TestCaseOperation2Input) InputService15TestCaseOperation2Request } // Send marshals and sends the InputService15TestCaseOperation2 API request. @@ -2490,7 +2509,7 @@ func (c *InputService15ProtocolTest) InputService15TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService15TestCaseOperation2Request{Request: req, Input: input} + return InputService15TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService15TestCaseOperation2Request} } type InputService15TestShapeInputService15TestCaseOperation1Output struct { @@ -2603,6 +2622,7 @@ const opInputService16TestCaseOperation1 = "OperationName" type InputService16TestCaseOperation1Request struct { *aws.Request Input *InputService16TestShapeInputService16TestCaseOperation6Input + Copy func(*InputService16TestShapeInputService16TestCaseOperation6Input) InputService16TestCaseOperation1Request } // Send marshals and sends the InputService16TestCaseOperation1 API request. @@ -2641,7 +2661,7 @@ func (c *InputService16ProtocolTest) InputService16TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService16TestCaseOperation1Request{Request: req, Input: input} + return InputService16TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService16TestCaseOperation1Request} } const opInputService16TestCaseOperation2 = "OperationName" @@ -2650,6 +2670,7 @@ const opInputService16TestCaseOperation2 = "OperationName" type InputService16TestCaseOperation2Request struct { *aws.Request Input *InputService16TestShapeInputService16TestCaseOperation6Input + Copy func(*InputService16TestShapeInputService16TestCaseOperation6Input) InputService16TestCaseOperation2Request } // Send marshals and sends the InputService16TestCaseOperation2 API request. @@ -2688,7 +2709,7 @@ func (c *InputService16ProtocolTest) InputService16TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService16TestCaseOperation2Request{Request: req, Input: input} + return InputService16TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService16TestCaseOperation2Request} } const opInputService16TestCaseOperation3 = "OperationName" @@ -2697,6 +2718,7 @@ const opInputService16TestCaseOperation3 = "OperationName" type InputService16TestCaseOperation3Request struct { *aws.Request Input *InputService16TestShapeInputService16TestCaseOperation6Input + Copy func(*InputService16TestShapeInputService16TestCaseOperation6Input) InputService16TestCaseOperation3Request } // Send marshals and sends the InputService16TestCaseOperation3 API request. @@ -2735,7 +2757,7 @@ func (c *InputService16ProtocolTest) InputService16TestCaseOperation3Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService16TestCaseOperation3Request{Request: req, Input: input} + return InputService16TestCaseOperation3Request{Request: req, Input: input, Copy: c.InputService16TestCaseOperation3Request} } const opInputService16TestCaseOperation4 = "OperationName" @@ -2744,6 +2766,7 @@ const opInputService16TestCaseOperation4 = "OperationName" type InputService16TestCaseOperation4Request struct { *aws.Request Input *InputService16TestShapeInputService16TestCaseOperation6Input + Copy func(*InputService16TestShapeInputService16TestCaseOperation6Input) InputService16TestCaseOperation4Request } // Send marshals and sends the InputService16TestCaseOperation4 API request. @@ -2782,7 +2805,7 @@ func (c *InputService16ProtocolTest) InputService16TestCaseOperation4Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService16TestCaseOperation4Request{Request: req, Input: input} + return InputService16TestCaseOperation4Request{Request: req, Input: input, Copy: c.InputService16TestCaseOperation4Request} } const opInputService16TestCaseOperation5 = "OperationName" @@ -2791,6 +2814,7 @@ const opInputService16TestCaseOperation5 = "OperationName" type InputService16TestCaseOperation5Request struct { *aws.Request Input *InputService16TestShapeInputService16TestCaseOperation6Input + Copy func(*InputService16TestShapeInputService16TestCaseOperation6Input) InputService16TestCaseOperation5Request } // Send marshals and sends the InputService16TestCaseOperation5 API request. @@ -2829,7 +2853,7 @@ func (c *InputService16ProtocolTest) InputService16TestCaseOperation5Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService16TestCaseOperation5Request{Request: req, Input: input} + return InputService16TestCaseOperation5Request{Request: req, Input: input, Copy: c.InputService16TestCaseOperation5Request} } const opInputService16TestCaseOperation6 = "OperationName" @@ -2838,6 +2862,7 @@ const opInputService16TestCaseOperation6 = "OperationName" type InputService16TestCaseOperation6Request struct { *aws.Request Input *InputService16TestShapeInputService16TestCaseOperation6Input + Copy func(*InputService16TestShapeInputService16TestCaseOperation6Input) InputService16TestCaseOperation6Request } // Send marshals and sends the InputService16TestCaseOperation6 API request. @@ -2876,7 +2901,7 @@ func (c *InputService16ProtocolTest) InputService16TestCaseOperation6Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService16TestCaseOperation6Request{Request: req, Input: input} + return InputService16TestCaseOperation6Request{Request: req, Input: input, Copy: c.InputService16TestCaseOperation6Request} } type InputService16TestShapeInputService16TestCaseOperation1Output struct { @@ -3106,6 +3131,7 @@ const opInputService17TestCaseOperation1 = "OperationName" type InputService17TestCaseOperation1Request struct { *aws.Request Input *InputService17TestShapeInputService17TestCaseOperation2Input + Copy func(*InputService17TestShapeInputService17TestCaseOperation2Input) InputService17TestCaseOperation1Request } // Send marshals and sends the InputService17TestCaseOperation1 API request. @@ -3144,7 +3170,7 @@ func (c *InputService17ProtocolTest) InputService17TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService17TestCaseOperation1Request{Request: req, Input: input} + return InputService17TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService17TestCaseOperation1Request} } const opInputService17TestCaseOperation2 = "OperationName" @@ -3153,6 +3179,7 @@ const opInputService17TestCaseOperation2 = "OperationName" type InputService17TestCaseOperation2Request struct { *aws.Request Input *InputService17TestShapeInputService17TestCaseOperation2Input + Copy func(*InputService17TestShapeInputService17TestCaseOperation2Input) InputService17TestCaseOperation2Request } // Send marshals and sends the InputService17TestCaseOperation2 API request. @@ -3191,7 +3218,7 @@ func (c *InputService17ProtocolTest) InputService17TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService17TestCaseOperation2Request{Request: req, Input: input} + return InputService17TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService17TestCaseOperation2Request} } type InputService17TestShapeInputService17TestCaseOperation1Output struct { @@ -3312,6 +3339,7 @@ const opInputService18TestCaseOperation1 = "OperationName" type InputService18TestCaseOperation1Request struct { *aws.Request Input *InputService18TestShapeInputService18TestCaseOperation1Input + Copy func(*InputService18TestShapeInputService18TestCaseOperation1Input) InputService18TestCaseOperation1Request } // Send marshals and sends the InputService18TestCaseOperation1 API request. @@ -3350,7 +3378,7 @@ func (c *InputService18ProtocolTest) InputService18TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService18TestCaseOperation1Request{Request: req, Input: input} + return InputService18TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService18TestCaseOperation1Request} } type InputService18TestShapeInputService18TestCaseOperation1Input struct { @@ -3447,6 +3475,7 @@ const opInputService19TestCaseOperation1 = "OperationName" type InputService19TestCaseOperation1Request struct { *aws.Request Input *InputService19TestShapeInputService19TestCaseOperation1Input + Copy func(*InputService19TestShapeInputService19TestCaseOperation1Input) InputService19TestCaseOperation1Request } // Send marshals and sends the InputService19TestCaseOperation1 API request. @@ -3485,7 +3514,7 @@ func (c *InputService19ProtocolTest) InputService19TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService19TestCaseOperation1Request{Request: req, Input: input} + return InputService19TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService19TestCaseOperation1Request} } type InputService19TestShapeInputService19TestCaseOperation1Input struct { @@ -3582,6 +3611,7 @@ const opInputService20TestCaseOperation1 = "OperationName" type InputService20TestCaseOperation1Request struct { *aws.Request Input *InputService20TestShapeInputService20TestCaseOperation2Input + Copy func(*InputService20TestShapeInputService20TestCaseOperation2Input) InputService20TestCaseOperation1Request } // Send marshals and sends the InputService20TestCaseOperation1 API request. @@ -3620,7 +3650,7 @@ func (c *InputService20ProtocolTest) InputService20TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService20TestCaseOperation1Request{Request: req, Input: input} + return InputService20TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService20TestCaseOperation1Request} } const opInputService20TestCaseOperation2 = "OperationName" @@ -3629,6 +3659,7 @@ const opInputService20TestCaseOperation2 = "OperationName" type InputService20TestCaseOperation2Request struct { *aws.Request Input *InputService20TestShapeInputService20TestCaseOperation2Input + Copy func(*InputService20TestShapeInputService20TestCaseOperation2Input) InputService20TestCaseOperation2Request } // Send marshals and sends the InputService20TestCaseOperation2 API request. @@ -3667,7 +3698,7 @@ func (c *InputService20ProtocolTest) InputService20TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService20TestCaseOperation2Request{Request: req, Input: input} + return InputService20TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService20TestCaseOperation2Request} } type InputService20TestShapeInputService20TestCaseOperation1Output struct { @@ -3786,6 +3817,7 @@ const opInputService21TestCaseOperation1 = "OperationName" type InputService21TestCaseOperation1Request struct { *aws.Request Input *InputService21TestShapeInputService21TestCaseOperation3Input + Copy func(*InputService21TestShapeInputService21TestCaseOperation3Input) InputService21TestCaseOperation1Request } // Send marshals and sends the InputService21TestCaseOperation1 API request. @@ -3824,7 +3856,7 @@ func (c *InputService21ProtocolTest) InputService21TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService21TestCaseOperation1Request{Request: req, Input: input} + return InputService21TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService21TestCaseOperation1Request} } const opInputService21TestCaseOperation2 = "OperationName" @@ -3833,6 +3865,7 @@ const opInputService21TestCaseOperation2 = "OperationName" type InputService21TestCaseOperation2Request struct { *aws.Request Input *InputService21TestShapeInputService21TestCaseOperation3Input + Copy func(*InputService21TestShapeInputService21TestCaseOperation3Input) InputService21TestCaseOperation2Request } // Send marshals and sends the InputService21TestCaseOperation2 API request. @@ -3871,7 +3904,7 @@ func (c *InputService21ProtocolTest) InputService21TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService21TestCaseOperation2Request{Request: req, Input: input} + return InputService21TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService21TestCaseOperation2Request} } const opInputService21TestCaseOperation3 = "OperationName" @@ -3880,6 +3913,7 @@ const opInputService21TestCaseOperation3 = "OperationName" type InputService21TestCaseOperation3Request struct { *aws.Request Input *InputService21TestShapeInputService21TestCaseOperation3Input + Copy func(*InputService21TestShapeInputService21TestCaseOperation3Input) InputService21TestCaseOperation3Request } // Send marshals and sends the InputService21TestCaseOperation3 API request. @@ -3918,7 +3952,7 @@ func (c *InputService21ProtocolTest) InputService21TestCaseOperation3Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService21TestCaseOperation3Request{Request: req, Input: input} + return InputService21TestCaseOperation3Request{Request: req, Input: input, Copy: c.InputService21TestCaseOperation3Request} } type InputService21TestShapeBodyStructure struct { @@ -4094,6 +4128,7 @@ const opInputService22TestCaseOperation1 = "OperationName" type InputService22TestCaseOperation1Request struct { *aws.Request Input *InputService22TestShapeInputService22TestCaseOperation2Input + Copy func(*InputService22TestShapeInputService22TestCaseOperation2Input) InputService22TestCaseOperation1Request } // Send marshals and sends the InputService22TestCaseOperation1 API request. @@ -4132,7 +4167,7 @@ func (c *InputService22ProtocolTest) InputService22TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService22TestCaseOperation1Request{Request: req, Input: input} + return InputService22TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService22TestCaseOperation1Request} } const opInputService22TestCaseOperation2 = "OperationName" @@ -4141,6 +4176,7 @@ const opInputService22TestCaseOperation2 = "OperationName" type InputService22TestCaseOperation2Request struct { *aws.Request Input *InputService22TestShapeInputService22TestCaseOperation2Input + Copy func(*InputService22TestShapeInputService22TestCaseOperation2Input) InputService22TestCaseOperation2Request } // Send marshals and sends the InputService22TestCaseOperation2 API request. @@ -4179,7 +4215,7 @@ func (c *InputService22ProtocolTest) InputService22TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService22TestCaseOperation2Request{Request: req, Input: input} + return InputService22TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService22TestCaseOperation2Request} } type InputService22TestShapeInputService22TestCaseOperation1Output struct { diff --git a/private/protocol/restjson/unmarshal_test.go b/private/protocol/restjson/unmarshal_test.go index 867ca6b1e2a..3837b5211e1 100644 --- a/private/protocol/restjson/unmarshal_test.go +++ b/private/protocol/restjson/unmarshal_test.go @@ -101,6 +101,7 @@ const opOutputService1TestCaseOperation1 = "OperationName" type OutputService1TestCaseOperation1Request struct { *aws.Request Input *OutputService1TestShapeOutputService1TestCaseOperation1Input + Copy func(*OutputService1TestShapeOutputService1TestCaseOperation1Input) OutputService1TestCaseOperation1Request } // Send marshals and sends the OutputService1TestCaseOperation1 API request. @@ -137,7 +138,7 @@ func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService1TestCaseOperation1Request{Request: req, Input: input} + return OutputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService1TestCaseOperation1Request} } type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { @@ -309,6 +310,7 @@ const opOutputService2TestCaseOperation1 = "OperationName" type OutputService2TestCaseOperation1Request struct { *aws.Request Input *OutputService2TestShapeOutputService2TestCaseOperation1Input + Copy func(*OutputService2TestShapeOutputService2TestCaseOperation1Input) OutputService2TestCaseOperation1Request } // Send marshals and sends the OutputService2TestCaseOperation1 API request. @@ -345,7 +347,7 @@ func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService2TestCaseOperation1Request{Request: req, Input: input} + return OutputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService2TestCaseOperation1Request} } type OutputService2TestShapeBlobContainer struct { @@ -469,6 +471,7 @@ const opOutputService3TestCaseOperation1 = "OperationName" type OutputService3TestCaseOperation1Request struct { *aws.Request Input *OutputService3TestShapeOutputService3TestCaseOperation1Input + Copy func(*OutputService3TestShapeOutputService3TestCaseOperation1Input) OutputService3TestCaseOperation1Request } // Send marshals and sends the OutputService3TestCaseOperation1 API request. @@ -505,7 +508,7 @@ func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService3TestCaseOperation1Request{Request: req, Input: input} + return OutputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService3TestCaseOperation1Request} } type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { @@ -627,6 +630,7 @@ const opOutputService4TestCaseOperation1 = "OperationName" type OutputService4TestCaseOperation1Request struct { *aws.Request Input *OutputService4TestShapeOutputService4TestCaseOperation1Input + Copy func(*OutputService4TestShapeOutputService4TestCaseOperation1Input) OutputService4TestCaseOperation1Request } // Send marshals and sends the OutputService4TestCaseOperation1 API request. @@ -663,7 +667,7 @@ func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService4TestCaseOperation1Request{Request: req, Input: input} + return OutputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService4TestCaseOperation1Request} } type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { @@ -766,6 +770,7 @@ const opOutputService5TestCaseOperation1 = "OperationName" type OutputService5TestCaseOperation1Request struct { *aws.Request Input *OutputService5TestShapeOutputService5TestCaseOperation1Input + Copy func(*OutputService5TestShapeOutputService5TestCaseOperation1Input) OutputService5TestCaseOperation1Request } // Send marshals and sends the OutputService5TestCaseOperation1 API request. @@ -802,7 +807,7 @@ func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService5TestCaseOperation1Request{Request: req, Input: input} + return OutputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService5TestCaseOperation1Request} } type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { @@ -922,6 +927,7 @@ const opOutputService6TestCaseOperation1 = "OperationName" type OutputService6TestCaseOperation1Request struct { *aws.Request Input *OutputService6TestShapeOutputService6TestCaseOperation1Input + Copy func(*OutputService6TestShapeOutputService6TestCaseOperation1Input) OutputService6TestCaseOperation1Request } // Send marshals and sends the OutputService6TestCaseOperation1 API request. @@ -958,7 +964,7 @@ func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService6TestCaseOperation1Request{Request: req, Input: input} + return OutputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService6TestCaseOperation1Request} } type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { @@ -1066,6 +1072,7 @@ const opOutputService7TestCaseOperation1 = "OperationName" type OutputService7TestCaseOperation1Request struct { *aws.Request Input *OutputService7TestShapeOutputService7TestCaseOperation1Input + Copy func(*OutputService7TestShapeOutputService7TestCaseOperation1Input) OutputService7TestCaseOperation1Request } // Send marshals and sends the OutputService7TestCaseOperation1 API request. @@ -1102,7 +1109,7 @@ func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService7TestCaseOperation1Request{Request: req, Input: input} + return OutputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService7TestCaseOperation1Request} } type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { @@ -1205,6 +1212,7 @@ const opOutputService8TestCaseOperation1 = "OperationName" type OutputService8TestCaseOperation1Request struct { *aws.Request Input *OutputService8TestShapeOutputService8TestCaseOperation1Input + Copy func(*OutputService8TestShapeOutputService8TestCaseOperation1Input) OutputService8TestCaseOperation1Request } // Send marshals and sends the OutputService8TestCaseOperation1 API request. @@ -1241,7 +1249,7 @@ func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService8TestCaseOperation1Request{Request: req, Input: input} + return OutputService8TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService8TestCaseOperation1Request} } type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { @@ -1338,6 +1346,7 @@ const opOutputService9TestCaseOperation1 = "OperationName" type OutputService9TestCaseOperation1Request struct { *aws.Request Input *OutputService9TestShapeOutputService9TestCaseOperation1Input + Copy func(*OutputService9TestShapeOutputService9TestCaseOperation1Input) OutputService9TestCaseOperation1Request } // Send marshals and sends the OutputService9TestCaseOperation1 API request. @@ -1374,7 +1383,7 @@ func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService9TestCaseOperation1Request{Request: req, Input: input} + return OutputService9TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService9TestCaseOperation1Request} } type OutputService9TestShapeOutputService9TestCaseOperation1Input struct { @@ -1491,6 +1500,7 @@ const opOutputService10TestCaseOperation1 = "OperationName" type OutputService10TestCaseOperation1Request struct { *aws.Request Input *OutputService10TestShapeOutputService10TestCaseOperation1Input + Copy func(*OutputService10TestShapeOutputService10TestCaseOperation1Input) OutputService10TestCaseOperation1Request } // Send marshals and sends the OutputService10TestCaseOperation1 API request. @@ -1527,7 +1537,7 @@ func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService10TestCaseOperation1Request{Request: req, Input: input} + return OutputService10TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService10TestCaseOperation1Request} } type OutputService10TestShapeBodyStructure struct { @@ -1649,6 +1659,7 @@ const opOutputService11TestCaseOperation1 = "OperationName" type OutputService11TestCaseOperation1Request struct { *aws.Request Input *OutputService11TestShapeOutputService11TestCaseOperation1Input + Copy func(*OutputService11TestShapeOutputService11TestCaseOperation1Input) OutputService11TestCaseOperation1Request } // Send marshals and sends the OutputService11TestCaseOperation1 API request. @@ -1685,7 +1696,7 @@ func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService11TestCaseOperation1Request{Request: req, Input: input} + return OutputService11TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService11TestCaseOperation1Request} } type OutputService11TestShapeOutputService11TestCaseOperation1Input struct { @@ -1782,6 +1793,7 @@ const opOutputService12TestCaseOperation1 = "OperationName" type OutputService12TestCaseOperation1Request struct { *aws.Request Input *OutputService12TestShapeOutputService12TestCaseOperation1Input + Copy func(*OutputService12TestShapeOutputService12TestCaseOperation1Input) OutputService12TestCaseOperation1Request } // Send marshals and sends the OutputService12TestCaseOperation1 API request. @@ -1818,7 +1830,7 @@ func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService12TestCaseOperation1Request{Request: req, Input: input} + return OutputService12TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService12TestCaseOperation1Request} } const opOutputService12TestCaseOperation2 = "OperationName" @@ -1827,6 +1839,7 @@ const opOutputService12TestCaseOperation2 = "OperationName" type OutputService12TestCaseOperation2Request struct { *aws.Request Input *OutputService12TestShapeOutputService12TestCaseOperation2Input + Copy func(*OutputService12TestShapeOutputService12TestCaseOperation2Input) OutputService12TestCaseOperation2Request } // Send marshals and sends the OutputService12TestCaseOperation2 API request. @@ -1863,7 +1876,7 @@ func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation2Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService12TestCaseOperation2Request{Request: req, Input: input} + return OutputService12TestCaseOperation2Request{Request: req, Input: input, Copy: c.OutputService12TestCaseOperation2Request} } const opOutputService12TestCaseOperation3 = "OperationName" @@ -1872,6 +1885,7 @@ const opOutputService12TestCaseOperation3 = "OperationName" type OutputService12TestCaseOperation3Request struct { *aws.Request Input *OutputService12TestShapeOutputService12TestCaseOperation3Input + Copy func(*OutputService12TestShapeOutputService12TestCaseOperation3Input) OutputService12TestCaseOperation3Request } // Send marshals and sends the OutputService12TestCaseOperation3 API request. @@ -1908,7 +1922,7 @@ func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation3Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService12TestCaseOperation3Request{Request: req, Input: input} + return OutputService12TestCaseOperation3Request{Request: req, Input: input, Copy: c.OutputService12TestCaseOperation3Request} } type OutputService12TestShapeOutputService12TestCaseOperation1Input struct { @@ -2047,6 +2061,7 @@ const opOutputService13TestCaseOperation1 = "OperationName" type OutputService13TestCaseOperation1Request struct { *aws.Request Input *OutputService13TestShapeOutputService13TestCaseOperation1Input + Copy func(*OutputService13TestShapeOutputService13TestCaseOperation1Input) OutputService13TestCaseOperation1Request } // Send marshals and sends the OutputService13TestCaseOperation1 API request. @@ -2083,7 +2098,7 @@ func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService13TestCaseOperation1Request{Request: req, Input: input} + return OutputService13TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService13TestCaseOperation1Request} } const opOutputService13TestCaseOperation2 = "OperationName" @@ -2092,6 +2107,7 @@ const opOutputService13TestCaseOperation2 = "OperationName" type OutputService13TestCaseOperation2Request struct { *aws.Request Input *OutputService13TestShapeOutputService13TestCaseOperation2Input + Copy func(*OutputService13TestShapeOutputService13TestCaseOperation2Input) OutputService13TestCaseOperation2Request } // Send marshals and sends the OutputService13TestCaseOperation2 API request. @@ -2130,7 +2146,7 @@ func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation2Request(i req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return OutputService13TestCaseOperation2Request{Request: req, Input: input} + return OutputService13TestCaseOperation2Request{Request: req, Input: input, Copy: c.OutputService13TestCaseOperation2Request} } type OutputService13TestShapeOutputService13TestCaseOperation1Input struct { diff --git a/private/protocol/restxml/build_test.go b/private/protocol/restxml/build_test.go index 3bf588b35b2..baabfc0e730 100644 --- a/private/protocol/restxml/build_test.go +++ b/private/protocol/restxml/build_test.go @@ -101,6 +101,7 @@ const opInputService1TestCaseOperation1 = "OperationName" type InputService1TestCaseOperation1Request struct { *aws.Request Input *InputService1TestShapeInputService1TestCaseOperation2Input + Copy func(*InputService1TestShapeInputService1TestCaseOperation2Input) InputService1TestCaseOperation1Request } // Send marshals and sends the InputService1TestCaseOperation1 API request. @@ -139,7 +140,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService1TestCaseOperation1Request{Request: req, Input: input} + return InputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService1TestCaseOperation1Request} } const opInputService1TestCaseOperation2 = "OperationName" @@ -148,6 +149,7 @@ const opInputService1TestCaseOperation2 = "OperationName" type InputService1TestCaseOperation2Request struct { *aws.Request Input *InputService1TestShapeInputService1TestCaseOperation2Input + Copy func(*InputService1TestShapeInputService1TestCaseOperation2Input) InputService1TestCaseOperation2Request } // Send marshals and sends the InputService1TestCaseOperation2 API request. @@ -186,7 +188,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService1TestCaseOperation2Request{Request: req, Input: input} + return InputService1TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService1TestCaseOperation2Request} } const opInputService1TestCaseOperation3 = "OperationName" @@ -195,6 +197,7 @@ const opInputService1TestCaseOperation3 = "OperationName" type InputService1TestCaseOperation3Request struct { *aws.Request Input *InputService1TestShapeInputService1TestCaseOperation3Input + Copy func(*InputService1TestShapeInputService1TestCaseOperation3Input) InputService1TestCaseOperation3Request } // Send marshals and sends the InputService1TestCaseOperation3 API request. @@ -233,7 +236,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation3Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService1TestCaseOperation3Request{Request: req, Input: input} + return InputService1TestCaseOperation3Request{Request: req, Input: input, Copy: c.InputService1TestCaseOperation3Request} } type InputService1TestShapeInputService1TestCaseOperation1Output struct { @@ -383,6 +386,7 @@ const opInputService2TestCaseOperation1 = "OperationName" type InputService2TestCaseOperation1Request struct { *aws.Request Input *InputService2TestShapeInputService2TestCaseOperation1Input + Copy func(*InputService2TestShapeInputService2TestCaseOperation1Input) InputService2TestCaseOperation1Request } // Send marshals and sends the InputService2TestCaseOperation1 API request. @@ -421,7 +425,7 @@ func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService2TestCaseOperation1Request{Request: req, Input: input} + return InputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService2TestCaseOperation1Request} } type InputService2TestShapeInputService2TestCaseOperation1Input struct { @@ -545,6 +549,7 @@ const opInputService3TestCaseOperation1 = "OperationName" type InputService3TestCaseOperation1Request struct { *aws.Request Input *InputService3TestShapeInputService3TestCaseOperation2Input + Copy func(*InputService3TestShapeInputService3TestCaseOperation2Input) InputService3TestCaseOperation1Request } // Send marshals and sends the InputService3TestCaseOperation1 API request. @@ -583,7 +588,7 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService3TestCaseOperation1Request{Request: req, Input: input} + return InputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService3TestCaseOperation1Request} } const opInputService3TestCaseOperation2 = "OperationName" @@ -592,6 +597,7 @@ const opInputService3TestCaseOperation2 = "OperationName" type InputService3TestCaseOperation2Request struct { *aws.Request Input *InputService3TestShapeInputService3TestCaseOperation2Input + Copy func(*InputService3TestShapeInputService3TestCaseOperation2Input) InputService3TestCaseOperation2Request } // Send marshals and sends the InputService3TestCaseOperation2 API request. @@ -630,7 +636,7 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService3TestCaseOperation2Request{Request: req, Input: input} + return InputService3TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService3TestCaseOperation2Request} } type InputService3TestShapeInputService3TestCaseOperation1Output struct { @@ -779,6 +785,7 @@ const opInputService4TestCaseOperation1 = "OperationName" type InputService4TestCaseOperation1Request struct { *aws.Request Input *InputService4TestShapeInputService4TestCaseOperation1Input + Copy func(*InputService4TestShapeInputService4TestCaseOperation1Input) InputService4TestCaseOperation1Request } // Send marshals and sends the InputService4TestCaseOperation1 API request. @@ -817,7 +824,7 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService4TestCaseOperation1Request{Request: req, Input: input} + return InputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService4TestCaseOperation1Request} } type InputService4TestShapeInputService4TestCaseOperation1Input struct { @@ -950,6 +957,7 @@ const opInputService5TestCaseOperation1 = "OperationName" type InputService5TestCaseOperation1Request struct { *aws.Request Input *InputService5TestShapeInputService5TestCaseOperation1Input + Copy func(*InputService5TestShapeInputService5TestCaseOperation1Input) InputService5TestCaseOperation1Request } // Send marshals and sends the InputService5TestCaseOperation1 API request. @@ -988,7 +996,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService5TestCaseOperation1Request{Request: req, Input: input} + return InputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService5TestCaseOperation1Request} } type InputService5TestShapeInputService5TestCaseOperation1Input struct { @@ -1094,6 +1102,7 @@ const opInputService6TestCaseOperation1 = "OperationName" type InputService6TestCaseOperation1Request struct { *aws.Request Input *InputService6TestShapeInputService6TestCaseOperation1Input + Copy func(*InputService6TestShapeInputService6TestCaseOperation1Input) InputService6TestCaseOperation1Request } // Send marshals and sends the InputService6TestCaseOperation1 API request. @@ -1132,7 +1141,7 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService6TestCaseOperation1Request{Request: req, Input: input} + return InputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService6TestCaseOperation1Request} } type InputService6TestShapeInputService6TestCaseOperation1Input struct { @@ -1238,6 +1247,7 @@ const opInputService7TestCaseOperation1 = "OperationName" type InputService7TestCaseOperation1Request struct { *aws.Request Input *InputService7TestShapeInputService7TestCaseOperation1Input + Copy func(*InputService7TestShapeInputService7TestCaseOperation1Input) InputService7TestCaseOperation1Request } // Send marshals and sends the InputService7TestCaseOperation1 API request. @@ -1276,7 +1286,7 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService7TestCaseOperation1Request{Request: req, Input: input} + return InputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService7TestCaseOperation1Request} } type InputService7TestShapeInputService7TestCaseOperation1Input struct { @@ -1382,6 +1392,7 @@ const opInputService8TestCaseOperation1 = "OperationName" type InputService8TestCaseOperation1Request struct { *aws.Request Input *InputService8TestShapeInputService8TestCaseOperation1Input + Copy func(*InputService8TestShapeInputService8TestCaseOperation1Input) InputService8TestCaseOperation1Request } // Send marshals and sends the InputService8TestCaseOperation1 API request. @@ -1420,7 +1431,7 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService8TestCaseOperation1Request{Request: req, Input: input} + return InputService8TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService8TestCaseOperation1Request} } type InputService8TestShapeInputService8TestCaseOperation1Input struct { @@ -1526,6 +1537,7 @@ const opInputService9TestCaseOperation1 = "OperationName" type InputService9TestCaseOperation1Request struct { *aws.Request Input *InputService9TestShapeInputService9TestCaseOperation1Input + Copy func(*InputService9TestShapeInputService9TestCaseOperation1Input) InputService9TestCaseOperation1Request } // Send marshals and sends the InputService9TestCaseOperation1 API request. @@ -1564,7 +1576,7 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService9TestCaseOperation1Request{Request: req, Input: input} + return InputService9TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService9TestCaseOperation1Request} } type InputService9TestShapeInputService9TestCaseOperation1Input struct { @@ -1687,6 +1699,7 @@ const opInputService10TestCaseOperation1 = "OperationName" type InputService10TestCaseOperation1Request struct { *aws.Request Input *InputService10TestShapeInputService10TestCaseOperation1Input + Copy func(*InputService10TestShapeInputService10TestCaseOperation1Input) InputService10TestCaseOperation1Request } // Send marshals and sends the InputService10TestCaseOperation1 API request. @@ -1725,7 +1738,7 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService10TestCaseOperation1Request{Request: req, Input: input} + return InputService10TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService10TestCaseOperation1Request} } type InputService10TestShapeInputService10TestCaseOperation1Input struct { @@ -1851,6 +1864,7 @@ const opInputService11TestCaseOperation1 = "OperationName" type InputService11TestCaseOperation1Request struct { *aws.Request Input *InputService11TestShapeInputService11TestCaseOperation1Input + Copy func(*InputService11TestShapeInputService11TestCaseOperation1Input) InputService11TestCaseOperation1Request } // Send marshals and sends the InputService11TestCaseOperation1 API request. @@ -1889,7 +1903,7 @@ func (c *InputService11ProtocolTest) InputService11TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService11TestCaseOperation1Request{Request: req, Input: input} + return InputService11TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService11TestCaseOperation1Request} } type InputService11TestShapeInputService11TestCaseOperation1Input struct { @@ -1992,6 +2006,7 @@ const opInputService12TestCaseOperation1 = "OperationName" type InputService12TestCaseOperation1Request struct { *aws.Request Input *InputService12TestShapeInputService12TestCaseOperation1Input + Copy func(*InputService12TestShapeInputService12TestCaseOperation1Input) InputService12TestCaseOperation1Request } // Send marshals and sends the InputService12TestCaseOperation1 API request. @@ -2030,7 +2045,7 @@ func (c *InputService12ProtocolTest) InputService12TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService12TestCaseOperation1Request{Request: req, Input: input} + return InputService12TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService12TestCaseOperation1Request} } type InputService12TestShapeInputService12TestCaseOperation1Input struct { @@ -2133,6 +2148,7 @@ const opInputService13TestCaseOperation1 = "OperationName" type InputService13TestCaseOperation1Request struct { *aws.Request Input *InputService13TestShapeInputService13TestCaseOperation1Input + Copy func(*InputService13TestShapeInputService13TestCaseOperation1Input) InputService13TestCaseOperation1Request } // Send marshals and sends the InputService13TestCaseOperation1 API request. @@ -2171,7 +2187,7 @@ func (c *InputService13ProtocolTest) InputService13TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService13TestCaseOperation1Request{Request: req, Input: input} + return InputService13TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService13TestCaseOperation1Request} } type InputService13TestShapeInputService13TestCaseOperation1Input struct { @@ -2282,6 +2298,7 @@ const opInputService14TestCaseOperation1 = "OperationName" type InputService14TestCaseOperation1Request struct { *aws.Request Input *InputService14TestShapeInputService14TestCaseOperation1Input + Copy func(*InputService14TestShapeInputService14TestCaseOperation1Input) InputService14TestCaseOperation1Request } // Send marshals and sends the InputService14TestCaseOperation1 API request. @@ -2320,7 +2337,7 @@ func (c *InputService14ProtocolTest) InputService14TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService14TestCaseOperation1Request{Request: req, Input: input} + return InputService14TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService14TestCaseOperation1Request} } type InputService14TestShapeInputService14TestCaseOperation1Input struct { @@ -2436,6 +2453,7 @@ const opInputService15TestCaseOperation1 = "OperationName" type InputService15TestCaseOperation1Request struct { *aws.Request Input *InputService15TestShapeInputService15TestCaseOperation2Input + Copy func(*InputService15TestShapeInputService15TestCaseOperation2Input) InputService15TestCaseOperation1Request } // Send marshals and sends the InputService15TestCaseOperation1 API request. @@ -2474,7 +2492,7 @@ func (c *InputService15ProtocolTest) InputService15TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService15TestCaseOperation1Request{Request: req, Input: input} + return InputService15TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService15TestCaseOperation1Request} } const opInputService15TestCaseOperation2 = "OperationName" @@ -2483,6 +2501,7 @@ const opInputService15TestCaseOperation2 = "OperationName" type InputService15TestCaseOperation2Request struct { *aws.Request Input *InputService15TestShapeInputService15TestCaseOperation2Input + Copy func(*InputService15TestShapeInputService15TestCaseOperation2Input) InputService15TestCaseOperation2Request } // Send marshals and sends the InputService15TestCaseOperation2 API request. @@ -2521,7 +2540,7 @@ func (c *InputService15ProtocolTest) InputService15TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService15TestCaseOperation2Request{Request: req, Input: input} + return InputService15TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService15TestCaseOperation2Request} } type InputService15TestShapeInputService15TestCaseOperation1Output struct { @@ -2634,6 +2653,7 @@ const opInputService16TestCaseOperation1 = "OperationName" type InputService16TestCaseOperation1Request struct { *aws.Request Input *InputService16TestShapeInputService16TestCaseOperation1Input + Copy func(*InputService16TestShapeInputService16TestCaseOperation1Input) InputService16TestCaseOperation1Request } // Send marshals and sends the InputService16TestCaseOperation1 API request. @@ -2672,7 +2692,7 @@ func (c *InputService16ProtocolTest) InputService16TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService16TestCaseOperation1Request{Request: req, Input: input} + return InputService16TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService16TestCaseOperation1Request} } type InputService16TestShapeInputService16TestCaseOperation1Input struct { @@ -2769,6 +2789,7 @@ const opInputService17TestCaseOperation1 = "OperationName" type InputService17TestCaseOperation1Request struct { *aws.Request Input *InputService17TestShapeInputService17TestCaseOperation2Input + Copy func(*InputService17TestShapeInputService17TestCaseOperation2Input) InputService17TestCaseOperation1Request } // Send marshals and sends the InputService17TestCaseOperation1 API request. @@ -2807,7 +2828,7 @@ func (c *InputService17ProtocolTest) InputService17TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService17TestCaseOperation1Request{Request: req, Input: input} + return InputService17TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService17TestCaseOperation1Request} } const opInputService17TestCaseOperation2 = "OperationName" @@ -2816,6 +2837,7 @@ const opInputService17TestCaseOperation2 = "OperationName" type InputService17TestCaseOperation2Request struct { *aws.Request Input *InputService17TestShapeInputService17TestCaseOperation2Input + Copy func(*InputService17TestShapeInputService17TestCaseOperation2Input) InputService17TestCaseOperation2Request } // Send marshals and sends the InputService17TestCaseOperation2 API request. @@ -2854,7 +2876,7 @@ func (c *InputService17ProtocolTest) InputService17TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService17TestCaseOperation2Request{Request: req, Input: input} + return InputService17TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService17TestCaseOperation2Request} } type InputService17TestShapeInputService17TestCaseOperation1Output struct { @@ -2967,6 +2989,7 @@ const opInputService18TestCaseOperation1 = "OperationName" type InputService18TestCaseOperation1Request struct { *aws.Request Input *InputService18TestShapeInputService18TestCaseOperation4Input + Copy func(*InputService18TestShapeInputService18TestCaseOperation4Input) InputService18TestCaseOperation1Request } // Send marshals and sends the InputService18TestCaseOperation1 API request. @@ -3005,7 +3028,7 @@ func (c *InputService18ProtocolTest) InputService18TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService18TestCaseOperation1Request{Request: req, Input: input} + return InputService18TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService18TestCaseOperation1Request} } const opInputService18TestCaseOperation2 = "OperationName" @@ -3014,6 +3037,7 @@ const opInputService18TestCaseOperation2 = "OperationName" type InputService18TestCaseOperation2Request struct { *aws.Request Input *InputService18TestShapeInputService18TestCaseOperation4Input + Copy func(*InputService18TestShapeInputService18TestCaseOperation4Input) InputService18TestCaseOperation2Request } // Send marshals and sends the InputService18TestCaseOperation2 API request. @@ -3052,7 +3076,7 @@ func (c *InputService18ProtocolTest) InputService18TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService18TestCaseOperation2Request{Request: req, Input: input} + return InputService18TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService18TestCaseOperation2Request} } const opInputService18TestCaseOperation3 = "OperationName" @@ -3061,6 +3085,7 @@ const opInputService18TestCaseOperation3 = "OperationName" type InputService18TestCaseOperation3Request struct { *aws.Request Input *InputService18TestShapeInputService18TestCaseOperation4Input + Copy func(*InputService18TestShapeInputService18TestCaseOperation4Input) InputService18TestCaseOperation3Request } // Send marshals and sends the InputService18TestCaseOperation3 API request. @@ -3099,7 +3124,7 @@ func (c *InputService18ProtocolTest) InputService18TestCaseOperation3Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService18TestCaseOperation3Request{Request: req, Input: input} + return InputService18TestCaseOperation3Request{Request: req, Input: input, Copy: c.InputService18TestCaseOperation3Request} } const opInputService18TestCaseOperation4 = "OperationName" @@ -3108,6 +3133,7 @@ const opInputService18TestCaseOperation4 = "OperationName" type InputService18TestCaseOperation4Request struct { *aws.Request Input *InputService18TestShapeInputService18TestCaseOperation4Input + Copy func(*InputService18TestShapeInputService18TestCaseOperation4Input) InputService18TestCaseOperation4Request } // Send marshals and sends the InputService18TestCaseOperation4 API request. @@ -3146,7 +3172,7 @@ func (c *InputService18ProtocolTest) InputService18TestCaseOperation4Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService18TestCaseOperation4Request{Request: req, Input: input} + return InputService18TestCaseOperation4Request{Request: req, Input: input, Copy: c.InputService18TestCaseOperation4Request} } type InputService18TestShapeFooShape struct { @@ -3308,6 +3334,7 @@ const opInputService19TestCaseOperation1 = "OperationName" type InputService19TestCaseOperation1Request struct { *aws.Request Input *InputService19TestShapeInputService19TestCaseOperation1Input + Copy func(*InputService19TestShapeInputService19TestCaseOperation1Input) InputService19TestCaseOperation1Request } // Send marshals and sends the InputService19TestCaseOperation1 API request. @@ -3346,7 +3373,7 @@ func (c *InputService19ProtocolTest) InputService19TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService19TestCaseOperation1Request{Request: req, Input: input} + return InputService19TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService19TestCaseOperation1Request} } type InputService19TestShapeGrant struct { @@ -3485,6 +3512,7 @@ const opInputService20TestCaseOperation1 = "OperationName" type InputService20TestCaseOperation1Request struct { *aws.Request Input *InputService20TestShapeInputService20TestCaseOperation1Input + Copy func(*InputService20TestShapeInputService20TestCaseOperation1Input) InputService20TestCaseOperation1Request } // Send marshals and sends the InputService20TestCaseOperation1 API request. @@ -3523,7 +3551,7 @@ func (c *InputService20ProtocolTest) InputService20TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService20TestCaseOperation1Request{Request: req, Input: input} + return InputService20TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService20TestCaseOperation1Request} } type InputService20TestShapeInputService20TestCaseOperation1Input struct { @@ -3628,6 +3656,7 @@ const opInputService21TestCaseOperation1 = "OperationName" type InputService21TestCaseOperation1Request struct { *aws.Request Input *InputService21TestShapeInputService21TestCaseOperation2Input + Copy func(*InputService21TestShapeInputService21TestCaseOperation2Input) InputService21TestCaseOperation1Request } // Send marshals and sends the InputService21TestCaseOperation1 API request. @@ -3666,7 +3695,7 @@ func (c *InputService21ProtocolTest) InputService21TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService21TestCaseOperation1Request{Request: req, Input: input} + return InputService21TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService21TestCaseOperation1Request} } const opInputService21TestCaseOperation2 = "OperationName" @@ -3675,6 +3704,7 @@ const opInputService21TestCaseOperation2 = "OperationName" type InputService21TestCaseOperation2Request struct { *aws.Request Input *InputService21TestShapeInputService21TestCaseOperation2Input + Copy func(*InputService21TestShapeInputService21TestCaseOperation2Input) InputService21TestCaseOperation2Request } // Send marshals and sends the InputService21TestCaseOperation2 API request. @@ -3713,7 +3743,7 @@ func (c *InputService21ProtocolTest) InputService21TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService21TestCaseOperation2Request{Request: req, Input: input} + return InputService21TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService21TestCaseOperation2Request} } type InputService21TestShapeInputService21TestCaseOperation1Output struct { @@ -3826,6 +3856,7 @@ const opInputService22TestCaseOperation1 = "OperationName" type InputService22TestCaseOperation1Request struct { *aws.Request Input *InputService22TestShapeInputService22TestCaseOperation6Input + Copy func(*InputService22TestShapeInputService22TestCaseOperation6Input) InputService22TestCaseOperation1Request } // Send marshals and sends the InputService22TestCaseOperation1 API request. @@ -3864,7 +3895,7 @@ func (c *InputService22ProtocolTest) InputService22TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService22TestCaseOperation1Request{Request: req, Input: input} + return InputService22TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService22TestCaseOperation1Request} } const opInputService22TestCaseOperation2 = "OperationName" @@ -3873,6 +3904,7 @@ const opInputService22TestCaseOperation2 = "OperationName" type InputService22TestCaseOperation2Request struct { *aws.Request Input *InputService22TestShapeInputService22TestCaseOperation6Input + Copy func(*InputService22TestShapeInputService22TestCaseOperation6Input) InputService22TestCaseOperation2Request } // Send marshals and sends the InputService22TestCaseOperation2 API request. @@ -3911,7 +3943,7 @@ func (c *InputService22ProtocolTest) InputService22TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService22TestCaseOperation2Request{Request: req, Input: input} + return InputService22TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService22TestCaseOperation2Request} } const opInputService22TestCaseOperation3 = "OperationName" @@ -3920,6 +3952,7 @@ const opInputService22TestCaseOperation3 = "OperationName" type InputService22TestCaseOperation3Request struct { *aws.Request Input *InputService22TestShapeInputService22TestCaseOperation6Input + Copy func(*InputService22TestShapeInputService22TestCaseOperation6Input) InputService22TestCaseOperation3Request } // Send marshals and sends the InputService22TestCaseOperation3 API request. @@ -3958,7 +3991,7 @@ func (c *InputService22ProtocolTest) InputService22TestCaseOperation3Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService22TestCaseOperation3Request{Request: req, Input: input} + return InputService22TestCaseOperation3Request{Request: req, Input: input, Copy: c.InputService22TestCaseOperation3Request} } const opInputService22TestCaseOperation4 = "OperationName" @@ -3967,6 +4000,7 @@ const opInputService22TestCaseOperation4 = "OperationName" type InputService22TestCaseOperation4Request struct { *aws.Request Input *InputService22TestShapeInputService22TestCaseOperation6Input + Copy func(*InputService22TestShapeInputService22TestCaseOperation6Input) InputService22TestCaseOperation4Request } // Send marshals and sends the InputService22TestCaseOperation4 API request. @@ -4005,7 +4039,7 @@ func (c *InputService22ProtocolTest) InputService22TestCaseOperation4Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService22TestCaseOperation4Request{Request: req, Input: input} + return InputService22TestCaseOperation4Request{Request: req, Input: input, Copy: c.InputService22TestCaseOperation4Request} } const opInputService22TestCaseOperation5 = "OperationName" @@ -4014,6 +4048,7 @@ const opInputService22TestCaseOperation5 = "OperationName" type InputService22TestCaseOperation5Request struct { *aws.Request Input *InputService22TestShapeInputService22TestCaseOperation6Input + Copy func(*InputService22TestShapeInputService22TestCaseOperation6Input) InputService22TestCaseOperation5Request } // Send marshals and sends the InputService22TestCaseOperation5 API request. @@ -4052,7 +4087,7 @@ func (c *InputService22ProtocolTest) InputService22TestCaseOperation5Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService22TestCaseOperation5Request{Request: req, Input: input} + return InputService22TestCaseOperation5Request{Request: req, Input: input, Copy: c.InputService22TestCaseOperation5Request} } const opInputService22TestCaseOperation6 = "OperationName" @@ -4061,6 +4096,7 @@ const opInputService22TestCaseOperation6 = "OperationName" type InputService22TestCaseOperation6Request struct { *aws.Request Input *InputService22TestShapeInputService22TestCaseOperation6Input + Copy func(*InputService22TestShapeInputService22TestCaseOperation6Input) InputService22TestCaseOperation6Request } // Send marshals and sends the InputService22TestCaseOperation6 API request. @@ -4099,7 +4135,7 @@ func (c *InputService22ProtocolTest) InputService22TestCaseOperation6Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService22TestCaseOperation6Request{Request: req, Input: input} + return InputService22TestCaseOperation6Request{Request: req, Input: input, Copy: c.InputService22TestCaseOperation6Request} } type InputService22TestShapeInputService22TestCaseOperation1Output struct { @@ -4332,6 +4368,7 @@ const opInputService23TestCaseOperation1 = "OperationName" type InputService23TestCaseOperation1Request struct { *aws.Request Input *InputService23TestShapeInputService23TestCaseOperation1Input + Copy func(*InputService23TestShapeInputService23TestCaseOperation1Input) InputService23TestCaseOperation1Request } // Send marshals and sends the InputService23TestCaseOperation1 API request. @@ -4370,7 +4407,7 @@ func (c *InputService23ProtocolTest) InputService23TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService23TestCaseOperation1Request{Request: req, Input: input} + return InputService23TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService23TestCaseOperation1Request} } type InputService23TestShapeInputService23TestCaseOperation1Input struct { @@ -4467,6 +4504,7 @@ const opInputService24TestCaseOperation1 = "OperationName" type InputService24TestCaseOperation1Request struct { *aws.Request Input *InputService24TestShapeInputService24TestCaseOperation2Input + Copy func(*InputService24TestShapeInputService24TestCaseOperation2Input) InputService24TestCaseOperation1Request } // Send marshals and sends the InputService24TestCaseOperation1 API request. @@ -4505,7 +4543,7 @@ func (c *InputService24ProtocolTest) InputService24TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService24TestCaseOperation1Request{Request: req, Input: input} + return InputService24TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService24TestCaseOperation1Request} } const opInputService24TestCaseOperation2 = "OperationName" @@ -4514,6 +4552,7 @@ const opInputService24TestCaseOperation2 = "OperationName" type InputService24TestCaseOperation2Request struct { *aws.Request Input *InputService24TestShapeInputService24TestCaseOperation2Input + Copy func(*InputService24TestShapeInputService24TestCaseOperation2Input) InputService24TestCaseOperation2Request } // Send marshals and sends the InputService24TestCaseOperation2 API request. @@ -4552,7 +4591,7 @@ func (c *InputService24ProtocolTest) InputService24TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService24TestCaseOperation2Request{Request: req, Input: input} + return InputService24TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService24TestCaseOperation2Request} } type InputService24TestShapeInputService24TestCaseOperation1Output struct { @@ -4671,6 +4710,7 @@ const opInputService25TestCaseOperation1 = "OperationName" type InputService25TestCaseOperation1Request struct { *aws.Request Input *InputService25TestShapeInputService25TestCaseOperation2Input + Copy func(*InputService25TestShapeInputService25TestCaseOperation2Input) InputService25TestCaseOperation1Request } // Send marshals and sends the InputService25TestCaseOperation1 API request. @@ -4709,7 +4749,7 @@ func (c *InputService25ProtocolTest) InputService25TestCaseOperation1Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService25TestCaseOperation1Request{Request: req, Input: input} + return InputService25TestCaseOperation1Request{Request: req, Input: input, Copy: c.InputService25TestCaseOperation1Request} } const opInputService25TestCaseOperation2 = "OperationName" @@ -4718,6 +4758,7 @@ const opInputService25TestCaseOperation2 = "OperationName" type InputService25TestCaseOperation2Request struct { *aws.Request Input *InputService25TestShapeInputService25TestCaseOperation2Input + Copy func(*InputService25TestShapeInputService25TestCaseOperation2Input) InputService25TestCaseOperation2Request } // Send marshals and sends the InputService25TestCaseOperation2 API request. @@ -4756,7 +4797,7 @@ func (c *InputService25ProtocolTest) InputService25TestCaseOperation2Request(inp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return InputService25TestCaseOperation2Request{Request: req, Input: input} + return InputService25TestCaseOperation2Request{Request: req, Input: input, Copy: c.InputService25TestCaseOperation2Request} } type InputService25TestShapeInputService25TestCaseOperation1Output struct { diff --git a/private/protocol/restxml/unmarshal_test.go b/private/protocol/restxml/unmarshal_test.go index 944675ddc55..0f0ea4377d8 100644 --- a/private/protocol/restxml/unmarshal_test.go +++ b/private/protocol/restxml/unmarshal_test.go @@ -101,6 +101,7 @@ const opOutputService1TestCaseOperation1 = "OperationName" type OutputService1TestCaseOperation1Request struct { *aws.Request Input *OutputService1TestShapeOutputService1TestCaseOperation1Input + Copy func(*OutputService1TestShapeOutputService1TestCaseOperation1Input) OutputService1TestCaseOperation1Request } // Send marshals and sends the OutputService1TestCaseOperation1 API request. @@ -137,7 +138,7 @@ func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService1TestCaseOperation1Request{Request: req, Input: input} + return OutputService1TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService1TestCaseOperation1Request} } const opOutputService1TestCaseOperation2 = "OperationName" @@ -146,6 +147,7 @@ const opOutputService1TestCaseOperation2 = "OperationName" type OutputService1TestCaseOperation2Request struct { *aws.Request Input *OutputService1TestShapeOutputService1TestCaseOperation2Input + Copy func(*OutputService1TestShapeOutputService1TestCaseOperation2Input) OutputService1TestCaseOperation2Request } // Send marshals and sends the OutputService1TestCaseOperation2 API request. @@ -182,7 +184,7 @@ func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation2Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService1TestCaseOperation2Request{Request: req, Input: input} + return OutputService1TestCaseOperation2Request{Request: req, Input: input, Copy: c.OutputService1TestCaseOperation2Request} } type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { @@ -369,6 +371,7 @@ const opOutputService2TestCaseOperation1 = "OperationName" type OutputService2TestCaseOperation1Request struct { *aws.Request Input *OutputService2TestShapeOutputService2TestCaseOperation1Input + Copy func(*OutputService2TestShapeOutputService2TestCaseOperation1Input) OutputService2TestCaseOperation1Request } // Send marshals and sends the OutputService2TestCaseOperation1 API request. @@ -405,7 +408,7 @@ func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService2TestCaseOperation1Request{Request: req, Input: input} + return OutputService2TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService2TestCaseOperation1Request} } type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { @@ -503,6 +506,7 @@ const opOutputService3TestCaseOperation1 = "OperationName" type OutputService3TestCaseOperation1Request struct { *aws.Request Input *OutputService3TestShapeOutputService3TestCaseOperation1Input + Copy func(*OutputService3TestShapeOutputService3TestCaseOperation1Input) OutputService3TestCaseOperation1Request } // Send marshals and sends the OutputService3TestCaseOperation1 API request. @@ -539,7 +543,7 @@ func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService3TestCaseOperation1Request{Request: req, Input: input} + return OutputService3TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService3TestCaseOperation1Request} } type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { @@ -642,6 +646,7 @@ const opOutputService4TestCaseOperation1 = "OperationName" type OutputService4TestCaseOperation1Request struct { *aws.Request Input *OutputService4TestShapeOutputService4TestCaseOperation1Input + Copy func(*OutputService4TestShapeOutputService4TestCaseOperation1Input) OutputService4TestCaseOperation1Request } // Send marshals and sends the OutputService4TestCaseOperation1 API request. @@ -678,7 +683,7 @@ func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService4TestCaseOperation1Request{Request: req, Input: input} + return OutputService4TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService4TestCaseOperation1Request} } type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { @@ -781,6 +786,7 @@ const opOutputService5TestCaseOperation1 = "OperationName" type OutputService5TestCaseOperation1Request struct { *aws.Request Input *OutputService5TestShapeOutputService5TestCaseOperation1Input + Copy func(*OutputService5TestShapeOutputService5TestCaseOperation1Input) OutputService5TestCaseOperation1Request } // Send marshals and sends the OutputService5TestCaseOperation1 API request. @@ -817,7 +823,7 @@ func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService5TestCaseOperation1Request{Request: req, Input: input} + return OutputService5TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService5TestCaseOperation1Request} } type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { @@ -920,6 +926,7 @@ const opOutputService6TestCaseOperation1 = "OperationName" type OutputService6TestCaseOperation1Request struct { *aws.Request Input *OutputService6TestShapeOutputService6TestCaseOperation1Input + Copy func(*OutputService6TestShapeOutputService6TestCaseOperation1Input) OutputService6TestCaseOperation1Request } // Send marshals and sends the OutputService6TestCaseOperation1 API request. @@ -956,7 +963,7 @@ func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService6TestCaseOperation1Request{Request: req, Input: input} + return OutputService6TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService6TestCaseOperation1Request} } type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { @@ -1076,6 +1083,7 @@ const opOutputService7TestCaseOperation1 = "OperationName" type OutputService7TestCaseOperation1Request struct { *aws.Request Input *OutputService7TestShapeOutputService7TestCaseOperation1Input + Copy func(*OutputService7TestShapeOutputService7TestCaseOperation1Input) OutputService7TestCaseOperation1Request } // Send marshals and sends the OutputService7TestCaseOperation1 API request. @@ -1112,7 +1120,7 @@ func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService7TestCaseOperation1Request{Request: req, Input: input} + return OutputService7TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService7TestCaseOperation1Request} } type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { @@ -1215,6 +1223,7 @@ const opOutputService8TestCaseOperation1 = "OperationName" type OutputService8TestCaseOperation1Request struct { *aws.Request Input *OutputService8TestShapeOutputService8TestCaseOperation1Input + Copy func(*OutputService8TestShapeOutputService8TestCaseOperation1Input) OutputService8TestCaseOperation1Request } // Send marshals and sends the OutputService8TestCaseOperation1 API request. @@ -1251,7 +1260,7 @@ func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService8TestCaseOperation1Request{Request: req, Input: input} + return OutputService8TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService8TestCaseOperation1Request} } type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { @@ -1354,6 +1363,7 @@ const opOutputService9TestCaseOperation1 = "OperationName" type OutputService9TestCaseOperation1Request struct { *aws.Request Input *OutputService9TestShapeOutputService9TestCaseOperation1Input + Copy func(*OutputService9TestShapeOutputService9TestCaseOperation1Input) OutputService9TestCaseOperation1Request } // Send marshals and sends the OutputService9TestCaseOperation1 API request. @@ -1390,7 +1400,7 @@ func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService9TestCaseOperation1Request{Request: req, Input: input} + return OutputService9TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService9TestCaseOperation1Request} } type OutputService9TestShapeOutputService9TestCaseOperation1Input struct { @@ -1512,6 +1522,7 @@ const opOutputService10TestCaseOperation1 = "OperationName" type OutputService10TestCaseOperation1Request struct { *aws.Request Input *OutputService10TestShapeOutputService10TestCaseOperation1Input + Copy func(*OutputService10TestShapeOutputService10TestCaseOperation1Input) OutputService10TestCaseOperation1Request } // Send marshals and sends the OutputService10TestCaseOperation1 API request. @@ -1548,7 +1559,7 @@ func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService10TestCaseOperation1Request{Request: req, Input: input} + return OutputService10TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService10TestCaseOperation1Request} } type OutputService10TestShapeOutputService10TestCaseOperation1Input struct { @@ -1645,6 +1656,7 @@ const opOutputService11TestCaseOperation1 = "OperationName" type OutputService11TestCaseOperation1Request struct { *aws.Request Input *OutputService11TestShapeOutputService11TestCaseOperation1Input + Copy func(*OutputService11TestShapeOutputService11TestCaseOperation1Input) OutputService11TestCaseOperation1Request } // Send marshals and sends the OutputService11TestCaseOperation1 API request. @@ -1681,7 +1693,7 @@ func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService11TestCaseOperation1Request{Request: req, Input: input} + return OutputService11TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService11TestCaseOperation1Request} } type OutputService11TestShapeOutputService11TestCaseOperation1Input struct { @@ -1842,6 +1854,7 @@ const opOutputService12TestCaseOperation1 = "OperationName" type OutputService12TestCaseOperation1Request struct { *aws.Request Input *OutputService12TestShapeOutputService12TestCaseOperation1Input + Copy func(*OutputService12TestShapeOutputService12TestCaseOperation1Input) OutputService12TestCaseOperation1Request } // Send marshals and sends the OutputService12TestCaseOperation1 API request. @@ -1878,7 +1891,7 @@ func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService12TestCaseOperation1Request{Request: req, Input: input} + return OutputService12TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService12TestCaseOperation1Request} } type OutputService12TestShapeOutputService12TestCaseOperation1Input struct { @@ -1975,6 +1988,7 @@ const opOutputService13TestCaseOperation1 = "OperationName" type OutputService13TestCaseOperation1Request struct { *aws.Request Input *OutputService13TestShapeOutputService13TestCaseOperation1Input + Copy func(*OutputService13TestShapeOutputService13TestCaseOperation1Input) OutputService13TestCaseOperation1Request } // Send marshals and sends the OutputService13TestCaseOperation1 API request. @@ -2011,7 +2025,7 @@ func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService13TestCaseOperation1Request{Request: req, Input: input} + return OutputService13TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService13TestCaseOperation1Request} } const opOutputService13TestCaseOperation2 = "OperationName" @@ -2020,6 +2034,7 @@ const opOutputService13TestCaseOperation2 = "OperationName" type OutputService13TestCaseOperation2Request struct { *aws.Request Input *OutputService13TestShapeOutputService13TestCaseOperation2Input + Copy func(*OutputService13TestShapeOutputService13TestCaseOperation2Input) OutputService13TestCaseOperation2Request } // Send marshals and sends the OutputService13TestCaseOperation2 API request. @@ -2058,7 +2073,7 @@ func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation2Request(i req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return OutputService13TestCaseOperation2Request{Request: req, Input: input} + return OutputService13TestCaseOperation2Request{Request: req, Input: input, Copy: c.OutputService13TestCaseOperation2Request} } type OutputService13TestShapeOutputService13TestCaseOperation1Input struct { @@ -2213,6 +2228,7 @@ const opOutputService14TestCaseOperation1 = "OperationName" type OutputService14TestCaseOperation1Request struct { *aws.Request Input *OutputService14TestShapeOutputService14TestCaseOperation1Input + Copy func(*OutputService14TestShapeOutputService14TestCaseOperation1Input) OutputService14TestCaseOperation1Request } // Send marshals and sends the OutputService14TestCaseOperation1 API request. @@ -2249,7 +2265,7 @@ func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1Request(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OutputService14TestCaseOperation1Request{Request: req, Input: input} + return OutputService14TestCaseOperation1Request{Request: req, Input: input, Copy: c.OutputService14TestCaseOperation1Request} } type OutputService14TestShapeItemDetailShape struct { diff --git a/service/acm/acmiface/interface.go b/service/acm/acmiface/interface.go index 958ee526a49..67b1eeb3ba0 100644 --- a/service/acm/acmiface/interface.go +++ b/service/acm/acmiface/interface.go @@ -9,7 +9,6 @@ package acmiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/acm" ) @@ -75,9 +74,6 @@ type ACMAPI interface { ListCertificatesRequest(*acm.ListCertificatesInput) acm.ListCertificatesRequest - ListCertificatesPages(*acm.ListCertificatesInput, func(*acm.ListCertificatesOutput, bool) bool) error - ListCertificatesPagesWithContext(aws.Context, *acm.ListCertificatesInput, func(*acm.ListCertificatesOutput, bool) bool, ...aws.Option) error - ListTagsForCertificateRequest(*acm.ListTagsForCertificateInput) acm.ListTagsForCertificateRequest RemoveTagsFromCertificateRequest(*acm.RemoveTagsFromCertificateInput) acm.RemoveTagsFromCertificateRequest diff --git a/service/acm/api.go b/service/acm/api.go index 467e305008d..74de4423667 100644 --- a/service/acm/api.go +++ b/service/acm/api.go @@ -18,6 +18,7 @@ const opAddTagsToCertificate = "AddTagsToCertificate" type AddTagsToCertificateRequest struct { *aws.Request Input *AddTagsToCertificateInput + Copy func(*AddTagsToCertificateInput) AddTagsToCertificateRequest } // Send marshals and sends the AddTagsToCertificate API request. @@ -76,7 +77,7 @@ func (c *ACM) AddTagsToCertificateRequest(input *AddTagsToCertificateInput) AddT req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddTagsToCertificateRequest{Request: req, Input: input} + return AddTagsToCertificateRequest{Request: req, Input: input, Copy: c.AddTagsToCertificateRequest} } const opDeleteCertificate = "DeleteCertificate" @@ -85,6 +86,7 @@ const opDeleteCertificate = "DeleteCertificate" type DeleteCertificateRequest struct { *aws.Request Input *DeleteCertificateInput + Copy func(*DeleteCertificateInput) DeleteCertificateRequest } // Send marshals and sends the DeleteCertificate API request. @@ -135,7 +137,7 @@ func (c *ACM) DeleteCertificateRequest(input *DeleteCertificateInput) DeleteCert req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCertificateRequest{Request: req, Input: input} + return DeleteCertificateRequest{Request: req, Input: input, Copy: c.DeleteCertificateRequest} } const opDescribeCertificate = "DescribeCertificate" @@ -144,6 +146,7 @@ const opDescribeCertificate = "DescribeCertificate" type DescribeCertificateRequest struct { *aws.Request Input *DescribeCertificateInput + Copy func(*DescribeCertificateInput) DescribeCertificateRequest } // Send marshals and sends the DescribeCertificate API request. @@ -184,7 +187,7 @@ func (c *ACM) DescribeCertificateRequest(input *DescribeCertificateInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCertificateRequest{Request: req, Input: input} + return DescribeCertificateRequest{Request: req, Input: input, Copy: c.DescribeCertificateRequest} } const opGetCertificate = "GetCertificate" @@ -193,6 +196,7 @@ const opGetCertificate = "GetCertificate" type GetCertificateRequest struct { *aws.Request Input *GetCertificateInput + Copy func(*GetCertificateInput) GetCertificateRequest } // Send marshals and sends the GetCertificate API request. @@ -238,7 +242,7 @@ func (c *ACM) GetCertificateRequest(input *GetCertificateInput) GetCertificateRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCertificateRequest{Request: req, Input: input} + return GetCertificateRequest{Request: req, Input: input, Copy: c.GetCertificateRequest} } const opImportCertificate = "ImportCertificate" @@ -247,6 +251,7 @@ const opImportCertificate = "ImportCertificate" type ImportCertificateRequest struct { *aws.Request Input *ImportCertificateInput + Copy func(*ImportCertificateInput) ImportCertificateRequest } // Send marshals and sends the ImportCertificate API request. @@ -335,7 +340,7 @@ func (c *ACM) ImportCertificateRequest(input *ImportCertificateInput) ImportCert req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportCertificateRequest{Request: req, Input: input} + return ImportCertificateRequest{Request: req, Input: input, Copy: c.ImportCertificateRequest} } const opListCertificates = "ListCertificates" @@ -344,6 +349,7 @@ const opListCertificates = "ListCertificates" type ListCertificatesRequest struct { *aws.Request Input *ListCertificatesInput + Copy func(*ListCertificatesInput) ListCertificatesRequest } // Send marshals and sends the ListCertificates API request. @@ -392,57 +398,53 @@ func (c *ACM) ListCertificatesRequest(input *ListCertificatesInput) ListCertific req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCertificatesRequest{Request: req, Input: input} + return ListCertificatesRequest{Request: req, Input: input, Copy: c.ListCertificatesRequest} } -// ListCertificatesPages iterates over the pages of a ListCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCertificates method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListCertificatesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListCertificates operation. -// pageNum := 0 -// err := client.ListCertificatesPages(params, -// func(page *ListCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListCertificatesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ACM) ListCertificatesPages(input *ListCertificatesInput, fn func(*ListCertificatesOutput, bool) bool) error { - return c.ListCertificatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCertificatesPagesWithContext same as ListCertificatesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ACM) ListCertificatesPagesWithContext(ctx aws.Context, input *ListCertificatesInput, fn func(*ListCertificatesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListCertificatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListCertificatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListCertificatesRequest) Paginate(opts ...aws.Option) ListCertificatesPager { + return ListCertificatesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListCertificatesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCertificatesOutput), !p.HasNextPage()) - } - return p.Err() +// ListCertificatesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListCertificatesPager struct { + aws.Pager +} + +func (p *ListCertificatesPager) CurrentPage() *ListCertificatesOutput { + return p.Pager.CurrentPage().(*ListCertificatesOutput) } const opListTagsForCertificate = "ListTagsForCertificate" @@ -451,6 +453,7 @@ const opListTagsForCertificate = "ListTagsForCertificate" type ListTagsForCertificateRequest struct { *aws.Request Input *ListTagsForCertificateInput + Copy func(*ListTagsForCertificateInput) ListTagsForCertificateRequest } // Send marshals and sends the ListTagsForCertificate API request. @@ -494,7 +497,7 @@ func (c *ACM) ListTagsForCertificateRequest(input *ListTagsForCertificateInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForCertificateRequest{Request: req, Input: input} + return ListTagsForCertificateRequest{Request: req, Input: input, Copy: c.ListTagsForCertificateRequest} } const opRemoveTagsFromCertificate = "RemoveTagsFromCertificate" @@ -503,6 +506,7 @@ const opRemoveTagsFromCertificate = "RemoveTagsFromCertificate" type RemoveTagsFromCertificateRequest struct { *aws.Request Input *RemoveTagsFromCertificateInput + Copy func(*RemoveTagsFromCertificateInput) RemoveTagsFromCertificateRequest } // Send marshals and sends the RemoveTagsFromCertificate API request. @@ -552,7 +556,7 @@ func (c *ACM) RemoveTagsFromCertificateRequest(input *RemoveTagsFromCertificateI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromCertificateRequest{Request: req, Input: input} + return RemoveTagsFromCertificateRequest{Request: req, Input: input, Copy: c.RemoveTagsFromCertificateRequest} } const opRequestCertificate = "RequestCertificate" @@ -561,6 +565,7 @@ const opRequestCertificate = "RequestCertificate" type RequestCertificateRequest struct { *aws.Request Input *RequestCertificateInput + Copy func(*RequestCertificateInput) RequestCertificateRequest } // Send marshals and sends the RequestCertificate API request. @@ -614,7 +619,7 @@ func (c *ACM) RequestCertificateRequest(input *RequestCertificateInput) RequestC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RequestCertificateRequest{Request: req, Input: input} + return RequestCertificateRequest{Request: req, Input: input, Copy: c.RequestCertificateRequest} } const opResendValidationEmail = "ResendValidationEmail" @@ -623,6 +628,7 @@ const opResendValidationEmail = "ResendValidationEmail" type ResendValidationEmailRequest struct { *aws.Request Input *ResendValidationEmailInput + Copy func(*ResendValidationEmailInput) ResendValidationEmailRequest } // Send marshals and sends the ResendValidationEmail API request. @@ -675,7 +681,7 @@ func (c *ACM) ResendValidationEmailRequest(input *ResendValidationEmailInput) Re req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ResendValidationEmailRequest{Request: req, Input: input} + return ResendValidationEmailRequest{Request: req, Input: input, Copy: c.ResendValidationEmailRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/AddTagsToCertificateRequest diff --git a/service/alexaforbusiness/alexaforbusinessiface/interface.go b/service/alexaforbusiness/alexaforbusinessiface/interface.go index 44d6df49095..8c8f5b70a90 100644 --- a/service/alexaforbusiness/alexaforbusinessiface/interface.go +++ b/service/alexaforbusiness/alexaforbusinessiface/interface.go @@ -9,7 +9,6 @@ package alexaforbusinessiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness" ) @@ -101,14 +100,8 @@ type AlexaForBusinessAPI interface { ListSkillsRequest(*alexaforbusiness.ListSkillsInput) alexaforbusiness.ListSkillsRequest - ListSkillsPages(*alexaforbusiness.ListSkillsInput, func(*alexaforbusiness.ListSkillsOutput, bool) bool) error - ListSkillsPagesWithContext(aws.Context, *alexaforbusiness.ListSkillsInput, func(*alexaforbusiness.ListSkillsOutput, bool) bool, ...aws.Option) error - ListTagsRequest(*alexaforbusiness.ListTagsInput) alexaforbusiness.ListTagsRequest - ListTagsPages(*alexaforbusiness.ListTagsInput, func(*alexaforbusiness.ListTagsOutput, bool) bool) error - ListTagsPagesWithContext(aws.Context, *alexaforbusiness.ListTagsInput, func(*alexaforbusiness.ListTagsOutput, bool) bool, ...aws.Option) error - PutRoomSkillParameterRequest(*alexaforbusiness.PutRoomSkillParameterInput) alexaforbusiness.PutRoomSkillParameterRequest ResolveRoomRequest(*alexaforbusiness.ResolveRoomInput) alexaforbusiness.ResolveRoomRequest @@ -117,29 +110,14 @@ type AlexaForBusinessAPI interface { SearchDevicesRequest(*alexaforbusiness.SearchDevicesInput) alexaforbusiness.SearchDevicesRequest - SearchDevicesPages(*alexaforbusiness.SearchDevicesInput, func(*alexaforbusiness.SearchDevicesOutput, bool) bool) error - SearchDevicesPagesWithContext(aws.Context, *alexaforbusiness.SearchDevicesInput, func(*alexaforbusiness.SearchDevicesOutput, bool) bool, ...aws.Option) error - SearchProfilesRequest(*alexaforbusiness.SearchProfilesInput) alexaforbusiness.SearchProfilesRequest - SearchProfilesPages(*alexaforbusiness.SearchProfilesInput, func(*alexaforbusiness.SearchProfilesOutput, bool) bool) error - SearchProfilesPagesWithContext(aws.Context, *alexaforbusiness.SearchProfilesInput, func(*alexaforbusiness.SearchProfilesOutput, bool) bool, ...aws.Option) error - SearchRoomsRequest(*alexaforbusiness.SearchRoomsInput) alexaforbusiness.SearchRoomsRequest - SearchRoomsPages(*alexaforbusiness.SearchRoomsInput, func(*alexaforbusiness.SearchRoomsOutput, bool) bool) error - SearchRoomsPagesWithContext(aws.Context, *alexaforbusiness.SearchRoomsInput, func(*alexaforbusiness.SearchRoomsOutput, bool) bool, ...aws.Option) error - SearchSkillGroupsRequest(*alexaforbusiness.SearchSkillGroupsInput) alexaforbusiness.SearchSkillGroupsRequest - SearchSkillGroupsPages(*alexaforbusiness.SearchSkillGroupsInput, func(*alexaforbusiness.SearchSkillGroupsOutput, bool) bool) error - SearchSkillGroupsPagesWithContext(aws.Context, *alexaforbusiness.SearchSkillGroupsInput, func(*alexaforbusiness.SearchSkillGroupsOutput, bool) bool, ...aws.Option) error - SearchUsersRequest(*alexaforbusiness.SearchUsersInput) alexaforbusiness.SearchUsersRequest - SearchUsersPages(*alexaforbusiness.SearchUsersInput, func(*alexaforbusiness.SearchUsersOutput, bool) bool) error - SearchUsersPagesWithContext(aws.Context, *alexaforbusiness.SearchUsersInput, func(*alexaforbusiness.SearchUsersOutput, bool) bool, ...aws.Option) error - SendInvitationRequest(*alexaforbusiness.SendInvitationInput) alexaforbusiness.SendInvitationRequest StartDeviceSyncRequest(*alexaforbusiness.StartDeviceSyncInput) alexaforbusiness.StartDeviceSyncRequest diff --git a/service/alexaforbusiness/api.go b/service/alexaforbusiness/api.go index eeacd46e039..8d3fb76e62b 100644 --- a/service/alexaforbusiness/api.go +++ b/service/alexaforbusiness/api.go @@ -15,6 +15,7 @@ const opAssociateDeviceWithRoom = "AssociateDeviceWithRoom" type AssociateDeviceWithRoomRequest struct { *aws.Request Input *AssociateDeviceWithRoomInput + Copy func(*AssociateDeviceWithRoomInput) AssociateDeviceWithRoomRequest } // Send marshals and sends the AssociateDeviceWithRoom API request. @@ -58,7 +59,7 @@ func (c *AlexaForBusiness) AssociateDeviceWithRoomRequest(input *AssociateDevice req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateDeviceWithRoomRequest{Request: req, Input: input} + return AssociateDeviceWithRoomRequest{Request: req, Input: input, Copy: c.AssociateDeviceWithRoomRequest} } const opAssociateSkillGroupWithRoom = "AssociateSkillGroupWithRoom" @@ -67,6 +68,7 @@ const opAssociateSkillGroupWithRoom = "AssociateSkillGroupWithRoom" type AssociateSkillGroupWithRoomRequest struct { *aws.Request Input *AssociateSkillGroupWithRoomInput + Copy func(*AssociateSkillGroupWithRoomInput) AssociateSkillGroupWithRoomRequest } // Send marshals and sends the AssociateSkillGroupWithRoom API request. @@ -108,7 +110,7 @@ func (c *AlexaForBusiness) AssociateSkillGroupWithRoomRequest(input *AssociateSk req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateSkillGroupWithRoomRequest{Request: req, Input: input} + return AssociateSkillGroupWithRoomRequest{Request: req, Input: input, Copy: c.AssociateSkillGroupWithRoomRequest} } const opCreateProfile = "CreateProfile" @@ -117,6 +119,7 @@ const opCreateProfile = "CreateProfile" type CreateProfileRequest struct { *aws.Request Input *CreateProfileInput + Copy func(*CreateProfileInput) CreateProfileRequest } // Send marshals and sends the CreateProfile API request. @@ -157,7 +160,7 @@ func (c *AlexaForBusiness) CreateProfileRequest(input *CreateProfileInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateProfileRequest{Request: req, Input: input} + return CreateProfileRequest{Request: req, Input: input, Copy: c.CreateProfileRequest} } const opCreateRoom = "CreateRoom" @@ -166,6 +169,7 @@ const opCreateRoom = "CreateRoom" type CreateRoomRequest struct { *aws.Request Input *CreateRoomInput + Copy func(*CreateRoomInput) CreateRoomRequest } // Send marshals and sends the CreateRoom API request. @@ -206,7 +210,7 @@ func (c *AlexaForBusiness) CreateRoomRequest(input *CreateRoomInput) CreateRoomR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRoomRequest{Request: req, Input: input} + return CreateRoomRequest{Request: req, Input: input, Copy: c.CreateRoomRequest} } const opCreateSkillGroup = "CreateSkillGroup" @@ -215,6 +219,7 @@ const opCreateSkillGroup = "CreateSkillGroup" type CreateSkillGroupRequest struct { *aws.Request Input *CreateSkillGroupInput + Copy func(*CreateSkillGroupInput) CreateSkillGroupRequest } // Send marshals and sends the CreateSkillGroup API request. @@ -255,7 +260,7 @@ func (c *AlexaForBusiness) CreateSkillGroupRequest(input *CreateSkillGroupInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSkillGroupRequest{Request: req, Input: input} + return CreateSkillGroupRequest{Request: req, Input: input, Copy: c.CreateSkillGroupRequest} } const opCreateUser = "CreateUser" @@ -264,6 +269,7 @@ const opCreateUser = "CreateUser" type CreateUserRequest struct { *aws.Request Input *CreateUserInput + Copy func(*CreateUserInput) CreateUserRequest } // Send marshals and sends the CreateUser API request. @@ -304,7 +310,7 @@ func (c *AlexaForBusiness) CreateUserRequest(input *CreateUserInput) CreateUserR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserRequest{Request: req, Input: input} + return CreateUserRequest{Request: req, Input: input, Copy: c.CreateUserRequest} } const opDeleteProfile = "DeleteProfile" @@ -313,6 +319,7 @@ const opDeleteProfile = "DeleteProfile" type DeleteProfileRequest struct { *aws.Request Input *DeleteProfileInput + Copy func(*DeleteProfileInput) DeleteProfileRequest } // Send marshals and sends the DeleteProfile API request. @@ -353,7 +360,7 @@ func (c *AlexaForBusiness) DeleteProfileRequest(input *DeleteProfileInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteProfileRequest{Request: req, Input: input} + return DeleteProfileRequest{Request: req, Input: input, Copy: c.DeleteProfileRequest} } const opDeleteRoom = "DeleteRoom" @@ -362,6 +369,7 @@ const opDeleteRoom = "DeleteRoom" type DeleteRoomRequest struct { *aws.Request Input *DeleteRoomInput + Copy func(*DeleteRoomInput) DeleteRoomRequest } // Send marshals and sends the DeleteRoom API request. @@ -402,7 +410,7 @@ func (c *AlexaForBusiness) DeleteRoomRequest(input *DeleteRoomInput) DeleteRoomR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRoomRequest{Request: req, Input: input} + return DeleteRoomRequest{Request: req, Input: input, Copy: c.DeleteRoomRequest} } const opDeleteRoomSkillParameter = "DeleteRoomSkillParameter" @@ -411,6 +419,7 @@ const opDeleteRoomSkillParameter = "DeleteRoomSkillParameter" type DeleteRoomSkillParameterRequest struct { *aws.Request Input *DeleteRoomSkillParameterInput + Copy func(*DeleteRoomSkillParameterInput) DeleteRoomSkillParameterRequest } // Send marshals and sends the DeleteRoomSkillParameter API request. @@ -451,7 +460,7 @@ func (c *AlexaForBusiness) DeleteRoomSkillParameterRequest(input *DeleteRoomSkil req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRoomSkillParameterRequest{Request: req, Input: input} + return DeleteRoomSkillParameterRequest{Request: req, Input: input, Copy: c.DeleteRoomSkillParameterRequest} } const opDeleteSkillGroup = "DeleteSkillGroup" @@ -460,6 +469,7 @@ const opDeleteSkillGroup = "DeleteSkillGroup" type DeleteSkillGroupRequest struct { *aws.Request Input *DeleteSkillGroupInput + Copy func(*DeleteSkillGroupInput) DeleteSkillGroupRequest } // Send marshals and sends the DeleteSkillGroup API request. @@ -500,7 +510,7 @@ func (c *AlexaForBusiness) DeleteSkillGroupRequest(input *DeleteSkillGroupInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSkillGroupRequest{Request: req, Input: input} + return DeleteSkillGroupRequest{Request: req, Input: input, Copy: c.DeleteSkillGroupRequest} } const opDeleteUser = "DeleteUser" @@ -509,6 +519,7 @@ const opDeleteUser = "DeleteUser" type DeleteUserRequest struct { *aws.Request Input *DeleteUserInput + Copy func(*DeleteUserInput) DeleteUserRequest } // Send marshals and sends the DeleteUser API request. @@ -549,7 +560,7 @@ func (c *AlexaForBusiness) DeleteUserRequest(input *DeleteUserInput) DeleteUserR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteUserRequest{Request: req, Input: input} + return DeleteUserRequest{Request: req, Input: input, Copy: c.DeleteUserRequest} } const opDisassociateDeviceFromRoom = "DisassociateDeviceFromRoom" @@ -558,6 +569,7 @@ const opDisassociateDeviceFromRoom = "DisassociateDeviceFromRoom" type DisassociateDeviceFromRoomRequest struct { *aws.Request Input *DisassociateDeviceFromRoomInput + Copy func(*DisassociateDeviceFromRoomInput) DisassociateDeviceFromRoomRequest } // Send marshals and sends the DisassociateDeviceFromRoom API request. @@ -600,7 +612,7 @@ func (c *AlexaForBusiness) DisassociateDeviceFromRoomRequest(input *Disassociate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateDeviceFromRoomRequest{Request: req, Input: input} + return DisassociateDeviceFromRoomRequest{Request: req, Input: input, Copy: c.DisassociateDeviceFromRoomRequest} } const opDisassociateSkillGroupFromRoom = "DisassociateSkillGroupFromRoom" @@ -609,6 +621,7 @@ const opDisassociateSkillGroupFromRoom = "DisassociateSkillGroupFromRoom" type DisassociateSkillGroupFromRoomRequest struct { *aws.Request Input *DisassociateSkillGroupFromRoomInput + Copy func(*DisassociateSkillGroupFromRoomInput) DisassociateSkillGroupFromRoomRequest } // Send marshals and sends the DisassociateSkillGroupFromRoom API request. @@ -650,7 +663,7 @@ func (c *AlexaForBusiness) DisassociateSkillGroupFromRoomRequest(input *Disassoc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateSkillGroupFromRoomRequest{Request: req, Input: input} + return DisassociateSkillGroupFromRoomRequest{Request: req, Input: input, Copy: c.DisassociateSkillGroupFromRoomRequest} } const opGetDevice = "GetDevice" @@ -659,6 +672,7 @@ const opGetDevice = "GetDevice" type GetDeviceRequest struct { *aws.Request Input *GetDeviceInput + Copy func(*GetDeviceInput) GetDeviceRequest } // Send marshals and sends the GetDevice API request. @@ -699,7 +713,7 @@ func (c *AlexaForBusiness) GetDeviceRequest(input *GetDeviceInput) GetDeviceRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeviceRequest{Request: req, Input: input} + return GetDeviceRequest{Request: req, Input: input, Copy: c.GetDeviceRequest} } const opGetProfile = "GetProfile" @@ -708,6 +722,7 @@ const opGetProfile = "GetProfile" type GetProfileRequest struct { *aws.Request Input *GetProfileInput + Copy func(*GetProfileInput) GetProfileRequest } // Send marshals and sends the GetProfile API request. @@ -748,7 +763,7 @@ func (c *AlexaForBusiness) GetProfileRequest(input *GetProfileInput) GetProfileR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetProfileRequest{Request: req, Input: input} + return GetProfileRequest{Request: req, Input: input, Copy: c.GetProfileRequest} } const opGetRoom = "GetRoom" @@ -757,6 +772,7 @@ const opGetRoom = "GetRoom" type GetRoomRequest struct { *aws.Request Input *GetRoomInput + Copy func(*GetRoomInput) GetRoomRequest } // Send marshals and sends the GetRoom API request. @@ -797,7 +813,7 @@ func (c *AlexaForBusiness) GetRoomRequest(input *GetRoomInput) GetRoomRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRoomRequest{Request: req, Input: input} + return GetRoomRequest{Request: req, Input: input, Copy: c.GetRoomRequest} } const opGetRoomSkillParameter = "GetRoomSkillParameter" @@ -806,6 +822,7 @@ const opGetRoomSkillParameter = "GetRoomSkillParameter" type GetRoomSkillParameterRequest struct { *aws.Request Input *GetRoomSkillParameterInput + Copy func(*GetRoomSkillParameterInput) GetRoomSkillParameterRequest } // Send marshals and sends the GetRoomSkillParameter API request. @@ -846,7 +863,7 @@ func (c *AlexaForBusiness) GetRoomSkillParameterRequest(input *GetRoomSkillParam req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRoomSkillParameterRequest{Request: req, Input: input} + return GetRoomSkillParameterRequest{Request: req, Input: input, Copy: c.GetRoomSkillParameterRequest} } const opGetSkillGroup = "GetSkillGroup" @@ -855,6 +872,7 @@ const opGetSkillGroup = "GetSkillGroup" type GetSkillGroupRequest struct { *aws.Request Input *GetSkillGroupInput + Copy func(*GetSkillGroupInput) GetSkillGroupRequest } // Send marshals and sends the GetSkillGroup API request. @@ -895,7 +913,7 @@ func (c *AlexaForBusiness) GetSkillGroupRequest(input *GetSkillGroupInput) GetSk req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSkillGroupRequest{Request: req, Input: input} + return GetSkillGroupRequest{Request: req, Input: input, Copy: c.GetSkillGroupRequest} } const opListSkills = "ListSkills" @@ -904,6 +922,7 @@ const opListSkills = "ListSkills" type ListSkillsRequest struct { *aws.Request Input *ListSkillsInput + Copy func(*ListSkillsInput) ListSkillsRequest } // Send marshals and sends the ListSkills API request. @@ -950,57 +969,53 @@ func (c *AlexaForBusiness) ListSkillsRequest(input *ListSkillsInput) ListSkillsR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSkillsRequest{Request: req, Input: input} + return ListSkillsRequest{Request: req, Input: input, Copy: c.ListSkillsRequest} } -// ListSkillsPages iterates over the pages of a ListSkills operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSkills method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListSkillsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListSkills operation. -// pageNum := 0 -// err := client.ListSkillsPages(params, -// func(page *ListSkillsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AlexaForBusiness) ListSkillsPages(input *ListSkillsInput, fn func(*ListSkillsOutput, bool) bool) error { - return c.ListSkillsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSkillsPagesWithContext same as ListSkillsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AlexaForBusiness) ListSkillsPagesWithContext(ctx aws.Context, input *ListSkillsInput, fn func(*ListSkillsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListSkillsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListSkillsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListSkillsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListSkillsRequest) Paginate(opts ...aws.Option) ListSkillsPager { + return ListSkillsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListSkillsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSkillsOutput), !p.HasNextPage()) - } - return p.Err() +// ListSkillsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListSkillsPager struct { + aws.Pager +} + +func (p *ListSkillsPager) CurrentPage() *ListSkillsOutput { + return p.Pager.CurrentPage().(*ListSkillsOutput) } const opListTags = "ListTags" @@ -1009,6 +1024,7 @@ const opListTags = "ListTags" type ListTagsRequest struct { *aws.Request Input *ListTagsInput + Copy func(*ListTagsInput) ListTagsRequest } // Send marshals and sends the ListTags API request. @@ -1055,57 +1071,53 @@ func (c *AlexaForBusiness) ListTagsRequest(input *ListTagsInput) ListTagsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsRequest{Request: req, Input: input} + return ListTagsRequest{Request: req, Input: input, Copy: c.ListTagsRequest} } -// ListTagsPages iterates over the pages of a ListTags operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTags method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTagsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTags operation. -// pageNum := 0 -// err := client.ListTagsPages(params, -// func(page *ListTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AlexaForBusiness) ListTagsPages(input *ListTagsInput, fn func(*ListTagsOutput, bool) bool) error { - return c.ListTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTagsPagesWithContext same as ListTagsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AlexaForBusiness) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, fn func(*ListTagsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTagsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTagsRequest) Paginate(opts ...aws.Option) ListTagsPager { + return ListTagsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTagsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) - } - return p.Err() +// ListTagsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTagsPager struct { + aws.Pager +} + +func (p *ListTagsPager) CurrentPage() *ListTagsOutput { + return p.Pager.CurrentPage().(*ListTagsOutput) } const opPutRoomSkillParameter = "PutRoomSkillParameter" @@ -1114,6 +1126,7 @@ const opPutRoomSkillParameter = "PutRoomSkillParameter" type PutRoomSkillParameterRequest struct { *aws.Request Input *PutRoomSkillParameterInput + Copy func(*PutRoomSkillParameterInput) PutRoomSkillParameterRequest } // Send marshals and sends the PutRoomSkillParameter API request. @@ -1155,7 +1168,7 @@ func (c *AlexaForBusiness) PutRoomSkillParameterRequest(input *PutRoomSkillParam req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutRoomSkillParameterRequest{Request: req, Input: input} + return PutRoomSkillParameterRequest{Request: req, Input: input, Copy: c.PutRoomSkillParameterRequest} } const opResolveRoom = "ResolveRoom" @@ -1164,6 +1177,7 @@ const opResolveRoom = "ResolveRoom" type ResolveRoomRequest struct { *aws.Request Input *ResolveRoomInput + Copy func(*ResolveRoomInput) ResolveRoomRequest } // Send marshals and sends the ResolveRoom API request. @@ -1205,7 +1219,7 @@ func (c *AlexaForBusiness) ResolveRoomRequest(input *ResolveRoomInput) ResolveRo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResolveRoomRequest{Request: req, Input: input} + return ResolveRoomRequest{Request: req, Input: input, Copy: c.ResolveRoomRequest} } const opRevokeInvitation = "RevokeInvitation" @@ -1214,6 +1228,7 @@ const opRevokeInvitation = "RevokeInvitation" type RevokeInvitationRequest struct { *aws.Request Input *RevokeInvitationInput + Copy func(*RevokeInvitationInput) RevokeInvitationRequest } // Send marshals and sends the RevokeInvitation API request. @@ -1254,7 +1269,7 @@ func (c *AlexaForBusiness) RevokeInvitationRequest(input *RevokeInvitationInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RevokeInvitationRequest{Request: req, Input: input} + return RevokeInvitationRequest{Request: req, Input: input, Copy: c.RevokeInvitationRequest} } const opSearchDevices = "SearchDevices" @@ -1263,6 +1278,7 @@ const opSearchDevices = "SearchDevices" type SearchDevicesRequest struct { *aws.Request Input *SearchDevicesInput + Copy func(*SearchDevicesInput) SearchDevicesRequest } // Send marshals and sends the SearchDevices API request. @@ -1309,57 +1325,53 @@ func (c *AlexaForBusiness) SearchDevicesRequest(input *SearchDevicesInput) Searc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchDevicesRequest{Request: req, Input: input} + return SearchDevicesRequest{Request: req, Input: input, Copy: c.SearchDevicesRequest} } -// SearchDevicesPages iterates over the pages of a SearchDevices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchDevices method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SearchDevicesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SearchDevices operation. -// pageNum := 0 -// err := client.SearchDevicesPages(params, -// func(page *SearchDevicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AlexaForBusiness) SearchDevicesPages(input *SearchDevicesInput, fn func(*SearchDevicesOutput, bool) bool) error { - return c.SearchDevicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchDevicesPagesWithContext same as SearchDevicesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AlexaForBusiness) SearchDevicesPagesWithContext(ctx aws.Context, input *SearchDevicesInput, fn func(*SearchDevicesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SearchDevicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SearchDevicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.SearchDevicesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *SearchDevicesRequest) Paginate(opts ...aws.Option) SearchDevicesPager { + return SearchDevicesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SearchDevicesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchDevicesOutput), !p.HasNextPage()) - } - return p.Err() +// SearchDevicesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SearchDevicesPager struct { + aws.Pager +} + +func (p *SearchDevicesPager) CurrentPage() *SearchDevicesOutput { + return p.Pager.CurrentPage().(*SearchDevicesOutput) } const opSearchProfiles = "SearchProfiles" @@ -1368,6 +1380,7 @@ const opSearchProfiles = "SearchProfiles" type SearchProfilesRequest struct { *aws.Request Input *SearchProfilesInput + Copy func(*SearchProfilesInput) SearchProfilesRequest } // Send marshals and sends the SearchProfiles API request. @@ -1414,57 +1427,53 @@ func (c *AlexaForBusiness) SearchProfilesRequest(input *SearchProfilesInput) Sea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchProfilesRequest{Request: req, Input: input} + return SearchProfilesRequest{Request: req, Input: input, Copy: c.SearchProfilesRequest} } -// SearchProfilesPages iterates over the pages of a SearchProfiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchProfiles method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SearchProfilesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SearchProfiles operation. -// pageNum := 0 -// err := client.SearchProfilesPages(params, -// func(page *SearchProfilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AlexaForBusiness) SearchProfilesPages(input *SearchProfilesInput, fn func(*SearchProfilesOutput, bool) bool) error { - return c.SearchProfilesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchProfilesPagesWithContext same as SearchProfilesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AlexaForBusiness) SearchProfilesPagesWithContext(ctx aws.Context, input *SearchProfilesInput, fn func(*SearchProfilesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SearchProfilesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SearchProfilesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.SearchProfilesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *SearchProfilesRequest) Paginate(opts ...aws.Option) SearchProfilesPager { + return SearchProfilesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SearchProfilesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchProfilesOutput), !p.HasNextPage()) - } - return p.Err() +// SearchProfilesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SearchProfilesPager struct { + aws.Pager +} + +func (p *SearchProfilesPager) CurrentPage() *SearchProfilesOutput { + return p.Pager.CurrentPage().(*SearchProfilesOutput) } const opSearchRooms = "SearchRooms" @@ -1473,6 +1482,7 @@ const opSearchRooms = "SearchRooms" type SearchRoomsRequest struct { *aws.Request Input *SearchRoomsInput + Copy func(*SearchRoomsInput) SearchRoomsRequest } // Send marshals and sends the SearchRooms API request. @@ -1519,57 +1529,53 @@ func (c *AlexaForBusiness) SearchRoomsRequest(input *SearchRoomsInput) SearchRoo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchRoomsRequest{Request: req, Input: input} + return SearchRoomsRequest{Request: req, Input: input, Copy: c.SearchRoomsRequest} } -// SearchRoomsPages iterates over the pages of a SearchRooms operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchRooms method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SearchRoomsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SearchRooms operation. -// pageNum := 0 -// err := client.SearchRoomsPages(params, -// func(page *SearchRoomsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AlexaForBusiness) SearchRoomsPages(input *SearchRoomsInput, fn func(*SearchRoomsOutput, bool) bool) error { - return c.SearchRoomsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchRoomsPagesWithContext same as SearchRoomsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AlexaForBusiness) SearchRoomsPagesWithContext(ctx aws.Context, input *SearchRoomsInput, fn func(*SearchRoomsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SearchRoomsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SearchRoomsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.SearchRoomsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *SearchRoomsRequest) Paginate(opts ...aws.Option) SearchRoomsPager { + return SearchRoomsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SearchRoomsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchRoomsOutput), !p.HasNextPage()) - } - return p.Err() +// SearchRoomsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SearchRoomsPager struct { + aws.Pager +} + +func (p *SearchRoomsPager) CurrentPage() *SearchRoomsOutput { + return p.Pager.CurrentPage().(*SearchRoomsOutput) } const opSearchSkillGroups = "SearchSkillGroups" @@ -1578,6 +1584,7 @@ const opSearchSkillGroups = "SearchSkillGroups" type SearchSkillGroupsRequest struct { *aws.Request Input *SearchSkillGroupsInput + Copy func(*SearchSkillGroupsInput) SearchSkillGroupsRequest } // Send marshals and sends the SearchSkillGroups API request. @@ -1625,57 +1632,53 @@ func (c *AlexaForBusiness) SearchSkillGroupsRequest(input *SearchSkillGroupsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchSkillGroupsRequest{Request: req, Input: input} + return SearchSkillGroupsRequest{Request: req, Input: input, Copy: c.SearchSkillGroupsRequest} } -// SearchSkillGroupsPages iterates over the pages of a SearchSkillGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchSkillGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SearchSkillGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SearchSkillGroups operation. -// pageNum := 0 -// err := client.SearchSkillGroupsPages(params, -// func(page *SearchSkillGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AlexaForBusiness) SearchSkillGroupsPages(input *SearchSkillGroupsInput, fn func(*SearchSkillGroupsOutput, bool) bool) error { - return c.SearchSkillGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchSkillGroupsPagesWithContext same as SearchSkillGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AlexaForBusiness) SearchSkillGroupsPagesWithContext(ctx aws.Context, input *SearchSkillGroupsInput, fn func(*SearchSkillGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SearchSkillGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SearchSkillGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.SearchSkillGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *SearchSkillGroupsRequest) Paginate(opts ...aws.Option) SearchSkillGroupsPager { + return SearchSkillGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SearchSkillGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchSkillGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// SearchSkillGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SearchSkillGroupsPager struct { + aws.Pager +} + +func (p *SearchSkillGroupsPager) CurrentPage() *SearchSkillGroupsOutput { + return p.Pager.CurrentPage().(*SearchSkillGroupsOutput) } const opSearchUsers = "SearchUsers" @@ -1684,6 +1687,7 @@ const opSearchUsers = "SearchUsers" type SearchUsersRequest struct { *aws.Request Input *SearchUsersInput + Copy func(*SearchUsersInput) SearchUsersRequest } // Send marshals and sends the SearchUsers API request. @@ -1730,57 +1734,53 @@ func (c *AlexaForBusiness) SearchUsersRequest(input *SearchUsersInput) SearchUse req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchUsersRequest{Request: req, Input: input} + return SearchUsersRequest{Request: req, Input: input, Copy: c.SearchUsersRequest} } -// SearchUsersPages iterates over the pages of a SearchUsers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchUsers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SearchUsersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SearchUsers operation. -// pageNum := 0 -// err := client.SearchUsersPages(params, -// func(page *SearchUsersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AlexaForBusiness) SearchUsersPages(input *SearchUsersInput, fn func(*SearchUsersOutput, bool) bool) error { - return c.SearchUsersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchUsersPagesWithContext same as SearchUsersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AlexaForBusiness) SearchUsersPagesWithContext(ctx aws.Context, input *SearchUsersInput, fn func(*SearchUsersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SearchUsersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SearchUsersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.SearchUsersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *SearchUsersRequest) Paginate(opts ...aws.Option) SearchUsersPager { + return SearchUsersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SearchUsersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchUsersOutput), !p.HasNextPage()) - } - return p.Err() +// SearchUsersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SearchUsersPager struct { + aws.Pager +} + +func (p *SearchUsersPager) CurrentPage() *SearchUsersOutput { + return p.Pager.CurrentPage().(*SearchUsersOutput) } const opSendInvitation = "SendInvitation" @@ -1789,6 +1789,7 @@ const opSendInvitation = "SendInvitation" type SendInvitationRequest struct { *aws.Request Input *SendInvitationInput + Copy func(*SendInvitationInput) SendInvitationRequest } // Send marshals and sends the SendInvitation API request. @@ -1830,7 +1831,7 @@ func (c *AlexaForBusiness) SendInvitationRequest(input *SendInvitationInput) Sen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendInvitationRequest{Request: req, Input: input} + return SendInvitationRequest{Request: req, Input: input, Copy: c.SendInvitationRequest} } const opStartDeviceSync = "StartDeviceSync" @@ -1839,6 +1840,7 @@ const opStartDeviceSync = "StartDeviceSync" type StartDeviceSyncRequest struct { *aws.Request Input *StartDeviceSyncInput + Copy func(*StartDeviceSyncInput) StartDeviceSyncRequest } // Send marshals and sends the StartDeviceSync API request. @@ -1880,7 +1882,7 @@ func (c *AlexaForBusiness) StartDeviceSyncRequest(input *StartDeviceSyncInput) S req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartDeviceSyncRequest{Request: req, Input: input} + return StartDeviceSyncRequest{Request: req, Input: input, Copy: c.StartDeviceSyncRequest} } const opTagResource = "TagResource" @@ -1889,6 +1891,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -1929,7 +1932,7 @@ func (c *AlexaForBusiness) TagResourceRequest(input *TagResourceInput) TagResour req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource" @@ -1938,6 +1941,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -1978,7 +1982,7 @@ func (c *AlexaForBusiness) UntagResourceRequest(input *UntagResourceInput) Untag req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateDevice = "UpdateDevice" @@ -1987,6 +1991,7 @@ const opUpdateDevice = "UpdateDevice" type UpdateDeviceRequest struct { *aws.Request Input *UpdateDeviceInput + Copy func(*UpdateDeviceInput) UpdateDeviceRequest } // Send marshals and sends the UpdateDevice API request. @@ -2027,7 +2032,7 @@ func (c *AlexaForBusiness) UpdateDeviceRequest(input *UpdateDeviceInput) UpdateD req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDeviceRequest{Request: req, Input: input} + return UpdateDeviceRequest{Request: req, Input: input, Copy: c.UpdateDeviceRequest} } const opUpdateProfile = "UpdateProfile" @@ -2036,6 +2041,7 @@ const opUpdateProfile = "UpdateProfile" type UpdateProfileRequest struct { *aws.Request Input *UpdateProfileInput + Copy func(*UpdateProfileInput) UpdateProfileRequest } // Send marshals and sends the UpdateProfile API request. @@ -2076,7 +2082,7 @@ func (c *AlexaForBusiness) UpdateProfileRequest(input *UpdateProfileInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateProfileRequest{Request: req, Input: input} + return UpdateProfileRequest{Request: req, Input: input, Copy: c.UpdateProfileRequest} } const opUpdateRoom = "UpdateRoom" @@ -2085,6 +2091,7 @@ const opUpdateRoom = "UpdateRoom" type UpdateRoomRequest struct { *aws.Request Input *UpdateRoomInput + Copy func(*UpdateRoomInput) UpdateRoomRequest } // Send marshals and sends the UpdateRoom API request. @@ -2125,7 +2132,7 @@ func (c *AlexaForBusiness) UpdateRoomRequest(input *UpdateRoomInput) UpdateRoomR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRoomRequest{Request: req, Input: input} + return UpdateRoomRequest{Request: req, Input: input, Copy: c.UpdateRoomRequest} } const opUpdateSkillGroup = "UpdateSkillGroup" @@ -2134,6 +2141,7 @@ const opUpdateSkillGroup = "UpdateSkillGroup" type UpdateSkillGroupRequest struct { *aws.Request Input *UpdateSkillGroupInput + Copy func(*UpdateSkillGroupInput) UpdateSkillGroupRequest } // Send marshals and sends the UpdateSkillGroup API request. @@ -2174,7 +2182,7 @@ func (c *AlexaForBusiness) UpdateSkillGroupRequest(input *UpdateSkillGroupInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSkillGroupRequest{Request: req, Input: input} + return UpdateSkillGroupRequest{Request: req, Input: input, Copy: c.UpdateSkillGroupRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/alexaforbusiness-2017-11-09/AssociateDeviceWithRoomRequest diff --git a/service/apigateway/api.go b/service/apigateway/api.go index 87ecc6fdfd7..81e18bb7fff 100644 --- a/service/apigateway/api.go +++ b/service/apigateway/api.go @@ -17,6 +17,7 @@ const opCreateApiKey = "CreateApiKey" type CreateApiKeyRequest struct { *aws.Request Input *CreateApiKeyInput + Copy func(*CreateApiKeyInput) CreateApiKeyRequest } // Send marshals and sends the CreateApiKey API request. @@ -57,7 +58,7 @@ func (c *APIGateway) CreateApiKeyRequest(input *CreateApiKeyInput) CreateApiKeyR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateApiKeyRequest{Request: req, Input: input} + return CreateApiKeyRequest{Request: req, Input: input, Copy: c.CreateApiKeyRequest} } const opCreateAuthorizer = "CreateAuthorizer" @@ -66,6 +67,7 @@ const opCreateAuthorizer = "CreateAuthorizer" type CreateAuthorizerRequest struct { *aws.Request Input *CreateAuthorizerInput + Copy func(*CreateAuthorizerInput) CreateAuthorizerRequest } // Send marshals and sends the CreateAuthorizer API request. @@ -106,7 +108,7 @@ func (c *APIGateway) CreateAuthorizerRequest(input *CreateAuthorizerInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAuthorizerRequest{Request: req, Input: input} + return CreateAuthorizerRequest{Request: req, Input: input, Copy: c.CreateAuthorizerRequest} } const opCreateBasePathMapping = "CreateBasePathMapping" @@ -115,6 +117,7 @@ const opCreateBasePathMapping = "CreateBasePathMapping" type CreateBasePathMappingRequest struct { *aws.Request Input *CreateBasePathMappingInput + Copy func(*CreateBasePathMappingInput) CreateBasePathMappingRequest } // Send marshals and sends the CreateBasePathMapping API request. @@ -153,7 +156,7 @@ func (c *APIGateway) CreateBasePathMappingRequest(input *CreateBasePathMappingIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBasePathMappingRequest{Request: req, Input: input} + return CreateBasePathMappingRequest{Request: req, Input: input, Copy: c.CreateBasePathMappingRequest} } const opCreateDeployment = "CreateDeployment" @@ -162,6 +165,7 @@ const opCreateDeployment = "CreateDeployment" type CreateDeploymentRequest struct { *aws.Request Input *CreateDeploymentInput + Copy func(*CreateDeploymentInput) CreateDeploymentRequest } // Send marshals and sends the CreateDeployment API request. @@ -201,7 +205,7 @@ func (c *APIGateway) CreateDeploymentRequest(input *CreateDeploymentInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDeploymentRequest{Request: req, Input: input} + return CreateDeploymentRequest{Request: req, Input: input, Copy: c.CreateDeploymentRequest} } const opCreateDocumentationPart = "CreateDocumentationPart" @@ -210,6 +214,7 @@ const opCreateDocumentationPart = "CreateDocumentationPart" type CreateDocumentationPartRequest struct { *aws.Request Input *CreateDocumentationPartInput + Copy func(*CreateDocumentationPartInput) CreateDocumentationPartRequest } // Send marshals and sends the CreateDocumentationPart API request. @@ -246,7 +251,7 @@ func (c *APIGateway) CreateDocumentationPartRequest(input *CreateDocumentationPa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDocumentationPartRequest{Request: req, Input: input} + return CreateDocumentationPartRequest{Request: req, Input: input, Copy: c.CreateDocumentationPartRequest} } const opCreateDocumentationVersion = "CreateDocumentationVersion" @@ -255,6 +260,7 @@ const opCreateDocumentationVersion = "CreateDocumentationVersion" type CreateDocumentationVersionRequest struct { *aws.Request Input *CreateDocumentationVersionInput + Copy func(*CreateDocumentationVersionInput) CreateDocumentationVersionRequest } // Send marshals and sends the CreateDocumentationVersion API request. @@ -291,7 +297,7 @@ func (c *APIGateway) CreateDocumentationVersionRequest(input *CreateDocumentatio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDocumentationVersionRequest{Request: req, Input: input} + return CreateDocumentationVersionRequest{Request: req, Input: input, Copy: c.CreateDocumentationVersionRequest} } const opCreateDomainName = "CreateDomainName" @@ -300,6 +306,7 @@ const opCreateDomainName = "CreateDomainName" type CreateDomainNameRequest struct { *aws.Request Input *CreateDomainNameInput + Copy func(*CreateDomainNameInput) CreateDomainNameRequest } // Send marshals and sends the CreateDomainName API request. @@ -338,7 +345,7 @@ func (c *APIGateway) CreateDomainNameRequest(input *CreateDomainNameInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDomainNameRequest{Request: req, Input: input} + return CreateDomainNameRequest{Request: req, Input: input, Copy: c.CreateDomainNameRequest} } const opCreateModel = "CreateModel" @@ -347,6 +354,7 @@ const opCreateModel = "CreateModel" type CreateModelRequest struct { *aws.Request Input *CreateModelInput + Copy func(*CreateModelInput) CreateModelRequest } // Send marshals and sends the CreateModel API request. @@ -385,7 +393,7 @@ func (c *APIGateway) CreateModelRequest(input *CreateModelInput) CreateModelRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateModelRequest{Request: req, Input: input} + return CreateModelRequest{Request: req, Input: input, Copy: c.CreateModelRequest} } const opCreateRequestValidator = "CreateRequestValidator" @@ -394,6 +402,7 @@ const opCreateRequestValidator = "CreateRequestValidator" type CreateRequestValidatorRequest struct { *aws.Request Input *CreateRequestValidatorInput + Copy func(*CreateRequestValidatorInput) CreateRequestValidatorRequest } // Send marshals and sends the CreateRequestValidator API request. @@ -432,7 +441,7 @@ func (c *APIGateway) CreateRequestValidatorRequest(input *CreateRequestValidator req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRequestValidatorRequest{Request: req, Input: input} + return CreateRequestValidatorRequest{Request: req, Input: input, Copy: c.CreateRequestValidatorRequest} } const opCreateResource = "CreateResource" @@ -441,6 +450,7 @@ const opCreateResource = "CreateResource" type CreateResourceRequest struct { *aws.Request Input *CreateResourceInput + Copy func(*CreateResourceInput) CreateResourceRequest } // Send marshals and sends the CreateResource API request. @@ -479,7 +489,7 @@ func (c *APIGateway) CreateResourceRequest(input *CreateResourceInput) CreateRes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateResourceRequest{Request: req, Input: input} + return CreateResourceRequest{Request: req, Input: input, Copy: c.CreateResourceRequest} } const opCreateRestApi = "CreateRestApi" @@ -488,6 +498,7 @@ const opCreateRestApi = "CreateRestApi" type CreateRestApiRequest struct { *aws.Request Input *CreateRestApiInput + Copy func(*CreateRestApiInput) CreateRestApiRequest } // Send marshals and sends the CreateRestApi API request. @@ -526,7 +537,7 @@ func (c *APIGateway) CreateRestApiRequest(input *CreateRestApiInput) CreateRestA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRestApiRequest{Request: req, Input: input} + return CreateRestApiRequest{Request: req, Input: input, Copy: c.CreateRestApiRequest} } const opCreateStage = "CreateStage" @@ -535,6 +546,7 @@ const opCreateStage = "CreateStage" type CreateStageRequest struct { *aws.Request Input *CreateStageInput + Copy func(*CreateStageInput) CreateStageRequest } // Send marshals and sends the CreateStage API request. @@ -574,7 +586,7 @@ func (c *APIGateway) CreateStageRequest(input *CreateStageInput) CreateStageRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStageRequest{Request: req, Input: input} + return CreateStageRequest{Request: req, Input: input, Copy: c.CreateStageRequest} } const opCreateUsagePlan = "CreateUsagePlan" @@ -583,6 +595,7 @@ const opCreateUsagePlan = "CreateUsagePlan" type CreateUsagePlanRequest struct { *aws.Request Input *CreateUsagePlanInput + Copy func(*CreateUsagePlanInput) CreateUsagePlanRequest } // Send marshals and sends the CreateUsagePlan API request. @@ -622,7 +635,7 @@ func (c *APIGateway) CreateUsagePlanRequest(input *CreateUsagePlanInput) CreateU req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUsagePlanRequest{Request: req, Input: input} + return CreateUsagePlanRequest{Request: req, Input: input, Copy: c.CreateUsagePlanRequest} } const opCreateUsagePlanKey = "CreateUsagePlanKey" @@ -631,6 +644,7 @@ const opCreateUsagePlanKey = "CreateUsagePlanKey" type CreateUsagePlanKeyRequest struct { *aws.Request Input *CreateUsagePlanKeyInput + Copy func(*CreateUsagePlanKeyInput) CreateUsagePlanKeyRequest } // Send marshals and sends the CreateUsagePlanKey API request. @@ -669,7 +683,7 @@ func (c *APIGateway) CreateUsagePlanKeyRequest(input *CreateUsagePlanKeyInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUsagePlanKeyRequest{Request: req, Input: input} + return CreateUsagePlanKeyRequest{Request: req, Input: input, Copy: c.CreateUsagePlanKeyRequest} } const opCreateVpcLink = "CreateVpcLink" @@ -678,6 +692,7 @@ const opCreateVpcLink = "CreateVpcLink" type CreateVpcLinkRequest struct { *aws.Request Input *CreateVpcLinkInput + Copy func(*CreateVpcLinkInput) CreateVpcLinkRequest } // Send marshals and sends the CreateVpcLink API request. @@ -719,7 +734,7 @@ func (c *APIGateway) CreateVpcLinkRequest(input *CreateVpcLinkInput) CreateVpcLi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpcLinkRequest{Request: req, Input: input} + return CreateVpcLinkRequest{Request: req, Input: input, Copy: c.CreateVpcLinkRequest} } const opDeleteApiKey = "DeleteApiKey" @@ -728,6 +743,7 @@ const opDeleteApiKey = "DeleteApiKey" type DeleteApiKeyRequest struct { *aws.Request Input *DeleteApiKeyInput + Copy func(*DeleteApiKeyInput) DeleteApiKeyRequest } // Send marshals and sends the DeleteApiKey API request. @@ -768,7 +784,7 @@ func (c *APIGateway) DeleteApiKeyRequest(input *DeleteApiKeyInput) DeleteApiKeyR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteApiKeyRequest{Request: req, Input: input} + return DeleteApiKeyRequest{Request: req, Input: input, Copy: c.DeleteApiKeyRequest} } const opDeleteAuthorizer = "DeleteAuthorizer" @@ -777,6 +793,7 @@ const opDeleteAuthorizer = "DeleteAuthorizer" type DeleteAuthorizerRequest struct { *aws.Request Input *DeleteAuthorizerInput + Copy func(*DeleteAuthorizerInput) DeleteAuthorizerRequest } // Send marshals and sends the DeleteAuthorizer API request. @@ -819,7 +836,7 @@ func (c *APIGateway) DeleteAuthorizerRequest(input *DeleteAuthorizerInput) Delet req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAuthorizerRequest{Request: req, Input: input} + return DeleteAuthorizerRequest{Request: req, Input: input, Copy: c.DeleteAuthorizerRequest} } const opDeleteBasePathMapping = "DeleteBasePathMapping" @@ -828,6 +845,7 @@ const opDeleteBasePathMapping = "DeleteBasePathMapping" type DeleteBasePathMappingRequest struct { *aws.Request Input *DeleteBasePathMappingInput + Copy func(*DeleteBasePathMappingInput) DeleteBasePathMappingRequest } // Send marshals and sends the DeleteBasePathMapping API request. @@ -868,7 +886,7 @@ func (c *APIGateway) DeleteBasePathMappingRequest(input *DeleteBasePathMappingIn req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBasePathMappingRequest{Request: req, Input: input} + return DeleteBasePathMappingRequest{Request: req, Input: input, Copy: c.DeleteBasePathMappingRequest} } const opDeleteClientCertificate = "DeleteClientCertificate" @@ -877,6 +895,7 @@ const opDeleteClientCertificate = "DeleteClientCertificate" type DeleteClientCertificateRequest struct { *aws.Request Input *DeleteClientCertificateInput + Copy func(*DeleteClientCertificateInput) DeleteClientCertificateRequest } // Send marshals and sends the DeleteClientCertificate API request. @@ -917,7 +936,7 @@ func (c *APIGateway) DeleteClientCertificateRequest(input *DeleteClientCertifica req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteClientCertificateRequest{Request: req, Input: input} + return DeleteClientCertificateRequest{Request: req, Input: input, Copy: c.DeleteClientCertificateRequest} } const opDeleteDeployment = "DeleteDeployment" @@ -926,6 +945,7 @@ const opDeleteDeployment = "DeleteDeployment" type DeleteDeploymentRequest struct { *aws.Request Input *DeleteDeploymentInput + Copy func(*DeleteDeploymentInput) DeleteDeploymentRequest } // Send marshals and sends the DeleteDeployment API request. @@ -967,7 +987,7 @@ func (c *APIGateway) DeleteDeploymentRequest(input *DeleteDeploymentInput) Delet req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDeploymentRequest{Request: req, Input: input} + return DeleteDeploymentRequest{Request: req, Input: input, Copy: c.DeleteDeploymentRequest} } const opDeleteDocumentationPart = "DeleteDocumentationPart" @@ -976,6 +996,7 @@ const opDeleteDocumentationPart = "DeleteDocumentationPart" type DeleteDocumentationPartRequest struct { *aws.Request Input *DeleteDocumentationPartInput + Copy func(*DeleteDocumentationPartInput) DeleteDocumentationPartRequest } // Send marshals and sends the DeleteDocumentationPart API request. @@ -1014,7 +1035,7 @@ func (c *APIGateway) DeleteDocumentationPartRequest(input *DeleteDocumentationPa req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDocumentationPartRequest{Request: req, Input: input} + return DeleteDocumentationPartRequest{Request: req, Input: input, Copy: c.DeleteDocumentationPartRequest} } const opDeleteDocumentationVersion = "DeleteDocumentationVersion" @@ -1023,6 +1044,7 @@ const opDeleteDocumentationVersion = "DeleteDocumentationVersion" type DeleteDocumentationVersionRequest struct { *aws.Request Input *DeleteDocumentationVersionInput + Copy func(*DeleteDocumentationVersionInput) DeleteDocumentationVersionRequest } // Send marshals and sends the DeleteDocumentationVersion API request. @@ -1061,7 +1083,7 @@ func (c *APIGateway) DeleteDocumentationVersionRequest(input *DeleteDocumentatio req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDocumentationVersionRequest{Request: req, Input: input} + return DeleteDocumentationVersionRequest{Request: req, Input: input, Copy: c.DeleteDocumentationVersionRequest} } const opDeleteDomainName = "DeleteDomainName" @@ -1070,6 +1092,7 @@ const opDeleteDomainName = "DeleteDomainName" type DeleteDomainNameRequest struct { *aws.Request Input *DeleteDomainNameInput + Copy func(*DeleteDomainNameInput) DeleteDomainNameRequest } // Send marshals and sends the DeleteDomainName API request. @@ -1110,7 +1133,7 @@ func (c *APIGateway) DeleteDomainNameRequest(input *DeleteDomainNameInput) Delet req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDomainNameRequest{Request: req, Input: input} + return DeleteDomainNameRequest{Request: req, Input: input, Copy: c.DeleteDomainNameRequest} } const opDeleteGatewayResponse = "DeleteGatewayResponse" @@ -1119,6 +1142,7 @@ const opDeleteGatewayResponse = "DeleteGatewayResponse" type DeleteGatewayResponseRequest struct { *aws.Request Input *DeleteGatewayResponseInput + Copy func(*DeleteGatewayResponseInput) DeleteGatewayResponseRequest } // Send marshals and sends the DeleteGatewayResponse API request. @@ -1160,7 +1184,7 @@ func (c *APIGateway) DeleteGatewayResponseRequest(input *DeleteGatewayResponseIn req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteGatewayResponseRequest{Request: req, Input: input} + return DeleteGatewayResponseRequest{Request: req, Input: input, Copy: c.DeleteGatewayResponseRequest} } const opDeleteIntegration = "DeleteIntegration" @@ -1169,6 +1193,7 @@ const opDeleteIntegration = "DeleteIntegration" type DeleteIntegrationRequest struct { *aws.Request Input *DeleteIntegrationInput + Copy func(*DeleteIntegrationInput) DeleteIntegrationRequest } // Send marshals and sends the DeleteIntegration API request. @@ -1209,7 +1234,7 @@ func (c *APIGateway) DeleteIntegrationRequest(input *DeleteIntegrationInput) Del req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteIntegrationRequest{Request: req, Input: input} + return DeleteIntegrationRequest{Request: req, Input: input, Copy: c.DeleteIntegrationRequest} } const opDeleteIntegrationResponse = "DeleteIntegrationResponse" @@ -1218,6 +1243,7 @@ const opDeleteIntegrationResponse = "DeleteIntegrationResponse" type DeleteIntegrationResponseRequest struct { *aws.Request Input *DeleteIntegrationResponseInput + Copy func(*DeleteIntegrationResponseInput) DeleteIntegrationResponseRequest } // Send marshals and sends the DeleteIntegrationResponse API request. @@ -1258,7 +1284,7 @@ func (c *APIGateway) DeleteIntegrationResponseRequest(input *DeleteIntegrationRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteIntegrationResponseRequest{Request: req, Input: input} + return DeleteIntegrationResponseRequest{Request: req, Input: input, Copy: c.DeleteIntegrationResponseRequest} } const opDeleteMethod = "DeleteMethod" @@ -1267,6 +1293,7 @@ const opDeleteMethod = "DeleteMethod" type DeleteMethodRequest struct { *aws.Request Input *DeleteMethodInput + Copy func(*DeleteMethodInput) DeleteMethodRequest } // Send marshals and sends the DeleteMethod API request. @@ -1307,7 +1334,7 @@ func (c *APIGateway) DeleteMethodRequest(input *DeleteMethodInput) DeleteMethodR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteMethodRequest{Request: req, Input: input} + return DeleteMethodRequest{Request: req, Input: input, Copy: c.DeleteMethodRequest} } const opDeleteMethodResponse = "DeleteMethodResponse" @@ -1316,6 +1343,7 @@ const opDeleteMethodResponse = "DeleteMethodResponse" type DeleteMethodResponseRequest struct { *aws.Request Input *DeleteMethodResponseInput + Copy func(*DeleteMethodResponseInput) DeleteMethodResponseRequest } // Send marshals and sends the DeleteMethodResponse API request. @@ -1356,7 +1384,7 @@ func (c *APIGateway) DeleteMethodResponseRequest(input *DeleteMethodResponseInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteMethodResponseRequest{Request: req, Input: input} + return DeleteMethodResponseRequest{Request: req, Input: input, Copy: c.DeleteMethodResponseRequest} } const opDeleteModel = "DeleteModel" @@ -1365,6 +1393,7 @@ const opDeleteModel = "DeleteModel" type DeleteModelRequest struct { *aws.Request Input *DeleteModelInput + Copy func(*DeleteModelInput) DeleteModelRequest } // Send marshals and sends the DeleteModel API request. @@ -1405,7 +1434,7 @@ func (c *APIGateway) DeleteModelRequest(input *DeleteModelInput) DeleteModelRequ req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteModelRequest{Request: req, Input: input} + return DeleteModelRequest{Request: req, Input: input, Copy: c.DeleteModelRequest} } const opDeleteRequestValidator = "DeleteRequestValidator" @@ -1414,6 +1443,7 @@ const opDeleteRequestValidator = "DeleteRequestValidator" type DeleteRequestValidatorRequest struct { *aws.Request Input *DeleteRequestValidatorInput + Copy func(*DeleteRequestValidatorInput) DeleteRequestValidatorRequest } // Send marshals and sends the DeleteRequestValidator API request. @@ -1454,7 +1484,7 @@ func (c *APIGateway) DeleteRequestValidatorRequest(input *DeleteRequestValidator req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteRequestValidatorRequest{Request: req, Input: input} + return DeleteRequestValidatorRequest{Request: req, Input: input, Copy: c.DeleteRequestValidatorRequest} } const opDeleteResource = "DeleteResource" @@ -1463,6 +1493,7 @@ const opDeleteResource = "DeleteResource" type DeleteResourceRequest struct { *aws.Request Input *DeleteResourceInput + Copy func(*DeleteResourceInput) DeleteResourceRequest } // Send marshals and sends the DeleteResource API request. @@ -1503,7 +1534,7 @@ func (c *APIGateway) DeleteResourceRequest(input *DeleteResourceInput) DeleteRes req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteResourceRequest{Request: req, Input: input} + return DeleteResourceRequest{Request: req, Input: input, Copy: c.DeleteResourceRequest} } const opDeleteRestApi = "DeleteRestApi" @@ -1512,6 +1543,7 @@ const opDeleteRestApi = "DeleteRestApi" type DeleteRestApiRequest struct { *aws.Request Input *DeleteRestApiInput + Copy func(*DeleteRestApiInput) DeleteRestApiRequest } // Send marshals and sends the DeleteRestApi API request. @@ -1552,7 +1584,7 @@ func (c *APIGateway) DeleteRestApiRequest(input *DeleteRestApiInput) DeleteRestA req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteRestApiRequest{Request: req, Input: input} + return DeleteRestApiRequest{Request: req, Input: input, Copy: c.DeleteRestApiRequest} } const opDeleteStage = "DeleteStage" @@ -1561,6 +1593,7 @@ const opDeleteStage = "DeleteStage" type DeleteStageRequest struct { *aws.Request Input *DeleteStageInput + Copy func(*DeleteStageInput) DeleteStageRequest } // Send marshals and sends the DeleteStage API request. @@ -1601,7 +1634,7 @@ func (c *APIGateway) DeleteStageRequest(input *DeleteStageInput) DeleteStageRequ req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteStageRequest{Request: req, Input: input} + return DeleteStageRequest{Request: req, Input: input, Copy: c.DeleteStageRequest} } const opDeleteUsagePlan = "DeleteUsagePlan" @@ -1610,6 +1643,7 @@ const opDeleteUsagePlan = "DeleteUsagePlan" type DeleteUsagePlanRequest struct { *aws.Request Input *DeleteUsagePlanInput + Copy func(*DeleteUsagePlanInput) DeleteUsagePlanRequest } // Send marshals and sends the DeleteUsagePlan API request. @@ -1650,7 +1684,7 @@ func (c *APIGateway) DeleteUsagePlanRequest(input *DeleteUsagePlanInput) DeleteU req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteUsagePlanRequest{Request: req, Input: input} + return DeleteUsagePlanRequest{Request: req, Input: input, Copy: c.DeleteUsagePlanRequest} } const opDeleteUsagePlanKey = "DeleteUsagePlanKey" @@ -1659,6 +1693,7 @@ const opDeleteUsagePlanKey = "DeleteUsagePlanKey" type DeleteUsagePlanKeyRequest struct { *aws.Request Input *DeleteUsagePlanKeyInput + Copy func(*DeleteUsagePlanKeyInput) DeleteUsagePlanKeyRequest } // Send marshals and sends the DeleteUsagePlanKey API request. @@ -1700,7 +1735,7 @@ func (c *APIGateway) DeleteUsagePlanKeyRequest(input *DeleteUsagePlanKeyInput) D req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteUsagePlanKeyRequest{Request: req, Input: input} + return DeleteUsagePlanKeyRequest{Request: req, Input: input, Copy: c.DeleteUsagePlanKeyRequest} } const opDeleteVpcLink = "DeleteVpcLink" @@ -1709,6 +1744,7 @@ const opDeleteVpcLink = "DeleteVpcLink" type DeleteVpcLinkRequest struct { *aws.Request Input *DeleteVpcLinkInput + Copy func(*DeleteVpcLinkInput) DeleteVpcLinkRequest } // Send marshals and sends the DeleteVpcLink API request. @@ -1749,7 +1785,7 @@ func (c *APIGateway) DeleteVpcLinkRequest(input *DeleteVpcLinkInput) DeleteVpcLi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVpcLinkRequest{Request: req, Input: input} + return DeleteVpcLinkRequest{Request: req, Input: input, Copy: c.DeleteVpcLinkRequest} } const opFlushStageAuthorizersCache = "FlushStageAuthorizersCache" @@ -1758,6 +1794,7 @@ const opFlushStageAuthorizersCache = "FlushStageAuthorizersCache" type FlushStageAuthorizersCacheRequest struct { *aws.Request Input *FlushStageAuthorizersCacheInput + Copy func(*FlushStageAuthorizersCacheInput) FlushStageAuthorizersCacheRequest } // Send marshals and sends the FlushStageAuthorizersCache API request. @@ -1798,7 +1835,7 @@ func (c *APIGateway) FlushStageAuthorizersCacheRequest(input *FlushStageAuthoriz req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return FlushStageAuthorizersCacheRequest{Request: req, Input: input} + return FlushStageAuthorizersCacheRequest{Request: req, Input: input, Copy: c.FlushStageAuthorizersCacheRequest} } const opFlushStageCache = "FlushStageCache" @@ -1807,6 +1844,7 @@ const opFlushStageCache = "FlushStageCache" type FlushStageCacheRequest struct { *aws.Request Input *FlushStageCacheInput + Copy func(*FlushStageCacheInput) FlushStageCacheRequest } // Send marshals and sends the FlushStageCache API request. @@ -1847,7 +1885,7 @@ func (c *APIGateway) FlushStageCacheRequest(input *FlushStageCacheInput) FlushSt req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return FlushStageCacheRequest{Request: req, Input: input} + return FlushStageCacheRequest{Request: req, Input: input, Copy: c.FlushStageCacheRequest} } const opGenerateClientCertificate = "GenerateClientCertificate" @@ -1856,6 +1894,7 @@ const opGenerateClientCertificate = "GenerateClientCertificate" type GenerateClientCertificateRequest struct { *aws.Request Input *GenerateClientCertificateInput + Copy func(*GenerateClientCertificateInput) GenerateClientCertificateRequest } // Send marshals and sends the GenerateClientCertificate API request. @@ -1894,7 +1933,7 @@ func (c *APIGateway) GenerateClientCertificateRequest(input *GenerateClientCerti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GenerateClientCertificateRequest{Request: req, Input: input} + return GenerateClientCertificateRequest{Request: req, Input: input, Copy: c.GenerateClientCertificateRequest} } const opGetAccount = "GetAccount" @@ -1903,6 +1942,7 @@ const opGetAccount = "GetAccount" type GetAccountRequest struct { *aws.Request Input *GetAccountInput + Copy func(*GetAccountInput) GetAccountRequest } // Send marshals and sends the GetAccount API request. @@ -1941,7 +1981,7 @@ func (c *APIGateway) GetAccountRequest(input *GetAccountInput) GetAccountRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccountRequest{Request: req, Input: input} + return GetAccountRequest{Request: req, Input: input, Copy: c.GetAccountRequest} } const opGetApiKey = "GetApiKey" @@ -1950,6 +1990,7 @@ const opGetApiKey = "GetApiKey" type GetApiKeyRequest struct { *aws.Request Input *GetApiKeyInput + Copy func(*GetApiKeyInput) GetApiKeyRequest } // Send marshals and sends the GetApiKey API request. @@ -1988,7 +2029,7 @@ func (c *APIGateway) GetApiKeyRequest(input *GetApiKeyInput) GetApiKeyRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApiKeyRequest{Request: req, Input: input} + return GetApiKeyRequest{Request: req, Input: input, Copy: c.GetApiKeyRequest} } const opGetApiKeys = "GetApiKeys" @@ -1997,6 +2038,7 @@ const opGetApiKeys = "GetApiKeys" type GetApiKeysRequest struct { *aws.Request Input *GetApiKeysInput + Copy func(*GetApiKeysInput) GetApiKeysRequest } // Send marshals and sends the GetApiKeys API request. @@ -2041,57 +2083,53 @@ func (c *APIGateway) GetApiKeysRequest(input *GetApiKeysInput) GetApiKeysRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApiKeysRequest{Request: req, Input: input} + return GetApiKeysRequest{Request: req, Input: input, Copy: c.GetApiKeysRequest} } -// GetApiKeysPages iterates over the pages of a GetApiKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetApiKeys method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetApiKeysRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetApiKeys operation. -// pageNum := 0 -// err := client.GetApiKeysPages(params, -// func(page *GetApiKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetApiKeysPages(input *GetApiKeysInput, fn func(*GetApiKeysOutput, bool) bool) error { - return c.GetApiKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetApiKeysPagesWithContext same as GetApiKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetApiKeysPagesWithContext(ctx aws.Context, input *GetApiKeysInput, fn func(*GetApiKeysOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetApiKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetApiKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetApiKeysRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetApiKeysRequest) Paginate(opts ...aws.Option) GetApiKeysPager { + return GetApiKeysPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetApiKeysInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetApiKeysOutput), !p.HasNextPage()) - } - return p.Err() +// GetApiKeysPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetApiKeysPager struct { + aws.Pager +} + +func (p *GetApiKeysPager) CurrentPage() *GetApiKeysOutput { + return p.Pager.CurrentPage().(*GetApiKeysOutput) } const opGetAuthorizer = "GetAuthorizer" @@ -2100,6 +2138,7 @@ const opGetAuthorizer = "GetAuthorizer" type GetAuthorizerRequest struct { *aws.Request Input *GetAuthorizerInput + Copy func(*GetAuthorizerInput) GetAuthorizerRequest } // Send marshals and sends the GetAuthorizer API request. @@ -2140,7 +2179,7 @@ func (c *APIGateway) GetAuthorizerRequest(input *GetAuthorizerInput) GetAuthoriz req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAuthorizerRequest{Request: req, Input: input} + return GetAuthorizerRequest{Request: req, Input: input, Copy: c.GetAuthorizerRequest} } const opGetAuthorizers = "GetAuthorizers" @@ -2149,6 +2188,7 @@ const opGetAuthorizers = "GetAuthorizers" type GetAuthorizersRequest struct { *aws.Request Input *GetAuthorizersInput + Copy func(*GetAuthorizersInput) GetAuthorizersRequest } // Send marshals and sends the GetAuthorizers API request. @@ -2189,7 +2229,7 @@ func (c *APIGateway) GetAuthorizersRequest(input *GetAuthorizersInput) GetAuthor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAuthorizersRequest{Request: req, Input: input} + return GetAuthorizersRequest{Request: req, Input: input, Copy: c.GetAuthorizersRequest} } const opGetBasePathMapping = "GetBasePathMapping" @@ -2198,6 +2238,7 @@ const opGetBasePathMapping = "GetBasePathMapping" type GetBasePathMappingRequest struct { *aws.Request Input *GetBasePathMappingInput + Copy func(*GetBasePathMappingInput) GetBasePathMappingRequest } // Send marshals and sends the GetBasePathMapping API request. @@ -2236,7 +2277,7 @@ func (c *APIGateway) GetBasePathMappingRequest(input *GetBasePathMappingInput) G req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBasePathMappingRequest{Request: req, Input: input} + return GetBasePathMappingRequest{Request: req, Input: input, Copy: c.GetBasePathMappingRequest} } const opGetBasePathMappings = "GetBasePathMappings" @@ -2245,6 +2286,7 @@ const opGetBasePathMappings = "GetBasePathMappings" type GetBasePathMappingsRequest struct { *aws.Request Input *GetBasePathMappingsInput + Copy func(*GetBasePathMappingsInput) GetBasePathMappingsRequest } // Send marshals and sends the GetBasePathMappings API request. @@ -2289,57 +2331,53 @@ func (c *APIGateway) GetBasePathMappingsRequest(input *GetBasePathMappingsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBasePathMappingsRequest{Request: req, Input: input} + return GetBasePathMappingsRequest{Request: req, Input: input, Copy: c.GetBasePathMappingsRequest} } -// GetBasePathMappingsPages iterates over the pages of a GetBasePathMappings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetBasePathMappings method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetBasePathMappingsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetBasePathMappings operation. -// pageNum := 0 -// err := client.GetBasePathMappingsPages(params, -// func(page *GetBasePathMappingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetBasePathMappingsPages(input *GetBasePathMappingsInput, fn func(*GetBasePathMappingsOutput, bool) bool) error { - return c.GetBasePathMappingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetBasePathMappingsPagesWithContext same as GetBasePathMappingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetBasePathMappingsPagesWithContext(ctx aws.Context, input *GetBasePathMappingsInput, fn func(*GetBasePathMappingsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetBasePathMappingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetBasePathMappingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetBasePathMappingsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetBasePathMappingsRequest) Paginate(opts ...aws.Option) GetBasePathMappingsPager { + return GetBasePathMappingsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetBasePathMappingsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBasePathMappingsOutput), !p.HasNextPage()) - } - return p.Err() +// GetBasePathMappingsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetBasePathMappingsPager struct { + aws.Pager +} + +func (p *GetBasePathMappingsPager) CurrentPage() *GetBasePathMappingsOutput { + return p.Pager.CurrentPage().(*GetBasePathMappingsOutput) } const opGetClientCertificate = "GetClientCertificate" @@ -2348,6 +2386,7 @@ const opGetClientCertificate = "GetClientCertificate" type GetClientCertificateRequest struct { *aws.Request Input *GetClientCertificateInput + Copy func(*GetClientCertificateInput) GetClientCertificateRequest } // Send marshals and sends the GetClientCertificate API request. @@ -2386,7 +2425,7 @@ func (c *APIGateway) GetClientCertificateRequest(input *GetClientCertificateInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetClientCertificateRequest{Request: req, Input: input} + return GetClientCertificateRequest{Request: req, Input: input, Copy: c.GetClientCertificateRequest} } const opGetClientCertificates = "GetClientCertificates" @@ -2395,6 +2434,7 @@ const opGetClientCertificates = "GetClientCertificates" type GetClientCertificatesRequest struct { *aws.Request Input *GetClientCertificatesInput + Copy func(*GetClientCertificatesInput) GetClientCertificatesRequest } // Send marshals and sends the GetClientCertificates API request. @@ -2439,57 +2479,53 @@ func (c *APIGateway) GetClientCertificatesRequest(input *GetClientCertificatesIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetClientCertificatesRequest{Request: req, Input: input} + return GetClientCertificatesRequest{Request: req, Input: input, Copy: c.GetClientCertificatesRequest} } -// GetClientCertificatesPages iterates over the pages of a GetClientCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetClientCertificates method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetClientCertificatesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetClientCertificates operation. -// pageNum := 0 -// err := client.GetClientCertificatesPages(params, -// func(page *GetClientCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetClientCertificatesPages(input *GetClientCertificatesInput, fn func(*GetClientCertificatesOutput, bool) bool) error { - return c.GetClientCertificatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetClientCertificatesPagesWithContext same as GetClientCertificatesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetClientCertificatesPagesWithContext(ctx aws.Context, input *GetClientCertificatesInput, fn func(*GetClientCertificatesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetClientCertificatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetClientCertificatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetClientCertificatesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetClientCertificatesRequest) Paginate(opts ...aws.Option) GetClientCertificatesPager { + return GetClientCertificatesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetClientCertificatesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetClientCertificatesOutput), !p.HasNextPage()) - } - return p.Err() +// GetClientCertificatesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetClientCertificatesPager struct { + aws.Pager +} + +func (p *GetClientCertificatesPager) CurrentPage() *GetClientCertificatesOutput { + return p.Pager.CurrentPage().(*GetClientCertificatesOutput) } const opGetDeployment = "GetDeployment" @@ -2498,6 +2534,7 @@ const opGetDeployment = "GetDeployment" type GetDeploymentRequest struct { *aws.Request Input *GetDeploymentInput + Copy func(*GetDeploymentInput) GetDeploymentRequest } // Send marshals and sends the GetDeployment API request. @@ -2536,7 +2573,7 @@ func (c *APIGateway) GetDeploymentRequest(input *GetDeploymentInput) GetDeployme req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeploymentRequest{Request: req, Input: input} + return GetDeploymentRequest{Request: req, Input: input, Copy: c.GetDeploymentRequest} } const opGetDeployments = "GetDeployments" @@ -2545,6 +2582,7 @@ const opGetDeployments = "GetDeployments" type GetDeploymentsRequest struct { *aws.Request Input *GetDeploymentsInput + Copy func(*GetDeploymentsInput) GetDeploymentsRequest } // Send marshals and sends the GetDeployments API request. @@ -2589,57 +2627,53 @@ func (c *APIGateway) GetDeploymentsRequest(input *GetDeploymentsInput) GetDeploy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeploymentsRequest{Request: req, Input: input} + return GetDeploymentsRequest{Request: req, Input: input, Copy: c.GetDeploymentsRequest} } -// GetDeploymentsPages iterates over the pages of a GetDeployments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetDeployments method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetDeploymentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetDeployments operation. -// pageNum := 0 -// err := client.GetDeploymentsPages(params, -// func(page *GetDeploymentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetDeploymentsPages(input *GetDeploymentsInput, fn func(*GetDeploymentsOutput, bool) bool) error { - return c.GetDeploymentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetDeploymentsPagesWithContext same as GetDeploymentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetDeploymentsPagesWithContext(ctx aws.Context, input *GetDeploymentsInput, fn func(*GetDeploymentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetDeploymentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetDeploymentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetDeploymentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetDeploymentsRequest) Paginate(opts ...aws.Option) GetDeploymentsPager { + return GetDeploymentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetDeploymentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDeploymentsOutput), !p.HasNextPage()) - } - return p.Err() +// GetDeploymentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetDeploymentsPager struct { + aws.Pager +} + +func (p *GetDeploymentsPager) CurrentPage() *GetDeploymentsOutput { + return p.Pager.CurrentPage().(*GetDeploymentsOutput) } const opGetDocumentationPart = "GetDocumentationPart" @@ -2648,6 +2682,7 @@ const opGetDocumentationPart = "GetDocumentationPart" type GetDocumentationPartRequest struct { *aws.Request Input *GetDocumentationPartInput + Copy func(*GetDocumentationPartInput) GetDocumentationPartRequest } // Send marshals and sends the GetDocumentationPart API request. @@ -2684,7 +2719,7 @@ func (c *APIGateway) GetDocumentationPartRequest(input *GetDocumentationPartInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDocumentationPartRequest{Request: req, Input: input} + return GetDocumentationPartRequest{Request: req, Input: input, Copy: c.GetDocumentationPartRequest} } const opGetDocumentationParts = "GetDocumentationParts" @@ -2693,6 +2728,7 @@ const opGetDocumentationParts = "GetDocumentationParts" type GetDocumentationPartsRequest struct { *aws.Request Input *GetDocumentationPartsInput + Copy func(*GetDocumentationPartsInput) GetDocumentationPartsRequest } // Send marshals and sends the GetDocumentationParts API request. @@ -2729,7 +2765,7 @@ func (c *APIGateway) GetDocumentationPartsRequest(input *GetDocumentationPartsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDocumentationPartsRequest{Request: req, Input: input} + return GetDocumentationPartsRequest{Request: req, Input: input, Copy: c.GetDocumentationPartsRequest} } const opGetDocumentationVersion = "GetDocumentationVersion" @@ -2738,6 +2774,7 @@ const opGetDocumentationVersion = "GetDocumentationVersion" type GetDocumentationVersionRequest struct { *aws.Request Input *GetDocumentationVersionInput + Copy func(*GetDocumentationVersionInput) GetDocumentationVersionRequest } // Send marshals and sends the GetDocumentationVersion API request. @@ -2774,7 +2811,7 @@ func (c *APIGateway) GetDocumentationVersionRequest(input *GetDocumentationVersi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDocumentationVersionRequest{Request: req, Input: input} + return GetDocumentationVersionRequest{Request: req, Input: input, Copy: c.GetDocumentationVersionRequest} } const opGetDocumentationVersions = "GetDocumentationVersions" @@ -2783,6 +2820,7 @@ const opGetDocumentationVersions = "GetDocumentationVersions" type GetDocumentationVersionsRequest struct { *aws.Request Input *GetDocumentationVersionsInput + Copy func(*GetDocumentationVersionsInput) GetDocumentationVersionsRequest } // Send marshals and sends the GetDocumentationVersions API request. @@ -2819,7 +2857,7 @@ func (c *APIGateway) GetDocumentationVersionsRequest(input *GetDocumentationVers req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDocumentationVersionsRequest{Request: req, Input: input} + return GetDocumentationVersionsRequest{Request: req, Input: input, Copy: c.GetDocumentationVersionsRequest} } const opGetDomainName = "GetDomainName" @@ -2828,6 +2866,7 @@ const opGetDomainName = "GetDomainName" type GetDomainNameRequest struct { *aws.Request Input *GetDomainNameInput + Copy func(*GetDomainNameInput) GetDomainNameRequest } // Send marshals and sends the GetDomainName API request. @@ -2867,7 +2906,7 @@ func (c *APIGateway) GetDomainNameRequest(input *GetDomainNameInput) GetDomainNa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDomainNameRequest{Request: req, Input: input} + return GetDomainNameRequest{Request: req, Input: input, Copy: c.GetDomainNameRequest} } const opGetDomainNames = "GetDomainNames" @@ -2876,6 +2915,7 @@ const opGetDomainNames = "GetDomainNames" type GetDomainNamesRequest struct { *aws.Request Input *GetDomainNamesInput + Copy func(*GetDomainNamesInput) GetDomainNamesRequest } // Send marshals and sends the GetDomainNames API request. @@ -2920,57 +2960,53 @@ func (c *APIGateway) GetDomainNamesRequest(input *GetDomainNamesInput) GetDomain req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDomainNamesRequest{Request: req, Input: input} + return GetDomainNamesRequest{Request: req, Input: input, Copy: c.GetDomainNamesRequest} } -// GetDomainNamesPages iterates over the pages of a GetDomainNames operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetDomainNames method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetDomainNamesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetDomainNames operation. -// pageNum := 0 -// err := client.GetDomainNamesPages(params, -// func(page *GetDomainNamesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetDomainNamesPages(input *GetDomainNamesInput, fn func(*GetDomainNamesOutput, bool) bool) error { - return c.GetDomainNamesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetDomainNamesPagesWithContext same as GetDomainNamesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetDomainNamesPagesWithContext(ctx aws.Context, input *GetDomainNamesInput, fn func(*GetDomainNamesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetDomainNamesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetDomainNamesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetDomainNamesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetDomainNamesRequest) Paginate(opts ...aws.Option) GetDomainNamesPager { + return GetDomainNamesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetDomainNamesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDomainNamesOutput), !p.HasNextPage()) - } - return p.Err() +// GetDomainNamesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetDomainNamesPager struct { + aws.Pager +} + +func (p *GetDomainNamesPager) CurrentPage() *GetDomainNamesOutput { + return p.Pager.CurrentPage().(*GetDomainNamesOutput) } const opGetExport = "GetExport" @@ -2979,6 +3015,7 @@ const opGetExport = "GetExport" type GetExportRequest struct { *aws.Request Input *GetExportInput + Copy func(*GetExportInput) GetExportRequest } // Send marshals and sends the GetExport API request. @@ -3017,7 +3054,7 @@ func (c *APIGateway) GetExportRequest(input *GetExportInput) GetExportRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetExportRequest{Request: req, Input: input} + return GetExportRequest{Request: req, Input: input, Copy: c.GetExportRequest} } const opGetGatewayResponse = "GetGatewayResponse" @@ -3026,6 +3063,7 @@ const opGetGatewayResponse = "GetGatewayResponse" type GetGatewayResponseRequest struct { *aws.Request Input *GetGatewayResponseInput + Copy func(*GetGatewayResponseInput) GetGatewayResponseRequest } // Send marshals and sends the GetGatewayResponse API request. @@ -3064,7 +3102,7 @@ func (c *APIGateway) GetGatewayResponseRequest(input *GetGatewayResponseInput) G req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGatewayResponseRequest{Request: req, Input: input} + return GetGatewayResponseRequest{Request: req, Input: input, Copy: c.GetGatewayResponseRequest} } const opGetGatewayResponses = "GetGatewayResponses" @@ -3073,6 +3111,7 @@ const opGetGatewayResponses = "GetGatewayResponses" type GetGatewayResponsesRequest struct { *aws.Request Input *GetGatewayResponsesInput + Copy func(*GetGatewayResponsesInput) GetGatewayResponsesRequest } // Send marshals and sends the GetGatewayResponses API request. @@ -3114,7 +3153,7 @@ func (c *APIGateway) GetGatewayResponsesRequest(input *GetGatewayResponsesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGatewayResponsesRequest{Request: req, Input: input} + return GetGatewayResponsesRequest{Request: req, Input: input, Copy: c.GetGatewayResponsesRequest} } const opGetIntegration = "GetIntegration" @@ -3123,6 +3162,7 @@ const opGetIntegration = "GetIntegration" type GetIntegrationRequest struct { *aws.Request Input *GetIntegrationInput + Copy func(*GetIntegrationInput) GetIntegrationRequest } // Send marshals and sends the GetIntegration API request. @@ -3161,7 +3201,7 @@ func (c *APIGateway) GetIntegrationRequest(input *GetIntegrationInput) GetIntegr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIntegrationRequest{Request: req, Input: input} + return GetIntegrationRequest{Request: req, Input: input, Copy: c.GetIntegrationRequest} } const opGetIntegrationResponse = "GetIntegrationResponse" @@ -3170,6 +3210,7 @@ const opGetIntegrationResponse = "GetIntegrationResponse" type GetIntegrationResponseRequest struct { *aws.Request Input *GetIntegrationResponseInput + Copy func(*GetIntegrationResponseInput) GetIntegrationResponseRequest } // Send marshals and sends the GetIntegrationResponse API request. @@ -3208,7 +3249,7 @@ func (c *APIGateway) GetIntegrationResponseRequest(input *GetIntegrationResponse req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIntegrationResponseRequest{Request: req, Input: input} + return GetIntegrationResponseRequest{Request: req, Input: input, Copy: c.GetIntegrationResponseRequest} } const opGetMethod = "GetMethod" @@ -3217,6 +3258,7 @@ const opGetMethod = "GetMethod" type GetMethodRequest struct { *aws.Request Input *GetMethodInput + Copy func(*GetMethodInput) GetMethodRequest } // Send marshals and sends the GetMethod API request. @@ -3255,7 +3297,7 @@ func (c *APIGateway) GetMethodRequest(input *GetMethodInput) GetMethodRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMethodRequest{Request: req, Input: input} + return GetMethodRequest{Request: req, Input: input, Copy: c.GetMethodRequest} } const opGetMethodResponse = "GetMethodResponse" @@ -3264,6 +3306,7 @@ const opGetMethodResponse = "GetMethodResponse" type GetMethodResponseRequest struct { *aws.Request Input *GetMethodResponseInput + Copy func(*GetMethodResponseInput) GetMethodResponseRequest } // Send marshals and sends the GetMethodResponse API request. @@ -3302,7 +3345,7 @@ func (c *APIGateway) GetMethodResponseRequest(input *GetMethodResponseInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMethodResponseRequest{Request: req, Input: input} + return GetMethodResponseRequest{Request: req, Input: input, Copy: c.GetMethodResponseRequest} } const opGetModel = "GetModel" @@ -3311,6 +3354,7 @@ const opGetModel = "GetModel" type GetModelRequest struct { *aws.Request Input *GetModelInput + Copy func(*GetModelInput) GetModelRequest } // Send marshals and sends the GetModel API request. @@ -3349,7 +3393,7 @@ func (c *APIGateway) GetModelRequest(input *GetModelInput) GetModelRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetModelRequest{Request: req, Input: input} + return GetModelRequest{Request: req, Input: input, Copy: c.GetModelRequest} } const opGetModelTemplate = "GetModelTemplate" @@ -3358,6 +3402,7 @@ const opGetModelTemplate = "GetModelTemplate" type GetModelTemplateRequest struct { *aws.Request Input *GetModelTemplateInput + Copy func(*GetModelTemplateInput) GetModelTemplateRequest } // Send marshals and sends the GetModelTemplate API request. @@ -3397,7 +3442,7 @@ func (c *APIGateway) GetModelTemplateRequest(input *GetModelTemplateInput) GetMo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetModelTemplateRequest{Request: req, Input: input} + return GetModelTemplateRequest{Request: req, Input: input, Copy: c.GetModelTemplateRequest} } const opGetModels = "GetModels" @@ -3406,6 +3451,7 @@ const opGetModels = "GetModels" type GetModelsRequest struct { *aws.Request Input *GetModelsInput + Copy func(*GetModelsInput) GetModelsRequest } // Send marshals and sends the GetModels API request. @@ -3450,57 +3496,53 @@ func (c *APIGateway) GetModelsRequest(input *GetModelsInput) GetModelsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetModelsRequest{Request: req, Input: input} + return GetModelsRequest{Request: req, Input: input, Copy: c.GetModelsRequest} } -// GetModelsPages iterates over the pages of a GetModels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetModels method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetModelsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetModels operation. -// pageNum := 0 -// err := client.GetModelsPages(params, -// func(page *GetModelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetModelsPages(input *GetModelsInput, fn func(*GetModelsOutput, bool) bool) error { - return c.GetModelsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetModelsPagesWithContext same as GetModelsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetModelsPagesWithContext(ctx aws.Context, input *GetModelsInput, fn func(*GetModelsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetModelsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetModelsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetModelsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetModelsRequest) Paginate(opts ...aws.Option) GetModelsPager { + return GetModelsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetModelsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetModelsOutput), !p.HasNextPage()) - } - return p.Err() +// GetModelsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetModelsPager struct { + aws.Pager +} + +func (p *GetModelsPager) CurrentPage() *GetModelsOutput { + return p.Pager.CurrentPage().(*GetModelsOutput) } const opGetRequestValidator = "GetRequestValidator" @@ -3509,6 +3551,7 @@ const opGetRequestValidator = "GetRequestValidator" type GetRequestValidatorRequest struct { *aws.Request Input *GetRequestValidatorInput + Copy func(*GetRequestValidatorInput) GetRequestValidatorRequest } // Send marshals and sends the GetRequestValidator API request. @@ -3547,7 +3590,7 @@ func (c *APIGateway) GetRequestValidatorRequest(input *GetRequestValidatorInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRequestValidatorRequest{Request: req, Input: input} + return GetRequestValidatorRequest{Request: req, Input: input, Copy: c.GetRequestValidatorRequest} } const opGetRequestValidators = "GetRequestValidators" @@ -3556,6 +3599,7 @@ const opGetRequestValidators = "GetRequestValidators" type GetRequestValidatorsRequest struct { *aws.Request Input *GetRequestValidatorsInput + Copy func(*GetRequestValidatorsInput) GetRequestValidatorsRequest } // Send marshals and sends the GetRequestValidators API request. @@ -3594,7 +3638,7 @@ func (c *APIGateway) GetRequestValidatorsRequest(input *GetRequestValidatorsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRequestValidatorsRequest{Request: req, Input: input} + return GetRequestValidatorsRequest{Request: req, Input: input, Copy: c.GetRequestValidatorsRequest} } const opGetResource = "GetResource" @@ -3603,6 +3647,7 @@ const opGetResource = "GetResource" type GetResourceRequest struct { *aws.Request Input *GetResourceInput + Copy func(*GetResourceInput) GetResourceRequest } // Send marshals and sends the GetResource API request. @@ -3641,7 +3686,7 @@ func (c *APIGateway) GetResourceRequest(input *GetResourceInput) GetResourceRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetResourceRequest{Request: req, Input: input} + return GetResourceRequest{Request: req, Input: input, Copy: c.GetResourceRequest} } const opGetResources = "GetResources" @@ -3650,6 +3695,7 @@ const opGetResources = "GetResources" type GetResourcesRequest struct { *aws.Request Input *GetResourcesInput + Copy func(*GetResourcesInput) GetResourcesRequest } // Send marshals and sends the GetResources API request. @@ -3694,57 +3740,53 @@ func (c *APIGateway) GetResourcesRequest(input *GetResourcesInput) GetResourcesR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetResourcesRequest{Request: req, Input: input} + return GetResourcesRequest{Request: req, Input: input, Copy: c.GetResourcesRequest} } -// GetResourcesPages iterates over the pages of a GetResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetResources method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetResourcesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetResources operation. -// pageNum := 0 -// err := client.GetResourcesPages(params, -// func(page *GetResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetResourcesPages(input *GetResourcesInput, fn func(*GetResourcesOutput, bool) bool) error { - return c.GetResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetResourcesPagesWithContext same as GetResourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetResourcesPagesWithContext(ctx aws.Context, input *GetResourcesInput, fn func(*GetResourcesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetResourcesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetResourcesRequest) Paginate(opts ...aws.Option) GetResourcesPager { + return GetResourcesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetResourcesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetResourcesOutput), !p.HasNextPage()) - } - return p.Err() +// GetResourcesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetResourcesPager struct { + aws.Pager +} + +func (p *GetResourcesPager) CurrentPage() *GetResourcesOutput { + return p.Pager.CurrentPage().(*GetResourcesOutput) } const opGetRestApi = "GetRestApi" @@ -3753,6 +3795,7 @@ const opGetRestApi = "GetRestApi" type GetRestApiRequest struct { *aws.Request Input *GetRestApiInput + Copy func(*GetRestApiInput) GetRestApiRequest } // Send marshals and sends the GetRestApi API request. @@ -3791,7 +3834,7 @@ func (c *APIGateway) GetRestApiRequest(input *GetRestApiInput) GetRestApiRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRestApiRequest{Request: req, Input: input} + return GetRestApiRequest{Request: req, Input: input, Copy: c.GetRestApiRequest} } const opGetRestApis = "GetRestApis" @@ -3800,6 +3843,7 @@ const opGetRestApis = "GetRestApis" type GetRestApisRequest struct { *aws.Request Input *GetRestApisInput + Copy func(*GetRestApisInput) GetRestApisRequest } // Send marshals and sends the GetRestApis API request. @@ -3844,57 +3888,53 @@ func (c *APIGateway) GetRestApisRequest(input *GetRestApisInput) GetRestApisRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRestApisRequest{Request: req, Input: input} + return GetRestApisRequest{Request: req, Input: input, Copy: c.GetRestApisRequest} } -// GetRestApisPages iterates over the pages of a GetRestApis operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetRestApis method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetRestApisRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetRestApis operation. -// pageNum := 0 -// err := client.GetRestApisPages(params, -// func(page *GetRestApisOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetRestApisPages(input *GetRestApisInput, fn func(*GetRestApisOutput, bool) bool) error { - return c.GetRestApisPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetRestApisPagesWithContext same as GetRestApisPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetRestApisPagesWithContext(ctx aws.Context, input *GetRestApisInput, fn func(*GetRestApisOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetRestApisInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetRestApisRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetRestApisRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetRestApisRequest) Paginate(opts ...aws.Option) GetRestApisPager { + return GetRestApisPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetRestApisInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetRestApisOutput), !p.HasNextPage()) - } - return p.Err() +// GetRestApisPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetRestApisPager struct { + aws.Pager +} + +func (p *GetRestApisPager) CurrentPage() *GetRestApisOutput { + return p.Pager.CurrentPage().(*GetRestApisOutput) } const opGetSdk = "GetSdk" @@ -3903,6 +3943,7 @@ const opGetSdk = "GetSdk" type GetSdkRequest struct { *aws.Request Input *GetSdkInput + Copy func(*GetSdkInput) GetSdkRequest } // Send marshals and sends the GetSdk API request. @@ -3941,7 +3982,7 @@ func (c *APIGateway) GetSdkRequest(input *GetSdkInput) GetSdkRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSdkRequest{Request: req, Input: input} + return GetSdkRequest{Request: req, Input: input, Copy: c.GetSdkRequest} } const opGetSdkType = "GetSdkType" @@ -3950,6 +3991,7 @@ const opGetSdkType = "GetSdkType" type GetSdkTypeRequest struct { *aws.Request Input *GetSdkTypeInput + Copy func(*GetSdkTypeInput) GetSdkTypeRequest } // Send marshals and sends the GetSdkType API request. @@ -3986,7 +4028,7 @@ func (c *APIGateway) GetSdkTypeRequest(input *GetSdkTypeInput) GetSdkTypeRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSdkTypeRequest{Request: req, Input: input} + return GetSdkTypeRequest{Request: req, Input: input, Copy: c.GetSdkTypeRequest} } const opGetSdkTypes = "GetSdkTypes" @@ -3995,6 +4037,7 @@ const opGetSdkTypes = "GetSdkTypes" type GetSdkTypesRequest struct { *aws.Request Input *GetSdkTypesInput + Copy func(*GetSdkTypesInput) GetSdkTypesRequest } // Send marshals and sends the GetSdkTypes API request. @@ -4031,7 +4074,7 @@ func (c *APIGateway) GetSdkTypesRequest(input *GetSdkTypesInput) GetSdkTypesRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSdkTypesRequest{Request: req, Input: input} + return GetSdkTypesRequest{Request: req, Input: input, Copy: c.GetSdkTypesRequest} } const opGetStage = "GetStage" @@ -4040,6 +4083,7 @@ const opGetStage = "GetStage" type GetStageRequest struct { *aws.Request Input *GetStageInput + Copy func(*GetStageInput) GetStageRequest } // Send marshals and sends the GetStage API request. @@ -4078,7 +4122,7 @@ func (c *APIGateway) GetStageRequest(input *GetStageInput) GetStageRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetStageRequest{Request: req, Input: input} + return GetStageRequest{Request: req, Input: input, Copy: c.GetStageRequest} } const opGetStages = "GetStages" @@ -4087,6 +4131,7 @@ const opGetStages = "GetStages" type GetStagesRequest struct { *aws.Request Input *GetStagesInput + Copy func(*GetStagesInput) GetStagesRequest } // Send marshals and sends the GetStages API request. @@ -4125,7 +4170,7 @@ func (c *APIGateway) GetStagesRequest(input *GetStagesInput) GetStagesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetStagesRequest{Request: req, Input: input} + return GetStagesRequest{Request: req, Input: input, Copy: c.GetStagesRequest} } const opGetTags = "GetTags" @@ -4134,6 +4179,7 @@ const opGetTags = "GetTags" type GetTagsRequest struct { *aws.Request Input *GetTagsInput + Copy func(*GetTagsInput) GetTagsRequest } // Send marshals and sends the GetTags API request. @@ -4172,7 +4218,7 @@ func (c *APIGateway) GetTagsRequest(input *GetTagsInput) GetTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTagsRequest{Request: req, Input: input} + return GetTagsRequest{Request: req, Input: input, Copy: c.GetTagsRequest} } const opGetUsage = "GetUsage" @@ -4181,6 +4227,7 @@ const opGetUsage = "GetUsage" type GetUsageRequest struct { *aws.Request Input *GetUsageInput + Copy func(*GetUsageInput) GetUsageRequest } // Send marshals and sends the GetUsage API request. @@ -4225,57 +4272,53 @@ func (c *APIGateway) GetUsageRequest(input *GetUsageInput) GetUsageRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUsageRequest{Request: req, Input: input} + return GetUsageRequest{Request: req, Input: input, Copy: c.GetUsageRequest} } -// GetUsagePages iterates over the pages of a GetUsage operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetUsage method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetUsageRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetUsage operation. -// pageNum := 0 -// err := client.GetUsagePages(params, -// func(page *UpdateUsageOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetUsagePages(input *GetUsageInput, fn func(*UpdateUsageOutput, bool) bool) error { - return c.GetUsagePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetUsagePagesWithContext same as GetUsagePages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetUsagePagesWithContext(ctx aws.Context, input *GetUsageInput, fn func(*UpdateUsageOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetUsageInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetUsageRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetUsageRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetUsageRequest) Paginate(opts ...aws.Option) GetUsagePager { + return GetUsagePager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetUsageInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*UpdateUsageOutput), !p.HasNextPage()) - } - return p.Err() +// GetUsagePager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetUsagePager struct { + aws.Pager +} + +func (p *GetUsagePager) CurrentPage() *UpdateUsageOutput { + return p.Pager.CurrentPage().(*UpdateUsageOutput) } const opGetUsagePlan = "GetUsagePlan" @@ -4284,6 +4327,7 @@ const opGetUsagePlan = "GetUsagePlan" type GetUsagePlanRequest struct { *aws.Request Input *GetUsagePlanInput + Copy func(*GetUsagePlanInput) GetUsagePlanRequest } // Send marshals and sends the GetUsagePlan API request. @@ -4322,7 +4366,7 @@ func (c *APIGateway) GetUsagePlanRequest(input *GetUsagePlanInput) GetUsagePlanR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUsagePlanRequest{Request: req, Input: input} + return GetUsagePlanRequest{Request: req, Input: input, Copy: c.GetUsagePlanRequest} } const opGetUsagePlanKey = "GetUsagePlanKey" @@ -4331,6 +4375,7 @@ const opGetUsagePlanKey = "GetUsagePlanKey" type GetUsagePlanKeyRequest struct { *aws.Request Input *GetUsagePlanKeyInput + Copy func(*GetUsagePlanKeyInput) GetUsagePlanKeyRequest } // Send marshals and sends the GetUsagePlanKey API request. @@ -4369,7 +4414,7 @@ func (c *APIGateway) GetUsagePlanKeyRequest(input *GetUsagePlanKeyInput) GetUsag req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUsagePlanKeyRequest{Request: req, Input: input} + return GetUsagePlanKeyRequest{Request: req, Input: input, Copy: c.GetUsagePlanKeyRequest} } const opGetUsagePlanKeys = "GetUsagePlanKeys" @@ -4378,6 +4423,7 @@ const opGetUsagePlanKeys = "GetUsagePlanKeys" type GetUsagePlanKeysRequest struct { *aws.Request Input *GetUsagePlanKeysInput + Copy func(*GetUsagePlanKeysInput) GetUsagePlanKeysRequest } // Send marshals and sends the GetUsagePlanKeys API request. @@ -4423,57 +4469,53 @@ func (c *APIGateway) GetUsagePlanKeysRequest(input *GetUsagePlanKeysInput) GetUs req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUsagePlanKeysRequest{Request: req, Input: input} + return GetUsagePlanKeysRequest{Request: req, Input: input, Copy: c.GetUsagePlanKeysRequest} } -// GetUsagePlanKeysPages iterates over the pages of a GetUsagePlanKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetUsagePlanKeys method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetUsagePlanKeysRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetUsagePlanKeys operation. -// pageNum := 0 -// err := client.GetUsagePlanKeysPages(params, -// func(page *GetUsagePlanKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetUsagePlanKeysPages(input *GetUsagePlanKeysInput, fn func(*GetUsagePlanKeysOutput, bool) bool) error { - return c.GetUsagePlanKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetUsagePlanKeysPagesWithContext same as GetUsagePlanKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetUsagePlanKeysPagesWithContext(ctx aws.Context, input *GetUsagePlanKeysInput, fn func(*GetUsagePlanKeysOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetUsagePlanKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetUsagePlanKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetUsagePlanKeysRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetUsagePlanKeysRequest) Paginate(opts ...aws.Option) GetUsagePlanKeysPager { + return GetUsagePlanKeysPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetUsagePlanKeysInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetUsagePlanKeysOutput), !p.HasNextPage()) - } - return p.Err() +// GetUsagePlanKeysPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetUsagePlanKeysPager struct { + aws.Pager +} + +func (p *GetUsagePlanKeysPager) CurrentPage() *GetUsagePlanKeysOutput { + return p.Pager.CurrentPage().(*GetUsagePlanKeysOutput) } const opGetUsagePlans = "GetUsagePlans" @@ -4482,6 +4524,7 @@ const opGetUsagePlans = "GetUsagePlans" type GetUsagePlansRequest struct { *aws.Request Input *GetUsagePlansInput + Copy func(*GetUsagePlansInput) GetUsagePlansRequest } // Send marshals and sends the GetUsagePlans API request. @@ -4526,57 +4569,53 @@ func (c *APIGateway) GetUsagePlansRequest(input *GetUsagePlansInput) GetUsagePla req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUsagePlansRequest{Request: req, Input: input} + return GetUsagePlansRequest{Request: req, Input: input, Copy: c.GetUsagePlansRequest} } -// GetUsagePlansPages iterates over the pages of a GetUsagePlans operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetUsagePlans method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetUsagePlansRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetUsagePlans operation. -// pageNum := 0 -// err := client.GetUsagePlansPages(params, -// func(page *GetUsagePlansOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetUsagePlansPages(input *GetUsagePlansInput, fn func(*GetUsagePlansOutput, bool) bool) error { - return c.GetUsagePlansPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetUsagePlansPagesWithContext same as GetUsagePlansPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetUsagePlansPagesWithContext(ctx aws.Context, input *GetUsagePlansInput, fn func(*GetUsagePlansOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetUsagePlansInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetUsagePlansRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetUsagePlansRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetUsagePlansRequest) Paginate(opts ...aws.Option) GetUsagePlansPager { + return GetUsagePlansPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetUsagePlansInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetUsagePlansOutput), !p.HasNextPage()) - } - return p.Err() +// GetUsagePlansPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetUsagePlansPager struct { + aws.Pager +} + +func (p *GetUsagePlansPager) CurrentPage() *GetUsagePlansOutput { + return p.Pager.CurrentPage().(*GetUsagePlansOutput) } const opGetVpcLink = "GetVpcLink" @@ -4585,6 +4624,7 @@ const opGetVpcLink = "GetVpcLink" type GetVpcLinkRequest struct { *aws.Request Input *GetVpcLinkInput + Copy func(*GetVpcLinkInput) GetVpcLinkRequest } // Send marshals and sends the GetVpcLink API request. @@ -4623,7 +4663,7 @@ func (c *APIGateway) GetVpcLinkRequest(input *GetVpcLinkInput) GetVpcLinkRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetVpcLinkRequest{Request: req, Input: input} + return GetVpcLinkRequest{Request: req, Input: input, Copy: c.GetVpcLinkRequest} } const opGetVpcLinks = "GetVpcLinks" @@ -4632,6 +4672,7 @@ const opGetVpcLinks = "GetVpcLinks" type GetVpcLinksRequest struct { *aws.Request Input *GetVpcLinksInput + Copy func(*GetVpcLinksInput) GetVpcLinksRequest } // Send marshals and sends the GetVpcLinks API request. @@ -4676,57 +4717,53 @@ func (c *APIGateway) GetVpcLinksRequest(input *GetVpcLinksInput) GetVpcLinksRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetVpcLinksRequest{Request: req, Input: input} + return GetVpcLinksRequest{Request: req, Input: input, Copy: c.GetVpcLinksRequest} } -// GetVpcLinksPages iterates over the pages of a GetVpcLinks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetVpcLinks method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetVpcLinksRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetVpcLinks operation. -// pageNum := 0 -// err := client.GetVpcLinksPages(params, -// func(page *GetVpcLinksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetVpcLinksPages(input *GetVpcLinksInput, fn func(*GetVpcLinksOutput, bool) bool) error { - return c.GetVpcLinksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetVpcLinksPagesWithContext same as GetVpcLinksPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *APIGateway) GetVpcLinksPagesWithContext(ctx aws.Context, input *GetVpcLinksInput, fn func(*GetVpcLinksOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetVpcLinksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetVpcLinksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetVpcLinksRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetVpcLinksRequest) Paginate(opts ...aws.Option) GetVpcLinksPager { + return GetVpcLinksPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetVpcLinksInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetVpcLinksOutput), !p.HasNextPage()) - } - return p.Err() +// GetVpcLinksPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetVpcLinksPager struct { + aws.Pager +} + +func (p *GetVpcLinksPager) CurrentPage() *GetVpcLinksOutput { + return p.Pager.CurrentPage().(*GetVpcLinksOutput) } const opImportApiKeys = "ImportApiKeys" @@ -4735,6 +4772,7 @@ const opImportApiKeys = "ImportApiKeys" type ImportApiKeysRequest struct { *aws.Request Input *ImportApiKeysInput + Copy func(*ImportApiKeysInput) ImportApiKeysRequest } // Send marshals and sends the ImportApiKeys API request. @@ -4773,7 +4811,7 @@ func (c *APIGateway) ImportApiKeysRequest(input *ImportApiKeysInput) ImportApiKe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportApiKeysRequest{Request: req, Input: input} + return ImportApiKeysRequest{Request: req, Input: input, Copy: c.ImportApiKeysRequest} } const opImportDocumentationParts = "ImportDocumentationParts" @@ -4782,6 +4820,7 @@ const opImportDocumentationParts = "ImportDocumentationParts" type ImportDocumentationPartsRequest struct { *aws.Request Input *ImportDocumentationPartsInput + Copy func(*ImportDocumentationPartsInput) ImportDocumentationPartsRequest } // Send marshals and sends the ImportDocumentationParts API request. @@ -4818,7 +4857,7 @@ func (c *APIGateway) ImportDocumentationPartsRequest(input *ImportDocumentationP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportDocumentationPartsRequest{Request: req, Input: input} + return ImportDocumentationPartsRequest{Request: req, Input: input, Copy: c.ImportDocumentationPartsRequest} } const opImportRestApi = "ImportRestApi" @@ -4827,6 +4866,7 @@ const opImportRestApi = "ImportRestApi" type ImportRestApiRequest struct { *aws.Request Input *ImportRestApiInput + Copy func(*ImportRestApiInput) ImportRestApiRequest } // Send marshals and sends the ImportRestApi API request. @@ -4866,7 +4906,7 @@ func (c *APIGateway) ImportRestApiRequest(input *ImportRestApiInput) ImportRestA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportRestApiRequest{Request: req, Input: input} + return ImportRestApiRequest{Request: req, Input: input, Copy: c.ImportRestApiRequest} } const opPutGatewayResponse = "PutGatewayResponse" @@ -4875,6 +4915,7 @@ const opPutGatewayResponse = "PutGatewayResponse" type PutGatewayResponseRequest struct { *aws.Request Input *PutGatewayResponseInput + Copy func(*PutGatewayResponseInput) PutGatewayResponseRequest } // Send marshals and sends the PutGatewayResponse API request. @@ -4914,7 +4955,7 @@ func (c *APIGateway) PutGatewayResponseRequest(input *PutGatewayResponseInput) P req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutGatewayResponseRequest{Request: req, Input: input} + return PutGatewayResponseRequest{Request: req, Input: input, Copy: c.PutGatewayResponseRequest} } const opPutIntegration = "PutIntegration" @@ -4923,6 +4964,7 @@ const opPutIntegration = "PutIntegration" type PutIntegrationRequest struct { *aws.Request Input *PutIntegrationInput + Copy func(*PutIntegrationInput) PutIntegrationRequest } // Send marshals and sends the PutIntegration API request. @@ -4961,7 +5003,7 @@ func (c *APIGateway) PutIntegrationRequest(input *PutIntegrationInput) PutIntegr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutIntegrationRequest{Request: req, Input: input} + return PutIntegrationRequest{Request: req, Input: input, Copy: c.PutIntegrationRequest} } const opPutIntegrationResponse = "PutIntegrationResponse" @@ -4970,6 +5012,7 @@ const opPutIntegrationResponse = "PutIntegrationResponse" type PutIntegrationResponseRequest struct { *aws.Request Input *PutIntegrationResponseInput + Copy func(*PutIntegrationResponseInput) PutIntegrationResponseRequest } // Send marshals and sends the PutIntegrationResponse API request. @@ -5008,7 +5051,7 @@ func (c *APIGateway) PutIntegrationResponseRequest(input *PutIntegrationResponse req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutIntegrationResponseRequest{Request: req, Input: input} + return PutIntegrationResponseRequest{Request: req, Input: input, Copy: c.PutIntegrationResponseRequest} } const opPutMethod = "PutMethod" @@ -5017,6 +5060,7 @@ const opPutMethod = "PutMethod" type PutMethodRequest struct { *aws.Request Input *PutMethodInput + Copy func(*PutMethodInput) PutMethodRequest } // Send marshals and sends the PutMethod API request. @@ -5055,7 +5099,7 @@ func (c *APIGateway) PutMethodRequest(input *PutMethodInput) PutMethodRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutMethodRequest{Request: req, Input: input} + return PutMethodRequest{Request: req, Input: input, Copy: c.PutMethodRequest} } const opPutMethodResponse = "PutMethodResponse" @@ -5064,6 +5108,7 @@ const opPutMethodResponse = "PutMethodResponse" type PutMethodResponseRequest struct { *aws.Request Input *PutMethodResponseInput + Copy func(*PutMethodResponseInput) PutMethodResponseRequest } // Send marshals and sends the PutMethodResponse API request. @@ -5102,7 +5147,7 @@ func (c *APIGateway) PutMethodResponseRequest(input *PutMethodResponseInput) Put req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutMethodResponseRequest{Request: req, Input: input} + return PutMethodResponseRequest{Request: req, Input: input, Copy: c.PutMethodResponseRequest} } const opPutRestApi = "PutRestApi" @@ -5111,6 +5156,7 @@ const opPutRestApi = "PutRestApi" type PutRestApiRequest struct { *aws.Request Input *PutRestApiInput + Copy func(*PutRestApiInput) PutRestApiRequest } // Send marshals and sends the PutRestApi API request. @@ -5152,7 +5198,7 @@ func (c *APIGateway) PutRestApiRequest(input *PutRestApiInput) PutRestApiRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutRestApiRequest{Request: req, Input: input} + return PutRestApiRequest{Request: req, Input: input, Copy: c.PutRestApiRequest} } const opTagResource = "TagResource" @@ -5161,6 +5207,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -5201,7 +5248,7 @@ func (c *APIGateway) TagResourceRequest(input *TagResourceInput) TagResourceRequ req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opTestInvokeAuthorizer = "TestInvokeAuthorizer" @@ -5210,6 +5257,7 @@ const opTestInvokeAuthorizer = "TestInvokeAuthorizer" type TestInvokeAuthorizerRequest struct { *aws.Request Input *TestInvokeAuthorizerInput + Copy func(*TestInvokeAuthorizerInput) TestInvokeAuthorizerRequest } // Send marshals and sends the TestInvokeAuthorizer API request. @@ -5251,7 +5299,7 @@ func (c *APIGateway) TestInvokeAuthorizerRequest(input *TestInvokeAuthorizerInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestInvokeAuthorizerRequest{Request: req, Input: input} + return TestInvokeAuthorizerRequest{Request: req, Input: input, Copy: c.TestInvokeAuthorizerRequest} } const opTestInvokeMethod = "TestInvokeMethod" @@ -5260,6 +5308,7 @@ const opTestInvokeMethod = "TestInvokeMethod" type TestInvokeMethodRequest struct { *aws.Request Input *TestInvokeMethodInput + Copy func(*TestInvokeMethodInput) TestInvokeMethodRequest } // Send marshals and sends the TestInvokeMethod API request. @@ -5299,7 +5348,7 @@ func (c *APIGateway) TestInvokeMethodRequest(input *TestInvokeMethodInput) TestI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestInvokeMethodRequest{Request: req, Input: input} + return TestInvokeMethodRequest{Request: req, Input: input, Copy: c.TestInvokeMethodRequest} } const opUntagResource = "UntagResource" @@ -5308,6 +5357,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -5348,7 +5398,7 @@ func (c *APIGateway) UntagResourceRequest(input *UntagResourceInput) UntagResour req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateAccount = "UpdateAccount" @@ -5357,6 +5407,7 @@ const opUpdateAccount = "UpdateAccount" type UpdateAccountRequest struct { *aws.Request Input *UpdateAccountInput + Copy func(*UpdateAccountInput) UpdateAccountRequest } // Send marshals and sends the UpdateAccount API request. @@ -5395,7 +5446,7 @@ func (c *APIGateway) UpdateAccountRequest(input *UpdateAccountInput) UpdateAccou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAccountRequest{Request: req, Input: input} + return UpdateAccountRequest{Request: req, Input: input, Copy: c.UpdateAccountRequest} } const opUpdateApiKey = "UpdateApiKey" @@ -5404,6 +5455,7 @@ const opUpdateApiKey = "UpdateApiKey" type UpdateApiKeyRequest struct { *aws.Request Input *UpdateApiKeyInput + Copy func(*UpdateApiKeyInput) UpdateApiKeyRequest } // Send marshals and sends the UpdateApiKey API request. @@ -5442,7 +5494,7 @@ func (c *APIGateway) UpdateApiKeyRequest(input *UpdateApiKeyInput) UpdateApiKeyR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApiKeyRequest{Request: req, Input: input} + return UpdateApiKeyRequest{Request: req, Input: input, Copy: c.UpdateApiKeyRequest} } const opUpdateAuthorizer = "UpdateAuthorizer" @@ -5451,6 +5503,7 @@ const opUpdateAuthorizer = "UpdateAuthorizer" type UpdateAuthorizerRequest struct { *aws.Request Input *UpdateAuthorizerInput + Copy func(*UpdateAuthorizerInput) UpdateAuthorizerRequest } // Send marshals and sends the UpdateAuthorizer API request. @@ -5491,7 +5544,7 @@ func (c *APIGateway) UpdateAuthorizerRequest(input *UpdateAuthorizerInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAuthorizerRequest{Request: req, Input: input} + return UpdateAuthorizerRequest{Request: req, Input: input, Copy: c.UpdateAuthorizerRequest} } const opUpdateBasePathMapping = "UpdateBasePathMapping" @@ -5500,6 +5553,7 @@ const opUpdateBasePathMapping = "UpdateBasePathMapping" type UpdateBasePathMappingRequest struct { *aws.Request Input *UpdateBasePathMappingInput + Copy func(*UpdateBasePathMappingInput) UpdateBasePathMappingRequest } // Send marshals and sends the UpdateBasePathMapping API request. @@ -5538,7 +5592,7 @@ func (c *APIGateway) UpdateBasePathMappingRequest(input *UpdateBasePathMappingIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateBasePathMappingRequest{Request: req, Input: input} + return UpdateBasePathMappingRequest{Request: req, Input: input, Copy: c.UpdateBasePathMappingRequest} } const opUpdateClientCertificate = "UpdateClientCertificate" @@ -5547,6 +5601,7 @@ const opUpdateClientCertificate = "UpdateClientCertificate" type UpdateClientCertificateRequest struct { *aws.Request Input *UpdateClientCertificateInput + Copy func(*UpdateClientCertificateInput) UpdateClientCertificateRequest } // Send marshals and sends the UpdateClientCertificate API request. @@ -5585,7 +5640,7 @@ func (c *APIGateway) UpdateClientCertificateRequest(input *UpdateClientCertifica req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateClientCertificateRequest{Request: req, Input: input} + return UpdateClientCertificateRequest{Request: req, Input: input, Copy: c.UpdateClientCertificateRequest} } const opUpdateDeployment = "UpdateDeployment" @@ -5594,6 +5649,7 @@ const opUpdateDeployment = "UpdateDeployment" type UpdateDeploymentRequest struct { *aws.Request Input *UpdateDeploymentInput + Copy func(*UpdateDeploymentInput) UpdateDeploymentRequest } // Send marshals and sends the UpdateDeployment API request. @@ -5632,7 +5688,7 @@ func (c *APIGateway) UpdateDeploymentRequest(input *UpdateDeploymentInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDeploymentRequest{Request: req, Input: input} + return UpdateDeploymentRequest{Request: req, Input: input, Copy: c.UpdateDeploymentRequest} } const opUpdateDocumentationPart = "UpdateDocumentationPart" @@ -5641,6 +5697,7 @@ const opUpdateDocumentationPart = "UpdateDocumentationPart" type UpdateDocumentationPartRequest struct { *aws.Request Input *UpdateDocumentationPartInput + Copy func(*UpdateDocumentationPartInput) UpdateDocumentationPartRequest } // Send marshals and sends the UpdateDocumentationPart API request. @@ -5677,7 +5734,7 @@ func (c *APIGateway) UpdateDocumentationPartRequest(input *UpdateDocumentationPa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDocumentationPartRequest{Request: req, Input: input} + return UpdateDocumentationPartRequest{Request: req, Input: input, Copy: c.UpdateDocumentationPartRequest} } const opUpdateDocumentationVersion = "UpdateDocumentationVersion" @@ -5686,6 +5743,7 @@ const opUpdateDocumentationVersion = "UpdateDocumentationVersion" type UpdateDocumentationVersionRequest struct { *aws.Request Input *UpdateDocumentationVersionInput + Copy func(*UpdateDocumentationVersionInput) UpdateDocumentationVersionRequest } // Send marshals and sends the UpdateDocumentationVersion API request. @@ -5722,7 +5780,7 @@ func (c *APIGateway) UpdateDocumentationVersionRequest(input *UpdateDocumentatio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDocumentationVersionRequest{Request: req, Input: input} + return UpdateDocumentationVersionRequest{Request: req, Input: input, Copy: c.UpdateDocumentationVersionRequest} } const opUpdateDomainName = "UpdateDomainName" @@ -5731,6 +5789,7 @@ const opUpdateDomainName = "UpdateDomainName" type UpdateDomainNameRequest struct { *aws.Request Input *UpdateDomainNameInput + Copy func(*UpdateDomainNameInput) UpdateDomainNameRequest } // Send marshals and sends the UpdateDomainName API request. @@ -5769,7 +5828,7 @@ func (c *APIGateway) UpdateDomainNameRequest(input *UpdateDomainNameInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDomainNameRequest{Request: req, Input: input} + return UpdateDomainNameRequest{Request: req, Input: input, Copy: c.UpdateDomainNameRequest} } const opUpdateGatewayResponse = "UpdateGatewayResponse" @@ -5778,6 +5837,7 @@ const opUpdateGatewayResponse = "UpdateGatewayResponse" type UpdateGatewayResponseRequest struct { *aws.Request Input *UpdateGatewayResponseInput + Copy func(*UpdateGatewayResponseInput) UpdateGatewayResponseRequest } // Send marshals and sends the UpdateGatewayResponse API request. @@ -5816,7 +5876,7 @@ func (c *APIGateway) UpdateGatewayResponseRequest(input *UpdateGatewayResponseIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGatewayResponseRequest{Request: req, Input: input} + return UpdateGatewayResponseRequest{Request: req, Input: input, Copy: c.UpdateGatewayResponseRequest} } const opUpdateIntegration = "UpdateIntegration" @@ -5825,6 +5885,7 @@ const opUpdateIntegration = "UpdateIntegration" type UpdateIntegrationRequest struct { *aws.Request Input *UpdateIntegrationInput + Copy func(*UpdateIntegrationInput) UpdateIntegrationRequest } // Send marshals and sends the UpdateIntegration API request. @@ -5863,7 +5924,7 @@ func (c *APIGateway) UpdateIntegrationRequest(input *UpdateIntegrationInput) Upd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateIntegrationRequest{Request: req, Input: input} + return UpdateIntegrationRequest{Request: req, Input: input, Copy: c.UpdateIntegrationRequest} } const opUpdateIntegrationResponse = "UpdateIntegrationResponse" @@ -5872,6 +5933,7 @@ const opUpdateIntegrationResponse = "UpdateIntegrationResponse" type UpdateIntegrationResponseRequest struct { *aws.Request Input *UpdateIntegrationResponseInput + Copy func(*UpdateIntegrationResponseInput) UpdateIntegrationResponseRequest } // Send marshals and sends the UpdateIntegrationResponse API request. @@ -5910,7 +5972,7 @@ func (c *APIGateway) UpdateIntegrationResponseRequest(input *UpdateIntegrationRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateIntegrationResponseRequest{Request: req, Input: input} + return UpdateIntegrationResponseRequest{Request: req, Input: input, Copy: c.UpdateIntegrationResponseRequest} } const opUpdateMethod = "UpdateMethod" @@ -5919,6 +5981,7 @@ const opUpdateMethod = "UpdateMethod" type UpdateMethodRequest struct { *aws.Request Input *UpdateMethodInput + Copy func(*UpdateMethodInput) UpdateMethodRequest } // Send marshals and sends the UpdateMethod API request. @@ -5957,7 +6020,7 @@ func (c *APIGateway) UpdateMethodRequest(input *UpdateMethodInput) UpdateMethodR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateMethodRequest{Request: req, Input: input} + return UpdateMethodRequest{Request: req, Input: input, Copy: c.UpdateMethodRequest} } const opUpdateMethodResponse = "UpdateMethodResponse" @@ -5966,6 +6029,7 @@ const opUpdateMethodResponse = "UpdateMethodResponse" type UpdateMethodResponseRequest struct { *aws.Request Input *UpdateMethodResponseInput + Copy func(*UpdateMethodResponseInput) UpdateMethodResponseRequest } // Send marshals and sends the UpdateMethodResponse API request. @@ -6004,7 +6068,7 @@ func (c *APIGateway) UpdateMethodResponseRequest(input *UpdateMethodResponseInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateMethodResponseRequest{Request: req, Input: input} + return UpdateMethodResponseRequest{Request: req, Input: input, Copy: c.UpdateMethodResponseRequest} } const opUpdateModel = "UpdateModel" @@ -6013,6 +6077,7 @@ const opUpdateModel = "UpdateModel" type UpdateModelRequest struct { *aws.Request Input *UpdateModelInput + Copy func(*UpdateModelInput) UpdateModelRequest } // Send marshals and sends the UpdateModel API request. @@ -6051,7 +6116,7 @@ func (c *APIGateway) UpdateModelRequest(input *UpdateModelInput) UpdateModelRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateModelRequest{Request: req, Input: input} + return UpdateModelRequest{Request: req, Input: input, Copy: c.UpdateModelRequest} } const opUpdateRequestValidator = "UpdateRequestValidator" @@ -6060,6 +6125,7 @@ const opUpdateRequestValidator = "UpdateRequestValidator" type UpdateRequestValidatorRequest struct { *aws.Request Input *UpdateRequestValidatorInput + Copy func(*UpdateRequestValidatorInput) UpdateRequestValidatorRequest } // Send marshals and sends the UpdateRequestValidator API request. @@ -6098,7 +6164,7 @@ func (c *APIGateway) UpdateRequestValidatorRequest(input *UpdateRequestValidator req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRequestValidatorRequest{Request: req, Input: input} + return UpdateRequestValidatorRequest{Request: req, Input: input, Copy: c.UpdateRequestValidatorRequest} } const opUpdateResource = "UpdateResource" @@ -6107,6 +6173,7 @@ const opUpdateResource = "UpdateResource" type UpdateResourceRequest struct { *aws.Request Input *UpdateResourceInput + Copy func(*UpdateResourceInput) UpdateResourceRequest } // Send marshals and sends the UpdateResource API request. @@ -6145,7 +6212,7 @@ func (c *APIGateway) UpdateResourceRequest(input *UpdateResourceInput) UpdateRes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateResourceRequest{Request: req, Input: input} + return UpdateResourceRequest{Request: req, Input: input, Copy: c.UpdateResourceRequest} } const opUpdateRestApi = "UpdateRestApi" @@ -6154,6 +6221,7 @@ const opUpdateRestApi = "UpdateRestApi" type UpdateRestApiRequest struct { *aws.Request Input *UpdateRestApiInput + Copy func(*UpdateRestApiInput) UpdateRestApiRequest } // Send marshals and sends the UpdateRestApi API request. @@ -6192,7 +6260,7 @@ func (c *APIGateway) UpdateRestApiRequest(input *UpdateRestApiInput) UpdateRestA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRestApiRequest{Request: req, Input: input} + return UpdateRestApiRequest{Request: req, Input: input, Copy: c.UpdateRestApiRequest} } const opUpdateStage = "UpdateStage" @@ -6201,6 +6269,7 @@ const opUpdateStage = "UpdateStage" type UpdateStageRequest struct { *aws.Request Input *UpdateStageInput + Copy func(*UpdateStageInput) UpdateStageRequest } // Send marshals and sends the UpdateStage API request. @@ -6239,7 +6308,7 @@ func (c *APIGateway) UpdateStageRequest(input *UpdateStageInput) UpdateStageRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateStageRequest{Request: req, Input: input} + return UpdateStageRequest{Request: req, Input: input, Copy: c.UpdateStageRequest} } const opUpdateUsage = "UpdateUsage" @@ -6248,6 +6317,7 @@ const opUpdateUsage = "UpdateUsage" type UpdateUsageRequest struct { *aws.Request Input *UpdateUsageInput + Copy func(*UpdateUsageInput) UpdateUsageRequest } // Send marshals and sends the UpdateUsage API request. @@ -6287,7 +6357,7 @@ func (c *APIGateway) UpdateUsageRequest(input *UpdateUsageInput) UpdateUsageRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateUsageRequest{Request: req, Input: input} + return UpdateUsageRequest{Request: req, Input: input, Copy: c.UpdateUsageRequest} } const opUpdateUsagePlan = "UpdateUsagePlan" @@ -6296,6 +6366,7 @@ const opUpdateUsagePlan = "UpdateUsagePlan" type UpdateUsagePlanRequest struct { *aws.Request Input *UpdateUsagePlanInput + Copy func(*UpdateUsagePlanInput) UpdateUsagePlanRequest } // Send marshals and sends the UpdateUsagePlan API request. @@ -6334,7 +6405,7 @@ func (c *APIGateway) UpdateUsagePlanRequest(input *UpdateUsagePlanInput) UpdateU req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateUsagePlanRequest{Request: req, Input: input} + return UpdateUsagePlanRequest{Request: req, Input: input, Copy: c.UpdateUsagePlanRequest} } const opUpdateVpcLink = "UpdateVpcLink" @@ -6343,6 +6414,7 @@ const opUpdateVpcLink = "UpdateVpcLink" type UpdateVpcLinkRequest struct { *aws.Request Input *UpdateVpcLinkInput + Copy func(*UpdateVpcLinkInput) UpdateVpcLinkRequest } // Send marshals and sends the UpdateVpcLink API request. @@ -6381,7 +6453,7 @@ func (c *APIGateway) UpdateVpcLinkRequest(input *UpdateVpcLinkInput) UpdateVpcLi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateVpcLinkRequest{Request: req, Input: input} + return UpdateVpcLinkRequest{Request: req, Input: input, Copy: c.UpdateVpcLinkRequest} } // Access log settings, including the access log format and access log destination diff --git a/service/apigateway/apigatewayiface/interface.go b/service/apigateway/apigatewayiface/interface.go index 690c106e975..9987fc0393a 100644 --- a/service/apigateway/apigatewayiface/interface.go +++ b/service/apigateway/apigatewayiface/interface.go @@ -9,7 +9,6 @@ package apigatewayiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/apigateway" ) @@ -147,9 +146,6 @@ type APIGatewayAPI interface { GetApiKeysRequest(*apigateway.GetApiKeysInput) apigateway.GetApiKeysRequest - GetApiKeysPages(*apigateway.GetApiKeysInput, func(*apigateway.GetApiKeysOutput, bool) bool) error - GetApiKeysPagesWithContext(aws.Context, *apigateway.GetApiKeysInput, func(*apigateway.GetApiKeysOutput, bool) bool, ...aws.Option) error - GetAuthorizerRequest(*apigateway.GetAuthorizerInput) apigateway.GetAuthorizerRequest GetAuthorizersRequest(*apigateway.GetAuthorizersInput) apigateway.GetAuthorizersRequest @@ -158,23 +154,14 @@ type APIGatewayAPI interface { GetBasePathMappingsRequest(*apigateway.GetBasePathMappingsInput) apigateway.GetBasePathMappingsRequest - GetBasePathMappingsPages(*apigateway.GetBasePathMappingsInput, func(*apigateway.GetBasePathMappingsOutput, bool) bool) error - GetBasePathMappingsPagesWithContext(aws.Context, *apigateway.GetBasePathMappingsInput, func(*apigateway.GetBasePathMappingsOutput, bool) bool, ...aws.Option) error - GetClientCertificateRequest(*apigateway.GetClientCertificateInput) apigateway.GetClientCertificateRequest GetClientCertificatesRequest(*apigateway.GetClientCertificatesInput) apigateway.GetClientCertificatesRequest - GetClientCertificatesPages(*apigateway.GetClientCertificatesInput, func(*apigateway.GetClientCertificatesOutput, bool) bool) error - GetClientCertificatesPagesWithContext(aws.Context, *apigateway.GetClientCertificatesInput, func(*apigateway.GetClientCertificatesOutput, bool) bool, ...aws.Option) error - GetDeploymentRequest(*apigateway.GetDeploymentInput) apigateway.GetDeploymentRequest GetDeploymentsRequest(*apigateway.GetDeploymentsInput) apigateway.GetDeploymentsRequest - GetDeploymentsPages(*apigateway.GetDeploymentsInput, func(*apigateway.GetDeploymentsOutput, bool) bool) error - GetDeploymentsPagesWithContext(aws.Context, *apigateway.GetDeploymentsInput, func(*apigateway.GetDeploymentsOutput, bool) bool, ...aws.Option) error - GetDocumentationPartRequest(*apigateway.GetDocumentationPartInput) apigateway.GetDocumentationPartRequest GetDocumentationPartsRequest(*apigateway.GetDocumentationPartsInput) apigateway.GetDocumentationPartsRequest @@ -187,9 +174,6 @@ type APIGatewayAPI interface { GetDomainNamesRequest(*apigateway.GetDomainNamesInput) apigateway.GetDomainNamesRequest - GetDomainNamesPages(*apigateway.GetDomainNamesInput, func(*apigateway.GetDomainNamesOutput, bool) bool) error - GetDomainNamesPagesWithContext(aws.Context, *apigateway.GetDomainNamesInput, func(*apigateway.GetDomainNamesOutput, bool) bool, ...aws.Option) error - GetExportRequest(*apigateway.GetExportInput) apigateway.GetExportRequest GetGatewayResponseRequest(*apigateway.GetGatewayResponseInput) apigateway.GetGatewayResponseRequest @@ -210,9 +194,6 @@ type APIGatewayAPI interface { GetModelsRequest(*apigateway.GetModelsInput) apigateway.GetModelsRequest - GetModelsPages(*apigateway.GetModelsInput, func(*apigateway.GetModelsOutput, bool) bool) error - GetModelsPagesWithContext(aws.Context, *apigateway.GetModelsInput, func(*apigateway.GetModelsOutput, bool) bool, ...aws.Option) error - GetRequestValidatorRequest(*apigateway.GetRequestValidatorInput) apigateway.GetRequestValidatorRequest GetRequestValidatorsRequest(*apigateway.GetRequestValidatorsInput) apigateway.GetRequestValidatorsRequest @@ -221,16 +202,10 @@ type APIGatewayAPI interface { GetResourcesRequest(*apigateway.GetResourcesInput) apigateway.GetResourcesRequest - GetResourcesPages(*apigateway.GetResourcesInput, func(*apigateway.GetResourcesOutput, bool) bool) error - GetResourcesPagesWithContext(aws.Context, *apigateway.GetResourcesInput, func(*apigateway.GetResourcesOutput, bool) bool, ...aws.Option) error - GetRestApiRequest(*apigateway.GetRestApiInput) apigateway.GetRestApiRequest GetRestApisRequest(*apigateway.GetRestApisInput) apigateway.GetRestApisRequest - GetRestApisPages(*apigateway.GetRestApisInput, func(*apigateway.GetRestApisOutput, bool) bool) error - GetRestApisPagesWithContext(aws.Context, *apigateway.GetRestApisInput, func(*apigateway.GetRestApisOutput, bool) bool, ...aws.Option) error - GetSdkRequest(*apigateway.GetSdkInput) apigateway.GetSdkRequest GetSdkTypeRequest(*apigateway.GetSdkTypeInput) apigateway.GetSdkTypeRequest @@ -245,30 +220,18 @@ type APIGatewayAPI interface { GetUsageRequest(*apigateway.GetUsageInput) apigateway.GetUsageRequest - GetUsagePages(*apigateway.GetUsageInput, func(*apigateway.UpdateUsageOutput, bool) bool) error - GetUsagePagesWithContext(aws.Context, *apigateway.GetUsageInput, func(*apigateway.UpdateUsageOutput, bool) bool, ...aws.Option) error - GetUsagePlanRequest(*apigateway.GetUsagePlanInput) apigateway.GetUsagePlanRequest GetUsagePlanKeyRequest(*apigateway.GetUsagePlanKeyInput) apigateway.GetUsagePlanKeyRequest GetUsagePlanKeysRequest(*apigateway.GetUsagePlanKeysInput) apigateway.GetUsagePlanKeysRequest - GetUsagePlanKeysPages(*apigateway.GetUsagePlanKeysInput, func(*apigateway.GetUsagePlanKeysOutput, bool) bool) error - GetUsagePlanKeysPagesWithContext(aws.Context, *apigateway.GetUsagePlanKeysInput, func(*apigateway.GetUsagePlanKeysOutput, bool) bool, ...aws.Option) error - GetUsagePlansRequest(*apigateway.GetUsagePlansInput) apigateway.GetUsagePlansRequest - GetUsagePlansPages(*apigateway.GetUsagePlansInput, func(*apigateway.GetUsagePlansOutput, bool) bool) error - GetUsagePlansPagesWithContext(aws.Context, *apigateway.GetUsagePlansInput, func(*apigateway.GetUsagePlansOutput, bool) bool, ...aws.Option) error - GetVpcLinkRequest(*apigateway.GetVpcLinkInput) apigateway.GetVpcLinkRequest GetVpcLinksRequest(*apigateway.GetVpcLinksInput) apigateway.GetVpcLinksRequest - GetVpcLinksPages(*apigateway.GetVpcLinksInput, func(*apigateway.GetVpcLinksOutput, bool) bool) error - GetVpcLinksPagesWithContext(aws.Context, *apigateway.GetVpcLinksInput, func(*apigateway.GetVpcLinksOutput, bool) bool, ...aws.Option) error - ImportApiKeysRequest(*apigateway.ImportApiKeysInput) apigateway.ImportApiKeysRequest ImportDocumentationPartsRequest(*apigateway.ImportDocumentationPartsInput) apigateway.ImportDocumentationPartsRequest diff --git a/service/applicationautoscaling/api.go b/service/applicationautoscaling/api.go index 3c22dcb5ab6..176eb712aa8 100644 --- a/service/applicationautoscaling/api.go +++ b/service/applicationautoscaling/api.go @@ -16,6 +16,7 @@ const opDeleteScalingPolicy = "DeleteScalingPolicy" type DeleteScalingPolicyRequest struct { *aws.Request Input *DeleteScalingPolicyInput + Copy func(*DeleteScalingPolicyInput) DeleteScalingPolicyRequest } // Send marshals and sends the DeleteScalingPolicy API request. @@ -62,7 +63,7 @@ func (c *ApplicationAutoScaling) DeleteScalingPolicyRequest(input *DeleteScaling req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteScalingPolicyRequest{Request: req, Input: input} + return DeleteScalingPolicyRequest{Request: req, Input: input, Copy: c.DeleteScalingPolicyRequest} } const opDeleteScheduledAction = "DeleteScheduledAction" @@ -71,6 +72,7 @@ const opDeleteScheduledAction = "DeleteScheduledAction" type DeleteScheduledActionRequest struct { *aws.Request Input *DeleteScheduledActionInput + Copy func(*DeleteScheduledActionInput) DeleteScheduledActionRequest } // Send marshals and sends the DeleteScheduledAction API request. @@ -111,7 +113,7 @@ func (c *ApplicationAutoScaling) DeleteScheduledActionRequest(input *DeleteSched req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteScheduledActionRequest{Request: req, Input: input} + return DeleteScheduledActionRequest{Request: req, Input: input, Copy: c.DeleteScheduledActionRequest} } const opDeregisterScalableTarget = "DeregisterScalableTarget" @@ -120,6 +122,7 @@ const opDeregisterScalableTarget = "DeregisterScalableTarget" type DeregisterScalableTargetRequest struct { *aws.Request Input *DeregisterScalableTargetInput + Copy func(*DeregisterScalableTargetInput) DeregisterScalableTargetRequest } // Send marshals and sends the DeregisterScalableTarget API request. @@ -165,7 +168,7 @@ func (c *ApplicationAutoScaling) DeregisterScalableTargetRequest(input *Deregist req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterScalableTargetRequest{Request: req, Input: input} + return DeregisterScalableTargetRequest{Request: req, Input: input, Copy: c.DeregisterScalableTargetRequest} } const opDescribeScalableTargets = "DescribeScalableTargets" @@ -174,6 +177,7 @@ const opDescribeScalableTargets = "DescribeScalableTargets" type DescribeScalableTargetsRequest struct { *aws.Request Input *DescribeScalableTargetsInput + Copy func(*DescribeScalableTargetsInput) DescribeScalableTargetsRequest } // Send marshals and sends the DescribeScalableTargets API request. @@ -227,57 +231,53 @@ func (c *ApplicationAutoScaling) DescribeScalableTargetsRequest(input *DescribeS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScalableTargetsRequest{Request: req, Input: input} + return DescribeScalableTargetsRequest{Request: req, Input: input, Copy: c.DescribeScalableTargetsRequest} } -// DescribeScalableTargetsPages iterates over the pages of a DescribeScalableTargets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScalableTargets method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeScalableTargetsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeScalableTargets operation. -// pageNum := 0 -// err := client.DescribeScalableTargetsPages(params, -// func(page *DescribeScalableTargetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ApplicationAutoScaling) DescribeScalableTargetsPages(input *DescribeScalableTargetsInput, fn func(*DescribeScalableTargetsOutput, bool) bool) error { - return c.DescribeScalableTargetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeScalableTargetsPagesWithContext same as DescribeScalableTargetsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ApplicationAutoScaling) DescribeScalableTargetsPagesWithContext(ctx aws.Context, input *DescribeScalableTargetsInput, fn func(*DescribeScalableTargetsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeScalableTargetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeScalableTargetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeScalableTargetsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeScalableTargetsRequest) Paginate(opts ...aws.Option) DescribeScalableTargetsPager { + return DescribeScalableTargetsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeScalableTargetsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScalableTargetsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeScalableTargetsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeScalableTargetsPager struct { + aws.Pager +} + +func (p *DescribeScalableTargetsPager) CurrentPage() *DescribeScalableTargetsOutput { + return p.Pager.CurrentPage().(*DescribeScalableTargetsOutput) } const opDescribeScalingActivities = "DescribeScalingActivities" @@ -286,6 +286,7 @@ const opDescribeScalingActivities = "DescribeScalingActivities" type DescribeScalingActivitiesRequest struct { *aws.Request Input *DescribeScalingActivitiesInput + Copy func(*DescribeScalingActivitiesInput) DescribeScalingActivitiesRequest } // Send marshals and sends the DescribeScalingActivities API request. @@ -340,57 +341,53 @@ func (c *ApplicationAutoScaling) DescribeScalingActivitiesRequest(input *Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScalingActivitiesRequest{Request: req, Input: input} + return DescribeScalingActivitiesRequest{Request: req, Input: input, Copy: c.DescribeScalingActivitiesRequest} } -// DescribeScalingActivitiesPages iterates over the pages of a DescribeScalingActivities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScalingActivities method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeScalingActivitiesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeScalingActivities operation. -// pageNum := 0 -// err := client.DescribeScalingActivitiesPages(params, -// func(page *DescribeScalingActivitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ApplicationAutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActivitiesInput, fn func(*DescribeScalingActivitiesOutput, bool) bool) error { - return c.DescribeScalingActivitiesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeScalingActivitiesPagesWithContext same as DescribeScalingActivitiesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ApplicationAutoScaling) DescribeScalingActivitiesPagesWithContext(ctx aws.Context, input *DescribeScalingActivitiesInput, fn func(*DescribeScalingActivitiesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeScalingActivitiesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeScalingActivitiesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeScalingActivitiesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeScalingActivitiesRequest) Paginate(opts ...aws.Option) DescribeScalingActivitiesPager { + return DescribeScalingActivitiesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeScalingActivitiesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeScalingActivitiesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeScalingActivitiesPager struct { + aws.Pager +} + +func (p *DescribeScalingActivitiesPager) CurrentPage() *DescribeScalingActivitiesOutput { + return p.Pager.CurrentPage().(*DescribeScalingActivitiesOutput) } const opDescribeScalingPolicies = "DescribeScalingPolicies" @@ -399,6 +396,7 @@ const opDescribeScalingPolicies = "DescribeScalingPolicies" type DescribeScalingPoliciesRequest struct { *aws.Request Input *DescribeScalingPoliciesInput + Copy func(*DescribeScalingPoliciesInput) DescribeScalingPoliciesRequest } // Send marshals and sends the DescribeScalingPolicies API request. @@ -451,57 +449,53 @@ func (c *ApplicationAutoScaling) DescribeScalingPoliciesRequest(input *DescribeS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScalingPoliciesRequest{Request: req, Input: input} + return DescribeScalingPoliciesRequest{Request: req, Input: input, Copy: c.DescribeScalingPoliciesRequest} } -// DescribeScalingPoliciesPages iterates over the pages of a DescribeScalingPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScalingPolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeScalingPoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeScalingPolicies operation. -// pageNum := 0 -// err := client.DescribeScalingPoliciesPages(params, -// func(page *DescribeScalingPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ApplicationAutoScaling) DescribeScalingPoliciesPages(input *DescribeScalingPoliciesInput, fn func(*DescribeScalingPoliciesOutput, bool) bool) error { - return c.DescribeScalingPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeScalingPoliciesPagesWithContext same as DescribeScalingPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ApplicationAutoScaling) DescribeScalingPoliciesPagesWithContext(ctx aws.Context, input *DescribeScalingPoliciesInput, fn func(*DescribeScalingPoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeScalingPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeScalingPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeScalingPoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeScalingPoliciesRequest) Paginate(opts ...aws.Option) DescribeScalingPoliciesPager { + return DescribeScalingPoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeScalingPoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScalingPoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeScalingPoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeScalingPoliciesPager struct { + aws.Pager +} + +func (p *DescribeScalingPoliciesPager) CurrentPage() *DescribeScalingPoliciesOutput { + return p.Pager.CurrentPage().(*DescribeScalingPoliciesOutput) } const opDescribeScheduledActions = "DescribeScheduledActions" @@ -510,6 +504,7 @@ const opDescribeScheduledActions = "DescribeScheduledActions" type DescribeScheduledActionsRequest struct { *aws.Request Input *DescribeScheduledActionsInput + Copy func(*DescribeScheduledActionsInput) DescribeScheduledActionsRequest } // Send marshals and sends the DescribeScheduledActions API request. @@ -556,7 +551,7 @@ func (c *ApplicationAutoScaling) DescribeScheduledActionsRequest(input *Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScheduledActionsRequest{Request: req, Input: input} + return DescribeScheduledActionsRequest{Request: req, Input: input, Copy: c.DescribeScheduledActionsRequest} } const opPutScalingPolicy = "PutScalingPolicy" @@ -565,6 +560,7 @@ const opPutScalingPolicy = "PutScalingPolicy" type PutScalingPolicyRequest struct { *aws.Request Input *PutScalingPolicyInput + Copy func(*PutScalingPolicyInput) PutScalingPolicyRequest } // Send marshals and sends the PutScalingPolicy API request. @@ -617,7 +613,7 @@ func (c *ApplicationAutoScaling) PutScalingPolicyRequest(input *PutScalingPolicy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutScalingPolicyRequest{Request: req, Input: input} + return PutScalingPolicyRequest{Request: req, Input: input, Copy: c.PutScalingPolicyRequest} } const opPutScheduledAction = "PutScheduledAction" @@ -626,6 +622,7 @@ const opPutScheduledAction = "PutScheduledAction" type PutScheduledActionRequest struct { *aws.Request Input *PutScheduledActionInput + Copy func(*PutScheduledActionInput) PutScheduledActionRequest } // Send marshals and sends the PutScheduledAction API request. @@ -680,7 +677,7 @@ func (c *ApplicationAutoScaling) PutScheduledActionRequest(input *PutScheduledAc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutScheduledActionRequest{Request: req, Input: input} + return PutScheduledActionRequest{Request: req, Input: input, Copy: c.PutScheduledActionRequest} } const opRegisterScalableTarget = "RegisterScalableTarget" @@ -689,6 +686,7 @@ const opRegisterScalableTarget = "RegisterScalableTarget" type RegisterScalableTargetRequest struct { *aws.Request Input *RegisterScalableTargetInput + Copy func(*RegisterScalableTargetInput) RegisterScalableTargetRequest } // Send marshals and sends the RegisterScalableTarget API request. @@ -737,7 +735,7 @@ func (c *ApplicationAutoScaling) RegisterScalableTargetRequest(input *RegisterSc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterScalableTargetRequest{Request: req, Input: input} + return RegisterScalableTargetRequest{Request: req, Input: input, Copy: c.RegisterScalableTargetRequest} } // Represents a CloudWatch alarm associated with a scaling policy. diff --git a/service/applicationautoscaling/applicationautoscalingiface/interface.go b/service/applicationautoscaling/applicationautoscalingiface/interface.go index a3eb7d1605e..e02b1be1683 100644 --- a/service/applicationautoscaling/applicationautoscalingiface/interface.go +++ b/service/applicationautoscaling/applicationautoscalingiface/interface.go @@ -9,7 +9,6 @@ package applicationautoscalingiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/applicationautoscaling" ) @@ -71,19 +70,10 @@ type ApplicationAutoScalingAPI interface { DescribeScalableTargetsRequest(*applicationautoscaling.DescribeScalableTargetsInput) applicationautoscaling.DescribeScalableTargetsRequest - DescribeScalableTargetsPages(*applicationautoscaling.DescribeScalableTargetsInput, func(*applicationautoscaling.DescribeScalableTargetsOutput, bool) bool) error - DescribeScalableTargetsPagesWithContext(aws.Context, *applicationautoscaling.DescribeScalableTargetsInput, func(*applicationautoscaling.DescribeScalableTargetsOutput, bool) bool, ...aws.Option) error - DescribeScalingActivitiesRequest(*applicationautoscaling.DescribeScalingActivitiesInput) applicationautoscaling.DescribeScalingActivitiesRequest - DescribeScalingActivitiesPages(*applicationautoscaling.DescribeScalingActivitiesInput, func(*applicationautoscaling.DescribeScalingActivitiesOutput, bool) bool) error - DescribeScalingActivitiesPagesWithContext(aws.Context, *applicationautoscaling.DescribeScalingActivitiesInput, func(*applicationautoscaling.DescribeScalingActivitiesOutput, bool) bool, ...aws.Option) error - DescribeScalingPoliciesRequest(*applicationautoscaling.DescribeScalingPoliciesInput) applicationautoscaling.DescribeScalingPoliciesRequest - DescribeScalingPoliciesPages(*applicationautoscaling.DescribeScalingPoliciesInput, func(*applicationautoscaling.DescribeScalingPoliciesOutput, bool) bool) error - DescribeScalingPoliciesPagesWithContext(aws.Context, *applicationautoscaling.DescribeScalingPoliciesInput, func(*applicationautoscaling.DescribeScalingPoliciesOutput, bool) bool, ...aws.Option) error - DescribeScheduledActionsRequest(*applicationautoscaling.DescribeScheduledActionsInput) applicationautoscaling.DescribeScheduledActionsRequest PutScalingPolicyRequest(*applicationautoscaling.PutScalingPolicyInput) applicationautoscaling.PutScalingPolicyRequest diff --git a/service/applicationdiscoveryservice/api.go b/service/applicationdiscoveryservice/api.go index 19dc9d45f3e..37c77d26616 100644 --- a/service/applicationdiscoveryservice/api.go +++ b/service/applicationdiscoveryservice/api.go @@ -16,6 +16,7 @@ const opAssociateConfigurationItemsToApplication = "AssociateConfigurationItemsT type AssociateConfigurationItemsToApplicationRequest struct { *aws.Request Input *AssociateConfigurationItemsToApplicationInput + Copy func(*AssociateConfigurationItemsToApplicationInput) AssociateConfigurationItemsToApplicationRequest } // Send marshals and sends the AssociateConfigurationItemsToApplication API request. @@ -56,7 +57,7 @@ func (c *ApplicationDiscoveryService) AssociateConfigurationItemsToApplicationRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateConfigurationItemsToApplicationRequest{Request: req, Input: input} + return AssociateConfigurationItemsToApplicationRequest{Request: req, Input: input, Copy: c.AssociateConfigurationItemsToApplicationRequest} } const opCreateApplication = "CreateApplication" @@ -65,6 +66,7 @@ const opCreateApplication = "CreateApplication" type CreateApplicationRequest struct { *aws.Request Input *CreateApplicationInput + Copy func(*CreateApplicationInput) CreateApplicationRequest } // Send marshals and sends the CreateApplication API request. @@ -105,7 +107,7 @@ func (c *ApplicationDiscoveryService) CreateApplicationRequest(input *CreateAppl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateApplicationRequest{Request: req, Input: input} + return CreateApplicationRequest{Request: req, Input: input, Copy: c.CreateApplicationRequest} } const opCreateTags = "CreateTags" @@ -114,6 +116,7 @@ const opCreateTags = "CreateTags" type CreateTagsRequest struct { *aws.Request Input *CreateTagsInput + Copy func(*CreateTagsInput) CreateTagsRequest } // Send marshals and sends the CreateTags API request. @@ -156,7 +159,7 @@ func (c *ApplicationDiscoveryService) CreateTagsRequest(input *CreateTagsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTagsRequest{Request: req, Input: input} + return CreateTagsRequest{Request: req, Input: input, Copy: c.CreateTagsRequest} } const opDeleteApplications = "DeleteApplications" @@ -165,6 +168,7 @@ const opDeleteApplications = "DeleteApplications" type DeleteApplicationsRequest struct { *aws.Request Input *DeleteApplicationsInput + Copy func(*DeleteApplicationsInput) DeleteApplicationsRequest } // Send marshals and sends the DeleteApplications API request. @@ -206,7 +210,7 @@ func (c *ApplicationDiscoveryService) DeleteApplicationsRequest(input *DeleteApp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApplicationsRequest{Request: req, Input: input} + return DeleteApplicationsRequest{Request: req, Input: input, Copy: c.DeleteApplicationsRequest} } const opDeleteTags = "DeleteTags" @@ -215,6 +219,7 @@ const opDeleteTags = "DeleteTags" type DeleteTagsRequest struct { *aws.Request Input *DeleteTagsInput + Copy func(*DeleteTagsInput) DeleteTagsRequest } // Send marshals and sends the DeleteTags API request. @@ -256,7 +261,7 @@ func (c *ApplicationDiscoveryService) DeleteTagsRequest(input *DeleteTagsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTagsRequest{Request: req, Input: input} + return DeleteTagsRequest{Request: req, Input: input, Copy: c.DeleteTagsRequest} } const opDescribeAgents = "DescribeAgents" @@ -265,6 +270,7 @@ const opDescribeAgents = "DescribeAgents" type DescribeAgentsRequest struct { *aws.Request Input *DescribeAgentsInput + Copy func(*DescribeAgentsInput) DescribeAgentsRequest } // Send marshals and sends the DescribeAgents API request. @@ -306,7 +312,7 @@ func (c *ApplicationDiscoveryService) DescribeAgentsRequest(input *DescribeAgent req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAgentsRequest{Request: req, Input: input} + return DescribeAgentsRequest{Request: req, Input: input, Copy: c.DescribeAgentsRequest} } const opDescribeConfigurations = "DescribeConfigurations" @@ -315,6 +321,7 @@ const opDescribeConfigurations = "DescribeConfigurations" type DescribeConfigurationsRequest struct { *aws.Request Input *DescribeConfigurationsInput + Copy func(*DescribeConfigurationsInput) DescribeConfigurationsRequest } // Send marshals and sends the DescribeConfigurations API request. @@ -362,7 +369,7 @@ func (c *ApplicationDiscoveryService) DescribeConfigurationsRequest(input *Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigurationsRequest{Request: req, Input: input} + return DescribeConfigurationsRequest{Request: req, Input: input, Copy: c.DescribeConfigurationsRequest} } const opDescribeExportConfigurations = "DescribeExportConfigurations" @@ -371,6 +378,7 @@ const opDescribeExportConfigurations = "DescribeExportConfigurations" type DescribeExportConfigurationsRequest struct { *aws.Request Input *DescribeExportConfigurationsInput + Copy func(*DescribeExportConfigurationsInput) DescribeExportConfigurationsRequest } // Send marshals and sends the DescribeExportConfigurations API request. @@ -417,7 +425,7 @@ func (c *ApplicationDiscoveryService) DescribeExportConfigurationsRequest(input req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeExportConfigurationsRequest{Request: req, Input: input} + return DescribeExportConfigurationsRequest{Request: req, Input: input, Copy: c.DescribeExportConfigurationsRequest} } const opDescribeExportTasks = "DescribeExportTasks" @@ -426,6 +434,7 @@ const opDescribeExportTasks = "DescribeExportTasks" type DescribeExportTasksRequest struct { *aws.Request Input *DescribeExportTasksInput + Copy func(*DescribeExportTasksInput) DescribeExportTasksRequest } // Send marshals and sends the DescribeExportTasks API request. @@ -467,7 +476,7 @@ func (c *ApplicationDiscoveryService) DescribeExportTasksRequest(input *Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeExportTasksRequest{Request: req, Input: input} + return DescribeExportTasksRequest{Request: req, Input: input, Copy: c.DescribeExportTasksRequest} } const opDescribeTags = "DescribeTags" @@ -476,6 +485,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -517,7 +527,7 @@ func (c *ApplicationDiscoveryService) DescribeTagsRequest(input *DescribeTagsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } const opDisassociateConfigurationItemsFromApplication = "DisassociateConfigurationItemsFromApplication" @@ -526,6 +536,7 @@ const opDisassociateConfigurationItemsFromApplication = "DisassociateConfigurati type DisassociateConfigurationItemsFromApplicationRequest struct { *aws.Request Input *DisassociateConfigurationItemsFromApplicationInput + Copy func(*DisassociateConfigurationItemsFromApplicationInput) DisassociateConfigurationItemsFromApplicationRequest } // Send marshals and sends the DisassociateConfigurationItemsFromApplication API request. @@ -566,7 +577,7 @@ func (c *ApplicationDiscoveryService) DisassociateConfigurationItemsFromApplicat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateConfigurationItemsFromApplicationRequest{Request: req, Input: input} + return DisassociateConfigurationItemsFromApplicationRequest{Request: req, Input: input, Copy: c.DisassociateConfigurationItemsFromApplicationRequest} } const opExportConfigurations = "ExportConfigurations" @@ -575,6 +586,7 @@ const opExportConfigurations = "ExportConfigurations" type ExportConfigurationsRequest struct { *aws.Request Input *ExportConfigurationsInput + Copy func(*ExportConfigurationsInput) ExportConfigurationsRequest } // Send marshals and sends the ExportConfigurations API request. @@ -624,7 +636,7 @@ func (c *ApplicationDiscoveryService) ExportConfigurationsRequest(input *ExportC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ExportConfigurationsRequest{Request: req, Input: input} + return ExportConfigurationsRequest{Request: req, Input: input, Copy: c.ExportConfigurationsRequest} } const opGetDiscoverySummary = "GetDiscoverySummary" @@ -633,6 +645,7 @@ const opGetDiscoverySummary = "GetDiscoverySummary" type GetDiscoverySummaryRequest struct { *aws.Request Input *GetDiscoverySummaryInput + Copy func(*GetDiscoverySummaryInput) GetDiscoverySummaryRequest } // Send marshals and sends the GetDiscoverySummary API request. @@ -673,7 +686,7 @@ func (c *ApplicationDiscoveryService) GetDiscoverySummaryRequest(input *GetDisco req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDiscoverySummaryRequest{Request: req, Input: input} + return GetDiscoverySummaryRequest{Request: req, Input: input, Copy: c.GetDiscoverySummaryRequest} } const opListConfigurations = "ListConfigurations" @@ -682,6 +695,7 @@ const opListConfigurations = "ListConfigurations" type ListConfigurationsRequest struct { *aws.Request Input *ListConfigurationsInput + Copy func(*ListConfigurationsInput) ListConfigurationsRequest } // Send marshals and sends the ListConfigurations API request. @@ -723,7 +737,7 @@ func (c *ApplicationDiscoveryService) ListConfigurationsRequest(input *ListConfi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListConfigurationsRequest{Request: req, Input: input} + return ListConfigurationsRequest{Request: req, Input: input, Copy: c.ListConfigurationsRequest} } const opListServerNeighbors = "ListServerNeighbors" @@ -732,6 +746,7 @@ const opListServerNeighbors = "ListServerNeighbors" type ListServerNeighborsRequest struct { *aws.Request Input *ListServerNeighborsInput + Copy func(*ListServerNeighborsInput) ListServerNeighborsRequest } // Send marshals and sends the ListServerNeighbors API request. @@ -773,7 +788,7 @@ func (c *ApplicationDiscoveryService) ListServerNeighborsRequest(input *ListServ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListServerNeighborsRequest{Request: req, Input: input} + return ListServerNeighborsRequest{Request: req, Input: input, Copy: c.ListServerNeighborsRequest} } const opStartDataCollectionByAgentIds = "StartDataCollectionByAgentIds" @@ -782,6 +797,7 @@ const opStartDataCollectionByAgentIds = "StartDataCollectionByAgentIds" type StartDataCollectionByAgentIdsRequest struct { *aws.Request Input *StartDataCollectionByAgentIdsInput + Copy func(*StartDataCollectionByAgentIdsInput) StartDataCollectionByAgentIdsRequest } // Send marshals and sends the StartDataCollectionByAgentIds API request. @@ -822,7 +838,7 @@ func (c *ApplicationDiscoveryService) StartDataCollectionByAgentIdsRequest(input req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartDataCollectionByAgentIdsRequest{Request: req, Input: input} + return StartDataCollectionByAgentIdsRequest{Request: req, Input: input, Copy: c.StartDataCollectionByAgentIdsRequest} } const opStartExportTask = "StartExportTask" @@ -831,6 +847,7 @@ const opStartExportTask = "StartExportTask" type StartExportTaskRequest struct { *aws.Request Input *StartExportTaskInput + Copy func(*StartExportTaskInput) StartExportTaskRequest } // Send marshals and sends the StartExportTask API request. @@ -881,7 +898,7 @@ func (c *ApplicationDiscoveryService) StartExportTaskRequest(input *StartExportT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartExportTaskRequest{Request: req, Input: input} + return StartExportTaskRequest{Request: req, Input: input, Copy: c.StartExportTaskRequest} } const opStopDataCollectionByAgentIds = "StopDataCollectionByAgentIds" @@ -890,6 +907,7 @@ const opStopDataCollectionByAgentIds = "StopDataCollectionByAgentIds" type StopDataCollectionByAgentIdsRequest struct { *aws.Request Input *StopDataCollectionByAgentIdsInput + Copy func(*StopDataCollectionByAgentIdsInput) StopDataCollectionByAgentIdsRequest } // Send marshals and sends the StopDataCollectionByAgentIds API request. @@ -930,7 +948,7 @@ func (c *ApplicationDiscoveryService) StopDataCollectionByAgentIdsRequest(input req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopDataCollectionByAgentIdsRequest{Request: req, Input: input} + return StopDataCollectionByAgentIdsRequest{Request: req, Input: input, Copy: c.StopDataCollectionByAgentIdsRequest} } const opUpdateApplication = "UpdateApplication" @@ -939,6 +957,7 @@ const opUpdateApplication = "UpdateApplication" type UpdateApplicationRequest struct { *aws.Request Input *UpdateApplicationInput + Copy func(*UpdateApplicationInput) UpdateApplicationRequest } // Send marshals and sends the UpdateApplication API request. @@ -979,7 +998,7 @@ func (c *ApplicationDiscoveryService) UpdateApplicationRequest(input *UpdateAppl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApplicationRequest{Request: req, Input: input} + return UpdateApplicationRequest{Request: req, Input: input, Copy: c.UpdateApplicationRequest} } // Information about agents or connectors that were instructed to start collecting diff --git a/service/appstream/api.go b/service/appstream/api.go index 24088f7e176..0bb20a3f813 100644 --- a/service/appstream/api.go +++ b/service/appstream/api.go @@ -16,6 +16,7 @@ const opAssociateFleet = "AssociateFleet" type AssociateFleetRequest struct { *aws.Request Input *AssociateFleetInput + Copy func(*AssociateFleetInput) AssociateFleetRequest } // Send marshals and sends the AssociateFleet API request. @@ -56,7 +57,7 @@ func (c *AppStream) AssociateFleetRequest(input *AssociateFleetInput) AssociateF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateFleetRequest{Request: req, Input: input} + return AssociateFleetRequest{Request: req, Input: input, Copy: c.AssociateFleetRequest} } const opCreateDirectoryConfig = "CreateDirectoryConfig" @@ -65,6 +66,7 @@ const opCreateDirectoryConfig = "CreateDirectoryConfig" type CreateDirectoryConfigRequest struct { *aws.Request Input *CreateDirectoryConfigInput + Copy func(*CreateDirectoryConfigInput) CreateDirectoryConfigRequest } // Send marshals and sends the CreateDirectoryConfig API request. @@ -105,7 +107,7 @@ func (c *AppStream) CreateDirectoryConfigRequest(input *CreateDirectoryConfigInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDirectoryConfigRequest{Request: req, Input: input} + return CreateDirectoryConfigRequest{Request: req, Input: input, Copy: c.CreateDirectoryConfigRequest} } const opCreateFleet = "CreateFleet" @@ -114,6 +116,7 @@ const opCreateFleet = "CreateFleet" type CreateFleetRequest struct { *aws.Request Input *CreateFleetInput + Copy func(*CreateFleetInput) CreateFleetRequest } // Send marshals and sends the CreateFleet API request. @@ -154,7 +157,7 @@ func (c *AppStream) CreateFleetRequest(input *CreateFleetInput) CreateFleetReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFleetRequest{Request: req, Input: input} + return CreateFleetRequest{Request: req, Input: input, Copy: c.CreateFleetRequest} } const opCreateImageBuilder = "CreateImageBuilder" @@ -163,6 +166,7 @@ const opCreateImageBuilder = "CreateImageBuilder" type CreateImageBuilderRequest struct { *aws.Request Input *CreateImageBuilderInput + Copy func(*CreateImageBuilderInput) CreateImageBuilderRequest } // Send marshals and sends the CreateImageBuilder API request. @@ -206,7 +210,7 @@ func (c *AppStream) CreateImageBuilderRequest(input *CreateImageBuilderInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateImageBuilderRequest{Request: req, Input: input} + return CreateImageBuilderRequest{Request: req, Input: input, Copy: c.CreateImageBuilderRequest} } const opCreateImageBuilderStreamingURL = "CreateImageBuilderStreamingURL" @@ -215,6 +219,7 @@ const opCreateImageBuilderStreamingURL = "CreateImageBuilderStreamingURL" type CreateImageBuilderStreamingURLRequest struct { *aws.Request Input *CreateImageBuilderStreamingURLInput + Copy func(*CreateImageBuilderStreamingURLInput) CreateImageBuilderStreamingURLRequest } // Send marshals and sends the CreateImageBuilderStreamingURL API request. @@ -255,7 +260,7 @@ func (c *AppStream) CreateImageBuilderStreamingURLRequest(input *CreateImageBuil req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateImageBuilderStreamingURLRequest{Request: req, Input: input} + return CreateImageBuilderStreamingURLRequest{Request: req, Input: input, Copy: c.CreateImageBuilderStreamingURLRequest} } const opCreateStack = "CreateStack" @@ -264,6 +269,7 @@ const opCreateStack = "CreateStack" type CreateStackRequest struct { *aws.Request Input *CreateStackInput + Copy func(*CreateStackInput) CreateStackRequest } // Send marshals and sends the CreateStack API request. @@ -304,7 +310,7 @@ func (c *AppStream) CreateStackRequest(input *CreateStackInput) CreateStackReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStackRequest{Request: req, Input: input} + return CreateStackRequest{Request: req, Input: input, Copy: c.CreateStackRequest} } const opCreateStreamingURL = "CreateStreamingURL" @@ -313,6 +319,7 @@ const opCreateStreamingURL = "CreateStreamingURL" type CreateStreamingURLRequest struct { *aws.Request Input *CreateStreamingURLInput + Copy func(*CreateStreamingURLInput) CreateStreamingURLRequest } // Send marshals and sends the CreateStreamingURL API request. @@ -353,7 +360,7 @@ func (c *AppStream) CreateStreamingURLRequest(input *CreateStreamingURLInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStreamingURLRequest{Request: req, Input: input} + return CreateStreamingURLRequest{Request: req, Input: input, Copy: c.CreateStreamingURLRequest} } const opDeleteDirectoryConfig = "DeleteDirectoryConfig" @@ -362,6 +369,7 @@ const opDeleteDirectoryConfig = "DeleteDirectoryConfig" type DeleteDirectoryConfigRequest struct { *aws.Request Input *DeleteDirectoryConfigInput + Copy func(*DeleteDirectoryConfigInput) DeleteDirectoryConfigRequest } // Send marshals and sends the DeleteDirectoryConfig API request. @@ -402,7 +410,7 @@ func (c *AppStream) DeleteDirectoryConfigRequest(input *DeleteDirectoryConfigInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDirectoryConfigRequest{Request: req, Input: input} + return DeleteDirectoryConfigRequest{Request: req, Input: input, Copy: c.DeleteDirectoryConfigRequest} } const opDeleteFleet = "DeleteFleet" @@ -411,6 +419,7 @@ const opDeleteFleet = "DeleteFleet" type DeleteFleetRequest struct { *aws.Request Input *DeleteFleetInput + Copy func(*DeleteFleetInput) DeleteFleetRequest } // Send marshals and sends the DeleteFleet API request. @@ -451,7 +460,7 @@ func (c *AppStream) DeleteFleetRequest(input *DeleteFleetInput) DeleteFleetReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteFleetRequest{Request: req, Input: input} + return DeleteFleetRequest{Request: req, Input: input, Copy: c.DeleteFleetRequest} } const opDeleteImage = "DeleteImage" @@ -460,6 +469,7 @@ const opDeleteImage = "DeleteImage" type DeleteImageRequest struct { *aws.Request Input *DeleteImageInput + Copy func(*DeleteImageInput) DeleteImageRequest } // Send marshals and sends the DeleteImage API request. @@ -502,7 +512,7 @@ func (c *AppStream) DeleteImageRequest(input *DeleteImageInput) DeleteImageReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteImageRequest{Request: req, Input: input} + return DeleteImageRequest{Request: req, Input: input, Copy: c.DeleteImageRequest} } const opDeleteImageBuilder = "DeleteImageBuilder" @@ -511,6 +521,7 @@ const opDeleteImageBuilder = "DeleteImageBuilder" type DeleteImageBuilderRequest struct { *aws.Request Input *DeleteImageBuilderInput + Copy func(*DeleteImageBuilderInput) DeleteImageBuilderRequest } // Send marshals and sends the DeleteImageBuilder API request. @@ -551,7 +562,7 @@ func (c *AppStream) DeleteImageBuilderRequest(input *DeleteImageBuilderInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteImageBuilderRequest{Request: req, Input: input} + return DeleteImageBuilderRequest{Request: req, Input: input, Copy: c.DeleteImageBuilderRequest} } const opDeleteStack = "DeleteStack" @@ -560,6 +571,7 @@ const opDeleteStack = "DeleteStack" type DeleteStackRequest struct { *aws.Request Input *DeleteStackInput + Copy func(*DeleteStackInput) DeleteStackRequest } // Send marshals and sends the DeleteStack API request. @@ -601,7 +613,7 @@ func (c *AppStream) DeleteStackRequest(input *DeleteStackInput) DeleteStackReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteStackRequest{Request: req, Input: input} + return DeleteStackRequest{Request: req, Input: input, Copy: c.DeleteStackRequest} } const opDescribeDirectoryConfigs = "DescribeDirectoryConfigs" @@ -610,6 +622,7 @@ const opDescribeDirectoryConfigs = "DescribeDirectoryConfigs" type DescribeDirectoryConfigsRequest struct { *aws.Request Input *DescribeDirectoryConfigsInput + Copy func(*DescribeDirectoryConfigsInput) DescribeDirectoryConfigsRequest } // Send marshals and sends the DescribeDirectoryConfigs API request. @@ -650,7 +663,7 @@ func (c *AppStream) DescribeDirectoryConfigsRequest(input *DescribeDirectoryConf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDirectoryConfigsRequest{Request: req, Input: input} + return DescribeDirectoryConfigsRequest{Request: req, Input: input, Copy: c.DescribeDirectoryConfigsRequest} } const opDescribeFleets = "DescribeFleets" @@ -659,6 +672,7 @@ const opDescribeFleets = "DescribeFleets" type DescribeFleetsRequest struct { *aws.Request Input *DescribeFleetsInput + Copy func(*DescribeFleetsInput) DescribeFleetsRequest } // Send marshals and sends the DescribeFleets API request. @@ -699,7 +713,7 @@ func (c *AppStream) DescribeFleetsRequest(input *DescribeFleetsInput) DescribeFl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFleetsRequest{Request: req, Input: input} + return DescribeFleetsRequest{Request: req, Input: input, Copy: c.DescribeFleetsRequest} } const opDescribeImageBuilders = "DescribeImageBuilders" @@ -708,6 +722,7 @@ const opDescribeImageBuilders = "DescribeImageBuilders" type DescribeImageBuildersRequest struct { *aws.Request Input *DescribeImageBuildersInput + Copy func(*DescribeImageBuildersInput) DescribeImageBuildersRequest } // Send marshals and sends the DescribeImageBuilders API request. @@ -748,7 +763,7 @@ func (c *AppStream) DescribeImageBuildersRequest(input *DescribeImageBuildersInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeImageBuildersRequest{Request: req, Input: input} + return DescribeImageBuildersRequest{Request: req, Input: input, Copy: c.DescribeImageBuildersRequest} } const opDescribeImages = "DescribeImages" @@ -757,6 +772,7 @@ const opDescribeImages = "DescribeImages" type DescribeImagesRequest struct { *aws.Request Input *DescribeImagesInput + Copy func(*DescribeImagesInput) DescribeImagesRequest } // Send marshals and sends the DescribeImages API request. @@ -797,7 +813,7 @@ func (c *AppStream) DescribeImagesRequest(input *DescribeImagesInput) DescribeIm req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeImagesRequest{Request: req, Input: input} + return DescribeImagesRequest{Request: req, Input: input, Copy: c.DescribeImagesRequest} } const opDescribeSessions = "DescribeSessions" @@ -806,6 +822,7 @@ const opDescribeSessions = "DescribeSessions" type DescribeSessionsRequest struct { *aws.Request Input *DescribeSessionsInput + Copy func(*DescribeSessionsInput) DescribeSessionsRequest } // Send marshals and sends the DescribeSessions API request. @@ -849,7 +866,7 @@ func (c *AppStream) DescribeSessionsRequest(input *DescribeSessionsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSessionsRequest{Request: req, Input: input} + return DescribeSessionsRequest{Request: req, Input: input, Copy: c.DescribeSessionsRequest} } const opDescribeStacks = "DescribeStacks" @@ -858,6 +875,7 @@ const opDescribeStacks = "DescribeStacks" type DescribeStacksRequest struct { *aws.Request Input *DescribeStacksInput + Copy func(*DescribeStacksInput) DescribeStacksRequest } // Send marshals and sends the DescribeStacks API request. @@ -898,7 +916,7 @@ func (c *AppStream) DescribeStacksRequest(input *DescribeStacksInput) DescribeSt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStacksRequest{Request: req, Input: input} + return DescribeStacksRequest{Request: req, Input: input, Copy: c.DescribeStacksRequest} } const opDisassociateFleet = "DisassociateFleet" @@ -907,6 +925,7 @@ const opDisassociateFleet = "DisassociateFleet" type DisassociateFleetRequest struct { *aws.Request Input *DisassociateFleetInput + Copy func(*DisassociateFleetInput) DisassociateFleetRequest } // Send marshals and sends the DisassociateFleet API request. @@ -947,7 +966,7 @@ func (c *AppStream) DisassociateFleetRequest(input *DisassociateFleetInput) Disa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateFleetRequest{Request: req, Input: input} + return DisassociateFleetRequest{Request: req, Input: input, Copy: c.DisassociateFleetRequest} } const opExpireSession = "ExpireSession" @@ -956,6 +975,7 @@ const opExpireSession = "ExpireSession" type ExpireSessionRequest struct { *aws.Request Input *ExpireSessionInput + Copy func(*ExpireSessionInput) ExpireSessionRequest } // Send marshals and sends the ExpireSession API request. @@ -996,7 +1016,7 @@ func (c *AppStream) ExpireSessionRequest(input *ExpireSessionInput) ExpireSessio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ExpireSessionRequest{Request: req, Input: input} + return ExpireSessionRequest{Request: req, Input: input, Copy: c.ExpireSessionRequest} } const opListAssociatedFleets = "ListAssociatedFleets" @@ -1005,6 +1025,7 @@ const opListAssociatedFleets = "ListAssociatedFleets" type ListAssociatedFleetsRequest struct { *aws.Request Input *ListAssociatedFleetsInput + Copy func(*ListAssociatedFleetsInput) ListAssociatedFleetsRequest } // Send marshals and sends the ListAssociatedFleets API request. @@ -1045,7 +1066,7 @@ func (c *AppStream) ListAssociatedFleetsRequest(input *ListAssociatedFleetsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAssociatedFleetsRequest{Request: req, Input: input} + return ListAssociatedFleetsRequest{Request: req, Input: input, Copy: c.ListAssociatedFleetsRequest} } const opListAssociatedStacks = "ListAssociatedStacks" @@ -1054,6 +1075,7 @@ const opListAssociatedStacks = "ListAssociatedStacks" type ListAssociatedStacksRequest struct { *aws.Request Input *ListAssociatedStacksInput + Copy func(*ListAssociatedStacksInput) ListAssociatedStacksRequest } // Send marshals and sends the ListAssociatedStacks API request. @@ -1094,7 +1116,7 @@ func (c *AppStream) ListAssociatedStacksRequest(input *ListAssociatedStacksInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAssociatedStacksRequest{Request: req, Input: input} + return ListAssociatedStacksRequest{Request: req, Input: input, Copy: c.ListAssociatedStacksRequest} } const opListTagsForResource = "ListTagsForResource" @@ -1103,6 +1125,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -1147,7 +1170,7 @@ func (c *AppStream) ListTagsForResourceRequest(input *ListTagsForResourceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opStartFleet = "StartFleet" @@ -1156,6 +1179,7 @@ const opStartFleet = "StartFleet" type StartFleetRequest struct { *aws.Request Input *StartFleetInput + Copy func(*StartFleetInput) StartFleetRequest } // Send marshals and sends the StartFleet API request. @@ -1196,7 +1220,7 @@ func (c *AppStream) StartFleetRequest(input *StartFleetInput) StartFleetRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartFleetRequest{Request: req, Input: input} + return StartFleetRequest{Request: req, Input: input, Copy: c.StartFleetRequest} } const opStartImageBuilder = "StartImageBuilder" @@ -1205,6 +1229,7 @@ const opStartImageBuilder = "StartImageBuilder" type StartImageBuilderRequest struct { *aws.Request Input *StartImageBuilderInput + Copy func(*StartImageBuilderInput) StartImageBuilderRequest } // Send marshals and sends the StartImageBuilder API request. @@ -1245,7 +1270,7 @@ func (c *AppStream) StartImageBuilderRequest(input *StartImageBuilderInput) Star req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartImageBuilderRequest{Request: req, Input: input} + return StartImageBuilderRequest{Request: req, Input: input, Copy: c.StartImageBuilderRequest} } const opStopFleet = "StopFleet" @@ -1254,6 +1279,7 @@ const opStopFleet = "StopFleet" type StopFleetRequest struct { *aws.Request Input *StopFleetInput + Copy func(*StopFleetInput) StopFleetRequest } // Send marshals and sends the StopFleet API request. @@ -1294,7 +1320,7 @@ func (c *AppStream) StopFleetRequest(input *StopFleetInput) StopFleetRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopFleetRequest{Request: req, Input: input} + return StopFleetRequest{Request: req, Input: input, Copy: c.StopFleetRequest} } const opStopImageBuilder = "StopImageBuilder" @@ -1303,6 +1329,7 @@ const opStopImageBuilder = "StopImageBuilder" type StopImageBuilderRequest struct { *aws.Request Input *StopImageBuilderInput + Copy func(*StopImageBuilderInput) StopImageBuilderRequest } // Send marshals and sends the StopImageBuilder API request. @@ -1343,7 +1370,7 @@ func (c *AppStream) StopImageBuilderRequest(input *StopImageBuilderInput) StopIm req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopImageBuilderRequest{Request: req, Input: input} + return StopImageBuilderRequest{Request: req, Input: input, Copy: c.StopImageBuilderRequest} } const opTagResource = "TagResource" @@ -1352,6 +1379,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -1402,7 +1430,7 @@ func (c *AppStream) TagResourceRequest(input *TagResourceInput) TagResourceReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource" @@ -1411,6 +1439,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -1456,7 +1485,7 @@ func (c *AppStream) UntagResourceRequest(input *UntagResourceInput) UntagResourc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateDirectoryConfig = "UpdateDirectoryConfig" @@ -1465,6 +1494,7 @@ const opUpdateDirectoryConfig = "UpdateDirectoryConfig" type UpdateDirectoryConfigRequest struct { *aws.Request Input *UpdateDirectoryConfigInput + Copy func(*UpdateDirectoryConfigInput) UpdateDirectoryConfigRequest } // Send marshals and sends the UpdateDirectoryConfig API request. @@ -1505,7 +1535,7 @@ func (c *AppStream) UpdateDirectoryConfigRequest(input *UpdateDirectoryConfigInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDirectoryConfigRequest{Request: req, Input: input} + return UpdateDirectoryConfigRequest{Request: req, Input: input, Copy: c.UpdateDirectoryConfigRequest} } const opUpdateFleet = "UpdateFleet" @@ -1514,6 +1544,7 @@ const opUpdateFleet = "UpdateFleet" type UpdateFleetRequest struct { *aws.Request Input *UpdateFleetInput + Copy func(*UpdateFleetInput) UpdateFleetRequest } // Send marshals and sends the UpdateFleet API request. @@ -1559,7 +1590,7 @@ func (c *AppStream) UpdateFleetRequest(input *UpdateFleetInput) UpdateFleetReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateFleetRequest{Request: req, Input: input} + return UpdateFleetRequest{Request: req, Input: input, Copy: c.UpdateFleetRequest} } const opUpdateStack = "UpdateStack" @@ -1568,6 +1599,7 @@ const opUpdateStack = "UpdateStack" type UpdateStackRequest struct { *aws.Request Input *UpdateStackInput + Copy func(*UpdateStackInput) UpdateStackRequest } // Send marshals and sends the UpdateStack API request. @@ -1608,7 +1640,7 @@ func (c *AppStream) UpdateStackRequest(input *UpdateStackInput) UpdateStackReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateStackRequest{Request: req, Input: input} + return UpdateStackRequest{Request: req, Input: input, Copy: c.UpdateStackRequest} } // Describes an application in the application catalog. diff --git a/service/appsync/api.go b/service/appsync/api.go index 05634677569..0f46edaed71 100644 --- a/service/appsync/api.go +++ b/service/appsync/api.go @@ -14,6 +14,7 @@ const opCreateApiKey = "CreateApiKey" type CreateApiKeyRequest struct { *aws.Request Input *CreateApiKeyInput + Copy func(*CreateApiKeyInput) CreateApiKeyRequest } // Send marshals and sends the CreateApiKey API request. @@ -55,7 +56,7 @@ func (c *AppSync) CreateApiKeyRequest(input *CreateApiKeyInput) CreateApiKeyRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateApiKeyRequest{Request: req, Input: input} + return CreateApiKeyRequest{Request: req, Input: input, Copy: c.CreateApiKeyRequest} } const opCreateDataSource = "CreateDataSource" @@ -64,6 +65,7 @@ const opCreateDataSource = "CreateDataSource" type CreateDataSourceRequest struct { *aws.Request Input *CreateDataSourceInput + Copy func(*CreateDataSourceInput) CreateDataSourceRequest } // Send marshals and sends the CreateDataSource API request. @@ -104,7 +106,7 @@ func (c *AppSync) CreateDataSourceRequest(input *CreateDataSourceInput) CreateDa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDataSourceRequest{Request: req, Input: input} + return CreateDataSourceRequest{Request: req, Input: input, Copy: c.CreateDataSourceRequest} } const opCreateGraphqlApi = "CreateGraphqlApi" @@ -113,6 +115,7 @@ const opCreateGraphqlApi = "CreateGraphqlApi" type CreateGraphqlApiRequest struct { *aws.Request Input *CreateGraphqlApiInput + Copy func(*CreateGraphqlApiInput) CreateGraphqlApiRequest } // Send marshals and sends the CreateGraphqlApi API request. @@ -153,7 +156,7 @@ func (c *AppSync) CreateGraphqlApiRequest(input *CreateGraphqlApiInput) CreateGr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGraphqlApiRequest{Request: req, Input: input} + return CreateGraphqlApiRequest{Request: req, Input: input, Copy: c.CreateGraphqlApiRequest} } const opCreateResolver = "CreateResolver" @@ -162,6 +165,7 @@ const opCreateResolver = "CreateResolver" type CreateResolverRequest struct { *aws.Request Input *CreateResolverInput + Copy func(*CreateResolverInput) CreateResolverRequest } // Send marshals and sends the CreateResolver API request. @@ -205,7 +209,7 @@ func (c *AppSync) CreateResolverRequest(input *CreateResolverInput) CreateResolv req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateResolverRequest{Request: req, Input: input} + return CreateResolverRequest{Request: req, Input: input, Copy: c.CreateResolverRequest} } const opCreateType = "CreateType" @@ -214,6 +218,7 @@ const opCreateType = "CreateType" type CreateTypeRequest struct { *aws.Request Input *CreateTypeInput + Copy func(*CreateTypeInput) CreateTypeRequest } // Send marshals and sends the CreateType API request. @@ -254,7 +259,7 @@ func (c *AppSync) CreateTypeRequest(input *CreateTypeInput) CreateTypeRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTypeRequest{Request: req, Input: input} + return CreateTypeRequest{Request: req, Input: input, Copy: c.CreateTypeRequest} } const opDeleteApiKey = "DeleteApiKey" @@ -263,6 +268,7 @@ const opDeleteApiKey = "DeleteApiKey" type DeleteApiKeyRequest struct { *aws.Request Input *DeleteApiKeyInput + Copy func(*DeleteApiKeyInput) DeleteApiKeyRequest } // Send marshals and sends the DeleteApiKey API request. @@ -303,7 +309,7 @@ func (c *AppSync) DeleteApiKeyRequest(input *DeleteApiKeyInput) DeleteApiKeyRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApiKeyRequest{Request: req, Input: input} + return DeleteApiKeyRequest{Request: req, Input: input, Copy: c.DeleteApiKeyRequest} } const opDeleteDataSource = "DeleteDataSource" @@ -312,6 +318,7 @@ const opDeleteDataSource = "DeleteDataSource" type DeleteDataSourceRequest struct { *aws.Request Input *DeleteDataSourceInput + Copy func(*DeleteDataSourceInput) DeleteDataSourceRequest } // Send marshals and sends the DeleteDataSource API request. @@ -352,7 +359,7 @@ func (c *AppSync) DeleteDataSourceRequest(input *DeleteDataSourceInput) DeleteDa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDataSourceRequest{Request: req, Input: input} + return DeleteDataSourceRequest{Request: req, Input: input, Copy: c.DeleteDataSourceRequest} } const opDeleteGraphqlApi = "DeleteGraphqlApi" @@ -361,6 +368,7 @@ const opDeleteGraphqlApi = "DeleteGraphqlApi" type DeleteGraphqlApiRequest struct { *aws.Request Input *DeleteGraphqlApiInput + Copy func(*DeleteGraphqlApiInput) DeleteGraphqlApiRequest } // Send marshals and sends the DeleteGraphqlApi API request. @@ -401,7 +409,7 @@ func (c *AppSync) DeleteGraphqlApiRequest(input *DeleteGraphqlApiInput) DeleteGr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGraphqlApiRequest{Request: req, Input: input} + return DeleteGraphqlApiRequest{Request: req, Input: input, Copy: c.DeleteGraphqlApiRequest} } const opDeleteResolver = "DeleteResolver" @@ -410,6 +418,7 @@ const opDeleteResolver = "DeleteResolver" type DeleteResolverRequest struct { *aws.Request Input *DeleteResolverInput + Copy func(*DeleteResolverInput) DeleteResolverRequest } // Send marshals and sends the DeleteResolver API request. @@ -450,7 +459,7 @@ func (c *AppSync) DeleteResolverRequest(input *DeleteResolverInput) DeleteResolv req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteResolverRequest{Request: req, Input: input} + return DeleteResolverRequest{Request: req, Input: input, Copy: c.DeleteResolverRequest} } const opDeleteType = "DeleteType" @@ -459,6 +468,7 @@ const opDeleteType = "DeleteType" type DeleteTypeRequest struct { *aws.Request Input *DeleteTypeInput + Copy func(*DeleteTypeInput) DeleteTypeRequest } // Send marshals and sends the DeleteType API request. @@ -499,7 +509,7 @@ func (c *AppSync) DeleteTypeRequest(input *DeleteTypeInput) DeleteTypeRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTypeRequest{Request: req, Input: input} + return DeleteTypeRequest{Request: req, Input: input, Copy: c.DeleteTypeRequest} } const opGetDataSource = "GetDataSource" @@ -508,6 +518,7 @@ const opGetDataSource = "GetDataSource" type GetDataSourceRequest struct { *aws.Request Input *GetDataSourceInput + Copy func(*GetDataSourceInput) GetDataSourceRequest } // Send marshals and sends the GetDataSource API request. @@ -548,7 +559,7 @@ func (c *AppSync) GetDataSourceRequest(input *GetDataSourceInput) GetDataSourceR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDataSourceRequest{Request: req, Input: input} + return GetDataSourceRequest{Request: req, Input: input, Copy: c.GetDataSourceRequest} } const opGetGraphqlApi = "GetGraphqlApi" @@ -557,6 +568,7 @@ const opGetGraphqlApi = "GetGraphqlApi" type GetGraphqlApiRequest struct { *aws.Request Input *GetGraphqlApiInput + Copy func(*GetGraphqlApiInput) GetGraphqlApiRequest } // Send marshals and sends the GetGraphqlApi API request. @@ -597,7 +609,7 @@ func (c *AppSync) GetGraphqlApiRequest(input *GetGraphqlApiInput) GetGraphqlApiR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGraphqlApiRequest{Request: req, Input: input} + return GetGraphqlApiRequest{Request: req, Input: input, Copy: c.GetGraphqlApiRequest} } const opGetIntrospectionSchema = "GetIntrospectionSchema" @@ -606,6 +618,7 @@ const opGetIntrospectionSchema = "GetIntrospectionSchema" type GetIntrospectionSchemaRequest struct { *aws.Request Input *GetIntrospectionSchemaInput + Copy func(*GetIntrospectionSchemaInput) GetIntrospectionSchemaRequest } // Send marshals and sends the GetIntrospectionSchema API request. @@ -646,7 +659,7 @@ func (c *AppSync) GetIntrospectionSchemaRequest(input *GetIntrospectionSchemaInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIntrospectionSchemaRequest{Request: req, Input: input} + return GetIntrospectionSchemaRequest{Request: req, Input: input, Copy: c.GetIntrospectionSchemaRequest} } const opGetResolver = "GetResolver" @@ -655,6 +668,7 @@ const opGetResolver = "GetResolver" type GetResolverRequest struct { *aws.Request Input *GetResolverInput + Copy func(*GetResolverInput) GetResolverRequest } // Send marshals and sends the GetResolver API request. @@ -695,7 +709,7 @@ func (c *AppSync) GetResolverRequest(input *GetResolverInput) GetResolverRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetResolverRequest{Request: req, Input: input} + return GetResolverRequest{Request: req, Input: input, Copy: c.GetResolverRequest} } const opGetSchemaCreationStatus = "GetSchemaCreationStatus" @@ -704,6 +718,7 @@ const opGetSchemaCreationStatus = "GetSchemaCreationStatus" type GetSchemaCreationStatusRequest struct { *aws.Request Input *GetSchemaCreationStatusInput + Copy func(*GetSchemaCreationStatusInput) GetSchemaCreationStatusRequest } // Send marshals and sends the GetSchemaCreationStatus API request. @@ -744,7 +759,7 @@ func (c *AppSync) GetSchemaCreationStatusRequest(input *GetSchemaCreationStatusI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSchemaCreationStatusRequest{Request: req, Input: input} + return GetSchemaCreationStatusRequest{Request: req, Input: input, Copy: c.GetSchemaCreationStatusRequest} } const opGetType = "GetType" @@ -753,6 +768,7 @@ const opGetType = "GetType" type GetTypeRequest struct { *aws.Request Input *GetTypeInput + Copy func(*GetTypeInput) GetTypeRequest } // Send marshals and sends the GetType API request. @@ -793,7 +809,7 @@ func (c *AppSync) GetTypeRequest(input *GetTypeInput) GetTypeRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTypeRequest{Request: req, Input: input} + return GetTypeRequest{Request: req, Input: input, Copy: c.GetTypeRequest} } const opListApiKeys = "ListApiKeys" @@ -802,6 +818,7 @@ const opListApiKeys = "ListApiKeys" type ListApiKeysRequest struct { *aws.Request Input *ListApiKeysInput + Copy func(*ListApiKeysInput) ListApiKeysRequest } // Send marshals and sends the ListApiKeys API request. @@ -842,7 +859,7 @@ func (c *AppSync) ListApiKeysRequest(input *ListApiKeysInput) ListApiKeysRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListApiKeysRequest{Request: req, Input: input} + return ListApiKeysRequest{Request: req, Input: input, Copy: c.ListApiKeysRequest} } const opListDataSources = "ListDataSources" @@ -851,6 +868,7 @@ const opListDataSources = "ListDataSources" type ListDataSourcesRequest struct { *aws.Request Input *ListDataSourcesInput + Copy func(*ListDataSourcesInput) ListDataSourcesRequest } // Send marshals and sends the ListDataSources API request. @@ -891,7 +909,7 @@ func (c *AppSync) ListDataSourcesRequest(input *ListDataSourcesInput) ListDataSo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDataSourcesRequest{Request: req, Input: input} + return ListDataSourcesRequest{Request: req, Input: input, Copy: c.ListDataSourcesRequest} } const opListGraphqlApis = "ListGraphqlApis" @@ -900,6 +918,7 @@ const opListGraphqlApis = "ListGraphqlApis" type ListGraphqlApisRequest struct { *aws.Request Input *ListGraphqlApisInput + Copy func(*ListGraphqlApisInput) ListGraphqlApisRequest } // Send marshals and sends the ListGraphqlApis API request. @@ -940,7 +959,7 @@ func (c *AppSync) ListGraphqlApisRequest(input *ListGraphqlApisInput) ListGraphq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGraphqlApisRequest{Request: req, Input: input} + return ListGraphqlApisRequest{Request: req, Input: input, Copy: c.ListGraphqlApisRequest} } const opListResolvers = "ListResolvers" @@ -949,6 +968,7 @@ const opListResolvers = "ListResolvers" type ListResolversRequest struct { *aws.Request Input *ListResolversInput + Copy func(*ListResolversInput) ListResolversRequest } // Send marshals and sends the ListResolvers API request. @@ -989,7 +1009,7 @@ func (c *AppSync) ListResolversRequest(input *ListResolversInput) ListResolversR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResolversRequest{Request: req, Input: input} + return ListResolversRequest{Request: req, Input: input, Copy: c.ListResolversRequest} } const opListTypes = "ListTypes" @@ -998,6 +1018,7 @@ const opListTypes = "ListTypes" type ListTypesRequest struct { *aws.Request Input *ListTypesInput + Copy func(*ListTypesInput) ListTypesRequest } // Send marshals and sends the ListTypes API request. @@ -1038,7 +1059,7 @@ func (c *AppSync) ListTypesRequest(input *ListTypesInput) ListTypesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTypesRequest{Request: req, Input: input} + return ListTypesRequest{Request: req, Input: input, Copy: c.ListTypesRequest} } const opStartSchemaCreation = "StartSchemaCreation" @@ -1047,6 +1068,7 @@ const opStartSchemaCreation = "StartSchemaCreation" type StartSchemaCreationRequest struct { *aws.Request Input *StartSchemaCreationInput + Copy func(*StartSchemaCreationInput) StartSchemaCreationRequest } // Send marshals and sends the StartSchemaCreation API request. @@ -1089,7 +1111,7 @@ func (c *AppSync) StartSchemaCreationRequest(input *StartSchemaCreationInput) St req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartSchemaCreationRequest{Request: req, Input: input} + return StartSchemaCreationRequest{Request: req, Input: input, Copy: c.StartSchemaCreationRequest} } const opUpdateDataSource = "UpdateDataSource" @@ -1098,6 +1120,7 @@ const opUpdateDataSource = "UpdateDataSource" type UpdateDataSourceRequest struct { *aws.Request Input *UpdateDataSourceInput + Copy func(*UpdateDataSourceInput) UpdateDataSourceRequest } // Send marshals and sends the UpdateDataSource API request. @@ -1138,7 +1161,7 @@ func (c *AppSync) UpdateDataSourceRequest(input *UpdateDataSourceInput) UpdateDa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDataSourceRequest{Request: req, Input: input} + return UpdateDataSourceRequest{Request: req, Input: input, Copy: c.UpdateDataSourceRequest} } const opUpdateGraphqlApi = "UpdateGraphqlApi" @@ -1147,6 +1170,7 @@ const opUpdateGraphqlApi = "UpdateGraphqlApi" type UpdateGraphqlApiRequest struct { *aws.Request Input *UpdateGraphqlApiInput + Copy func(*UpdateGraphqlApiInput) UpdateGraphqlApiRequest } // Send marshals and sends the UpdateGraphqlApi API request. @@ -1187,7 +1211,7 @@ func (c *AppSync) UpdateGraphqlApiRequest(input *UpdateGraphqlApiInput) UpdateGr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGraphqlApiRequest{Request: req, Input: input} + return UpdateGraphqlApiRequest{Request: req, Input: input, Copy: c.UpdateGraphqlApiRequest} } const opUpdateResolver = "UpdateResolver" @@ -1196,6 +1220,7 @@ const opUpdateResolver = "UpdateResolver" type UpdateResolverRequest struct { *aws.Request Input *UpdateResolverInput + Copy func(*UpdateResolverInput) UpdateResolverRequest } // Send marshals and sends the UpdateResolver API request. @@ -1236,7 +1261,7 @@ func (c *AppSync) UpdateResolverRequest(input *UpdateResolverInput) UpdateResolv req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateResolverRequest{Request: req, Input: input} + return UpdateResolverRequest{Request: req, Input: input, Copy: c.UpdateResolverRequest} } const opUpdateType = "UpdateType" @@ -1245,6 +1270,7 @@ const opUpdateType = "UpdateType" type UpdateTypeRequest struct { *aws.Request Input *UpdateTypeInput + Copy func(*UpdateTypeInput) UpdateTypeRequest } // Send marshals and sends the UpdateType API request. @@ -1285,7 +1311,7 @@ func (c *AppSync) UpdateTypeRequest(input *UpdateTypeInput) UpdateTypeRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTypeRequest{Request: req, Input: input} + return UpdateTypeRequest{Request: req, Input: input, Copy: c.UpdateTypeRequest} } // Describes an API key. diff --git a/service/athena/api.go b/service/athena/api.go index b3fc15d6b79..dee14924f13 100644 --- a/service/athena/api.go +++ b/service/athena/api.go @@ -15,6 +15,7 @@ const opBatchGetNamedQuery = "BatchGetNamedQuery" type BatchGetNamedQueryRequest struct { *aws.Request Input *BatchGetNamedQueryInput + Copy func(*BatchGetNamedQueryInput) BatchGetNamedQueryRequest } // Send marshals and sends the BatchGetNamedQuery API request. @@ -61,7 +62,7 @@ func (c *Athena) BatchGetNamedQueryRequest(input *BatchGetNamedQueryInput) Batch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetNamedQueryRequest{Request: req, Input: input} + return BatchGetNamedQueryRequest{Request: req, Input: input, Copy: c.BatchGetNamedQueryRequest} } const opBatchGetQueryExecution = "BatchGetQueryExecution" @@ -70,6 +71,7 @@ const opBatchGetQueryExecution = "BatchGetQueryExecution" type BatchGetQueryExecutionRequest struct { *aws.Request Input *BatchGetQueryExecutionInput + Copy func(*BatchGetQueryExecutionInput) BatchGetQueryExecutionRequest } // Send marshals and sends the BatchGetQueryExecution API request. @@ -114,7 +116,7 @@ func (c *Athena) BatchGetQueryExecutionRequest(input *BatchGetQueryExecutionInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetQueryExecutionRequest{Request: req, Input: input} + return BatchGetQueryExecutionRequest{Request: req, Input: input, Copy: c.BatchGetQueryExecutionRequest} } const opCreateNamedQuery = "CreateNamedQuery" @@ -123,6 +125,7 @@ const opCreateNamedQuery = "CreateNamedQuery" type CreateNamedQueryRequest struct { *aws.Request Input *CreateNamedQueryInput + Copy func(*CreateNamedQueryInput) CreateNamedQueryRequest } // Send marshals and sends the CreateNamedQuery API request. @@ -167,7 +170,7 @@ func (c *Athena) CreateNamedQueryRequest(input *CreateNamedQueryInput) CreateNam req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNamedQueryRequest{Request: req, Input: input} + return CreateNamedQueryRequest{Request: req, Input: input, Copy: c.CreateNamedQueryRequest} } const opDeleteNamedQuery = "DeleteNamedQuery" @@ -176,6 +179,7 @@ const opDeleteNamedQuery = "DeleteNamedQuery" type DeleteNamedQueryRequest struct { *aws.Request Input *DeleteNamedQueryInput + Copy func(*DeleteNamedQueryInput) DeleteNamedQueryRequest } // Send marshals and sends the DeleteNamedQuery API request. @@ -220,7 +224,7 @@ func (c *Athena) DeleteNamedQueryRequest(input *DeleteNamedQueryInput) DeleteNam req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteNamedQueryRequest{Request: req, Input: input} + return DeleteNamedQueryRequest{Request: req, Input: input, Copy: c.DeleteNamedQueryRequest} } const opGetNamedQuery = "GetNamedQuery" @@ -229,6 +233,7 @@ const opGetNamedQuery = "GetNamedQuery" type GetNamedQueryRequest struct { *aws.Request Input *GetNamedQueryInput + Copy func(*GetNamedQueryInput) GetNamedQueryRequest } // Send marshals and sends the GetNamedQuery API request. @@ -269,7 +274,7 @@ func (c *Athena) GetNamedQueryRequest(input *GetNamedQueryInput) GetNamedQueryRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetNamedQueryRequest{Request: req, Input: input} + return GetNamedQueryRequest{Request: req, Input: input, Copy: c.GetNamedQueryRequest} } const opGetQueryExecution = "GetQueryExecution" @@ -278,6 +283,7 @@ const opGetQueryExecution = "GetQueryExecution" type GetQueryExecutionRequest struct { *aws.Request Input *GetQueryExecutionInput + Copy func(*GetQueryExecutionInput) GetQueryExecutionRequest } // Send marshals and sends the GetQueryExecution API request. @@ -319,7 +325,7 @@ func (c *Athena) GetQueryExecutionRequest(input *GetQueryExecutionInput) GetQuer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetQueryExecutionRequest{Request: req, Input: input} + return GetQueryExecutionRequest{Request: req, Input: input, Copy: c.GetQueryExecutionRequest} } const opGetQueryResults = "GetQueryResults" @@ -328,6 +334,7 @@ const opGetQueryResults = "GetQueryResults" type GetQueryResultsRequest struct { *aws.Request Input *GetQueryResultsInput + Copy func(*GetQueryResultsInput) GetQueryResultsRequest } // Send marshals and sends the GetQueryResults API request. @@ -376,57 +383,53 @@ func (c *Athena) GetQueryResultsRequest(input *GetQueryResultsInput) GetQueryRes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetQueryResultsRequest{Request: req, Input: input} + return GetQueryResultsRequest{Request: req, Input: input, Copy: c.GetQueryResultsRequest} } -// GetQueryResultsPages iterates over the pages of a GetQueryResults operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetQueryResults method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetQueryResultsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetQueryResults operation. -// pageNum := 0 -// err := client.GetQueryResultsPages(params, -// func(page *GetQueryResultsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetQueryResultsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Athena) GetQueryResultsPages(input *GetQueryResultsInput, fn func(*GetQueryResultsOutput, bool) bool) error { - return c.GetQueryResultsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetQueryResultsPagesWithContext same as GetQueryResultsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Athena) GetQueryResultsPagesWithContext(ctx aws.Context, input *GetQueryResultsInput, fn func(*GetQueryResultsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetQueryResultsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetQueryResultsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetQueryResultsRequest) Paginate(opts ...aws.Option) GetQueryResultsPager { + return GetQueryResultsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetQueryResultsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetQueryResultsOutput), !p.HasNextPage()) - } - return p.Err() +// GetQueryResultsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetQueryResultsPager struct { + aws.Pager +} + +func (p *GetQueryResultsPager) CurrentPage() *GetQueryResultsOutput { + return p.Pager.CurrentPage().(*GetQueryResultsOutput) } const opListNamedQueries = "ListNamedQueries" @@ -435,6 +438,7 @@ const opListNamedQueries = "ListNamedQueries" type ListNamedQueriesRequest struct { *aws.Request Input *ListNamedQueriesInput + Copy func(*ListNamedQueriesInput) ListNamedQueriesRequest } // Send marshals and sends the ListNamedQueries API request. @@ -485,57 +489,53 @@ func (c *Athena) ListNamedQueriesRequest(input *ListNamedQueriesInput) ListNamed req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListNamedQueriesRequest{Request: req, Input: input} + return ListNamedQueriesRequest{Request: req, Input: input, Copy: c.ListNamedQueriesRequest} } -// ListNamedQueriesPages iterates over the pages of a ListNamedQueries operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNamedQueries method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListNamedQueriesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListNamedQueries operation. -// pageNum := 0 -// err := client.ListNamedQueriesPages(params, -// func(page *ListNamedQueriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListNamedQueriesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Athena) ListNamedQueriesPages(input *ListNamedQueriesInput, fn func(*ListNamedQueriesOutput, bool) bool) error { - return c.ListNamedQueriesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNamedQueriesPagesWithContext same as ListNamedQueriesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Athena) ListNamedQueriesPagesWithContext(ctx aws.Context, input *ListNamedQueriesInput, fn func(*ListNamedQueriesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListNamedQueriesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListNamedQueriesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListNamedQueriesRequest) Paginate(opts ...aws.Option) ListNamedQueriesPager { + return ListNamedQueriesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListNamedQueriesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNamedQueriesOutput), !p.HasNextPage()) - } - return p.Err() +// ListNamedQueriesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListNamedQueriesPager struct { + aws.Pager +} + +func (p *ListNamedQueriesPager) CurrentPage() *ListNamedQueriesOutput { + return p.Pager.CurrentPage().(*ListNamedQueriesOutput) } const opListQueryExecutions = "ListQueryExecutions" @@ -544,6 +544,7 @@ const opListQueryExecutions = "ListQueryExecutions" type ListQueryExecutionsRequest struct { *aws.Request Input *ListQueryExecutionsInput + Copy func(*ListQueryExecutionsInput) ListQueryExecutionsRequest } // Send marshals and sends the ListQueryExecutions API request. @@ -594,57 +595,53 @@ func (c *Athena) ListQueryExecutionsRequest(input *ListQueryExecutionsInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListQueryExecutionsRequest{Request: req, Input: input} + return ListQueryExecutionsRequest{Request: req, Input: input, Copy: c.ListQueryExecutionsRequest} } -// ListQueryExecutionsPages iterates over the pages of a ListQueryExecutions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListQueryExecutions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListQueryExecutionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListQueryExecutions operation. -// pageNum := 0 -// err := client.ListQueryExecutionsPages(params, -// func(page *ListQueryExecutionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListQueryExecutionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Athena) ListQueryExecutionsPages(input *ListQueryExecutionsInput, fn func(*ListQueryExecutionsOutput, bool) bool) error { - return c.ListQueryExecutionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListQueryExecutionsPagesWithContext same as ListQueryExecutionsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Athena) ListQueryExecutionsPagesWithContext(ctx aws.Context, input *ListQueryExecutionsInput, fn func(*ListQueryExecutionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListQueryExecutionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListQueryExecutionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListQueryExecutionsRequest) Paginate(opts ...aws.Option) ListQueryExecutionsPager { + return ListQueryExecutionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListQueryExecutionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListQueryExecutionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListQueryExecutionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListQueryExecutionsPager struct { + aws.Pager +} + +func (p *ListQueryExecutionsPager) CurrentPage() *ListQueryExecutionsOutput { + return p.Pager.CurrentPage().(*ListQueryExecutionsOutput) } const opStartQueryExecution = "StartQueryExecution" @@ -653,6 +650,7 @@ const opStartQueryExecution = "StartQueryExecution" type StartQueryExecutionRequest struct { *aws.Request Input *StartQueryExecutionInput + Copy func(*StartQueryExecutionInput) StartQueryExecutionRequest } // Send marshals and sends the StartQueryExecution API request. @@ -697,7 +695,7 @@ func (c *Athena) StartQueryExecutionRequest(input *StartQueryExecutionInput) Sta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartQueryExecutionRequest{Request: req, Input: input} + return StartQueryExecutionRequest{Request: req, Input: input, Copy: c.StartQueryExecutionRequest} } const opStopQueryExecution = "StopQueryExecution" @@ -706,6 +704,7 @@ const opStopQueryExecution = "StopQueryExecution" type StopQueryExecutionRequest struct { *aws.Request Input *StopQueryExecutionInput + Copy func(*StopQueryExecutionInput) StopQueryExecutionRequest } // Send marshals and sends the StopQueryExecution API request. @@ -750,7 +749,7 @@ func (c *Athena) StopQueryExecutionRequest(input *StopQueryExecutionInput) StopQ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopQueryExecutionRequest{Request: req, Input: input} + return StopQueryExecutionRequest{Request: req, Input: input, Copy: c.StopQueryExecutionRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/BatchGetNamedQueryInput diff --git a/service/athena/athenaiface/interface.go b/service/athena/athenaiface/interface.go index 17242e6aa36..d75528ac909 100644 --- a/service/athena/athenaiface/interface.go +++ b/service/athena/athenaiface/interface.go @@ -9,7 +9,6 @@ package athenaiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/athena" ) @@ -77,19 +76,10 @@ type AthenaAPI interface { GetQueryResultsRequest(*athena.GetQueryResultsInput) athena.GetQueryResultsRequest - GetQueryResultsPages(*athena.GetQueryResultsInput, func(*athena.GetQueryResultsOutput, bool) bool) error - GetQueryResultsPagesWithContext(aws.Context, *athena.GetQueryResultsInput, func(*athena.GetQueryResultsOutput, bool) bool, ...aws.Option) error - ListNamedQueriesRequest(*athena.ListNamedQueriesInput) athena.ListNamedQueriesRequest - ListNamedQueriesPages(*athena.ListNamedQueriesInput, func(*athena.ListNamedQueriesOutput, bool) bool) error - ListNamedQueriesPagesWithContext(aws.Context, *athena.ListNamedQueriesInput, func(*athena.ListNamedQueriesOutput, bool) bool, ...aws.Option) error - ListQueryExecutionsRequest(*athena.ListQueryExecutionsInput) athena.ListQueryExecutionsRequest - ListQueryExecutionsPages(*athena.ListQueryExecutionsInput, func(*athena.ListQueryExecutionsOutput, bool) bool) error - ListQueryExecutionsPagesWithContext(aws.Context, *athena.ListQueryExecutionsInput, func(*athena.ListQueryExecutionsOutput, bool) bool, ...aws.Option) error - StartQueryExecutionRequest(*athena.StartQueryExecutionInput) athena.StartQueryExecutionRequest StopQueryExecutionRequest(*athena.StopQueryExecutionInput) athena.StopQueryExecutionRequest diff --git a/service/autoscaling/api.go b/service/autoscaling/api.go index beb1fcd38da..46b7cb0ec1e 100644 --- a/service/autoscaling/api.go +++ b/service/autoscaling/api.go @@ -18,6 +18,7 @@ const opAttachInstances = "AttachInstances" type AttachInstancesRequest struct { *aws.Request Input *AttachInstancesInput + Copy func(*AttachInstancesInput) AttachInstancesRequest } // Send marshals and sends the AttachInstances API request. @@ -74,7 +75,7 @@ func (c *AutoScaling) AttachInstancesRequest(input *AttachInstancesInput) Attach req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AttachInstancesRequest{Request: req, Input: input} + return AttachInstancesRequest{Request: req, Input: input, Copy: c.AttachInstancesRequest} } const opAttachLoadBalancerTargetGroups = "AttachLoadBalancerTargetGroups" @@ -83,6 +84,7 @@ const opAttachLoadBalancerTargetGroups = "AttachLoadBalancerTargetGroups" type AttachLoadBalancerTargetGroupsRequest struct { *aws.Request Input *AttachLoadBalancerTargetGroupsInput + Copy func(*AttachLoadBalancerTargetGroupsInput) AttachLoadBalancerTargetGroupsRequest } // Send marshals and sends the AttachLoadBalancerTargetGroups API request. @@ -130,7 +132,7 @@ func (c *AutoScaling) AttachLoadBalancerTargetGroupsRequest(input *AttachLoadBal req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachLoadBalancerTargetGroupsRequest{Request: req, Input: input} + return AttachLoadBalancerTargetGroupsRequest{Request: req, Input: input, Copy: c.AttachLoadBalancerTargetGroupsRequest} } const opAttachLoadBalancers = "AttachLoadBalancers" @@ -139,6 +141,7 @@ const opAttachLoadBalancers = "AttachLoadBalancers" type AttachLoadBalancersRequest struct { *aws.Request Input *AttachLoadBalancersInput + Copy func(*AttachLoadBalancersInput) AttachLoadBalancersRequest } // Send marshals and sends the AttachLoadBalancers API request. @@ -189,7 +192,7 @@ func (c *AutoScaling) AttachLoadBalancersRequest(input *AttachLoadBalancersInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachLoadBalancersRequest{Request: req, Input: input} + return AttachLoadBalancersRequest{Request: req, Input: input, Copy: c.AttachLoadBalancersRequest} } const opCompleteLifecycleAction = "CompleteLifecycleAction" @@ -198,6 +201,7 @@ const opCompleteLifecycleAction = "CompleteLifecycleAction" type CompleteLifecycleActionRequest struct { *aws.Request Input *CompleteLifecycleActionInput + Copy func(*CompleteLifecycleActionInput) CompleteLifecycleActionRequest } // Send marshals and sends the CompleteLifecycleAction API request. @@ -260,7 +264,7 @@ func (c *AutoScaling) CompleteLifecycleActionRequest(input *CompleteLifecycleAct req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CompleteLifecycleActionRequest{Request: req, Input: input} + return CompleteLifecycleActionRequest{Request: req, Input: input, Copy: c.CompleteLifecycleActionRequest} } const opCreateAutoScalingGroup = "CreateAutoScalingGroup" @@ -269,6 +273,7 @@ const opCreateAutoScalingGroup = "CreateAutoScalingGroup" type CreateAutoScalingGroupRequest struct { *aws.Request Input *CreateAutoScalingGroupInput + Copy func(*CreateAutoScalingGroupInput) CreateAutoScalingGroupRequest } // Send marshals and sends the CreateAutoScalingGroup API request. @@ -318,7 +323,7 @@ func (c *AutoScaling) CreateAutoScalingGroupRequest(input *CreateAutoScalingGrou req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateAutoScalingGroupRequest{Request: req, Input: input} + return CreateAutoScalingGroupRequest{Request: req, Input: input, Copy: c.CreateAutoScalingGroupRequest} } const opCreateLaunchConfiguration = "CreateLaunchConfiguration" @@ -327,6 +332,7 @@ const opCreateLaunchConfiguration = "CreateLaunchConfiguration" type CreateLaunchConfigurationRequest struct { *aws.Request Input *CreateLaunchConfigurationInput + Copy func(*CreateLaunchConfigurationInput) CreateLaunchConfigurationRequest } // Send marshals and sends the CreateLaunchConfiguration API request. @@ -376,7 +382,7 @@ func (c *AutoScaling) CreateLaunchConfigurationRequest(input *CreateLaunchConfig req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateLaunchConfigurationRequest{Request: req, Input: input} + return CreateLaunchConfigurationRequest{Request: req, Input: input, Copy: c.CreateLaunchConfigurationRequest} } const opCreateOrUpdateTags = "CreateOrUpdateTags" @@ -385,6 +391,7 @@ const opCreateOrUpdateTags = "CreateOrUpdateTags" type CreateOrUpdateTagsRequest struct { *aws.Request Input *CreateOrUpdateTagsInput + Copy func(*CreateOrUpdateTagsInput) CreateOrUpdateTagsRequest } // Send marshals and sends the CreateOrUpdateTags API request. @@ -433,7 +440,7 @@ func (c *AutoScaling) CreateOrUpdateTagsRequest(input *CreateOrUpdateTagsInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateOrUpdateTagsRequest{Request: req, Input: input} + return CreateOrUpdateTagsRequest{Request: req, Input: input, Copy: c.CreateOrUpdateTagsRequest} } const opDeleteAutoScalingGroup = "DeleteAutoScalingGroup" @@ -442,6 +449,7 @@ const opDeleteAutoScalingGroup = "DeleteAutoScalingGroup" type DeleteAutoScalingGroupRequest struct { *aws.Request Input *DeleteAutoScalingGroupInput + Copy func(*DeleteAutoScalingGroupInput) DeleteAutoScalingGroupRequest } // Send marshals and sends the DeleteAutoScalingGroup API request. @@ -498,7 +506,7 @@ func (c *AutoScaling) DeleteAutoScalingGroupRequest(input *DeleteAutoScalingGrou req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAutoScalingGroupRequest{Request: req, Input: input} + return DeleteAutoScalingGroupRequest{Request: req, Input: input, Copy: c.DeleteAutoScalingGroupRequest} } const opDeleteLaunchConfiguration = "DeleteLaunchConfiguration" @@ -507,6 +515,7 @@ const opDeleteLaunchConfiguration = "DeleteLaunchConfiguration" type DeleteLaunchConfigurationRequest struct { *aws.Request Input *DeleteLaunchConfigurationInput + Copy func(*DeleteLaunchConfigurationInput) DeleteLaunchConfigurationRequest } // Send marshals and sends the DeleteLaunchConfiguration API request. @@ -553,7 +562,7 @@ func (c *AutoScaling) DeleteLaunchConfigurationRequest(input *DeleteLaunchConfig req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteLaunchConfigurationRequest{Request: req, Input: input} + return DeleteLaunchConfigurationRequest{Request: req, Input: input, Copy: c.DeleteLaunchConfigurationRequest} } const opDeleteLifecycleHook = "DeleteLifecycleHook" @@ -562,6 +571,7 @@ const opDeleteLifecycleHook = "DeleteLifecycleHook" type DeleteLifecycleHookRequest struct { *aws.Request Input *DeleteLifecycleHookInput + Copy func(*DeleteLifecycleHookInput) DeleteLifecycleHookRequest } // Send marshals and sends the DeleteLifecycleHook API request. @@ -605,7 +615,7 @@ func (c *AutoScaling) DeleteLifecycleHookRequest(input *DeleteLifecycleHookInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLifecycleHookRequest{Request: req, Input: input} + return DeleteLifecycleHookRequest{Request: req, Input: input, Copy: c.DeleteLifecycleHookRequest} } const opDeleteNotificationConfiguration = "DeleteNotificationConfiguration" @@ -614,6 +624,7 @@ const opDeleteNotificationConfiguration = "DeleteNotificationConfiguration" type DeleteNotificationConfigurationRequest struct { *aws.Request Input *DeleteNotificationConfigurationInput + Copy func(*DeleteNotificationConfigurationInput) DeleteNotificationConfigurationRequest } // Send marshals and sends the DeleteNotificationConfiguration API request. @@ -656,7 +667,7 @@ func (c *AutoScaling) DeleteNotificationConfigurationRequest(input *DeleteNotifi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteNotificationConfigurationRequest{Request: req, Input: input} + return DeleteNotificationConfigurationRequest{Request: req, Input: input, Copy: c.DeleteNotificationConfigurationRequest} } const opDeletePolicy = "DeletePolicy" @@ -665,6 +676,7 @@ const opDeletePolicy = "DeletePolicy" type DeletePolicyRequest struct { *aws.Request Input *DeletePolicyInput + Copy func(*DeletePolicyInput) DeletePolicyRequest } // Send marshals and sends the DeletePolicy API request. @@ -710,7 +722,7 @@ func (c *AutoScaling) DeletePolicyRequest(input *DeletePolicyInput) DeletePolicy req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePolicyRequest{Request: req, Input: input} + return DeletePolicyRequest{Request: req, Input: input, Copy: c.DeletePolicyRequest} } const opDeleteScheduledAction = "DeleteScheduledAction" @@ -719,6 +731,7 @@ const opDeleteScheduledAction = "DeleteScheduledAction" type DeleteScheduledActionRequest struct { *aws.Request Input *DeleteScheduledActionInput + Copy func(*DeleteScheduledActionInput) DeleteScheduledActionRequest } // Send marshals and sends the DeleteScheduledAction API request. @@ -761,7 +774,7 @@ func (c *AutoScaling) DeleteScheduledActionRequest(input *DeleteScheduledActionI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteScheduledActionRequest{Request: req, Input: input} + return DeleteScheduledActionRequest{Request: req, Input: input, Copy: c.DeleteScheduledActionRequest} } const opDeleteTags = "DeleteTags" @@ -770,6 +783,7 @@ const opDeleteTags = "DeleteTags" type DeleteTagsRequest struct { *aws.Request Input *DeleteTagsInput + Copy func(*DeleteTagsInput) DeleteTagsRequest } // Send marshals and sends the DeleteTags API request. @@ -812,7 +826,7 @@ func (c *AutoScaling) DeleteTagsRequest(input *DeleteTagsInput) DeleteTagsReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteTagsRequest{Request: req, Input: input} + return DeleteTagsRequest{Request: req, Input: input, Copy: c.DeleteTagsRequest} } const opDescribeAccountLimits = "DescribeAccountLimits" @@ -821,6 +835,7 @@ const opDescribeAccountLimits = "DescribeAccountLimits" type DescribeAccountLimitsRequest struct { *aws.Request Input *DescribeAccountLimitsInput + Copy func(*DescribeAccountLimitsInput) DescribeAccountLimitsRequest } // Send marshals and sends the DescribeAccountLimits API request. @@ -865,7 +880,7 @@ func (c *AutoScaling) DescribeAccountLimitsRequest(input *DescribeAccountLimitsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAccountLimitsRequest{Request: req, Input: input} + return DescribeAccountLimitsRequest{Request: req, Input: input, Copy: c.DescribeAccountLimitsRequest} } const opDescribeAdjustmentTypes = "DescribeAdjustmentTypes" @@ -874,6 +889,7 @@ const opDescribeAdjustmentTypes = "DescribeAdjustmentTypes" type DescribeAdjustmentTypesRequest struct { *aws.Request Input *DescribeAdjustmentTypesInput + Copy func(*DescribeAdjustmentTypesInput) DescribeAdjustmentTypesRequest } // Send marshals and sends the DescribeAdjustmentTypes API request. @@ -914,7 +930,7 @@ func (c *AutoScaling) DescribeAdjustmentTypesRequest(input *DescribeAdjustmentTy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAdjustmentTypesRequest{Request: req, Input: input} + return DescribeAdjustmentTypesRequest{Request: req, Input: input, Copy: c.DescribeAdjustmentTypesRequest} } const opDescribeAutoScalingGroups = "DescribeAutoScalingGroups" @@ -923,6 +939,7 @@ const opDescribeAutoScalingGroups = "DescribeAutoScalingGroups" type DescribeAutoScalingGroupsRequest struct { *aws.Request Input *DescribeAutoScalingGroupsInput + Copy func(*DescribeAutoScalingGroupsInput) DescribeAutoScalingGroupsRequest } // Send marshals and sends the DescribeAutoScalingGroups API request. @@ -969,57 +986,53 @@ func (c *AutoScaling) DescribeAutoScalingGroupsRequest(input *DescribeAutoScalin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAutoScalingGroupsRequest{Request: req, Input: input} + return DescribeAutoScalingGroupsRequest{Request: req, Input: input, Copy: c.DescribeAutoScalingGroupsRequest} } -// DescribeAutoScalingGroupsPages iterates over the pages of a DescribeAutoScalingGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAutoScalingGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeAutoScalingGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeAutoScalingGroups operation. -// pageNum := 0 -// err := client.DescribeAutoScalingGroupsPages(params, -// func(page *DescribeAutoScalingGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeAutoScalingGroupsPages(input *DescribeAutoScalingGroupsInput, fn func(*DescribeAutoScalingGroupsOutput, bool) bool) error { - return c.DescribeAutoScalingGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeAutoScalingGroupsPagesWithContext same as DescribeAutoScalingGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AutoScaling) DescribeAutoScalingGroupsPagesWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, fn func(*DescribeAutoScalingGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeAutoScalingGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeAutoScalingGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeAutoScalingGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeAutoScalingGroupsRequest) Paginate(opts ...aws.Option) DescribeAutoScalingGroupsPager { + return DescribeAutoScalingGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeAutoScalingGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAutoScalingGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeAutoScalingGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeAutoScalingGroupsPager struct { + aws.Pager +} + +func (p *DescribeAutoScalingGroupsPager) CurrentPage() *DescribeAutoScalingGroupsOutput { + return p.Pager.CurrentPage().(*DescribeAutoScalingGroupsOutput) } const opDescribeAutoScalingInstances = "DescribeAutoScalingInstances" @@ -1028,6 +1041,7 @@ const opDescribeAutoScalingInstances = "DescribeAutoScalingInstances" type DescribeAutoScalingInstancesRequest struct { *aws.Request Input *DescribeAutoScalingInstancesInput + Copy func(*DescribeAutoScalingInstancesInput) DescribeAutoScalingInstancesRequest } // Send marshals and sends the DescribeAutoScalingInstances API request. @@ -1074,57 +1088,53 @@ func (c *AutoScaling) DescribeAutoScalingInstancesRequest(input *DescribeAutoSca req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAutoScalingInstancesRequest{Request: req, Input: input} + return DescribeAutoScalingInstancesRequest{Request: req, Input: input, Copy: c.DescribeAutoScalingInstancesRequest} } -// DescribeAutoScalingInstancesPages iterates over the pages of a DescribeAutoScalingInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAutoScalingInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeAutoScalingInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeAutoScalingInstances operation. -// pageNum := 0 -// err := client.DescribeAutoScalingInstancesPages(params, -// func(page *DescribeAutoScalingInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeAutoScalingInstancesPages(input *DescribeAutoScalingInstancesInput, fn func(*DescribeAutoScalingInstancesOutput, bool) bool) error { - return c.DescribeAutoScalingInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeAutoScalingInstancesPagesWithContext same as DescribeAutoScalingInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AutoScaling) DescribeAutoScalingInstancesPagesWithContext(ctx aws.Context, input *DescribeAutoScalingInstancesInput, fn func(*DescribeAutoScalingInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeAutoScalingInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeAutoScalingInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeAutoScalingInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeAutoScalingInstancesRequest) Paginate(opts ...aws.Option) DescribeAutoScalingInstancesPager { + return DescribeAutoScalingInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeAutoScalingInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAutoScalingInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeAutoScalingInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeAutoScalingInstancesPager struct { + aws.Pager +} + +func (p *DescribeAutoScalingInstancesPager) CurrentPage() *DescribeAutoScalingInstancesOutput { + return p.Pager.CurrentPage().(*DescribeAutoScalingInstancesOutput) } const opDescribeAutoScalingNotificationTypes = "DescribeAutoScalingNotificationTypes" @@ -1133,6 +1143,7 @@ const opDescribeAutoScalingNotificationTypes = "DescribeAutoScalingNotificationT type DescribeAutoScalingNotificationTypesRequest struct { *aws.Request Input *DescribeAutoScalingNotificationTypesInput + Copy func(*DescribeAutoScalingNotificationTypesInput) DescribeAutoScalingNotificationTypesRequest } // Send marshals and sends the DescribeAutoScalingNotificationTypes API request. @@ -1173,7 +1184,7 @@ func (c *AutoScaling) DescribeAutoScalingNotificationTypesRequest(input *Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAutoScalingNotificationTypesRequest{Request: req, Input: input} + return DescribeAutoScalingNotificationTypesRequest{Request: req, Input: input, Copy: c.DescribeAutoScalingNotificationTypesRequest} } const opDescribeLaunchConfigurations = "DescribeLaunchConfigurations" @@ -1182,6 +1193,7 @@ const opDescribeLaunchConfigurations = "DescribeLaunchConfigurations" type DescribeLaunchConfigurationsRequest struct { *aws.Request Input *DescribeLaunchConfigurationsInput + Copy func(*DescribeLaunchConfigurationsInput) DescribeLaunchConfigurationsRequest } // Send marshals and sends the DescribeLaunchConfigurations API request. @@ -1228,57 +1240,53 @@ func (c *AutoScaling) DescribeLaunchConfigurationsRequest(input *DescribeLaunchC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLaunchConfigurationsRequest{Request: req, Input: input} + return DescribeLaunchConfigurationsRequest{Request: req, Input: input, Copy: c.DescribeLaunchConfigurationsRequest} } -// DescribeLaunchConfigurationsPages iterates over the pages of a DescribeLaunchConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLaunchConfigurations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeLaunchConfigurationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeLaunchConfigurations operation. -// pageNum := 0 -// err := client.DescribeLaunchConfigurationsPages(params, -// func(page *DescribeLaunchConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeLaunchConfigurationsPages(input *DescribeLaunchConfigurationsInput, fn func(*DescribeLaunchConfigurationsOutput, bool) bool) error { - return c.DescribeLaunchConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeLaunchConfigurationsPagesWithContext same as DescribeLaunchConfigurationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AutoScaling) DescribeLaunchConfigurationsPagesWithContext(ctx aws.Context, input *DescribeLaunchConfigurationsInput, fn func(*DescribeLaunchConfigurationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeLaunchConfigurationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeLaunchConfigurationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeLaunchConfigurationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeLaunchConfigurationsRequest) Paginate(opts ...aws.Option) DescribeLaunchConfigurationsPager { + return DescribeLaunchConfigurationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeLaunchConfigurationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLaunchConfigurationsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeLaunchConfigurationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeLaunchConfigurationsPager struct { + aws.Pager +} + +func (p *DescribeLaunchConfigurationsPager) CurrentPage() *DescribeLaunchConfigurationsOutput { + return p.Pager.CurrentPage().(*DescribeLaunchConfigurationsOutput) } const opDescribeLifecycleHookTypes = "DescribeLifecycleHookTypes" @@ -1287,6 +1295,7 @@ const opDescribeLifecycleHookTypes = "DescribeLifecycleHookTypes" type DescribeLifecycleHookTypesRequest struct { *aws.Request Input *DescribeLifecycleHookTypesInput + Copy func(*DescribeLifecycleHookTypesInput) DescribeLifecycleHookTypesRequest } // Send marshals and sends the DescribeLifecycleHookTypes API request. @@ -1327,7 +1336,7 @@ func (c *AutoScaling) DescribeLifecycleHookTypesRequest(input *DescribeLifecycle req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLifecycleHookTypesRequest{Request: req, Input: input} + return DescribeLifecycleHookTypesRequest{Request: req, Input: input, Copy: c.DescribeLifecycleHookTypesRequest} } const opDescribeLifecycleHooks = "DescribeLifecycleHooks" @@ -1336,6 +1345,7 @@ const opDescribeLifecycleHooks = "DescribeLifecycleHooks" type DescribeLifecycleHooksRequest struct { *aws.Request Input *DescribeLifecycleHooksInput + Copy func(*DescribeLifecycleHooksInput) DescribeLifecycleHooksRequest } // Send marshals and sends the DescribeLifecycleHooks API request. @@ -1376,7 +1386,7 @@ func (c *AutoScaling) DescribeLifecycleHooksRequest(input *DescribeLifecycleHook req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLifecycleHooksRequest{Request: req, Input: input} + return DescribeLifecycleHooksRequest{Request: req, Input: input, Copy: c.DescribeLifecycleHooksRequest} } const opDescribeLoadBalancerTargetGroups = "DescribeLoadBalancerTargetGroups" @@ -1385,6 +1395,7 @@ const opDescribeLoadBalancerTargetGroups = "DescribeLoadBalancerTargetGroups" type DescribeLoadBalancerTargetGroupsRequest struct { *aws.Request Input *DescribeLoadBalancerTargetGroupsInput + Copy func(*DescribeLoadBalancerTargetGroupsInput) DescribeLoadBalancerTargetGroupsRequest } // Send marshals and sends the DescribeLoadBalancerTargetGroups API request. @@ -1425,7 +1436,7 @@ func (c *AutoScaling) DescribeLoadBalancerTargetGroupsRequest(input *DescribeLoa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoadBalancerTargetGroupsRequest{Request: req, Input: input} + return DescribeLoadBalancerTargetGroupsRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancerTargetGroupsRequest} } const opDescribeLoadBalancers = "DescribeLoadBalancers" @@ -1434,6 +1445,7 @@ const opDescribeLoadBalancers = "DescribeLoadBalancers" type DescribeLoadBalancersRequest struct { *aws.Request Input *DescribeLoadBalancersInput + Copy func(*DescribeLoadBalancersInput) DescribeLoadBalancersRequest } // Send marshals and sends the DescribeLoadBalancers API request. @@ -1477,7 +1489,7 @@ func (c *AutoScaling) DescribeLoadBalancersRequest(input *DescribeLoadBalancersI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoadBalancersRequest{Request: req, Input: input} + return DescribeLoadBalancersRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancersRequest} } const opDescribeMetricCollectionTypes = "DescribeMetricCollectionTypes" @@ -1486,6 +1498,7 @@ const opDescribeMetricCollectionTypes = "DescribeMetricCollectionTypes" type DescribeMetricCollectionTypesRequest struct { *aws.Request Input *DescribeMetricCollectionTypesInput + Copy func(*DescribeMetricCollectionTypesInput) DescribeMetricCollectionTypesRequest } // Send marshals and sends the DescribeMetricCollectionTypes API request. @@ -1529,7 +1542,7 @@ func (c *AutoScaling) DescribeMetricCollectionTypesRequest(input *DescribeMetric req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMetricCollectionTypesRequest{Request: req, Input: input} + return DescribeMetricCollectionTypesRequest{Request: req, Input: input, Copy: c.DescribeMetricCollectionTypesRequest} } const opDescribeNotificationConfigurations = "DescribeNotificationConfigurations" @@ -1538,6 +1551,7 @@ const opDescribeNotificationConfigurations = "DescribeNotificationConfigurations type DescribeNotificationConfigurationsRequest struct { *aws.Request Input *DescribeNotificationConfigurationsInput + Copy func(*DescribeNotificationConfigurationsInput) DescribeNotificationConfigurationsRequest } // Send marshals and sends the DescribeNotificationConfigurations API request. @@ -1585,57 +1599,53 @@ func (c *AutoScaling) DescribeNotificationConfigurationsRequest(input *DescribeN req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNotificationConfigurationsRequest{Request: req, Input: input} + return DescribeNotificationConfigurationsRequest{Request: req, Input: input, Copy: c.DescribeNotificationConfigurationsRequest} } -// DescribeNotificationConfigurationsPages iterates over the pages of a DescribeNotificationConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeNotificationConfigurations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeNotificationConfigurationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeNotificationConfigurations operation. -// pageNum := 0 -// err := client.DescribeNotificationConfigurationsPages(params, -// func(page *DescribeNotificationConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeNotificationConfigurationsPages(input *DescribeNotificationConfigurationsInput, fn func(*DescribeNotificationConfigurationsOutput, bool) bool) error { - return c.DescribeNotificationConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeNotificationConfigurationsPagesWithContext same as DescribeNotificationConfigurationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AutoScaling) DescribeNotificationConfigurationsPagesWithContext(ctx aws.Context, input *DescribeNotificationConfigurationsInput, fn func(*DescribeNotificationConfigurationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeNotificationConfigurationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeNotificationConfigurationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeNotificationConfigurationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeNotificationConfigurationsRequest) Paginate(opts ...aws.Option) DescribeNotificationConfigurationsPager { + return DescribeNotificationConfigurationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeNotificationConfigurationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNotificationConfigurationsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeNotificationConfigurationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeNotificationConfigurationsPager struct { + aws.Pager +} + +func (p *DescribeNotificationConfigurationsPager) CurrentPage() *DescribeNotificationConfigurationsOutput { + return p.Pager.CurrentPage().(*DescribeNotificationConfigurationsOutput) } const opDescribePolicies = "DescribePolicies" @@ -1644,6 +1654,7 @@ const opDescribePolicies = "DescribePolicies" type DescribePoliciesRequest struct { *aws.Request Input *DescribePoliciesInput + Copy func(*DescribePoliciesInput) DescribePoliciesRequest } // Send marshals and sends the DescribePolicies API request. @@ -1690,57 +1701,53 @@ func (c *AutoScaling) DescribePoliciesRequest(input *DescribePoliciesInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePoliciesRequest{Request: req, Input: input} + return DescribePoliciesRequest{Request: req, Input: input, Copy: c.DescribePoliciesRequest} } -// DescribePoliciesPages iterates over the pages of a DescribePolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribePolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribePoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribePolicies operation. -// pageNum := 0 -// err := client.DescribePoliciesPages(params, -// func(page *DescribePoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribePoliciesPages(input *DescribePoliciesInput, fn func(*DescribePoliciesOutput, bool) bool) error { - return c.DescribePoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribePoliciesPagesWithContext same as DescribePoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AutoScaling) DescribePoliciesPagesWithContext(ctx aws.Context, input *DescribePoliciesInput, fn func(*DescribePoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribePoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribePoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribePoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribePoliciesRequest) Paginate(opts ...aws.Option) DescribePoliciesPager { + return DescribePoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribePoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribePoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribePoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribePoliciesPager struct { + aws.Pager +} + +func (p *DescribePoliciesPager) CurrentPage() *DescribePoliciesOutput { + return p.Pager.CurrentPage().(*DescribePoliciesOutput) } const opDescribeScalingActivities = "DescribeScalingActivities" @@ -1749,6 +1756,7 @@ const opDescribeScalingActivities = "DescribeScalingActivities" type DescribeScalingActivitiesRequest struct { *aws.Request Input *DescribeScalingActivitiesInput + Copy func(*DescribeScalingActivitiesInput) DescribeScalingActivitiesRequest } // Send marshals and sends the DescribeScalingActivities API request. @@ -1795,57 +1803,53 @@ func (c *AutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingAct req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScalingActivitiesRequest{Request: req, Input: input} + return DescribeScalingActivitiesRequest{Request: req, Input: input, Copy: c.DescribeScalingActivitiesRequest} } -// DescribeScalingActivitiesPages iterates over the pages of a DescribeScalingActivities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScalingActivities method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeScalingActivitiesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeScalingActivities operation. -// pageNum := 0 -// err := client.DescribeScalingActivitiesPages(params, -// func(page *DescribeScalingActivitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActivitiesInput, fn func(*DescribeScalingActivitiesOutput, bool) bool) error { - return c.DescribeScalingActivitiesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeScalingActivitiesPagesWithContext same as DescribeScalingActivitiesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AutoScaling) DescribeScalingActivitiesPagesWithContext(ctx aws.Context, input *DescribeScalingActivitiesInput, fn func(*DescribeScalingActivitiesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeScalingActivitiesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeScalingActivitiesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeScalingActivitiesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeScalingActivitiesRequest) Paginate(opts ...aws.Option) DescribeScalingActivitiesPager { + return DescribeScalingActivitiesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeScalingActivitiesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeScalingActivitiesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeScalingActivitiesPager struct { + aws.Pager +} + +func (p *DescribeScalingActivitiesPager) CurrentPage() *DescribeScalingActivitiesOutput { + return p.Pager.CurrentPage().(*DescribeScalingActivitiesOutput) } const opDescribeScalingProcessTypes = "DescribeScalingProcessTypes" @@ -1854,6 +1858,7 @@ const opDescribeScalingProcessTypes = "DescribeScalingProcessTypes" type DescribeScalingProcessTypesRequest struct { *aws.Request Input *DescribeScalingProcessTypesInput + Copy func(*DescribeScalingProcessTypesInput) DescribeScalingProcessTypesRequest } // Send marshals and sends the DescribeScalingProcessTypes API request. @@ -1894,7 +1899,7 @@ func (c *AutoScaling) DescribeScalingProcessTypesRequest(input *DescribeScalingP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScalingProcessTypesRequest{Request: req, Input: input} + return DescribeScalingProcessTypesRequest{Request: req, Input: input, Copy: c.DescribeScalingProcessTypesRequest} } const opDescribeScheduledActions = "DescribeScheduledActions" @@ -1903,6 +1908,7 @@ const opDescribeScheduledActions = "DescribeScheduledActions" type DescribeScheduledActionsRequest struct { *aws.Request Input *DescribeScheduledActionsInput + Copy func(*DescribeScheduledActionsInput) DescribeScheduledActionsRequest } // Send marshals and sends the DescribeScheduledActions API request. @@ -1950,57 +1956,53 @@ func (c *AutoScaling) DescribeScheduledActionsRequest(input *DescribeScheduledAc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScheduledActionsRequest{Request: req, Input: input} + return DescribeScheduledActionsRequest{Request: req, Input: input, Copy: c.DescribeScheduledActionsRequest} } -// DescribeScheduledActionsPages iterates over the pages of a DescribeScheduledActions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScheduledActions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeScheduledActionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeScheduledActions operation. -// pageNum := 0 -// err := client.DescribeScheduledActionsPages(params, -// func(page *DescribeScheduledActionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeScheduledActionsPages(input *DescribeScheduledActionsInput, fn func(*DescribeScheduledActionsOutput, bool) bool) error { - return c.DescribeScheduledActionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeScheduledActionsPagesWithContext same as DescribeScheduledActionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AutoScaling) DescribeScheduledActionsPagesWithContext(ctx aws.Context, input *DescribeScheduledActionsInput, fn func(*DescribeScheduledActionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeScheduledActionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeScheduledActionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeScheduledActionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeScheduledActionsRequest) Paginate(opts ...aws.Option) DescribeScheduledActionsPager { + return DescribeScheduledActionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeScheduledActionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeScheduledActionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeScheduledActionsPager struct { + aws.Pager +} + +func (p *DescribeScheduledActionsPager) CurrentPage() *DescribeScheduledActionsOutput { + return p.Pager.CurrentPage().(*DescribeScheduledActionsOutput) } const opDescribeTags = "DescribeTags" @@ -2009,6 +2011,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -2064,57 +2067,53 @@ func (c *AutoScaling) DescribeTagsRequest(input *DescribeTagsInput) DescribeTags req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } -// DescribeTagsPages iterates over the pages of a DescribeTags operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTags method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeTagsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeTags operation. -// pageNum := 0 -// err := client.DescribeTagsPages(params, -// func(page *DescribeTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeTagsPages(input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool) error { - return c.DescribeTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTagsPagesWithContext same as DescribeTagsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *AutoScaling) DescribeTagsPagesWithContext(ctx aws.Context, input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeTagsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeTagsRequest) Paginate(opts ...aws.Option) DescribeTagsPager { + return DescribeTagsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeTagsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeTagsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeTagsPager struct { + aws.Pager +} + +func (p *DescribeTagsPager) CurrentPage() *DescribeTagsOutput { + return p.Pager.CurrentPage().(*DescribeTagsOutput) } const opDescribeTerminationPolicyTypes = "DescribeTerminationPolicyTypes" @@ -2123,6 +2122,7 @@ const opDescribeTerminationPolicyTypes = "DescribeTerminationPolicyTypes" type DescribeTerminationPolicyTypesRequest struct { *aws.Request Input *DescribeTerminationPolicyTypesInput + Copy func(*DescribeTerminationPolicyTypesInput) DescribeTerminationPolicyTypesRequest } // Send marshals and sends the DescribeTerminationPolicyTypes API request. @@ -2163,7 +2163,7 @@ func (c *AutoScaling) DescribeTerminationPolicyTypesRequest(input *DescribeTermi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTerminationPolicyTypesRequest{Request: req, Input: input} + return DescribeTerminationPolicyTypesRequest{Request: req, Input: input, Copy: c.DescribeTerminationPolicyTypesRequest} } const opDetachInstances = "DetachInstances" @@ -2172,6 +2172,7 @@ const opDetachInstances = "DetachInstances" type DetachInstancesRequest struct { *aws.Request Input *DetachInstancesInput + Copy func(*DetachInstancesInput) DetachInstancesRequest } // Send marshals and sends the DetachInstances API request. @@ -2227,7 +2228,7 @@ func (c *AutoScaling) DetachInstancesRequest(input *DetachInstancesInput) Detach req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachInstancesRequest{Request: req, Input: input} + return DetachInstancesRequest{Request: req, Input: input, Copy: c.DetachInstancesRequest} } const opDetachLoadBalancerTargetGroups = "DetachLoadBalancerTargetGroups" @@ -2236,6 +2237,7 @@ const opDetachLoadBalancerTargetGroups = "DetachLoadBalancerTargetGroups" type DetachLoadBalancerTargetGroupsRequest struct { *aws.Request Input *DetachLoadBalancerTargetGroupsInput + Copy func(*DetachLoadBalancerTargetGroupsInput) DetachLoadBalancerTargetGroupsRequest } // Send marshals and sends the DetachLoadBalancerTargetGroups API request. @@ -2276,7 +2278,7 @@ func (c *AutoScaling) DetachLoadBalancerTargetGroupsRequest(input *DetachLoadBal req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachLoadBalancerTargetGroupsRequest{Request: req, Input: input} + return DetachLoadBalancerTargetGroupsRequest{Request: req, Input: input, Copy: c.DetachLoadBalancerTargetGroupsRequest} } const opDetachLoadBalancers = "DetachLoadBalancers" @@ -2285,6 +2287,7 @@ const opDetachLoadBalancers = "DetachLoadBalancers" type DetachLoadBalancersRequest struct { *aws.Request Input *DetachLoadBalancersInput + Copy func(*DetachLoadBalancersInput) DetachLoadBalancersRequest } // Send marshals and sends the DetachLoadBalancers API request. @@ -2334,7 +2337,7 @@ func (c *AutoScaling) DetachLoadBalancersRequest(input *DetachLoadBalancersInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachLoadBalancersRequest{Request: req, Input: input} + return DetachLoadBalancersRequest{Request: req, Input: input, Copy: c.DetachLoadBalancersRequest} } const opDisableMetricsCollection = "DisableMetricsCollection" @@ -2343,6 +2346,7 @@ const opDisableMetricsCollection = "DisableMetricsCollection" type DisableMetricsCollectionRequest struct { *aws.Request Input *DisableMetricsCollectionInput + Copy func(*DisableMetricsCollectionInput) DisableMetricsCollectionRequest } // Send marshals and sends the DisableMetricsCollection API request. @@ -2385,7 +2389,7 @@ func (c *AutoScaling) DisableMetricsCollectionRequest(input *DisableMetricsColle req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisableMetricsCollectionRequest{Request: req, Input: input} + return DisableMetricsCollectionRequest{Request: req, Input: input, Copy: c.DisableMetricsCollectionRequest} } const opEnableMetricsCollection = "EnableMetricsCollection" @@ -2394,6 +2398,7 @@ const opEnableMetricsCollection = "EnableMetricsCollection" type EnableMetricsCollectionRequest struct { *aws.Request Input *EnableMetricsCollectionInput + Copy func(*EnableMetricsCollectionInput) EnableMetricsCollectionRequest } // Send marshals and sends the EnableMetricsCollection API request. @@ -2438,7 +2443,7 @@ func (c *AutoScaling) EnableMetricsCollectionRequest(input *EnableMetricsCollect req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableMetricsCollectionRequest{Request: req, Input: input} + return EnableMetricsCollectionRequest{Request: req, Input: input, Copy: c.EnableMetricsCollectionRequest} } const opEnterStandby = "EnterStandby" @@ -2447,6 +2452,7 @@ const opEnterStandby = "EnterStandby" type EnterStandbyRequest struct { *aws.Request Input *EnterStandbyInput + Copy func(*EnterStandbyInput) EnterStandbyRequest } // Send marshals and sends the EnterStandby API request. @@ -2491,7 +2497,7 @@ func (c *AutoScaling) EnterStandbyRequest(input *EnterStandbyInput) EnterStandby req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnterStandbyRequest{Request: req, Input: input} + return EnterStandbyRequest{Request: req, Input: input, Copy: c.EnterStandbyRequest} } const opExecutePolicy = "ExecutePolicy" @@ -2500,6 +2506,7 @@ const opExecutePolicy = "ExecutePolicy" type ExecutePolicyRequest struct { *aws.Request Input *ExecutePolicyInput + Copy func(*ExecutePolicyInput) ExecutePolicyRequest } // Send marshals and sends the ExecutePolicy API request. @@ -2542,7 +2549,7 @@ func (c *AutoScaling) ExecutePolicyRequest(input *ExecutePolicyInput) ExecutePol req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ExecutePolicyRequest{Request: req, Input: input} + return ExecutePolicyRequest{Request: req, Input: input, Copy: c.ExecutePolicyRequest} } const opExitStandby = "ExitStandby" @@ -2551,6 +2558,7 @@ const opExitStandby = "ExitStandby" type ExitStandbyRequest struct { *aws.Request Input *ExitStandbyInput + Copy func(*ExitStandbyInput) ExitStandbyRequest } // Send marshals and sends the ExitStandby API request. @@ -2595,7 +2603,7 @@ func (c *AutoScaling) ExitStandbyRequest(input *ExitStandbyInput) ExitStandbyReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ExitStandbyRequest{Request: req, Input: input} + return ExitStandbyRequest{Request: req, Input: input, Copy: c.ExitStandbyRequest} } const opPutLifecycleHook = "PutLifecycleHook" @@ -2604,6 +2612,7 @@ const opPutLifecycleHook = "PutLifecycleHook" type PutLifecycleHookRequest struct { *aws.Request Input *PutLifecycleHookInput + Copy func(*PutLifecycleHookInput) PutLifecycleHookRequest } // Send marshals and sends the PutLifecycleHook API request. @@ -2674,7 +2683,7 @@ func (c *AutoScaling) PutLifecycleHookRequest(input *PutLifecycleHookInput) PutL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutLifecycleHookRequest{Request: req, Input: input} + return PutLifecycleHookRequest{Request: req, Input: input, Copy: c.PutLifecycleHookRequest} } const opPutNotificationConfiguration = "PutNotificationConfiguration" @@ -2683,6 +2692,7 @@ const opPutNotificationConfiguration = "PutNotificationConfiguration" type PutNotificationConfigurationRequest struct { *aws.Request Input *PutNotificationConfigurationInput + Copy func(*PutNotificationConfigurationInput) PutNotificationConfigurationRequest } // Send marshals and sends the PutNotificationConfiguration API request. @@ -2733,7 +2743,7 @@ func (c *AutoScaling) PutNotificationConfigurationRequest(input *PutNotification req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutNotificationConfigurationRequest{Request: req, Input: input} + return PutNotificationConfigurationRequest{Request: req, Input: input, Copy: c.PutNotificationConfigurationRequest} } const opPutScalingPolicy = "PutScalingPolicy" @@ -2742,6 +2752,7 @@ const opPutScalingPolicy = "PutScalingPolicy" type PutScalingPolicyRequest struct { *aws.Request Input *PutScalingPolicyInput + Copy func(*PutScalingPolicyInput) PutScalingPolicyRequest } // Send marshals and sends the PutScalingPolicy API request. @@ -2790,7 +2801,7 @@ func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) PutS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutScalingPolicyRequest{Request: req, Input: input} + return PutScalingPolicyRequest{Request: req, Input: input, Copy: c.PutScalingPolicyRequest} } const opPutScheduledUpdateGroupAction = "PutScheduledUpdateGroupAction" @@ -2799,6 +2810,7 @@ const opPutScheduledUpdateGroupAction = "PutScheduledUpdateGroupAction" type PutScheduledUpdateGroupActionRequest struct { *aws.Request Input *PutScheduledUpdateGroupActionInput + Copy func(*PutScheduledUpdateGroupActionInput) PutScheduledUpdateGroupActionRequest } // Send marshals and sends the PutScheduledUpdateGroupAction API request. @@ -2846,7 +2858,7 @@ func (c *AutoScaling) PutScheduledUpdateGroupActionRequest(input *PutScheduledUp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutScheduledUpdateGroupActionRequest{Request: req, Input: input} + return PutScheduledUpdateGroupActionRequest{Request: req, Input: input, Copy: c.PutScheduledUpdateGroupActionRequest} } const opRecordLifecycleActionHeartbeat = "RecordLifecycleActionHeartbeat" @@ -2855,6 +2867,7 @@ const opRecordLifecycleActionHeartbeat = "RecordLifecycleActionHeartbeat" type RecordLifecycleActionHeartbeatRequest struct { *aws.Request Input *RecordLifecycleActionHeartbeatInput + Copy func(*RecordLifecycleActionHeartbeatInput) RecordLifecycleActionHeartbeatRequest } // Send marshals and sends the RecordLifecycleActionHeartbeat API request. @@ -2918,7 +2931,7 @@ func (c *AutoScaling) RecordLifecycleActionHeartbeatRequest(input *RecordLifecyc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RecordLifecycleActionHeartbeatRequest{Request: req, Input: input} + return RecordLifecycleActionHeartbeatRequest{Request: req, Input: input, Copy: c.RecordLifecycleActionHeartbeatRequest} } const opResumeProcesses = "ResumeProcesses" @@ -2927,6 +2940,7 @@ const opResumeProcesses = "ResumeProcesses" type ResumeProcessesRequest struct { *aws.Request Input *SuspendProcessesInput + Copy func(*SuspendProcessesInput) ResumeProcessesRequest } // Send marshals and sends the ResumeProcesses API request. @@ -2974,7 +2988,7 @@ func (c *AutoScaling) ResumeProcessesRequest(input *SuspendProcessesInput) Resum req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ResumeProcessesRequest{Request: req, Input: input} + return ResumeProcessesRequest{Request: req, Input: input, Copy: c.ResumeProcessesRequest} } const opSetDesiredCapacity = "SetDesiredCapacity" @@ -2983,6 +2997,7 @@ const opSetDesiredCapacity = "SetDesiredCapacity" type SetDesiredCapacityRequest struct { *aws.Request Input *SetDesiredCapacityInput + Copy func(*SetDesiredCapacityInput) SetDesiredCapacityRequest } // Send marshals and sends the SetDesiredCapacity API request. @@ -3028,7 +3043,7 @@ func (c *AutoScaling) SetDesiredCapacityRequest(input *SetDesiredCapacityInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetDesiredCapacityRequest{Request: req, Input: input} + return SetDesiredCapacityRequest{Request: req, Input: input, Copy: c.SetDesiredCapacityRequest} } const opSetInstanceHealth = "SetInstanceHealth" @@ -3037,6 +3052,7 @@ const opSetInstanceHealth = "SetInstanceHealth" type SetInstanceHealthRequest struct { *aws.Request Input *SetInstanceHealthInput + Copy func(*SetInstanceHealthInput) SetInstanceHealthRequest } // Send marshals and sends the SetInstanceHealth API request. @@ -3082,7 +3098,7 @@ func (c *AutoScaling) SetInstanceHealthRequest(input *SetInstanceHealthInput) Se req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetInstanceHealthRequest{Request: req, Input: input} + return SetInstanceHealthRequest{Request: req, Input: input, Copy: c.SetInstanceHealthRequest} } const opSetInstanceProtection = "SetInstanceProtection" @@ -3091,6 +3107,7 @@ const opSetInstanceProtection = "SetInstanceProtection" type SetInstanceProtectionRequest struct { *aws.Request Input *SetInstanceProtectionInput + Copy func(*SetInstanceProtectionInput) SetInstanceProtectionRequest } // Send marshals and sends the SetInstanceProtection API request. @@ -3134,7 +3151,7 @@ func (c *AutoScaling) SetInstanceProtectionRequest(input *SetInstanceProtectionI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetInstanceProtectionRequest{Request: req, Input: input} + return SetInstanceProtectionRequest{Request: req, Input: input, Copy: c.SetInstanceProtectionRequest} } const opSuspendProcesses = "SuspendProcesses" @@ -3143,6 +3160,7 @@ const opSuspendProcesses = "SuspendProcesses" type SuspendProcessesRequest struct { *aws.Request Input *SuspendProcessesInput + Copy func(*SuspendProcessesInput) SuspendProcessesRequest } // Send marshals and sends the SuspendProcesses API request. @@ -3195,7 +3213,7 @@ func (c *AutoScaling) SuspendProcessesRequest(input *SuspendProcessesInput) Susp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SuspendProcessesRequest{Request: req, Input: input} + return SuspendProcessesRequest{Request: req, Input: input, Copy: c.SuspendProcessesRequest} } const opTerminateInstanceInAutoScalingGroup = "TerminateInstanceInAutoScalingGroup" @@ -3204,6 +3222,7 @@ const opTerminateInstanceInAutoScalingGroup = "TerminateInstanceInAutoScalingGro type TerminateInstanceInAutoScalingGroupRequest struct { *aws.Request Input *TerminateInstanceInAutoScalingGroupInput + Copy func(*TerminateInstanceInAutoScalingGroupInput) TerminateInstanceInAutoScalingGroupRequest } // Send marshals and sends the TerminateInstanceInAutoScalingGroup API request. @@ -3248,7 +3267,7 @@ func (c *AutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *Terminat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TerminateInstanceInAutoScalingGroupRequest{Request: req, Input: input} + return TerminateInstanceInAutoScalingGroupRequest{Request: req, Input: input, Copy: c.TerminateInstanceInAutoScalingGroupRequest} } const opUpdateAutoScalingGroup = "UpdateAutoScalingGroup" @@ -3257,6 +3276,7 @@ const opUpdateAutoScalingGroup = "UpdateAutoScalingGroup" type UpdateAutoScalingGroupRequest struct { *aws.Request Input *UpdateAutoScalingGroupInput + Copy func(*UpdateAutoScalingGroupInput) UpdateAutoScalingGroupRequest } // Send marshals and sends the UpdateAutoScalingGroup API request. @@ -3321,7 +3341,7 @@ func (c *AutoScaling) UpdateAutoScalingGroupRequest(input *UpdateAutoScalingGrou req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateAutoScalingGroupRequest{Request: req, Input: input} + return UpdateAutoScalingGroupRequest{Request: req, Input: input, Copy: c.UpdateAutoScalingGroupRequest} } // Describes scaling activity, which is a long-running process that represents diff --git a/service/autoscaling/autoscalingiface/interface.go b/service/autoscaling/autoscalingiface/interface.go index 5548dbc9c08..168965e24c7 100644 --- a/service/autoscaling/autoscalingiface/interface.go +++ b/service/autoscaling/autoscalingiface/interface.go @@ -97,21 +97,12 @@ type AutoScalingAPI interface { DescribeAutoScalingGroupsRequest(*autoscaling.DescribeAutoScalingGroupsInput) autoscaling.DescribeAutoScalingGroupsRequest - DescribeAutoScalingGroupsPages(*autoscaling.DescribeAutoScalingGroupsInput, func(*autoscaling.DescribeAutoScalingGroupsOutput, bool) bool) error - DescribeAutoScalingGroupsPagesWithContext(aws.Context, *autoscaling.DescribeAutoScalingGroupsInput, func(*autoscaling.DescribeAutoScalingGroupsOutput, bool) bool, ...aws.Option) error - DescribeAutoScalingInstancesRequest(*autoscaling.DescribeAutoScalingInstancesInput) autoscaling.DescribeAutoScalingInstancesRequest - DescribeAutoScalingInstancesPages(*autoscaling.DescribeAutoScalingInstancesInput, func(*autoscaling.DescribeAutoScalingInstancesOutput, bool) bool) error - DescribeAutoScalingInstancesPagesWithContext(aws.Context, *autoscaling.DescribeAutoScalingInstancesInput, func(*autoscaling.DescribeAutoScalingInstancesOutput, bool) bool, ...aws.Option) error - DescribeAutoScalingNotificationTypesRequest(*autoscaling.DescribeAutoScalingNotificationTypesInput) autoscaling.DescribeAutoScalingNotificationTypesRequest DescribeLaunchConfigurationsRequest(*autoscaling.DescribeLaunchConfigurationsInput) autoscaling.DescribeLaunchConfigurationsRequest - DescribeLaunchConfigurationsPages(*autoscaling.DescribeLaunchConfigurationsInput, func(*autoscaling.DescribeLaunchConfigurationsOutput, bool) bool) error - DescribeLaunchConfigurationsPagesWithContext(aws.Context, *autoscaling.DescribeLaunchConfigurationsInput, func(*autoscaling.DescribeLaunchConfigurationsOutput, bool) bool, ...aws.Option) error - DescribeLifecycleHookTypesRequest(*autoscaling.DescribeLifecycleHookTypesInput) autoscaling.DescribeLifecycleHookTypesRequest DescribeLifecycleHooksRequest(*autoscaling.DescribeLifecycleHooksInput) autoscaling.DescribeLifecycleHooksRequest @@ -124,31 +115,16 @@ type AutoScalingAPI interface { DescribeNotificationConfigurationsRequest(*autoscaling.DescribeNotificationConfigurationsInput) autoscaling.DescribeNotificationConfigurationsRequest - DescribeNotificationConfigurationsPages(*autoscaling.DescribeNotificationConfigurationsInput, func(*autoscaling.DescribeNotificationConfigurationsOutput, bool) bool) error - DescribeNotificationConfigurationsPagesWithContext(aws.Context, *autoscaling.DescribeNotificationConfigurationsInput, func(*autoscaling.DescribeNotificationConfigurationsOutput, bool) bool, ...aws.Option) error - DescribePoliciesRequest(*autoscaling.DescribePoliciesInput) autoscaling.DescribePoliciesRequest - DescribePoliciesPages(*autoscaling.DescribePoliciesInput, func(*autoscaling.DescribePoliciesOutput, bool) bool) error - DescribePoliciesPagesWithContext(aws.Context, *autoscaling.DescribePoliciesInput, func(*autoscaling.DescribePoliciesOutput, bool) bool, ...aws.Option) error - DescribeScalingActivitiesRequest(*autoscaling.DescribeScalingActivitiesInput) autoscaling.DescribeScalingActivitiesRequest - DescribeScalingActivitiesPages(*autoscaling.DescribeScalingActivitiesInput, func(*autoscaling.DescribeScalingActivitiesOutput, bool) bool) error - DescribeScalingActivitiesPagesWithContext(aws.Context, *autoscaling.DescribeScalingActivitiesInput, func(*autoscaling.DescribeScalingActivitiesOutput, bool) bool, ...aws.Option) error - DescribeScalingProcessTypesRequest(*autoscaling.DescribeScalingProcessTypesInput) autoscaling.DescribeScalingProcessTypesRequest DescribeScheduledActionsRequest(*autoscaling.DescribeScheduledActionsInput) autoscaling.DescribeScheduledActionsRequest - DescribeScheduledActionsPages(*autoscaling.DescribeScheduledActionsInput, func(*autoscaling.DescribeScheduledActionsOutput, bool) bool) error - DescribeScheduledActionsPagesWithContext(aws.Context, *autoscaling.DescribeScheduledActionsInput, func(*autoscaling.DescribeScheduledActionsOutput, bool) bool, ...aws.Option) error - DescribeTagsRequest(*autoscaling.DescribeTagsInput) autoscaling.DescribeTagsRequest - DescribeTagsPages(*autoscaling.DescribeTagsInput, func(*autoscaling.DescribeTagsOutput, bool) bool) error - DescribeTagsPagesWithContext(aws.Context, *autoscaling.DescribeTagsInput, func(*autoscaling.DescribeTagsOutput, bool) bool, ...aws.Option) error - DescribeTerminationPolicyTypesRequest(*autoscaling.DescribeTerminationPolicyTypesInput) autoscaling.DescribeTerminationPolicyTypesRequest DetachInstancesRequest(*autoscaling.DetachInstancesInput) autoscaling.DetachInstancesRequest diff --git a/service/batch/api.go b/service/batch/api.go index df28428d1c9..d5830dde685 100644 --- a/service/batch/api.go +++ b/service/batch/api.go @@ -16,6 +16,7 @@ const opCancelJob = "CancelJob" type CancelJobRequest struct { *aws.Request Input *CancelJobInput + Copy func(*CancelJobInput) CancelJobRequest } // Send marshals and sends the CancelJob API request. @@ -60,7 +61,7 @@ func (c *Batch) CancelJobRequest(input *CancelJobInput) CancelJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelJobRequest{Request: req, Input: input} + return CancelJobRequest{Request: req, Input: input, Copy: c.CancelJobRequest} } const opCreateComputeEnvironment = "CreateComputeEnvironment" @@ -69,6 +70,7 @@ const opCreateComputeEnvironment = "CreateComputeEnvironment" type CreateComputeEnvironmentRequest struct { *aws.Request Input *CreateComputeEnvironmentInput + Copy func(*CreateComputeEnvironmentInput) CreateComputeEnvironmentRequest } // Send marshals and sends the CreateComputeEnvironment API request. @@ -130,7 +132,7 @@ func (c *Batch) CreateComputeEnvironmentRequest(input *CreateComputeEnvironmentI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateComputeEnvironmentRequest{Request: req, Input: input} + return CreateComputeEnvironmentRequest{Request: req, Input: input, Copy: c.CreateComputeEnvironmentRequest} } const opCreateJobQueue = "CreateJobQueue" @@ -139,6 +141,7 @@ const opCreateJobQueue = "CreateJobQueue" type CreateJobQueueRequest struct { *aws.Request Input *CreateJobQueueInput + Copy func(*CreateJobQueueInput) CreateJobQueueRequest } // Send marshals and sends the CreateJobQueue API request. @@ -187,7 +190,7 @@ func (c *Batch) CreateJobQueueRequest(input *CreateJobQueueInput) CreateJobQueue req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateJobQueueRequest{Request: req, Input: input} + return CreateJobQueueRequest{Request: req, Input: input, Copy: c.CreateJobQueueRequest} } const opDeleteComputeEnvironment = "DeleteComputeEnvironment" @@ -196,6 +199,7 @@ const opDeleteComputeEnvironment = "DeleteComputeEnvironment" type DeleteComputeEnvironmentRequest struct { *aws.Request Input *DeleteComputeEnvironmentInput + Copy func(*DeleteComputeEnvironmentInput) DeleteComputeEnvironmentRequest } // Send marshals and sends the DeleteComputeEnvironment API request. @@ -240,7 +244,7 @@ func (c *Batch) DeleteComputeEnvironmentRequest(input *DeleteComputeEnvironmentI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteComputeEnvironmentRequest{Request: req, Input: input} + return DeleteComputeEnvironmentRequest{Request: req, Input: input, Copy: c.DeleteComputeEnvironmentRequest} } const opDeleteJobQueue = "DeleteJobQueue" @@ -249,6 +253,7 @@ const opDeleteJobQueue = "DeleteJobQueue" type DeleteJobQueueRequest struct { *aws.Request Input *DeleteJobQueueInput + Copy func(*DeleteJobQueueInput) DeleteJobQueueRequest } // Send marshals and sends the DeleteJobQueue API request. @@ -294,7 +299,7 @@ func (c *Batch) DeleteJobQueueRequest(input *DeleteJobQueueInput) DeleteJobQueue req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteJobQueueRequest{Request: req, Input: input} + return DeleteJobQueueRequest{Request: req, Input: input, Copy: c.DeleteJobQueueRequest} } const opDeregisterJobDefinition = "DeregisterJobDefinition" @@ -303,6 +308,7 @@ const opDeregisterJobDefinition = "DeregisterJobDefinition" type DeregisterJobDefinitionRequest struct { *aws.Request Input *DeregisterJobDefinitionInput + Copy func(*DeregisterJobDefinitionInput) DeregisterJobDefinitionRequest } // Send marshals and sends the DeregisterJobDefinition API request. @@ -343,7 +349,7 @@ func (c *Batch) DeregisterJobDefinitionRequest(input *DeregisterJobDefinitionInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterJobDefinitionRequest{Request: req, Input: input} + return DeregisterJobDefinitionRequest{Request: req, Input: input, Copy: c.DeregisterJobDefinitionRequest} } const opDescribeComputeEnvironments = "DescribeComputeEnvironments" @@ -352,6 +358,7 @@ const opDescribeComputeEnvironments = "DescribeComputeEnvironments" type DescribeComputeEnvironmentsRequest struct { *aws.Request Input *DescribeComputeEnvironmentsInput + Copy func(*DescribeComputeEnvironmentsInput) DescribeComputeEnvironmentsRequest } // Send marshals and sends the DescribeComputeEnvironments API request. @@ -396,7 +403,7 @@ func (c *Batch) DescribeComputeEnvironmentsRequest(input *DescribeComputeEnviron req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeComputeEnvironmentsRequest{Request: req, Input: input} + return DescribeComputeEnvironmentsRequest{Request: req, Input: input, Copy: c.DescribeComputeEnvironmentsRequest} } const opDescribeJobDefinitions = "DescribeJobDefinitions" @@ -405,6 +412,7 @@ const opDescribeJobDefinitions = "DescribeJobDefinitions" type DescribeJobDefinitionsRequest struct { *aws.Request Input *DescribeJobDefinitionsInput + Copy func(*DescribeJobDefinitionsInput) DescribeJobDefinitionsRequest } // Send marshals and sends the DescribeJobDefinitions API request. @@ -446,7 +454,7 @@ func (c *Batch) DescribeJobDefinitionsRequest(input *DescribeJobDefinitionsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeJobDefinitionsRequest{Request: req, Input: input} + return DescribeJobDefinitionsRequest{Request: req, Input: input, Copy: c.DescribeJobDefinitionsRequest} } const opDescribeJobQueues = "DescribeJobQueues" @@ -455,6 +463,7 @@ const opDescribeJobQueues = "DescribeJobQueues" type DescribeJobQueuesRequest struct { *aws.Request Input *DescribeJobQueuesInput + Copy func(*DescribeJobQueuesInput) DescribeJobQueuesRequest } // Send marshals and sends the DescribeJobQueues API request. @@ -495,7 +504,7 @@ func (c *Batch) DescribeJobQueuesRequest(input *DescribeJobQueuesInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeJobQueuesRequest{Request: req, Input: input} + return DescribeJobQueuesRequest{Request: req, Input: input, Copy: c.DescribeJobQueuesRequest} } const opDescribeJobs = "DescribeJobs" @@ -504,6 +513,7 @@ const opDescribeJobs = "DescribeJobs" type DescribeJobsRequest struct { *aws.Request Input *DescribeJobsInput + Copy func(*DescribeJobsInput) DescribeJobsRequest } // Send marshals and sends the DescribeJobs API request. @@ -544,7 +554,7 @@ func (c *Batch) DescribeJobsRequest(input *DescribeJobsInput) DescribeJobsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeJobsRequest{Request: req, Input: input} + return DescribeJobsRequest{Request: req, Input: input, Copy: c.DescribeJobsRequest} } const opListJobs = "ListJobs" @@ -553,6 +563,7 @@ const opListJobs = "ListJobs" type ListJobsRequest struct { *aws.Request Input *ListJobsInput + Copy func(*ListJobsInput) ListJobsRequest } // Send marshals and sends the ListJobs API request. @@ -595,7 +606,7 @@ func (c *Batch) ListJobsRequest(input *ListJobsInput) ListJobsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobsRequest{Request: req, Input: input} + return ListJobsRequest{Request: req, Input: input, Copy: c.ListJobsRequest} } const opRegisterJobDefinition = "RegisterJobDefinition" @@ -604,6 +615,7 @@ const opRegisterJobDefinition = "RegisterJobDefinition" type RegisterJobDefinitionRequest struct { *aws.Request Input *RegisterJobDefinitionInput + Copy func(*RegisterJobDefinitionInput) RegisterJobDefinitionRequest } // Send marshals and sends the RegisterJobDefinition API request. @@ -644,7 +656,7 @@ func (c *Batch) RegisterJobDefinitionRequest(input *RegisterJobDefinitionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterJobDefinitionRequest{Request: req, Input: input} + return RegisterJobDefinitionRequest{Request: req, Input: input, Copy: c.RegisterJobDefinitionRequest} } const opSubmitJob = "SubmitJob" @@ -653,6 +665,7 @@ const opSubmitJob = "SubmitJob" type SubmitJobRequest struct { *aws.Request Input *SubmitJobInput + Copy func(*SubmitJobInput) SubmitJobRequest } // Send marshals and sends the SubmitJob API request. @@ -694,7 +707,7 @@ func (c *Batch) SubmitJobRequest(input *SubmitJobInput) SubmitJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SubmitJobRequest{Request: req, Input: input} + return SubmitJobRequest{Request: req, Input: input, Copy: c.SubmitJobRequest} } const opTerminateJob = "TerminateJob" @@ -703,6 +716,7 @@ const opTerminateJob = "TerminateJob" type TerminateJobRequest struct { *aws.Request Input *TerminateJobInput + Copy func(*TerminateJobInput) TerminateJobRequest } // Send marshals and sends the TerminateJob API request. @@ -745,7 +759,7 @@ func (c *Batch) TerminateJobRequest(input *TerminateJobInput) TerminateJobReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TerminateJobRequest{Request: req, Input: input} + return TerminateJobRequest{Request: req, Input: input, Copy: c.TerminateJobRequest} } const opUpdateComputeEnvironment = "UpdateComputeEnvironment" @@ -754,6 +768,7 @@ const opUpdateComputeEnvironment = "UpdateComputeEnvironment" type UpdateComputeEnvironmentRequest struct { *aws.Request Input *UpdateComputeEnvironmentInput + Copy func(*UpdateComputeEnvironmentInput) UpdateComputeEnvironmentRequest } // Send marshals and sends the UpdateComputeEnvironment API request. @@ -794,7 +809,7 @@ func (c *Batch) UpdateComputeEnvironmentRequest(input *UpdateComputeEnvironmentI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateComputeEnvironmentRequest{Request: req, Input: input} + return UpdateComputeEnvironmentRequest{Request: req, Input: input, Copy: c.UpdateComputeEnvironmentRequest} } const opUpdateJobQueue = "UpdateJobQueue" @@ -803,6 +818,7 @@ const opUpdateJobQueue = "UpdateJobQueue" type UpdateJobQueueRequest struct { *aws.Request Input *UpdateJobQueueInput + Copy func(*UpdateJobQueueInput) UpdateJobQueueRequest } // Send marshals and sends the UpdateJobQueue API request. @@ -843,7 +859,7 @@ func (c *Batch) UpdateJobQueueRequest(input *UpdateJobQueueInput) UpdateJobQueue req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateJobQueueRequest{Request: req, Input: input} + return UpdateJobQueueRequest{Request: req, Input: input, Copy: c.UpdateJobQueueRequest} } // An object representing an AWS Batch array job. diff --git a/service/budgets/api.go b/service/budgets/api.go index 70325021f07..049d43950ab 100644 --- a/service/budgets/api.go +++ b/service/budgets/api.go @@ -16,6 +16,7 @@ const opCreateBudget = "CreateBudget" type CreateBudgetRequest struct { *aws.Request Input *CreateBudgetInput + Copy func(*CreateBudgetInput) CreateBudgetRequest } // Send marshals and sends the CreateBudget API request. @@ -54,7 +55,7 @@ func (c *Budgets) CreateBudgetRequest(input *CreateBudgetInput) CreateBudgetRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBudgetRequest{Request: req, Input: input} + return CreateBudgetRequest{Request: req, Input: input, Copy: c.CreateBudgetRequest} } const opCreateNotification = "CreateNotification" @@ -63,6 +64,7 @@ const opCreateNotification = "CreateNotification" type CreateNotificationRequest struct { *aws.Request Input *CreateNotificationInput + Copy func(*CreateNotificationInput) CreateNotificationRequest } // Send marshals and sends the CreateNotification API request. @@ -101,7 +103,7 @@ func (c *Budgets) CreateNotificationRequest(input *CreateNotificationInput) Crea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNotificationRequest{Request: req, Input: input} + return CreateNotificationRequest{Request: req, Input: input, Copy: c.CreateNotificationRequest} } const opCreateSubscriber = "CreateSubscriber" @@ -110,6 +112,7 @@ const opCreateSubscriber = "CreateSubscriber" type CreateSubscriberRequest struct { *aws.Request Input *CreateSubscriberInput + Copy func(*CreateSubscriberInput) CreateSubscriberRequest } // Send marshals and sends the CreateSubscriber API request. @@ -148,7 +151,7 @@ func (c *Budgets) CreateSubscriberRequest(input *CreateSubscriberInput) CreateSu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSubscriberRequest{Request: req, Input: input} + return CreateSubscriberRequest{Request: req, Input: input, Copy: c.CreateSubscriberRequest} } const opDeleteBudget = "DeleteBudget" @@ -157,6 +160,7 @@ const opDeleteBudget = "DeleteBudget" type DeleteBudgetRequest struct { *aws.Request Input *DeleteBudgetInput + Copy func(*DeleteBudgetInput) DeleteBudgetRequest } // Send marshals and sends the DeleteBudget API request. @@ -195,7 +199,7 @@ func (c *Budgets) DeleteBudgetRequest(input *DeleteBudgetInput) DeleteBudgetRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteBudgetRequest{Request: req, Input: input} + return DeleteBudgetRequest{Request: req, Input: input, Copy: c.DeleteBudgetRequest} } const opDeleteNotification = "DeleteNotification" @@ -204,6 +208,7 @@ const opDeleteNotification = "DeleteNotification" type DeleteNotificationRequest struct { *aws.Request Input *DeleteNotificationInput + Copy func(*DeleteNotificationInput) DeleteNotificationRequest } // Send marshals and sends the DeleteNotification API request. @@ -242,7 +247,7 @@ func (c *Budgets) DeleteNotificationRequest(input *DeleteNotificationInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteNotificationRequest{Request: req, Input: input} + return DeleteNotificationRequest{Request: req, Input: input, Copy: c.DeleteNotificationRequest} } const opDeleteSubscriber = "DeleteSubscriber" @@ -251,6 +256,7 @@ const opDeleteSubscriber = "DeleteSubscriber" type DeleteSubscriberRequest struct { *aws.Request Input *DeleteSubscriberInput + Copy func(*DeleteSubscriberInput) DeleteSubscriberRequest } // Send marshals and sends the DeleteSubscriber API request. @@ -289,7 +295,7 @@ func (c *Budgets) DeleteSubscriberRequest(input *DeleteSubscriberInput) DeleteSu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSubscriberRequest{Request: req, Input: input} + return DeleteSubscriberRequest{Request: req, Input: input, Copy: c.DeleteSubscriberRequest} } const opDescribeBudget = "DescribeBudget" @@ -298,6 +304,7 @@ const opDescribeBudget = "DescribeBudget" type DescribeBudgetRequest struct { *aws.Request Input *DescribeBudgetInput + Copy func(*DescribeBudgetInput) DescribeBudgetRequest } // Send marshals and sends the DescribeBudget API request. @@ -336,7 +343,7 @@ func (c *Budgets) DescribeBudgetRequest(input *DescribeBudgetInput) DescribeBudg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBudgetRequest{Request: req, Input: input} + return DescribeBudgetRequest{Request: req, Input: input, Copy: c.DescribeBudgetRequest} } const opDescribeBudgets = "DescribeBudgets" @@ -345,6 +352,7 @@ const opDescribeBudgets = "DescribeBudgets" type DescribeBudgetsRequest struct { *aws.Request Input *DescribeBudgetsInput + Copy func(*DescribeBudgetsInput) DescribeBudgetsRequest } // Send marshals and sends the DescribeBudgets API request. @@ -383,7 +391,7 @@ func (c *Budgets) DescribeBudgetsRequest(input *DescribeBudgetsInput) DescribeBu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBudgetsRequest{Request: req, Input: input} + return DescribeBudgetsRequest{Request: req, Input: input, Copy: c.DescribeBudgetsRequest} } const opDescribeNotificationsForBudget = "DescribeNotificationsForBudget" @@ -392,6 +400,7 @@ const opDescribeNotificationsForBudget = "DescribeNotificationsForBudget" type DescribeNotificationsForBudgetRequest struct { *aws.Request Input *DescribeNotificationsForBudgetInput + Copy func(*DescribeNotificationsForBudgetInput) DescribeNotificationsForBudgetRequest } // Send marshals and sends the DescribeNotificationsForBudget API request. @@ -430,7 +439,7 @@ func (c *Budgets) DescribeNotificationsForBudgetRequest(input *DescribeNotificat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNotificationsForBudgetRequest{Request: req, Input: input} + return DescribeNotificationsForBudgetRequest{Request: req, Input: input, Copy: c.DescribeNotificationsForBudgetRequest} } const opDescribeSubscribersForNotification = "DescribeSubscribersForNotification" @@ -439,6 +448,7 @@ const opDescribeSubscribersForNotification = "DescribeSubscribersForNotification type DescribeSubscribersForNotificationRequest struct { *aws.Request Input *DescribeSubscribersForNotificationInput + Copy func(*DescribeSubscribersForNotificationInput) DescribeSubscribersForNotificationRequest } // Send marshals and sends the DescribeSubscribersForNotification API request. @@ -477,7 +487,7 @@ func (c *Budgets) DescribeSubscribersForNotificationRequest(input *DescribeSubsc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSubscribersForNotificationRequest{Request: req, Input: input} + return DescribeSubscribersForNotificationRequest{Request: req, Input: input, Copy: c.DescribeSubscribersForNotificationRequest} } const opUpdateBudget = "UpdateBudget" @@ -486,6 +496,7 @@ const opUpdateBudget = "UpdateBudget" type UpdateBudgetRequest struct { *aws.Request Input *UpdateBudgetInput + Copy func(*UpdateBudgetInput) UpdateBudgetRequest } // Send marshals and sends the UpdateBudget API request. @@ -524,7 +535,7 @@ func (c *Budgets) UpdateBudgetRequest(input *UpdateBudgetInput) UpdateBudgetRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateBudgetRequest{Request: req, Input: input} + return UpdateBudgetRequest{Request: req, Input: input, Copy: c.UpdateBudgetRequest} } const opUpdateNotification = "UpdateNotification" @@ -533,6 +544,7 @@ const opUpdateNotification = "UpdateNotification" type UpdateNotificationRequest struct { *aws.Request Input *UpdateNotificationInput + Copy func(*UpdateNotificationInput) UpdateNotificationRequest } // Send marshals and sends the UpdateNotification API request. @@ -571,7 +583,7 @@ func (c *Budgets) UpdateNotificationRequest(input *UpdateNotificationInput) Upda req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateNotificationRequest{Request: req, Input: input} + return UpdateNotificationRequest{Request: req, Input: input, Copy: c.UpdateNotificationRequest} } const opUpdateSubscriber = "UpdateSubscriber" @@ -580,6 +592,7 @@ const opUpdateSubscriber = "UpdateSubscriber" type UpdateSubscriberRequest struct { *aws.Request Input *UpdateSubscriberInput + Copy func(*UpdateSubscriberInput) UpdateSubscriberRequest } // Send marshals and sends the UpdateSubscriber API request. @@ -618,7 +631,7 @@ func (c *Budgets) UpdateSubscriberRequest(input *UpdateSubscriberInput) UpdateSu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSubscriberRequest{Request: req, Input: input} + return UpdateSubscriberRequest{Request: req, Input: input, Copy: c.UpdateSubscriberRequest} } // AWS Budget model diff --git a/service/cloud9/api.go b/service/cloud9/api.go index 730d6b805a5..202aae85e02 100644 --- a/service/cloud9/api.go +++ b/service/cloud9/api.go @@ -15,6 +15,7 @@ const opCreateEnvironmentEC2 = "CreateEnvironmentEC2" type CreateEnvironmentEC2Request struct { *aws.Request Input *CreateEnvironmentEC2Input + Copy func(*CreateEnvironmentEC2Input) CreateEnvironmentEC2Request } // Send marshals and sends the CreateEnvironmentEC2 API request. @@ -57,7 +58,7 @@ func (c *Cloud9) CreateEnvironmentEC2Request(input *CreateEnvironmentEC2Input) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEnvironmentEC2Request{Request: req, Input: input} + return CreateEnvironmentEC2Request{Request: req, Input: input, Copy: c.CreateEnvironmentEC2Request} } const opCreateEnvironmentMembership = "CreateEnvironmentMembership" @@ -66,6 +67,7 @@ const opCreateEnvironmentMembership = "CreateEnvironmentMembership" type CreateEnvironmentMembershipRequest struct { *aws.Request Input *CreateEnvironmentMembershipInput + Copy func(*CreateEnvironmentMembershipInput) CreateEnvironmentMembershipRequest } // Send marshals and sends the CreateEnvironmentMembership API request. @@ -106,7 +108,7 @@ func (c *Cloud9) CreateEnvironmentMembershipRequest(input *CreateEnvironmentMemb req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEnvironmentMembershipRequest{Request: req, Input: input} + return CreateEnvironmentMembershipRequest{Request: req, Input: input, Copy: c.CreateEnvironmentMembershipRequest} } const opDeleteEnvironment = "DeleteEnvironment" @@ -115,6 +117,7 @@ const opDeleteEnvironment = "DeleteEnvironment" type DeleteEnvironmentRequest struct { *aws.Request Input *DeleteEnvironmentInput + Copy func(*DeleteEnvironmentInput) DeleteEnvironmentRequest } // Send marshals and sends the DeleteEnvironment API request. @@ -157,7 +160,7 @@ func (c *Cloud9) DeleteEnvironmentRequest(input *DeleteEnvironmentInput) DeleteE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEnvironmentRequest{Request: req, Input: input} + return DeleteEnvironmentRequest{Request: req, Input: input, Copy: c.DeleteEnvironmentRequest} } const opDeleteEnvironmentMembership = "DeleteEnvironmentMembership" @@ -166,6 +169,7 @@ const opDeleteEnvironmentMembership = "DeleteEnvironmentMembership" type DeleteEnvironmentMembershipRequest struct { *aws.Request Input *DeleteEnvironmentMembershipInput + Copy func(*DeleteEnvironmentMembershipInput) DeleteEnvironmentMembershipRequest } // Send marshals and sends the DeleteEnvironmentMembership API request. @@ -206,7 +210,7 @@ func (c *Cloud9) DeleteEnvironmentMembershipRequest(input *DeleteEnvironmentMemb req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEnvironmentMembershipRequest{Request: req, Input: input} + return DeleteEnvironmentMembershipRequest{Request: req, Input: input, Copy: c.DeleteEnvironmentMembershipRequest} } const opDescribeEnvironmentMemberships = "DescribeEnvironmentMemberships" @@ -215,6 +219,7 @@ const opDescribeEnvironmentMemberships = "DescribeEnvironmentMemberships" type DescribeEnvironmentMembershipsRequest struct { *aws.Request Input *DescribeEnvironmentMembershipsInput + Copy func(*DescribeEnvironmentMembershipsInput) DescribeEnvironmentMembershipsRequest } // Send marshals and sends the DescribeEnvironmentMemberships API request. @@ -262,57 +267,53 @@ func (c *Cloud9) DescribeEnvironmentMembershipsRequest(input *DescribeEnvironmen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEnvironmentMembershipsRequest{Request: req, Input: input} + return DescribeEnvironmentMembershipsRequest{Request: req, Input: input, Copy: c.DescribeEnvironmentMembershipsRequest} } -// DescribeEnvironmentMembershipsPages iterates over the pages of a DescribeEnvironmentMemberships operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEnvironmentMemberships method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEnvironmentMembershipsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEnvironmentMemberships operation. -// pageNum := 0 -// err := client.DescribeEnvironmentMembershipsPages(params, -// func(page *DescribeEnvironmentMembershipsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.DescribeEnvironmentMembershipsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Cloud9) DescribeEnvironmentMembershipsPages(input *DescribeEnvironmentMembershipsInput, fn func(*DescribeEnvironmentMembershipsOutput, bool) bool) error { - return c.DescribeEnvironmentMembershipsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEnvironmentMembershipsPagesWithContext same as DescribeEnvironmentMembershipsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Cloud9) DescribeEnvironmentMembershipsPagesWithContext(ctx aws.Context, input *DescribeEnvironmentMembershipsInput, fn func(*DescribeEnvironmentMembershipsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEnvironmentMembershipsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEnvironmentMembershipsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *DescribeEnvironmentMembershipsRequest) Paginate(opts ...aws.Option) DescribeEnvironmentMembershipsPager { + return DescribeEnvironmentMembershipsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEnvironmentMembershipsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEnvironmentMembershipsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEnvironmentMembershipsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEnvironmentMembershipsPager struct { + aws.Pager +} + +func (p *DescribeEnvironmentMembershipsPager) CurrentPage() *DescribeEnvironmentMembershipsOutput { + return p.Pager.CurrentPage().(*DescribeEnvironmentMembershipsOutput) } const opDescribeEnvironmentStatus = "DescribeEnvironmentStatus" @@ -321,6 +322,7 @@ const opDescribeEnvironmentStatus = "DescribeEnvironmentStatus" type DescribeEnvironmentStatusRequest struct { *aws.Request Input *DescribeEnvironmentStatusInput + Copy func(*DescribeEnvironmentStatusInput) DescribeEnvironmentStatusRequest } // Send marshals and sends the DescribeEnvironmentStatus API request. @@ -361,7 +363,7 @@ func (c *Cloud9) DescribeEnvironmentStatusRequest(input *DescribeEnvironmentStat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEnvironmentStatusRequest{Request: req, Input: input} + return DescribeEnvironmentStatusRequest{Request: req, Input: input, Copy: c.DescribeEnvironmentStatusRequest} } const opDescribeEnvironments = "DescribeEnvironments" @@ -370,6 +372,7 @@ const opDescribeEnvironments = "DescribeEnvironments" type DescribeEnvironmentsRequest struct { *aws.Request Input *DescribeEnvironmentsInput + Copy func(*DescribeEnvironmentsInput) DescribeEnvironmentsRequest } // Send marshals and sends the DescribeEnvironments API request. @@ -410,7 +413,7 @@ func (c *Cloud9) DescribeEnvironmentsRequest(input *DescribeEnvironmentsInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEnvironmentsRequest{Request: req, Input: input} + return DescribeEnvironmentsRequest{Request: req, Input: input, Copy: c.DescribeEnvironmentsRequest} } const opListEnvironments = "ListEnvironments" @@ -419,6 +422,7 @@ const opListEnvironments = "ListEnvironments" type ListEnvironmentsRequest struct { *aws.Request Input *ListEnvironmentsInput + Copy func(*ListEnvironmentsInput) ListEnvironmentsRequest } // Send marshals and sends the ListEnvironments API request. @@ -465,57 +469,53 @@ func (c *Cloud9) ListEnvironmentsRequest(input *ListEnvironmentsInput) ListEnvir req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListEnvironmentsRequest{Request: req, Input: input} + return ListEnvironmentsRequest{Request: req, Input: input, Copy: c.ListEnvironmentsRequest} } -// ListEnvironmentsPages iterates over the pages of a ListEnvironments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEnvironments method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListEnvironmentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListEnvironments operation. -// pageNum := 0 -// err := client.ListEnvironmentsPages(params, -// func(page *ListEnvironmentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListEnvironmentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Cloud9) ListEnvironmentsPages(input *ListEnvironmentsInput, fn func(*ListEnvironmentsOutput, bool) bool) error { - return c.ListEnvironmentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEnvironmentsPagesWithContext same as ListEnvironmentsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Cloud9) ListEnvironmentsPagesWithContext(ctx aws.Context, input *ListEnvironmentsInput, fn func(*ListEnvironmentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListEnvironmentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListEnvironmentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListEnvironmentsRequest) Paginate(opts ...aws.Option) ListEnvironmentsPager { + return ListEnvironmentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListEnvironmentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEnvironmentsOutput), !p.HasNextPage()) - } - return p.Err() +// ListEnvironmentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListEnvironmentsPager struct { + aws.Pager +} + +func (p *ListEnvironmentsPager) CurrentPage() *ListEnvironmentsOutput { + return p.Pager.CurrentPage().(*ListEnvironmentsOutput) } const opUpdateEnvironment = "UpdateEnvironment" @@ -524,6 +524,7 @@ const opUpdateEnvironment = "UpdateEnvironment" type UpdateEnvironmentRequest struct { *aws.Request Input *UpdateEnvironmentInput + Copy func(*UpdateEnvironmentInput) UpdateEnvironmentRequest } // Send marshals and sends the UpdateEnvironment API request. @@ -564,7 +565,7 @@ func (c *Cloud9) UpdateEnvironmentRequest(input *UpdateEnvironmentInput) UpdateE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEnvironmentRequest{Request: req, Input: input} + return UpdateEnvironmentRequest{Request: req, Input: input, Copy: c.UpdateEnvironmentRequest} } const opUpdateEnvironmentMembership = "UpdateEnvironmentMembership" @@ -573,6 +574,7 @@ const opUpdateEnvironmentMembership = "UpdateEnvironmentMembership" type UpdateEnvironmentMembershipRequest struct { *aws.Request Input *UpdateEnvironmentMembershipInput + Copy func(*UpdateEnvironmentMembershipInput) UpdateEnvironmentMembershipRequest } // Send marshals and sends the UpdateEnvironmentMembership API request. @@ -614,7 +616,7 @@ func (c *Cloud9) UpdateEnvironmentMembershipRequest(input *UpdateEnvironmentMemb req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEnvironmentMembershipRequest{Request: req, Input: input} + return UpdateEnvironmentMembershipRequest{Request: req, Input: input, Copy: c.UpdateEnvironmentMembershipRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/CreateEnvironmentEC2Request diff --git a/service/cloud9/cloud9iface/interface.go b/service/cloud9/cloud9iface/interface.go index 952df359cdc..029e4c37e77 100644 --- a/service/cloud9/cloud9iface/interface.go +++ b/service/cloud9/cloud9iface/interface.go @@ -9,7 +9,6 @@ package cloud9iface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloud9" ) @@ -73,18 +72,12 @@ type Cloud9API interface { DescribeEnvironmentMembershipsRequest(*cloud9.DescribeEnvironmentMembershipsInput) cloud9.DescribeEnvironmentMembershipsRequest - DescribeEnvironmentMembershipsPages(*cloud9.DescribeEnvironmentMembershipsInput, func(*cloud9.DescribeEnvironmentMembershipsOutput, bool) bool) error - DescribeEnvironmentMembershipsPagesWithContext(aws.Context, *cloud9.DescribeEnvironmentMembershipsInput, func(*cloud9.DescribeEnvironmentMembershipsOutput, bool) bool, ...aws.Option) error - DescribeEnvironmentStatusRequest(*cloud9.DescribeEnvironmentStatusInput) cloud9.DescribeEnvironmentStatusRequest DescribeEnvironmentsRequest(*cloud9.DescribeEnvironmentsInput) cloud9.DescribeEnvironmentsRequest ListEnvironmentsRequest(*cloud9.ListEnvironmentsInput) cloud9.ListEnvironmentsRequest - ListEnvironmentsPages(*cloud9.ListEnvironmentsInput, func(*cloud9.ListEnvironmentsOutput, bool) bool) error - ListEnvironmentsPagesWithContext(aws.Context, *cloud9.ListEnvironmentsInput, func(*cloud9.ListEnvironmentsOutput, bool) bool, ...aws.Option) error - UpdateEnvironmentRequest(*cloud9.UpdateEnvironmentInput) cloud9.UpdateEnvironmentRequest UpdateEnvironmentMembershipRequest(*cloud9.UpdateEnvironmentMembershipInput) cloud9.UpdateEnvironmentMembershipRequest diff --git a/service/clouddirectory/api.go b/service/clouddirectory/api.go index 28fd3bb6ac7..cf034bf9184 100644 --- a/service/clouddirectory/api.go +++ b/service/clouddirectory/api.go @@ -18,6 +18,7 @@ const opAddFacetToObject = "AddFacetToObject" type AddFacetToObjectRequest struct { *aws.Request Input *AddFacetToObjectInput + Copy func(*AddFacetToObjectInput) AddFacetToObjectRequest } // Send marshals and sends the AddFacetToObject API request. @@ -58,7 +59,7 @@ func (c *CloudDirectory) AddFacetToObjectRequest(input *AddFacetToObjectInput) A req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddFacetToObjectRequest{Request: req, Input: input} + return AddFacetToObjectRequest{Request: req, Input: input, Copy: c.AddFacetToObjectRequest} } const opApplySchema = "ApplySchema" @@ -67,6 +68,7 @@ const opApplySchema = "ApplySchema" type ApplySchemaRequest struct { *aws.Request Input *ApplySchemaInput + Copy func(*ApplySchemaInput) ApplySchemaRequest } // Send marshals and sends the ApplySchema API request. @@ -108,7 +110,7 @@ func (c *CloudDirectory) ApplySchemaRequest(input *ApplySchemaInput) ApplySchema req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ApplySchemaRequest{Request: req, Input: input} + return ApplySchemaRequest{Request: req, Input: input, Copy: c.ApplySchemaRequest} } const opAttachObject = "AttachObject" @@ -117,6 +119,7 @@ const opAttachObject = "AttachObject" type AttachObjectRequest struct { *aws.Request Input *AttachObjectInput + Copy func(*AttachObjectInput) AttachObjectRequest } // Send marshals and sends the AttachObject API request. @@ -162,7 +165,7 @@ func (c *CloudDirectory) AttachObjectRequest(input *AttachObjectInput) AttachObj req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachObjectRequest{Request: req, Input: input} + return AttachObjectRequest{Request: req, Input: input, Copy: c.AttachObjectRequest} } const opAttachPolicy = "AttachPolicy" @@ -171,6 +174,7 @@ const opAttachPolicy = "AttachPolicy" type AttachPolicyRequest struct { *aws.Request Input *AttachPolicyInput + Copy func(*AttachPolicyInput) AttachPolicyRequest } // Send marshals and sends the AttachPolicy API request. @@ -212,7 +216,7 @@ func (c *CloudDirectory) AttachPolicyRequest(input *AttachPolicyInput) AttachPol req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachPolicyRequest{Request: req, Input: input} + return AttachPolicyRequest{Request: req, Input: input, Copy: c.AttachPolicyRequest} } const opAttachToIndex = "AttachToIndex" @@ -221,6 +225,7 @@ const opAttachToIndex = "AttachToIndex" type AttachToIndexRequest struct { *aws.Request Input *AttachToIndexInput + Copy func(*AttachToIndexInput) AttachToIndexRequest } // Send marshals and sends the AttachToIndex API request. @@ -261,7 +266,7 @@ func (c *CloudDirectory) AttachToIndexRequest(input *AttachToIndexInput) AttachT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachToIndexRequest{Request: req, Input: input} + return AttachToIndexRequest{Request: req, Input: input, Copy: c.AttachToIndexRequest} } const opAttachTypedLink = "AttachTypedLink" @@ -270,6 +275,7 @@ const opAttachTypedLink = "AttachTypedLink" type AttachTypedLinkRequest struct { *aws.Request Input *AttachTypedLinkInput + Copy func(*AttachTypedLinkInput) AttachTypedLinkRequest } // Send marshals and sends the AttachTypedLink API request. @@ -311,7 +317,7 @@ func (c *CloudDirectory) AttachTypedLinkRequest(input *AttachTypedLinkInput) Att req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachTypedLinkRequest{Request: req, Input: input} + return AttachTypedLinkRequest{Request: req, Input: input, Copy: c.AttachTypedLinkRequest} } const opBatchRead = "BatchRead" @@ -320,6 +326,7 @@ const opBatchRead = "BatchRead" type BatchReadRequest struct { *aws.Request Input *BatchReadInput + Copy func(*BatchReadInput) BatchReadRequest } // Send marshals and sends the BatchRead API request. @@ -360,7 +367,7 @@ func (c *CloudDirectory) BatchReadRequest(input *BatchReadInput) BatchReadReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchReadRequest{Request: req, Input: input} + return BatchReadRequest{Request: req, Input: input, Copy: c.BatchReadRequest} } const opBatchWrite = "BatchWrite" @@ -369,6 +376,7 @@ const opBatchWrite = "BatchWrite" type BatchWriteRequest struct { *aws.Request Input *BatchWriteInput + Copy func(*BatchWriteInput) BatchWriteRequest } // Send marshals and sends the BatchWrite API request. @@ -410,7 +418,7 @@ func (c *CloudDirectory) BatchWriteRequest(input *BatchWriteInput) BatchWriteReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchWriteRequest{Request: req, Input: input} + return BatchWriteRequest{Request: req, Input: input, Copy: c.BatchWriteRequest} } const opCreateDirectory = "CreateDirectory" @@ -419,6 +427,7 @@ const opCreateDirectory = "CreateDirectory" type CreateDirectoryRequest struct { *aws.Request Input *CreateDirectoryInput + Copy func(*CreateDirectoryInput) CreateDirectoryRequest } // Send marshals and sends the CreateDirectory API request. @@ -460,7 +469,7 @@ func (c *CloudDirectory) CreateDirectoryRequest(input *CreateDirectoryInput) Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDirectoryRequest{Request: req, Input: input} + return CreateDirectoryRequest{Request: req, Input: input, Copy: c.CreateDirectoryRequest} } const opCreateFacet = "CreateFacet" @@ -469,6 +478,7 @@ const opCreateFacet = "CreateFacet" type CreateFacetRequest struct { *aws.Request Input *CreateFacetInput + Copy func(*CreateFacetInput) CreateFacetRequest } // Send marshals and sends the CreateFacet API request. @@ -510,7 +520,7 @@ func (c *CloudDirectory) CreateFacetRequest(input *CreateFacetInput) CreateFacet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFacetRequest{Request: req, Input: input} + return CreateFacetRequest{Request: req, Input: input, Copy: c.CreateFacetRequest} } const opCreateIndex = "CreateIndex" @@ -519,6 +529,7 @@ const opCreateIndex = "CreateIndex" type CreateIndexRequest struct { *aws.Request Input *CreateIndexInput + Copy func(*CreateIndexInput) CreateIndexRequest } // Send marshals and sends the CreateIndex API request. @@ -560,7 +571,7 @@ func (c *CloudDirectory) CreateIndexRequest(input *CreateIndexInput) CreateIndex req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateIndexRequest{Request: req, Input: input} + return CreateIndexRequest{Request: req, Input: input, Copy: c.CreateIndexRequest} } const opCreateObject = "CreateObject" @@ -569,6 +580,7 @@ const opCreateObject = "CreateObject" type CreateObjectRequest struct { *aws.Request Input *CreateObjectInput + Copy func(*CreateObjectInput) CreateObjectRequest } // Send marshals and sends the CreateObject API request. @@ -612,7 +624,7 @@ func (c *CloudDirectory) CreateObjectRequest(input *CreateObjectInput) CreateObj req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateObjectRequest{Request: req, Input: input} + return CreateObjectRequest{Request: req, Input: input, Copy: c.CreateObjectRequest} } const opCreateSchema = "CreateSchema" @@ -621,6 +633,7 @@ const opCreateSchema = "CreateSchema" type CreateSchemaRequest struct { *aws.Request Input *CreateSchemaInput + Copy func(*CreateSchemaInput) CreateSchemaRequest } // Send marshals and sends the CreateSchema API request. @@ -673,7 +686,7 @@ func (c *CloudDirectory) CreateSchemaRequest(input *CreateSchemaInput) CreateSch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSchemaRequest{Request: req, Input: input} + return CreateSchemaRequest{Request: req, Input: input, Copy: c.CreateSchemaRequest} } const opCreateTypedLinkFacet = "CreateTypedLinkFacet" @@ -682,6 +695,7 @@ const opCreateTypedLinkFacet = "CreateTypedLinkFacet" type CreateTypedLinkFacetRequest struct { *aws.Request Input *CreateTypedLinkFacetInput + Copy func(*CreateTypedLinkFacetInput) CreateTypedLinkFacetRequest } // Send marshals and sends the CreateTypedLinkFacet API request. @@ -722,7 +736,7 @@ func (c *CloudDirectory) CreateTypedLinkFacetRequest(input *CreateTypedLinkFacet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTypedLinkFacetRequest{Request: req, Input: input} + return CreateTypedLinkFacetRequest{Request: req, Input: input, Copy: c.CreateTypedLinkFacetRequest} } const opDeleteDirectory = "DeleteDirectory" @@ -731,6 +745,7 @@ const opDeleteDirectory = "DeleteDirectory" type DeleteDirectoryRequest struct { *aws.Request Input *DeleteDirectoryInput + Copy func(*DeleteDirectoryInput) DeleteDirectoryRequest } // Send marshals and sends the DeleteDirectory API request. @@ -772,7 +787,7 @@ func (c *CloudDirectory) DeleteDirectoryRequest(input *DeleteDirectoryInput) Del req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDirectoryRequest{Request: req, Input: input} + return DeleteDirectoryRequest{Request: req, Input: input, Copy: c.DeleteDirectoryRequest} } const opDeleteFacet = "DeleteFacet" @@ -781,6 +796,7 @@ const opDeleteFacet = "DeleteFacet" type DeleteFacetRequest struct { *aws.Request Input *DeleteFacetInput + Copy func(*DeleteFacetInput) DeleteFacetRequest } // Send marshals and sends the DeleteFacet API request. @@ -822,7 +838,7 @@ func (c *CloudDirectory) DeleteFacetRequest(input *DeleteFacetInput) DeleteFacet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteFacetRequest{Request: req, Input: input} + return DeleteFacetRequest{Request: req, Input: input, Copy: c.DeleteFacetRequest} } const opDeleteObject = "DeleteObject" @@ -831,6 +847,7 @@ const opDeleteObject = "DeleteObject" type DeleteObjectRequest struct { *aws.Request Input *DeleteObjectInput + Copy func(*DeleteObjectInput) DeleteObjectRequest } // Send marshals and sends the DeleteObject API request. @@ -872,7 +889,7 @@ func (c *CloudDirectory) DeleteObjectRequest(input *DeleteObjectInput) DeleteObj req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteObjectRequest{Request: req, Input: input} + return DeleteObjectRequest{Request: req, Input: input, Copy: c.DeleteObjectRequest} } const opDeleteSchema = "DeleteSchema" @@ -881,6 +898,7 @@ const opDeleteSchema = "DeleteSchema" type DeleteSchemaRequest struct { *aws.Request Input *DeleteSchemaInput + Copy func(*DeleteSchemaInput) DeleteSchemaRequest } // Send marshals and sends the DeleteSchema API request. @@ -922,7 +940,7 @@ func (c *CloudDirectory) DeleteSchemaRequest(input *DeleteSchemaInput) DeleteSch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSchemaRequest{Request: req, Input: input} + return DeleteSchemaRequest{Request: req, Input: input, Copy: c.DeleteSchemaRequest} } const opDeleteTypedLinkFacet = "DeleteTypedLinkFacet" @@ -931,6 +949,7 @@ const opDeleteTypedLinkFacet = "DeleteTypedLinkFacet" type DeleteTypedLinkFacetRequest struct { *aws.Request Input *DeleteTypedLinkFacetInput + Copy func(*DeleteTypedLinkFacetInput) DeleteTypedLinkFacetRequest } // Send marshals and sends the DeleteTypedLinkFacet API request. @@ -971,7 +990,7 @@ func (c *CloudDirectory) DeleteTypedLinkFacetRequest(input *DeleteTypedLinkFacet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTypedLinkFacetRequest{Request: req, Input: input} + return DeleteTypedLinkFacetRequest{Request: req, Input: input, Copy: c.DeleteTypedLinkFacetRequest} } const opDetachFromIndex = "DetachFromIndex" @@ -980,6 +999,7 @@ const opDetachFromIndex = "DetachFromIndex" type DetachFromIndexRequest struct { *aws.Request Input *DetachFromIndexInput + Copy func(*DetachFromIndexInput) DetachFromIndexRequest } // Send marshals and sends the DetachFromIndex API request. @@ -1020,7 +1040,7 @@ func (c *CloudDirectory) DetachFromIndexRequest(input *DetachFromIndexInput) Det req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachFromIndexRequest{Request: req, Input: input} + return DetachFromIndexRequest{Request: req, Input: input, Copy: c.DetachFromIndexRequest} } const opDetachObject = "DetachObject" @@ -1029,6 +1049,7 @@ const opDetachObject = "DetachObject" type DetachObjectRequest struct { *aws.Request Input *DetachObjectInput + Copy func(*DetachObjectInput) DetachObjectRequest } // Send marshals and sends the DetachObject API request. @@ -1070,7 +1091,7 @@ func (c *CloudDirectory) DetachObjectRequest(input *DetachObjectInput) DetachObj req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachObjectRequest{Request: req, Input: input} + return DetachObjectRequest{Request: req, Input: input, Copy: c.DetachObjectRequest} } const opDetachPolicy = "DetachPolicy" @@ -1079,6 +1100,7 @@ const opDetachPolicy = "DetachPolicy" type DetachPolicyRequest struct { *aws.Request Input *DetachPolicyInput + Copy func(*DetachPolicyInput) DetachPolicyRequest } // Send marshals and sends the DetachPolicy API request. @@ -1119,7 +1141,7 @@ func (c *CloudDirectory) DetachPolicyRequest(input *DetachPolicyInput) DetachPol req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachPolicyRequest{Request: req, Input: input} + return DetachPolicyRequest{Request: req, Input: input, Copy: c.DetachPolicyRequest} } const opDetachTypedLink = "DetachTypedLink" @@ -1128,6 +1150,7 @@ const opDetachTypedLink = "DetachTypedLink" type DetachTypedLinkRequest struct { *aws.Request Input *DetachTypedLinkInput + Copy func(*DetachTypedLinkInput) DetachTypedLinkRequest } // Send marshals and sends the DetachTypedLink API request. @@ -1171,7 +1194,7 @@ func (c *CloudDirectory) DetachTypedLinkRequest(input *DetachTypedLinkInput) Det req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachTypedLinkRequest{Request: req, Input: input} + return DetachTypedLinkRequest{Request: req, Input: input, Copy: c.DetachTypedLinkRequest} } const opDisableDirectory = "DisableDirectory" @@ -1180,6 +1203,7 @@ const opDisableDirectory = "DisableDirectory" type DisableDirectoryRequest struct { *aws.Request Input *DisableDirectoryInput + Copy func(*DisableDirectoryInput) DisableDirectoryRequest } // Send marshals and sends the DisableDirectory API request. @@ -1222,7 +1246,7 @@ func (c *CloudDirectory) DisableDirectoryRequest(input *DisableDirectoryInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableDirectoryRequest{Request: req, Input: input} + return DisableDirectoryRequest{Request: req, Input: input, Copy: c.DisableDirectoryRequest} } const opEnableDirectory = "EnableDirectory" @@ -1231,6 +1255,7 @@ const opEnableDirectory = "EnableDirectory" type EnableDirectoryRequest struct { *aws.Request Input *EnableDirectoryInput + Copy func(*EnableDirectoryInput) EnableDirectoryRequest } // Send marshals and sends the EnableDirectory API request. @@ -1272,7 +1297,7 @@ func (c *CloudDirectory) EnableDirectoryRequest(input *EnableDirectoryInput) Ena req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableDirectoryRequest{Request: req, Input: input} + return EnableDirectoryRequest{Request: req, Input: input, Copy: c.EnableDirectoryRequest} } const opGetAppliedSchemaVersion = "GetAppliedSchemaVersion" @@ -1281,6 +1306,7 @@ const opGetAppliedSchemaVersion = "GetAppliedSchemaVersion" type GetAppliedSchemaVersionRequest struct { *aws.Request Input *GetAppliedSchemaVersionInput + Copy func(*GetAppliedSchemaVersionInput) GetAppliedSchemaVersionRequest } // Send marshals and sends the GetAppliedSchemaVersion API request. @@ -1322,7 +1348,7 @@ func (c *CloudDirectory) GetAppliedSchemaVersionRequest(input *GetAppliedSchemaV req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAppliedSchemaVersionRequest{Request: req, Input: input} + return GetAppliedSchemaVersionRequest{Request: req, Input: input, Copy: c.GetAppliedSchemaVersionRequest} } const opGetDirectory = "GetDirectory" @@ -1331,6 +1357,7 @@ const opGetDirectory = "GetDirectory" type GetDirectoryRequest struct { *aws.Request Input *GetDirectoryInput + Copy func(*GetDirectoryInput) GetDirectoryRequest } // Send marshals and sends the GetDirectory API request. @@ -1371,7 +1398,7 @@ func (c *CloudDirectory) GetDirectoryRequest(input *GetDirectoryInput) GetDirect req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDirectoryRequest{Request: req, Input: input} + return GetDirectoryRequest{Request: req, Input: input, Copy: c.GetDirectoryRequest} } const opGetFacet = "GetFacet" @@ -1380,6 +1407,7 @@ const opGetFacet = "GetFacet" type GetFacetRequest struct { *aws.Request Input *GetFacetInput + Copy func(*GetFacetInput) GetFacetRequest } // Send marshals and sends the GetFacet API request. @@ -1422,7 +1450,7 @@ func (c *CloudDirectory) GetFacetRequest(input *GetFacetInput) GetFacetRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFacetRequest{Request: req, Input: input} + return GetFacetRequest{Request: req, Input: input, Copy: c.GetFacetRequest} } const opGetObjectInformation = "GetObjectInformation" @@ -1431,6 +1459,7 @@ const opGetObjectInformation = "GetObjectInformation" type GetObjectInformationRequest struct { *aws.Request Input *GetObjectInformationInput + Copy func(*GetObjectInformationInput) GetObjectInformationRequest } // Send marshals and sends the GetObjectInformation API request. @@ -1471,7 +1500,7 @@ func (c *CloudDirectory) GetObjectInformationRequest(input *GetObjectInformation req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetObjectInformationRequest{Request: req, Input: input} + return GetObjectInformationRequest{Request: req, Input: input, Copy: c.GetObjectInformationRequest} } const opGetSchemaAsJson = "GetSchemaAsJson" @@ -1480,6 +1509,7 @@ const opGetSchemaAsJson = "GetSchemaAsJson" type GetSchemaAsJsonRequest struct { *aws.Request Input *GetSchemaAsJsonInput + Copy func(*GetSchemaAsJsonInput) GetSchemaAsJsonRequest } // Send marshals and sends the GetSchemaAsJson API request. @@ -1521,7 +1551,7 @@ func (c *CloudDirectory) GetSchemaAsJsonRequest(input *GetSchemaAsJsonInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSchemaAsJsonRequest{Request: req, Input: input} + return GetSchemaAsJsonRequest{Request: req, Input: input, Copy: c.GetSchemaAsJsonRequest} } const opGetTypedLinkFacetInformation = "GetTypedLinkFacetInformation" @@ -1530,6 +1560,7 @@ const opGetTypedLinkFacetInformation = "GetTypedLinkFacetInformation" type GetTypedLinkFacetInformationRequest struct { *aws.Request Input *GetTypedLinkFacetInformationInput + Copy func(*GetTypedLinkFacetInformationInput) GetTypedLinkFacetInformationRequest } // Send marshals and sends the GetTypedLinkFacetInformation API request. @@ -1571,7 +1602,7 @@ func (c *CloudDirectory) GetTypedLinkFacetInformationRequest(input *GetTypedLink req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTypedLinkFacetInformationRequest{Request: req, Input: input} + return GetTypedLinkFacetInformationRequest{Request: req, Input: input, Copy: c.GetTypedLinkFacetInformationRequest} } const opListAppliedSchemaArns = "ListAppliedSchemaArns" @@ -1580,6 +1611,7 @@ const opListAppliedSchemaArns = "ListAppliedSchemaArns" type ListAppliedSchemaArnsRequest struct { *aws.Request Input *ListAppliedSchemaArnsInput + Copy func(*ListAppliedSchemaArnsInput) ListAppliedSchemaArnsRequest } // Send marshals and sends the ListAppliedSchemaArns API request. @@ -1627,57 +1659,53 @@ func (c *CloudDirectory) ListAppliedSchemaArnsRequest(input *ListAppliedSchemaAr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAppliedSchemaArnsRequest{Request: req, Input: input} + return ListAppliedSchemaArnsRequest{Request: req, Input: input, Copy: c.ListAppliedSchemaArnsRequest} } -// ListAppliedSchemaArnsPages iterates over the pages of a ListAppliedSchemaArns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAppliedSchemaArns method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAppliedSchemaArnsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAppliedSchemaArns operation. -// pageNum := 0 -// err := client.ListAppliedSchemaArnsPages(params, -// func(page *ListAppliedSchemaArnsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListAppliedSchemaArnsPages(input *ListAppliedSchemaArnsInput, fn func(*ListAppliedSchemaArnsOutput, bool) bool) error { - return c.ListAppliedSchemaArnsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAppliedSchemaArnsPagesWithContext same as ListAppliedSchemaArnsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListAppliedSchemaArnsPagesWithContext(ctx aws.Context, input *ListAppliedSchemaArnsInput, fn func(*ListAppliedSchemaArnsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAppliedSchemaArnsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAppliedSchemaArnsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAppliedSchemaArnsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAppliedSchemaArnsRequest) Paginate(opts ...aws.Option) ListAppliedSchemaArnsPager { + return ListAppliedSchemaArnsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAppliedSchemaArnsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAppliedSchemaArnsOutput), !p.HasNextPage()) - } - return p.Err() +// ListAppliedSchemaArnsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAppliedSchemaArnsPager struct { + aws.Pager +} + +func (p *ListAppliedSchemaArnsPager) CurrentPage() *ListAppliedSchemaArnsOutput { + return p.Pager.CurrentPage().(*ListAppliedSchemaArnsOutput) } const opListAttachedIndices = "ListAttachedIndices" @@ -1686,6 +1714,7 @@ const opListAttachedIndices = "ListAttachedIndices" type ListAttachedIndicesRequest struct { *aws.Request Input *ListAttachedIndicesInput + Copy func(*ListAttachedIndicesInput) ListAttachedIndicesRequest } // Send marshals and sends the ListAttachedIndices API request. @@ -1732,57 +1761,53 @@ func (c *CloudDirectory) ListAttachedIndicesRequest(input *ListAttachedIndicesIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAttachedIndicesRequest{Request: req, Input: input} + return ListAttachedIndicesRequest{Request: req, Input: input, Copy: c.ListAttachedIndicesRequest} } -// ListAttachedIndicesPages iterates over the pages of a ListAttachedIndices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAttachedIndices method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAttachedIndicesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAttachedIndices operation. -// pageNum := 0 -// err := client.ListAttachedIndicesPages(params, -// func(page *ListAttachedIndicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListAttachedIndicesPages(input *ListAttachedIndicesInput, fn func(*ListAttachedIndicesOutput, bool) bool) error { - return c.ListAttachedIndicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAttachedIndicesPagesWithContext same as ListAttachedIndicesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListAttachedIndicesPagesWithContext(ctx aws.Context, input *ListAttachedIndicesInput, fn func(*ListAttachedIndicesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAttachedIndicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAttachedIndicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAttachedIndicesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAttachedIndicesRequest) Paginate(opts ...aws.Option) ListAttachedIndicesPager { + return ListAttachedIndicesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAttachedIndicesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAttachedIndicesOutput), !p.HasNextPage()) - } - return p.Err() +// ListAttachedIndicesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAttachedIndicesPager struct { + aws.Pager +} + +func (p *ListAttachedIndicesPager) CurrentPage() *ListAttachedIndicesOutput { + return p.Pager.CurrentPage().(*ListAttachedIndicesOutput) } const opListDevelopmentSchemaArns = "ListDevelopmentSchemaArns" @@ -1791,6 +1816,7 @@ const opListDevelopmentSchemaArns = "ListDevelopmentSchemaArns" type ListDevelopmentSchemaArnsRequest struct { *aws.Request Input *ListDevelopmentSchemaArnsInput + Copy func(*ListDevelopmentSchemaArnsInput) ListDevelopmentSchemaArnsRequest } // Send marshals and sends the ListDevelopmentSchemaArns API request. @@ -1837,57 +1863,53 @@ func (c *CloudDirectory) ListDevelopmentSchemaArnsRequest(input *ListDevelopment req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDevelopmentSchemaArnsRequest{Request: req, Input: input} + return ListDevelopmentSchemaArnsRequest{Request: req, Input: input, Copy: c.ListDevelopmentSchemaArnsRequest} } -// ListDevelopmentSchemaArnsPages iterates over the pages of a ListDevelopmentSchemaArns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDevelopmentSchemaArns method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDevelopmentSchemaArnsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDevelopmentSchemaArns operation. -// pageNum := 0 -// err := client.ListDevelopmentSchemaArnsPages(params, -// func(page *ListDevelopmentSchemaArnsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListDevelopmentSchemaArnsPages(input *ListDevelopmentSchemaArnsInput, fn func(*ListDevelopmentSchemaArnsOutput, bool) bool) error { - return c.ListDevelopmentSchemaArnsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDevelopmentSchemaArnsPagesWithContext same as ListDevelopmentSchemaArnsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListDevelopmentSchemaArnsPagesWithContext(ctx aws.Context, input *ListDevelopmentSchemaArnsInput, fn func(*ListDevelopmentSchemaArnsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDevelopmentSchemaArnsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDevelopmentSchemaArnsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDevelopmentSchemaArnsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDevelopmentSchemaArnsRequest) Paginate(opts ...aws.Option) ListDevelopmentSchemaArnsPager { + return ListDevelopmentSchemaArnsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDevelopmentSchemaArnsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDevelopmentSchemaArnsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDevelopmentSchemaArnsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDevelopmentSchemaArnsPager struct { + aws.Pager +} + +func (p *ListDevelopmentSchemaArnsPager) CurrentPage() *ListDevelopmentSchemaArnsOutput { + return p.Pager.CurrentPage().(*ListDevelopmentSchemaArnsOutput) } const opListDirectories = "ListDirectories" @@ -1896,6 +1918,7 @@ const opListDirectories = "ListDirectories" type ListDirectoriesRequest struct { *aws.Request Input *ListDirectoriesInput + Copy func(*ListDirectoriesInput) ListDirectoriesRequest } // Send marshals and sends the ListDirectories API request. @@ -1942,57 +1965,53 @@ func (c *CloudDirectory) ListDirectoriesRequest(input *ListDirectoriesInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDirectoriesRequest{Request: req, Input: input} + return ListDirectoriesRequest{Request: req, Input: input, Copy: c.ListDirectoriesRequest} } -// ListDirectoriesPages iterates over the pages of a ListDirectories operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDirectories method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDirectoriesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDirectories operation. -// pageNum := 0 -// err := client.ListDirectoriesPages(params, -// func(page *ListDirectoriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListDirectoriesPages(input *ListDirectoriesInput, fn func(*ListDirectoriesOutput, bool) bool) error { - return c.ListDirectoriesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDirectoriesPagesWithContext same as ListDirectoriesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListDirectoriesPagesWithContext(ctx aws.Context, input *ListDirectoriesInput, fn func(*ListDirectoriesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDirectoriesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDirectoriesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDirectoriesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDirectoriesRequest) Paginate(opts ...aws.Option) ListDirectoriesPager { + return ListDirectoriesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDirectoriesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDirectoriesOutput), !p.HasNextPage()) - } - return p.Err() +// ListDirectoriesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDirectoriesPager struct { + aws.Pager +} + +func (p *ListDirectoriesPager) CurrentPage() *ListDirectoriesOutput { + return p.Pager.CurrentPage().(*ListDirectoriesOutput) } const opListFacetAttributes = "ListFacetAttributes" @@ -2001,6 +2020,7 @@ const opListFacetAttributes = "ListFacetAttributes" type ListFacetAttributesRequest struct { *aws.Request Input *ListFacetAttributesInput + Copy func(*ListFacetAttributesInput) ListFacetAttributesRequest } // Send marshals and sends the ListFacetAttributes API request. @@ -2047,57 +2067,53 @@ func (c *CloudDirectory) ListFacetAttributesRequest(input *ListFacetAttributesIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFacetAttributesRequest{Request: req, Input: input} + return ListFacetAttributesRequest{Request: req, Input: input, Copy: c.ListFacetAttributesRequest} } -// ListFacetAttributesPages iterates over the pages of a ListFacetAttributes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFacetAttributes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListFacetAttributesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListFacetAttributes operation. -// pageNum := 0 -// err := client.ListFacetAttributesPages(params, -// func(page *ListFacetAttributesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListFacetAttributesPages(input *ListFacetAttributesInput, fn func(*ListFacetAttributesOutput, bool) bool) error { - return c.ListFacetAttributesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFacetAttributesPagesWithContext same as ListFacetAttributesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListFacetAttributesPagesWithContext(ctx aws.Context, input *ListFacetAttributesInput, fn func(*ListFacetAttributesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListFacetAttributesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListFacetAttributesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListFacetAttributesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListFacetAttributesRequest) Paginate(opts ...aws.Option) ListFacetAttributesPager { + return ListFacetAttributesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListFacetAttributesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFacetAttributesOutput), !p.HasNextPage()) - } - return p.Err() +// ListFacetAttributesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListFacetAttributesPager struct { + aws.Pager +} + +func (p *ListFacetAttributesPager) CurrentPage() *ListFacetAttributesOutput { + return p.Pager.CurrentPage().(*ListFacetAttributesOutput) } const opListFacetNames = "ListFacetNames" @@ -2106,6 +2122,7 @@ const opListFacetNames = "ListFacetNames" type ListFacetNamesRequest struct { *aws.Request Input *ListFacetNamesInput + Copy func(*ListFacetNamesInput) ListFacetNamesRequest } // Send marshals and sends the ListFacetNames API request. @@ -2152,57 +2169,53 @@ func (c *CloudDirectory) ListFacetNamesRequest(input *ListFacetNamesInput) ListF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFacetNamesRequest{Request: req, Input: input} + return ListFacetNamesRequest{Request: req, Input: input, Copy: c.ListFacetNamesRequest} } -// ListFacetNamesPages iterates over the pages of a ListFacetNames operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFacetNames method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListFacetNamesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListFacetNames operation. -// pageNum := 0 -// err := client.ListFacetNamesPages(params, -// func(page *ListFacetNamesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListFacetNamesPages(input *ListFacetNamesInput, fn func(*ListFacetNamesOutput, bool) bool) error { - return c.ListFacetNamesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFacetNamesPagesWithContext same as ListFacetNamesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListFacetNamesPagesWithContext(ctx aws.Context, input *ListFacetNamesInput, fn func(*ListFacetNamesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListFacetNamesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListFacetNamesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListFacetNamesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListFacetNamesRequest) Paginate(opts ...aws.Option) ListFacetNamesPager { + return ListFacetNamesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListFacetNamesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFacetNamesOutput), !p.HasNextPage()) - } - return p.Err() +// ListFacetNamesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListFacetNamesPager struct { + aws.Pager +} + +func (p *ListFacetNamesPager) CurrentPage() *ListFacetNamesOutput { + return p.Pager.CurrentPage().(*ListFacetNamesOutput) } const opListIncomingTypedLinks = "ListIncomingTypedLinks" @@ -2211,6 +2224,7 @@ const opListIncomingTypedLinks = "ListIncomingTypedLinks" type ListIncomingTypedLinksRequest struct { *aws.Request Input *ListIncomingTypedLinksInput + Copy func(*ListIncomingTypedLinksInput) ListIncomingTypedLinksRequest } // Send marshals and sends the ListIncomingTypedLinks API request. @@ -2253,7 +2267,7 @@ func (c *CloudDirectory) ListIncomingTypedLinksRequest(input *ListIncomingTypedL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIncomingTypedLinksRequest{Request: req, Input: input} + return ListIncomingTypedLinksRequest{Request: req, Input: input, Copy: c.ListIncomingTypedLinksRequest} } const opListIndex = "ListIndex" @@ -2262,6 +2276,7 @@ const opListIndex = "ListIndex" type ListIndexRequest struct { *aws.Request Input *ListIndexInput + Copy func(*ListIndexInput) ListIndexRequest } // Send marshals and sends the ListIndex API request. @@ -2308,57 +2323,53 @@ func (c *CloudDirectory) ListIndexRequest(input *ListIndexInput) ListIndexReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIndexRequest{Request: req, Input: input} + return ListIndexRequest{Request: req, Input: input, Copy: c.ListIndexRequest} } -// ListIndexPages iterates over the pages of a ListIndex operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIndex method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListIndexRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListIndex operation. -// pageNum := 0 -// err := client.ListIndexPages(params, -// func(page *ListIndexOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListIndexPages(input *ListIndexInput, fn func(*ListIndexOutput, bool) bool) error { - return c.ListIndexPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIndexPagesWithContext same as ListIndexPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListIndexPagesWithContext(ctx aws.Context, input *ListIndexInput, fn func(*ListIndexOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListIndexInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListIndexRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListIndexRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListIndexRequest) Paginate(opts ...aws.Option) ListIndexPager { + return ListIndexPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListIndexInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListIndexOutput), !p.HasNextPage()) - } - return p.Err() +// ListIndexPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListIndexPager struct { + aws.Pager +} + +func (p *ListIndexPager) CurrentPage() *ListIndexOutput { + return p.Pager.CurrentPage().(*ListIndexOutput) } const opListObjectAttributes = "ListObjectAttributes" @@ -2367,6 +2378,7 @@ const opListObjectAttributes = "ListObjectAttributes" type ListObjectAttributesRequest struct { *aws.Request Input *ListObjectAttributesInput + Copy func(*ListObjectAttributesInput) ListObjectAttributesRequest } // Send marshals and sends the ListObjectAttributes API request. @@ -2413,57 +2425,53 @@ func (c *CloudDirectory) ListObjectAttributesRequest(input *ListObjectAttributes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListObjectAttributesRequest{Request: req, Input: input} + return ListObjectAttributesRequest{Request: req, Input: input, Copy: c.ListObjectAttributesRequest} } -// ListObjectAttributesPages iterates over the pages of a ListObjectAttributes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectAttributes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListObjectAttributesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListObjectAttributes operation. -// pageNum := 0 -// err := client.ListObjectAttributesPages(params, -// func(page *ListObjectAttributesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListObjectAttributesPages(input *ListObjectAttributesInput, fn func(*ListObjectAttributesOutput, bool) bool) error { - return c.ListObjectAttributesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectAttributesPagesWithContext same as ListObjectAttributesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListObjectAttributesPagesWithContext(ctx aws.Context, input *ListObjectAttributesInput, fn func(*ListObjectAttributesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListObjectAttributesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListObjectAttributesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListObjectAttributesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListObjectAttributesRequest) Paginate(opts ...aws.Option) ListObjectAttributesPager { + return ListObjectAttributesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListObjectAttributesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectAttributesOutput), !p.HasNextPage()) - } - return p.Err() +// ListObjectAttributesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListObjectAttributesPager struct { + aws.Pager +} + +func (p *ListObjectAttributesPager) CurrentPage() *ListObjectAttributesOutput { + return p.Pager.CurrentPage().(*ListObjectAttributesOutput) } const opListObjectChildren = "ListObjectChildren" @@ -2472,6 +2480,7 @@ const opListObjectChildren = "ListObjectChildren" type ListObjectChildrenRequest struct { *aws.Request Input *ListObjectChildrenInput + Copy func(*ListObjectChildrenInput) ListObjectChildrenRequest } // Send marshals and sends the ListObjectChildren API request. @@ -2519,57 +2528,53 @@ func (c *CloudDirectory) ListObjectChildrenRequest(input *ListObjectChildrenInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListObjectChildrenRequest{Request: req, Input: input} + return ListObjectChildrenRequest{Request: req, Input: input, Copy: c.ListObjectChildrenRequest} } -// ListObjectChildrenPages iterates over the pages of a ListObjectChildren operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectChildren method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListObjectChildrenRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListObjectChildren operation. -// pageNum := 0 -// err := client.ListObjectChildrenPages(params, -// func(page *ListObjectChildrenOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListObjectChildrenPages(input *ListObjectChildrenInput, fn func(*ListObjectChildrenOutput, bool) bool) error { - return c.ListObjectChildrenPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectChildrenPagesWithContext same as ListObjectChildrenPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListObjectChildrenPagesWithContext(ctx aws.Context, input *ListObjectChildrenInput, fn func(*ListObjectChildrenOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListObjectChildrenInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListObjectChildrenRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListObjectChildrenRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListObjectChildrenRequest) Paginate(opts ...aws.Option) ListObjectChildrenPager { + return ListObjectChildrenPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListObjectChildrenInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectChildrenOutput), !p.HasNextPage()) - } - return p.Err() +// ListObjectChildrenPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListObjectChildrenPager struct { + aws.Pager +} + +func (p *ListObjectChildrenPager) CurrentPage() *ListObjectChildrenOutput { + return p.Pager.CurrentPage().(*ListObjectChildrenOutput) } const opListObjectParentPaths = "ListObjectParentPaths" @@ -2578,6 +2583,7 @@ const opListObjectParentPaths = "ListObjectParentPaths" type ListObjectParentPathsRequest struct { *aws.Request Input *ListObjectParentPathsInput + Copy func(*ListObjectParentPathsInput) ListObjectParentPathsRequest } // Send marshals and sends the ListObjectParentPaths API request. @@ -2634,57 +2640,53 @@ func (c *CloudDirectory) ListObjectParentPathsRequest(input *ListObjectParentPat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListObjectParentPathsRequest{Request: req, Input: input} + return ListObjectParentPathsRequest{Request: req, Input: input, Copy: c.ListObjectParentPathsRequest} } -// ListObjectParentPathsPages iterates over the pages of a ListObjectParentPaths operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectParentPaths method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListObjectParentPathsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListObjectParentPaths operation. -// pageNum := 0 -// err := client.ListObjectParentPathsPages(params, -// func(page *ListObjectParentPathsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListObjectParentPathsPages(input *ListObjectParentPathsInput, fn func(*ListObjectParentPathsOutput, bool) bool) error { - return c.ListObjectParentPathsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectParentPathsPagesWithContext same as ListObjectParentPathsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListObjectParentPathsPagesWithContext(ctx aws.Context, input *ListObjectParentPathsInput, fn func(*ListObjectParentPathsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListObjectParentPathsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListObjectParentPathsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListObjectParentPathsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListObjectParentPathsRequest) Paginate(opts ...aws.Option) ListObjectParentPathsPager { + return ListObjectParentPathsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListObjectParentPathsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectParentPathsOutput), !p.HasNextPage()) - } - return p.Err() +// ListObjectParentPathsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListObjectParentPathsPager struct { + aws.Pager +} + +func (p *ListObjectParentPathsPager) CurrentPage() *ListObjectParentPathsOutput { + return p.Pager.CurrentPage().(*ListObjectParentPathsOutput) } const opListObjectParents = "ListObjectParents" @@ -2693,6 +2695,7 @@ const opListObjectParents = "ListObjectParents" type ListObjectParentsRequest struct { *aws.Request Input *ListObjectParentsInput + Copy func(*ListObjectParentsInput) ListObjectParentsRequest } // Send marshals and sends the ListObjectParents API request. @@ -2740,57 +2743,53 @@ func (c *CloudDirectory) ListObjectParentsRequest(input *ListObjectParentsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListObjectParentsRequest{Request: req, Input: input} + return ListObjectParentsRequest{Request: req, Input: input, Copy: c.ListObjectParentsRequest} } -// ListObjectParentsPages iterates over the pages of a ListObjectParents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectParents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListObjectParentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListObjectParents operation. -// pageNum := 0 -// err := client.ListObjectParentsPages(params, -// func(page *ListObjectParentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListObjectParentsPages(input *ListObjectParentsInput, fn func(*ListObjectParentsOutput, bool) bool) error { - return c.ListObjectParentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectParentsPagesWithContext same as ListObjectParentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListObjectParentsPagesWithContext(ctx aws.Context, input *ListObjectParentsInput, fn func(*ListObjectParentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListObjectParentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListObjectParentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListObjectParentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListObjectParentsRequest) Paginate(opts ...aws.Option) ListObjectParentsPager { + return ListObjectParentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListObjectParentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectParentsOutput), !p.HasNextPage()) - } - return p.Err() +// ListObjectParentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListObjectParentsPager struct { + aws.Pager +} + +func (p *ListObjectParentsPager) CurrentPage() *ListObjectParentsOutput { + return p.Pager.CurrentPage().(*ListObjectParentsOutput) } const opListObjectPolicies = "ListObjectPolicies" @@ -2799,6 +2798,7 @@ const opListObjectPolicies = "ListObjectPolicies" type ListObjectPoliciesRequest struct { *aws.Request Input *ListObjectPoliciesInput + Copy func(*ListObjectPoliciesInput) ListObjectPoliciesRequest } // Send marshals and sends the ListObjectPolicies API request. @@ -2845,57 +2845,53 @@ func (c *CloudDirectory) ListObjectPoliciesRequest(input *ListObjectPoliciesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListObjectPoliciesRequest{Request: req, Input: input} + return ListObjectPoliciesRequest{Request: req, Input: input, Copy: c.ListObjectPoliciesRequest} } -// ListObjectPoliciesPages iterates over the pages of a ListObjectPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectPolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListObjectPoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListObjectPolicies operation. -// pageNum := 0 -// err := client.ListObjectPoliciesPages(params, -// func(page *ListObjectPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListObjectPoliciesPages(input *ListObjectPoliciesInput, fn func(*ListObjectPoliciesOutput, bool) bool) error { - return c.ListObjectPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectPoliciesPagesWithContext same as ListObjectPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListObjectPoliciesPagesWithContext(ctx aws.Context, input *ListObjectPoliciesInput, fn func(*ListObjectPoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListObjectPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListObjectPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListObjectPoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListObjectPoliciesRequest) Paginate(opts ...aws.Option) ListObjectPoliciesPager { + return ListObjectPoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListObjectPoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectPoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListObjectPoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListObjectPoliciesPager struct { + aws.Pager +} + +func (p *ListObjectPoliciesPager) CurrentPage() *ListObjectPoliciesOutput { + return p.Pager.CurrentPage().(*ListObjectPoliciesOutput) } const opListOutgoingTypedLinks = "ListOutgoingTypedLinks" @@ -2904,6 +2900,7 @@ const opListOutgoingTypedLinks = "ListOutgoingTypedLinks" type ListOutgoingTypedLinksRequest struct { *aws.Request Input *ListOutgoingTypedLinksInput + Copy func(*ListOutgoingTypedLinksInput) ListOutgoingTypedLinksRequest } // Send marshals and sends the ListOutgoingTypedLinks API request. @@ -2946,7 +2943,7 @@ func (c *CloudDirectory) ListOutgoingTypedLinksRequest(input *ListOutgoingTypedL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOutgoingTypedLinksRequest{Request: req, Input: input} + return ListOutgoingTypedLinksRequest{Request: req, Input: input, Copy: c.ListOutgoingTypedLinksRequest} } const opListPolicyAttachments = "ListPolicyAttachments" @@ -2955,6 +2952,7 @@ const opListPolicyAttachments = "ListPolicyAttachments" type ListPolicyAttachmentsRequest struct { *aws.Request Input *ListPolicyAttachmentsInput + Copy func(*ListPolicyAttachmentsInput) ListPolicyAttachmentsRequest } // Send marshals and sends the ListPolicyAttachments API request. @@ -3001,57 +2999,53 @@ func (c *CloudDirectory) ListPolicyAttachmentsRequest(input *ListPolicyAttachmen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPolicyAttachmentsRequest{Request: req, Input: input} + return ListPolicyAttachmentsRequest{Request: req, Input: input, Copy: c.ListPolicyAttachmentsRequest} } -// ListPolicyAttachmentsPages iterates over the pages of a ListPolicyAttachments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicyAttachments method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPolicyAttachmentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPolicyAttachments operation. -// pageNum := 0 -// err := client.ListPolicyAttachmentsPages(params, -// func(page *ListPolicyAttachmentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListPolicyAttachmentsPages(input *ListPolicyAttachmentsInput, fn func(*ListPolicyAttachmentsOutput, bool) bool) error { - return c.ListPolicyAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPolicyAttachmentsPagesWithContext same as ListPolicyAttachmentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListPolicyAttachmentsPagesWithContext(ctx aws.Context, input *ListPolicyAttachmentsInput, fn func(*ListPolicyAttachmentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPolicyAttachmentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPolicyAttachmentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPolicyAttachmentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPolicyAttachmentsRequest) Paginate(opts ...aws.Option) ListPolicyAttachmentsPager { + return ListPolicyAttachmentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPolicyAttachmentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPolicyAttachmentsOutput), !p.HasNextPage()) - } - return p.Err() +// ListPolicyAttachmentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPolicyAttachmentsPager struct { + aws.Pager +} + +func (p *ListPolicyAttachmentsPager) CurrentPage() *ListPolicyAttachmentsOutput { + return p.Pager.CurrentPage().(*ListPolicyAttachmentsOutput) } const opListPublishedSchemaArns = "ListPublishedSchemaArns" @@ -3060,6 +3054,7 @@ const opListPublishedSchemaArns = "ListPublishedSchemaArns" type ListPublishedSchemaArnsRequest struct { *aws.Request Input *ListPublishedSchemaArnsInput + Copy func(*ListPublishedSchemaArnsInput) ListPublishedSchemaArnsRequest } // Send marshals and sends the ListPublishedSchemaArns API request. @@ -3107,57 +3102,53 @@ func (c *CloudDirectory) ListPublishedSchemaArnsRequest(input *ListPublishedSche req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPublishedSchemaArnsRequest{Request: req, Input: input} + return ListPublishedSchemaArnsRequest{Request: req, Input: input, Copy: c.ListPublishedSchemaArnsRequest} } -// ListPublishedSchemaArnsPages iterates over the pages of a ListPublishedSchemaArns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPublishedSchemaArns method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPublishedSchemaArnsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPublishedSchemaArns operation. -// pageNum := 0 -// err := client.ListPublishedSchemaArnsPages(params, -// func(page *ListPublishedSchemaArnsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListPublishedSchemaArnsPages(input *ListPublishedSchemaArnsInput, fn func(*ListPublishedSchemaArnsOutput, bool) bool) error { - return c.ListPublishedSchemaArnsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPublishedSchemaArnsPagesWithContext same as ListPublishedSchemaArnsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListPublishedSchemaArnsPagesWithContext(ctx aws.Context, input *ListPublishedSchemaArnsInput, fn func(*ListPublishedSchemaArnsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPublishedSchemaArnsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPublishedSchemaArnsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPublishedSchemaArnsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPublishedSchemaArnsRequest) Paginate(opts ...aws.Option) ListPublishedSchemaArnsPager { + return ListPublishedSchemaArnsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPublishedSchemaArnsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPublishedSchemaArnsOutput), !p.HasNextPage()) - } - return p.Err() +// ListPublishedSchemaArnsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPublishedSchemaArnsPager struct { + aws.Pager +} + +func (p *ListPublishedSchemaArnsPager) CurrentPage() *ListPublishedSchemaArnsOutput { + return p.Pager.CurrentPage().(*ListPublishedSchemaArnsOutput) } const opListTagsForResource = "ListTagsForResource" @@ -3166,6 +3157,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -3214,57 +3206,53 @@ func (c *CloudDirectory) ListTagsForResourceRequest(input *ListTagsForResourceIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } -// ListTagsForResourcePages iterates over the pages of a ListTagsForResource operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTagsForResource method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTagsForResourceRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTagsForResource operation. -// pageNum := 0 -// err := client.ListTagsForResourcePages(params, -// func(page *ListTagsForResourceOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListTagsForResourcePages(input *ListTagsForResourceInput, fn func(*ListTagsForResourceOutput, bool) bool) error { - return c.ListTagsForResourcePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTagsForResourcePagesWithContext same as ListTagsForResourcePages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListTagsForResourcePagesWithContext(ctx aws.Context, input *ListTagsForResourceInput, fn func(*ListTagsForResourceOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTagsForResourceInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTagsForResourceRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTagsForResourceRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTagsForResourceRequest) Paginate(opts ...aws.Option) ListTagsForResourcePager { + return ListTagsForResourcePager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTagsForResourceInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) - } - return p.Err() +// ListTagsForResourcePager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTagsForResourcePager struct { + aws.Pager +} + +func (p *ListTagsForResourcePager) CurrentPage() *ListTagsForResourceOutput { + return p.Pager.CurrentPage().(*ListTagsForResourceOutput) } const opListTypedLinkFacetAttributes = "ListTypedLinkFacetAttributes" @@ -3273,6 +3261,7 @@ const opListTypedLinkFacetAttributes = "ListTypedLinkFacetAttributes" type ListTypedLinkFacetAttributesRequest struct { *aws.Request Input *ListTypedLinkFacetAttributesInput + Copy func(*ListTypedLinkFacetAttributesInput) ListTypedLinkFacetAttributesRequest } // Send marshals and sends the ListTypedLinkFacetAttributes API request. @@ -3320,57 +3309,53 @@ func (c *CloudDirectory) ListTypedLinkFacetAttributesRequest(input *ListTypedLin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTypedLinkFacetAttributesRequest{Request: req, Input: input} + return ListTypedLinkFacetAttributesRequest{Request: req, Input: input, Copy: c.ListTypedLinkFacetAttributesRequest} } -// ListTypedLinkFacetAttributesPages iterates over the pages of a ListTypedLinkFacetAttributes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTypedLinkFacetAttributes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTypedLinkFacetAttributesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTypedLinkFacetAttributes operation. -// pageNum := 0 -// err := client.ListTypedLinkFacetAttributesPages(params, -// func(page *ListTypedLinkFacetAttributesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListTypedLinkFacetAttributesPages(input *ListTypedLinkFacetAttributesInput, fn func(*ListTypedLinkFacetAttributesOutput, bool) bool) error { - return c.ListTypedLinkFacetAttributesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTypedLinkFacetAttributesPagesWithContext same as ListTypedLinkFacetAttributesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListTypedLinkFacetAttributesPagesWithContext(ctx aws.Context, input *ListTypedLinkFacetAttributesInput, fn func(*ListTypedLinkFacetAttributesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTypedLinkFacetAttributesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTypedLinkFacetAttributesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTypedLinkFacetAttributesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTypedLinkFacetAttributesRequest) Paginate(opts ...aws.Option) ListTypedLinkFacetAttributesPager { + return ListTypedLinkFacetAttributesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTypedLinkFacetAttributesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTypedLinkFacetAttributesOutput), !p.HasNextPage()) - } - return p.Err() +// ListTypedLinkFacetAttributesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTypedLinkFacetAttributesPager struct { + aws.Pager +} + +func (p *ListTypedLinkFacetAttributesPager) CurrentPage() *ListTypedLinkFacetAttributesOutput { + return p.Pager.CurrentPage().(*ListTypedLinkFacetAttributesOutput) } const opListTypedLinkFacetNames = "ListTypedLinkFacetNames" @@ -3379,6 +3364,7 @@ const opListTypedLinkFacetNames = "ListTypedLinkFacetNames" type ListTypedLinkFacetNamesRequest struct { *aws.Request Input *ListTypedLinkFacetNamesInput + Copy func(*ListTypedLinkFacetNamesInput) ListTypedLinkFacetNamesRequest } // Send marshals and sends the ListTypedLinkFacetNames API request. @@ -3426,57 +3412,53 @@ func (c *CloudDirectory) ListTypedLinkFacetNamesRequest(input *ListTypedLinkFace req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTypedLinkFacetNamesRequest{Request: req, Input: input} + return ListTypedLinkFacetNamesRequest{Request: req, Input: input, Copy: c.ListTypedLinkFacetNamesRequest} } -// ListTypedLinkFacetNamesPages iterates over the pages of a ListTypedLinkFacetNames operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTypedLinkFacetNames method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTypedLinkFacetNamesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTypedLinkFacetNames operation. -// pageNum := 0 -// err := client.ListTypedLinkFacetNamesPages(params, -// func(page *ListTypedLinkFacetNamesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) ListTypedLinkFacetNamesPages(input *ListTypedLinkFacetNamesInput, fn func(*ListTypedLinkFacetNamesOutput, bool) bool) error { - return c.ListTypedLinkFacetNamesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTypedLinkFacetNamesPagesWithContext same as ListTypedLinkFacetNamesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) ListTypedLinkFacetNamesPagesWithContext(ctx aws.Context, input *ListTypedLinkFacetNamesInput, fn func(*ListTypedLinkFacetNamesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTypedLinkFacetNamesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTypedLinkFacetNamesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTypedLinkFacetNamesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTypedLinkFacetNamesRequest) Paginate(opts ...aws.Option) ListTypedLinkFacetNamesPager { + return ListTypedLinkFacetNamesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTypedLinkFacetNamesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTypedLinkFacetNamesOutput), !p.HasNextPage()) - } - return p.Err() +// ListTypedLinkFacetNamesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTypedLinkFacetNamesPager struct { + aws.Pager +} + +func (p *ListTypedLinkFacetNamesPager) CurrentPage() *ListTypedLinkFacetNamesOutput { + return p.Pager.CurrentPage().(*ListTypedLinkFacetNamesOutput) } const opLookupPolicy = "LookupPolicy" @@ -3485,6 +3467,7 @@ const opLookupPolicy = "LookupPolicy" type LookupPolicyRequest struct { *aws.Request Input *LookupPolicyInput + Copy func(*LookupPolicyInput) LookupPolicyRequest } // Send marshals and sends the LookupPolicy API request. @@ -3537,57 +3520,53 @@ func (c *CloudDirectory) LookupPolicyRequest(input *LookupPolicyInput) LookupPol req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return LookupPolicyRequest{Request: req, Input: input} + return LookupPolicyRequest{Request: req, Input: input, Copy: c.LookupPolicyRequest} } -// LookupPolicyPages iterates over the pages of a LookupPolicy operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See LookupPolicy method for more information on how to use this operation. +// Paginate pages iterates over the pages of a LookupPolicyRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a LookupPolicy operation. -// pageNum := 0 -// err := client.LookupPolicyPages(params, -// func(page *LookupPolicyOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudDirectory) LookupPolicyPages(input *LookupPolicyInput, fn func(*LookupPolicyOutput, bool) bool) error { - return c.LookupPolicyPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// LookupPolicyPagesWithContext same as LookupPolicyPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudDirectory) LookupPolicyPagesWithContext(ctx aws.Context, input *LookupPolicyInput, fn func(*LookupPolicyOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *LookupPolicyInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.LookupPolicyRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.LookupPolicyRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *LookupPolicyRequest) Paginate(opts ...aws.Option) LookupPolicyPager { + return LookupPolicyPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *LookupPolicyInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*LookupPolicyOutput), !p.HasNextPage()) - } - return p.Err() +// LookupPolicyPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type LookupPolicyPager struct { + aws.Pager +} + +func (p *LookupPolicyPager) CurrentPage() *LookupPolicyOutput { + return p.Pager.CurrentPage().(*LookupPolicyOutput) } const opPublishSchema = "PublishSchema" @@ -3596,6 +3575,7 @@ const opPublishSchema = "PublishSchema" type PublishSchemaRequest struct { *aws.Request Input *PublishSchemaInput + Copy func(*PublishSchemaInput) PublishSchemaRequest } // Send marshals and sends the PublishSchema API request. @@ -3637,7 +3617,7 @@ func (c *CloudDirectory) PublishSchemaRequest(input *PublishSchemaInput) Publish req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PublishSchemaRequest{Request: req, Input: input} + return PublishSchemaRequest{Request: req, Input: input, Copy: c.PublishSchemaRequest} } const opPutSchemaFromJson = "PutSchemaFromJson" @@ -3646,6 +3626,7 @@ const opPutSchemaFromJson = "PutSchemaFromJson" type PutSchemaFromJsonRequest struct { *aws.Request Input *PutSchemaFromJsonInput + Copy func(*PutSchemaFromJsonInput) PutSchemaFromJsonRequest } // Send marshals and sends the PutSchemaFromJson API request. @@ -3688,7 +3669,7 @@ func (c *CloudDirectory) PutSchemaFromJsonRequest(input *PutSchemaFromJsonInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutSchemaFromJsonRequest{Request: req, Input: input} + return PutSchemaFromJsonRequest{Request: req, Input: input, Copy: c.PutSchemaFromJsonRequest} } const opRemoveFacetFromObject = "RemoveFacetFromObject" @@ -3697,6 +3678,7 @@ const opRemoveFacetFromObject = "RemoveFacetFromObject" type RemoveFacetFromObjectRequest struct { *aws.Request Input *RemoveFacetFromObjectInput + Copy func(*RemoveFacetFromObjectInput) RemoveFacetFromObjectRequest } // Send marshals and sends the RemoveFacetFromObject API request. @@ -3737,7 +3719,7 @@ func (c *CloudDirectory) RemoveFacetFromObjectRequest(input *RemoveFacetFromObje req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveFacetFromObjectRequest{Request: req, Input: input} + return RemoveFacetFromObjectRequest{Request: req, Input: input, Copy: c.RemoveFacetFromObjectRequest} } const opTagResource = "TagResource" @@ -3746,6 +3728,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -3786,7 +3769,7 @@ func (c *CloudDirectory) TagResourceRequest(input *TagResourceInput) TagResource req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource" @@ -3795,6 +3778,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -3835,7 +3819,7 @@ func (c *CloudDirectory) UntagResourceRequest(input *UntagResourceInput) UntagRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateFacet = "UpdateFacet" @@ -3844,6 +3828,7 @@ const opUpdateFacet = "UpdateFacet" type UpdateFacetRequest struct { *aws.Request Input *UpdateFacetInput + Copy func(*UpdateFacetInput) UpdateFacetRequest } // Send marshals and sends the UpdateFacet API request. @@ -3890,7 +3875,7 @@ func (c *CloudDirectory) UpdateFacetRequest(input *UpdateFacetInput) UpdateFacet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateFacetRequest{Request: req, Input: input} + return UpdateFacetRequest{Request: req, Input: input, Copy: c.UpdateFacetRequest} } const opUpdateObjectAttributes = "UpdateObjectAttributes" @@ -3899,6 +3884,7 @@ const opUpdateObjectAttributes = "UpdateObjectAttributes" type UpdateObjectAttributesRequest struct { *aws.Request Input *UpdateObjectAttributesInput + Copy func(*UpdateObjectAttributesInput) UpdateObjectAttributesRequest } // Send marshals and sends the UpdateObjectAttributes API request. @@ -3939,7 +3925,7 @@ func (c *CloudDirectory) UpdateObjectAttributesRequest(input *UpdateObjectAttrib req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateObjectAttributesRequest{Request: req, Input: input} + return UpdateObjectAttributesRequest{Request: req, Input: input, Copy: c.UpdateObjectAttributesRequest} } const opUpdateSchema = "UpdateSchema" @@ -3948,6 +3934,7 @@ const opUpdateSchema = "UpdateSchema" type UpdateSchemaRequest struct { *aws.Request Input *UpdateSchemaInput + Copy func(*UpdateSchemaInput) UpdateSchemaRequest } // Send marshals and sends the UpdateSchema API request. @@ -3989,7 +3976,7 @@ func (c *CloudDirectory) UpdateSchemaRequest(input *UpdateSchemaInput) UpdateSch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSchemaRequest{Request: req, Input: input} + return UpdateSchemaRequest{Request: req, Input: input, Copy: c.UpdateSchemaRequest} } const opUpdateTypedLinkFacet = "UpdateTypedLinkFacet" @@ -3998,6 +3985,7 @@ const opUpdateTypedLinkFacet = "UpdateTypedLinkFacet" type UpdateTypedLinkFacetRequest struct { *aws.Request Input *UpdateTypedLinkFacetInput + Copy func(*UpdateTypedLinkFacetInput) UpdateTypedLinkFacetRequest } // Send marshals and sends the UpdateTypedLinkFacet API request. @@ -4038,7 +4026,7 @@ func (c *CloudDirectory) UpdateTypedLinkFacetRequest(input *UpdateTypedLinkFacet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTypedLinkFacetRequest{Request: req, Input: input} + return UpdateTypedLinkFacetRequest{Request: req, Input: input, Copy: c.UpdateTypedLinkFacetRequest} } const opUpgradeAppliedSchema = "UpgradeAppliedSchema" @@ -4047,6 +4035,7 @@ const opUpgradeAppliedSchema = "UpgradeAppliedSchema" type UpgradeAppliedSchemaRequest struct { *aws.Request Input *UpgradeAppliedSchemaInput + Copy func(*UpgradeAppliedSchemaInput) UpgradeAppliedSchemaRequest } // Send marshals and sends the UpgradeAppliedSchema API request. @@ -4092,7 +4081,7 @@ func (c *CloudDirectory) UpgradeAppliedSchemaRequest(input *UpgradeAppliedSchema req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpgradeAppliedSchemaRequest{Request: req, Input: input} + return UpgradeAppliedSchemaRequest{Request: req, Input: input, Copy: c.UpgradeAppliedSchemaRequest} } const opUpgradePublishedSchema = "UpgradePublishedSchema" @@ -4101,6 +4090,7 @@ const opUpgradePublishedSchema = "UpgradePublishedSchema" type UpgradePublishedSchemaRequest struct { *aws.Request Input *UpgradePublishedSchemaInput + Copy func(*UpgradePublishedSchemaInput) UpgradePublishedSchemaRequest } // Send marshals and sends the UpgradePublishedSchema API request. @@ -4142,7 +4132,7 @@ func (c *CloudDirectory) UpgradePublishedSchemaRequest(input *UpgradePublishedSc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpgradePublishedSchemaRequest{Request: req, Input: input} + return UpgradePublishedSchemaRequest{Request: req, Input: input, Copy: c.UpgradePublishedSchemaRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/clouddirectory-2016-05-10/AddFacetToObjectRequest diff --git a/service/clouddirectory/clouddirectoryiface/interface.go b/service/clouddirectory/clouddirectoryiface/interface.go index 37c5f31236b..0f3dd2e173a 100644 --- a/service/clouddirectory/clouddirectoryiface/interface.go +++ b/service/clouddirectory/clouddirectoryiface/interface.go @@ -9,7 +9,6 @@ package clouddirectoryiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/clouddirectory" ) @@ -127,98 +126,44 @@ type CloudDirectoryAPI interface { ListAppliedSchemaArnsRequest(*clouddirectory.ListAppliedSchemaArnsInput) clouddirectory.ListAppliedSchemaArnsRequest - ListAppliedSchemaArnsPages(*clouddirectory.ListAppliedSchemaArnsInput, func(*clouddirectory.ListAppliedSchemaArnsOutput, bool) bool) error - ListAppliedSchemaArnsPagesWithContext(aws.Context, *clouddirectory.ListAppliedSchemaArnsInput, func(*clouddirectory.ListAppliedSchemaArnsOutput, bool) bool, ...aws.Option) error - ListAttachedIndicesRequest(*clouddirectory.ListAttachedIndicesInput) clouddirectory.ListAttachedIndicesRequest - ListAttachedIndicesPages(*clouddirectory.ListAttachedIndicesInput, func(*clouddirectory.ListAttachedIndicesOutput, bool) bool) error - ListAttachedIndicesPagesWithContext(aws.Context, *clouddirectory.ListAttachedIndicesInput, func(*clouddirectory.ListAttachedIndicesOutput, bool) bool, ...aws.Option) error - ListDevelopmentSchemaArnsRequest(*clouddirectory.ListDevelopmentSchemaArnsInput) clouddirectory.ListDevelopmentSchemaArnsRequest - ListDevelopmentSchemaArnsPages(*clouddirectory.ListDevelopmentSchemaArnsInput, func(*clouddirectory.ListDevelopmentSchemaArnsOutput, bool) bool) error - ListDevelopmentSchemaArnsPagesWithContext(aws.Context, *clouddirectory.ListDevelopmentSchemaArnsInput, func(*clouddirectory.ListDevelopmentSchemaArnsOutput, bool) bool, ...aws.Option) error - ListDirectoriesRequest(*clouddirectory.ListDirectoriesInput) clouddirectory.ListDirectoriesRequest - ListDirectoriesPages(*clouddirectory.ListDirectoriesInput, func(*clouddirectory.ListDirectoriesOutput, bool) bool) error - ListDirectoriesPagesWithContext(aws.Context, *clouddirectory.ListDirectoriesInput, func(*clouddirectory.ListDirectoriesOutput, bool) bool, ...aws.Option) error - ListFacetAttributesRequest(*clouddirectory.ListFacetAttributesInput) clouddirectory.ListFacetAttributesRequest - ListFacetAttributesPages(*clouddirectory.ListFacetAttributesInput, func(*clouddirectory.ListFacetAttributesOutput, bool) bool) error - ListFacetAttributesPagesWithContext(aws.Context, *clouddirectory.ListFacetAttributesInput, func(*clouddirectory.ListFacetAttributesOutput, bool) bool, ...aws.Option) error - ListFacetNamesRequest(*clouddirectory.ListFacetNamesInput) clouddirectory.ListFacetNamesRequest - ListFacetNamesPages(*clouddirectory.ListFacetNamesInput, func(*clouddirectory.ListFacetNamesOutput, bool) bool) error - ListFacetNamesPagesWithContext(aws.Context, *clouddirectory.ListFacetNamesInput, func(*clouddirectory.ListFacetNamesOutput, bool) bool, ...aws.Option) error - ListIncomingTypedLinksRequest(*clouddirectory.ListIncomingTypedLinksInput) clouddirectory.ListIncomingTypedLinksRequest ListIndexRequest(*clouddirectory.ListIndexInput) clouddirectory.ListIndexRequest - ListIndexPages(*clouddirectory.ListIndexInput, func(*clouddirectory.ListIndexOutput, bool) bool) error - ListIndexPagesWithContext(aws.Context, *clouddirectory.ListIndexInput, func(*clouddirectory.ListIndexOutput, bool) bool, ...aws.Option) error - ListObjectAttributesRequest(*clouddirectory.ListObjectAttributesInput) clouddirectory.ListObjectAttributesRequest - ListObjectAttributesPages(*clouddirectory.ListObjectAttributesInput, func(*clouddirectory.ListObjectAttributesOutput, bool) bool) error - ListObjectAttributesPagesWithContext(aws.Context, *clouddirectory.ListObjectAttributesInput, func(*clouddirectory.ListObjectAttributesOutput, bool) bool, ...aws.Option) error - ListObjectChildrenRequest(*clouddirectory.ListObjectChildrenInput) clouddirectory.ListObjectChildrenRequest - ListObjectChildrenPages(*clouddirectory.ListObjectChildrenInput, func(*clouddirectory.ListObjectChildrenOutput, bool) bool) error - ListObjectChildrenPagesWithContext(aws.Context, *clouddirectory.ListObjectChildrenInput, func(*clouddirectory.ListObjectChildrenOutput, bool) bool, ...aws.Option) error - ListObjectParentPathsRequest(*clouddirectory.ListObjectParentPathsInput) clouddirectory.ListObjectParentPathsRequest - ListObjectParentPathsPages(*clouddirectory.ListObjectParentPathsInput, func(*clouddirectory.ListObjectParentPathsOutput, bool) bool) error - ListObjectParentPathsPagesWithContext(aws.Context, *clouddirectory.ListObjectParentPathsInput, func(*clouddirectory.ListObjectParentPathsOutput, bool) bool, ...aws.Option) error - ListObjectParentsRequest(*clouddirectory.ListObjectParentsInput) clouddirectory.ListObjectParentsRequest - ListObjectParentsPages(*clouddirectory.ListObjectParentsInput, func(*clouddirectory.ListObjectParentsOutput, bool) bool) error - ListObjectParentsPagesWithContext(aws.Context, *clouddirectory.ListObjectParentsInput, func(*clouddirectory.ListObjectParentsOutput, bool) bool, ...aws.Option) error - ListObjectPoliciesRequest(*clouddirectory.ListObjectPoliciesInput) clouddirectory.ListObjectPoliciesRequest - ListObjectPoliciesPages(*clouddirectory.ListObjectPoliciesInput, func(*clouddirectory.ListObjectPoliciesOutput, bool) bool) error - ListObjectPoliciesPagesWithContext(aws.Context, *clouddirectory.ListObjectPoliciesInput, func(*clouddirectory.ListObjectPoliciesOutput, bool) bool, ...aws.Option) error - ListOutgoingTypedLinksRequest(*clouddirectory.ListOutgoingTypedLinksInput) clouddirectory.ListOutgoingTypedLinksRequest ListPolicyAttachmentsRequest(*clouddirectory.ListPolicyAttachmentsInput) clouddirectory.ListPolicyAttachmentsRequest - ListPolicyAttachmentsPages(*clouddirectory.ListPolicyAttachmentsInput, func(*clouddirectory.ListPolicyAttachmentsOutput, bool) bool) error - ListPolicyAttachmentsPagesWithContext(aws.Context, *clouddirectory.ListPolicyAttachmentsInput, func(*clouddirectory.ListPolicyAttachmentsOutput, bool) bool, ...aws.Option) error - ListPublishedSchemaArnsRequest(*clouddirectory.ListPublishedSchemaArnsInput) clouddirectory.ListPublishedSchemaArnsRequest - ListPublishedSchemaArnsPages(*clouddirectory.ListPublishedSchemaArnsInput, func(*clouddirectory.ListPublishedSchemaArnsOutput, bool) bool) error - ListPublishedSchemaArnsPagesWithContext(aws.Context, *clouddirectory.ListPublishedSchemaArnsInput, func(*clouddirectory.ListPublishedSchemaArnsOutput, bool) bool, ...aws.Option) error - ListTagsForResourceRequest(*clouddirectory.ListTagsForResourceInput) clouddirectory.ListTagsForResourceRequest - ListTagsForResourcePages(*clouddirectory.ListTagsForResourceInput, func(*clouddirectory.ListTagsForResourceOutput, bool) bool) error - ListTagsForResourcePagesWithContext(aws.Context, *clouddirectory.ListTagsForResourceInput, func(*clouddirectory.ListTagsForResourceOutput, bool) bool, ...aws.Option) error - ListTypedLinkFacetAttributesRequest(*clouddirectory.ListTypedLinkFacetAttributesInput) clouddirectory.ListTypedLinkFacetAttributesRequest - ListTypedLinkFacetAttributesPages(*clouddirectory.ListTypedLinkFacetAttributesInput, func(*clouddirectory.ListTypedLinkFacetAttributesOutput, bool) bool) error - ListTypedLinkFacetAttributesPagesWithContext(aws.Context, *clouddirectory.ListTypedLinkFacetAttributesInput, func(*clouddirectory.ListTypedLinkFacetAttributesOutput, bool) bool, ...aws.Option) error - ListTypedLinkFacetNamesRequest(*clouddirectory.ListTypedLinkFacetNamesInput) clouddirectory.ListTypedLinkFacetNamesRequest - ListTypedLinkFacetNamesPages(*clouddirectory.ListTypedLinkFacetNamesInput, func(*clouddirectory.ListTypedLinkFacetNamesOutput, bool) bool) error - ListTypedLinkFacetNamesPagesWithContext(aws.Context, *clouddirectory.ListTypedLinkFacetNamesInput, func(*clouddirectory.ListTypedLinkFacetNamesOutput, bool) bool, ...aws.Option) error - LookupPolicyRequest(*clouddirectory.LookupPolicyInput) clouddirectory.LookupPolicyRequest - LookupPolicyPages(*clouddirectory.LookupPolicyInput, func(*clouddirectory.LookupPolicyOutput, bool) bool) error - LookupPolicyPagesWithContext(aws.Context, *clouddirectory.LookupPolicyInput, func(*clouddirectory.LookupPolicyOutput, bool) bool, ...aws.Option) error - PublishSchemaRequest(*clouddirectory.PublishSchemaInput) clouddirectory.PublishSchemaRequest PutSchemaFromJsonRequest(*clouddirectory.PutSchemaFromJsonInput) clouddirectory.PutSchemaFromJsonRequest diff --git a/service/cloudformation/api.go b/service/cloudformation/api.go index 0f056812b3d..aa6c188599d 100644 --- a/service/cloudformation/api.go +++ b/service/cloudformation/api.go @@ -18,6 +18,7 @@ const opCancelUpdateStack = "CancelUpdateStack" type CancelUpdateStackRequest struct { *aws.Request Input *CancelUpdateStackInput + Copy func(*CancelUpdateStackInput) CancelUpdateStackRequest } // Send marshals and sends the CancelUpdateStack API request. @@ -63,7 +64,7 @@ func (c *CloudFormation) CancelUpdateStackRequest(input *CancelUpdateStackInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CancelUpdateStackRequest{Request: req, Input: input} + return CancelUpdateStackRequest{Request: req, Input: input, Copy: c.CancelUpdateStackRequest} } const opContinueUpdateRollback = "ContinueUpdateRollback" @@ -72,6 +73,7 @@ const opContinueUpdateRollback = "ContinueUpdateRollback" type ContinueUpdateRollbackRequest struct { *aws.Request Input *ContinueUpdateRollbackInput + Copy func(*ContinueUpdateRollbackInput) ContinueUpdateRollbackRequest } // Send marshals and sends the ContinueUpdateRollback API request. @@ -124,7 +126,7 @@ func (c *CloudFormation) ContinueUpdateRollbackRequest(input *ContinueUpdateRoll req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ContinueUpdateRollbackRequest{Request: req, Input: input} + return ContinueUpdateRollbackRequest{Request: req, Input: input, Copy: c.ContinueUpdateRollbackRequest} } const opCreateChangeSet = "CreateChangeSet" @@ -133,6 +135,7 @@ const opCreateChangeSet = "CreateChangeSet" type CreateChangeSetRequest struct { *aws.Request Input *CreateChangeSetInput + Copy func(*CreateChangeSetInput) CreateChangeSetRequest } // Send marshals and sends the CreateChangeSet API request. @@ -193,7 +196,7 @@ func (c *CloudFormation) CreateChangeSetRequest(input *CreateChangeSetInput) Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateChangeSetRequest{Request: req, Input: input} + return CreateChangeSetRequest{Request: req, Input: input, Copy: c.CreateChangeSetRequest} } const opCreateStack = "CreateStack" @@ -202,6 +205,7 @@ const opCreateStack = "CreateStack" type CreateStackRequest struct { *aws.Request Input *CreateStackInput + Copy func(*CreateStackInput) CreateStackRequest } // Send marshals and sends the CreateStack API request. @@ -244,7 +248,7 @@ func (c *CloudFormation) CreateStackRequest(input *CreateStackInput) CreateStack req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStackRequest{Request: req, Input: input} + return CreateStackRequest{Request: req, Input: input, Copy: c.CreateStackRequest} } const opCreateStackInstances = "CreateStackInstances" @@ -253,6 +257,7 @@ const opCreateStackInstances = "CreateStackInstances" type CreateStackInstancesRequest struct { *aws.Request Input *CreateStackInstancesInput + Copy func(*CreateStackInstancesInput) CreateStackInstancesRequest } // Send marshals and sends the CreateStackInstances API request. @@ -296,7 +301,7 @@ func (c *CloudFormation) CreateStackInstancesRequest(input *CreateStackInstances req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStackInstancesRequest{Request: req, Input: input} + return CreateStackInstancesRequest{Request: req, Input: input, Copy: c.CreateStackInstancesRequest} } const opCreateStackSet = "CreateStackSet" @@ -305,6 +310,7 @@ const opCreateStackSet = "CreateStackSet" type CreateStackSetRequest struct { *aws.Request Input *CreateStackSetInput + Copy func(*CreateStackSetInput) CreateStackSetRequest } // Send marshals and sends the CreateStackSet API request. @@ -345,7 +351,7 @@ func (c *CloudFormation) CreateStackSetRequest(input *CreateStackSetInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStackSetRequest{Request: req, Input: input} + return CreateStackSetRequest{Request: req, Input: input, Copy: c.CreateStackSetRequest} } const opDeleteChangeSet = "DeleteChangeSet" @@ -354,6 +360,7 @@ const opDeleteChangeSet = "DeleteChangeSet" type DeleteChangeSetRequest struct { *aws.Request Input *DeleteChangeSetInput + Copy func(*DeleteChangeSetInput) DeleteChangeSetRequest } // Send marshals and sends the DeleteChangeSet API request. @@ -398,7 +405,7 @@ func (c *CloudFormation) DeleteChangeSetRequest(input *DeleteChangeSetInput) Del req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteChangeSetRequest{Request: req, Input: input} + return DeleteChangeSetRequest{Request: req, Input: input, Copy: c.DeleteChangeSetRequest} } const opDeleteStack = "DeleteStack" @@ -407,6 +414,7 @@ const opDeleteStack = "DeleteStack" type DeleteStackRequest struct { *aws.Request Input *DeleteStackInput + Copy func(*DeleteStackInput) DeleteStackRequest } // Send marshals and sends the DeleteStack API request. @@ -451,7 +459,7 @@ func (c *CloudFormation) DeleteStackRequest(input *DeleteStackInput) DeleteStack req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteStackRequest{Request: req, Input: input} + return DeleteStackRequest{Request: req, Input: input, Copy: c.DeleteStackRequest} } const opDeleteStackInstances = "DeleteStackInstances" @@ -460,6 +468,7 @@ const opDeleteStackInstances = "DeleteStackInstances" type DeleteStackInstancesRequest struct { *aws.Request Input *DeleteStackInstancesInput + Copy func(*DeleteStackInstancesInput) DeleteStackInstancesRequest } // Send marshals and sends the DeleteStackInstances API request. @@ -500,7 +509,7 @@ func (c *CloudFormation) DeleteStackInstancesRequest(input *DeleteStackInstances req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteStackInstancesRequest{Request: req, Input: input} + return DeleteStackInstancesRequest{Request: req, Input: input, Copy: c.DeleteStackInstancesRequest} } const opDeleteStackSet = "DeleteStackSet" @@ -509,6 +518,7 @@ const opDeleteStackSet = "DeleteStackSet" type DeleteStackSetRequest struct { *aws.Request Input *DeleteStackSetInput + Copy func(*DeleteStackSetInput) DeleteStackSetRequest } // Send marshals and sends the DeleteStackSet API request. @@ -551,7 +561,7 @@ func (c *CloudFormation) DeleteStackSetRequest(input *DeleteStackSetInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteStackSetRequest{Request: req, Input: input} + return DeleteStackSetRequest{Request: req, Input: input, Copy: c.DeleteStackSetRequest} } const opDescribeAccountLimits = "DescribeAccountLimits" @@ -560,6 +570,7 @@ const opDescribeAccountLimits = "DescribeAccountLimits" type DescribeAccountLimitsRequest struct { *aws.Request Input *DescribeAccountLimitsInput + Copy func(*DescribeAccountLimitsInput) DescribeAccountLimitsRequest } // Send marshals and sends the DescribeAccountLimits API request. @@ -601,7 +612,7 @@ func (c *CloudFormation) DescribeAccountLimitsRequest(input *DescribeAccountLimi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAccountLimitsRequest{Request: req, Input: input} + return DescribeAccountLimitsRequest{Request: req, Input: input, Copy: c.DescribeAccountLimitsRequest} } const opDescribeChangeSet = "DescribeChangeSet" @@ -610,6 +621,7 @@ const opDescribeChangeSet = "DescribeChangeSet" type DescribeChangeSetRequest struct { *aws.Request Input *DescribeChangeSetInput + Copy func(*DescribeChangeSetInput) DescribeChangeSetRequest } // Send marshals and sends the DescribeChangeSet API request. @@ -653,7 +665,7 @@ func (c *CloudFormation) DescribeChangeSetRequest(input *DescribeChangeSetInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeChangeSetRequest{Request: req, Input: input} + return DescribeChangeSetRequest{Request: req, Input: input, Copy: c.DescribeChangeSetRequest} } const opDescribeStackEvents = "DescribeStackEvents" @@ -662,6 +674,7 @@ const opDescribeStackEvents = "DescribeStackEvents" type DescribeStackEventsRequest struct { *aws.Request Input *DescribeStackEventsInput + Copy func(*DescribeStackEventsInput) DescribeStackEventsRequest } // Send marshals and sends the DescribeStackEvents API request. @@ -713,57 +726,53 @@ func (c *CloudFormation) DescribeStackEventsRequest(input *DescribeStackEventsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStackEventsRequest{Request: req, Input: input} + return DescribeStackEventsRequest{Request: req, Input: input, Copy: c.DescribeStackEventsRequest} } -// DescribeStackEventsPages iterates over the pages of a DescribeStackEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeStackEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeStackEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeStackEvents operation. -// pageNum := 0 -// err := client.DescribeStackEventsPages(params, -// func(page *DescribeStackEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) DescribeStackEventsPages(input *DescribeStackEventsInput, fn func(*DescribeStackEventsOutput, bool) bool) error { - return c.DescribeStackEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeStackEventsPagesWithContext same as DescribeStackEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFormation) DescribeStackEventsPagesWithContext(ctx aws.Context, input *DescribeStackEventsInput, fn func(*DescribeStackEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeStackEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeStackEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeStackEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeStackEventsRequest) Paginate(opts ...aws.Option) DescribeStackEventsPager { + return DescribeStackEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeStackEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStackEventsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeStackEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeStackEventsPager struct { + aws.Pager +} + +func (p *DescribeStackEventsPager) CurrentPage() *DescribeStackEventsOutput { + return p.Pager.CurrentPage().(*DescribeStackEventsOutput) } const opDescribeStackInstance = "DescribeStackInstance" @@ -772,6 +781,7 @@ const opDescribeStackInstance = "DescribeStackInstance" type DescribeStackInstanceRequest struct { *aws.Request Input *DescribeStackInstanceInput + Copy func(*DescribeStackInstanceInput) DescribeStackInstanceRequest } // Send marshals and sends the DescribeStackInstance API request. @@ -816,7 +826,7 @@ func (c *CloudFormation) DescribeStackInstanceRequest(input *DescribeStackInstan req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStackInstanceRequest{Request: req, Input: input} + return DescribeStackInstanceRequest{Request: req, Input: input, Copy: c.DescribeStackInstanceRequest} } const opDescribeStackResource = "DescribeStackResource" @@ -825,6 +835,7 @@ const opDescribeStackResource = "DescribeStackResource" type DescribeStackResourceRequest struct { *aws.Request Input *DescribeStackResourceInput + Copy func(*DescribeStackResourceInput) DescribeStackResourceRequest } // Send marshals and sends the DescribeStackResource API request. @@ -868,7 +879,7 @@ func (c *CloudFormation) DescribeStackResourceRequest(input *DescribeStackResour req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStackResourceRequest{Request: req, Input: input} + return DescribeStackResourceRequest{Request: req, Input: input, Copy: c.DescribeStackResourceRequest} } const opDescribeStackResources = "DescribeStackResources" @@ -877,6 +888,7 @@ const opDescribeStackResources = "DescribeStackResources" type DescribeStackResourcesRequest struct { *aws.Request Input *DescribeStackResourcesInput + Copy func(*DescribeStackResourcesInput) DescribeStackResourcesRequest } // Send marshals and sends the DescribeStackResources API request. @@ -934,7 +946,7 @@ func (c *CloudFormation) DescribeStackResourcesRequest(input *DescribeStackResou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStackResourcesRequest{Request: req, Input: input} + return DescribeStackResourcesRequest{Request: req, Input: input, Copy: c.DescribeStackResourcesRequest} } const opDescribeStackSet = "DescribeStackSet" @@ -943,6 +955,7 @@ const opDescribeStackSet = "DescribeStackSet" type DescribeStackSetRequest struct { *aws.Request Input *DescribeStackSetInput + Copy func(*DescribeStackSetInput) DescribeStackSetRequest } // Send marshals and sends the DescribeStackSet API request. @@ -983,7 +996,7 @@ func (c *CloudFormation) DescribeStackSetRequest(input *DescribeStackSetInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStackSetRequest{Request: req, Input: input} + return DescribeStackSetRequest{Request: req, Input: input, Copy: c.DescribeStackSetRequest} } const opDescribeStackSetOperation = "DescribeStackSetOperation" @@ -992,6 +1005,7 @@ const opDescribeStackSetOperation = "DescribeStackSetOperation" type DescribeStackSetOperationRequest struct { *aws.Request Input *DescribeStackSetOperationInput + Copy func(*DescribeStackSetOperationInput) DescribeStackSetOperationRequest } // Send marshals and sends the DescribeStackSetOperation API request. @@ -1032,7 +1046,7 @@ func (c *CloudFormation) DescribeStackSetOperationRequest(input *DescribeStackSe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStackSetOperationRequest{Request: req, Input: input} + return DescribeStackSetOperationRequest{Request: req, Input: input, Copy: c.DescribeStackSetOperationRequest} } const opDescribeStacks = "DescribeStacks" @@ -1041,6 +1055,7 @@ const opDescribeStacks = "DescribeStacks" type DescribeStacksRequest struct { *aws.Request Input *DescribeStacksInput + Copy func(*DescribeStacksInput) DescribeStacksRequest } // Send marshals and sends the DescribeStacks API request. @@ -1090,57 +1105,53 @@ func (c *CloudFormation) DescribeStacksRequest(input *DescribeStacksInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStacksRequest{Request: req, Input: input} + return DescribeStacksRequest{Request: req, Input: input, Copy: c.DescribeStacksRequest} } -// DescribeStacksPages iterates over the pages of a DescribeStacks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeStacks method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeStacksRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeStacks operation. -// pageNum := 0 -// err := client.DescribeStacksPages(params, -// func(page *DescribeStacksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) DescribeStacksPages(input *DescribeStacksInput, fn func(*DescribeStacksOutput, bool) bool) error { - return c.DescribeStacksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeStacksPagesWithContext same as DescribeStacksPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFormation) DescribeStacksPagesWithContext(ctx aws.Context, input *DescribeStacksInput, fn func(*DescribeStacksOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeStacksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeStacksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeStacksRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeStacksRequest) Paginate(opts ...aws.Option) DescribeStacksPager { + return DescribeStacksPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeStacksInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStacksOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeStacksPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeStacksPager struct { + aws.Pager +} + +func (p *DescribeStacksPager) CurrentPage() *DescribeStacksOutput { + return p.Pager.CurrentPage().(*DescribeStacksOutput) } const opEstimateTemplateCost = "EstimateTemplateCost" @@ -1149,6 +1160,7 @@ const opEstimateTemplateCost = "EstimateTemplateCost" type EstimateTemplateCostRequest struct { *aws.Request Input *EstimateTemplateCostInput + Copy func(*EstimateTemplateCostInput) EstimateTemplateCostRequest } // Send marshals and sends the EstimateTemplateCost API request. @@ -1191,7 +1203,7 @@ func (c *CloudFormation) EstimateTemplateCostRequest(input *EstimateTemplateCost req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EstimateTemplateCostRequest{Request: req, Input: input} + return EstimateTemplateCostRequest{Request: req, Input: input, Copy: c.EstimateTemplateCostRequest} } const opExecuteChangeSet = "ExecuteChangeSet" @@ -1200,6 +1212,7 @@ const opExecuteChangeSet = "ExecuteChangeSet" type ExecuteChangeSetRequest struct { *aws.Request Input *ExecuteChangeSetInput + Copy func(*ExecuteChangeSetInput) ExecuteChangeSetRequest } // Send marshals and sends the ExecuteChangeSet API request. @@ -1251,7 +1264,7 @@ func (c *CloudFormation) ExecuteChangeSetRequest(input *ExecuteChangeSetInput) E req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ExecuteChangeSetRequest{Request: req, Input: input} + return ExecuteChangeSetRequest{Request: req, Input: input, Copy: c.ExecuteChangeSetRequest} } const opGetStackPolicy = "GetStackPolicy" @@ -1260,6 +1273,7 @@ const opGetStackPolicy = "GetStackPolicy" type GetStackPolicyRequest struct { *aws.Request Input *GetStackPolicyInput + Copy func(*GetStackPolicyInput) GetStackPolicyRequest } // Send marshals and sends the GetStackPolicy API request. @@ -1301,7 +1315,7 @@ func (c *CloudFormation) GetStackPolicyRequest(input *GetStackPolicyInput) GetSt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetStackPolicyRequest{Request: req, Input: input} + return GetStackPolicyRequest{Request: req, Input: input, Copy: c.GetStackPolicyRequest} } const opGetTemplate = "GetTemplate" @@ -1310,6 +1324,7 @@ const opGetTemplate = "GetTemplate" type GetTemplateRequest struct { *aws.Request Input *GetTemplateInput + Copy func(*GetTemplateInput) GetTemplateRequest } // Send marshals and sends the GetTemplate API request. @@ -1356,7 +1371,7 @@ func (c *CloudFormation) GetTemplateRequest(input *GetTemplateInput) GetTemplate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTemplateRequest{Request: req, Input: input} + return GetTemplateRequest{Request: req, Input: input, Copy: c.GetTemplateRequest} } const opGetTemplateSummary = "GetTemplateSummary" @@ -1365,6 +1380,7 @@ const opGetTemplateSummary = "GetTemplateSummary" type GetTemplateSummaryRequest struct { *aws.Request Input *GetTemplateSummaryInput + Copy func(*GetTemplateSummaryInput) GetTemplateSummaryRequest } // Send marshals and sends the GetTemplateSummary API request. @@ -1416,7 +1432,7 @@ func (c *CloudFormation) GetTemplateSummaryRequest(input *GetTemplateSummaryInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTemplateSummaryRequest{Request: req, Input: input} + return GetTemplateSummaryRequest{Request: req, Input: input, Copy: c.GetTemplateSummaryRequest} } const opListChangeSets = "ListChangeSets" @@ -1425,6 +1441,7 @@ const opListChangeSets = "ListChangeSets" type ListChangeSetsRequest struct { *aws.Request Input *ListChangeSetsInput + Copy func(*ListChangeSetsInput) ListChangeSetsRequest } // Send marshals and sends the ListChangeSets API request. @@ -1467,7 +1484,7 @@ func (c *CloudFormation) ListChangeSetsRequest(input *ListChangeSetsInput) ListC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListChangeSetsRequest{Request: req, Input: input} + return ListChangeSetsRequest{Request: req, Input: input, Copy: c.ListChangeSetsRequest} } const opListExports = "ListExports" @@ -1476,6 +1493,7 @@ const opListExports = "ListExports" type ListExportsRequest struct { *aws.Request Input *ListExportsInput + Copy func(*ListExportsInput) ListExportsRequest } // Send marshals and sends the ListExports API request. @@ -1528,57 +1546,53 @@ func (c *CloudFormation) ListExportsRequest(input *ListExportsInput) ListExports req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListExportsRequest{Request: req, Input: input} + return ListExportsRequest{Request: req, Input: input, Copy: c.ListExportsRequest} } -// ListExportsPages iterates over the pages of a ListExports operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListExports method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListExportsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListExports operation. -// pageNum := 0 -// err := client.ListExportsPages(params, -// func(page *ListExportsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) ListExportsPages(input *ListExportsInput, fn func(*ListExportsOutput, bool) bool) error { - return c.ListExportsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListExportsPagesWithContext same as ListExportsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFormation) ListExportsPagesWithContext(ctx aws.Context, input *ListExportsInput, fn func(*ListExportsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListExportsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListExportsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListExportsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListExportsRequest) Paginate(opts ...aws.Option) ListExportsPager { + return ListExportsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListExportsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListExportsOutput), !p.HasNextPage()) - } - return p.Err() +// ListExportsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListExportsPager struct { + aws.Pager +} + +func (p *ListExportsPager) CurrentPage() *ListExportsOutput { + return p.Pager.CurrentPage().(*ListExportsOutput) } const opListImports = "ListImports" @@ -1587,6 +1601,7 @@ const opListImports = "ListImports" type ListImportsRequest struct { *aws.Request Input *ListImportsInput + Copy func(*ListImportsInput) ListImportsRequest } // Send marshals and sends the ListImports API request. @@ -1639,57 +1654,53 @@ func (c *CloudFormation) ListImportsRequest(input *ListImportsInput) ListImports req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListImportsRequest{Request: req, Input: input} + return ListImportsRequest{Request: req, Input: input, Copy: c.ListImportsRequest} } -// ListImportsPages iterates over the pages of a ListImports operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListImports method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListImportsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListImports operation. -// pageNum := 0 -// err := client.ListImportsPages(params, -// func(page *ListImportsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) ListImportsPages(input *ListImportsInput, fn func(*ListImportsOutput, bool) bool) error { - return c.ListImportsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListImportsPagesWithContext same as ListImportsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFormation) ListImportsPagesWithContext(ctx aws.Context, input *ListImportsInput, fn func(*ListImportsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListImportsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListImportsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListImportsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListImportsRequest) Paginate(opts ...aws.Option) ListImportsPager { + return ListImportsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListImportsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListImportsOutput), !p.HasNextPage()) - } - return p.Err() +// ListImportsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListImportsPager struct { + aws.Pager +} + +func (p *ListImportsPager) CurrentPage() *ListImportsOutput { + return p.Pager.CurrentPage().(*ListImportsOutput) } const opListStackInstances = "ListStackInstances" @@ -1698,6 +1709,7 @@ const opListStackInstances = "ListStackInstances" type ListStackInstancesRequest struct { *aws.Request Input *ListStackInstancesInput + Copy func(*ListStackInstancesInput) ListStackInstancesRequest } // Send marshals and sends the ListStackInstances API request. @@ -1740,7 +1752,7 @@ func (c *CloudFormation) ListStackInstancesRequest(input *ListStackInstancesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStackInstancesRequest{Request: req, Input: input} + return ListStackInstancesRequest{Request: req, Input: input, Copy: c.ListStackInstancesRequest} } const opListStackResources = "ListStackResources" @@ -1749,6 +1761,7 @@ const opListStackResources = "ListStackResources" type ListStackResourcesRequest struct { *aws.Request Input *ListStackResourcesInput + Copy func(*ListStackResourcesInput) ListStackResourcesRequest } // Send marshals and sends the ListStackResources API request. @@ -1798,57 +1811,53 @@ func (c *CloudFormation) ListStackResourcesRequest(input *ListStackResourcesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStackResourcesRequest{Request: req, Input: input} + return ListStackResourcesRequest{Request: req, Input: input, Copy: c.ListStackResourcesRequest} } -// ListStackResourcesPages iterates over the pages of a ListStackResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStackResources method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListStackResourcesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListStackResources operation. -// pageNum := 0 -// err := client.ListStackResourcesPages(params, -// func(page *ListStackResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) ListStackResourcesPages(input *ListStackResourcesInput, fn func(*ListStackResourcesOutput, bool) bool) error { - return c.ListStackResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStackResourcesPagesWithContext same as ListStackResourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFormation) ListStackResourcesPagesWithContext(ctx aws.Context, input *ListStackResourcesInput, fn func(*ListStackResourcesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListStackResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListStackResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListStackResourcesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListStackResourcesRequest) Paginate(opts ...aws.Option) ListStackResourcesPager { + return ListStackResourcesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListStackResourcesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStackResourcesOutput), !p.HasNextPage()) - } - return p.Err() +// ListStackResourcesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListStackResourcesPager struct { + aws.Pager +} + +func (p *ListStackResourcesPager) CurrentPage() *ListStackResourcesOutput { + return p.Pager.CurrentPage().(*ListStackResourcesOutput) } const opListStackSetOperationResults = "ListStackSetOperationResults" @@ -1857,6 +1866,7 @@ const opListStackSetOperationResults = "ListStackSetOperationResults" type ListStackSetOperationResultsRequest struct { *aws.Request Input *ListStackSetOperationResultsInput + Copy func(*ListStackSetOperationResultsInput) ListStackSetOperationResultsRequest } // Send marshals and sends the ListStackSetOperationResults API request. @@ -1897,7 +1907,7 @@ func (c *CloudFormation) ListStackSetOperationResultsRequest(input *ListStackSet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStackSetOperationResultsRequest{Request: req, Input: input} + return ListStackSetOperationResultsRequest{Request: req, Input: input, Copy: c.ListStackSetOperationResultsRequest} } const opListStackSetOperations = "ListStackSetOperations" @@ -1906,6 +1916,7 @@ const opListStackSetOperations = "ListStackSetOperations" type ListStackSetOperationsRequest struct { *aws.Request Input *ListStackSetOperationsInput + Copy func(*ListStackSetOperationsInput) ListStackSetOperationsRequest } // Send marshals and sends the ListStackSetOperations API request. @@ -1946,7 +1957,7 @@ func (c *CloudFormation) ListStackSetOperationsRequest(input *ListStackSetOperat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStackSetOperationsRequest{Request: req, Input: input} + return ListStackSetOperationsRequest{Request: req, Input: input, Copy: c.ListStackSetOperationsRequest} } const opListStackSets = "ListStackSets" @@ -1955,6 +1966,7 @@ const opListStackSets = "ListStackSets" type ListStackSetsRequest struct { *aws.Request Input *ListStackSetsInput + Copy func(*ListStackSetsInput) ListStackSetsRequest } // Send marshals and sends the ListStackSets API request. @@ -1996,7 +2008,7 @@ func (c *CloudFormation) ListStackSetsRequest(input *ListStackSetsInput) ListSta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStackSetsRequest{Request: req, Input: input} + return ListStackSetsRequest{Request: req, Input: input, Copy: c.ListStackSetsRequest} } const opListStacks = "ListStacks" @@ -2005,6 +2017,7 @@ const opListStacks = "ListStacks" type ListStacksRequest struct { *aws.Request Input *ListStacksInput + Copy func(*ListStacksInput) ListStacksRequest } // Send marshals and sends the ListStacks API request. @@ -2055,57 +2068,53 @@ func (c *CloudFormation) ListStacksRequest(input *ListStacksInput) ListStacksReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStacksRequest{Request: req, Input: input} + return ListStacksRequest{Request: req, Input: input, Copy: c.ListStacksRequest} } -// ListStacksPages iterates over the pages of a ListStacks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStacks method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListStacksRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListStacks operation. -// pageNum := 0 -// err := client.ListStacksPages(params, -// func(page *ListStacksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) ListStacksPages(input *ListStacksInput, fn func(*ListStacksOutput, bool) bool) error { - return c.ListStacksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStacksPagesWithContext same as ListStacksPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFormation) ListStacksPagesWithContext(ctx aws.Context, input *ListStacksInput, fn func(*ListStacksOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListStacksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListStacksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListStacksRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListStacksRequest) Paginate(opts ...aws.Option) ListStacksPager { + return ListStacksPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListStacksInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStacksOutput), !p.HasNextPage()) - } - return p.Err() +// ListStacksPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListStacksPager struct { + aws.Pager +} + +func (p *ListStacksPager) CurrentPage() *ListStacksOutput { + return p.Pager.CurrentPage().(*ListStacksOutput) } const opSetStackPolicy = "SetStackPolicy" @@ -2114,6 +2123,7 @@ const opSetStackPolicy = "SetStackPolicy" type SetStackPolicyRequest struct { *aws.Request Input *SetStackPolicyInput + Copy func(*SetStackPolicyInput) SetStackPolicyRequest } // Send marshals and sends the SetStackPolicy API request. @@ -2156,7 +2166,7 @@ func (c *CloudFormation) SetStackPolicyRequest(input *SetStackPolicyInput) SetSt req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetStackPolicyRequest{Request: req, Input: input} + return SetStackPolicyRequest{Request: req, Input: input, Copy: c.SetStackPolicyRequest} } const opSignalResource = "SignalResource" @@ -2165,6 +2175,7 @@ const opSignalResource = "SignalResource" type SignalResourceRequest struct { *aws.Request Input *SignalResourceInput + Copy func(*SignalResourceInput) SignalResourceRequest } // Send marshals and sends the SignalResource API request. @@ -2212,7 +2223,7 @@ func (c *CloudFormation) SignalResourceRequest(input *SignalResourceInput) Signa req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SignalResourceRequest{Request: req, Input: input} + return SignalResourceRequest{Request: req, Input: input, Copy: c.SignalResourceRequest} } const opStopStackSetOperation = "StopStackSetOperation" @@ -2221,6 +2232,7 @@ const opStopStackSetOperation = "StopStackSetOperation" type StopStackSetOperationRequest struct { *aws.Request Input *StopStackSetOperationInput + Copy func(*StopStackSetOperationInput) StopStackSetOperationRequest } // Send marshals and sends the StopStackSetOperation API request. @@ -2261,7 +2273,7 @@ func (c *CloudFormation) StopStackSetOperationRequest(input *StopStackSetOperati req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopStackSetOperationRequest{Request: req, Input: input} + return StopStackSetOperationRequest{Request: req, Input: input, Copy: c.StopStackSetOperationRequest} } const opUpdateStack = "UpdateStack" @@ -2270,6 +2282,7 @@ const opUpdateStack = "UpdateStack" type UpdateStackRequest struct { *aws.Request Input *UpdateStackInput + Copy func(*UpdateStackInput) UpdateStackRequest } // Send marshals and sends the UpdateStack API request. @@ -2318,7 +2331,7 @@ func (c *CloudFormation) UpdateStackRequest(input *UpdateStackInput) UpdateStack req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateStackRequest{Request: req, Input: input} + return UpdateStackRequest{Request: req, Input: input, Copy: c.UpdateStackRequest} } const opUpdateStackInstances = "UpdateStackInstances" @@ -2327,6 +2340,7 @@ const opUpdateStackInstances = "UpdateStackInstances" type UpdateStackInstancesRequest struct { *aws.Request Input *UpdateStackInstancesInput + Copy func(*UpdateStackInstancesInput) UpdateStackInstancesRequest } // Send marshals and sends the UpdateStackInstances API request. @@ -2384,7 +2398,7 @@ func (c *CloudFormation) UpdateStackInstancesRequest(input *UpdateStackInstances req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateStackInstancesRequest{Request: req, Input: input} + return UpdateStackInstancesRequest{Request: req, Input: input, Copy: c.UpdateStackInstancesRequest} } const opUpdateStackSet = "UpdateStackSet" @@ -2393,6 +2407,7 @@ const opUpdateStackSet = "UpdateStackSet" type UpdateStackSetRequest struct { *aws.Request Input *UpdateStackSetInput + Copy func(*UpdateStackSetInput) UpdateStackSetRequest } // Send marshals and sends the UpdateStackSet API request. @@ -2438,7 +2453,7 @@ func (c *CloudFormation) UpdateStackSetRequest(input *UpdateStackSetInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateStackSetRequest{Request: req, Input: input} + return UpdateStackSetRequest{Request: req, Input: input, Copy: c.UpdateStackSetRequest} } const opUpdateTerminationProtection = "UpdateTerminationProtection" @@ -2447,6 +2462,7 @@ const opUpdateTerminationProtection = "UpdateTerminationProtection" type UpdateTerminationProtectionRequest struct { *aws.Request Input *UpdateTerminationProtectionInput + Copy func(*UpdateTerminationProtectionInput) UpdateTerminationProtectionRequest } // Send marshals and sends the UpdateTerminationProtection API request. @@ -2495,7 +2511,7 @@ func (c *CloudFormation) UpdateTerminationProtectionRequest(input *UpdateTermina req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTerminationProtectionRequest{Request: req, Input: input} + return UpdateTerminationProtectionRequest{Request: req, Input: input, Copy: c.UpdateTerminationProtectionRequest} } const opValidateTemplate = "ValidateTemplate" @@ -2504,6 +2520,7 @@ const opValidateTemplate = "ValidateTemplate" type ValidateTemplateRequest struct { *aws.Request Input *ValidateTemplateInput + Copy func(*ValidateTemplateInput) ValidateTemplateRequest } // Send marshals and sends the ValidateTemplate API request. @@ -2547,7 +2564,7 @@ func (c *CloudFormation) ValidateTemplateRequest(input *ValidateTemplateInput) V req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ValidateTemplateRequest{Request: req, Input: input} + return ValidateTemplateRequest{Request: req, Input: input, Copy: c.ValidateTemplateRequest} } // Structure that contains the results of the account gate function which AWS diff --git a/service/cloudformation/cloudformationiface/interface.go b/service/cloudformation/cloudformationiface/interface.go index 7a10f18762e..f641636128c 100644 --- a/service/cloudformation/cloudformationiface/interface.go +++ b/service/cloudformation/cloudformationiface/interface.go @@ -89,9 +89,6 @@ type CloudFormationAPI interface { DescribeStackEventsRequest(*cloudformation.DescribeStackEventsInput) cloudformation.DescribeStackEventsRequest - DescribeStackEventsPages(*cloudformation.DescribeStackEventsInput, func(*cloudformation.DescribeStackEventsOutput, bool) bool) error - DescribeStackEventsPagesWithContext(aws.Context, *cloudformation.DescribeStackEventsInput, func(*cloudformation.DescribeStackEventsOutput, bool) bool, ...aws.Option) error - DescribeStackInstanceRequest(*cloudformation.DescribeStackInstanceInput) cloudformation.DescribeStackInstanceRequest DescribeStackResourceRequest(*cloudformation.DescribeStackResourceInput) cloudformation.DescribeStackResourceRequest @@ -104,9 +101,6 @@ type CloudFormationAPI interface { DescribeStacksRequest(*cloudformation.DescribeStacksInput) cloudformation.DescribeStacksRequest - DescribeStacksPages(*cloudformation.DescribeStacksInput, func(*cloudformation.DescribeStacksOutput, bool) bool) error - DescribeStacksPagesWithContext(aws.Context, *cloudformation.DescribeStacksInput, func(*cloudformation.DescribeStacksOutput, bool) bool, ...aws.Option) error - EstimateTemplateCostRequest(*cloudformation.EstimateTemplateCostInput) cloudformation.EstimateTemplateCostRequest ExecuteChangeSetRequest(*cloudformation.ExecuteChangeSetInput) cloudformation.ExecuteChangeSetRequest @@ -121,21 +115,12 @@ type CloudFormationAPI interface { ListExportsRequest(*cloudformation.ListExportsInput) cloudformation.ListExportsRequest - ListExportsPages(*cloudformation.ListExportsInput, func(*cloudformation.ListExportsOutput, bool) bool) error - ListExportsPagesWithContext(aws.Context, *cloudformation.ListExportsInput, func(*cloudformation.ListExportsOutput, bool) bool, ...aws.Option) error - ListImportsRequest(*cloudformation.ListImportsInput) cloudformation.ListImportsRequest - ListImportsPages(*cloudformation.ListImportsInput, func(*cloudformation.ListImportsOutput, bool) bool) error - ListImportsPagesWithContext(aws.Context, *cloudformation.ListImportsInput, func(*cloudformation.ListImportsOutput, bool) bool, ...aws.Option) error - ListStackInstancesRequest(*cloudformation.ListStackInstancesInput) cloudformation.ListStackInstancesRequest ListStackResourcesRequest(*cloudformation.ListStackResourcesInput) cloudformation.ListStackResourcesRequest - ListStackResourcesPages(*cloudformation.ListStackResourcesInput, func(*cloudformation.ListStackResourcesOutput, bool) bool) error - ListStackResourcesPagesWithContext(aws.Context, *cloudformation.ListStackResourcesInput, func(*cloudformation.ListStackResourcesOutput, bool) bool, ...aws.Option) error - ListStackSetOperationResultsRequest(*cloudformation.ListStackSetOperationResultsInput) cloudformation.ListStackSetOperationResultsRequest ListStackSetOperationsRequest(*cloudformation.ListStackSetOperationsInput) cloudformation.ListStackSetOperationsRequest @@ -144,9 +129,6 @@ type CloudFormationAPI interface { ListStacksRequest(*cloudformation.ListStacksInput) cloudformation.ListStacksRequest - ListStacksPages(*cloudformation.ListStacksInput, func(*cloudformation.ListStacksOutput, bool) bool) error - ListStacksPagesWithContext(aws.Context, *cloudformation.ListStacksInput, func(*cloudformation.ListStacksOutput, bool) bool, ...aws.Option) error - SetStackPolicyRequest(*cloudformation.SetStackPolicyInput) cloudformation.SetStackPolicyRequest SignalResourceRequest(*cloudformation.SignalResourceInput) cloudformation.SignalResourceRequest diff --git a/service/cloudfront/api.go b/service/cloudfront/api.go index 83bf35f0f10..a0b03b74b03 100644 --- a/service/cloudfront/api.go +++ b/service/cloudfront/api.go @@ -18,6 +18,7 @@ const opCreateCloudFrontOriginAccessIdentity = "CreateCloudFrontOriginAccessIden type CreateCloudFrontOriginAccessIdentityRequest struct { *aws.Request Input *CreateCloudFrontOriginAccessIdentityInput + Copy func(*CreateCloudFrontOriginAccessIdentityInput) CreateCloudFrontOriginAccessIdentityRequest } // Send marshals and sends the CreateCloudFrontOriginAccessIdentity API request. @@ -63,7 +64,7 @@ func (c *CloudFront) CreateCloudFrontOriginAccessIdentityRequest(input *CreateCl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCloudFrontOriginAccessIdentityRequest{Request: req, Input: input} + return CreateCloudFrontOriginAccessIdentityRequest{Request: req, Input: input, Copy: c.CreateCloudFrontOriginAccessIdentityRequest} } const opCreateDistribution = "CreateDistribution2017_03_25" @@ -72,6 +73,7 @@ const opCreateDistribution = "CreateDistribution2017_03_25" type CreateDistributionRequest struct { *aws.Request Input *CreateDistributionInput + Copy func(*CreateDistributionInput) CreateDistributionRequest } // Send marshals and sends the CreateDistribution API request. @@ -113,7 +115,7 @@ func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDistributionRequest{Request: req, Input: input} + return CreateDistributionRequest{Request: req, Input: input, Copy: c.CreateDistributionRequest} } const opCreateDistributionWithTags = "CreateDistributionWithTags2017_03_25" @@ -122,6 +124,7 @@ const opCreateDistributionWithTags = "CreateDistributionWithTags2017_03_25" type CreateDistributionWithTagsRequest struct { *aws.Request Input *CreateDistributionWithTagsInput + Copy func(*CreateDistributionWithTagsInput) CreateDistributionWithTagsRequest } // Send marshals and sends the CreateDistributionWithTags API request. @@ -162,7 +165,7 @@ func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistribution req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDistributionWithTagsRequest{Request: req, Input: input} + return CreateDistributionWithTagsRequest{Request: req, Input: input, Copy: c.CreateDistributionWithTagsRequest} } const opCreateInvalidation = "CreateInvalidation2017_03_25" @@ -171,6 +174,7 @@ const opCreateInvalidation = "CreateInvalidation2017_03_25" type CreateInvalidationRequest struct { *aws.Request Input *CreateInvalidationInput + Copy func(*CreateInvalidationInput) CreateInvalidationRequest } // Send marshals and sends the CreateInvalidation API request. @@ -211,7 +215,7 @@ func (c *CloudFront) CreateInvalidationRequest(input *CreateInvalidationInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInvalidationRequest{Request: req, Input: input} + return CreateInvalidationRequest{Request: req, Input: input, Copy: c.CreateInvalidationRequest} } const opCreateStreamingDistribution = "CreateStreamingDistribution2017_03_25" @@ -220,6 +224,7 @@ const opCreateStreamingDistribution = "CreateStreamingDistribution2017_03_25" type CreateStreamingDistributionRequest struct { *aws.Request Input *CreateStreamingDistributionInput + Copy func(*CreateStreamingDistributionInput) CreateStreamingDistributionRequest } // Send marshals and sends the CreateStreamingDistribution API request. @@ -287,7 +292,7 @@ func (c *CloudFront) CreateStreamingDistributionRequest(input *CreateStreamingDi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStreamingDistributionRequest{Request: req, Input: input} + return CreateStreamingDistributionRequest{Request: req, Input: input, Copy: c.CreateStreamingDistributionRequest} } const opCreateStreamingDistributionWithTags = "CreateStreamingDistributionWithTags2017_03_25" @@ -296,6 +301,7 @@ const opCreateStreamingDistributionWithTags = "CreateStreamingDistributionWithTa type CreateStreamingDistributionWithTagsRequest struct { *aws.Request Input *CreateStreamingDistributionWithTagsInput + Copy func(*CreateStreamingDistributionWithTagsInput) CreateStreamingDistributionWithTagsRequest } // Send marshals and sends the CreateStreamingDistributionWithTags API request. @@ -336,7 +342,7 @@ func (c *CloudFront) CreateStreamingDistributionWithTagsRequest(input *CreateStr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStreamingDistributionWithTagsRequest{Request: req, Input: input} + return CreateStreamingDistributionWithTagsRequest{Request: req, Input: input, Copy: c.CreateStreamingDistributionWithTagsRequest} } const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIdentity2017_03_25" @@ -345,6 +351,7 @@ const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIden type DeleteCloudFrontOriginAccessIdentityRequest struct { *aws.Request Input *DeleteCloudFrontOriginAccessIdentityInput + Copy func(*DeleteCloudFrontOriginAccessIdentityInput) DeleteCloudFrontOriginAccessIdentityRequest } // Send marshals and sends the DeleteCloudFrontOriginAccessIdentity API request. @@ -387,7 +394,7 @@ func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityRequest(input *DeleteCl req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCloudFrontOriginAccessIdentityRequest{Request: req, Input: input} + return DeleteCloudFrontOriginAccessIdentityRequest{Request: req, Input: input, Copy: c.DeleteCloudFrontOriginAccessIdentityRequest} } const opDeleteDistribution = "DeleteDistribution2017_03_25" @@ -396,6 +403,7 @@ const opDeleteDistribution = "DeleteDistribution2017_03_25" type DeleteDistributionRequest struct { *aws.Request Input *DeleteDistributionInput + Copy func(*DeleteDistributionInput) DeleteDistributionRequest } // Send marshals and sends the DeleteDistribution API request. @@ -438,7 +446,7 @@ func (c *CloudFront) DeleteDistributionRequest(input *DeleteDistributionInput) D req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDistributionRequest{Request: req, Input: input} + return DeleteDistributionRequest{Request: req, Input: input, Copy: c.DeleteDistributionRequest} } const opDeleteServiceLinkedRole = "DeleteServiceLinkedRole2017_03_25" @@ -447,6 +455,7 @@ const opDeleteServiceLinkedRole = "DeleteServiceLinkedRole2017_03_25" type DeleteServiceLinkedRoleRequest struct { *aws.Request Input *DeleteServiceLinkedRoleInput + Copy func(*DeleteServiceLinkedRoleInput) DeleteServiceLinkedRoleRequest } // Send marshals and sends the DeleteServiceLinkedRole API request. @@ -487,7 +496,7 @@ func (c *CloudFront) DeleteServiceLinkedRoleRequest(input *DeleteServiceLinkedRo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteServiceLinkedRoleRequest{Request: req, Input: input} + return DeleteServiceLinkedRoleRequest{Request: req, Input: input, Copy: c.DeleteServiceLinkedRoleRequest} } const opDeleteStreamingDistribution = "DeleteStreamingDistribution2017_03_25" @@ -496,6 +505,7 @@ const opDeleteStreamingDistribution = "DeleteStreamingDistribution2017_03_25" type DeleteStreamingDistributionRequest struct { *aws.Request Input *DeleteStreamingDistributionInput + Copy func(*DeleteStreamingDistributionInput) DeleteStreamingDistributionRequest } // Send marshals and sends the DeleteStreamingDistribution API request. @@ -573,7 +583,7 @@ func (c *CloudFront) DeleteStreamingDistributionRequest(input *DeleteStreamingDi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteStreamingDistributionRequest{Request: req, Input: input} + return DeleteStreamingDistributionRequest{Request: req, Input: input, Copy: c.DeleteStreamingDistributionRequest} } const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity2017_03_25" @@ -582,6 +592,7 @@ const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity20 type GetCloudFrontOriginAccessIdentityRequest struct { *aws.Request Input *GetCloudFrontOriginAccessIdentityInput + Copy func(*GetCloudFrontOriginAccessIdentityInput) GetCloudFrontOriginAccessIdentityRequest } // Send marshals and sends the GetCloudFrontOriginAccessIdentity API request. @@ -622,7 +633,7 @@ func (c *CloudFront) GetCloudFrontOriginAccessIdentityRequest(input *GetCloudFro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCloudFrontOriginAccessIdentityRequest{Request: req, Input: input} + return GetCloudFrontOriginAccessIdentityRequest{Request: req, Input: input, Copy: c.GetCloudFrontOriginAccessIdentityRequest} } const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIdentityConfig2017_03_25" @@ -631,6 +642,7 @@ const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIden type GetCloudFrontOriginAccessIdentityConfigRequest struct { *aws.Request Input *GetCloudFrontOriginAccessIdentityConfigInput + Copy func(*GetCloudFrontOriginAccessIdentityConfigInput) GetCloudFrontOriginAccessIdentityConfigRequest } // Send marshals and sends the GetCloudFrontOriginAccessIdentityConfig API request. @@ -671,7 +683,7 @@ func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfigRequest(input *GetCl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCloudFrontOriginAccessIdentityConfigRequest{Request: req, Input: input} + return GetCloudFrontOriginAccessIdentityConfigRequest{Request: req, Input: input, Copy: c.GetCloudFrontOriginAccessIdentityConfigRequest} } const opGetDistribution = "GetDistribution2017_03_25" @@ -680,6 +692,7 @@ const opGetDistribution = "GetDistribution2017_03_25" type GetDistributionRequest struct { *aws.Request Input *GetDistributionInput + Copy func(*GetDistributionInput) GetDistributionRequest } // Send marshals and sends the GetDistribution API request. @@ -720,7 +733,7 @@ func (c *CloudFront) GetDistributionRequest(input *GetDistributionInput) GetDist req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDistributionRequest{Request: req, Input: input} + return GetDistributionRequest{Request: req, Input: input, Copy: c.GetDistributionRequest} } const opGetDistributionConfig = "GetDistributionConfig2017_03_25" @@ -729,6 +742,7 @@ const opGetDistributionConfig = "GetDistributionConfig2017_03_25" type GetDistributionConfigRequest struct { *aws.Request Input *GetDistributionConfigInput + Copy func(*GetDistributionConfigInput) GetDistributionConfigRequest } // Send marshals and sends the GetDistributionConfig API request. @@ -769,7 +783,7 @@ func (c *CloudFront) GetDistributionConfigRequest(input *GetDistributionConfigIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDistributionConfigRequest{Request: req, Input: input} + return GetDistributionConfigRequest{Request: req, Input: input, Copy: c.GetDistributionConfigRequest} } const opGetInvalidation = "GetInvalidation2017_03_25" @@ -778,6 +792,7 @@ const opGetInvalidation = "GetInvalidation2017_03_25" type GetInvalidationRequest struct { *aws.Request Input *GetInvalidationInput + Copy func(*GetInvalidationInput) GetInvalidationRequest } // Send marshals and sends the GetInvalidation API request. @@ -818,7 +833,7 @@ func (c *CloudFront) GetInvalidationRequest(input *GetInvalidationInput) GetInva req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInvalidationRequest{Request: req, Input: input} + return GetInvalidationRequest{Request: req, Input: input, Copy: c.GetInvalidationRequest} } const opGetStreamingDistribution = "GetStreamingDistribution2017_03_25" @@ -827,6 +842,7 @@ const opGetStreamingDistribution = "GetStreamingDistribution2017_03_25" type GetStreamingDistributionRequest struct { *aws.Request Input *GetStreamingDistributionInput + Copy func(*GetStreamingDistributionInput) GetStreamingDistributionRequest } // Send marshals and sends the GetStreamingDistribution API request. @@ -868,7 +884,7 @@ func (c *CloudFront) GetStreamingDistributionRequest(input *GetStreamingDistribu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetStreamingDistributionRequest{Request: req, Input: input} + return GetStreamingDistributionRequest{Request: req, Input: input, Copy: c.GetStreamingDistributionRequest} } const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2017_03_25" @@ -877,6 +893,7 @@ const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2017_03_ type GetStreamingDistributionConfigRequest struct { *aws.Request Input *GetStreamingDistributionConfigInput + Copy func(*GetStreamingDistributionConfigInput) GetStreamingDistributionConfigRequest } // Send marshals and sends the GetStreamingDistributionConfig API request. @@ -917,7 +934,7 @@ func (c *CloudFront) GetStreamingDistributionConfigRequest(input *GetStreamingDi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetStreamingDistributionConfigRequest{Request: req, Input: input} + return GetStreamingDistributionConfigRequest{Request: req, Input: input, Copy: c.GetStreamingDistributionConfigRequest} } const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdentities2017_03_25" @@ -926,6 +943,7 @@ const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdenti type ListCloudFrontOriginAccessIdentitiesRequest struct { *aws.Request Input *ListCloudFrontOriginAccessIdentitiesInput + Copy func(*ListCloudFrontOriginAccessIdentitiesInput) ListCloudFrontOriginAccessIdentitiesRequest } // Send marshals and sends the ListCloudFrontOriginAccessIdentities API request. @@ -972,57 +990,53 @@ func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesRequest(input *ListClou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCloudFrontOriginAccessIdentitiesRequest{Request: req, Input: input} + return ListCloudFrontOriginAccessIdentitiesRequest{Request: req, Input: input, Copy: c.ListCloudFrontOriginAccessIdentitiesRequest} } -// ListCloudFrontOriginAccessIdentitiesPages iterates over the pages of a ListCloudFrontOriginAccessIdentities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCloudFrontOriginAccessIdentities method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListCloudFrontOriginAccessIdentitiesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListCloudFrontOriginAccessIdentities operation. -// pageNum := 0 -// err := client.ListCloudFrontOriginAccessIdentitiesPages(params, -// func(page *ListCloudFrontOriginAccessIdentitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesPages(input *ListCloudFrontOriginAccessIdentitiesInput, fn func(*ListCloudFrontOriginAccessIdentitiesOutput, bool) bool) error { - return c.ListCloudFrontOriginAccessIdentitiesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCloudFrontOriginAccessIdentitiesPagesWithContext same as ListCloudFrontOriginAccessIdentitiesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesPagesWithContext(ctx aws.Context, input *ListCloudFrontOriginAccessIdentitiesInput, fn func(*ListCloudFrontOriginAccessIdentitiesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListCloudFrontOriginAccessIdentitiesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListCloudFrontOriginAccessIdentitiesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListCloudFrontOriginAccessIdentitiesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListCloudFrontOriginAccessIdentitiesRequest) Paginate(opts ...aws.Option) ListCloudFrontOriginAccessIdentitiesPager { + return ListCloudFrontOriginAccessIdentitiesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListCloudFrontOriginAccessIdentitiesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCloudFrontOriginAccessIdentitiesOutput), !p.HasNextPage()) - } - return p.Err() +// ListCloudFrontOriginAccessIdentitiesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListCloudFrontOriginAccessIdentitiesPager struct { + aws.Pager +} + +func (p *ListCloudFrontOriginAccessIdentitiesPager) CurrentPage() *ListCloudFrontOriginAccessIdentitiesOutput { + return p.Pager.CurrentPage().(*ListCloudFrontOriginAccessIdentitiesOutput) } const opListDistributions = "ListDistributions2017_03_25" @@ -1031,6 +1045,7 @@ const opListDistributions = "ListDistributions2017_03_25" type ListDistributionsRequest struct { *aws.Request Input *ListDistributionsInput + Copy func(*ListDistributionsInput) ListDistributionsRequest } // Send marshals and sends the ListDistributions API request. @@ -1077,57 +1092,53 @@ func (c *CloudFront) ListDistributionsRequest(input *ListDistributionsInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDistributionsRequest{Request: req, Input: input} + return ListDistributionsRequest{Request: req, Input: input, Copy: c.ListDistributionsRequest} } -// ListDistributionsPages iterates over the pages of a ListDistributions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDistributions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDistributionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDistributions operation. -// pageNum := 0 -// err := client.ListDistributionsPages(params, -// func(page *ListDistributionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFront) ListDistributionsPages(input *ListDistributionsInput, fn func(*ListDistributionsOutput, bool) bool) error { - return c.ListDistributionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDistributionsPagesWithContext same as ListDistributionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFront) ListDistributionsPagesWithContext(ctx aws.Context, input *ListDistributionsInput, fn func(*ListDistributionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDistributionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDistributionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDistributionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDistributionsRequest) Paginate(opts ...aws.Option) ListDistributionsPager { + return ListDistributionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDistributionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDistributionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDistributionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDistributionsPager struct { + aws.Pager +} + +func (p *ListDistributionsPager) CurrentPage() *ListDistributionsOutput { + return p.Pager.CurrentPage().(*ListDistributionsOutput) } const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2017_03_25" @@ -1136,6 +1147,7 @@ const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2017_03_25" type ListDistributionsByWebACLIdRequest struct { *aws.Request Input *ListDistributionsByWebACLIdInput + Copy func(*ListDistributionsByWebACLIdInput) ListDistributionsByWebACLIdRequest } // Send marshals and sends the ListDistributionsByWebACLId API request. @@ -1176,7 +1188,7 @@ func (c *CloudFront) ListDistributionsByWebACLIdRequest(input *ListDistributions req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDistributionsByWebACLIdRequest{Request: req, Input: input} + return ListDistributionsByWebACLIdRequest{Request: req, Input: input, Copy: c.ListDistributionsByWebACLIdRequest} } const opListInvalidations = "ListInvalidations2017_03_25" @@ -1185,6 +1197,7 @@ const opListInvalidations = "ListInvalidations2017_03_25" type ListInvalidationsRequest struct { *aws.Request Input *ListInvalidationsInput + Copy func(*ListInvalidationsInput) ListInvalidationsRequest } // Send marshals and sends the ListInvalidations API request. @@ -1231,57 +1244,53 @@ func (c *CloudFront) ListInvalidationsRequest(input *ListInvalidationsInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInvalidationsRequest{Request: req, Input: input} + return ListInvalidationsRequest{Request: req, Input: input, Copy: c.ListInvalidationsRequest} } -// ListInvalidationsPages iterates over the pages of a ListInvalidations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInvalidations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInvalidationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInvalidations operation. -// pageNum := 0 -// err := client.ListInvalidationsPages(params, -// func(page *ListInvalidationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFront) ListInvalidationsPages(input *ListInvalidationsInput, fn func(*ListInvalidationsOutput, bool) bool) error { - return c.ListInvalidationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInvalidationsPagesWithContext same as ListInvalidationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFront) ListInvalidationsPagesWithContext(ctx aws.Context, input *ListInvalidationsInput, fn func(*ListInvalidationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInvalidationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInvalidationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListInvalidationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListInvalidationsRequest) Paginate(opts ...aws.Option) ListInvalidationsPager { + return ListInvalidationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInvalidationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInvalidationsOutput), !p.HasNextPage()) - } - return p.Err() +// ListInvalidationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInvalidationsPager struct { + aws.Pager +} + +func (p *ListInvalidationsPager) CurrentPage() *ListInvalidationsOutput { + return p.Pager.CurrentPage().(*ListInvalidationsOutput) } const opListStreamingDistributions = "ListStreamingDistributions2017_03_25" @@ -1290,6 +1299,7 @@ const opListStreamingDistributions = "ListStreamingDistributions2017_03_25" type ListStreamingDistributionsRequest struct { *aws.Request Input *ListStreamingDistributionsInput + Copy func(*ListStreamingDistributionsInput) ListStreamingDistributionsRequest } // Send marshals and sends the ListStreamingDistributions API request. @@ -1336,57 +1346,53 @@ func (c *CloudFront) ListStreamingDistributionsRequest(input *ListStreamingDistr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStreamingDistributionsRequest{Request: req, Input: input} + return ListStreamingDistributionsRequest{Request: req, Input: input, Copy: c.ListStreamingDistributionsRequest} } -// ListStreamingDistributionsPages iterates over the pages of a ListStreamingDistributions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStreamingDistributions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListStreamingDistributionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListStreamingDistributions operation. -// pageNum := 0 -// err := client.ListStreamingDistributionsPages(params, -// func(page *ListStreamingDistributionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFront) ListStreamingDistributionsPages(input *ListStreamingDistributionsInput, fn func(*ListStreamingDistributionsOutput, bool) bool) error { - return c.ListStreamingDistributionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStreamingDistributionsPagesWithContext same as ListStreamingDistributionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudFront) ListStreamingDistributionsPagesWithContext(ctx aws.Context, input *ListStreamingDistributionsInput, fn func(*ListStreamingDistributionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListStreamingDistributionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListStreamingDistributionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListStreamingDistributionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListStreamingDistributionsRequest) Paginate(opts ...aws.Option) ListStreamingDistributionsPager { + return ListStreamingDistributionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListStreamingDistributionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStreamingDistributionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListStreamingDistributionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListStreamingDistributionsPager struct { + aws.Pager +} + +func (p *ListStreamingDistributionsPager) CurrentPage() *ListStreamingDistributionsOutput { + return p.Pager.CurrentPage().(*ListStreamingDistributionsOutput) } const opListTagsForResource = "ListTagsForResource2017_03_25" @@ -1395,6 +1401,7 @@ const opListTagsForResource = "ListTagsForResource2017_03_25" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -1435,7 +1442,7 @@ func (c *CloudFront) ListTagsForResourceRequest(input *ListTagsForResourceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opTagResource = "TagResource2017_03_25" @@ -1444,6 +1451,7 @@ const opTagResource = "TagResource2017_03_25" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -1486,7 +1494,7 @@ func (c *CloudFront) TagResourceRequest(input *TagResourceInput) TagResourceRequ req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource2017_03_25" @@ -1495,6 +1503,7 @@ const opUntagResource = "UntagResource2017_03_25" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -1537,7 +1546,7 @@ func (c *CloudFront) UntagResourceRequest(input *UntagResourceInput) UntagResour req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIdentity2017_03_25" @@ -1546,6 +1555,7 @@ const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIden type UpdateCloudFrontOriginAccessIdentityRequest struct { *aws.Request Input *UpdateCloudFrontOriginAccessIdentityInput + Copy func(*UpdateCloudFrontOriginAccessIdentityInput) UpdateCloudFrontOriginAccessIdentityRequest } // Send marshals and sends the UpdateCloudFrontOriginAccessIdentity API request. @@ -1586,7 +1596,7 @@ func (c *CloudFront) UpdateCloudFrontOriginAccessIdentityRequest(input *UpdateCl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateCloudFrontOriginAccessIdentityRequest{Request: req, Input: input} + return UpdateCloudFrontOriginAccessIdentityRequest{Request: req, Input: input, Copy: c.UpdateCloudFrontOriginAccessIdentityRequest} } const opUpdateDistribution = "UpdateDistribution2017_03_25" @@ -1595,6 +1605,7 @@ const opUpdateDistribution = "UpdateDistribution2017_03_25" type UpdateDistributionRequest struct { *aws.Request Input *UpdateDistributionInput + Copy func(*UpdateDistributionInput) UpdateDistributionRequest } // Send marshals and sends the UpdateDistribution API request. @@ -1684,7 +1695,7 @@ func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) U req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDistributionRequest{Request: req, Input: input} + return UpdateDistributionRequest{Request: req, Input: input, Copy: c.UpdateDistributionRequest} } const opUpdateStreamingDistribution = "UpdateStreamingDistribution2017_03_25" @@ -1693,6 +1704,7 @@ const opUpdateStreamingDistribution = "UpdateStreamingDistribution2017_03_25" type UpdateStreamingDistributionRequest struct { *aws.Request Input *UpdateStreamingDistributionInput + Copy func(*UpdateStreamingDistributionInput) UpdateStreamingDistributionRequest } // Send marshals and sends the UpdateStreamingDistribution API request. @@ -1733,7 +1745,7 @@ func (c *CloudFront) UpdateStreamingDistributionRequest(input *UpdateStreamingDi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateStreamingDistributionRequest{Request: req, Input: input} + return UpdateStreamingDistributionRequest{Request: req, Input: input, Copy: c.UpdateStreamingDistributionRequest} } // A complex type that lists the AWS accounts, if any, that you included in diff --git a/service/cloudfront/cloudfrontiface/interface.go b/service/cloudfront/cloudfrontiface/interface.go index a9487b4b2d7..3ee306e4666 100644 --- a/service/cloudfront/cloudfrontiface/interface.go +++ b/service/cloudfront/cloudfrontiface/interface.go @@ -99,26 +99,14 @@ type CloudFrontAPI interface { ListCloudFrontOriginAccessIdentitiesRequest(*cloudfront.ListCloudFrontOriginAccessIdentitiesInput) cloudfront.ListCloudFrontOriginAccessIdentitiesRequest - ListCloudFrontOriginAccessIdentitiesPages(*cloudfront.ListCloudFrontOriginAccessIdentitiesInput, func(*cloudfront.ListCloudFrontOriginAccessIdentitiesOutput, bool) bool) error - ListCloudFrontOriginAccessIdentitiesPagesWithContext(aws.Context, *cloudfront.ListCloudFrontOriginAccessIdentitiesInput, func(*cloudfront.ListCloudFrontOriginAccessIdentitiesOutput, bool) bool, ...aws.Option) error - ListDistributionsRequest(*cloudfront.ListDistributionsInput) cloudfront.ListDistributionsRequest - ListDistributionsPages(*cloudfront.ListDistributionsInput, func(*cloudfront.ListDistributionsOutput, bool) bool) error - ListDistributionsPagesWithContext(aws.Context, *cloudfront.ListDistributionsInput, func(*cloudfront.ListDistributionsOutput, bool) bool, ...aws.Option) error - ListDistributionsByWebACLIdRequest(*cloudfront.ListDistributionsByWebACLIdInput) cloudfront.ListDistributionsByWebACLIdRequest ListInvalidationsRequest(*cloudfront.ListInvalidationsInput) cloudfront.ListInvalidationsRequest - ListInvalidationsPages(*cloudfront.ListInvalidationsInput, func(*cloudfront.ListInvalidationsOutput, bool) bool) error - ListInvalidationsPagesWithContext(aws.Context, *cloudfront.ListInvalidationsInput, func(*cloudfront.ListInvalidationsOutput, bool) bool, ...aws.Option) error - ListStreamingDistributionsRequest(*cloudfront.ListStreamingDistributionsInput) cloudfront.ListStreamingDistributionsRequest - ListStreamingDistributionsPages(*cloudfront.ListStreamingDistributionsInput, func(*cloudfront.ListStreamingDistributionsOutput, bool) bool) error - ListStreamingDistributionsPagesWithContext(aws.Context, *cloudfront.ListStreamingDistributionsInput, func(*cloudfront.ListStreamingDistributionsOutput, bool) bool, ...aws.Option) error - ListTagsForResourceRequest(*cloudfront.ListTagsForResourceInput) cloudfront.ListTagsForResourceRequest TagResourceRequest(*cloudfront.TagResourceInput) cloudfront.TagResourceRequest diff --git a/service/cloudhsm/api.go b/service/cloudhsm/api.go index fd20c5cb7fb..5add4f3d3ea 100644 --- a/service/cloudhsm/api.go +++ b/service/cloudhsm/api.go @@ -15,6 +15,7 @@ const opAddTagsToResource = "AddTagsToResource" type AddTagsToResourceRequest struct { *aws.Request Input *AddTagsToResourceInput + Copy func(*AddTagsToResourceInput) AddTagsToResourceRequest } // Send marshals and sends the AddTagsToResource API request. @@ -66,7 +67,7 @@ func (c *CloudHSM) AddTagsToResourceRequest(input *AddTagsToResourceInput) AddTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsToResourceRequest{Request: req, Input: input} + return AddTagsToResourceRequest{Request: req, Input: input, Copy: c.AddTagsToResourceRequest} } const opCreateHapg = "CreateHapg" @@ -75,6 +76,7 @@ const opCreateHapg = "CreateHapg" type CreateHapgRequest struct { *aws.Request Input *CreateHapgInput + Copy func(*CreateHapgInput) CreateHapgRequest } // Send marshals and sends the CreateHapg API request. @@ -125,7 +127,7 @@ func (c *CloudHSM) CreateHapgRequest(input *CreateHapgInput) CreateHapgRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHapgRequest{Request: req, Input: input} + return CreateHapgRequest{Request: req, Input: input, Copy: c.CreateHapgRequest} } const opCreateHsm = "CreateHsm" @@ -134,6 +136,7 @@ const opCreateHsm = "CreateHsm" type CreateHsmRequest struct { *aws.Request Input *CreateHsmInput + Copy func(*CreateHsmInput) CreateHsmRequest } // Send marshals and sends the CreateHsm API request. @@ -193,7 +196,7 @@ func (c *CloudHSM) CreateHsmRequest(input *CreateHsmInput) CreateHsmRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHsmRequest{Request: req, Input: input} + return CreateHsmRequest{Request: req, Input: input, Copy: c.CreateHsmRequest} } const opCreateLunaClient = "CreateLunaClient" @@ -202,6 +205,7 @@ const opCreateLunaClient = "CreateLunaClient" type CreateLunaClientRequest struct { *aws.Request Input *CreateLunaClientInput + Copy func(*CreateLunaClientInput) CreateLunaClientRequest } // Send marshals and sends the CreateLunaClient API request. @@ -251,7 +255,7 @@ func (c *CloudHSM) CreateLunaClientRequest(input *CreateLunaClientInput) CreateL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLunaClientRequest{Request: req, Input: input} + return CreateLunaClientRequest{Request: req, Input: input, Copy: c.CreateLunaClientRequest} } const opDeleteHapg = "DeleteHapg" @@ -260,6 +264,7 @@ const opDeleteHapg = "DeleteHapg" type DeleteHapgRequest struct { *aws.Request Input *DeleteHapgInput + Copy func(*DeleteHapgInput) DeleteHapgRequest } // Send marshals and sends the DeleteHapg API request. @@ -309,7 +314,7 @@ func (c *CloudHSM) DeleteHapgRequest(input *DeleteHapgInput) DeleteHapgRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteHapgRequest{Request: req, Input: input} + return DeleteHapgRequest{Request: req, Input: input, Copy: c.DeleteHapgRequest} } const opDeleteHsm = "DeleteHsm" @@ -318,6 +323,7 @@ const opDeleteHsm = "DeleteHsm" type DeleteHsmRequest struct { *aws.Request Input *DeleteHsmInput + Copy func(*DeleteHsmInput) DeleteHsmRequest } // Send marshals and sends the DeleteHsm API request. @@ -368,7 +374,7 @@ func (c *CloudHSM) DeleteHsmRequest(input *DeleteHsmInput) DeleteHsmRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteHsmRequest{Request: req, Input: input} + return DeleteHsmRequest{Request: req, Input: input, Copy: c.DeleteHsmRequest} } const opDeleteLunaClient = "DeleteLunaClient" @@ -377,6 +383,7 @@ const opDeleteLunaClient = "DeleteLunaClient" type DeleteLunaClientRequest struct { *aws.Request Input *DeleteLunaClientInput + Copy func(*DeleteLunaClientInput) DeleteLunaClientRequest } // Send marshals and sends the DeleteLunaClient API request. @@ -426,7 +433,7 @@ func (c *CloudHSM) DeleteLunaClientRequest(input *DeleteLunaClientInput) DeleteL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLunaClientRequest{Request: req, Input: input} + return DeleteLunaClientRequest{Request: req, Input: input, Copy: c.DeleteLunaClientRequest} } const opDescribeHapg = "DescribeHapg" @@ -435,6 +442,7 @@ const opDescribeHapg = "DescribeHapg" type DescribeHapgRequest struct { *aws.Request Input *DescribeHapgInput + Copy func(*DescribeHapgInput) DescribeHapgRequest } // Send marshals and sends the DescribeHapg API request. @@ -484,7 +492,7 @@ func (c *CloudHSM) DescribeHapgRequest(input *DescribeHapgInput) DescribeHapgReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeHapgRequest{Request: req, Input: input} + return DescribeHapgRequest{Request: req, Input: input, Copy: c.DescribeHapgRequest} } const opDescribeHsm = "DescribeHsm" @@ -493,6 +501,7 @@ const opDescribeHsm = "DescribeHsm" type DescribeHsmRequest struct { *aws.Request Input *DescribeHsmInput + Copy func(*DescribeHsmInput) DescribeHsmRequest } // Send marshals and sends the DescribeHsm API request. @@ -543,7 +552,7 @@ func (c *CloudHSM) DescribeHsmRequest(input *DescribeHsmInput) DescribeHsmReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeHsmRequest{Request: req, Input: input} + return DescribeHsmRequest{Request: req, Input: input, Copy: c.DescribeHsmRequest} } const opDescribeLunaClient = "DescribeLunaClient" @@ -552,6 +561,7 @@ const opDescribeLunaClient = "DescribeLunaClient" type DescribeLunaClientRequest struct { *aws.Request Input *DescribeLunaClientInput + Copy func(*DescribeLunaClientInput) DescribeLunaClientRequest } // Send marshals and sends the DescribeLunaClient API request. @@ -601,7 +611,7 @@ func (c *CloudHSM) DescribeLunaClientRequest(input *DescribeLunaClientInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLunaClientRequest{Request: req, Input: input} + return DescribeLunaClientRequest{Request: req, Input: input, Copy: c.DescribeLunaClientRequest} } const opGetConfig = "GetConfig" @@ -610,6 +620,7 @@ const opGetConfig = "GetConfig" type GetConfigRequest struct { *aws.Request Input *GetConfigInput + Copy func(*GetConfigInput) GetConfigRequest } // Send marshals and sends the GetConfig API request. @@ -660,7 +671,7 @@ func (c *CloudHSM) GetConfigRequest(input *GetConfigInput) GetConfigRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetConfigRequest{Request: req, Input: input} + return GetConfigRequest{Request: req, Input: input, Copy: c.GetConfigRequest} } const opListAvailableZones = "ListAvailableZones" @@ -669,6 +680,7 @@ const opListAvailableZones = "ListAvailableZones" type ListAvailableZonesRequest struct { *aws.Request Input *ListAvailableZonesInput + Copy func(*ListAvailableZonesInput) ListAvailableZonesRequest } // Send marshals and sends the ListAvailableZones API request. @@ -718,7 +730,7 @@ func (c *CloudHSM) ListAvailableZonesRequest(input *ListAvailableZonesInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAvailableZonesRequest{Request: req, Input: input} + return ListAvailableZonesRequest{Request: req, Input: input, Copy: c.ListAvailableZonesRequest} } const opListHapgs = "ListHapgs" @@ -727,6 +739,7 @@ const opListHapgs = "ListHapgs" type ListHapgsRequest struct { *aws.Request Input *ListHapgsInput + Copy func(*ListHapgsInput) ListHapgsRequest } // Send marshals and sends the ListHapgs API request. @@ -781,7 +794,7 @@ func (c *CloudHSM) ListHapgsRequest(input *ListHapgsInput) ListHapgsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListHapgsRequest{Request: req, Input: input} + return ListHapgsRequest{Request: req, Input: input, Copy: c.ListHapgsRequest} } const opListHsms = "ListHsms" @@ -790,6 +803,7 @@ const opListHsms = "ListHsms" type ListHsmsRequest struct { *aws.Request Input *ListHsmsInput + Copy func(*ListHsmsInput) ListHsmsRequest } // Send marshals and sends the ListHsms API request. @@ -845,7 +859,7 @@ func (c *CloudHSM) ListHsmsRequest(input *ListHsmsInput) ListHsmsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListHsmsRequest{Request: req, Input: input} + return ListHsmsRequest{Request: req, Input: input, Copy: c.ListHsmsRequest} } const opListLunaClients = "ListLunaClients" @@ -854,6 +868,7 @@ const opListLunaClients = "ListLunaClients" type ListLunaClientsRequest struct { *aws.Request Input *ListLunaClientsInput + Copy func(*ListLunaClientsInput) ListLunaClientsRequest } // Send marshals and sends the ListLunaClients API request. @@ -908,7 +923,7 @@ func (c *CloudHSM) ListLunaClientsRequest(input *ListLunaClientsInput) ListLunaC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListLunaClientsRequest{Request: req, Input: input} + return ListLunaClientsRequest{Request: req, Input: input, Copy: c.ListLunaClientsRequest} } const opListTagsForResource = "ListTagsForResource" @@ -917,6 +932,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -966,7 +982,7 @@ func (c *CloudHSM) ListTagsForResourceRequest(input *ListTagsForResourceInput) L req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opModifyHapg = "ModifyHapg" @@ -975,6 +991,7 @@ const opModifyHapg = "ModifyHapg" type ModifyHapgRequest struct { *aws.Request Input *ModifyHapgInput + Copy func(*ModifyHapgInput) ModifyHapgRequest } // Send marshals and sends the ModifyHapg API request. @@ -1024,7 +1041,7 @@ func (c *CloudHSM) ModifyHapgRequest(input *ModifyHapgInput) ModifyHapgRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyHapgRequest{Request: req, Input: input} + return ModifyHapgRequest{Request: req, Input: input, Copy: c.ModifyHapgRequest} } const opModifyHsm = "ModifyHsm" @@ -1033,6 +1050,7 @@ const opModifyHsm = "ModifyHsm" type ModifyHsmRequest struct { *aws.Request Input *ModifyHsmInput + Copy func(*ModifyHsmInput) ModifyHsmRequest } // Send marshals and sends the ModifyHsm API request. @@ -1088,7 +1106,7 @@ func (c *CloudHSM) ModifyHsmRequest(input *ModifyHsmInput) ModifyHsmRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyHsmRequest{Request: req, Input: input} + return ModifyHsmRequest{Request: req, Input: input, Copy: c.ModifyHsmRequest} } const opModifyLunaClient = "ModifyLunaClient" @@ -1097,6 +1115,7 @@ const opModifyLunaClient = "ModifyLunaClient" type ModifyLunaClientRequest struct { *aws.Request Input *ModifyLunaClientInput + Copy func(*ModifyLunaClientInput) ModifyLunaClientRequest } // Send marshals and sends the ModifyLunaClient API request. @@ -1149,7 +1168,7 @@ func (c *CloudHSM) ModifyLunaClientRequest(input *ModifyLunaClientInput) ModifyL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyLunaClientRequest{Request: req, Input: input} + return ModifyLunaClientRequest{Request: req, Input: input, Copy: c.ModifyLunaClientRequest} } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -1158,6 +1177,7 @@ const opRemoveTagsFromResource = "RemoveTagsFromResource" type RemoveTagsFromResourceRequest struct { *aws.Request Input *RemoveTagsFromResourceInput + Copy func(*RemoveTagsFromResourceInput) RemoveTagsFromResourceRequest } // Send marshals and sends the RemoveTagsFromResource API request. @@ -1210,7 +1230,7 @@ func (c *CloudHSM) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromResourceRequest{Request: req, Input: input} + return RemoveTagsFromResourceRequest{Request: req, Input: input, Copy: c.RemoveTagsFromResourceRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudhsm-2014-05-30/AddTagsToResourceRequest diff --git a/service/cloudhsmv2/api.go b/service/cloudhsmv2/api.go index a52b24bccb6..505fb907b3f 100644 --- a/service/cloudhsmv2/api.go +++ b/service/cloudhsmv2/api.go @@ -16,6 +16,7 @@ const opCreateCluster = "CreateCluster" type CreateClusterRequest struct { *aws.Request Input *CreateClusterInput + Copy func(*CreateClusterInput) CreateClusterRequest } // Send marshals and sends the CreateCluster API request. @@ -56,7 +57,7 @@ func (c *CloudHSMV2) CreateClusterRequest(input *CreateClusterInput) CreateClust req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClusterRequest{Request: req, Input: input} + return CreateClusterRequest{Request: req, Input: input, Copy: c.CreateClusterRequest} } const opCreateHsm = "CreateHsm" @@ -65,6 +66,7 @@ const opCreateHsm = "CreateHsm" type CreateHsmRequest struct { *aws.Request Input *CreateHsmInput + Copy func(*CreateHsmInput) CreateHsmRequest } // Send marshals and sends the CreateHsm API request. @@ -106,7 +108,7 @@ func (c *CloudHSMV2) CreateHsmRequest(input *CreateHsmInput) CreateHsmRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHsmRequest{Request: req, Input: input} + return CreateHsmRequest{Request: req, Input: input, Copy: c.CreateHsmRequest} } const opDeleteCluster = "DeleteCluster" @@ -115,6 +117,7 @@ const opDeleteCluster = "DeleteCluster" type DeleteClusterRequest struct { *aws.Request Input *DeleteClusterInput + Copy func(*DeleteClusterInput) DeleteClusterRequest } // Send marshals and sends the DeleteCluster API request. @@ -157,7 +160,7 @@ func (c *CloudHSMV2) DeleteClusterRequest(input *DeleteClusterInput) DeleteClust req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteClusterRequest{Request: req, Input: input} + return DeleteClusterRequest{Request: req, Input: input, Copy: c.DeleteClusterRequest} } const opDeleteHsm = "DeleteHsm" @@ -166,6 +169,7 @@ const opDeleteHsm = "DeleteHsm" type DeleteHsmRequest struct { *aws.Request Input *DeleteHsmInput + Copy func(*DeleteHsmInput) DeleteHsmRequest } // Send marshals and sends the DeleteHsm API request. @@ -209,7 +213,7 @@ func (c *CloudHSMV2) DeleteHsmRequest(input *DeleteHsmInput) DeleteHsmRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteHsmRequest{Request: req, Input: input} + return DeleteHsmRequest{Request: req, Input: input, Copy: c.DeleteHsmRequest} } const opDescribeBackups = "DescribeBackups" @@ -218,6 +222,7 @@ const opDescribeBackups = "DescribeBackups" type DescribeBackupsRequest struct { *aws.Request Input *DescribeBackupsInput + Copy func(*DescribeBackupsInput) DescribeBackupsRequest } // Send marshals and sends the DescribeBackups API request. @@ -271,57 +276,53 @@ func (c *CloudHSMV2) DescribeBackupsRequest(input *DescribeBackupsInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBackupsRequest{Request: req, Input: input} + return DescribeBackupsRequest{Request: req, Input: input, Copy: c.DescribeBackupsRequest} } -// DescribeBackupsPages iterates over the pages of a DescribeBackups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeBackups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeBackupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeBackups operation. -// pageNum := 0 -// err := client.DescribeBackupsPages(params, -// func(page *DescribeBackupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.DescribeBackupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *CloudHSMV2) DescribeBackupsPages(input *DescribeBackupsInput, fn func(*DescribeBackupsOutput, bool) bool) error { - return c.DescribeBackupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeBackupsPagesWithContext same as DescribeBackupsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudHSMV2) DescribeBackupsPagesWithContext(ctx aws.Context, input *DescribeBackupsInput, fn func(*DescribeBackupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeBackupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeBackupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *DescribeBackupsRequest) Paginate(opts ...aws.Option) DescribeBackupsPager { + return DescribeBackupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeBackupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeBackupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeBackupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeBackupsPager struct { + aws.Pager +} + +func (p *DescribeBackupsPager) CurrentPage() *DescribeBackupsOutput { + return p.Pager.CurrentPage().(*DescribeBackupsOutput) } const opDescribeClusters = "DescribeClusters" @@ -330,6 +331,7 @@ const opDescribeClusters = "DescribeClusters" type DescribeClustersRequest struct { *aws.Request Input *DescribeClustersInput + Copy func(*DescribeClustersInput) DescribeClustersRequest } // Send marshals and sends the DescribeClusters API request. @@ -383,57 +385,53 @@ func (c *CloudHSMV2) DescribeClustersRequest(input *DescribeClustersInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClustersRequest{Request: req, Input: input} + return DescribeClustersRequest{Request: req, Input: input, Copy: c.DescribeClustersRequest} } -// DescribeClustersPages iterates over the pages of a DescribeClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeClustersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeClusters operation. -// pageNum := 0 -// err := client.DescribeClustersPages(params, -// func(page *DescribeClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.DescribeClustersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *CloudHSMV2) DescribeClustersPages(input *DescribeClustersInput, fn func(*DescribeClustersOutput, bool) bool) error { - return c.DescribeClustersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeClustersPagesWithContext same as DescribeClustersPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudHSMV2) DescribeClustersPagesWithContext(ctx aws.Context, input *DescribeClustersInput, fn func(*DescribeClustersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeClustersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeClustersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *DescribeClustersRequest) Paginate(opts ...aws.Option) DescribeClustersPager { + return DescribeClustersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeClustersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClustersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeClustersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeClustersPager struct { + aws.Pager +} + +func (p *DescribeClustersPager) CurrentPage() *DescribeClustersOutput { + return p.Pager.CurrentPage().(*DescribeClustersOutput) } const opInitializeCluster = "InitializeCluster" @@ -442,6 +440,7 @@ const opInitializeCluster = "InitializeCluster" type InitializeClusterRequest struct { *aws.Request Input *InitializeClusterInput + Copy func(*InitializeClusterInput) InitializeClusterRequest } // Send marshals and sends the InitializeCluster API request. @@ -485,7 +484,7 @@ func (c *CloudHSMV2) InitializeClusterRequest(input *InitializeClusterInput) Ini req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InitializeClusterRequest{Request: req, Input: input} + return InitializeClusterRequest{Request: req, Input: input, Copy: c.InitializeClusterRequest} } const opListTags = "ListTags" @@ -494,6 +493,7 @@ const opListTags = "ListTags" type ListTagsRequest struct { *aws.Request Input *ListTagsInput + Copy func(*ListTagsInput) ListTagsRequest } // Send marshals and sends the ListTags API request. @@ -546,57 +546,53 @@ func (c *CloudHSMV2) ListTagsRequest(input *ListTagsInput) ListTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsRequest{Request: req, Input: input} + return ListTagsRequest{Request: req, Input: input, Copy: c.ListTagsRequest} } -// ListTagsPages iterates over the pages of a ListTags operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTags method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTagsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTags operation. -// pageNum := 0 -// err := client.ListTagsPages(params, -// func(page *ListTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListTagsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *CloudHSMV2) ListTagsPages(input *ListTagsInput, fn func(*ListTagsOutput, bool) bool) error { - return c.ListTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTagsPagesWithContext same as ListTagsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudHSMV2) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, fn func(*ListTagsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListTagsRequest) Paginate(opts ...aws.Option) ListTagsPager { + return ListTagsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTagsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) - } - return p.Err() +// ListTagsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTagsPager struct { + aws.Pager +} + +func (p *ListTagsPager) CurrentPage() *ListTagsOutput { + return p.Pager.CurrentPage().(*ListTagsOutput) } const opTagResource = "TagResource" @@ -605,6 +601,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -645,7 +642,7 @@ func (c *CloudHSMV2) TagResourceRequest(input *TagResourceInput) TagResourceRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource" @@ -654,6 +651,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -694,7 +692,7 @@ func (c *CloudHSMV2) UntagResourceRequest(input *UntagResourceInput) UntagResour req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } // Contains information about a backup of an AWS CloudHSM cluster. diff --git a/service/cloudhsmv2/cloudhsmv2iface/interface.go b/service/cloudhsmv2/cloudhsmv2iface/interface.go index 2bdf26e7e30..148fb9e1291 100644 --- a/service/cloudhsmv2/cloudhsmv2iface/interface.go +++ b/service/cloudhsmv2/cloudhsmv2iface/interface.go @@ -9,7 +9,6 @@ package cloudhsmv2iface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudhsmv2" ) @@ -73,21 +72,12 @@ type CloudHSMV2API interface { DescribeBackupsRequest(*cloudhsmv2.DescribeBackupsInput) cloudhsmv2.DescribeBackupsRequest - DescribeBackupsPages(*cloudhsmv2.DescribeBackupsInput, func(*cloudhsmv2.DescribeBackupsOutput, bool) bool) error - DescribeBackupsPagesWithContext(aws.Context, *cloudhsmv2.DescribeBackupsInput, func(*cloudhsmv2.DescribeBackupsOutput, bool) bool, ...aws.Option) error - DescribeClustersRequest(*cloudhsmv2.DescribeClustersInput) cloudhsmv2.DescribeClustersRequest - DescribeClustersPages(*cloudhsmv2.DescribeClustersInput, func(*cloudhsmv2.DescribeClustersOutput, bool) bool) error - DescribeClustersPagesWithContext(aws.Context, *cloudhsmv2.DescribeClustersInput, func(*cloudhsmv2.DescribeClustersOutput, bool) bool, ...aws.Option) error - InitializeClusterRequest(*cloudhsmv2.InitializeClusterInput) cloudhsmv2.InitializeClusterRequest ListTagsRequest(*cloudhsmv2.ListTagsInput) cloudhsmv2.ListTagsRequest - ListTagsPages(*cloudhsmv2.ListTagsInput, func(*cloudhsmv2.ListTagsOutput, bool) bool) error - ListTagsPagesWithContext(aws.Context, *cloudhsmv2.ListTagsInput, func(*cloudhsmv2.ListTagsOutput, bool) bool, ...aws.Option) error - TagResourceRequest(*cloudhsmv2.TagResourceInput) cloudhsmv2.TagResourceRequest UntagResourceRequest(*cloudhsmv2.UntagResourceInput) cloudhsmv2.UntagResourceRequest diff --git a/service/cloudsearch/api.go b/service/cloudsearch/api.go index c19be816efa..2d5a4ce23ab 100644 --- a/service/cloudsearch/api.go +++ b/service/cloudsearch/api.go @@ -15,6 +15,7 @@ const opBuildSuggesters = "BuildSuggesters" type BuildSuggestersRequest struct { *aws.Request Input *BuildSuggestersInput + Copy func(*BuildSuggestersInput) BuildSuggestersRequest } // Send marshals and sends the BuildSuggesters API request. @@ -55,7 +56,7 @@ func (c *CloudSearch) BuildSuggestersRequest(input *BuildSuggestersInput) BuildS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BuildSuggestersRequest{Request: req, Input: input} + return BuildSuggestersRequest{Request: req, Input: input, Copy: c.BuildSuggestersRequest} } const opCreateDomain = "CreateDomain" @@ -64,6 +65,7 @@ const opCreateDomain = "CreateDomain" type CreateDomainRequest struct { *aws.Request Input *CreateDomainInput + Copy func(*CreateDomainInput) CreateDomainRequest } // Send marshals and sends the CreateDomain API request. @@ -104,7 +106,7 @@ func (c *CloudSearch) CreateDomainRequest(input *CreateDomainInput) CreateDomain req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDomainRequest{Request: req, Input: input} + return CreateDomainRequest{Request: req, Input: input, Copy: c.CreateDomainRequest} } const opDefineAnalysisScheme = "DefineAnalysisScheme" @@ -113,6 +115,7 @@ const opDefineAnalysisScheme = "DefineAnalysisScheme" type DefineAnalysisSchemeRequest struct { *aws.Request Input *DefineAnalysisSchemeInput + Copy func(*DefineAnalysisSchemeInput) DefineAnalysisSchemeRequest } // Send marshals and sends the DefineAnalysisScheme API request. @@ -154,7 +157,7 @@ func (c *CloudSearch) DefineAnalysisSchemeRequest(input *DefineAnalysisSchemeInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DefineAnalysisSchemeRequest{Request: req, Input: input} + return DefineAnalysisSchemeRequest{Request: req, Input: input, Copy: c.DefineAnalysisSchemeRequest} } const opDefineExpression = "DefineExpression" @@ -163,6 +166,7 @@ const opDefineExpression = "DefineExpression" type DefineExpressionRequest struct { *aws.Request Input *DefineExpressionInput + Copy func(*DefineExpressionInput) DefineExpressionRequest } // Send marshals and sends the DefineExpression API request. @@ -204,7 +208,7 @@ func (c *CloudSearch) DefineExpressionRequest(input *DefineExpressionInput) Defi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DefineExpressionRequest{Request: req, Input: input} + return DefineExpressionRequest{Request: req, Input: input, Copy: c.DefineExpressionRequest} } const opDefineIndexField = "DefineIndexField" @@ -213,6 +217,7 @@ const opDefineIndexField = "DefineIndexField" type DefineIndexFieldRequest struct { *aws.Request Input *DefineIndexFieldInput + Copy func(*DefineIndexFieldInput) DefineIndexFieldRequest } // Send marshals and sends the DefineIndexField API request. @@ -258,7 +263,7 @@ func (c *CloudSearch) DefineIndexFieldRequest(input *DefineIndexFieldInput) Defi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DefineIndexFieldRequest{Request: req, Input: input} + return DefineIndexFieldRequest{Request: req, Input: input, Copy: c.DefineIndexFieldRequest} } const opDefineSuggester = "DefineSuggester" @@ -267,6 +272,7 @@ const opDefineSuggester = "DefineSuggester" type DefineSuggesterRequest struct { *aws.Request Input *DefineSuggesterInput + Copy func(*DefineSuggesterInput) DefineSuggesterRequest } // Send marshals and sends the DefineSuggester API request. @@ -310,7 +316,7 @@ func (c *CloudSearch) DefineSuggesterRequest(input *DefineSuggesterInput) Define req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DefineSuggesterRequest{Request: req, Input: input} + return DefineSuggesterRequest{Request: req, Input: input, Copy: c.DefineSuggesterRequest} } const opDeleteAnalysisScheme = "DeleteAnalysisScheme" @@ -319,6 +325,7 @@ const opDeleteAnalysisScheme = "DeleteAnalysisScheme" type DeleteAnalysisSchemeRequest struct { *aws.Request Input *DeleteAnalysisSchemeInput + Copy func(*DeleteAnalysisSchemeInput) DeleteAnalysisSchemeRequest } // Send marshals and sends the DeleteAnalysisScheme API request. @@ -359,7 +366,7 @@ func (c *CloudSearch) DeleteAnalysisSchemeRequest(input *DeleteAnalysisSchemeInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteAnalysisSchemeRequest{Request: req, Input: input} + return DeleteAnalysisSchemeRequest{Request: req, Input: input, Copy: c.DeleteAnalysisSchemeRequest} } const opDeleteDomain = "DeleteDomain" @@ -368,6 +375,7 @@ const opDeleteDomain = "DeleteDomain" type DeleteDomainRequest struct { *aws.Request Input *DeleteDomainInput + Copy func(*DeleteDomainInput) DeleteDomainRequest } // Send marshals and sends the DeleteDomain API request. @@ -409,7 +417,7 @@ func (c *CloudSearch) DeleteDomainRequest(input *DeleteDomainInput) DeleteDomain req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDomainRequest{Request: req, Input: input} + return DeleteDomainRequest{Request: req, Input: input, Copy: c.DeleteDomainRequest} } const opDeleteExpression = "DeleteExpression" @@ -418,6 +426,7 @@ const opDeleteExpression = "DeleteExpression" type DeleteExpressionRequest struct { *aws.Request Input *DeleteExpressionInput + Copy func(*DeleteExpressionInput) DeleteExpressionRequest } // Send marshals and sends the DeleteExpression API request. @@ -458,7 +467,7 @@ func (c *CloudSearch) DeleteExpressionRequest(input *DeleteExpressionInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteExpressionRequest{Request: req, Input: input} + return DeleteExpressionRequest{Request: req, Input: input, Copy: c.DeleteExpressionRequest} } const opDeleteIndexField = "DeleteIndexField" @@ -467,6 +476,7 @@ const opDeleteIndexField = "DeleteIndexField" type DeleteIndexFieldRequest struct { *aws.Request Input *DeleteIndexFieldInput + Copy func(*DeleteIndexFieldInput) DeleteIndexFieldRequest } // Send marshals and sends the DeleteIndexField API request. @@ -507,7 +517,7 @@ func (c *CloudSearch) DeleteIndexFieldRequest(input *DeleteIndexFieldInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteIndexFieldRequest{Request: req, Input: input} + return DeleteIndexFieldRequest{Request: req, Input: input, Copy: c.DeleteIndexFieldRequest} } const opDeleteSuggester = "DeleteSuggester" @@ -516,6 +526,7 @@ const opDeleteSuggester = "DeleteSuggester" type DeleteSuggesterRequest struct { *aws.Request Input *DeleteSuggesterInput + Copy func(*DeleteSuggesterInput) DeleteSuggesterRequest } // Send marshals and sends the DeleteSuggester API request. @@ -556,7 +567,7 @@ func (c *CloudSearch) DeleteSuggesterRequest(input *DeleteSuggesterInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSuggesterRequest{Request: req, Input: input} + return DeleteSuggesterRequest{Request: req, Input: input, Copy: c.DeleteSuggesterRequest} } const opDescribeAnalysisSchemes = "DescribeAnalysisSchemes" @@ -565,6 +576,7 @@ const opDescribeAnalysisSchemes = "DescribeAnalysisSchemes" type DescribeAnalysisSchemesRequest struct { *aws.Request Input *DescribeAnalysisSchemesInput + Copy func(*DescribeAnalysisSchemesInput) DescribeAnalysisSchemesRequest } // Send marshals and sends the DescribeAnalysisSchemes API request. @@ -609,7 +621,7 @@ func (c *CloudSearch) DescribeAnalysisSchemesRequest(input *DescribeAnalysisSche req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAnalysisSchemesRequest{Request: req, Input: input} + return DescribeAnalysisSchemesRequest{Request: req, Input: input, Copy: c.DescribeAnalysisSchemesRequest} } const opDescribeAvailabilityOptions = "DescribeAvailabilityOptions" @@ -618,6 +630,7 @@ const opDescribeAvailabilityOptions = "DescribeAvailabilityOptions" type DescribeAvailabilityOptionsRequest struct { *aws.Request Input *DescribeAvailabilityOptionsInput + Copy func(*DescribeAvailabilityOptionsInput) DescribeAvailabilityOptionsRequest } // Send marshals and sends the DescribeAvailabilityOptions API request. @@ -660,7 +673,7 @@ func (c *CloudSearch) DescribeAvailabilityOptionsRequest(input *DescribeAvailabi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAvailabilityOptionsRequest{Request: req, Input: input} + return DescribeAvailabilityOptionsRequest{Request: req, Input: input, Copy: c.DescribeAvailabilityOptionsRequest} } const opDescribeDomains = "DescribeDomains" @@ -669,6 +682,7 @@ const opDescribeDomains = "DescribeDomains" type DescribeDomainsRequest struct { *aws.Request Input *DescribeDomainsInput + Copy func(*DescribeDomainsInput) DescribeDomainsRequest } // Send marshals and sends the DescribeDomains API request. @@ -712,7 +726,7 @@ func (c *CloudSearch) DescribeDomainsRequest(input *DescribeDomainsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDomainsRequest{Request: req, Input: input} + return DescribeDomainsRequest{Request: req, Input: input, Copy: c.DescribeDomainsRequest} } const opDescribeExpressions = "DescribeExpressions" @@ -721,6 +735,7 @@ const opDescribeExpressions = "DescribeExpressions" type DescribeExpressionsRequest struct { *aws.Request Input *DescribeExpressionsInput + Copy func(*DescribeExpressionsInput) DescribeExpressionsRequest } // Send marshals and sends the DescribeExpressions API request. @@ -764,7 +779,7 @@ func (c *CloudSearch) DescribeExpressionsRequest(input *DescribeExpressionsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeExpressionsRequest{Request: req, Input: input} + return DescribeExpressionsRequest{Request: req, Input: input, Copy: c.DescribeExpressionsRequest} } const opDescribeIndexFields = "DescribeIndexFields" @@ -773,6 +788,7 @@ const opDescribeIndexFields = "DescribeIndexFields" type DescribeIndexFieldsRequest struct { *aws.Request Input *DescribeIndexFieldsInput + Copy func(*DescribeIndexFieldsInput) DescribeIndexFieldsRequest } // Send marshals and sends the DescribeIndexFields API request. @@ -816,7 +832,7 @@ func (c *CloudSearch) DescribeIndexFieldsRequest(input *DescribeIndexFieldsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIndexFieldsRequest{Request: req, Input: input} + return DescribeIndexFieldsRequest{Request: req, Input: input, Copy: c.DescribeIndexFieldsRequest} } const opDescribeScalingParameters = "DescribeScalingParameters" @@ -825,6 +841,7 @@ const opDescribeScalingParameters = "DescribeScalingParameters" type DescribeScalingParametersRequest struct { *aws.Request Input *DescribeScalingParametersInput + Copy func(*DescribeScalingParametersInput) DescribeScalingParametersRequest } // Send marshals and sends the DescribeScalingParameters API request. @@ -866,7 +883,7 @@ func (c *CloudSearch) DescribeScalingParametersRequest(input *DescribeScalingPar req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScalingParametersRequest{Request: req, Input: input} + return DescribeScalingParametersRequest{Request: req, Input: input, Copy: c.DescribeScalingParametersRequest} } const opDescribeServiceAccessPolicies = "DescribeServiceAccessPolicies" @@ -875,6 +892,7 @@ const opDescribeServiceAccessPolicies = "DescribeServiceAccessPolicies" type DescribeServiceAccessPoliciesRequest struct { *aws.Request Input *DescribeServiceAccessPoliciesInput + Copy func(*DescribeServiceAccessPoliciesInput) DescribeServiceAccessPoliciesRequest } // Send marshals and sends the DescribeServiceAccessPolicies API request. @@ -918,7 +936,7 @@ func (c *CloudSearch) DescribeServiceAccessPoliciesRequest(input *DescribeServic req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeServiceAccessPoliciesRequest{Request: req, Input: input} + return DescribeServiceAccessPoliciesRequest{Request: req, Input: input, Copy: c.DescribeServiceAccessPoliciesRequest} } const opDescribeSuggesters = "DescribeSuggesters" @@ -927,6 +945,7 @@ const opDescribeSuggesters = "DescribeSuggesters" type DescribeSuggestersRequest struct { *aws.Request Input *DescribeSuggestersInput + Copy func(*DescribeSuggestersInput) DescribeSuggestersRequest } // Send marshals and sends the DescribeSuggesters API request. @@ -971,7 +990,7 @@ func (c *CloudSearch) DescribeSuggestersRequest(input *DescribeSuggestersInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSuggestersRequest{Request: req, Input: input} + return DescribeSuggestersRequest{Request: req, Input: input, Copy: c.DescribeSuggestersRequest} } const opIndexDocuments = "IndexDocuments" @@ -980,6 +999,7 @@ const opIndexDocuments = "IndexDocuments" type IndexDocumentsRequest struct { *aws.Request Input *IndexDocumentsInput + Copy func(*IndexDocumentsInput) IndexDocumentsRequest } // Send marshals and sends the IndexDocuments API request. @@ -1020,7 +1040,7 @@ func (c *CloudSearch) IndexDocumentsRequest(input *IndexDocumentsInput) IndexDoc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return IndexDocumentsRequest{Request: req, Input: input} + return IndexDocumentsRequest{Request: req, Input: input, Copy: c.IndexDocumentsRequest} } const opListDomainNames = "ListDomainNames" @@ -1029,6 +1049,7 @@ const opListDomainNames = "ListDomainNames" type ListDomainNamesRequest struct { *aws.Request Input *ListDomainNamesInput + Copy func(*ListDomainNamesInput) ListDomainNamesRequest } // Send marshals and sends the ListDomainNames API request. @@ -1067,7 +1088,7 @@ func (c *CloudSearch) ListDomainNamesRequest(input *ListDomainNamesInput) ListDo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDomainNamesRequest{Request: req, Input: input} + return ListDomainNamesRequest{Request: req, Input: input, Copy: c.ListDomainNamesRequest} } const opUpdateAvailabilityOptions = "UpdateAvailabilityOptions" @@ -1076,6 +1097,7 @@ const opUpdateAvailabilityOptions = "UpdateAvailabilityOptions" type UpdateAvailabilityOptionsRequest struct { *aws.Request Input *UpdateAvailabilityOptionsInput + Copy func(*UpdateAvailabilityOptionsInput) UpdateAvailabilityOptionsRequest } // Send marshals and sends the UpdateAvailabilityOptions API request. @@ -1119,7 +1141,7 @@ func (c *CloudSearch) UpdateAvailabilityOptionsRequest(input *UpdateAvailability req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAvailabilityOptionsRequest{Request: req, Input: input} + return UpdateAvailabilityOptionsRequest{Request: req, Input: input, Copy: c.UpdateAvailabilityOptionsRequest} } const opUpdateScalingParameters = "UpdateScalingParameters" @@ -1128,6 +1150,7 @@ const opUpdateScalingParameters = "UpdateScalingParameters" type UpdateScalingParametersRequest struct { *aws.Request Input *UpdateScalingParametersInput + Copy func(*UpdateScalingParametersInput) UpdateScalingParametersRequest } // Send marshals and sends the UpdateScalingParameters API request. @@ -1173,7 +1196,7 @@ func (c *CloudSearch) UpdateScalingParametersRequest(input *UpdateScalingParamet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateScalingParametersRequest{Request: req, Input: input} + return UpdateScalingParametersRequest{Request: req, Input: input, Copy: c.UpdateScalingParametersRequest} } const opUpdateServiceAccessPolicies = "UpdateServiceAccessPolicies" @@ -1182,6 +1205,7 @@ const opUpdateServiceAccessPolicies = "UpdateServiceAccessPolicies" type UpdateServiceAccessPoliciesRequest struct { *aws.Request Input *UpdateServiceAccessPoliciesInput + Copy func(*UpdateServiceAccessPoliciesInput) UpdateServiceAccessPoliciesRequest } // Send marshals and sends the UpdateServiceAccessPolicies API request. @@ -1222,7 +1246,7 @@ func (c *CloudSearch) UpdateServiceAccessPoliciesRequest(input *UpdateServiceAcc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateServiceAccessPoliciesRequest{Request: req, Input: input} + return UpdateServiceAccessPoliciesRequest{Request: req, Input: input, Copy: c.UpdateServiceAccessPoliciesRequest} } // The configured access rules for the domain's document and search endpoints, diff --git a/service/cloudsearchdomain/api.go b/service/cloudsearchdomain/api.go index c07ba13e390..562a1d1a877 100644 --- a/service/cloudsearchdomain/api.go +++ b/service/cloudsearchdomain/api.go @@ -16,6 +16,7 @@ const opSearch = "Search" type SearchRequest struct { *aws.Request Input *SearchInput + Copy func(*SearchInput) SearchRequest } // Send marshals and sends the Search API request. @@ -74,7 +75,7 @@ func (c *CloudSearchDomain) SearchRequest(input *SearchInput) SearchRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchRequest{Request: req, Input: input} + return SearchRequest{Request: req, Input: input, Copy: c.SearchRequest} } const opSuggest = "Suggest" @@ -83,6 +84,7 @@ const opSuggest = "Suggest" type SuggestRequest struct { *aws.Request Input *SuggestInput + Copy func(*SuggestInput) SuggestRequest } // Send marshals and sends the Suggest API request. @@ -137,7 +139,7 @@ func (c *CloudSearchDomain) SuggestRequest(input *SuggestInput) SuggestRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SuggestRequest{Request: req, Input: input} + return SuggestRequest{Request: req, Input: input, Copy: c.SuggestRequest} } const opUploadDocuments = "UploadDocuments" @@ -146,6 +148,7 @@ const opUploadDocuments = "UploadDocuments" type UploadDocumentsRequest struct { *aws.Request Input *UploadDocumentsInput + Copy func(*UploadDocumentsInput) UploadDocumentsRequest } // Send marshals and sends the UploadDocuments API request. @@ -205,7 +208,7 @@ func (c *CloudSearchDomain) UploadDocumentsRequest(input *UploadDocumentsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UploadDocumentsRequest{Request: req, Input: input} + return UploadDocumentsRequest{Request: req, Input: input, Copy: c.UploadDocumentsRequest} } // A container for facet information. diff --git a/service/cloudtrail/api.go b/service/cloudtrail/api.go index 6171abc7679..becdfb7a0ab 100644 --- a/service/cloudtrail/api.go +++ b/service/cloudtrail/api.go @@ -16,6 +16,7 @@ const opAddTags = "AddTags" type AddTagsRequest struct { *aws.Request Input *AddTagsInput + Copy func(*AddTagsInput) AddTagsRequest } // Send marshals and sends the AddTags API request. @@ -61,7 +62,7 @@ func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) AddTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsRequest{Request: req, Input: input} + return AddTagsRequest{Request: req, Input: input, Copy: c.AddTagsRequest} } const opCreateTrail = "CreateTrail" @@ -70,6 +71,7 @@ const opCreateTrail = "CreateTrail" type CreateTrailRequest struct { *aws.Request Input *CreateTrailInput + Copy func(*CreateTrailInput) CreateTrailRequest } // Send marshals and sends the CreateTrail API request. @@ -112,7 +114,7 @@ func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) CreateTrailRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTrailRequest{Request: req, Input: input} + return CreateTrailRequest{Request: req, Input: input, Copy: c.CreateTrailRequest} } const opDeleteTrail = "DeleteTrail" @@ -121,6 +123,7 @@ const opDeleteTrail = "DeleteTrail" type DeleteTrailRequest struct { *aws.Request Input *DeleteTrailInput + Copy func(*DeleteTrailInput) DeleteTrailRequest } // Send marshals and sends the DeleteTrail API request. @@ -163,7 +166,7 @@ func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) DeleteTrailRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTrailRequest{Request: req, Input: input} + return DeleteTrailRequest{Request: req, Input: input, Copy: c.DeleteTrailRequest} } const opDescribeTrails = "DescribeTrails" @@ -172,6 +175,7 @@ const opDescribeTrails = "DescribeTrails" type DescribeTrailsRequest struct { *aws.Request Input *DescribeTrailsInput + Copy func(*DescribeTrailsInput) DescribeTrailsRequest } // Send marshals and sends the DescribeTrails API request. @@ -213,7 +217,7 @@ func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) DescribeT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTrailsRequest{Request: req, Input: input} + return DescribeTrailsRequest{Request: req, Input: input, Copy: c.DescribeTrailsRequest} } const opGetEventSelectors = "GetEventSelectors" @@ -222,6 +226,7 @@ const opGetEventSelectors = "GetEventSelectors" type GetEventSelectorsRequest struct { *aws.Request Input *GetEventSelectorsInput + Copy func(*GetEventSelectorsInput) GetEventSelectorsRequest } // Send marshals and sends the GetEventSelectors API request. @@ -274,7 +279,7 @@ func (c *CloudTrail) GetEventSelectorsRequest(input *GetEventSelectorsInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetEventSelectorsRequest{Request: req, Input: input} + return GetEventSelectorsRequest{Request: req, Input: input, Copy: c.GetEventSelectorsRequest} } const opGetTrailStatus = "GetTrailStatus" @@ -283,6 +288,7 @@ const opGetTrailStatus = "GetTrailStatus" type GetTrailStatusRequest struct { *aws.Request Input *GetTrailStatusInput + Copy func(*GetTrailStatusInput) GetTrailStatusRequest } // Send marshals and sends the GetTrailStatus API request. @@ -327,7 +333,7 @@ func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) GetTrailS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTrailStatusRequest{Request: req, Input: input} + return GetTrailStatusRequest{Request: req, Input: input, Copy: c.GetTrailStatusRequest} } const opListPublicKeys = "ListPublicKeys" @@ -336,6 +342,7 @@ const opListPublicKeys = "ListPublicKeys" type ListPublicKeysRequest struct { *aws.Request Input *ListPublicKeysInput + Copy func(*ListPublicKeysInput) ListPublicKeysRequest } // Send marshals and sends the ListPublicKeys API request. @@ -383,7 +390,7 @@ func (c *CloudTrail) ListPublicKeysRequest(input *ListPublicKeysInput) ListPubli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPublicKeysRequest{Request: req, Input: input} + return ListPublicKeysRequest{Request: req, Input: input, Copy: c.ListPublicKeysRequest} } const opListTags = "ListTags" @@ -392,6 +399,7 @@ const opListTags = "ListTags" type ListTagsRequest struct { *aws.Request Input *ListTagsInput + Copy func(*ListTagsInput) ListTagsRequest } // Send marshals and sends the ListTags API request. @@ -432,7 +440,7 @@ func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) ListTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsRequest{Request: req, Input: input} + return ListTagsRequest{Request: req, Input: input, Copy: c.ListTagsRequest} } const opLookupEvents = "LookupEvents" @@ -441,6 +449,7 @@ const opLookupEvents = "LookupEvents" type LookupEventsRequest struct { *aws.Request Input *LookupEventsInput + Copy func(*LookupEventsInput) LookupEventsRequest } // Send marshals and sends the LookupEvents API request. @@ -512,57 +521,53 @@ func (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) LookupEventsR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return LookupEventsRequest{Request: req, Input: input} + return LookupEventsRequest{Request: req, Input: input, Copy: c.LookupEventsRequest} } -// LookupEventsPages iterates over the pages of a LookupEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See LookupEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a LookupEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a LookupEvents operation. -// pageNum := 0 -// err := client.LookupEventsPages(params, -// func(page *LookupEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudTrail) LookupEventsPages(input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool) error { - return c.LookupEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// LookupEventsPagesWithContext same as LookupEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) LookupEventsPagesWithContext(ctx aws.Context, input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *LookupEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.LookupEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.LookupEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *LookupEventsRequest) Paginate(opts ...aws.Option) LookupEventsPager { + return LookupEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *LookupEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*LookupEventsOutput), !p.HasNextPage()) - } - return p.Err() +// LookupEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type LookupEventsPager struct { + aws.Pager +} + +func (p *LookupEventsPager) CurrentPage() *LookupEventsOutput { + return p.Pager.CurrentPage().(*LookupEventsOutput) } const opPutEventSelectors = "PutEventSelectors" @@ -571,6 +576,7 @@ const opPutEventSelectors = "PutEventSelectors" type PutEventSelectorsRequest struct { *aws.Request Input *PutEventSelectorsInput + Copy func(*PutEventSelectorsInput) PutEventSelectorsRequest } // Send marshals and sends the PutEventSelectors API request. @@ -638,7 +644,7 @@ func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) Put req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutEventSelectorsRequest{Request: req, Input: input} + return PutEventSelectorsRequest{Request: req, Input: input, Copy: c.PutEventSelectorsRequest} } const opRemoveTags = "RemoveTags" @@ -647,6 +653,7 @@ const opRemoveTags = "RemoveTags" type RemoveTagsRequest struct { *aws.Request Input *RemoveTagsInput + Copy func(*RemoveTagsInput) RemoveTagsRequest } // Send marshals and sends the RemoveTags API request. @@ -687,7 +694,7 @@ func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) RemoveTagsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsRequest{Request: req, Input: input} + return RemoveTagsRequest{Request: req, Input: input, Copy: c.RemoveTagsRequest} } const opStartLogging = "StartLogging" @@ -696,6 +703,7 @@ const opStartLogging = "StartLogging" type StartLoggingRequest struct { *aws.Request Input *StartLoggingInput + Copy func(*StartLoggingInput) StartLoggingRequest } // Send marshals and sends the StartLogging API request. @@ -740,7 +748,7 @@ func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) StartLoggingR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartLoggingRequest{Request: req, Input: input} + return StartLoggingRequest{Request: req, Input: input, Copy: c.StartLoggingRequest} } const opStopLogging = "StopLogging" @@ -749,6 +757,7 @@ const opStopLogging = "StopLogging" type StopLoggingRequest struct { *aws.Request Input *StopLoggingInput + Copy func(*StopLoggingInput) StopLoggingRequest } // Send marshals and sends the StopLogging API request. @@ -795,7 +804,7 @@ func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) StopLoggingRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopLoggingRequest{Request: req, Input: input} + return StopLoggingRequest{Request: req, Input: input, Copy: c.StopLoggingRequest} } const opUpdateTrail = "UpdateTrail" @@ -804,6 +813,7 @@ const opUpdateTrail = "UpdateTrail" type UpdateTrailRequest struct { *aws.Request Input *UpdateTrailInput + Copy func(*UpdateTrailInput) UpdateTrailRequest } // Send marshals and sends the UpdateTrail API request. @@ -849,7 +859,7 @@ func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) UpdateTrailRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTrailRequest{Request: req, Input: input} + return UpdateTrailRequest{Request: req, Input: input, Copy: c.UpdateTrailRequest} } // Specifies the tags to add to a trail. diff --git a/service/cloudtrail/cloudtrailiface/interface.go b/service/cloudtrail/cloudtrailiface/interface.go index 146c502cc10..f9e116589f3 100644 --- a/service/cloudtrail/cloudtrailiface/interface.go +++ b/service/cloudtrail/cloudtrailiface/interface.go @@ -9,7 +9,6 @@ package cloudtrailiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudtrail" ) @@ -81,9 +80,6 @@ type CloudTrailAPI interface { LookupEventsRequest(*cloudtrail.LookupEventsInput) cloudtrail.LookupEventsRequest - LookupEventsPages(*cloudtrail.LookupEventsInput, func(*cloudtrail.LookupEventsOutput, bool) bool) error - LookupEventsPagesWithContext(aws.Context, *cloudtrail.LookupEventsInput, func(*cloudtrail.LookupEventsOutput, bool) bool, ...aws.Option) error - PutEventSelectorsRequest(*cloudtrail.PutEventSelectorsInput) cloudtrail.PutEventSelectorsRequest RemoveTagsRequest(*cloudtrail.RemoveTagsInput) cloudtrail.RemoveTagsRequest diff --git a/service/cloudwatch/api.go b/service/cloudwatch/api.go index ceb5595b53e..4ad999349d3 100644 --- a/service/cloudwatch/api.go +++ b/service/cloudwatch/api.go @@ -18,6 +18,7 @@ const opDeleteAlarms = "DeleteAlarms" type DeleteAlarmsRequest struct { *aws.Request Input *DeleteAlarmsInput + Copy func(*DeleteAlarmsInput) DeleteAlarmsRequest } // Send marshals and sends the DeleteAlarms API request. @@ -60,7 +61,7 @@ func (c *CloudWatch) DeleteAlarmsRequest(input *DeleteAlarmsInput) DeleteAlarmsR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAlarmsRequest{Request: req, Input: input} + return DeleteAlarmsRequest{Request: req, Input: input, Copy: c.DeleteAlarmsRequest} } const opDeleteDashboards = "DeleteDashboards" @@ -69,6 +70,7 @@ const opDeleteDashboards = "DeleteDashboards" type DeleteDashboardsRequest struct { *aws.Request Input *DeleteDashboardsInput + Copy func(*DeleteDashboardsInput) DeleteDashboardsRequest } // Send marshals and sends the DeleteDashboards API request. @@ -110,7 +112,7 @@ func (c *CloudWatch) DeleteDashboardsRequest(input *DeleteDashboardsInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDashboardsRequest{Request: req, Input: input} + return DeleteDashboardsRequest{Request: req, Input: input, Copy: c.DeleteDashboardsRequest} } const opDescribeAlarmHistory = "DescribeAlarmHistory" @@ -119,6 +121,7 @@ const opDescribeAlarmHistory = "DescribeAlarmHistory" type DescribeAlarmHistoryRequest struct { *aws.Request Input *DescribeAlarmHistoryInput + Copy func(*DescribeAlarmHistoryInput) DescribeAlarmHistoryRequest } // Send marshals and sends the DescribeAlarmHistory API request. @@ -169,57 +172,53 @@ func (c *CloudWatch) DescribeAlarmHistoryRequest(input *DescribeAlarmHistoryInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAlarmHistoryRequest{Request: req, Input: input} + return DescribeAlarmHistoryRequest{Request: req, Input: input, Copy: c.DescribeAlarmHistoryRequest} } -// DescribeAlarmHistoryPages iterates over the pages of a DescribeAlarmHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAlarmHistory method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeAlarmHistoryRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeAlarmHistory operation. -// pageNum := 0 -// err := client.DescribeAlarmHistoryPages(params, -// func(page *DescribeAlarmHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatch) DescribeAlarmHistoryPages(input *DescribeAlarmHistoryInput, fn func(*DescribeAlarmHistoryOutput, bool) bool) error { - return c.DescribeAlarmHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeAlarmHistoryPagesWithContext same as DescribeAlarmHistoryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatch) DescribeAlarmHistoryPagesWithContext(ctx aws.Context, input *DescribeAlarmHistoryInput, fn func(*DescribeAlarmHistoryOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeAlarmHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeAlarmHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeAlarmHistoryRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeAlarmHistoryRequest) Paginate(opts ...aws.Option) DescribeAlarmHistoryPager { + return DescribeAlarmHistoryPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeAlarmHistoryInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAlarmHistoryOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeAlarmHistoryPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeAlarmHistoryPager struct { + aws.Pager +} + +func (p *DescribeAlarmHistoryPager) CurrentPage() *DescribeAlarmHistoryOutput { + return p.Pager.CurrentPage().(*DescribeAlarmHistoryOutput) } const opDescribeAlarms = "DescribeAlarms" @@ -228,6 +227,7 @@ const opDescribeAlarms = "DescribeAlarms" type DescribeAlarmsRequest struct { *aws.Request Input *DescribeAlarmsInput + Copy func(*DescribeAlarmsInput) DescribeAlarmsRequest } // Send marshals and sends the DescribeAlarms API request. @@ -276,57 +276,53 @@ func (c *CloudWatch) DescribeAlarmsRequest(input *DescribeAlarmsInput) DescribeA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAlarmsRequest{Request: req, Input: input} + return DescribeAlarmsRequest{Request: req, Input: input, Copy: c.DescribeAlarmsRequest} } -// DescribeAlarmsPages iterates over the pages of a DescribeAlarms operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAlarms method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeAlarmsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeAlarms operation. -// pageNum := 0 -// err := client.DescribeAlarmsPages(params, -// func(page *DescribeAlarmsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatch) DescribeAlarmsPages(input *DescribeAlarmsInput, fn func(*DescribeAlarmsOutput, bool) bool) error { - return c.DescribeAlarmsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeAlarmsPagesWithContext same as DescribeAlarmsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatch) DescribeAlarmsPagesWithContext(ctx aws.Context, input *DescribeAlarmsInput, fn func(*DescribeAlarmsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeAlarmsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeAlarmsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeAlarmsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeAlarmsRequest) Paginate(opts ...aws.Option) DescribeAlarmsPager { + return DescribeAlarmsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeAlarmsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAlarmsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeAlarmsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeAlarmsPager struct { + aws.Pager +} + +func (p *DescribeAlarmsPager) CurrentPage() *DescribeAlarmsOutput { + return p.Pager.CurrentPage().(*DescribeAlarmsOutput) } const opDescribeAlarmsForMetric = "DescribeAlarmsForMetric" @@ -335,6 +331,7 @@ const opDescribeAlarmsForMetric = "DescribeAlarmsForMetric" type DescribeAlarmsForMetricRequest struct { *aws.Request Input *DescribeAlarmsForMetricInput + Copy func(*DescribeAlarmsForMetricInput) DescribeAlarmsForMetricRequest } // Send marshals and sends the DescribeAlarmsForMetric API request. @@ -376,7 +373,7 @@ func (c *CloudWatch) DescribeAlarmsForMetricRequest(input *DescribeAlarmsForMetr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAlarmsForMetricRequest{Request: req, Input: input} + return DescribeAlarmsForMetricRequest{Request: req, Input: input, Copy: c.DescribeAlarmsForMetricRequest} } const opDisableAlarmActions = "DisableAlarmActions" @@ -385,6 +382,7 @@ const opDisableAlarmActions = "DisableAlarmActions" type DisableAlarmActionsRequest struct { *aws.Request Input *DisableAlarmActionsInput + Copy func(*DisableAlarmActionsInput) DisableAlarmActionsRequest } // Send marshals and sends the DisableAlarmActions API request. @@ -428,7 +426,7 @@ func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisableAlarmActionsRequest{Request: req, Input: input} + return DisableAlarmActionsRequest{Request: req, Input: input, Copy: c.DisableAlarmActionsRequest} } const opEnableAlarmActions = "EnableAlarmActions" @@ -437,6 +435,7 @@ const opEnableAlarmActions = "EnableAlarmActions" type EnableAlarmActionsRequest struct { *aws.Request Input *EnableAlarmActionsInput + Copy func(*EnableAlarmActionsInput) EnableAlarmActionsRequest } // Send marshals and sends the EnableAlarmActions API request. @@ -479,7 +478,7 @@ func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) E req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableAlarmActionsRequest{Request: req, Input: input} + return EnableAlarmActionsRequest{Request: req, Input: input, Copy: c.EnableAlarmActionsRequest} } const opGetDashboard = "GetDashboard" @@ -488,6 +487,7 @@ const opGetDashboard = "GetDashboard" type GetDashboardRequest struct { *aws.Request Input *GetDashboardInput + Copy func(*GetDashboardInput) GetDashboardRequest } // Send marshals and sends the GetDashboard API request. @@ -532,7 +532,7 @@ func (c *CloudWatch) GetDashboardRequest(input *GetDashboardInput) GetDashboardR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDashboardRequest{Request: req, Input: input} + return GetDashboardRequest{Request: req, Input: input, Copy: c.GetDashboardRequest} } const opGetMetricStatistics = "GetMetricStatistics" @@ -541,6 +541,7 @@ const opGetMetricStatistics = "GetMetricStatistics" type GetMetricStatisticsRequest struct { *aws.Request Input *GetMetricStatisticsInput + Copy func(*GetMetricStatisticsInput) GetMetricStatisticsRequest } // Send marshals and sends the GetMetricStatistics API request. @@ -631,7 +632,7 @@ func (c *CloudWatch) GetMetricStatisticsRequest(input *GetMetricStatisticsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMetricStatisticsRequest{Request: req, Input: input} + return GetMetricStatisticsRequest{Request: req, Input: input, Copy: c.GetMetricStatisticsRequest} } const opListDashboards = "ListDashboards" @@ -640,6 +641,7 @@ const opListDashboards = "ListDashboards" type ListDashboardsRequest struct { *aws.Request Input *ListDashboardsInput + Copy func(*ListDashboardsInput) ListDashboardsRequest } // Send marshals and sends the ListDashboards API request. @@ -682,7 +684,7 @@ func (c *CloudWatch) ListDashboardsRequest(input *ListDashboardsInput) ListDashb req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDashboardsRequest{Request: req, Input: input} + return ListDashboardsRequest{Request: req, Input: input, Copy: c.ListDashboardsRequest} } const opListMetrics = "ListMetrics" @@ -691,6 +693,7 @@ const opListMetrics = "ListMetrics" type ListMetricsRequest struct { *aws.Request Input *ListMetricsInput + Copy func(*ListMetricsInput) ListMetricsRequest } // Send marshals and sends the ListMetrics API request. @@ -745,57 +748,53 @@ func (c *CloudWatch) ListMetricsRequest(input *ListMetricsInput) ListMetricsRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListMetricsRequest{Request: req, Input: input} + return ListMetricsRequest{Request: req, Input: input, Copy: c.ListMetricsRequest} } -// ListMetricsPages iterates over the pages of a ListMetrics operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMetrics method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListMetricsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListMetrics operation. -// pageNum := 0 -// err := client.ListMetricsPages(params, -// func(page *ListMetricsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatch) ListMetricsPages(input *ListMetricsInput, fn func(*ListMetricsOutput, bool) bool) error { - return c.ListMetricsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMetricsPagesWithContext same as ListMetricsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatch) ListMetricsPagesWithContext(ctx aws.Context, input *ListMetricsInput, fn func(*ListMetricsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListMetricsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListMetricsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListMetricsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListMetricsRequest) Paginate(opts ...aws.Option) ListMetricsPager { + return ListMetricsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListMetricsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMetricsOutput), !p.HasNextPage()) - } - return p.Err() +// ListMetricsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListMetricsPager struct { + aws.Pager +} + +func (p *ListMetricsPager) CurrentPage() *ListMetricsOutput { + return p.Pager.CurrentPage().(*ListMetricsOutput) } const opPutDashboard = "PutDashboard" @@ -804,6 +803,7 @@ const opPutDashboard = "PutDashboard" type PutDashboardRequest struct { *aws.Request Input *PutDashboardInput + Copy func(*PutDashboardInput) PutDashboardRequest } // Send marshals and sends the PutDashboard API request. @@ -862,7 +862,7 @@ func (c *CloudWatch) PutDashboardRequest(input *PutDashboardInput) PutDashboardR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutDashboardRequest{Request: req, Input: input} + return PutDashboardRequest{Request: req, Input: input, Copy: c.PutDashboardRequest} } const opPutMetricAlarm = "PutMetricAlarm" @@ -871,6 +871,7 @@ const opPutMetricAlarm = "PutMetricAlarm" type PutMetricAlarmRequest struct { *aws.Request Input *PutMetricAlarmInput + Copy func(*PutMetricAlarmInput) PutMetricAlarmRequest } // Send marshals and sends the PutMetricAlarm API request. @@ -954,7 +955,7 @@ func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) PutMetric req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutMetricAlarmRequest{Request: req, Input: input} + return PutMetricAlarmRequest{Request: req, Input: input, Copy: c.PutMetricAlarmRequest} } const opPutMetricData = "PutMetricData" @@ -963,6 +964,7 @@ const opPutMetricData = "PutMetricData" type PutMetricDataRequest struct { *aws.Request Input *PutMetricDataInput + Copy func(*PutMetricDataInput) PutMetricDataRequest } // Send marshals and sends the PutMetricData API request. @@ -1033,7 +1035,7 @@ func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) PutMetricDa req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutMetricDataRequest{Request: req, Input: input} + return PutMetricDataRequest{Request: req, Input: input, Copy: c.PutMetricDataRequest} } const opSetAlarmState = "SetAlarmState" @@ -1042,6 +1044,7 @@ const opSetAlarmState = "SetAlarmState" type SetAlarmStateRequest struct { *aws.Request Input *SetAlarmStateInput + Copy func(*SetAlarmStateInput) SetAlarmStateRequest } // Send marshals and sends the SetAlarmState API request. @@ -1091,7 +1094,7 @@ func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) SetAlarmSta req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetAlarmStateRequest{Request: req, Input: input} + return SetAlarmStateRequest{Request: req, Input: input, Copy: c.SetAlarmStateRequest} } // Represents the history of a specific alarm. diff --git a/service/cloudwatch/cloudwatchiface/interface.go b/service/cloudwatch/cloudwatchiface/interface.go index d106443b37e..4c2a07a92e7 100644 --- a/service/cloudwatch/cloudwatchiface/interface.go +++ b/service/cloudwatch/cloudwatchiface/interface.go @@ -69,14 +69,8 @@ type CloudWatchAPI interface { DescribeAlarmHistoryRequest(*cloudwatch.DescribeAlarmHistoryInput) cloudwatch.DescribeAlarmHistoryRequest - DescribeAlarmHistoryPages(*cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool) error - DescribeAlarmHistoryPagesWithContext(aws.Context, *cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool, ...aws.Option) error - DescribeAlarmsRequest(*cloudwatch.DescribeAlarmsInput) cloudwatch.DescribeAlarmsRequest - DescribeAlarmsPages(*cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool) error - DescribeAlarmsPagesWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool, ...aws.Option) error - DescribeAlarmsForMetricRequest(*cloudwatch.DescribeAlarmsForMetricInput) cloudwatch.DescribeAlarmsForMetricRequest DisableAlarmActionsRequest(*cloudwatch.DisableAlarmActionsInput) cloudwatch.DisableAlarmActionsRequest @@ -91,9 +85,6 @@ type CloudWatchAPI interface { ListMetricsRequest(*cloudwatch.ListMetricsInput) cloudwatch.ListMetricsRequest - ListMetricsPages(*cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool) error - ListMetricsPagesWithContext(aws.Context, *cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool, ...aws.Option) error - PutDashboardRequest(*cloudwatch.PutDashboardInput) cloudwatch.PutDashboardRequest PutMetricAlarmRequest(*cloudwatch.PutMetricAlarmInput) cloudwatch.PutMetricAlarmRequest diff --git a/service/cloudwatchevents/api.go b/service/cloudwatchevents/api.go index ffe95401b6a..e7b1ad11ff9 100644 --- a/service/cloudwatchevents/api.go +++ b/service/cloudwatchevents/api.go @@ -18,6 +18,7 @@ const opDeleteRule = "DeleteRule" type DeleteRuleRequest struct { *aws.Request Input *DeleteRuleInput + Copy func(*DeleteRuleInput) DeleteRuleRequest } // Send marshals and sends the DeleteRule API request. @@ -66,7 +67,7 @@ func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) DeleteRuleR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteRuleRequest{Request: req, Input: input} + return DeleteRuleRequest{Request: req, Input: input, Copy: c.DeleteRuleRequest} } const opDescribeEventBus = "DescribeEventBus" @@ -75,6 +76,7 @@ const opDescribeEventBus = "DescribeEventBus" type DescribeEventBusRequest struct { *aws.Request Input *DescribeEventBusInput + Copy func(*DescribeEventBusInput) DescribeEventBusRequest } // Send marshals and sends the DescribeEventBus API request. @@ -117,7 +119,7 @@ func (c *CloudWatchEvents) DescribeEventBusRequest(input *DescribeEventBusInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventBusRequest{Request: req, Input: input} + return DescribeEventBusRequest{Request: req, Input: input, Copy: c.DescribeEventBusRequest} } const opDescribeRule = "DescribeRule" @@ -126,6 +128,7 @@ const opDescribeRule = "DescribeRule" type DescribeRuleRequest struct { *aws.Request Input *DescribeRuleInput + Copy func(*DescribeRuleInput) DescribeRuleRequest } // Send marshals and sends the DescribeRule API request. @@ -166,7 +169,7 @@ func (c *CloudWatchEvents) DescribeRuleRequest(input *DescribeRuleInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRuleRequest{Request: req, Input: input} + return DescribeRuleRequest{Request: req, Input: input, Copy: c.DescribeRuleRequest} } const opDisableRule = "DisableRule" @@ -175,6 +178,7 @@ const opDisableRule = "DisableRule" type DisableRuleRequest struct { *aws.Request Input *DisableRuleInput + Copy func(*DisableRuleInput) DisableRuleRequest } // Send marshals and sends the DisableRule API request. @@ -221,7 +225,7 @@ func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) DisableRu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisableRuleRequest{Request: req, Input: input} + return DisableRuleRequest{Request: req, Input: input, Copy: c.DisableRuleRequest} } const opEnableRule = "EnableRule" @@ -230,6 +234,7 @@ const opEnableRule = "EnableRule" type EnableRuleRequest struct { *aws.Request Input *EnableRuleInput + Copy func(*EnableRuleInput) EnableRuleRequest } // Send marshals and sends the EnableRule API request. @@ -276,7 +281,7 @@ func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) EnableRuleR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableRuleRequest{Request: req, Input: input} + return EnableRuleRequest{Request: req, Input: input, Copy: c.EnableRuleRequest} } const opListRuleNamesByTarget = "ListRuleNamesByTarget" @@ -285,6 +290,7 @@ const opListRuleNamesByTarget = "ListRuleNamesByTarget" type ListRuleNamesByTargetRequest struct { *aws.Request Input *ListRuleNamesByTargetInput + Copy func(*ListRuleNamesByTargetInput) ListRuleNamesByTargetRequest } // Send marshals and sends the ListRuleNamesByTarget API request. @@ -326,7 +332,7 @@ func (c *CloudWatchEvents) ListRuleNamesByTargetRequest(input *ListRuleNamesByTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRuleNamesByTargetRequest{Request: req, Input: input} + return ListRuleNamesByTargetRequest{Request: req, Input: input, Copy: c.ListRuleNamesByTargetRequest} } const opListRules = "ListRules" @@ -335,6 +341,7 @@ const opListRules = "ListRules" type ListRulesRequest struct { *aws.Request Input *ListRulesInput + Copy func(*ListRulesInput) ListRulesRequest } // Send marshals and sends the ListRules API request. @@ -376,7 +383,7 @@ func (c *CloudWatchEvents) ListRulesRequest(input *ListRulesInput) ListRulesRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRulesRequest{Request: req, Input: input} + return ListRulesRequest{Request: req, Input: input, Copy: c.ListRulesRequest} } const opListTargetsByRule = "ListTargetsByRule" @@ -385,6 +392,7 @@ const opListTargetsByRule = "ListTargetsByRule" type ListTargetsByRuleRequest struct { *aws.Request Input *ListTargetsByRuleInput + Copy func(*ListTargetsByRuleInput) ListTargetsByRuleRequest } // Send marshals and sends the ListTargetsByRule API request. @@ -425,7 +433,7 @@ func (c *CloudWatchEvents) ListTargetsByRuleRequest(input *ListTargetsByRuleInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTargetsByRuleRequest{Request: req, Input: input} + return ListTargetsByRuleRequest{Request: req, Input: input, Copy: c.ListTargetsByRuleRequest} } const opPutEvents = "PutEvents" @@ -434,6 +442,7 @@ const opPutEvents = "PutEvents" type PutEventsRequest struct { *aws.Request Input *PutEventsInput + Copy func(*PutEventsInput) PutEventsRequest } // Send marshals and sends the PutEvents API request. @@ -475,7 +484,7 @@ func (c *CloudWatchEvents) PutEventsRequest(input *PutEventsInput) PutEventsRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutEventsRequest{Request: req, Input: input} + return PutEventsRequest{Request: req, Input: input, Copy: c.PutEventsRequest} } const opPutPermission = "PutPermission" @@ -484,6 +493,7 @@ const opPutPermission = "PutPermission" type PutPermissionRequest struct { *aws.Request Input *PutPermissionInput + Copy func(*PutPermissionInput) PutPermissionRequest } // Send marshals and sends the PutPermission API request. @@ -537,7 +547,7 @@ func (c *CloudWatchEvents) PutPermissionRequest(input *PutPermissionInput) PutPe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutPermissionRequest{Request: req, Input: input} + return PutPermissionRequest{Request: req, Input: input, Copy: c.PutPermissionRequest} } const opPutRule = "PutRule" @@ -546,6 +556,7 @@ const opPutRule = "PutRule" type PutRuleRequest struct { *aws.Request Input *PutRuleInput + Copy func(*PutRuleInput) PutRuleRequest } // Send marshals and sends the PutRule API request. @@ -602,7 +613,7 @@ func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) PutRuleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutRuleRequest{Request: req, Input: input} + return PutRuleRequest{Request: req, Input: input, Copy: c.PutRuleRequest} } const opPutTargets = "PutTargets" @@ -611,6 +622,7 @@ const opPutTargets = "PutTargets" type PutTargetsRequest struct { *aws.Request Input *PutTargetsInput + Copy func(*PutTargetsInput) PutTargetsRequest } // Send marshals and sends the PutTargets API request. @@ -738,7 +750,7 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) PutTargetsR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutTargetsRequest{Request: req, Input: input} + return PutTargetsRequest{Request: req, Input: input, Copy: c.PutTargetsRequest} } const opRemovePermission = "RemovePermission" @@ -747,6 +759,7 @@ const opRemovePermission = "RemovePermission" type RemovePermissionRequest struct { *aws.Request Input *RemovePermissionInput + Copy func(*RemovePermissionInput) RemovePermissionRequest } // Send marshals and sends the RemovePermission API request. @@ -792,7 +805,7 @@ func (c *CloudWatchEvents) RemovePermissionRequest(input *RemovePermissionInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemovePermissionRequest{Request: req, Input: input} + return RemovePermissionRequest{Request: req, Input: input, Copy: c.RemovePermissionRequest} } const opRemoveTargets = "RemoveTargets" @@ -801,6 +814,7 @@ const opRemoveTargets = "RemoveTargets" type RemoveTargetsRequest struct { *aws.Request Input *RemoveTargetsInput + Copy func(*RemoveTargetsInput) RemoveTargetsRequest } // Send marshals and sends the RemoveTargets API request. @@ -851,7 +865,7 @@ func (c *CloudWatchEvents) RemoveTargetsRequest(input *RemoveTargetsInput) Remov req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTargetsRequest{Request: req, Input: input} + return RemoveTargetsRequest{Request: req, Input: input, Copy: c.RemoveTargetsRequest} } const opTestEventPattern = "TestEventPattern" @@ -860,6 +874,7 @@ const opTestEventPattern = "TestEventPattern" type TestEventPatternRequest struct { *aws.Request Input *TestEventPatternInput + Copy func(*TestEventPatternInput) TestEventPatternRequest } // Send marshals and sends the TestEventPattern API request. @@ -905,7 +920,7 @@ func (c *CloudWatchEvents) TestEventPatternRequest(input *TestEventPatternInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestEventPatternRequest{Request: req, Input: input} + return TestEventPatternRequest{Request: req, Input: input, Copy: c.TestEventPatternRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRuleRequest diff --git a/service/cloudwatchlogs/api.go b/service/cloudwatchlogs/api.go index f7ff4ddde30..447bd0ad7d1 100644 --- a/service/cloudwatchlogs/api.go +++ b/service/cloudwatchlogs/api.go @@ -17,6 +17,7 @@ const opAssociateKmsKey = "AssociateKmsKey" type AssociateKmsKeyRequest struct { *aws.Request Input *AssociateKmsKeyInput + Copy func(*AssociateKmsKeyInput) AssociateKmsKeyRequest } // Send marshals and sends the AssociateKmsKey API request. @@ -72,7 +73,7 @@ func (c *CloudWatchLogs) AssociateKmsKeyRequest(input *AssociateKmsKeyInput) Ass req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AssociateKmsKeyRequest{Request: req, Input: input} + return AssociateKmsKeyRequest{Request: req, Input: input, Copy: c.AssociateKmsKeyRequest} } const opCancelExportTask = "CancelExportTask" @@ -81,6 +82,7 @@ const opCancelExportTask = "CancelExportTask" type CancelExportTaskRequest struct { *aws.Request Input *CancelExportTaskInput + Copy func(*CancelExportTaskInput) CancelExportTaskRequest } // Send marshals and sends the CancelExportTask API request. @@ -125,7 +127,7 @@ func (c *CloudWatchLogs) CancelExportTaskRequest(input *CancelExportTaskInput) C req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CancelExportTaskRequest{Request: req, Input: input} + return CancelExportTaskRequest{Request: req, Input: input, Copy: c.CancelExportTaskRequest} } const opCreateExportTask = "CreateExportTask" @@ -134,6 +136,7 @@ const opCreateExportTask = "CreateExportTask" type CreateExportTaskRequest struct { *aws.Request Input *CreateExportTaskInput + Copy func(*CreateExportTaskInput) CreateExportTaskRequest } // Send marshals and sends the CreateExportTask API request. @@ -185,7 +188,7 @@ func (c *CloudWatchLogs) CreateExportTaskRequest(input *CreateExportTaskInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateExportTaskRequest{Request: req, Input: input} + return CreateExportTaskRequest{Request: req, Input: input, Copy: c.CreateExportTaskRequest} } const opCreateLogGroup = "CreateLogGroup" @@ -194,6 +197,7 @@ const opCreateLogGroup = "CreateLogGroup" type CreateLogGroupRequest struct { *aws.Request Input *CreateLogGroupInput + Copy func(*CreateLogGroupInput) CreateLogGroupRequest } // Send marshals and sends the CreateLogGroup API request. @@ -257,7 +261,7 @@ func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) Creat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateLogGroupRequest{Request: req, Input: input} + return CreateLogGroupRequest{Request: req, Input: input, Copy: c.CreateLogGroupRequest} } const opCreateLogStream = "CreateLogStream" @@ -266,6 +270,7 @@ const opCreateLogStream = "CreateLogStream" type CreateLogStreamRequest struct { *aws.Request Input *CreateLogStreamInput + Copy func(*CreateLogStreamInput) CreateLogStreamRequest } // Send marshals and sends the CreateLogStream API request. @@ -319,7 +324,7 @@ func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) Cre req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateLogStreamRequest{Request: req, Input: input} + return CreateLogStreamRequest{Request: req, Input: input, Copy: c.CreateLogStreamRequest} } const opDeleteDestination = "DeleteDestination" @@ -328,6 +333,7 @@ const opDeleteDestination = "DeleteDestination" type DeleteDestinationRequest struct { *aws.Request Input *DeleteDestinationInput + Copy func(*DeleteDestinationInput) DeleteDestinationRequest } // Send marshals and sends the DeleteDestination API request. @@ -372,7 +378,7 @@ func (c *CloudWatchLogs) DeleteDestinationRequest(input *DeleteDestinationInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDestinationRequest{Request: req, Input: input} + return DeleteDestinationRequest{Request: req, Input: input, Copy: c.DeleteDestinationRequest} } const opDeleteLogGroup = "DeleteLogGroup" @@ -381,6 +387,7 @@ const opDeleteLogGroup = "DeleteLogGroup" type DeleteLogGroupRequest struct { *aws.Request Input *DeleteLogGroupInput + Copy func(*DeleteLogGroupInput) DeleteLogGroupRequest } // Send marshals and sends the DeleteLogGroup API request. @@ -424,7 +431,7 @@ func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) Delet req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteLogGroupRequest{Request: req, Input: input} + return DeleteLogGroupRequest{Request: req, Input: input, Copy: c.DeleteLogGroupRequest} } const opDeleteLogStream = "DeleteLogStream" @@ -433,6 +440,7 @@ const opDeleteLogStream = "DeleteLogStream" type DeleteLogStreamRequest struct { *aws.Request Input *DeleteLogStreamInput + Copy func(*DeleteLogStreamInput) DeleteLogStreamRequest } // Send marshals and sends the DeleteLogStream API request. @@ -476,7 +484,7 @@ func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) Del req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteLogStreamRequest{Request: req, Input: input} + return DeleteLogStreamRequest{Request: req, Input: input, Copy: c.DeleteLogStreamRequest} } const opDeleteMetricFilter = "DeleteMetricFilter" @@ -485,6 +493,7 @@ const opDeleteMetricFilter = "DeleteMetricFilter" type DeleteMetricFilterRequest struct { *aws.Request Input *DeleteMetricFilterInput + Copy func(*DeleteMetricFilterInput) DeleteMetricFilterRequest } // Send marshals and sends the DeleteMetricFilter API request. @@ -527,7 +536,7 @@ func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteMetricFilterRequest{Request: req, Input: input} + return DeleteMetricFilterRequest{Request: req, Input: input, Copy: c.DeleteMetricFilterRequest} } const opDeleteResourcePolicy = "DeleteResourcePolicy" @@ -536,6 +545,7 @@ const opDeleteResourcePolicy = "DeleteResourcePolicy" type DeleteResourcePolicyRequest struct { *aws.Request Input *DeleteResourcePolicyInput + Copy func(*DeleteResourcePolicyInput) DeleteResourcePolicyRequest } // Send marshals and sends the DeleteResourcePolicy API request. @@ -579,7 +589,7 @@ func (c *CloudWatchLogs) DeleteResourcePolicyRequest(input *DeleteResourcePolicy req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteResourcePolicyRequest{Request: req, Input: input} + return DeleteResourcePolicyRequest{Request: req, Input: input, Copy: c.DeleteResourcePolicyRequest} } const opDeleteRetentionPolicy = "DeleteRetentionPolicy" @@ -588,6 +598,7 @@ const opDeleteRetentionPolicy = "DeleteRetentionPolicy" type DeleteRetentionPolicyRequest struct { *aws.Request Input *DeleteRetentionPolicyInput + Copy func(*DeleteRetentionPolicyInput) DeleteRetentionPolicyRequest } // Send marshals and sends the DeleteRetentionPolicy API request. @@ -633,7 +644,7 @@ func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPoli req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteRetentionPolicyRequest{Request: req, Input: input} + return DeleteRetentionPolicyRequest{Request: req, Input: input, Copy: c.DeleteRetentionPolicyRequest} } const opDeleteSubscriptionFilter = "DeleteSubscriptionFilter" @@ -642,6 +653,7 @@ const opDeleteSubscriptionFilter = "DeleteSubscriptionFilter" type DeleteSubscriptionFilterRequest struct { *aws.Request Input *DeleteSubscriptionFilterInput + Copy func(*DeleteSubscriptionFilterInput) DeleteSubscriptionFilterRequest } // Send marshals and sends the DeleteSubscriptionFilter API request. @@ -684,7 +696,7 @@ func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscripti req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSubscriptionFilterRequest{Request: req, Input: input} + return DeleteSubscriptionFilterRequest{Request: req, Input: input, Copy: c.DeleteSubscriptionFilterRequest} } const opDescribeDestinations = "DescribeDestinations" @@ -693,6 +705,7 @@ const opDescribeDestinations = "DescribeDestinations" type DescribeDestinationsRequest struct { *aws.Request Input *DescribeDestinationsInput + Copy func(*DescribeDestinationsInput) DescribeDestinationsRequest } // Send marshals and sends the DescribeDestinations API request. @@ -740,57 +753,53 @@ func (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinations req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDestinationsRequest{Request: req, Input: input} + return DescribeDestinationsRequest{Request: req, Input: input, Copy: c.DescribeDestinationsRequest} } -// DescribeDestinationsPages iterates over the pages of a DescribeDestinations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDestinations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDestinationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDestinations operation. -// pageNum := 0 -// err := client.DescribeDestinationsPages(params, -// func(page *DescribeDestinationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeDestinationsPages(input *DescribeDestinationsInput, fn func(*DescribeDestinationsOutput, bool) bool) error { - return c.DescribeDestinationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDestinationsPagesWithContext same as DescribeDestinationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatchLogs) DescribeDestinationsPagesWithContext(ctx aws.Context, input *DescribeDestinationsInput, fn func(*DescribeDestinationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDestinationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDestinationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDestinationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDestinationsRequest) Paginate(opts ...aws.Option) DescribeDestinationsPager { + return DescribeDestinationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDestinationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDestinationsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDestinationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDestinationsPager struct { + aws.Pager +} + +func (p *DescribeDestinationsPager) CurrentPage() *DescribeDestinationsOutput { + return p.Pager.CurrentPage().(*DescribeDestinationsOutput) } const opDescribeExportTasks = "DescribeExportTasks" @@ -799,6 +808,7 @@ const opDescribeExportTasks = "DescribeExportTasks" type DescribeExportTasksRequest struct { *aws.Request Input *DescribeExportTasksInput + Copy func(*DescribeExportTasksInput) DescribeExportTasksRequest } // Send marshals and sends the DescribeExportTasks API request. @@ -840,7 +850,7 @@ func (c *CloudWatchLogs) DescribeExportTasksRequest(input *DescribeExportTasksIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeExportTasksRequest{Request: req, Input: input} + return DescribeExportTasksRequest{Request: req, Input: input, Copy: c.DescribeExportTasksRequest} } const opDescribeLogGroups = "DescribeLogGroups" @@ -849,6 +859,7 @@ const opDescribeLogGroups = "DescribeLogGroups" type DescribeLogGroupsRequest struct { *aws.Request Input *DescribeLogGroupsInput + Copy func(*DescribeLogGroupsInput) DescribeLogGroupsRequest } // Send marshals and sends the DescribeLogGroups API request. @@ -896,57 +907,53 @@ func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLogGroupsRequest{Request: req, Input: input} + return DescribeLogGroupsRequest{Request: req, Input: input, Copy: c.DescribeLogGroupsRequest} } -// DescribeLogGroupsPages iterates over the pages of a DescribeLogGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLogGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeLogGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeLogGroups operation. -// pageNum := 0 -// err := client.DescribeLogGroupsPages(params, -// func(page *DescribeLogGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeLogGroupsPages(input *DescribeLogGroupsInput, fn func(*DescribeLogGroupsOutput, bool) bool) error { - return c.DescribeLogGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeLogGroupsPagesWithContext same as DescribeLogGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatchLogs) DescribeLogGroupsPagesWithContext(ctx aws.Context, input *DescribeLogGroupsInput, fn func(*DescribeLogGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeLogGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeLogGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeLogGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeLogGroupsRequest) Paginate(opts ...aws.Option) DescribeLogGroupsPager { + return DescribeLogGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeLogGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLogGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeLogGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeLogGroupsPager struct { + aws.Pager +} + +func (p *DescribeLogGroupsPager) CurrentPage() *DescribeLogGroupsOutput { + return p.Pager.CurrentPage().(*DescribeLogGroupsOutput) } const opDescribeLogStreams = "DescribeLogStreams" @@ -955,6 +962,7 @@ const opDescribeLogStreams = "DescribeLogStreams" type DescribeLogStreamsRequest struct { *aws.Request Input *DescribeLogStreamsInput + Copy func(*DescribeLogStreamsInput) DescribeLogStreamsRequest } // Send marshals and sends the DescribeLogStreams API request. @@ -1006,57 +1014,53 @@ func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLogStreamsRequest{Request: req, Input: input} + return DescribeLogStreamsRequest{Request: req, Input: input, Copy: c.DescribeLogStreamsRequest} } -// DescribeLogStreamsPages iterates over the pages of a DescribeLogStreams operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLogStreams method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeLogStreamsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeLogStreams operation. -// pageNum := 0 -// err := client.DescribeLogStreamsPages(params, -// func(page *DescribeLogStreamsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeLogStreamsPages(input *DescribeLogStreamsInput, fn func(*DescribeLogStreamsOutput, bool) bool) error { - return c.DescribeLogStreamsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeLogStreamsPagesWithContext same as DescribeLogStreamsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatchLogs) DescribeLogStreamsPagesWithContext(ctx aws.Context, input *DescribeLogStreamsInput, fn func(*DescribeLogStreamsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeLogStreamsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeLogStreamsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeLogStreamsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeLogStreamsRequest) Paginate(opts ...aws.Option) DescribeLogStreamsPager { + return DescribeLogStreamsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeLogStreamsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLogStreamsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeLogStreamsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeLogStreamsPager struct { + aws.Pager +} + +func (p *DescribeLogStreamsPager) CurrentPage() *DescribeLogStreamsOutput { + return p.Pager.CurrentPage().(*DescribeLogStreamsOutput) } const opDescribeMetricFilters = "DescribeMetricFilters" @@ -1065,6 +1069,7 @@ const opDescribeMetricFilters = "DescribeMetricFilters" type DescribeMetricFiltersRequest struct { *aws.Request Input *DescribeMetricFiltersInput + Copy func(*DescribeMetricFiltersInput) DescribeMetricFiltersRequest } // Send marshals and sends the DescribeMetricFilters API request. @@ -1113,57 +1118,53 @@ func (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFilte req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMetricFiltersRequest{Request: req, Input: input} + return DescribeMetricFiltersRequest{Request: req, Input: input, Copy: c.DescribeMetricFiltersRequest} } -// DescribeMetricFiltersPages iterates over the pages of a DescribeMetricFilters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeMetricFilters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeMetricFiltersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeMetricFilters operation. -// pageNum := 0 -// err := client.DescribeMetricFiltersPages(params, -// func(page *DescribeMetricFiltersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeMetricFiltersPages(input *DescribeMetricFiltersInput, fn func(*DescribeMetricFiltersOutput, bool) bool) error { - return c.DescribeMetricFiltersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeMetricFiltersPagesWithContext same as DescribeMetricFiltersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatchLogs) DescribeMetricFiltersPagesWithContext(ctx aws.Context, input *DescribeMetricFiltersInput, fn func(*DescribeMetricFiltersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeMetricFiltersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeMetricFiltersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeMetricFiltersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeMetricFiltersRequest) Paginate(opts ...aws.Option) DescribeMetricFiltersPager { + return DescribeMetricFiltersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeMetricFiltersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeMetricFiltersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeMetricFiltersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeMetricFiltersPager struct { + aws.Pager +} + +func (p *DescribeMetricFiltersPager) CurrentPage() *DescribeMetricFiltersOutput { + return p.Pager.CurrentPage().(*DescribeMetricFiltersOutput) } const opDescribeResourcePolicies = "DescribeResourcePolicies" @@ -1172,6 +1173,7 @@ const opDescribeResourcePolicies = "DescribeResourcePolicies" type DescribeResourcePoliciesRequest struct { *aws.Request Input *DescribeResourcePoliciesInput + Copy func(*DescribeResourcePoliciesInput) DescribeResourcePoliciesRequest } // Send marshals and sends the DescribeResourcePolicies API request. @@ -1212,7 +1214,7 @@ func (c *CloudWatchLogs) DescribeResourcePoliciesRequest(input *DescribeResource req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeResourcePoliciesRequest{Request: req, Input: input} + return DescribeResourcePoliciesRequest{Request: req, Input: input, Copy: c.DescribeResourcePoliciesRequest} } const opDescribeSubscriptionFilters = "DescribeSubscriptionFilters" @@ -1221,6 +1223,7 @@ const opDescribeSubscriptionFilters = "DescribeSubscriptionFilters" type DescribeSubscriptionFiltersRequest struct { *aws.Request Input *DescribeSubscriptionFiltersInput + Copy func(*DescribeSubscriptionFiltersInput) DescribeSubscriptionFiltersRequest } // Send marshals and sends the DescribeSubscriptionFilters API request. @@ -1269,57 +1272,53 @@ func (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubsc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSubscriptionFiltersRequest{Request: req, Input: input} + return DescribeSubscriptionFiltersRequest{Request: req, Input: input, Copy: c.DescribeSubscriptionFiltersRequest} } -// DescribeSubscriptionFiltersPages iterates over the pages of a DescribeSubscriptionFilters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSubscriptionFilters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeSubscriptionFiltersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeSubscriptionFilters operation. -// pageNum := 0 -// err := client.DescribeSubscriptionFiltersPages(params, -// func(page *DescribeSubscriptionFiltersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeSubscriptionFiltersPages(input *DescribeSubscriptionFiltersInput, fn func(*DescribeSubscriptionFiltersOutput, bool) bool) error { - return c.DescribeSubscriptionFiltersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSubscriptionFiltersPagesWithContext same as DescribeSubscriptionFiltersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatchLogs) DescribeSubscriptionFiltersPagesWithContext(ctx aws.Context, input *DescribeSubscriptionFiltersInput, fn func(*DescribeSubscriptionFiltersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeSubscriptionFiltersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeSubscriptionFiltersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeSubscriptionFiltersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeSubscriptionFiltersRequest) Paginate(opts ...aws.Option) DescribeSubscriptionFiltersPager { + return DescribeSubscriptionFiltersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeSubscriptionFiltersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSubscriptionFiltersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeSubscriptionFiltersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeSubscriptionFiltersPager struct { + aws.Pager +} + +func (p *DescribeSubscriptionFiltersPager) CurrentPage() *DescribeSubscriptionFiltersOutput { + return p.Pager.CurrentPage().(*DescribeSubscriptionFiltersOutput) } const opDisassociateKmsKey = "DisassociateKmsKey" @@ -1328,6 +1327,7 @@ const opDisassociateKmsKey = "DisassociateKmsKey" type DisassociateKmsKeyRequest struct { *aws.Request Input *DisassociateKmsKeyInput + Copy func(*DisassociateKmsKeyInput) DisassociateKmsKeyRequest } // Send marshals and sends the DisassociateKmsKey API request. @@ -1378,7 +1378,7 @@ func (c *CloudWatchLogs) DisassociateKmsKeyRequest(input *DisassociateKmsKeyInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisassociateKmsKeyRequest{Request: req, Input: input} + return DisassociateKmsKeyRequest{Request: req, Input: input, Copy: c.DisassociateKmsKeyRequest} } const opFilterLogEvents = "FilterLogEvents" @@ -1387,6 +1387,7 @@ const opFilterLogEvents = "FilterLogEvents" type FilterLogEventsRequest struct { *aws.Request Input *FilterLogEventsInput + Copy func(*FilterLogEventsInput) FilterLogEventsRequest } // Send marshals and sends the FilterLogEvents API request. @@ -1441,57 +1442,53 @@ func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) Fil req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return FilterLogEventsRequest{Request: req, Input: input} + return FilterLogEventsRequest{Request: req, Input: input, Copy: c.FilterLogEventsRequest} } -// FilterLogEventsPages iterates over the pages of a FilterLogEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See FilterLogEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a FilterLogEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a FilterLogEvents operation. -// pageNum := 0 -// err := client.FilterLogEventsPages(params, -// func(page *FilterLogEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) FilterLogEventsPages(input *FilterLogEventsInput, fn func(*FilterLogEventsOutput, bool) bool) error { - return c.FilterLogEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// FilterLogEventsPagesWithContext same as FilterLogEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatchLogs) FilterLogEventsPagesWithContext(ctx aws.Context, input *FilterLogEventsInput, fn func(*FilterLogEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *FilterLogEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.FilterLogEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.FilterLogEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *FilterLogEventsRequest) Paginate(opts ...aws.Option) FilterLogEventsPager { + return FilterLogEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *FilterLogEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*FilterLogEventsOutput), !p.HasNextPage()) - } - return p.Err() +// FilterLogEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type FilterLogEventsPager struct { + aws.Pager +} + +func (p *FilterLogEventsPager) CurrentPage() *FilterLogEventsOutput { + return p.Pager.CurrentPage().(*FilterLogEventsOutput) } const opGetLogEvents = "GetLogEvents" @@ -1500,6 +1497,7 @@ const opGetLogEvents = "GetLogEvents" type GetLogEventsRequest struct { *aws.Request Input *GetLogEventsInput + Copy func(*GetLogEventsInput) GetLogEventsRequest } // Send marshals and sends the GetLogEvents API request. @@ -1551,57 +1549,53 @@ func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) GetLogEve req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLogEventsRequest{Request: req, Input: input} + return GetLogEventsRequest{Request: req, Input: input, Copy: c.GetLogEventsRequest} } -// GetLogEventsPages iterates over the pages of a GetLogEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetLogEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetLogEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetLogEvents operation. -// pageNum := 0 -// err := client.GetLogEventsPages(params, -// func(page *GetLogEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) GetLogEventsPages(input *GetLogEventsInput, fn func(*GetLogEventsOutput, bool) bool) error { - return c.GetLogEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetLogEventsPagesWithContext same as GetLogEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudWatchLogs) GetLogEventsPagesWithContext(ctx aws.Context, input *GetLogEventsInput, fn func(*GetLogEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetLogEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetLogEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetLogEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetLogEventsRequest) Paginate(opts ...aws.Option) GetLogEventsPager { + return GetLogEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetLogEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetLogEventsOutput), !p.HasNextPage()) - } - return p.Err() +// GetLogEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetLogEventsPager struct { + aws.Pager +} + +func (p *GetLogEventsPager) CurrentPage() *GetLogEventsOutput { + return p.Pager.CurrentPage().(*GetLogEventsOutput) } const opListTagsLogGroup = "ListTagsLogGroup" @@ -1610,6 +1604,7 @@ const opListTagsLogGroup = "ListTagsLogGroup" type ListTagsLogGroupRequest struct { *aws.Request Input *ListTagsLogGroupInput + Copy func(*ListTagsLogGroupInput) ListTagsLogGroupRequest } // Send marshals and sends the ListTagsLogGroup API request. @@ -1650,7 +1645,7 @@ func (c *CloudWatchLogs) ListTagsLogGroupRequest(input *ListTagsLogGroupInput) L req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsLogGroupRequest{Request: req, Input: input} + return ListTagsLogGroupRequest{Request: req, Input: input, Copy: c.ListTagsLogGroupRequest} } const opPutDestination = "PutDestination" @@ -1659,6 +1654,7 @@ const opPutDestination = "PutDestination" type PutDestinationRequest struct { *aws.Request Input *PutDestinationInput + Copy func(*PutDestinationInput) PutDestinationRequest } // Send marshals and sends the PutDestination API request. @@ -1709,7 +1705,7 @@ func (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) PutDe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutDestinationRequest{Request: req, Input: input} + return PutDestinationRequest{Request: req, Input: input, Copy: c.PutDestinationRequest} } const opPutDestinationPolicy = "PutDestinationPolicy" @@ -1718,6 +1714,7 @@ const opPutDestinationPolicy = "PutDestinationPolicy" type PutDestinationPolicyRequest struct { *aws.Request Input *PutDestinationPolicyInput + Copy func(*PutDestinationPolicyInput) PutDestinationPolicyRequest } // Send marshals and sends the PutDestinationPolicy API request. @@ -1763,7 +1760,7 @@ func (c *CloudWatchLogs) PutDestinationPolicyRequest(input *PutDestinationPolicy req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutDestinationPolicyRequest{Request: req, Input: input} + return PutDestinationPolicyRequest{Request: req, Input: input, Copy: c.PutDestinationPolicyRequest} } const opPutLogEvents = "PutLogEvents" @@ -1772,6 +1769,7 @@ const opPutLogEvents = "PutLogEvents" type PutLogEventsRequest struct { *aws.Request Input *PutLogEventsInput + Copy func(*PutLogEventsInput) PutLogEventsRequest } // Send marshals and sends the PutLogEvents API request. @@ -1839,7 +1837,7 @@ func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) PutLogEve req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutLogEventsRequest{Request: req, Input: input} + return PutLogEventsRequest{Request: req, Input: input, Copy: c.PutLogEventsRequest} } const opPutMetricFilter = "PutMetricFilter" @@ -1848,6 +1846,7 @@ const opPutMetricFilter = "PutMetricFilter" type PutMetricFilterRequest struct { *aws.Request Input *PutMetricFilterInput + Copy func(*PutMetricFilterInput) PutMetricFilterRequest } // Send marshals and sends the PutMetricFilter API request. @@ -1895,7 +1894,7 @@ func (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) Put req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutMetricFilterRequest{Request: req, Input: input} + return PutMetricFilterRequest{Request: req, Input: input, Copy: c.PutMetricFilterRequest} } const opPutResourcePolicy = "PutResourcePolicy" @@ -1904,6 +1903,7 @@ const opPutResourcePolicy = "PutResourcePolicy" type PutResourcePolicyRequest struct { *aws.Request Input *PutResourcePolicyInput + Copy func(*PutResourcePolicyInput) PutResourcePolicyRequest } // Send marshals and sends the PutResourcePolicy API request. @@ -1946,7 +1946,7 @@ func (c *CloudWatchLogs) PutResourcePolicyRequest(input *PutResourcePolicyInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutResourcePolicyRequest{Request: req, Input: input} + return PutResourcePolicyRequest{Request: req, Input: input, Copy: c.PutResourcePolicyRequest} } const opPutRetentionPolicy = "PutRetentionPolicy" @@ -1955,6 +1955,7 @@ const opPutRetentionPolicy = "PutRetentionPolicy" type PutRetentionPolicyRequest struct { *aws.Request Input *PutRetentionPolicyInput + Copy func(*PutRetentionPolicyInput) PutRetentionPolicyRequest } // Send marshals and sends the PutRetentionPolicy API request. @@ -1999,7 +2000,7 @@ func (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutRetentionPolicyRequest{Request: req, Input: input} + return PutRetentionPolicyRequest{Request: req, Input: input, Copy: c.PutRetentionPolicyRequest} } const opPutSubscriptionFilter = "PutSubscriptionFilter" @@ -2008,6 +2009,7 @@ const opPutSubscriptionFilter = "PutSubscriptionFilter" type PutSubscriptionFilterRequest struct { *aws.Request Input *PutSubscriptionFilterInput + Copy func(*PutSubscriptionFilterInput) PutSubscriptionFilterRequest } // Send marshals and sends the PutSubscriptionFilter API request. @@ -2070,7 +2072,7 @@ func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilt req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutSubscriptionFilterRequest{Request: req, Input: input} + return PutSubscriptionFilterRequest{Request: req, Input: input, Copy: c.PutSubscriptionFilterRequest} } const opTagLogGroup = "TagLogGroup" @@ -2079,6 +2081,7 @@ const opTagLogGroup = "TagLogGroup" type TagLogGroupRequest struct { *aws.Request Input *TagLogGroupInput + Copy func(*TagLogGroupInput) TagLogGroupRequest } // Send marshals and sends the TagLogGroup API request. @@ -2128,7 +2131,7 @@ func (c *CloudWatchLogs) TagLogGroupRequest(input *TagLogGroupInput) TagLogGroup req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TagLogGroupRequest{Request: req, Input: input} + return TagLogGroupRequest{Request: req, Input: input, Copy: c.TagLogGroupRequest} } const opTestMetricFilter = "TestMetricFilter" @@ -2137,6 +2140,7 @@ const opTestMetricFilter = "TestMetricFilter" type TestMetricFilterRequest struct { *aws.Request Input *TestMetricFilterInput + Copy func(*TestMetricFilterInput) TestMetricFilterRequest } // Send marshals and sends the TestMetricFilter API request. @@ -2179,7 +2183,7 @@ func (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) T req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestMetricFilterRequest{Request: req, Input: input} + return TestMetricFilterRequest{Request: req, Input: input, Copy: c.TestMetricFilterRequest} } const opUntagLogGroup = "UntagLogGroup" @@ -2188,6 +2192,7 @@ const opUntagLogGroup = "UntagLogGroup" type UntagLogGroupRequest struct { *aws.Request Input *UntagLogGroupInput + Copy func(*UntagLogGroupInput) UntagLogGroupRequest } // Send marshals and sends the UntagLogGroup API request. @@ -2233,7 +2238,7 @@ func (c *CloudWatchLogs) UntagLogGroupRequest(input *UntagLogGroupInput) UntagLo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UntagLogGroupRequest{Request: req, Input: input} + return UntagLogGroupRequest{Request: req, Input: input, Copy: c.UntagLogGroupRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/AssociateKmsKeyRequest diff --git a/service/cloudwatchlogs/cloudwatchlogsiface/interface.go b/service/cloudwatchlogs/cloudwatchlogsiface/interface.go index 96970379007..12c8ed21fbd 100644 --- a/service/cloudwatchlogs/cloudwatchlogsiface/interface.go +++ b/service/cloudwatchlogs/cloudwatchlogsiface/interface.go @@ -9,7 +9,6 @@ package cloudwatchlogsiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs" ) @@ -89,45 +88,24 @@ type CloudWatchLogsAPI interface { DescribeDestinationsRequest(*cloudwatchlogs.DescribeDestinationsInput) cloudwatchlogs.DescribeDestinationsRequest - DescribeDestinationsPages(*cloudwatchlogs.DescribeDestinationsInput, func(*cloudwatchlogs.DescribeDestinationsOutput, bool) bool) error - DescribeDestinationsPagesWithContext(aws.Context, *cloudwatchlogs.DescribeDestinationsInput, func(*cloudwatchlogs.DescribeDestinationsOutput, bool) bool, ...aws.Option) error - DescribeExportTasksRequest(*cloudwatchlogs.DescribeExportTasksInput) cloudwatchlogs.DescribeExportTasksRequest DescribeLogGroupsRequest(*cloudwatchlogs.DescribeLogGroupsInput) cloudwatchlogs.DescribeLogGroupsRequest - DescribeLogGroupsPages(*cloudwatchlogs.DescribeLogGroupsInput, func(*cloudwatchlogs.DescribeLogGroupsOutput, bool) bool) error - DescribeLogGroupsPagesWithContext(aws.Context, *cloudwatchlogs.DescribeLogGroupsInput, func(*cloudwatchlogs.DescribeLogGroupsOutput, bool) bool, ...aws.Option) error - DescribeLogStreamsRequest(*cloudwatchlogs.DescribeLogStreamsInput) cloudwatchlogs.DescribeLogStreamsRequest - DescribeLogStreamsPages(*cloudwatchlogs.DescribeLogStreamsInput, func(*cloudwatchlogs.DescribeLogStreamsOutput, bool) bool) error - DescribeLogStreamsPagesWithContext(aws.Context, *cloudwatchlogs.DescribeLogStreamsInput, func(*cloudwatchlogs.DescribeLogStreamsOutput, bool) bool, ...aws.Option) error - DescribeMetricFiltersRequest(*cloudwatchlogs.DescribeMetricFiltersInput) cloudwatchlogs.DescribeMetricFiltersRequest - DescribeMetricFiltersPages(*cloudwatchlogs.DescribeMetricFiltersInput, func(*cloudwatchlogs.DescribeMetricFiltersOutput, bool) bool) error - DescribeMetricFiltersPagesWithContext(aws.Context, *cloudwatchlogs.DescribeMetricFiltersInput, func(*cloudwatchlogs.DescribeMetricFiltersOutput, bool) bool, ...aws.Option) error - DescribeResourcePoliciesRequest(*cloudwatchlogs.DescribeResourcePoliciesInput) cloudwatchlogs.DescribeResourcePoliciesRequest DescribeSubscriptionFiltersRequest(*cloudwatchlogs.DescribeSubscriptionFiltersInput) cloudwatchlogs.DescribeSubscriptionFiltersRequest - DescribeSubscriptionFiltersPages(*cloudwatchlogs.DescribeSubscriptionFiltersInput, func(*cloudwatchlogs.DescribeSubscriptionFiltersOutput, bool) bool) error - DescribeSubscriptionFiltersPagesWithContext(aws.Context, *cloudwatchlogs.DescribeSubscriptionFiltersInput, func(*cloudwatchlogs.DescribeSubscriptionFiltersOutput, bool) bool, ...aws.Option) error - DisassociateKmsKeyRequest(*cloudwatchlogs.DisassociateKmsKeyInput) cloudwatchlogs.DisassociateKmsKeyRequest FilterLogEventsRequest(*cloudwatchlogs.FilterLogEventsInput) cloudwatchlogs.FilterLogEventsRequest - FilterLogEventsPages(*cloudwatchlogs.FilterLogEventsInput, func(*cloudwatchlogs.FilterLogEventsOutput, bool) bool) error - FilterLogEventsPagesWithContext(aws.Context, *cloudwatchlogs.FilterLogEventsInput, func(*cloudwatchlogs.FilterLogEventsOutput, bool) bool, ...aws.Option) error - GetLogEventsRequest(*cloudwatchlogs.GetLogEventsInput) cloudwatchlogs.GetLogEventsRequest - GetLogEventsPages(*cloudwatchlogs.GetLogEventsInput, func(*cloudwatchlogs.GetLogEventsOutput, bool) bool) error - GetLogEventsPagesWithContext(aws.Context, *cloudwatchlogs.GetLogEventsInput, func(*cloudwatchlogs.GetLogEventsOutput, bool) bool, ...aws.Option) error - ListTagsLogGroupRequest(*cloudwatchlogs.ListTagsLogGroupInput) cloudwatchlogs.ListTagsLogGroupRequest PutDestinationRequest(*cloudwatchlogs.PutDestinationInput) cloudwatchlogs.PutDestinationRequest diff --git a/service/codebuild/api.go b/service/codebuild/api.go index 7ec813fa72f..4b69cf0afcf 100644 --- a/service/codebuild/api.go +++ b/service/codebuild/api.go @@ -16,6 +16,7 @@ const opBatchDeleteBuilds = "BatchDeleteBuilds" type BatchDeleteBuildsRequest struct { *aws.Request Input *BatchDeleteBuildsInput + Copy func(*BatchDeleteBuildsInput) BatchDeleteBuildsRequest } // Send marshals and sends the BatchDeleteBuilds API request. @@ -56,7 +57,7 @@ func (c *CodeBuild) BatchDeleteBuildsRequest(input *BatchDeleteBuildsInput) Batc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchDeleteBuildsRequest{Request: req, Input: input} + return BatchDeleteBuildsRequest{Request: req, Input: input, Copy: c.BatchDeleteBuildsRequest} } const opBatchGetBuilds = "BatchGetBuilds" @@ -65,6 +66,7 @@ const opBatchGetBuilds = "BatchGetBuilds" type BatchGetBuildsRequest struct { *aws.Request Input *BatchGetBuildsInput + Copy func(*BatchGetBuildsInput) BatchGetBuildsRequest } // Send marshals and sends the BatchGetBuilds API request. @@ -105,7 +107,7 @@ func (c *CodeBuild) BatchGetBuildsRequest(input *BatchGetBuildsInput) BatchGetBu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetBuildsRequest{Request: req, Input: input} + return BatchGetBuildsRequest{Request: req, Input: input, Copy: c.BatchGetBuildsRequest} } const opBatchGetProjects = "BatchGetProjects" @@ -114,6 +116,7 @@ const opBatchGetProjects = "BatchGetProjects" type BatchGetProjectsRequest struct { *aws.Request Input *BatchGetProjectsInput + Copy func(*BatchGetProjectsInput) BatchGetProjectsRequest } // Send marshals and sends the BatchGetProjects API request. @@ -154,7 +157,7 @@ func (c *CodeBuild) BatchGetProjectsRequest(input *BatchGetProjectsInput) BatchG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetProjectsRequest{Request: req, Input: input} + return BatchGetProjectsRequest{Request: req, Input: input, Copy: c.BatchGetProjectsRequest} } const opCreateProject = "CreateProject" @@ -163,6 +166,7 @@ const opCreateProject = "CreateProject" type CreateProjectRequest struct { *aws.Request Input *CreateProjectInput + Copy func(*CreateProjectInput) CreateProjectRequest } // Send marshals and sends the CreateProject API request. @@ -203,7 +207,7 @@ func (c *CodeBuild) CreateProjectRequest(input *CreateProjectInput) CreateProjec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateProjectRequest{Request: req, Input: input} + return CreateProjectRequest{Request: req, Input: input, Copy: c.CreateProjectRequest} } const opCreateWebhook = "CreateWebhook" @@ -212,6 +216,7 @@ const opCreateWebhook = "CreateWebhook" type CreateWebhookRequest struct { *aws.Request Input *CreateWebhookInput + Copy func(*CreateWebhookInput) CreateWebhookRequest } // Send marshals and sends the CreateWebhook API request. @@ -263,7 +268,7 @@ func (c *CodeBuild) CreateWebhookRequest(input *CreateWebhookInput) CreateWebhoo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateWebhookRequest{Request: req, Input: input} + return CreateWebhookRequest{Request: req, Input: input, Copy: c.CreateWebhookRequest} } const opDeleteProject = "DeleteProject" @@ -272,6 +277,7 @@ const opDeleteProject = "DeleteProject" type DeleteProjectRequest struct { *aws.Request Input *DeleteProjectInput + Copy func(*DeleteProjectInput) DeleteProjectRequest } // Send marshals and sends the DeleteProject API request. @@ -312,7 +318,7 @@ func (c *CodeBuild) DeleteProjectRequest(input *DeleteProjectInput) DeleteProjec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteProjectRequest{Request: req, Input: input} + return DeleteProjectRequest{Request: req, Input: input, Copy: c.DeleteProjectRequest} } const opDeleteWebhook = "DeleteWebhook" @@ -321,6 +327,7 @@ const opDeleteWebhook = "DeleteWebhook" type DeleteWebhookRequest struct { *aws.Request Input *DeleteWebhookInput + Copy func(*DeleteWebhookInput) DeleteWebhookRequest } // Send marshals and sends the DeleteWebhook API request. @@ -363,7 +370,7 @@ func (c *CodeBuild) DeleteWebhookRequest(input *DeleteWebhookInput) DeleteWebhoo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteWebhookRequest{Request: req, Input: input} + return DeleteWebhookRequest{Request: req, Input: input, Copy: c.DeleteWebhookRequest} } const opInvalidateProjectCache = "InvalidateProjectCache" @@ -372,6 +379,7 @@ const opInvalidateProjectCache = "InvalidateProjectCache" type InvalidateProjectCacheRequest struct { *aws.Request Input *InvalidateProjectCacheInput + Copy func(*InvalidateProjectCacheInput) InvalidateProjectCacheRequest } // Send marshals and sends the InvalidateProjectCache API request. @@ -412,7 +420,7 @@ func (c *CodeBuild) InvalidateProjectCacheRequest(input *InvalidateProjectCacheI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InvalidateProjectCacheRequest{Request: req, Input: input} + return InvalidateProjectCacheRequest{Request: req, Input: input, Copy: c.InvalidateProjectCacheRequest} } const opListBuilds = "ListBuilds" @@ -421,6 +429,7 @@ const opListBuilds = "ListBuilds" type ListBuildsRequest struct { *aws.Request Input *ListBuildsInput + Copy func(*ListBuildsInput) ListBuildsRequest } // Send marshals and sends the ListBuilds API request. @@ -461,7 +470,7 @@ func (c *CodeBuild) ListBuildsRequest(input *ListBuildsInput) ListBuildsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBuildsRequest{Request: req, Input: input} + return ListBuildsRequest{Request: req, Input: input, Copy: c.ListBuildsRequest} } const opListBuildsForProject = "ListBuildsForProject" @@ -470,6 +479,7 @@ const opListBuildsForProject = "ListBuildsForProject" type ListBuildsForProjectRequest struct { *aws.Request Input *ListBuildsForProjectInput + Copy func(*ListBuildsForProjectInput) ListBuildsForProjectRequest } // Send marshals and sends the ListBuildsForProject API request. @@ -511,7 +521,7 @@ func (c *CodeBuild) ListBuildsForProjectRequest(input *ListBuildsForProjectInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBuildsForProjectRequest{Request: req, Input: input} + return ListBuildsForProjectRequest{Request: req, Input: input, Copy: c.ListBuildsForProjectRequest} } const opListCuratedEnvironmentImages = "ListCuratedEnvironmentImages" @@ -520,6 +530,7 @@ const opListCuratedEnvironmentImages = "ListCuratedEnvironmentImages" type ListCuratedEnvironmentImagesRequest struct { *aws.Request Input *ListCuratedEnvironmentImagesInput + Copy func(*ListCuratedEnvironmentImagesInput) ListCuratedEnvironmentImagesRequest } // Send marshals and sends the ListCuratedEnvironmentImages API request. @@ -560,7 +571,7 @@ func (c *CodeBuild) ListCuratedEnvironmentImagesRequest(input *ListCuratedEnviro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCuratedEnvironmentImagesRequest{Request: req, Input: input} + return ListCuratedEnvironmentImagesRequest{Request: req, Input: input, Copy: c.ListCuratedEnvironmentImagesRequest} } const opListProjects = "ListProjects" @@ -569,6 +580,7 @@ const opListProjects = "ListProjects" type ListProjectsRequest struct { *aws.Request Input *ListProjectsInput + Copy func(*ListProjectsInput) ListProjectsRequest } // Send marshals and sends the ListProjects API request. @@ -610,7 +622,7 @@ func (c *CodeBuild) ListProjectsRequest(input *ListProjectsInput) ListProjectsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListProjectsRequest{Request: req, Input: input} + return ListProjectsRequest{Request: req, Input: input, Copy: c.ListProjectsRequest} } const opStartBuild = "StartBuild" @@ -619,6 +631,7 @@ const opStartBuild = "StartBuild" type StartBuildRequest struct { *aws.Request Input *StartBuildInput + Copy func(*StartBuildInput) StartBuildRequest } // Send marshals and sends the StartBuild API request. @@ -659,7 +672,7 @@ func (c *CodeBuild) StartBuildRequest(input *StartBuildInput) StartBuildRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartBuildRequest{Request: req, Input: input} + return StartBuildRequest{Request: req, Input: input, Copy: c.StartBuildRequest} } const opStopBuild = "StopBuild" @@ -668,6 +681,7 @@ const opStopBuild = "StopBuild" type StopBuildRequest struct { *aws.Request Input *StopBuildInput + Copy func(*StopBuildInput) StopBuildRequest } // Send marshals and sends the StopBuild API request. @@ -708,7 +722,7 @@ func (c *CodeBuild) StopBuildRequest(input *StopBuildInput) StopBuildRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopBuildRequest{Request: req, Input: input} + return StopBuildRequest{Request: req, Input: input, Copy: c.StopBuildRequest} } const opUpdateProject = "UpdateProject" @@ -717,6 +731,7 @@ const opUpdateProject = "UpdateProject" type UpdateProjectRequest struct { *aws.Request Input *UpdateProjectInput + Copy func(*UpdateProjectInput) UpdateProjectRequest } // Send marshals and sends the UpdateProject API request. @@ -757,7 +772,7 @@ func (c *CodeBuild) UpdateProjectRequest(input *UpdateProjectInput) UpdateProjec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateProjectRequest{Request: req, Input: input} + return UpdateProjectRequest{Request: req, Input: input, Copy: c.UpdateProjectRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchDeleteBuildsInput diff --git a/service/codecommit/api.go b/service/codecommit/api.go index f205714fea5..ad35510f169 100644 --- a/service/codecommit/api.go +++ b/service/codecommit/api.go @@ -18,6 +18,7 @@ const opBatchGetRepositories = "BatchGetRepositories" type BatchGetRepositoriesRequest struct { *aws.Request Input *BatchGetRepositoriesInput + Copy func(*BatchGetRepositoriesInput) BatchGetRepositoriesRequest } // Send marshals and sends the BatchGetRepositories API request. @@ -64,7 +65,7 @@ func (c *CodeCommit) BatchGetRepositoriesRequest(input *BatchGetRepositoriesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetRepositoriesRequest{Request: req, Input: input} + return BatchGetRepositoriesRequest{Request: req, Input: input, Copy: c.BatchGetRepositoriesRequest} } const opCreateBranch = "CreateBranch" @@ -73,6 +74,7 @@ const opCreateBranch = "CreateBranch" type CreateBranchRequest struct { *aws.Request Input *CreateBranchInput + Copy func(*CreateBranchInput) CreateBranchRequest } // Send marshals and sends the CreateBranch API request. @@ -118,7 +120,7 @@ func (c *CodeCommit) CreateBranchRequest(input *CreateBranchInput) CreateBranchR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateBranchRequest{Request: req, Input: input} + return CreateBranchRequest{Request: req, Input: input, Copy: c.CreateBranchRequest} } const opCreatePullRequest = "CreatePullRequest" @@ -127,6 +129,7 @@ const opCreatePullRequest = "CreatePullRequest" type CreatePullRequestRequest struct { *aws.Request Input *CreatePullRequestInput + Copy func(*CreatePullRequestInput) CreatePullRequestRequest } // Send marshals and sends the CreatePullRequest API request. @@ -167,7 +170,7 @@ func (c *CodeCommit) CreatePullRequestRequest(input *CreatePullRequestInput) Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePullRequestRequest{Request: req, Input: input} + return CreatePullRequestRequest{Request: req, Input: input, Copy: c.CreatePullRequestRequest} } const opCreateRepository = "CreateRepository" @@ -176,6 +179,7 @@ const opCreateRepository = "CreateRepository" type CreateRepositoryRequest struct { *aws.Request Input *CreateRepositoryInput + Copy func(*CreateRepositoryInput) CreateRepositoryRequest } // Send marshals and sends the CreateRepository API request. @@ -216,7 +220,7 @@ func (c *CodeCommit) CreateRepositoryRequest(input *CreateRepositoryInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRepositoryRequest{Request: req, Input: input} + return CreateRepositoryRequest{Request: req, Input: input, Copy: c.CreateRepositoryRequest} } const opDeleteBranch = "DeleteBranch" @@ -225,6 +229,7 @@ const opDeleteBranch = "DeleteBranch" type DeleteBranchRequest struct { *aws.Request Input *DeleteBranchInput + Copy func(*DeleteBranchInput) DeleteBranchRequest } // Send marshals and sends the DeleteBranch API request. @@ -266,7 +271,7 @@ func (c *CodeCommit) DeleteBranchRequest(input *DeleteBranchInput) DeleteBranchR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteBranchRequest{Request: req, Input: input} + return DeleteBranchRequest{Request: req, Input: input, Copy: c.DeleteBranchRequest} } const opDeleteCommentContent = "DeleteCommentContent" @@ -275,6 +280,7 @@ const opDeleteCommentContent = "DeleteCommentContent" type DeleteCommentContentRequest struct { *aws.Request Input *DeleteCommentContentInput + Copy func(*DeleteCommentContentInput) DeleteCommentContentRequest } // Send marshals and sends the DeleteCommentContent API request. @@ -315,7 +321,7 @@ func (c *CodeCommit) DeleteCommentContentRequest(input *DeleteCommentContentInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteCommentContentRequest{Request: req, Input: input} + return DeleteCommentContentRequest{Request: req, Input: input, Copy: c.DeleteCommentContentRequest} } const opDeleteRepository = "DeleteRepository" @@ -324,6 +330,7 @@ const opDeleteRepository = "DeleteRepository" type DeleteRepositoryRequest struct { *aws.Request Input *DeleteRepositoryInput + Copy func(*DeleteRepositoryInput) DeleteRepositoryRequest } // Send marshals and sends the DeleteRepository API request. @@ -369,7 +376,7 @@ func (c *CodeCommit) DeleteRepositoryRequest(input *DeleteRepositoryInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRepositoryRequest{Request: req, Input: input} + return DeleteRepositoryRequest{Request: req, Input: input, Copy: c.DeleteRepositoryRequest} } const opDescribePullRequestEvents = "DescribePullRequestEvents" @@ -378,6 +385,7 @@ const opDescribePullRequestEvents = "DescribePullRequestEvents" type DescribePullRequestEventsRequest struct { *aws.Request Input *DescribePullRequestEventsInput + Copy func(*DescribePullRequestEventsInput) DescribePullRequestEventsRequest } // Send marshals and sends the DescribePullRequestEvents API request. @@ -424,57 +432,53 @@ func (c *CodeCommit) DescribePullRequestEventsRequest(input *DescribePullRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePullRequestEventsRequest{Request: req, Input: input} + return DescribePullRequestEventsRequest{Request: req, Input: input, Copy: c.DescribePullRequestEventsRequest} } -// DescribePullRequestEventsPages iterates over the pages of a DescribePullRequestEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribePullRequestEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribePullRequestEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribePullRequestEvents operation. -// pageNum := 0 -// err := client.DescribePullRequestEventsPages(params, -// func(page *DescribePullRequestEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) DescribePullRequestEventsPages(input *DescribePullRequestEventsInput, fn func(*DescribePullRequestEventsOutput, bool) bool) error { - return c.DescribePullRequestEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribePullRequestEventsPagesWithContext same as DescribePullRequestEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeCommit) DescribePullRequestEventsPagesWithContext(ctx aws.Context, input *DescribePullRequestEventsInput, fn func(*DescribePullRequestEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribePullRequestEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribePullRequestEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribePullRequestEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribePullRequestEventsRequest) Paginate(opts ...aws.Option) DescribePullRequestEventsPager { + return DescribePullRequestEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribePullRequestEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribePullRequestEventsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribePullRequestEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribePullRequestEventsPager struct { + aws.Pager +} + +func (p *DescribePullRequestEventsPager) CurrentPage() *DescribePullRequestEventsOutput { + return p.Pager.CurrentPage().(*DescribePullRequestEventsOutput) } const opGetBlob = "GetBlob" @@ -483,6 +487,7 @@ const opGetBlob = "GetBlob" type GetBlobRequest struct { *aws.Request Input *GetBlobInput + Copy func(*GetBlobInput) GetBlobRequest } // Send marshals and sends the GetBlob API request. @@ -523,7 +528,7 @@ func (c *CodeCommit) GetBlobRequest(input *GetBlobInput) GetBlobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBlobRequest{Request: req, Input: input} + return GetBlobRequest{Request: req, Input: input, Copy: c.GetBlobRequest} } const opGetBranch = "GetBranch" @@ -532,6 +537,7 @@ const opGetBranch = "GetBranch" type GetBranchRequest struct { *aws.Request Input *GetBranchInput + Copy func(*GetBranchInput) GetBranchRequest } // Send marshals and sends the GetBranch API request. @@ -573,7 +579,7 @@ func (c *CodeCommit) GetBranchRequest(input *GetBranchInput) GetBranchRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBranchRequest{Request: req, Input: input} + return GetBranchRequest{Request: req, Input: input, Copy: c.GetBranchRequest} } const opGetComment = "GetComment" @@ -582,6 +588,7 @@ const opGetComment = "GetComment" type GetCommentRequest struct { *aws.Request Input *GetCommentInput + Copy func(*GetCommentInput) GetCommentRequest } // Send marshals and sends the GetComment API request. @@ -622,7 +629,7 @@ func (c *CodeCommit) GetCommentRequest(input *GetCommentInput) GetCommentRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCommentRequest{Request: req, Input: input} + return GetCommentRequest{Request: req, Input: input, Copy: c.GetCommentRequest} } const opGetCommentsForComparedCommit = "GetCommentsForComparedCommit" @@ -631,6 +638,7 @@ const opGetCommentsForComparedCommit = "GetCommentsForComparedCommit" type GetCommentsForComparedCommitRequest struct { *aws.Request Input *GetCommentsForComparedCommitInput + Copy func(*GetCommentsForComparedCommitInput) GetCommentsForComparedCommitRequest } // Send marshals and sends the GetCommentsForComparedCommit API request. @@ -677,57 +685,53 @@ func (c *CodeCommit) GetCommentsForComparedCommitRequest(input *GetCommentsForCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCommentsForComparedCommitRequest{Request: req, Input: input} + return GetCommentsForComparedCommitRequest{Request: req, Input: input, Copy: c.GetCommentsForComparedCommitRequest} } -// GetCommentsForComparedCommitPages iterates over the pages of a GetCommentsForComparedCommit operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetCommentsForComparedCommit method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetCommentsForComparedCommitRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetCommentsForComparedCommit operation. -// pageNum := 0 -// err := client.GetCommentsForComparedCommitPages(params, -// func(page *GetCommentsForComparedCommitOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) GetCommentsForComparedCommitPages(input *GetCommentsForComparedCommitInput, fn func(*GetCommentsForComparedCommitOutput, bool) bool) error { - return c.GetCommentsForComparedCommitPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetCommentsForComparedCommitPagesWithContext same as GetCommentsForComparedCommitPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeCommit) GetCommentsForComparedCommitPagesWithContext(ctx aws.Context, input *GetCommentsForComparedCommitInput, fn func(*GetCommentsForComparedCommitOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetCommentsForComparedCommitInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetCommentsForComparedCommitRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetCommentsForComparedCommitRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetCommentsForComparedCommitRequest) Paginate(opts ...aws.Option) GetCommentsForComparedCommitPager { + return GetCommentsForComparedCommitPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetCommentsForComparedCommitInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetCommentsForComparedCommitOutput), !p.HasNextPage()) - } - return p.Err() +// GetCommentsForComparedCommitPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetCommentsForComparedCommitPager struct { + aws.Pager +} + +func (p *GetCommentsForComparedCommitPager) CurrentPage() *GetCommentsForComparedCommitOutput { + return p.Pager.CurrentPage().(*GetCommentsForComparedCommitOutput) } const opGetCommentsForPullRequest = "GetCommentsForPullRequest" @@ -736,6 +740,7 @@ const opGetCommentsForPullRequest = "GetCommentsForPullRequest" type GetCommentsForPullRequestRequest struct { *aws.Request Input *GetCommentsForPullRequestInput + Copy func(*GetCommentsForPullRequestInput) GetCommentsForPullRequestRequest } // Send marshals and sends the GetCommentsForPullRequest API request. @@ -782,57 +787,53 @@ func (c *CodeCommit) GetCommentsForPullRequestRequest(input *GetCommentsForPullR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCommentsForPullRequestRequest{Request: req, Input: input} + return GetCommentsForPullRequestRequest{Request: req, Input: input, Copy: c.GetCommentsForPullRequestRequest} } -// GetCommentsForPullRequestPages iterates over the pages of a GetCommentsForPullRequest operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetCommentsForPullRequest method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetCommentsForPullRequestRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetCommentsForPullRequest operation. -// pageNum := 0 -// err := client.GetCommentsForPullRequestPages(params, -// func(page *GetCommentsForPullRequestOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) GetCommentsForPullRequestPages(input *GetCommentsForPullRequestInput, fn func(*GetCommentsForPullRequestOutput, bool) bool) error { - return c.GetCommentsForPullRequestPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetCommentsForPullRequestPagesWithContext same as GetCommentsForPullRequestPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeCommit) GetCommentsForPullRequestPagesWithContext(ctx aws.Context, input *GetCommentsForPullRequestInput, fn func(*GetCommentsForPullRequestOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetCommentsForPullRequestInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetCommentsForPullRequestRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetCommentsForPullRequestRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetCommentsForPullRequestRequest) Paginate(opts ...aws.Option) GetCommentsForPullRequestPager { + return GetCommentsForPullRequestPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetCommentsForPullRequestInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetCommentsForPullRequestOutput), !p.HasNextPage()) - } - return p.Err() +// GetCommentsForPullRequestPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetCommentsForPullRequestPager struct { + aws.Pager +} + +func (p *GetCommentsForPullRequestPager) CurrentPage() *GetCommentsForPullRequestOutput { + return p.Pager.CurrentPage().(*GetCommentsForPullRequestOutput) } const opGetCommit = "GetCommit" @@ -841,6 +842,7 @@ const opGetCommit = "GetCommit" type GetCommitRequest struct { *aws.Request Input *GetCommitInput + Copy func(*GetCommitInput) GetCommitRequest } // Send marshals and sends the GetCommit API request. @@ -882,7 +884,7 @@ func (c *CodeCommit) GetCommitRequest(input *GetCommitInput) GetCommitRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCommitRequest{Request: req, Input: input} + return GetCommitRequest{Request: req, Input: input, Copy: c.GetCommitRequest} } const opGetDifferences = "GetDifferences" @@ -891,6 +893,7 @@ const opGetDifferences = "GetDifferences" type GetDifferencesRequest struct { *aws.Request Input *GetDifferencesInput + Copy func(*GetDifferencesInput) GetDifferencesRequest } // Send marshals and sends the GetDifferences API request. @@ -939,57 +942,53 @@ func (c *CodeCommit) GetDifferencesRequest(input *GetDifferencesInput) GetDiffer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDifferencesRequest{Request: req, Input: input} + return GetDifferencesRequest{Request: req, Input: input, Copy: c.GetDifferencesRequest} } -// GetDifferencesPages iterates over the pages of a GetDifferences operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetDifferences method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetDifferencesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetDifferences operation. -// pageNum := 0 -// err := client.GetDifferencesPages(params, -// func(page *GetDifferencesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) GetDifferencesPages(input *GetDifferencesInput, fn func(*GetDifferencesOutput, bool) bool) error { - return c.GetDifferencesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetDifferencesPagesWithContext same as GetDifferencesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeCommit) GetDifferencesPagesWithContext(ctx aws.Context, input *GetDifferencesInput, fn func(*GetDifferencesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetDifferencesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetDifferencesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetDifferencesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetDifferencesRequest) Paginate(opts ...aws.Option) GetDifferencesPager { + return GetDifferencesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetDifferencesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDifferencesOutput), !p.HasNextPage()) - } - return p.Err() +// GetDifferencesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetDifferencesPager struct { + aws.Pager +} + +func (p *GetDifferencesPager) CurrentPage() *GetDifferencesOutput { + return p.Pager.CurrentPage().(*GetDifferencesOutput) } const opGetMergeConflicts = "GetMergeConflicts" @@ -998,6 +997,7 @@ const opGetMergeConflicts = "GetMergeConflicts" type GetMergeConflictsRequest struct { *aws.Request Input *GetMergeConflictsInput + Copy func(*GetMergeConflictsInput) GetMergeConflictsRequest } // Send marshals and sends the GetMergeConflicts API request. @@ -1039,7 +1039,7 @@ func (c *CodeCommit) GetMergeConflictsRequest(input *GetMergeConflictsInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMergeConflictsRequest{Request: req, Input: input} + return GetMergeConflictsRequest{Request: req, Input: input, Copy: c.GetMergeConflictsRequest} } const opGetPullRequest = "GetPullRequest" @@ -1048,6 +1048,7 @@ const opGetPullRequest = "GetPullRequest" type GetPullRequestRequest struct { *aws.Request Input *GetPullRequestInput + Copy func(*GetPullRequestInput) GetPullRequestRequest } // Send marshals and sends the GetPullRequest API request. @@ -1088,7 +1089,7 @@ func (c *CodeCommit) GetPullRequestRequest(input *GetPullRequestInput) GetPullRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPullRequestRequest{Request: req, Input: input} + return GetPullRequestRequest{Request: req, Input: input, Copy: c.GetPullRequestRequest} } const opGetRepository = "GetRepository" @@ -1097,6 +1098,7 @@ const opGetRepository = "GetRepository" type GetRepositoryRequest struct { *aws.Request Input *GetRepositoryInput + Copy func(*GetRepositoryInput) GetRepositoryRequest } // Send marshals and sends the GetRepository API request. @@ -1143,7 +1145,7 @@ func (c *CodeCommit) GetRepositoryRequest(input *GetRepositoryInput) GetReposito req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRepositoryRequest{Request: req, Input: input} + return GetRepositoryRequest{Request: req, Input: input, Copy: c.GetRepositoryRequest} } const opGetRepositoryTriggers = "GetRepositoryTriggers" @@ -1152,6 +1154,7 @@ const opGetRepositoryTriggers = "GetRepositoryTriggers" type GetRepositoryTriggersRequest struct { *aws.Request Input *GetRepositoryTriggersInput + Copy func(*GetRepositoryTriggersInput) GetRepositoryTriggersRequest } // Send marshals and sends the GetRepositoryTriggers API request. @@ -1192,7 +1195,7 @@ func (c *CodeCommit) GetRepositoryTriggersRequest(input *GetRepositoryTriggersIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRepositoryTriggersRequest{Request: req, Input: input} + return GetRepositoryTriggersRequest{Request: req, Input: input, Copy: c.GetRepositoryTriggersRequest} } const opListBranches = "ListBranches" @@ -1201,6 +1204,7 @@ const opListBranches = "ListBranches" type ListBranchesRequest struct { *aws.Request Input *ListBranchesInput + Copy func(*ListBranchesInput) ListBranchesRequest } // Send marshals and sends the ListBranches API request. @@ -1247,57 +1251,53 @@ func (c *CodeCommit) ListBranchesRequest(input *ListBranchesInput) ListBranchesR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBranchesRequest{Request: req, Input: input} + return ListBranchesRequest{Request: req, Input: input, Copy: c.ListBranchesRequest} } -// ListBranchesPages iterates over the pages of a ListBranches operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListBranches method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListBranchesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListBranches operation. -// pageNum := 0 -// err := client.ListBranchesPages(params, -// func(page *ListBranchesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) ListBranchesPages(input *ListBranchesInput, fn func(*ListBranchesOutput, bool) bool) error { - return c.ListBranchesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListBranchesPagesWithContext same as ListBranchesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeCommit) ListBranchesPagesWithContext(ctx aws.Context, input *ListBranchesInput, fn func(*ListBranchesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListBranchesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListBranchesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListBranchesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListBranchesRequest) Paginate(opts ...aws.Option) ListBranchesPager { + return ListBranchesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListBranchesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBranchesOutput), !p.HasNextPage()) - } - return p.Err() +// ListBranchesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListBranchesPager struct { + aws.Pager +} + +func (p *ListBranchesPager) CurrentPage() *ListBranchesOutput { + return p.Pager.CurrentPage().(*ListBranchesOutput) } const opListPullRequests = "ListPullRequests" @@ -1306,6 +1306,7 @@ const opListPullRequests = "ListPullRequests" type ListPullRequestsRequest struct { *aws.Request Input *ListPullRequestsInput + Copy func(*ListPullRequestsInput) ListPullRequestsRequest } // Send marshals and sends the ListPullRequests API request. @@ -1353,57 +1354,53 @@ func (c *CodeCommit) ListPullRequestsRequest(input *ListPullRequestsInput) ListP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPullRequestsRequest{Request: req, Input: input} + return ListPullRequestsRequest{Request: req, Input: input, Copy: c.ListPullRequestsRequest} } -// ListPullRequestsPages iterates over the pages of a ListPullRequests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPullRequests method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPullRequestsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPullRequests operation. -// pageNum := 0 -// err := client.ListPullRequestsPages(params, -// func(page *ListPullRequestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) ListPullRequestsPages(input *ListPullRequestsInput, fn func(*ListPullRequestsOutput, bool) bool) error { - return c.ListPullRequestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPullRequestsPagesWithContext same as ListPullRequestsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeCommit) ListPullRequestsPagesWithContext(ctx aws.Context, input *ListPullRequestsInput, fn func(*ListPullRequestsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPullRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPullRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPullRequestsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPullRequestsRequest) Paginate(opts ...aws.Option) ListPullRequestsPager { + return ListPullRequestsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPullRequestsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPullRequestsOutput), !p.HasNextPage()) - } - return p.Err() +// ListPullRequestsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPullRequestsPager struct { + aws.Pager +} + +func (p *ListPullRequestsPager) CurrentPage() *ListPullRequestsOutput { + return p.Pager.CurrentPage().(*ListPullRequestsOutput) } const opListRepositories = "ListRepositories" @@ -1412,6 +1409,7 @@ const opListRepositories = "ListRepositories" type ListRepositoriesRequest struct { *aws.Request Input *ListRepositoriesInput + Copy func(*ListRepositoriesInput) ListRepositoriesRequest } // Send marshals and sends the ListRepositories API request. @@ -1458,57 +1456,53 @@ func (c *CodeCommit) ListRepositoriesRequest(input *ListRepositoriesInput) ListR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRepositoriesRequest{Request: req, Input: input} + return ListRepositoriesRequest{Request: req, Input: input, Copy: c.ListRepositoriesRequest} } -// ListRepositoriesPages iterates over the pages of a ListRepositories operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRepositories method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListRepositoriesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListRepositories operation. -// pageNum := 0 -// err := client.ListRepositoriesPages(params, -// func(page *ListRepositoriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) ListRepositoriesPages(input *ListRepositoriesInput, fn func(*ListRepositoriesOutput, bool) bool) error { - return c.ListRepositoriesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRepositoriesPagesWithContext same as ListRepositoriesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeCommit) ListRepositoriesPagesWithContext(ctx aws.Context, input *ListRepositoriesInput, fn func(*ListRepositoriesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListRepositoriesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListRepositoriesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListRepositoriesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListRepositoriesRequest) Paginate(opts ...aws.Option) ListRepositoriesPager { + return ListRepositoriesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListRepositoriesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRepositoriesOutput), !p.HasNextPage()) - } - return p.Err() +// ListRepositoriesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListRepositoriesPager struct { + aws.Pager +} + +func (p *ListRepositoriesPager) CurrentPage() *ListRepositoriesOutput { + return p.Pager.CurrentPage().(*ListRepositoriesOutput) } const opMergePullRequestByFastForward = "MergePullRequestByFastForward" @@ -1517,6 +1511,7 @@ const opMergePullRequestByFastForward = "MergePullRequestByFastForward" type MergePullRequestByFastForwardRequest struct { *aws.Request Input *MergePullRequestByFastForwardInput + Copy func(*MergePullRequestByFastForwardInput) MergePullRequestByFastForwardRequest } // Send marshals and sends the MergePullRequestByFastForward API request. @@ -1559,7 +1554,7 @@ func (c *CodeCommit) MergePullRequestByFastForwardRequest(input *MergePullReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return MergePullRequestByFastForwardRequest{Request: req, Input: input} + return MergePullRequestByFastForwardRequest{Request: req, Input: input, Copy: c.MergePullRequestByFastForwardRequest} } const opPostCommentForComparedCommit = "PostCommentForComparedCommit" @@ -1568,6 +1563,7 @@ const opPostCommentForComparedCommit = "PostCommentForComparedCommit" type PostCommentForComparedCommitRequest struct { *aws.Request Input *PostCommentForComparedCommitInput + Copy func(*PostCommentForComparedCommitInput) PostCommentForComparedCommitRequest } // Send marshals and sends the PostCommentForComparedCommit API request. @@ -1608,7 +1604,7 @@ func (c *CodeCommit) PostCommentForComparedCommitRequest(input *PostCommentForCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PostCommentForComparedCommitRequest{Request: req, Input: input} + return PostCommentForComparedCommitRequest{Request: req, Input: input, Copy: c.PostCommentForComparedCommitRequest} } const opPostCommentForPullRequest = "PostCommentForPullRequest" @@ -1617,6 +1613,7 @@ const opPostCommentForPullRequest = "PostCommentForPullRequest" type PostCommentForPullRequestRequest struct { *aws.Request Input *PostCommentForPullRequestInput + Copy func(*PostCommentForPullRequestInput) PostCommentForPullRequestRequest } // Send marshals and sends the PostCommentForPullRequest API request. @@ -1657,7 +1654,7 @@ func (c *CodeCommit) PostCommentForPullRequestRequest(input *PostCommentForPullR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PostCommentForPullRequestRequest{Request: req, Input: input} + return PostCommentForPullRequestRequest{Request: req, Input: input, Copy: c.PostCommentForPullRequestRequest} } const opPostCommentReply = "PostCommentReply" @@ -1666,6 +1663,7 @@ const opPostCommentReply = "PostCommentReply" type PostCommentReplyRequest struct { *aws.Request Input *PostCommentReplyInput + Copy func(*PostCommentReplyInput) PostCommentReplyRequest } // Send marshals and sends the PostCommentReply API request. @@ -1707,7 +1705,7 @@ func (c *CodeCommit) PostCommentReplyRequest(input *PostCommentReplyInput) PostC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PostCommentReplyRequest{Request: req, Input: input} + return PostCommentReplyRequest{Request: req, Input: input, Copy: c.PostCommentReplyRequest} } const opPutRepositoryTriggers = "PutRepositoryTriggers" @@ -1716,6 +1714,7 @@ const opPutRepositoryTriggers = "PutRepositoryTriggers" type PutRepositoryTriggersRequest struct { *aws.Request Input *PutRepositoryTriggersInput + Copy func(*PutRepositoryTriggersInput) PutRepositoryTriggersRequest } // Send marshals and sends the PutRepositoryTriggers API request. @@ -1757,7 +1756,7 @@ func (c *CodeCommit) PutRepositoryTriggersRequest(input *PutRepositoryTriggersIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutRepositoryTriggersRequest{Request: req, Input: input} + return PutRepositoryTriggersRequest{Request: req, Input: input, Copy: c.PutRepositoryTriggersRequest} } const opTestRepositoryTriggers = "TestRepositoryTriggers" @@ -1766,6 +1765,7 @@ const opTestRepositoryTriggers = "TestRepositoryTriggers" type TestRepositoryTriggersRequest struct { *aws.Request Input *TestRepositoryTriggersInput + Copy func(*TestRepositoryTriggersInput) TestRepositoryTriggersRequest } // Send marshals and sends the TestRepositoryTriggers API request. @@ -1809,7 +1809,7 @@ func (c *CodeCommit) TestRepositoryTriggersRequest(input *TestRepositoryTriggers req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestRepositoryTriggersRequest{Request: req, Input: input} + return TestRepositoryTriggersRequest{Request: req, Input: input, Copy: c.TestRepositoryTriggersRequest} } const opUpdateComment = "UpdateComment" @@ -1818,6 +1818,7 @@ const opUpdateComment = "UpdateComment" type UpdateCommentRequest struct { *aws.Request Input *UpdateCommentInput + Copy func(*UpdateCommentInput) UpdateCommentRequest } // Send marshals and sends the UpdateComment API request. @@ -1858,7 +1859,7 @@ func (c *CodeCommit) UpdateCommentRequest(input *UpdateCommentInput) UpdateComme req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateCommentRequest{Request: req, Input: input} + return UpdateCommentRequest{Request: req, Input: input, Copy: c.UpdateCommentRequest} } const opUpdateDefaultBranch = "UpdateDefaultBranch" @@ -1867,6 +1868,7 @@ const opUpdateDefaultBranch = "UpdateDefaultBranch" type UpdateDefaultBranchRequest struct { *aws.Request Input *UpdateDefaultBranchInput + Copy func(*UpdateDefaultBranchInput) UpdateDefaultBranchRequest } // Send marshals and sends the UpdateDefaultBranch API request. @@ -1913,7 +1915,7 @@ func (c *CodeCommit) UpdateDefaultBranchRequest(input *UpdateDefaultBranchInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateDefaultBranchRequest{Request: req, Input: input} + return UpdateDefaultBranchRequest{Request: req, Input: input, Copy: c.UpdateDefaultBranchRequest} } const opUpdatePullRequestDescription = "UpdatePullRequestDescription" @@ -1922,6 +1924,7 @@ const opUpdatePullRequestDescription = "UpdatePullRequestDescription" type UpdatePullRequestDescriptionRequest struct { *aws.Request Input *UpdatePullRequestDescriptionInput + Copy func(*UpdatePullRequestDescriptionInput) UpdatePullRequestDescriptionRequest } // Send marshals and sends the UpdatePullRequestDescription API request. @@ -1962,7 +1965,7 @@ func (c *CodeCommit) UpdatePullRequestDescriptionRequest(input *UpdatePullReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePullRequestDescriptionRequest{Request: req, Input: input} + return UpdatePullRequestDescriptionRequest{Request: req, Input: input, Copy: c.UpdatePullRequestDescriptionRequest} } const opUpdatePullRequestStatus = "UpdatePullRequestStatus" @@ -1971,6 +1974,7 @@ const opUpdatePullRequestStatus = "UpdatePullRequestStatus" type UpdatePullRequestStatusRequest struct { *aws.Request Input *UpdatePullRequestStatusInput + Copy func(*UpdatePullRequestStatusInput) UpdatePullRequestStatusRequest } // Send marshals and sends the UpdatePullRequestStatus API request. @@ -2011,7 +2015,7 @@ func (c *CodeCommit) UpdatePullRequestStatusRequest(input *UpdatePullRequestStat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePullRequestStatusRequest{Request: req, Input: input} + return UpdatePullRequestStatusRequest{Request: req, Input: input, Copy: c.UpdatePullRequestStatusRequest} } const opUpdatePullRequestTitle = "UpdatePullRequestTitle" @@ -2020,6 +2024,7 @@ const opUpdatePullRequestTitle = "UpdatePullRequestTitle" type UpdatePullRequestTitleRequest struct { *aws.Request Input *UpdatePullRequestTitleInput + Copy func(*UpdatePullRequestTitleInput) UpdatePullRequestTitleRequest } // Send marshals and sends the UpdatePullRequestTitle API request. @@ -2060,7 +2065,7 @@ func (c *CodeCommit) UpdatePullRequestTitleRequest(input *UpdatePullRequestTitle req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePullRequestTitleRequest{Request: req, Input: input} + return UpdatePullRequestTitleRequest{Request: req, Input: input, Copy: c.UpdatePullRequestTitleRequest} } const opUpdateRepositoryDescription = "UpdateRepositoryDescription" @@ -2069,6 +2074,7 @@ const opUpdateRepositoryDescription = "UpdateRepositoryDescription" type UpdateRepositoryDescriptionRequest struct { *aws.Request Input *UpdateRepositoryDescriptionInput + Copy func(*UpdateRepositoryDescriptionInput) UpdateRepositoryDescriptionRequest } // Send marshals and sends the UpdateRepositoryDescription API request. @@ -2117,7 +2123,7 @@ func (c *CodeCommit) UpdateRepositoryDescriptionRequest(input *UpdateRepositoryD req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateRepositoryDescriptionRequest{Request: req, Input: input} + return UpdateRepositoryDescriptionRequest{Request: req, Input: input, Copy: c.UpdateRepositoryDescriptionRequest} } const opUpdateRepositoryName = "UpdateRepositoryName" @@ -2126,6 +2132,7 @@ const opUpdateRepositoryName = "UpdateRepositoryName" type UpdateRepositoryNameRequest struct { *aws.Request Input *UpdateRepositoryNameInput + Copy func(*UpdateRepositoryNameInput) UpdateRepositoryNameRequest } // Send marshals and sends the UpdateRepositoryName API request. @@ -2173,7 +2180,7 @@ func (c *CodeCommit) UpdateRepositoryNameRequest(input *UpdateRepositoryNameInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateRepositoryNameRequest{Request: req, Input: input} + return UpdateRepositoryNameRequest{Request: req, Input: input, Copy: c.UpdateRepositoryNameRequest} } // Represents the input of a batch get repositories operation. diff --git a/service/codecommit/codecommitiface/interface.go b/service/codecommit/codecommitiface/interface.go index dc37d328e06..8abbe509ed4 100644 --- a/service/codecommit/codecommitiface/interface.go +++ b/service/codecommit/codecommitiface/interface.go @@ -9,7 +9,6 @@ package codecommitiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/codecommit" ) @@ -79,9 +78,6 @@ type CodeCommitAPI interface { DescribePullRequestEventsRequest(*codecommit.DescribePullRequestEventsInput) codecommit.DescribePullRequestEventsRequest - DescribePullRequestEventsPages(*codecommit.DescribePullRequestEventsInput, func(*codecommit.DescribePullRequestEventsOutput, bool) bool) error - DescribePullRequestEventsPagesWithContext(aws.Context, *codecommit.DescribePullRequestEventsInput, func(*codecommit.DescribePullRequestEventsOutput, bool) bool, ...aws.Option) error - GetBlobRequest(*codecommit.GetBlobInput) codecommit.GetBlobRequest GetBranchRequest(*codecommit.GetBranchInput) codecommit.GetBranchRequest @@ -90,21 +86,12 @@ type CodeCommitAPI interface { GetCommentsForComparedCommitRequest(*codecommit.GetCommentsForComparedCommitInput) codecommit.GetCommentsForComparedCommitRequest - GetCommentsForComparedCommitPages(*codecommit.GetCommentsForComparedCommitInput, func(*codecommit.GetCommentsForComparedCommitOutput, bool) bool) error - GetCommentsForComparedCommitPagesWithContext(aws.Context, *codecommit.GetCommentsForComparedCommitInput, func(*codecommit.GetCommentsForComparedCommitOutput, bool) bool, ...aws.Option) error - GetCommentsForPullRequestRequest(*codecommit.GetCommentsForPullRequestInput) codecommit.GetCommentsForPullRequestRequest - GetCommentsForPullRequestPages(*codecommit.GetCommentsForPullRequestInput, func(*codecommit.GetCommentsForPullRequestOutput, bool) bool) error - GetCommentsForPullRequestPagesWithContext(aws.Context, *codecommit.GetCommentsForPullRequestInput, func(*codecommit.GetCommentsForPullRequestOutput, bool) bool, ...aws.Option) error - GetCommitRequest(*codecommit.GetCommitInput) codecommit.GetCommitRequest GetDifferencesRequest(*codecommit.GetDifferencesInput) codecommit.GetDifferencesRequest - GetDifferencesPages(*codecommit.GetDifferencesInput, func(*codecommit.GetDifferencesOutput, bool) bool) error - GetDifferencesPagesWithContext(aws.Context, *codecommit.GetDifferencesInput, func(*codecommit.GetDifferencesOutput, bool) bool, ...aws.Option) error - GetMergeConflictsRequest(*codecommit.GetMergeConflictsInput) codecommit.GetMergeConflictsRequest GetPullRequestRequest(*codecommit.GetPullRequestInput) codecommit.GetPullRequestRequest @@ -115,19 +102,10 @@ type CodeCommitAPI interface { ListBranchesRequest(*codecommit.ListBranchesInput) codecommit.ListBranchesRequest - ListBranchesPages(*codecommit.ListBranchesInput, func(*codecommit.ListBranchesOutput, bool) bool) error - ListBranchesPagesWithContext(aws.Context, *codecommit.ListBranchesInput, func(*codecommit.ListBranchesOutput, bool) bool, ...aws.Option) error - ListPullRequestsRequest(*codecommit.ListPullRequestsInput) codecommit.ListPullRequestsRequest - ListPullRequestsPages(*codecommit.ListPullRequestsInput, func(*codecommit.ListPullRequestsOutput, bool) bool) error - ListPullRequestsPagesWithContext(aws.Context, *codecommit.ListPullRequestsInput, func(*codecommit.ListPullRequestsOutput, bool) bool, ...aws.Option) error - ListRepositoriesRequest(*codecommit.ListRepositoriesInput) codecommit.ListRepositoriesRequest - ListRepositoriesPages(*codecommit.ListRepositoriesInput, func(*codecommit.ListRepositoriesOutput, bool) bool) error - ListRepositoriesPagesWithContext(aws.Context, *codecommit.ListRepositoriesInput, func(*codecommit.ListRepositoriesOutput, bool) bool, ...aws.Option) error - MergePullRequestByFastForwardRequest(*codecommit.MergePullRequestByFastForwardInput) codecommit.MergePullRequestByFastForwardRequest PostCommentForComparedCommitRequest(*codecommit.PostCommentForComparedCommitInput) codecommit.PostCommentForComparedCommitRequest diff --git a/service/codedeploy/api.go b/service/codedeploy/api.go index 4983bdb811a..5eb887174fe 100644 --- a/service/codedeploy/api.go +++ b/service/codedeploy/api.go @@ -17,6 +17,7 @@ const opAddTagsToOnPremisesInstances = "AddTagsToOnPremisesInstances" type AddTagsToOnPremisesInstancesRequest struct { *aws.Request Input *AddTagsToOnPremisesInstancesInput + Copy func(*AddTagsToOnPremisesInstancesInput) AddTagsToOnPremisesInstancesRequest } // Send marshals and sends the AddTagsToOnPremisesInstances API request. @@ -59,7 +60,7 @@ func (c *CodeDeploy) AddTagsToOnPremisesInstancesRequest(input *AddTagsToOnPremi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddTagsToOnPremisesInstancesRequest{Request: req, Input: input} + return AddTagsToOnPremisesInstancesRequest{Request: req, Input: input, Copy: c.AddTagsToOnPremisesInstancesRequest} } const opBatchGetApplicationRevisions = "BatchGetApplicationRevisions" @@ -68,6 +69,7 @@ const opBatchGetApplicationRevisions = "BatchGetApplicationRevisions" type BatchGetApplicationRevisionsRequest struct { *aws.Request Input *BatchGetApplicationRevisionsInput + Copy func(*BatchGetApplicationRevisionsInput) BatchGetApplicationRevisionsRequest } // Send marshals and sends the BatchGetApplicationRevisions API request. @@ -108,7 +110,7 @@ func (c *CodeDeploy) BatchGetApplicationRevisionsRequest(input *BatchGetApplicat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetApplicationRevisionsRequest{Request: req, Input: input} + return BatchGetApplicationRevisionsRequest{Request: req, Input: input, Copy: c.BatchGetApplicationRevisionsRequest} } const opBatchGetApplications = "BatchGetApplications" @@ -117,6 +119,7 @@ const opBatchGetApplications = "BatchGetApplications" type BatchGetApplicationsRequest struct { *aws.Request Input *BatchGetApplicationsInput + Copy func(*BatchGetApplicationsInput) BatchGetApplicationsRequest } // Send marshals and sends the BatchGetApplications API request. @@ -157,7 +160,7 @@ func (c *CodeDeploy) BatchGetApplicationsRequest(input *BatchGetApplicationsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetApplicationsRequest{Request: req, Input: input} + return BatchGetApplicationsRequest{Request: req, Input: input, Copy: c.BatchGetApplicationsRequest} } const opBatchGetDeploymentGroups = "BatchGetDeploymentGroups" @@ -166,6 +169,7 @@ const opBatchGetDeploymentGroups = "BatchGetDeploymentGroups" type BatchGetDeploymentGroupsRequest struct { *aws.Request Input *BatchGetDeploymentGroupsInput + Copy func(*BatchGetDeploymentGroupsInput) BatchGetDeploymentGroupsRequest } // Send marshals and sends the BatchGetDeploymentGroups API request. @@ -206,7 +210,7 @@ func (c *CodeDeploy) BatchGetDeploymentGroupsRequest(input *BatchGetDeploymentGr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetDeploymentGroupsRequest{Request: req, Input: input} + return BatchGetDeploymentGroupsRequest{Request: req, Input: input, Copy: c.BatchGetDeploymentGroupsRequest} } const opBatchGetDeploymentInstances = "BatchGetDeploymentInstances" @@ -215,6 +219,7 @@ const opBatchGetDeploymentInstances = "BatchGetDeploymentInstances" type BatchGetDeploymentInstancesRequest struct { *aws.Request Input *BatchGetDeploymentInstancesInput + Copy func(*BatchGetDeploymentInstancesInput) BatchGetDeploymentInstancesRequest } // Send marshals and sends the BatchGetDeploymentInstances API request. @@ -256,7 +261,7 @@ func (c *CodeDeploy) BatchGetDeploymentInstancesRequest(input *BatchGetDeploymen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetDeploymentInstancesRequest{Request: req, Input: input} + return BatchGetDeploymentInstancesRequest{Request: req, Input: input, Copy: c.BatchGetDeploymentInstancesRequest} } const opBatchGetDeployments = "BatchGetDeployments" @@ -265,6 +270,7 @@ const opBatchGetDeployments = "BatchGetDeployments" type BatchGetDeploymentsRequest struct { *aws.Request Input *BatchGetDeploymentsInput + Copy func(*BatchGetDeploymentsInput) BatchGetDeploymentsRequest } // Send marshals and sends the BatchGetDeployments API request. @@ -305,7 +311,7 @@ func (c *CodeDeploy) BatchGetDeploymentsRequest(input *BatchGetDeploymentsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetDeploymentsRequest{Request: req, Input: input} + return BatchGetDeploymentsRequest{Request: req, Input: input, Copy: c.BatchGetDeploymentsRequest} } const opBatchGetOnPremisesInstances = "BatchGetOnPremisesInstances" @@ -314,6 +320,7 @@ const opBatchGetOnPremisesInstances = "BatchGetOnPremisesInstances" type BatchGetOnPremisesInstancesRequest struct { *aws.Request Input *BatchGetOnPremisesInstancesInput + Copy func(*BatchGetOnPremisesInstancesInput) BatchGetOnPremisesInstancesRequest } // Send marshals and sends the BatchGetOnPremisesInstances API request. @@ -354,7 +361,7 @@ func (c *CodeDeploy) BatchGetOnPremisesInstancesRequest(input *BatchGetOnPremise req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetOnPremisesInstancesRequest{Request: req, Input: input} + return BatchGetOnPremisesInstancesRequest{Request: req, Input: input, Copy: c.BatchGetOnPremisesInstancesRequest} } const opContinueDeployment = "ContinueDeployment" @@ -363,6 +370,7 @@ const opContinueDeployment = "ContinueDeployment" type ContinueDeploymentRequest struct { *aws.Request Input *ContinueDeploymentInput + Copy func(*ContinueDeploymentInput) ContinueDeploymentRequest } // Send marshals and sends the ContinueDeployment API request. @@ -410,7 +418,7 @@ func (c *CodeDeploy) ContinueDeploymentRequest(input *ContinueDeploymentInput) C req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ContinueDeploymentRequest{Request: req, Input: input} + return ContinueDeploymentRequest{Request: req, Input: input, Copy: c.ContinueDeploymentRequest} } const opCreateApplication = "CreateApplication" @@ -419,6 +427,7 @@ const opCreateApplication = "CreateApplication" type CreateApplicationRequest struct { *aws.Request Input *CreateApplicationInput + Copy func(*CreateApplicationInput) CreateApplicationRequest } // Send marshals and sends the CreateApplication API request. @@ -459,7 +468,7 @@ func (c *CodeDeploy) CreateApplicationRequest(input *CreateApplicationInput) Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateApplicationRequest{Request: req, Input: input} + return CreateApplicationRequest{Request: req, Input: input, Copy: c.CreateApplicationRequest} } const opCreateDeployment = "CreateDeployment" @@ -468,6 +477,7 @@ const opCreateDeployment = "CreateDeployment" type CreateDeploymentRequest struct { *aws.Request Input *CreateDeploymentInput + Copy func(*CreateDeploymentInput) CreateDeploymentRequest } // Send marshals and sends the CreateDeployment API request. @@ -508,7 +518,7 @@ func (c *CodeDeploy) CreateDeploymentRequest(input *CreateDeploymentInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDeploymentRequest{Request: req, Input: input} + return CreateDeploymentRequest{Request: req, Input: input, Copy: c.CreateDeploymentRequest} } const opCreateDeploymentConfig = "CreateDeploymentConfig" @@ -517,6 +527,7 @@ const opCreateDeploymentConfig = "CreateDeploymentConfig" type CreateDeploymentConfigRequest struct { *aws.Request Input *CreateDeploymentConfigInput + Copy func(*CreateDeploymentConfigInput) CreateDeploymentConfigRequest } // Send marshals and sends the CreateDeploymentConfig API request. @@ -557,7 +568,7 @@ func (c *CodeDeploy) CreateDeploymentConfigRequest(input *CreateDeploymentConfig req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDeploymentConfigRequest{Request: req, Input: input} + return CreateDeploymentConfigRequest{Request: req, Input: input, Copy: c.CreateDeploymentConfigRequest} } const opCreateDeploymentGroup = "CreateDeploymentGroup" @@ -566,6 +577,7 @@ const opCreateDeploymentGroup = "CreateDeploymentGroup" type CreateDeploymentGroupRequest struct { *aws.Request Input *CreateDeploymentGroupInput + Copy func(*CreateDeploymentGroupInput) CreateDeploymentGroupRequest } // Send marshals and sends the CreateDeploymentGroup API request. @@ -606,7 +618,7 @@ func (c *CodeDeploy) CreateDeploymentGroupRequest(input *CreateDeploymentGroupIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDeploymentGroupRequest{Request: req, Input: input} + return CreateDeploymentGroupRequest{Request: req, Input: input, Copy: c.CreateDeploymentGroupRequest} } const opDeleteApplication = "DeleteApplication" @@ -615,6 +627,7 @@ const opDeleteApplication = "DeleteApplication" type DeleteApplicationRequest struct { *aws.Request Input *DeleteApplicationInput + Copy func(*DeleteApplicationInput) DeleteApplicationRequest } // Send marshals and sends the DeleteApplication API request. @@ -657,7 +670,7 @@ func (c *CodeDeploy) DeleteApplicationRequest(input *DeleteApplicationInput) Del req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteApplicationRequest{Request: req, Input: input} + return DeleteApplicationRequest{Request: req, Input: input, Copy: c.DeleteApplicationRequest} } const opDeleteDeploymentConfig = "DeleteDeploymentConfig" @@ -666,6 +679,7 @@ const opDeleteDeploymentConfig = "DeleteDeploymentConfig" type DeleteDeploymentConfigRequest struct { *aws.Request Input *DeleteDeploymentConfigInput + Copy func(*DeleteDeploymentConfigInput) DeleteDeploymentConfigRequest } // Send marshals and sends the DeleteDeploymentConfig API request. @@ -711,7 +725,7 @@ func (c *CodeDeploy) DeleteDeploymentConfigRequest(input *DeleteDeploymentConfig req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDeploymentConfigRequest{Request: req, Input: input} + return DeleteDeploymentConfigRequest{Request: req, Input: input, Copy: c.DeleteDeploymentConfigRequest} } const opDeleteDeploymentGroup = "DeleteDeploymentGroup" @@ -720,6 +734,7 @@ const opDeleteDeploymentGroup = "DeleteDeploymentGroup" type DeleteDeploymentGroupRequest struct { *aws.Request Input *DeleteDeploymentGroupInput + Copy func(*DeleteDeploymentGroupInput) DeleteDeploymentGroupRequest } // Send marshals and sends the DeleteDeploymentGroup API request. @@ -760,7 +775,7 @@ func (c *CodeDeploy) DeleteDeploymentGroupRequest(input *DeleteDeploymentGroupIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDeploymentGroupRequest{Request: req, Input: input} + return DeleteDeploymentGroupRequest{Request: req, Input: input, Copy: c.DeleteDeploymentGroupRequest} } const opDeleteGitHubAccountToken = "DeleteGitHubAccountToken" @@ -769,6 +784,7 @@ const opDeleteGitHubAccountToken = "DeleteGitHubAccountToken" type DeleteGitHubAccountTokenRequest struct { *aws.Request Input *DeleteGitHubAccountTokenInput + Copy func(*DeleteGitHubAccountTokenInput) DeleteGitHubAccountTokenRequest } // Send marshals and sends the DeleteGitHubAccountToken API request. @@ -809,7 +825,7 @@ func (c *CodeDeploy) DeleteGitHubAccountTokenRequest(input *DeleteGitHubAccountT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGitHubAccountTokenRequest{Request: req, Input: input} + return DeleteGitHubAccountTokenRequest{Request: req, Input: input, Copy: c.DeleteGitHubAccountTokenRequest} } const opDeregisterOnPremisesInstance = "DeregisterOnPremisesInstance" @@ -818,6 +834,7 @@ const opDeregisterOnPremisesInstance = "DeregisterOnPremisesInstance" type DeregisterOnPremisesInstanceRequest struct { *aws.Request Input *DeregisterOnPremisesInstanceInput + Copy func(*DeregisterOnPremisesInstanceInput) DeregisterOnPremisesInstanceRequest } // Send marshals and sends the DeregisterOnPremisesInstance API request. @@ -860,7 +877,7 @@ func (c *CodeDeploy) DeregisterOnPremisesInstanceRequest(input *DeregisterOnPrem req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeregisterOnPremisesInstanceRequest{Request: req, Input: input} + return DeregisterOnPremisesInstanceRequest{Request: req, Input: input, Copy: c.DeregisterOnPremisesInstanceRequest} } const opGetApplication = "GetApplication" @@ -869,6 +886,7 @@ const opGetApplication = "GetApplication" type GetApplicationRequest struct { *aws.Request Input *GetApplicationInput + Copy func(*GetApplicationInput) GetApplicationRequest } // Send marshals and sends the GetApplication API request. @@ -909,7 +927,7 @@ func (c *CodeDeploy) GetApplicationRequest(input *GetApplicationInput) GetApplic req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApplicationRequest{Request: req, Input: input} + return GetApplicationRequest{Request: req, Input: input, Copy: c.GetApplicationRequest} } const opGetApplicationRevision = "GetApplicationRevision" @@ -918,6 +936,7 @@ const opGetApplicationRevision = "GetApplicationRevision" type GetApplicationRevisionRequest struct { *aws.Request Input *GetApplicationRevisionInput + Copy func(*GetApplicationRevisionInput) GetApplicationRevisionRequest } // Send marshals and sends the GetApplicationRevision API request. @@ -958,7 +977,7 @@ func (c *CodeDeploy) GetApplicationRevisionRequest(input *GetApplicationRevision req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApplicationRevisionRequest{Request: req, Input: input} + return GetApplicationRevisionRequest{Request: req, Input: input, Copy: c.GetApplicationRevisionRequest} } const opGetDeployment = "GetDeployment" @@ -967,6 +986,7 @@ const opGetDeployment = "GetDeployment" type GetDeploymentRequest struct { *aws.Request Input *GetDeploymentInput + Copy func(*GetDeploymentInput) GetDeploymentRequest } // Send marshals and sends the GetDeployment API request. @@ -1007,7 +1027,7 @@ func (c *CodeDeploy) GetDeploymentRequest(input *GetDeploymentInput) GetDeployme req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeploymentRequest{Request: req, Input: input} + return GetDeploymentRequest{Request: req, Input: input, Copy: c.GetDeploymentRequest} } const opGetDeploymentConfig = "GetDeploymentConfig" @@ -1016,6 +1036,7 @@ const opGetDeploymentConfig = "GetDeploymentConfig" type GetDeploymentConfigRequest struct { *aws.Request Input *GetDeploymentConfigInput + Copy func(*GetDeploymentConfigInput) GetDeploymentConfigRequest } // Send marshals and sends the GetDeploymentConfig API request. @@ -1056,7 +1077,7 @@ func (c *CodeDeploy) GetDeploymentConfigRequest(input *GetDeploymentConfigInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeploymentConfigRequest{Request: req, Input: input} + return GetDeploymentConfigRequest{Request: req, Input: input, Copy: c.GetDeploymentConfigRequest} } const opGetDeploymentGroup = "GetDeploymentGroup" @@ -1065,6 +1086,7 @@ const opGetDeploymentGroup = "GetDeploymentGroup" type GetDeploymentGroupRequest struct { *aws.Request Input *GetDeploymentGroupInput + Copy func(*GetDeploymentGroupInput) GetDeploymentGroupRequest } // Send marshals and sends the GetDeploymentGroup API request. @@ -1105,7 +1127,7 @@ func (c *CodeDeploy) GetDeploymentGroupRequest(input *GetDeploymentGroupInput) G req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeploymentGroupRequest{Request: req, Input: input} + return GetDeploymentGroupRequest{Request: req, Input: input, Copy: c.GetDeploymentGroupRequest} } const opGetDeploymentInstance = "GetDeploymentInstance" @@ -1114,6 +1136,7 @@ const opGetDeploymentInstance = "GetDeploymentInstance" type GetDeploymentInstanceRequest struct { *aws.Request Input *GetDeploymentInstanceInput + Copy func(*GetDeploymentInstanceInput) GetDeploymentInstanceRequest } // Send marshals and sends the GetDeploymentInstance API request. @@ -1154,7 +1177,7 @@ func (c *CodeDeploy) GetDeploymentInstanceRequest(input *GetDeploymentInstanceIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeploymentInstanceRequest{Request: req, Input: input} + return GetDeploymentInstanceRequest{Request: req, Input: input, Copy: c.GetDeploymentInstanceRequest} } const opGetOnPremisesInstance = "GetOnPremisesInstance" @@ -1163,6 +1186,7 @@ const opGetOnPremisesInstance = "GetOnPremisesInstance" type GetOnPremisesInstanceRequest struct { *aws.Request Input *GetOnPremisesInstanceInput + Copy func(*GetOnPremisesInstanceInput) GetOnPremisesInstanceRequest } // Send marshals and sends the GetOnPremisesInstance API request. @@ -1203,7 +1227,7 @@ func (c *CodeDeploy) GetOnPremisesInstanceRequest(input *GetOnPremisesInstanceIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOnPremisesInstanceRequest{Request: req, Input: input} + return GetOnPremisesInstanceRequest{Request: req, Input: input, Copy: c.GetOnPremisesInstanceRequest} } const opListApplicationRevisions = "ListApplicationRevisions" @@ -1212,6 +1236,7 @@ const opListApplicationRevisions = "ListApplicationRevisions" type ListApplicationRevisionsRequest struct { *aws.Request Input *ListApplicationRevisionsInput + Copy func(*ListApplicationRevisionsInput) ListApplicationRevisionsRequest } // Send marshals and sends the ListApplicationRevisions API request. @@ -1258,57 +1283,53 @@ func (c *CodeDeploy) ListApplicationRevisionsRequest(input *ListApplicationRevis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListApplicationRevisionsRequest{Request: req, Input: input} + return ListApplicationRevisionsRequest{Request: req, Input: input, Copy: c.ListApplicationRevisionsRequest} } -// ListApplicationRevisionsPages iterates over the pages of a ListApplicationRevisions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListApplicationRevisions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListApplicationRevisionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListApplicationRevisions operation. -// pageNum := 0 -// err := client.ListApplicationRevisionsPages(params, -// func(page *ListApplicationRevisionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListApplicationRevisionsPages(input *ListApplicationRevisionsInput, fn func(*ListApplicationRevisionsOutput, bool) bool) error { - return c.ListApplicationRevisionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListApplicationRevisionsPagesWithContext same as ListApplicationRevisionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeDeploy) ListApplicationRevisionsPagesWithContext(ctx aws.Context, input *ListApplicationRevisionsInput, fn func(*ListApplicationRevisionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListApplicationRevisionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListApplicationRevisionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListApplicationRevisionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListApplicationRevisionsRequest) Paginate(opts ...aws.Option) ListApplicationRevisionsPager { + return ListApplicationRevisionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListApplicationRevisionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListApplicationRevisionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListApplicationRevisionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListApplicationRevisionsPager struct { + aws.Pager +} + +func (p *ListApplicationRevisionsPager) CurrentPage() *ListApplicationRevisionsOutput { + return p.Pager.CurrentPage().(*ListApplicationRevisionsOutput) } const opListApplications = "ListApplications" @@ -1317,6 +1338,7 @@ const opListApplications = "ListApplications" type ListApplicationsRequest struct { *aws.Request Input *ListApplicationsInput + Copy func(*ListApplicationsInput) ListApplicationsRequest } // Send marshals and sends the ListApplications API request. @@ -1363,57 +1385,53 @@ func (c *CodeDeploy) ListApplicationsRequest(input *ListApplicationsInput) ListA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListApplicationsRequest{Request: req, Input: input} + return ListApplicationsRequest{Request: req, Input: input, Copy: c.ListApplicationsRequest} } -// ListApplicationsPages iterates over the pages of a ListApplications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListApplications method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListApplicationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListApplications operation. -// pageNum := 0 -// err := client.ListApplicationsPages(params, -// func(page *ListApplicationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListApplicationsPages(input *ListApplicationsInput, fn func(*ListApplicationsOutput, bool) bool) error { - return c.ListApplicationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListApplicationsPagesWithContext same as ListApplicationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeDeploy) ListApplicationsPagesWithContext(ctx aws.Context, input *ListApplicationsInput, fn func(*ListApplicationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListApplicationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListApplicationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListApplicationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListApplicationsRequest) Paginate(opts ...aws.Option) ListApplicationsPager { + return ListApplicationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListApplicationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) - } - return p.Err() +// ListApplicationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListApplicationsPager struct { + aws.Pager +} + +func (p *ListApplicationsPager) CurrentPage() *ListApplicationsOutput { + return p.Pager.CurrentPage().(*ListApplicationsOutput) } const opListDeploymentConfigs = "ListDeploymentConfigs" @@ -1422,6 +1440,7 @@ const opListDeploymentConfigs = "ListDeploymentConfigs" type ListDeploymentConfigsRequest struct { *aws.Request Input *ListDeploymentConfigsInput + Copy func(*ListDeploymentConfigsInput) ListDeploymentConfigsRequest } // Send marshals and sends the ListDeploymentConfigs API request. @@ -1468,57 +1487,53 @@ func (c *CodeDeploy) ListDeploymentConfigsRequest(input *ListDeploymentConfigsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDeploymentConfigsRequest{Request: req, Input: input} + return ListDeploymentConfigsRequest{Request: req, Input: input, Copy: c.ListDeploymentConfigsRequest} } -// ListDeploymentConfigsPages iterates over the pages of a ListDeploymentConfigs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeploymentConfigs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDeploymentConfigsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDeploymentConfigs operation. -// pageNum := 0 -// err := client.ListDeploymentConfigsPages(params, -// func(page *ListDeploymentConfigsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListDeploymentConfigsPages(input *ListDeploymentConfigsInput, fn func(*ListDeploymentConfigsOutput, bool) bool) error { - return c.ListDeploymentConfigsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDeploymentConfigsPagesWithContext same as ListDeploymentConfigsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeDeploy) ListDeploymentConfigsPagesWithContext(ctx aws.Context, input *ListDeploymentConfigsInput, fn func(*ListDeploymentConfigsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDeploymentConfigsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDeploymentConfigsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDeploymentConfigsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDeploymentConfigsRequest) Paginate(opts ...aws.Option) ListDeploymentConfigsPager { + return ListDeploymentConfigsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDeploymentConfigsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDeploymentConfigsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDeploymentConfigsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDeploymentConfigsPager struct { + aws.Pager +} + +func (p *ListDeploymentConfigsPager) CurrentPage() *ListDeploymentConfigsOutput { + return p.Pager.CurrentPage().(*ListDeploymentConfigsOutput) } const opListDeploymentGroups = "ListDeploymentGroups" @@ -1527,6 +1542,7 @@ const opListDeploymentGroups = "ListDeploymentGroups" type ListDeploymentGroupsRequest struct { *aws.Request Input *ListDeploymentGroupsInput + Copy func(*ListDeploymentGroupsInput) ListDeploymentGroupsRequest } // Send marshals and sends the ListDeploymentGroups API request. @@ -1574,57 +1590,53 @@ func (c *CodeDeploy) ListDeploymentGroupsRequest(input *ListDeploymentGroupsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDeploymentGroupsRequest{Request: req, Input: input} + return ListDeploymentGroupsRequest{Request: req, Input: input, Copy: c.ListDeploymentGroupsRequest} } -// ListDeploymentGroupsPages iterates over the pages of a ListDeploymentGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeploymentGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDeploymentGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDeploymentGroups operation. -// pageNum := 0 -// err := client.ListDeploymentGroupsPages(params, -// func(page *ListDeploymentGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListDeploymentGroupsPages(input *ListDeploymentGroupsInput, fn func(*ListDeploymentGroupsOutput, bool) bool) error { - return c.ListDeploymentGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDeploymentGroupsPagesWithContext same as ListDeploymentGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeDeploy) ListDeploymentGroupsPagesWithContext(ctx aws.Context, input *ListDeploymentGroupsInput, fn func(*ListDeploymentGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDeploymentGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDeploymentGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDeploymentGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDeploymentGroupsRequest) Paginate(opts ...aws.Option) ListDeploymentGroupsPager { + return ListDeploymentGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDeploymentGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDeploymentGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDeploymentGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDeploymentGroupsPager struct { + aws.Pager +} + +func (p *ListDeploymentGroupsPager) CurrentPage() *ListDeploymentGroupsOutput { + return p.Pager.CurrentPage().(*ListDeploymentGroupsOutput) } const opListDeploymentInstances = "ListDeploymentInstances" @@ -1633,6 +1645,7 @@ const opListDeploymentInstances = "ListDeploymentInstances" type ListDeploymentInstancesRequest struct { *aws.Request Input *ListDeploymentInstancesInput + Copy func(*ListDeploymentInstancesInput) ListDeploymentInstancesRequest } // Send marshals and sends the ListDeploymentInstances API request. @@ -1680,57 +1693,53 @@ func (c *CodeDeploy) ListDeploymentInstancesRequest(input *ListDeploymentInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDeploymentInstancesRequest{Request: req, Input: input} + return ListDeploymentInstancesRequest{Request: req, Input: input, Copy: c.ListDeploymentInstancesRequest} } -// ListDeploymentInstancesPages iterates over the pages of a ListDeploymentInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeploymentInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDeploymentInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDeploymentInstances operation. -// pageNum := 0 -// err := client.ListDeploymentInstancesPages(params, -// func(page *ListDeploymentInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListDeploymentInstancesPages(input *ListDeploymentInstancesInput, fn func(*ListDeploymentInstancesOutput, bool) bool) error { - return c.ListDeploymentInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDeploymentInstancesPagesWithContext same as ListDeploymentInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeDeploy) ListDeploymentInstancesPagesWithContext(ctx aws.Context, input *ListDeploymentInstancesInput, fn func(*ListDeploymentInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDeploymentInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDeploymentInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDeploymentInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDeploymentInstancesRequest) Paginate(opts ...aws.Option) ListDeploymentInstancesPager { + return ListDeploymentInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDeploymentInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDeploymentInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// ListDeploymentInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDeploymentInstancesPager struct { + aws.Pager +} + +func (p *ListDeploymentInstancesPager) CurrentPage() *ListDeploymentInstancesOutput { + return p.Pager.CurrentPage().(*ListDeploymentInstancesOutput) } const opListDeployments = "ListDeployments" @@ -1739,6 +1748,7 @@ const opListDeployments = "ListDeployments" type ListDeploymentsRequest struct { *aws.Request Input *ListDeploymentsInput + Copy func(*ListDeploymentsInput) ListDeploymentsRequest } // Send marshals and sends the ListDeployments API request. @@ -1786,57 +1796,53 @@ func (c *CodeDeploy) ListDeploymentsRequest(input *ListDeploymentsInput) ListDep req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDeploymentsRequest{Request: req, Input: input} + return ListDeploymentsRequest{Request: req, Input: input, Copy: c.ListDeploymentsRequest} } -// ListDeploymentsPages iterates over the pages of a ListDeployments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeployments method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDeploymentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDeployments operation. -// pageNum := 0 -// err := client.ListDeploymentsPages(params, -// func(page *ListDeploymentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListDeploymentsPages(input *ListDeploymentsInput, fn func(*ListDeploymentsOutput, bool) bool) error { - return c.ListDeploymentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDeploymentsPagesWithContext same as ListDeploymentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeDeploy) ListDeploymentsPagesWithContext(ctx aws.Context, input *ListDeploymentsInput, fn func(*ListDeploymentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDeploymentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDeploymentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDeploymentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDeploymentsRequest) Paginate(opts ...aws.Option) ListDeploymentsPager { + return ListDeploymentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDeploymentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDeploymentsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDeploymentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDeploymentsPager struct { + aws.Pager +} + +func (p *ListDeploymentsPager) CurrentPage() *ListDeploymentsOutput { + return p.Pager.CurrentPage().(*ListDeploymentsOutput) } const opListGitHubAccountTokenNames = "ListGitHubAccountTokenNames" @@ -1845,6 +1851,7 @@ const opListGitHubAccountTokenNames = "ListGitHubAccountTokenNames" type ListGitHubAccountTokenNamesRequest struct { *aws.Request Input *ListGitHubAccountTokenNamesInput + Copy func(*ListGitHubAccountTokenNamesInput) ListGitHubAccountTokenNamesRequest } // Send marshals and sends the ListGitHubAccountTokenNames API request. @@ -1885,7 +1892,7 @@ func (c *CodeDeploy) ListGitHubAccountTokenNamesRequest(input *ListGitHubAccount req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGitHubAccountTokenNamesRequest{Request: req, Input: input} + return ListGitHubAccountTokenNamesRequest{Request: req, Input: input, Copy: c.ListGitHubAccountTokenNamesRequest} } const opListOnPremisesInstances = "ListOnPremisesInstances" @@ -1894,6 +1901,7 @@ const opListOnPremisesInstances = "ListOnPremisesInstances" type ListOnPremisesInstancesRequest struct { *aws.Request Input *ListOnPremisesInstancesInput + Copy func(*ListOnPremisesInstancesInput) ListOnPremisesInstancesRequest } // Send marshals and sends the ListOnPremisesInstances API request. @@ -1938,7 +1946,7 @@ func (c *CodeDeploy) ListOnPremisesInstancesRequest(input *ListOnPremisesInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOnPremisesInstancesRequest{Request: req, Input: input} + return ListOnPremisesInstancesRequest{Request: req, Input: input, Copy: c.ListOnPremisesInstancesRequest} } const opPutLifecycleEventHookExecutionStatus = "PutLifecycleEventHookExecutionStatus" @@ -1947,6 +1955,7 @@ const opPutLifecycleEventHookExecutionStatus = "PutLifecycleEventHookExecutionSt type PutLifecycleEventHookExecutionStatusRequest struct { *aws.Request Input *PutLifecycleEventHookExecutionStatusInput + Copy func(*PutLifecycleEventHookExecutionStatusInput) PutLifecycleEventHookExecutionStatusRequest } // Send marshals and sends the PutLifecycleEventHookExecutionStatus API request. @@ -1989,7 +1998,7 @@ func (c *CodeDeploy) PutLifecycleEventHookExecutionStatusRequest(input *PutLifec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutLifecycleEventHookExecutionStatusRequest{Request: req, Input: input} + return PutLifecycleEventHookExecutionStatusRequest{Request: req, Input: input, Copy: c.PutLifecycleEventHookExecutionStatusRequest} } const opRegisterApplicationRevision = "RegisterApplicationRevision" @@ -1998,6 +2007,7 @@ const opRegisterApplicationRevision = "RegisterApplicationRevision" type RegisterApplicationRevisionRequest struct { *aws.Request Input *RegisterApplicationRevisionInput + Copy func(*RegisterApplicationRevisionInput) RegisterApplicationRevisionRequest } // Send marshals and sends the RegisterApplicationRevision API request. @@ -2040,7 +2050,7 @@ func (c *CodeDeploy) RegisterApplicationRevisionRequest(input *RegisterApplicati req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RegisterApplicationRevisionRequest{Request: req, Input: input} + return RegisterApplicationRevisionRequest{Request: req, Input: input, Copy: c.RegisterApplicationRevisionRequest} } const opRegisterOnPremisesInstance = "RegisterOnPremisesInstance" @@ -2049,6 +2059,7 @@ const opRegisterOnPremisesInstance = "RegisterOnPremisesInstance" type RegisterOnPremisesInstanceRequest struct { *aws.Request Input *RegisterOnPremisesInstanceInput + Copy func(*RegisterOnPremisesInstanceInput) RegisterOnPremisesInstanceRequest } // Send marshals and sends the RegisterOnPremisesInstance API request. @@ -2094,7 +2105,7 @@ func (c *CodeDeploy) RegisterOnPremisesInstanceRequest(input *RegisterOnPremises req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RegisterOnPremisesInstanceRequest{Request: req, Input: input} + return RegisterOnPremisesInstanceRequest{Request: req, Input: input, Copy: c.RegisterOnPremisesInstanceRequest} } const opRemoveTagsFromOnPremisesInstances = "RemoveTagsFromOnPremisesInstances" @@ -2103,6 +2114,7 @@ const opRemoveTagsFromOnPremisesInstances = "RemoveTagsFromOnPremisesInstances" type RemoveTagsFromOnPremisesInstancesRequest struct { *aws.Request Input *RemoveTagsFromOnPremisesInstancesInput + Copy func(*RemoveTagsFromOnPremisesInstancesInput) RemoveTagsFromOnPremisesInstancesRequest } // Send marshals and sends the RemoveTagsFromOnPremisesInstances API request. @@ -2145,7 +2157,7 @@ func (c *CodeDeploy) RemoveTagsFromOnPremisesInstancesRequest(input *RemoveTagsF req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromOnPremisesInstancesRequest{Request: req, Input: input} + return RemoveTagsFromOnPremisesInstancesRequest{Request: req, Input: input, Copy: c.RemoveTagsFromOnPremisesInstancesRequest} } const opSkipWaitTimeForInstanceTermination = "SkipWaitTimeForInstanceTermination" @@ -2154,6 +2166,7 @@ const opSkipWaitTimeForInstanceTermination = "SkipWaitTimeForInstanceTermination type SkipWaitTimeForInstanceTerminationRequest struct { *aws.Request Input *SkipWaitTimeForInstanceTerminationInput + Copy func(*SkipWaitTimeForInstanceTerminationInput) SkipWaitTimeForInstanceTerminationRequest } // Send marshals and sends the SkipWaitTimeForInstanceTermination API request. @@ -2197,7 +2210,7 @@ func (c *CodeDeploy) SkipWaitTimeForInstanceTerminationRequest(input *SkipWaitTi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SkipWaitTimeForInstanceTerminationRequest{Request: req, Input: input} + return SkipWaitTimeForInstanceTerminationRequest{Request: req, Input: input, Copy: c.SkipWaitTimeForInstanceTerminationRequest} } const opStopDeployment = "StopDeployment" @@ -2206,6 +2219,7 @@ const opStopDeployment = "StopDeployment" type StopDeploymentRequest struct { *aws.Request Input *StopDeploymentInput + Copy func(*StopDeploymentInput) StopDeploymentRequest } // Send marshals and sends the StopDeployment API request. @@ -2246,7 +2260,7 @@ func (c *CodeDeploy) StopDeploymentRequest(input *StopDeploymentInput) StopDeplo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopDeploymentRequest{Request: req, Input: input} + return StopDeploymentRequest{Request: req, Input: input, Copy: c.StopDeploymentRequest} } const opUpdateApplication = "UpdateApplication" @@ -2255,6 +2269,7 @@ const opUpdateApplication = "UpdateApplication" type UpdateApplicationRequest struct { *aws.Request Input *UpdateApplicationInput + Copy func(*UpdateApplicationInput) UpdateApplicationRequest } // Send marshals and sends the UpdateApplication API request. @@ -2297,7 +2312,7 @@ func (c *CodeDeploy) UpdateApplicationRequest(input *UpdateApplicationInput) Upd req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateApplicationRequest{Request: req, Input: input} + return UpdateApplicationRequest{Request: req, Input: input, Copy: c.UpdateApplicationRequest} } const opUpdateDeploymentGroup = "UpdateDeploymentGroup" @@ -2306,6 +2321,7 @@ const opUpdateDeploymentGroup = "UpdateDeploymentGroup" type UpdateDeploymentGroupRequest struct { *aws.Request Input *UpdateDeploymentGroupInput + Copy func(*UpdateDeploymentGroupInput) UpdateDeploymentGroupRequest } // Send marshals and sends the UpdateDeploymentGroup API request. @@ -2346,7 +2362,7 @@ func (c *CodeDeploy) UpdateDeploymentGroupRequest(input *UpdateDeploymentGroupIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDeploymentGroupRequest{Request: req, Input: input} + return UpdateDeploymentGroupRequest{Request: req, Input: input, Copy: c.UpdateDeploymentGroupRequest} } // Represents the input of, and adds tags to, an on-premises instance operation. diff --git a/service/codedeploy/codedeployiface/interface.go b/service/codedeploy/codedeployiface/interface.go index f4e340b6eda..f8b9be23229 100644 --- a/service/codedeploy/codedeployiface/interface.go +++ b/service/codedeploy/codedeployiface/interface.go @@ -113,34 +113,16 @@ type CodeDeployAPI interface { ListApplicationRevisionsRequest(*codedeploy.ListApplicationRevisionsInput) codedeploy.ListApplicationRevisionsRequest - ListApplicationRevisionsPages(*codedeploy.ListApplicationRevisionsInput, func(*codedeploy.ListApplicationRevisionsOutput, bool) bool) error - ListApplicationRevisionsPagesWithContext(aws.Context, *codedeploy.ListApplicationRevisionsInput, func(*codedeploy.ListApplicationRevisionsOutput, bool) bool, ...aws.Option) error - ListApplicationsRequest(*codedeploy.ListApplicationsInput) codedeploy.ListApplicationsRequest - ListApplicationsPages(*codedeploy.ListApplicationsInput, func(*codedeploy.ListApplicationsOutput, bool) bool) error - ListApplicationsPagesWithContext(aws.Context, *codedeploy.ListApplicationsInput, func(*codedeploy.ListApplicationsOutput, bool) bool, ...aws.Option) error - ListDeploymentConfigsRequest(*codedeploy.ListDeploymentConfigsInput) codedeploy.ListDeploymentConfigsRequest - ListDeploymentConfigsPages(*codedeploy.ListDeploymentConfigsInput, func(*codedeploy.ListDeploymentConfigsOutput, bool) bool) error - ListDeploymentConfigsPagesWithContext(aws.Context, *codedeploy.ListDeploymentConfigsInput, func(*codedeploy.ListDeploymentConfigsOutput, bool) bool, ...aws.Option) error - ListDeploymentGroupsRequest(*codedeploy.ListDeploymentGroupsInput) codedeploy.ListDeploymentGroupsRequest - ListDeploymentGroupsPages(*codedeploy.ListDeploymentGroupsInput, func(*codedeploy.ListDeploymentGroupsOutput, bool) bool) error - ListDeploymentGroupsPagesWithContext(aws.Context, *codedeploy.ListDeploymentGroupsInput, func(*codedeploy.ListDeploymentGroupsOutput, bool) bool, ...aws.Option) error - ListDeploymentInstancesRequest(*codedeploy.ListDeploymentInstancesInput) codedeploy.ListDeploymentInstancesRequest - ListDeploymentInstancesPages(*codedeploy.ListDeploymentInstancesInput, func(*codedeploy.ListDeploymentInstancesOutput, bool) bool) error - ListDeploymentInstancesPagesWithContext(aws.Context, *codedeploy.ListDeploymentInstancesInput, func(*codedeploy.ListDeploymentInstancesOutput, bool) bool, ...aws.Option) error - ListDeploymentsRequest(*codedeploy.ListDeploymentsInput) codedeploy.ListDeploymentsRequest - ListDeploymentsPages(*codedeploy.ListDeploymentsInput, func(*codedeploy.ListDeploymentsOutput, bool) bool) error - ListDeploymentsPagesWithContext(aws.Context, *codedeploy.ListDeploymentsInput, func(*codedeploy.ListDeploymentsOutput, bool) bool, ...aws.Option) error - ListGitHubAccountTokenNamesRequest(*codedeploy.ListGitHubAccountTokenNamesInput) codedeploy.ListGitHubAccountTokenNamesRequest ListOnPremisesInstancesRequest(*codedeploy.ListOnPremisesInstancesInput) codedeploy.ListOnPremisesInstancesRequest diff --git a/service/codepipeline/api.go b/service/codepipeline/api.go index f5979d64cda..20256b4d198 100644 --- a/service/codepipeline/api.go +++ b/service/codepipeline/api.go @@ -18,6 +18,7 @@ const opAcknowledgeJob = "AcknowledgeJob" type AcknowledgeJobRequest struct { *aws.Request Input *AcknowledgeJobInput + Copy func(*AcknowledgeJobInput) AcknowledgeJobRequest } // Send marshals and sends the AcknowledgeJob API request. @@ -59,7 +60,7 @@ func (c *CodePipeline) AcknowledgeJobRequest(input *AcknowledgeJobInput) Acknowl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcknowledgeJobRequest{Request: req, Input: input} + return AcknowledgeJobRequest{Request: req, Input: input, Copy: c.AcknowledgeJobRequest} } const opAcknowledgeThirdPartyJob = "AcknowledgeThirdPartyJob" @@ -68,6 +69,7 @@ const opAcknowledgeThirdPartyJob = "AcknowledgeThirdPartyJob" type AcknowledgeThirdPartyJobRequest struct { *aws.Request Input *AcknowledgeThirdPartyJobInput + Copy func(*AcknowledgeThirdPartyJobInput) AcknowledgeThirdPartyJobRequest } // Send marshals and sends the AcknowledgeThirdPartyJob API request. @@ -109,7 +111,7 @@ func (c *CodePipeline) AcknowledgeThirdPartyJobRequest(input *AcknowledgeThirdPa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcknowledgeThirdPartyJobRequest{Request: req, Input: input} + return AcknowledgeThirdPartyJobRequest{Request: req, Input: input, Copy: c.AcknowledgeThirdPartyJobRequest} } const opCreateCustomActionType = "CreateCustomActionType" @@ -118,6 +120,7 @@ const opCreateCustomActionType = "CreateCustomActionType" type CreateCustomActionTypeRequest struct { *aws.Request Input *CreateCustomActionTypeInput + Copy func(*CreateCustomActionTypeInput) CreateCustomActionTypeRequest } // Send marshals and sends the CreateCustomActionType API request. @@ -159,7 +162,7 @@ func (c *CodePipeline) CreateCustomActionTypeRequest(input *CreateCustomActionTy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCustomActionTypeRequest{Request: req, Input: input} + return CreateCustomActionTypeRequest{Request: req, Input: input, Copy: c.CreateCustomActionTypeRequest} } const opCreatePipeline = "CreatePipeline" @@ -168,6 +171,7 @@ const opCreatePipeline = "CreatePipeline" type CreatePipelineRequest struct { *aws.Request Input *CreatePipelineInput + Copy func(*CreatePipelineInput) CreatePipelineRequest } // Send marshals and sends the CreatePipeline API request. @@ -208,7 +212,7 @@ func (c *CodePipeline) CreatePipelineRequest(input *CreatePipelineInput) CreateP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePipelineRequest{Request: req, Input: input} + return CreatePipelineRequest{Request: req, Input: input, Copy: c.CreatePipelineRequest} } const opDeleteCustomActionType = "DeleteCustomActionType" @@ -217,6 +221,7 @@ const opDeleteCustomActionType = "DeleteCustomActionType" type DeleteCustomActionTypeRequest struct { *aws.Request Input *DeleteCustomActionTypeInput + Copy func(*DeleteCustomActionTypeInput) DeleteCustomActionTypeRequest } // Send marshals and sends the DeleteCustomActionType API request. @@ -263,7 +268,7 @@ func (c *CodePipeline) DeleteCustomActionTypeRequest(input *DeleteCustomActionTy req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCustomActionTypeRequest{Request: req, Input: input} + return DeleteCustomActionTypeRequest{Request: req, Input: input, Copy: c.DeleteCustomActionTypeRequest} } const opDeletePipeline = "DeletePipeline" @@ -272,6 +277,7 @@ const opDeletePipeline = "DeletePipeline" type DeletePipelineRequest struct { *aws.Request Input *DeletePipelineInput + Copy func(*DeletePipelineInput) DeletePipelineRequest } // Send marshals and sends the DeletePipeline API request. @@ -314,7 +320,7 @@ func (c *CodePipeline) DeletePipelineRequest(input *DeletePipelineInput) DeleteP req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePipelineRequest{Request: req, Input: input} + return DeletePipelineRequest{Request: req, Input: input, Copy: c.DeletePipelineRequest} } const opDisableStageTransition = "DisableStageTransition" @@ -323,6 +329,7 @@ const opDisableStageTransition = "DisableStageTransition" type DisableStageTransitionRequest struct { *aws.Request Input *DisableStageTransitionInput + Copy func(*DisableStageTransitionInput) DisableStageTransitionRequest } // Send marshals and sends the DisableStageTransition API request. @@ -366,7 +373,7 @@ func (c *CodePipeline) DisableStageTransitionRequest(input *DisableStageTransiti req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisableStageTransitionRequest{Request: req, Input: input} + return DisableStageTransitionRequest{Request: req, Input: input, Copy: c.DisableStageTransitionRequest} } const opEnableStageTransition = "EnableStageTransition" @@ -375,6 +382,7 @@ const opEnableStageTransition = "EnableStageTransition" type EnableStageTransitionRequest struct { *aws.Request Input *EnableStageTransitionInput + Copy func(*EnableStageTransitionInput) EnableStageTransitionRequest } // Send marshals and sends the EnableStageTransition API request. @@ -417,7 +425,7 @@ func (c *CodePipeline) EnableStageTransitionRequest(input *EnableStageTransition req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableStageTransitionRequest{Request: req, Input: input} + return EnableStageTransitionRequest{Request: req, Input: input, Copy: c.EnableStageTransitionRequest} } const opGetJobDetails = "GetJobDetails" @@ -426,6 +434,7 @@ const opGetJobDetails = "GetJobDetails" type GetJobDetailsRequest struct { *aws.Request Input *GetJobDetailsInput + Copy func(*GetJobDetailsInput) GetJobDetailsRequest } // Send marshals and sends the GetJobDetails API request. @@ -471,7 +480,7 @@ func (c *CodePipeline) GetJobDetailsRequest(input *GetJobDetailsInput) GetJobDet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobDetailsRequest{Request: req, Input: input} + return GetJobDetailsRequest{Request: req, Input: input, Copy: c.GetJobDetailsRequest} } const opGetPipeline = "GetPipeline" @@ -480,6 +489,7 @@ const opGetPipeline = "GetPipeline" type GetPipelineRequest struct { *aws.Request Input *GetPipelineInput + Copy func(*GetPipelineInput) GetPipelineRequest } // Send marshals and sends the GetPipeline API request. @@ -522,7 +532,7 @@ func (c *CodePipeline) GetPipelineRequest(input *GetPipelineInput) GetPipelineRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPipelineRequest{Request: req, Input: input} + return GetPipelineRequest{Request: req, Input: input, Copy: c.GetPipelineRequest} } const opGetPipelineExecution = "GetPipelineExecution" @@ -531,6 +541,7 @@ const opGetPipelineExecution = "GetPipelineExecution" type GetPipelineExecutionRequest struct { *aws.Request Input *GetPipelineExecutionInput + Copy func(*GetPipelineExecutionInput) GetPipelineExecutionRequest } // Send marshals and sends the GetPipelineExecution API request. @@ -573,7 +584,7 @@ func (c *CodePipeline) GetPipelineExecutionRequest(input *GetPipelineExecutionIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPipelineExecutionRequest{Request: req, Input: input} + return GetPipelineExecutionRequest{Request: req, Input: input, Copy: c.GetPipelineExecutionRequest} } const opGetPipelineState = "GetPipelineState" @@ -582,6 +593,7 @@ const opGetPipelineState = "GetPipelineState" type GetPipelineStateRequest struct { *aws.Request Input *GetPipelineStateInput + Copy func(*GetPipelineStateInput) GetPipelineStateRequest } // Send marshals and sends the GetPipelineState API request. @@ -623,7 +635,7 @@ func (c *CodePipeline) GetPipelineStateRequest(input *GetPipelineStateInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPipelineStateRequest{Request: req, Input: input} + return GetPipelineStateRequest{Request: req, Input: input, Copy: c.GetPipelineStateRequest} } const opGetThirdPartyJobDetails = "GetThirdPartyJobDetails" @@ -632,6 +644,7 @@ const opGetThirdPartyJobDetails = "GetThirdPartyJobDetails" type GetThirdPartyJobDetailsRequest struct { *aws.Request Input *GetThirdPartyJobDetailsInput + Copy func(*GetThirdPartyJobDetailsInput) GetThirdPartyJobDetailsRequest } // Send marshals and sends the GetThirdPartyJobDetails API request. @@ -678,7 +691,7 @@ func (c *CodePipeline) GetThirdPartyJobDetailsRequest(input *GetThirdPartyJobDet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetThirdPartyJobDetailsRequest{Request: req, Input: input} + return GetThirdPartyJobDetailsRequest{Request: req, Input: input, Copy: c.GetThirdPartyJobDetailsRequest} } const opListActionTypes = "ListActionTypes" @@ -687,6 +700,7 @@ const opListActionTypes = "ListActionTypes" type ListActionTypesRequest struct { *aws.Request Input *ListActionTypesInput + Copy func(*ListActionTypesInput) ListActionTypesRequest } // Send marshals and sends the ListActionTypes API request. @@ -728,7 +742,7 @@ func (c *CodePipeline) ListActionTypesRequest(input *ListActionTypesInput) ListA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListActionTypesRequest{Request: req, Input: input} + return ListActionTypesRequest{Request: req, Input: input, Copy: c.ListActionTypesRequest} } const opListPipelineExecutions = "ListPipelineExecutions" @@ -737,6 +751,7 @@ const opListPipelineExecutions = "ListPipelineExecutions" type ListPipelineExecutionsRequest struct { *aws.Request Input *ListPipelineExecutionsInput + Copy func(*ListPipelineExecutionsInput) ListPipelineExecutionsRequest } // Send marshals and sends the ListPipelineExecutions API request. @@ -777,7 +792,7 @@ func (c *CodePipeline) ListPipelineExecutionsRequest(input *ListPipelineExecutio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPipelineExecutionsRequest{Request: req, Input: input} + return ListPipelineExecutionsRequest{Request: req, Input: input, Copy: c.ListPipelineExecutionsRequest} } const opListPipelines = "ListPipelines" @@ -786,6 +801,7 @@ const opListPipelines = "ListPipelines" type ListPipelinesRequest struct { *aws.Request Input *ListPipelinesInput + Copy func(*ListPipelinesInput) ListPipelinesRequest } // Send marshals and sends the ListPipelines API request. @@ -826,7 +842,7 @@ func (c *CodePipeline) ListPipelinesRequest(input *ListPipelinesInput) ListPipel req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPipelinesRequest{Request: req, Input: input} + return ListPipelinesRequest{Request: req, Input: input, Copy: c.ListPipelinesRequest} } const opPollForJobs = "PollForJobs" @@ -835,6 +851,7 @@ const opPollForJobs = "PollForJobs" type PollForJobsRequest struct { *aws.Request Input *PollForJobsInput + Copy func(*PollForJobsInput) PollForJobsRequest } // Send marshals and sends the PollForJobs API request. @@ -880,7 +897,7 @@ func (c *CodePipeline) PollForJobsRequest(input *PollForJobsInput) PollForJobsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PollForJobsRequest{Request: req, Input: input} + return PollForJobsRequest{Request: req, Input: input, Copy: c.PollForJobsRequest} } const opPollForThirdPartyJobs = "PollForThirdPartyJobs" @@ -889,6 +906,7 @@ const opPollForThirdPartyJobs = "PollForThirdPartyJobs" type PollForThirdPartyJobsRequest struct { *aws.Request Input *PollForThirdPartyJobsInput + Copy func(*PollForThirdPartyJobsInput) PollForThirdPartyJobsRequest } // Send marshals and sends the PollForThirdPartyJobs API request. @@ -934,7 +952,7 @@ func (c *CodePipeline) PollForThirdPartyJobsRequest(input *PollForThirdPartyJobs req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PollForThirdPartyJobsRequest{Request: req, Input: input} + return PollForThirdPartyJobsRequest{Request: req, Input: input, Copy: c.PollForThirdPartyJobsRequest} } const opPutActionRevision = "PutActionRevision" @@ -943,6 +961,7 @@ const opPutActionRevision = "PutActionRevision" type PutActionRevisionRequest struct { *aws.Request Input *PutActionRevisionInput + Copy func(*PutActionRevisionInput) PutActionRevisionRequest } // Send marshals and sends the PutActionRevision API request. @@ -983,7 +1002,7 @@ func (c *CodePipeline) PutActionRevisionRequest(input *PutActionRevisionInput) P req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutActionRevisionRequest{Request: req, Input: input} + return PutActionRevisionRequest{Request: req, Input: input, Copy: c.PutActionRevisionRequest} } const opPutApprovalResult = "PutApprovalResult" @@ -992,6 +1011,7 @@ const opPutApprovalResult = "PutApprovalResult" type PutApprovalResultRequest struct { *aws.Request Input *PutApprovalResultInput + Copy func(*PutApprovalResultInput) PutApprovalResultRequest } // Send marshals and sends the PutApprovalResult API request. @@ -1033,7 +1053,7 @@ func (c *CodePipeline) PutApprovalResultRequest(input *PutApprovalResultInput) P req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutApprovalResultRequest{Request: req, Input: input} + return PutApprovalResultRequest{Request: req, Input: input, Copy: c.PutApprovalResultRequest} } const opPutJobFailureResult = "PutJobFailureResult" @@ -1042,6 +1062,7 @@ const opPutJobFailureResult = "PutJobFailureResult" type PutJobFailureResultRequest struct { *aws.Request Input *PutJobFailureResultInput + Copy func(*PutJobFailureResultInput) PutJobFailureResultRequest } // Send marshals and sends the PutJobFailureResult API request. @@ -1085,7 +1106,7 @@ func (c *CodePipeline) PutJobFailureResultRequest(input *PutJobFailureResultInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutJobFailureResultRequest{Request: req, Input: input} + return PutJobFailureResultRequest{Request: req, Input: input, Copy: c.PutJobFailureResultRequest} } const opPutJobSuccessResult = "PutJobSuccessResult" @@ -1094,6 +1115,7 @@ const opPutJobSuccessResult = "PutJobSuccessResult" type PutJobSuccessResultRequest struct { *aws.Request Input *PutJobSuccessResultInput + Copy func(*PutJobSuccessResultInput) PutJobSuccessResultRequest } // Send marshals and sends the PutJobSuccessResult API request. @@ -1137,7 +1159,7 @@ func (c *CodePipeline) PutJobSuccessResultRequest(input *PutJobSuccessResultInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutJobSuccessResultRequest{Request: req, Input: input} + return PutJobSuccessResultRequest{Request: req, Input: input, Copy: c.PutJobSuccessResultRequest} } const opPutThirdPartyJobFailureResult = "PutThirdPartyJobFailureResult" @@ -1146,6 +1168,7 @@ const opPutThirdPartyJobFailureResult = "PutThirdPartyJobFailureResult" type PutThirdPartyJobFailureResultRequest struct { *aws.Request Input *PutThirdPartyJobFailureResultInput + Copy func(*PutThirdPartyJobFailureResultInput) PutThirdPartyJobFailureResultRequest } // Send marshals and sends the PutThirdPartyJobFailureResult API request. @@ -1189,7 +1212,7 @@ func (c *CodePipeline) PutThirdPartyJobFailureResultRequest(input *PutThirdParty req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutThirdPartyJobFailureResultRequest{Request: req, Input: input} + return PutThirdPartyJobFailureResultRequest{Request: req, Input: input, Copy: c.PutThirdPartyJobFailureResultRequest} } const opPutThirdPartyJobSuccessResult = "PutThirdPartyJobSuccessResult" @@ -1198,6 +1221,7 @@ const opPutThirdPartyJobSuccessResult = "PutThirdPartyJobSuccessResult" type PutThirdPartyJobSuccessResultRequest struct { *aws.Request Input *PutThirdPartyJobSuccessResultInput + Copy func(*PutThirdPartyJobSuccessResultInput) PutThirdPartyJobSuccessResultRequest } // Send marshals and sends the PutThirdPartyJobSuccessResult API request. @@ -1241,7 +1265,7 @@ func (c *CodePipeline) PutThirdPartyJobSuccessResultRequest(input *PutThirdParty req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutThirdPartyJobSuccessResultRequest{Request: req, Input: input} + return PutThirdPartyJobSuccessResultRequest{Request: req, Input: input, Copy: c.PutThirdPartyJobSuccessResultRequest} } const opRetryStageExecution = "RetryStageExecution" @@ -1250,6 +1274,7 @@ const opRetryStageExecution = "RetryStageExecution" type RetryStageExecutionRequest struct { *aws.Request Input *RetryStageExecutionInput + Copy func(*RetryStageExecutionInput) RetryStageExecutionRequest } // Send marshals and sends the RetryStageExecution API request. @@ -1290,7 +1315,7 @@ func (c *CodePipeline) RetryStageExecutionRequest(input *RetryStageExecutionInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RetryStageExecutionRequest{Request: req, Input: input} + return RetryStageExecutionRequest{Request: req, Input: input, Copy: c.RetryStageExecutionRequest} } const opStartPipelineExecution = "StartPipelineExecution" @@ -1299,6 +1324,7 @@ const opStartPipelineExecution = "StartPipelineExecution" type StartPipelineExecutionRequest struct { *aws.Request Input *StartPipelineExecutionInput + Copy func(*StartPipelineExecutionInput) StartPipelineExecutionRequest } // Send marshals and sends the StartPipelineExecution API request. @@ -1340,7 +1366,7 @@ func (c *CodePipeline) StartPipelineExecutionRequest(input *StartPipelineExecuti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartPipelineExecutionRequest{Request: req, Input: input} + return StartPipelineExecutionRequest{Request: req, Input: input, Copy: c.StartPipelineExecutionRequest} } const opUpdatePipeline = "UpdatePipeline" @@ -1349,6 +1375,7 @@ const opUpdatePipeline = "UpdatePipeline" type UpdatePipelineRequest struct { *aws.Request Input *UpdatePipelineInput + Copy func(*UpdatePipelineInput) UpdatePipelineRequest } // Send marshals and sends the UpdatePipeline API request. @@ -1392,7 +1419,7 @@ func (c *CodePipeline) UpdatePipelineRequest(input *UpdatePipelineInput) UpdateP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePipelineRequest{Request: req, Input: input} + return UpdatePipelineRequest{Request: req, Input: input, Copy: c.UpdatePipelineRequest} } // Represents an AWS session credentials object. These credentials are temporary diff --git a/service/codestar/api.go b/service/codestar/api.go index 501b6019ef1..434f2d96748 100644 --- a/service/codestar/api.go +++ b/service/codestar/api.go @@ -15,6 +15,7 @@ const opAssociateTeamMember = "AssociateTeamMember" type AssociateTeamMemberRequest struct { *aws.Request Input *AssociateTeamMemberInput + Copy func(*AssociateTeamMemberInput) AssociateTeamMemberRequest } // Send marshals and sends the AssociateTeamMember API request. @@ -55,7 +56,7 @@ func (c *CodeStar) AssociateTeamMemberRequest(input *AssociateTeamMemberInput) A req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateTeamMemberRequest{Request: req, Input: input} + return AssociateTeamMemberRequest{Request: req, Input: input, Copy: c.AssociateTeamMemberRequest} } const opCreateProject = "CreateProject" @@ -64,6 +65,7 @@ const opCreateProject = "CreateProject" type CreateProjectRequest struct { *aws.Request Input *CreateProjectInput + Copy func(*CreateProjectInput) CreateProjectRequest } // Send marshals and sends the CreateProject API request. @@ -104,7 +106,7 @@ func (c *CodeStar) CreateProjectRequest(input *CreateProjectInput) CreateProject req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateProjectRequest{Request: req, Input: input} + return CreateProjectRequest{Request: req, Input: input, Copy: c.CreateProjectRequest} } const opCreateUserProfile = "CreateUserProfile" @@ -113,6 +115,7 @@ const opCreateUserProfile = "CreateUserProfile" type CreateUserProfileRequest struct { *aws.Request Input *CreateUserProfileInput + Copy func(*CreateUserProfileInput) CreateUserProfileRequest } // Send marshals and sends the CreateUserProfile API request. @@ -157,7 +160,7 @@ func (c *CodeStar) CreateUserProfileRequest(input *CreateUserProfileInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserProfileRequest{Request: req, Input: input} + return CreateUserProfileRequest{Request: req, Input: input, Copy: c.CreateUserProfileRequest} } const opDeleteProject = "DeleteProject" @@ -166,6 +169,7 @@ const opDeleteProject = "DeleteProject" type DeleteProjectRequest struct { *aws.Request Input *DeleteProjectInput + Copy func(*DeleteProjectInput) DeleteProjectRequest } // Send marshals and sends the DeleteProject API request. @@ -208,7 +212,7 @@ func (c *CodeStar) DeleteProjectRequest(input *DeleteProjectInput) DeleteProject req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteProjectRequest{Request: req, Input: input} + return DeleteProjectRequest{Request: req, Input: input, Copy: c.DeleteProjectRequest} } const opDeleteUserProfile = "DeleteUserProfile" @@ -217,6 +221,7 @@ const opDeleteUserProfile = "DeleteUserProfile" type DeleteUserProfileRequest struct { *aws.Request Input *DeleteUserProfileInput + Copy func(*DeleteUserProfileInput) DeleteUserProfileRequest } // Send marshals and sends the DeleteUserProfile API request. @@ -260,7 +265,7 @@ func (c *CodeStar) DeleteUserProfileRequest(input *DeleteUserProfileInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteUserProfileRequest{Request: req, Input: input} + return DeleteUserProfileRequest{Request: req, Input: input, Copy: c.DeleteUserProfileRequest} } const opDescribeProject = "DescribeProject" @@ -269,6 +274,7 @@ const opDescribeProject = "DescribeProject" type DescribeProjectRequest struct { *aws.Request Input *DescribeProjectInput + Copy func(*DescribeProjectInput) DescribeProjectRequest } // Send marshals and sends the DescribeProject API request. @@ -309,7 +315,7 @@ func (c *CodeStar) DescribeProjectRequest(input *DescribeProjectInput) DescribeP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeProjectRequest{Request: req, Input: input} + return DescribeProjectRequest{Request: req, Input: input, Copy: c.DescribeProjectRequest} } const opDescribeUserProfile = "DescribeUserProfile" @@ -318,6 +324,7 @@ const opDescribeUserProfile = "DescribeUserProfile" type DescribeUserProfileRequest struct { *aws.Request Input *DescribeUserProfileInput + Copy func(*DescribeUserProfileInput) DescribeUserProfileRequest } // Send marshals and sends the DescribeUserProfile API request. @@ -358,7 +365,7 @@ func (c *CodeStar) DescribeUserProfileRequest(input *DescribeUserProfileInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUserProfileRequest{Request: req, Input: input} + return DescribeUserProfileRequest{Request: req, Input: input, Copy: c.DescribeUserProfileRequest} } const opDisassociateTeamMember = "DisassociateTeamMember" @@ -367,6 +374,7 @@ const opDisassociateTeamMember = "DisassociateTeamMember" type DisassociateTeamMemberRequest struct { *aws.Request Input *DisassociateTeamMemberInput + Copy func(*DisassociateTeamMemberInput) DisassociateTeamMemberRequest } // Send marshals and sends the DisassociateTeamMember API request. @@ -410,7 +418,7 @@ func (c *CodeStar) DisassociateTeamMemberRequest(input *DisassociateTeamMemberIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateTeamMemberRequest{Request: req, Input: input} + return DisassociateTeamMemberRequest{Request: req, Input: input, Copy: c.DisassociateTeamMemberRequest} } const opListProjects = "ListProjects" @@ -419,6 +427,7 @@ const opListProjects = "ListProjects" type ListProjectsRequest struct { *aws.Request Input *ListProjectsInput + Copy func(*ListProjectsInput) ListProjectsRequest } // Send marshals and sends the ListProjects API request. @@ -459,7 +468,7 @@ func (c *CodeStar) ListProjectsRequest(input *ListProjectsInput) ListProjectsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListProjectsRequest{Request: req, Input: input} + return ListProjectsRequest{Request: req, Input: input, Copy: c.ListProjectsRequest} } const opListResources = "ListResources" @@ -468,6 +477,7 @@ const opListResources = "ListResources" type ListResourcesRequest struct { *aws.Request Input *ListResourcesInput + Copy func(*ListResourcesInput) ListResourcesRequest } // Send marshals and sends the ListResources API request. @@ -508,7 +518,7 @@ func (c *CodeStar) ListResourcesRequest(input *ListResourcesInput) ListResources req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourcesRequest{Request: req, Input: input} + return ListResourcesRequest{Request: req, Input: input, Copy: c.ListResourcesRequest} } const opListTagsForProject = "ListTagsForProject" @@ -517,6 +527,7 @@ const opListTagsForProject = "ListTagsForProject" type ListTagsForProjectRequest struct { *aws.Request Input *ListTagsForProjectInput + Copy func(*ListTagsForProjectInput) ListTagsForProjectRequest } // Send marshals and sends the ListTagsForProject API request. @@ -557,7 +568,7 @@ func (c *CodeStar) ListTagsForProjectRequest(input *ListTagsForProjectInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForProjectRequest{Request: req, Input: input} + return ListTagsForProjectRequest{Request: req, Input: input, Copy: c.ListTagsForProjectRequest} } const opListTeamMembers = "ListTeamMembers" @@ -566,6 +577,7 @@ const opListTeamMembers = "ListTeamMembers" type ListTeamMembersRequest struct { *aws.Request Input *ListTeamMembersInput + Copy func(*ListTeamMembersInput) ListTeamMembersRequest } // Send marshals and sends the ListTeamMembers API request. @@ -606,7 +618,7 @@ func (c *CodeStar) ListTeamMembersRequest(input *ListTeamMembersInput) ListTeamM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTeamMembersRequest{Request: req, Input: input} + return ListTeamMembersRequest{Request: req, Input: input, Copy: c.ListTeamMembersRequest} } const opListUserProfiles = "ListUserProfiles" @@ -615,6 +627,7 @@ const opListUserProfiles = "ListUserProfiles" type ListUserProfilesRequest struct { *aws.Request Input *ListUserProfilesInput + Copy func(*ListUserProfilesInput) ListUserProfilesRequest } // Send marshals and sends the ListUserProfiles API request. @@ -655,7 +668,7 @@ func (c *CodeStar) ListUserProfilesRequest(input *ListUserProfilesInput) ListUse req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUserProfilesRequest{Request: req, Input: input} + return ListUserProfilesRequest{Request: req, Input: input, Copy: c.ListUserProfilesRequest} } const opTagProject = "TagProject" @@ -664,6 +677,7 @@ const opTagProject = "TagProject" type TagProjectRequest struct { *aws.Request Input *TagProjectInput + Copy func(*TagProjectInput) TagProjectRequest } // Send marshals and sends the TagProject API request. @@ -704,7 +718,7 @@ func (c *CodeStar) TagProjectRequest(input *TagProjectInput) TagProjectRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagProjectRequest{Request: req, Input: input} + return TagProjectRequest{Request: req, Input: input, Copy: c.TagProjectRequest} } const opUntagProject = "UntagProject" @@ -713,6 +727,7 @@ const opUntagProject = "UntagProject" type UntagProjectRequest struct { *aws.Request Input *UntagProjectInput + Copy func(*UntagProjectInput) UntagProjectRequest } // Send marshals and sends the UntagProject API request. @@ -753,7 +768,7 @@ func (c *CodeStar) UntagProjectRequest(input *UntagProjectInput) UntagProjectReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagProjectRequest{Request: req, Input: input} + return UntagProjectRequest{Request: req, Input: input, Copy: c.UntagProjectRequest} } const opUpdateProject = "UpdateProject" @@ -762,6 +777,7 @@ const opUpdateProject = "UpdateProject" type UpdateProjectRequest struct { *aws.Request Input *UpdateProjectInput + Copy func(*UpdateProjectInput) UpdateProjectRequest } // Send marshals and sends the UpdateProject API request. @@ -802,7 +818,7 @@ func (c *CodeStar) UpdateProjectRequest(input *UpdateProjectInput) UpdateProject req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateProjectRequest{Request: req, Input: input} + return UpdateProjectRequest{Request: req, Input: input, Copy: c.UpdateProjectRequest} } const opUpdateTeamMember = "UpdateTeamMember" @@ -811,6 +827,7 @@ const opUpdateTeamMember = "UpdateTeamMember" type UpdateTeamMemberRequest struct { *aws.Request Input *UpdateTeamMemberInput + Copy func(*UpdateTeamMemberInput) UpdateTeamMemberRequest } // Send marshals and sends the UpdateTeamMember API request. @@ -853,7 +870,7 @@ func (c *CodeStar) UpdateTeamMemberRequest(input *UpdateTeamMemberInput) UpdateT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTeamMemberRequest{Request: req, Input: input} + return UpdateTeamMemberRequest{Request: req, Input: input, Copy: c.UpdateTeamMemberRequest} } const opUpdateUserProfile = "UpdateUserProfile" @@ -862,6 +879,7 @@ const opUpdateUserProfile = "UpdateUserProfile" type UpdateUserProfileRequest struct { *aws.Request Input *UpdateUserProfileInput + Copy func(*UpdateUserProfileInput) UpdateUserProfileRequest } // Send marshals and sends the UpdateUserProfile API request. @@ -904,7 +922,7 @@ func (c *CodeStar) UpdateUserProfileRequest(input *UpdateUserProfileInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateUserProfileRequest{Request: req, Input: input} + return UpdateUserProfileRequest{Request: req, Input: input, Copy: c.UpdateUserProfileRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/codestar-2017-04-19/AssociateTeamMemberRequest diff --git a/service/cognitoidentity/api.go b/service/cognitoidentity/api.go index 21613f5e5e9..2202f16a411 100644 --- a/service/cognitoidentity/api.go +++ b/service/cognitoidentity/api.go @@ -18,6 +18,7 @@ const opCreateIdentityPool = "CreateIdentityPool" type CreateIdentityPoolRequest struct { *aws.Request Input *CreateIdentityPoolInput + Copy func(*CreateIdentityPoolInput) CreateIdentityPoolRequest } // Send marshals and sends the CreateIdentityPool API request. @@ -72,7 +73,7 @@ func (c *CognitoIdentity) CreateIdentityPoolRequest(input *CreateIdentityPoolInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateIdentityPoolRequest{Request: req, Input: input} + return CreateIdentityPoolRequest{Request: req, Input: input, Copy: c.CreateIdentityPoolRequest} } const opDeleteIdentities = "DeleteIdentities" @@ -81,6 +82,7 @@ const opDeleteIdentities = "DeleteIdentities" type DeleteIdentitiesRequest struct { *aws.Request Input *DeleteIdentitiesInput + Copy func(*DeleteIdentitiesInput) DeleteIdentitiesRequest } // Send marshals and sends the DeleteIdentities API request. @@ -124,7 +126,7 @@ func (c *CognitoIdentity) DeleteIdentitiesRequest(input *DeleteIdentitiesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteIdentitiesRequest{Request: req, Input: input} + return DeleteIdentitiesRequest{Request: req, Input: input, Copy: c.DeleteIdentitiesRequest} } const opDeleteIdentityPool = "DeleteIdentityPool" @@ -133,6 +135,7 @@ const opDeleteIdentityPool = "DeleteIdentityPool" type DeleteIdentityPoolRequest struct { *aws.Request Input *DeleteIdentityPoolInput + Copy func(*DeleteIdentityPoolInput) DeleteIdentityPoolRequest } // Send marshals and sends the DeleteIdentityPool API request. @@ -178,7 +181,7 @@ func (c *CognitoIdentity) DeleteIdentityPoolRequest(input *DeleteIdentityPoolInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteIdentityPoolRequest{Request: req, Input: input} + return DeleteIdentityPoolRequest{Request: req, Input: input, Copy: c.DeleteIdentityPoolRequest} } const opDescribeIdentity = "DescribeIdentity" @@ -187,6 +190,7 @@ const opDescribeIdentity = "DescribeIdentity" type DescribeIdentityRequest struct { *aws.Request Input *DescribeIdentityInput + Copy func(*DescribeIdentityInput) DescribeIdentityRequest } // Send marshals and sends the DescribeIdentity API request. @@ -230,7 +234,7 @@ func (c *CognitoIdentity) DescribeIdentityRequest(input *DescribeIdentityInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIdentityRequest{Request: req, Input: input} + return DescribeIdentityRequest{Request: req, Input: input, Copy: c.DescribeIdentityRequest} } const opDescribeIdentityPool = "DescribeIdentityPool" @@ -239,6 +243,7 @@ const opDescribeIdentityPool = "DescribeIdentityPool" type DescribeIdentityPoolRequest struct { *aws.Request Input *DescribeIdentityPoolInput + Copy func(*DescribeIdentityPoolInput) DescribeIdentityPoolRequest } // Send marshals and sends the DescribeIdentityPool API request. @@ -282,7 +287,7 @@ func (c *CognitoIdentity) DescribeIdentityPoolRequest(input *DescribeIdentityPoo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIdentityPoolRequest{Request: req, Input: input} + return DescribeIdentityPoolRequest{Request: req, Input: input, Copy: c.DescribeIdentityPoolRequest} } const opGetCredentialsForIdentity = "GetCredentialsForIdentity" @@ -291,6 +296,7 @@ const opGetCredentialsForIdentity = "GetCredentialsForIdentity" type GetCredentialsForIdentityRequest struct { *aws.Request Input *GetCredentialsForIdentityInput + Copy func(*GetCredentialsForIdentityInput) GetCredentialsForIdentityRequest } // Send marshals and sends the GetCredentialsForIdentity API request. @@ -336,7 +342,7 @@ func (c *CognitoIdentity) GetCredentialsForIdentityRequest(input *GetCredentials req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCredentialsForIdentityRequest{Request: req, Input: input} + return GetCredentialsForIdentityRequest{Request: req, Input: input, Copy: c.GetCredentialsForIdentityRequest} } const opGetId = "GetId" @@ -345,6 +351,7 @@ const opGetId = "GetId" type GetIdRequest struct { *aws.Request Input *GetIdInput + Copy func(*GetIdInput) GetIdRequest } // Send marshals and sends the GetId API request. @@ -388,7 +395,7 @@ func (c *CognitoIdentity) GetIdRequest(input *GetIdInput) GetIdRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIdRequest{Request: req, Input: input} + return GetIdRequest{Request: req, Input: input, Copy: c.GetIdRequest} } const opGetIdentityPoolRoles = "GetIdentityPoolRoles" @@ -397,6 +404,7 @@ const opGetIdentityPoolRoles = "GetIdentityPoolRoles" type GetIdentityPoolRolesRequest struct { *aws.Request Input *GetIdentityPoolRolesInput + Copy func(*GetIdentityPoolRolesInput) GetIdentityPoolRolesRequest } // Send marshals and sends the GetIdentityPoolRoles API request. @@ -439,7 +447,7 @@ func (c *CognitoIdentity) GetIdentityPoolRolesRequest(input *GetIdentityPoolRole req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIdentityPoolRolesRequest{Request: req, Input: input} + return GetIdentityPoolRolesRequest{Request: req, Input: input, Copy: c.GetIdentityPoolRolesRequest} } const opGetOpenIdToken = "GetOpenIdToken" @@ -448,6 +456,7 @@ const opGetOpenIdToken = "GetOpenIdToken" type GetOpenIdTokenRequest struct { *aws.Request Input *GetOpenIdTokenInput + Copy func(*GetOpenIdTokenInput) GetOpenIdTokenRequest } // Send marshals and sends the GetOpenIdToken API request. @@ -494,7 +503,7 @@ func (c *CognitoIdentity) GetOpenIdTokenRequest(input *GetOpenIdTokenInput) GetO req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOpenIdTokenRequest{Request: req, Input: input} + return GetOpenIdTokenRequest{Request: req, Input: input, Copy: c.GetOpenIdTokenRequest} } const opGetOpenIdTokenForDeveloperIdentity = "GetOpenIdTokenForDeveloperIdentity" @@ -503,6 +512,7 @@ const opGetOpenIdTokenForDeveloperIdentity = "GetOpenIdTokenForDeveloperIdentity type GetOpenIdTokenForDeveloperIdentityRequest struct { *aws.Request Input *GetOpenIdTokenForDeveloperIdentityInput + Copy func(*GetOpenIdTokenForDeveloperIdentityInput) GetOpenIdTokenForDeveloperIdentityRequest } // Send marshals and sends the GetOpenIdTokenForDeveloperIdentity API request. @@ -558,7 +568,7 @@ func (c *CognitoIdentity) GetOpenIdTokenForDeveloperIdentityRequest(input *GetOp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOpenIdTokenForDeveloperIdentityRequest{Request: req, Input: input} + return GetOpenIdTokenForDeveloperIdentityRequest{Request: req, Input: input, Copy: c.GetOpenIdTokenForDeveloperIdentityRequest} } const opListIdentities = "ListIdentities" @@ -567,6 +577,7 @@ const opListIdentities = "ListIdentities" type ListIdentitiesRequest struct { *aws.Request Input *ListIdentitiesInput + Copy func(*ListIdentitiesInput) ListIdentitiesRequest } // Send marshals and sends the ListIdentities API request. @@ -609,7 +620,7 @@ func (c *CognitoIdentity) ListIdentitiesRequest(input *ListIdentitiesInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIdentitiesRequest{Request: req, Input: input} + return ListIdentitiesRequest{Request: req, Input: input, Copy: c.ListIdentitiesRequest} } const opListIdentityPools = "ListIdentityPools" @@ -618,6 +629,7 @@ const opListIdentityPools = "ListIdentityPools" type ListIdentityPoolsRequest struct { *aws.Request Input *ListIdentityPoolsInput + Copy func(*ListIdentityPoolsInput) ListIdentityPoolsRequest } // Send marshals and sends the ListIdentityPools API request. @@ -660,7 +672,7 @@ func (c *CognitoIdentity) ListIdentityPoolsRequest(input *ListIdentityPoolsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIdentityPoolsRequest{Request: req, Input: input} + return ListIdentityPoolsRequest{Request: req, Input: input, Copy: c.ListIdentityPoolsRequest} } const opLookupDeveloperIdentity = "LookupDeveloperIdentity" @@ -669,6 +681,7 @@ const opLookupDeveloperIdentity = "LookupDeveloperIdentity" type LookupDeveloperIdentityRequest struct { *aws.Request Input *LookupDeveloperIdentityInput + Copy func(*LookupDeveloperIdentityInput) LookupDeveloperIdentityRequest } // Send marshals and sends the LookupDeveloperIdentity API request. @@ -718,7 +731,7 @@ func (c *CognitoIdentity) LookupDeveloperIdentityRequest(input *LookupDeveloperI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return LookupDeveloperIdentityRequest{Request: req, Input: input} + return LookupDeveloperIdentityRequest{Request: req, Input: input, Copy: c.LookupDeveloperIdentityRequest} } const opMergeDeveloperIdentities = "MergeDeveloperIdentities" @@ -727,6 +740,7 @@ const opMergeDeveloperIdentities = "MergeDeveloperIdentities" type MergeDeveloperIdentitiesRequest struct { *aws.Request Input *MergeDeveloperIdentitiesInput + Copy func(*MergeDeveloperIdentitiesInput) MergeDeveloperIdentitiesRequest } // Send marshals and sends the MergeDeveloperIdentities API request. @@ -775,7 +789,7 @@ func (c *CognitoIdentity) MergeDeveloperIdentitiesRequest(input *MergeDeveloperI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return MergeDeveloperIdentitiesRequest{Request: req, Input: input} + return MergeDeveloperIdentitiesRequest{Request: req, Input: input, Copy: c.MergeDeveloperIdentitiesRequest} } const opSetIdentityPoolRoles = "SetIdentityPoolRoles" @@ -784,6 +798,7 @@ const opSetIdentityPoolRoles = "SetIdentityPoolRoles" type SetIdentityPoolRolesRequest struct { *aws.Request Input *SetIdentityPoolRolesInput + Copy func(*SetIdentityPoolRolesInput) SetIdentityPoolRolesRequest } // Send marshals and sends the SetIdentityPoolRoles API request. @@ -829,7 +844,7 @@ func (c *CognitoIdentity) SetIdentityPoolRolesRequest(input *SetIdentityPoolRole req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetIdentityPoolRolesRequest{Request: req, Input: input} + return SetIdentityPoolRolesRequest{Request: req, Input: input, Copy: c.SetIdentityPoolRolesRequest} } const opUnlinkDeveloperIdentity = "UnlinkDeveloperIdentity" @@ -838,6 +853,7 @@ const opUnlinkDeveloperIdentity = "UnlinkDeveloperIdentity" type UnlinkDeveloperIdentityRequest struct { *aws.Request Input *UnlinkDeveloperIdentityInput + Copy func(*UnlinkDeveloperIdentityInput) UnlinkDeveloperIdentityRequest } // Send marshals and sends the UnlinkDeveloperIdentity API request. @@ -885,7 +901,7 @@ func (c *CognitoIdentity) UnlinkDeveloperIdentityRequest(input *UnlinkDeveloperI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UnlinkDeveloperIdentityRequest{Request: req, Input: input} + return UnlinkDeveloperIdentityRequest{Request: req, Input: input, Copy: c.UnlinkDeveloperIdentityRequest} } const opUnlinkIdentity = "UnlinkIdentity" @@ -894,6 +910,7 @@ const opUnlinkIdentity = "UnlinkIdentity" type UnlinkIdentityRequest struct { *aws.Request Input *UnlinkIdentityInput + Copy func(*UnlinkIdentityInput) UnlinkIdentityRequest } // Send marshals and sends the UnlinkIdentity API request. @@ -940,7 +957,7 @@ func (c *CognitoIdentity) UnlinkIdentityRequest(input *UnlinkIdentityInput) Unli req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UnlinkIdentityRequest{Request: req, Input: input} + return UnlinkIdentityRequest{Request: req, Input: input, Copy: c.UnlinkIdentityRequest} } const opUpdateIdentityPool = "UpdateIdentityPool" @@ -949,6 +966,7 @@ const opUpdateIdentityPool = "UpdateIdentityPool" type UpdateIdentityPoolRequest struct { *aws.Request Input *UpdateIdentityPoolOutput + Copy func(*UpdateIdentityPoolOutput) UpdateIdentityPoolRequest } // Send marshals and sends the UpdateIdentityPool API request. @@ -991,7 +1009,7 @@ func (c *CognitoIdentity) UpdateIdentityPoolRequest(input *UpdateIdentityPoolOut req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateIdentityPoolRequest{Request: req, Input: input} + return UpdateIdentityPoolRequest{Request: req, Input: input, Copy: c.UpdateIdentityPoolRequest} } // Input to the CreateIdentityPool action. diff --git a/service/cognitoidentityprovider/api.go b/service/cognitoidentityprovider/api.go index 5e326ddbeba..709436a5c62 100644 --- a/service/cognitoidentityprovider/api.go +++ b/service/cognitoidentityprovider/api.go @@ -18,6 +18,7 @@ const opAddCustomAttributes = "AddCustomAttributes" type AddCustomAttributesRequest struct { *aws.Request Input *AddCustomAttributesInput + Copy func(*AddCustomAttributesInput) AddCustomAttributesRequest } // Send marshals and sends the AddCustomAttributes API request. @@ -58,7 +59,7 @@ func (c *CognitoIdentityProvider) AddCustomAttributesRequest(input *AddCustomAtt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddCustomAttributesRequest{Request: req, Input: input} + return AddCustomAttributesRequest{Request: req, Input: input, Copy: c.AddCustomAttributesRequest} } const opAdminAddUserToGroup = "AdminAddUserToGroup" @@ -67,6 +68,7 @@ const opAdminAddUserToGroup = "AdminAddUserToGroup" type AdminAddUserToGroupRequest struct { *aws.Request Input *AdminAddUserToGroupInput + Copy func(*AdminAddUserToGroupInput) AdminAddUserToGroupRequest } // Send marshals and sends the AdminAddUserToGroup API request. @@ -111,7 +113,7 @@ func (c *CognitoIdentityProvider) AdminAddUserToGroupRequest(input *AdminAddUser req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AdminAddUserToGroupRequest{Request: req, Input: input} + return AdminAddUserToGroupRequest{Request: req, Input: input, Copy: c.AdminAddUserToGroupRequest} } const opAdminConfirmSignUp = "AdminConfirmSignUp" @@ -120,6 +122,7 @@ const opAdminConfirmSignUp = "AdminConfirmSignUp" type AdminConfirmSignUpRequest struct { *aws.Request Input *AdminConfirmSignUpInput + Copy func(*AdminConfirmSignUpInput) AdminConfirmSignUpRequest } // Send marshals and sends the AdminConfirmSignUp API request. @@ -163,7 +166,7 @@ func (c *CognitoIdentityProvider) AdminConfirmSignUpRequest(input *AdminConfirmS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminConfirmSignUpRequest{Request: req, Input: input} + return AdminConfirmSignUpRequest{Request: req, Input: input, Copy: c.AdminConfirmSignUpRequest} } const opAdminCreateUser = "AdminCreateUser" @@ -172,6 +175,7 @@ const opAdminCreateUser = "AdminCreateUser" type AdminCreateUserRequest struct { *aws.Request Input *AdminCreateUserInput + Copy func(*AdminCreateUserInput) AdminCreateUserRequest } // Send marshals and sends the AdminCreateUser API request. @@ -227,7 +231,7 @@ func (c *CognitoIdentityProvider) AdminCreateUserRequest(input *AdminCreateUserI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminCreateUserRequest{Request: req, Input: input} + return AdminCreateUserRequest{Request: req, Input: input, Copy: c.AdminCreateUserRequest} } const opAdminDeleteUser = "AdminDeleteUser" @@ -236,6 +240,7 @@ const opAdminDeleteUser = "AdminDeleteUser" type AdminDeleteUserRequest struct { *aws.Request Input *AdminDeleteUserInput + Copy func(*AdminDeleteUserInput) AdminDeleteUserRequest } // Send marshals and sends the AdminDeleteUser API request. @@ -280,7 +285,7 @@ func (c *CognitoIdentityProvider) AdminDeleteUserRequest(input *AdminDeleteUserI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AdminDeleteUserRequest{Request: req, Input: input} + return AdminDeleteUserRequest{Request: req, Input: input, Copy: c.AdminDeleteUserRequest} } const opAdminDeleteUserAttributes = "AdminDeleteUserAttributes" @@ -289,6 +294,7 @@ const opAdminDeleteUserAttributes = "AdminDeleteUserAttributes" type AdminDeleteUserAttributesRequest struct { *aws.Request Input *AdminDeleteUserAttributesInput + Copy func(*AdminDeleteUserAttributesInput) AdminDeleteUserAttributesRequest } // Send marshals and sends the AdminDeleteUserAttributes API request. @@ -332,7 +338,7 @@ func (c *CognitoIdentityProvider) AdminDeleteUserAttributesRequest(input *AdminD req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminDeleteUserAttributesRequest{Request: req, Input: input} + return AdminDeleteUserAttributesRequest{Request: req, Input: input, Copy: c.AdminDeleteUserAttributesRequest} } const opAdminDisableProviderForUser = "AdminDisableProviderForUser" @@ -341,6 +347,7 @@ const opAdminDisableProviderForUser = "AdminDisableProviderForUser" type AdminDisableProviderForUserRequest struct { *aws.Request Input *AdminDisableProviderForUserInput + Copy func(*AdminDisableProviderForUserInput) AdminDisableProviderForUserRequest } // Send marshals and sends the AdminDisableProviderForUser API request. @@ -409,7 +416,7 @@ func (c *CognitoIdentityProvider) AdminDisableProviderForUserRequest(input *Admi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminDisableProviderForUserRequest{Request: req, Input: input} + return AdminDisableProviderForUserRequest{Request: req, Input: input, Copy: c.AdminDisableProviderForUserRequest} } const opAdminDisableUser = "AdminDisableUser" @@ -418,6 +425,7 @@ const opAdminDisableUser = "AdminDisableUser" type AdminDisableUserRequest struct { *aws.Request Input *AdminDisableUserInput + Copy func(*AdminDisableUserInput) AdminDisableUserRequest } // Send marshals and sends the AdminDisableUser API request. @@ -460,7 +468,7 @@ func (c *CognitoIdentityProvider) AdminDisableUserRequest(input *AdminDisableUse req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminDisableUserRequest{Request: req, Input: input} + return AdminDisableUserRequest{Request: req, Input: input, Copy: c.AdminDisableUserRequest} } const opAdminEnableUser = "AdminEnableUser" @@ -469,6 +477,7 @@ const opAdminEnableUser = "AdminEnableUser" type AdminEnableUserRequest struct { *aws.Request Input *AdminEnableUserInput + Copy func(*AdminEnableUserInput) AdminEnableUserRequest } // Send marshals and sends the AdminEnableUser API request. @@ -511,7 +520,7 @@ func (c *CognitoIdentityProvider) AdminEnableUserRequest(input *AdminEnableUserI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminEnableUserRequest{Request: req, Input: input} + return AdminEnableUserRequest{Request: req, Input: input, Copy: c.AdminEnableUserRequest} } const opAdminForgetDevice = "AdminForgetDevice" @@ -520,6 +529,7 @@ const opAdminForgetDevice = "AdminForgetDevice" type AdminForgetDeviceRequest struct { *aws.Request Input *AdminForgetDeviceInput + Copy func(*AdminForgetDeviceInput) AdminForgetDeviceRequest } // Send marshals and sends the AdminForgetDevice API request. @@ -564,7 +574,7 @@ func (c *CognitoIdentityProvider) AdminForgetDeviceRequest(input *AdminForgetDev req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AdminForgetDeviceRequest{Request: req, Input: input} + return AdminForgetDeviceRequest{Request: req, Input: input, Copy: c.AdminForgetDeviceRequest} } const opAdminGetDevice = "AdminGetDevice" @@ -573,6 +583,7 @@ const opAdminGetDevice = "AdminGetDevice" type AdminGetDeviceRequest struct { *aws.Request Input *AdminGetDeviceInput + Copy func(*AdminGetDeviceInput) AdminGetDeviceRequest } // Send marshals and sends the AdminGetDevice API request. @@ -615,7 +626,7 @@ func (c *CognitoIdentityProvider) AdminGetDeviceRequest(input *AdminGetDeviceInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminGetDeviceRequest{Request: req, Input: input} + return AdminGetDeviceRequest{Request: req, Input: input, Copy: c.AdminGetDeviceRequest} } const opAdminGetUser = "AdminGetUser" @@ -624,6 +635,7 @@ const opAdminGetUser = "AdminGetUser" type AdminGetUserRequest struct { *aws.Request Input *AdminGetUserInput + Copy func(*AdminGetUserInput) AdminGetUserRequest } // Send marshals and sends the AdminGetUser API request. @@ -667,7 +679,7 @@ func (c *CognitoIdentityProvider) AdminGetUserRequest(input *AdminGetUserInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminGetUserRequest{Request: req, Input: input} + return AdminGetUserRequest{Request: req, Input: input, Copy: c.AdminGetUserRequest} } const opAdminInitiateAuth = "AdminInitiateAuth" @@ -676,6 +688,7 @@ const opAdminInitiateAuth = "AdminInitiateAuth" type AdminInitiateAuthRequest struct { *aws.Request Input *AdminInitiateAuthInput + Copy func(*AdminInitiateAuthInput) AdminInitiateAuthRequest } // Send marshals and sends the AdminInitiateAuth API request. @@ -718,7 +731,7 @@ func (c *CognitoIdentityProvider) AdminInitiateAuthRequest(input *AdminInitiateA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminInitiateAuthRequest{Request: req, Input: input} + return AdminInitiateAuthRequest{Request: req, Input: input, Copy: c.AdminInitiateAuthRequest} } const opAdminLinkProviderForUser = "AdminLinkProviderForUser" @@ -727,6 +740,7 @@ const opAdminLinkProviderForUser = "AdminLinkProviderForUser" type AdminLinkProviderForUserRequest struct { *aws.Request Input *AdminLinkProviderForUserInput + Copy func(*AdminLinkProviderForUserInput) AdminLinkProviderForUserRequest } // Send marshals and sends the AdminLinkProviderForUser API request. @@ -785,7 +799,7 @@ func (c *CognitoIdentityProvider) AdminLinkProviderForUserRequest(input *AdminLi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminLinkProviderForUserRequest{Request: req, Input: input} + return AdminLinkProviderForUserRequest{Request: req, Input: input, Copy: c.AdminLinkProviderForUserRequest} } const opAdminListDevices = "AdminListDevices" @@ -794,6 +808,7 @@ const opAdminListDevices = "AdminListDevices" type AdminListDevicesRequest struct { *aws.Request Input *AdminListDevicesInput + Copy func(*AdminListDevicesInput) AdminListDevicesRequest } // Send marshals and sends the AdminListDevices API request. @@ -836,7 +851,7 @@ func (c *CognitoIdentityProvider) AdminListDevicesRequest(input *AdminListDevice req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminListDevicesRequest{Request: req, Input: input} + return AdminListDevicesRequest{Request: req, Input: input, Copy: c.AdminListDevicesRequest} } const opAdminListGroupsForUser = "AdminListGroupsForUser" @@ -845,6 +860,7 @@ const opAdminListGroupsForUser = "AdminListGroupsForUser" type AdminListGroupsForUserRequest struct { *aws.Request Input *AdminListGroupsForUserInput + Copy func(*AdminListGroupsForUserInput) AdminListGroupsForUserRequest } // Send marshals and sends the AdminListGroupsForUser API request. @@ -887,7 +903,7 @@ func (c *CognitoIdentityProvider) AdminListGroupsForUserRequest(input *AdminList req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminListGroupsForUserRequest{Request: req, Input: input} + return AdminListGroupsForUserRequest{Request: req, Input: input, Copy: c.AdminListGroupsForUserRequest} } const opAdminListUserAuthEvents = "AdminListUserAuthEvents" @@ -896,6 +912,7 @@ const opAdminListUserAuthEvents = "AdminListUserAuthEvents" type AdminListUserAuthEventsRequest struct { *aws.Request Input *AdminListUserAuthEventsInput + Copy func(*AdminListUserAuthEventsInput) AdminListUserAuthEventsRequest } // Send marshals and sends the AdminListUserAuthEvents API request. @@ -937,7 +954,7 @@ func (c *CognitoIdentityProvider) AdminListUserAuthEventsRequest(input *AdminLis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminListUserAuthEventsRequest{Request: req, Input: input} + return AdminListUserAuthEventsRequest{Request: req, Input: input, Copy: c.AdminListUserAuthEventsRequest} } const opAdminRemoveUserFromGroup = "AdminRemoveUserFromGroup" @@ -946,6 +963,7 @@ const opAdminRemoveUserFromGroup = "AdminRemoveUserFromGroup" type AdminRemoveUserFromGroupRequest struct { *aws.Request Input *AdminRemoveUserFromGroupInput + Copy func(*AdminRemoveUserFromGroupInput) AdminRemoveUserFromGroupRequest } // Send marshals and sends the AdminRemoveUserFromGroup API request. @@ -990,7 +1008,7 @@ func (c *CognitoIdentityProvider) AdminRemoveUserFromGroupRequest(input *AdminRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AdminRemoveUserFromGroupRequest{Request: req, Input: input} + return AdminRemoveUserFromGroupRequest{Request: req, Input: input, Copy: c.AdminRemoveUserFromGroupRequest} } const opAdminResetUserPassword = "AdminResetUserPassword" @@ -999,6 +1017,7 @@ const opAdminResetUserPassword = "AdminResetUserPassword" type AdminResetUserPasswordRequest struct { *aws.Request Input *AdminResetUserPasswordInput + Copy func(*AdminResetUserPasswordInput) AdminResetUserPasswordRequest } // Send marshals and sends the AdminResetUserPassword API request. @@ -1052,7 +1071,7 @@ func (c *CognitoIdentityProvider) AdminResetUserPasswordRequest(input *AdminRese req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminResetUserPasswordRequest{Request: req, Input: input} + return AdminResetUserPasswordRequest{Request: req, Input: input, Copy: c.AdminResetUserPasswordRequest} } const opAdminRespondToAuthChallenge = "AdminRespondToAuthChallenge" @@ -1061,6 +1080,7 @@ const opAdminRespondToAuthChallenge = "AdminRespondToAuthChallenge" type AdminRespondToAuthChallengeRequest struct { *aws.Request Input *AdminRespondToAuthChallengeInput + Copy func(*AdminRespondToAuthChallengeInput) AdminRespondToAuthChallengeRequest } // Send marshals and sends the AdminRespondToAuthChallenge API request. @@ -1103,7 +1123,7 @@ func (c *CognitoIdentityProvider) AdminRespondToAuthChallengeRequest(input *Admi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminRespondToAuthChallengeRequest{Request: req, Input: input} + return AdminRespondToAuthChallengeRequest{Request: req, Input: input, Copy: c.AdminRespondToAuthChallengeRequest} } const opAdminSetUserMFAPreference = "AdminSetUserMFAPreference" @@ -1112,6 +1132,7 @@ const opAdminSetUserMFAPreference = "AdminSetUserMFAPreference" type AdminSetUserMFAPreferenceRequest struct { *aws.Request Input *AdminSetUserMFAPreferenceInput + Copy func(*AdminSetUserMFAPreferenceInput) AdminSetUserMFAPreferenceRequest } // Send marshals and sends the AdminSetUserMFAPreference API request. @@ -1152,7 +1173,7 @@ func (c *CognitoIdentityProvider) AdminSetUserMFAPreferenceRequest(input *AdminS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminSetUserMFAPreferenceRequest{Request: req, Input: input} + return AdminSetUserMFAPreferenceRequest{Request: req, Input: input, Copy: c.AdminSetUserMFAPreferenceRequest} } const opAdminSetUserSettings = "AdminSetUserSettings" @@ -1161,6 +1182,7 @@ const opAdminSetUserSettings = "AdminSetUserSettings" type AdminSetUserSettingsRequest struct { *aws.Request Input *AdminSetUserSettingsInput + Copy func(*AdminSetUserSettingsInput) AdminSetUserSettingsRequest } // Send marshals and sends the AdminSetUserSettings API request. @@ -1203,7 +1225,7 @@ func (c *CognitoIdentityProvider) AdminSetUserSettingsRequest(input *AdminSetUse req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminSetUserSettingsRequest{Request: req, Input: input} + return AdminSetUserSettingsRequest{Request: req, Input: input, Copy: c.AdminSetUserSettingsRequest} } const opAdminUpdateAuthEventFeedback = "AdminUpdateAuthEventFeedback" @@ -1212,6 +1234,7 @@ const opAdminUpdateAuthEventFeedback = "AdminUpdateAuthEventFeedback" type AdminUpdateAuthEventFeedbackRequest struct { *aws.Request Input *AdminUpdateAuthEventFeedbackInput + Copy func(*AdminUpdateAuthEventFeedbackInput) AdminUpdateAuthEventFeedbackRequest } // Send marshals and sends the AdminUpdateAuthEventFeedback API request. @@ -1254,7 +1277,7 @@ func (c *CognitoIdentityProvider) AdminUpdateAuthEventFeedbackRequest(input *Adm req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminUpdateAuthEventFeedbackRequest{Request: req, Input: input} + return AdminUpdateAuthEventFeedbackRequest{Request: req, Input: input, Copy: c.AdminUpdateAuthEventFeedbackRequest} } const opAdminUpdateDeviceStatus = "AdminUpdateDeviceStatus" @@ -1263,6 +1286,7 @@ const opAdminUpdateDeviceStatus = "AdminUpdateDeviceStatus" type AdminUpdateDeviceStatusRequest struct { *aws.Request Input *AdminUpdateDeviceStatusInput + Copy func(*AdminUpdateDeviceStatusInput) AdminUpdateDeviceStatusRequest } // Send marshals and sends the AdminUpdateDeviceStatus API request. @@ -1305,7 +1329,7 @@ func (c *CognitoIdentityProvider) AdminUpdateDeviceStatusRequest(input *AdminUpd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminUpdateDeviceStatusRequest{Request: req, Input: input} + return AdminUpdateDeviceStatusRequest{Request: req, Input: input, Copy: c.AdminUpdateDeviceStatusRequest} } const opAdminUpdateUserAttributes = "AdminUpdateUserAttributes" @@ -1314,6 +1338,7 @@ const opAdminUpdateUserAttributes = "AdminUpdateUserAttributes" type AdminUpdateUserAttributesRequest struct { *aws.Request Input *AdminUpdateUserAttributesInput + Copy func(*AdminUpdateUserAttributesInput) AdminUpdateUserAttributesRequest } // Send marshals and sends the AdminUpdateUserAttributes API request. @@ -1363,7 +1388,7 @@ func (c *CognitoIdentityProvider) AdminUpdateUserAttributesRequest(input *AdminU req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminUpdateUserAttributesRequest{Request: req, Input: input} + return AdminUpdateUserAttributesRequest{Request: req, Input: input, Copy: c.AdminUpdateUserAttributesRequest} } const opAdminUserGlobalSignOut = "AdminUserGlobalSignOut" @@ -1372,6 +1397,7 @@ const opAdminUserGlobalSignOut = "AdminUserGlobalSignOut" type AdminUserGlobalSignOutRequest struct { *aws.Request Input *AdminUserGlobalSignOutInput + Copy func(*AdminUserGlobalSignOutInput) AdminUserGlobalSignOutRequest } // Send marshals and sends the AdminUserGlobalSignOut API request. @@ -1414,7 +1440,7 @@ func (c *CognitoIdentityProvider) AdminUserGlobalSignOutRequest(input *AdminUser req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AdminUserGlobalSignOutRequest{Request: req, Input: input} + return AdminUserGlobalSignOutRequest{Request: req, Input: input, Copy: c.AdminUserGlobalSignOutRequest} } const opAssociateSoftwareToken = "AssociateSoftwareToken" @@ -1423,6 +1449,7 @@ const opAssociateSoftwareToken = "AssociateSoftwareToken" type AssociateSoftwareTokenRequest struct { *aws.Request Input *AssociateSoftwareTokenInput + Copy func(*AssociateSoftwareTokenInput) AssociateSoftwareTokenRequest } // Send marshals and sends the AssociateSoftwareToken API request. @@ -1464,7 +1491,7 @@ func (c *CognitoIdentityProvider) AssociateSoftwareTokenRequest(input *Associate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateSoftwareTokenRequest{Request: req, Input: input} + return AssociateSoftwareTokenRequest{Request: req, Input: input, Copy: c.AssociateSoftwareTokenRequest} } const opChangePassword = "ChangePassword" @@ -1473,6 +1500,7 @@ const opChangePassword = "ChangePassword" type ChangePasswordRequest struct { *aws.Request Input *ChangePasswordInput + Copy func(*ChangePasswordInput) ChangePasswordRequest } // Send marshals and sends the ChangePassword API request. @@ -1514,7 +1542,7 @@ func (c *CognitoIdentityProvider) ChangePasswordRequest(input *ChangePasswordInp output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return ChangePasswordRequest{Request: req, Input: input} + return ChangePasswordRequest{Request: req, Input: input, Copy: c.ChangePasswordRequest} } const opConfirmDevice = "ConfirmDevice" @@ -1523,6 +1551,7 @@ const opConfirmDevice = "ConfirmDevice" type ConfirmDeviceRequest struct { *aws.Request Input *ConfirmDeviceInput + Copy func(*ConfirmDeviceInput) ConfirmDeviceRequest } // Send marshals and sends the ConfirmDevice API request. @@ -1564,7 +1593,7 @@ func (c *CognitoIdentityProvider) ConfirmDeviceRequest(input *ConfirmDeviceInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ConfirmDeviceRequest{Request: req, Input: input} + return ConfirmDeviceRequest{Request: req, Input: input, Copy: c.ConfirmDeviceRequest} } const opConfirmForgotPassword = "ConfirmForgotPassword" @@ -1573,6 +1602,7 @@ const opConfirmForgotPassword = "ConfirmForgotPassword" type ConfirmForgotPasswordRequest struct { *aws.Request Input *ConfirmForgotPasswordInput + Copy func(*ConfirmForgotPasswordInput) ConfirmForgotPasswordRequest } // Send marshals and sends the ConfirmForgotPassword API request. @@ -1614,7 +1644,7 @@ func (c *CognitoIdentityProvider) ConfirmForgotPasswordRequest(input *ConfirmFor output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return ConfirmForgotPasswordRequest{Request: req, Input: input} + return ConfirmForgotPasswordRequest{Request: req, Input: input, Copy: c.ConfirmForgotPasswordRequest} } const opConfirmSignUp = "ConfirmSignUp" @@ -1623,6 +1653,7 @@ const opConfirmSignUp = "ConfirmSignUp" type ConfirmSignUpRequest struct { *aws.Request Input *ConfirmSignUpInput + Copy func(*ConfirmSignUpInput) ConfirmSignUpRequest } // Send marshals and sends the ConfirmSignUp API request. @@ -1665,7 +1696,7 @@ func (c *CognitoIdentityProvider) ConfirmSignUpRequest(input *ConfirmSignUpInput output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return ConfirmSignUpRequest{Request: req, Input: input} + return ConfirmSignUpRequest{Request: req, Input: input, Copy: c.ConfirmSignUpRequest} } const opCreateGroup = "CreateGroup" @@ -1674,6 +1705,7 @@ const opCreateGroup = "CreateGroup" type CreateGroupRequest struct { *aws.Request Input *CreateGroupInput + Copy func(*CreateGroupInput) CreateGroupRequest } // Send marshals and sends the CreateGroup API request. @@ -1716,7 +1748,7 @@ func (c *CognitoIdentityProvider) CreateGroupRequest(input *CreateGroupInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGroupRequest{Request: req, Input: input} + return CreateGroupRequest{Request: req, Input: input, Copy: c.CreateGroupRequest} } const opCreateIdentityProvider = "CreateIdentityProvider" @@ -1725,6 +1757,7 @@ const opCreateIdentityProvider = "CreateIdentityProvider" type CreateIdentityProviderRequest struct { *aws.Request Input *CreateIdentityProviderInput + Copy func(*CreateIdentityProviderInput) CreateIdentityProviderRequest } // Send marshals and sends the CreateIdentityProvider API request. @@ -1765,7 +1798,7 @@ func (c *CognitoIdentityProvider) CreateIdentityProviderRequest(input *CreateIde req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateIdentityProviderRequest{Request: req, Input: input} + return CreateIdentityProviderRequest{Request: req, Input: input, Copy: c.CreateIdentityProviderRequest} } const opCreateResourceServer = "CreateResourceServer" @@ -1774,6 +1807,7 @@ const opCreateResourceServer = "CreateResourceServer" type CreateResourceServerRequest struct { *aws.Request Input *CreateResourceServerInput + Copy func(*CreateResourceServerInput) CreateResourceServerRequest } // Send marshals and sends the CreateResourceServer API request. @@ -1814,7 +1848,7 @@ func (c *CognitoIdentityProvider) CreateResourceServerRequest(input *CreateResou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateResourceServerRequest{Request: req, Input: input} + return CreateResourceServerRequest{Request: req, Input: input, Copy: c.CreateResourceServerRequest} } const opCreateUserImportJob = "CreateUserImportJob" @@ -1823,6 +1857,7 @@ const opCreateUserImportJob = "CreateUserImportJob" type CreateUserImportJobRequest struct { *aws.Request Input *CreateUserImportJobInput + Copy func(*CreateUserImportJobInput) CreateUserImportJobRequest } // Send marshals and sends the CreateUserImportJob API request. @@ -1863,7 +1898,7 @@ func (c *CognitoIdentityProvider) CreateUserImportJobRequest(input *CreateUserIm req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserImportJobRequest{Request: req, Input: input} + return CreateUserImportJobRequest{Request: req, Input: input, Copy: c.CreateUserImportJobRequest} } const opCreateUserPool = "CreateUserPool" @@ -1872,6 +1907,7 @@ const opCreateUserPool = "CreateUserPool" type CreateUserPoolRequest struct { *aws.Request Input *CreateUserPoolInput + Copy func(*CreateUserPoolInput) CreateUserPoolRequest } // Send marshals and sends the CreateUserPool API request. @@ -1913,7 +1949,7 @@ func (c *CognitoIdentityProvider) CreateUserPoolRequest(input *CreateUserPoolInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserPoolRequest{Request: req, Input: input} + return CreateUserPoolRequest{Request: req, Input: input, Copy: c.CreateUserPoolRequest} } const opCreateUserPoolClient = "CreateUserPoolClient" @@ -1922,6 +1958,7 @@ const opCreateUserPoolClient = "CreateUserPoolClient" type CreateUserPoolClientRequest struct { *aws.Request Input *CreateUserPoolClientInput + Copy func(*CreateUserPoolClientInput) CreateUserPoolClientRequest } // Send marshals and sends the CreateUserPoolClient API request. @@ -1962,7 +1999,7 @@ func (c *CognitoIdentityProvider) CreateUserPoolClientRequest(input *CreateUserP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserPoolClientRequest{Request: req, Input: input} + return CreateUserPoolClientRequest{Request: req, Input: input, Copy: c.CreateUserPoolClientRequest} } const opCreateUserPoolDomain = "CreateUserPoolDomain" @@ -1971,6 +2008,7 @@ const opCreateUserPoolDomain = "CreateUserPoolDomain" type CreateUserPoolDomainRequest struct { *aws.Request Input *CreateUserPoolDomainInput + Copy func(*CreateUserPoolDomainInput) CreateUserPoolDomainRequest } // Send marshals and sends the CreateUserPoolDomain API request. @@ -2011,7 +2049,7 @@ func (c *CognitoIdentityProvider) CreateUserPoolDomainRequest(input *CreateUserP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserPoolDomainRequest{Request: req, Input: input} + return CreateUserPoolDomainRequest{Request: req, Input: input, Copy: c.CreateUserPoolDomainRequest} } const opDeleteGroup = "DeleteGroup" @@ -2020,6 +2058,7 @@ const opDeleteGroup = "DeleteGroup" type DeleteGroupRequest struct { *aws.Request Input *DeleteGroupInput + Copy func(*DeleteGroupInput) DeleteGroupRequest } // Send marshals and sends the DeleteGroup API request. @@ -2064,7 +2103,7 @@ func (c *CognitoIdentityProvider) DeleteGroupRequest(input *DeleteGroupInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteGroupRequest{Request: req, Input: input} + return DeleteGroupRequest{Request: req, Input: input, Copy: c.DeleteGroupRequest} } const opDeleteIdentityProvider = "DeleteIdentityProvider" @@ -2073,6 +2112,7 @@ const opDeleteIdentityProvider = "DeleteIdentityProvider" type DeleteIdentityProviderRequest struct { *aws.Request Input *DeleteIdentityProviderInput + Copy func(*DeleteIdentityProviderInput) DeleteIdentityProviderRequest } // Send marshals and sends the DeleteIdentityProvider API request. @@ -2115,7 +2155,7 @@ func (c *CognitoIdentityProvider) DeleteIdentityProviderRequest(input *DeleteIde req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteIdentityProviderRequest{Request: req, Input: input} + return DeleteIdentityProviderRequest{Request: req, Input: input, Copy: c.DeleteIdentityProviderRequest} } const opDeleteResourceServer = "DeleteResourceServer" @@ -2124,6 +2164,7 @@ const opDeleteResourceServer = "DeleteResourceServer" type DeleteResourceServerRequest struct { *aws.Request Input *DeleteResourceServerInput + Copy func(*DeleteResourceServerInput) DeleteResourceServerRequest } // Send marshals and sends the DeleteResourceServer API request. @@ -2166,7 +2207,7 @@ func (c *CognitoIdentityProvider) DeleteResourceServerRequest(input *DeleteResou req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteResourceServerRequest{Request: req, Input: input} + return DeleteResourceServerRequest{Request: req, Input: input, Copy: c.DeleteResourceServerRequest} } const opDeleteUser = "DeleteUser" @@ -2175,6 +2216,7 @@ const opDeleteUser = "DeleteUser" type DeleteUserRequest struct { *aws.Request Input *DeleteUserInput + Copy func(*DeleteUserInput) DeleteUserRequest } // Send marshals and sends the DeleteUser API request. @@ -2218,7 +2260,7 @@ func (c *CognitoIdentityProvider) DeleteUserRequest(input *DeleteUserInput) Dele output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return DeleteUserRequest{Request: req, Input: input} + return DeleteUserRequest{Request: req, Input: input, Copy: c.DeleteUserRequest} } const opDeleteUserAttributes = "DeleteUserAttributes" @@ -2227,6 +2269,7 @@ const opDeleteUserAttributes = "DeleteUserAttributes" type DeleteUserAttributesRequest struct { *aws.Request Input *DeleteUserAttributesInput + Copy func(*DeleteUserAttributesInput) DeleteUserAttributesRequest } // Send marshals and sends the DeleteUserAttributes API request. @@ -2268,7 +2311,7 @@ func (c *CognitoIdentityProvider) DeleteUserAttributesRequest(input *DeleteUserA output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return DeleteUserAttributesRequest{Request: req, Input: input} + return DeleteUserAttributesRequest{Request: req, Input: input, Copy: c.DeleteUserAttributesRequest} } const opDeleteUserPool = "DeleteUserPool" @@ -2277,6 +2320,7 @@ const opDeleteUserPool = "DeleteUserPool" type DeleteUserPoolRequest struct { *aws.Request Input *DeleteUserPoolInput + Copy func(*DeleteUserPoolInput) DeleteUserPoolRequest } // Send marshals and sends the DeleteUserPool API request. @@ -2319,7 +2363,7 @@ func (c *CognitoIdentityProvider) DeleteUserPoolRequest(input *DeleteUserPoolInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteUserPoolRequest{Request: req, Input: input} + return DeleteUserPoolRequest{Request: req, Input: input, Copy: c.DeleteUserPoolRequest} } const opDeleteUserPoolClient = "DeleteUserPoolClient" @@ -2328,6 +2372,7 @@ const opDeleteUserPoolClient = "DeleteUserPoolClient" type DeleteUserPoolClientRequest struct { *aws.Request Input *DeleteUserPoolClientInput + Copy func(*DeleteUserPoolClientInput) DeleteUserPoolClientRequest } // Send marshals and sends the DeleteUserPoolClient API request. @@ -2370,7 +2415,7 @@ func (c *CognitoIdentityProvider) DeleteUserPoolClientRequest(input *DeleteUserP req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteUserPoolClientRequest{Request: req, Input: input} + return DeleteUserPoolClientRequest{Request: req, Input: input, Copy: c.DeleteUserPoolClientRequest} } const opDeleteUserPoolDomain = "DeleteUserPoolDomain" @@ -2379,6 +2424,7 @@ const opDeleteUserPoolDomain = "DeleteUserPoolDomain" type DeleteUserPoolDomainRequest struct { *aws.Request Input *DeleteUserPoolDomainInput + Copy func(*DeleteUserPoolDomainInput) DeleteUserPoolDomainRequest } // Send marshals and sends the DeleteUserPoolDomain API request. @@ -2419,7 +2465,7 @@ func (c *CognitoIdentityProvider) DeleteUserPoolDomainRequest(input *DeleteUserP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteUserPoolDomainRequest{Request: req, Input: input} + return DeleteUserPoolDomainRequest{Request: req, Input: input, Copy: c.DeleteUserPoolDomainRequest} } const opDescribeIdentityProvider = "DescribeIdentityProvider" @@ -2428,6 +2474,7 @@ const opDescribeIdentityProvider = "DescribeIdentityProvider" type DescribeIdentityProviderRequest struct { *aws.Request Input *DescribeIdentityProviderInput + Copy func(*DescribeIdentityProviderInput) DescribeIdentityProviderRequest } // Send marshals and sends the DescribeIdentityProvider API request. @@ -2468,7 +2515,7 @@ func (c *CognitoIdentityProvider) DescribeIdentityProviderRequest(input *Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIdentityProviderRequest{Request: req, Input: input} + return DescribeIdentityProviderRequest{Request: req, Input: input, Copy: c.DescribeIdentityProviderRequest} } const opDescribeResourceServer = "DescribeResourceServer" @@ -2477,6 +2524,7 @@ const opDescribeResourceServer = "DescribeResourceServer" type DescribeResourceServerRequest struct { *aws.Request Input *DescribeResourceServerInput + Copy func(*DescribeResourceServerInput) DescribeResourceServerRequest } // Send marshals and sends the DescribeResourceServer API request. @@ -2517,7 +2565,7 @@ func (c *CognitoIdentityProvider) DescribeResourceServerRequest(input *DescribeR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeResourceServerRequest{Request: req, Input: input} + return DescribeResourceServerRequest{Request: req, Input: input, Copy: c.DescribeResourceServerRequest} } const opDescribeRiskConfiguration = "DescribeRiskConfiguration" @@ -2526,6 +2574,7 @@ const opDescribeRiskConfiguration = "DescribeRiskConfiguration" type DescribeRiskConfigurationRequest struct { *aws.Request Input *DescribeRiskConfigurationInput + Copy func(*DescribeRiskConfigurationInput) DescribeRiskConfigurationRequest } // Send marshals and sends the DescribeRiskConfiguration API request. @@ -2566,7 +2615,7 @@ func (c *CognitoIdentityProvider) DescribeRiskConfigurationRequest(input *Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRiskConfigurationRequest{Request: req, Input: input} + return DescribeRiskConfigurationRequest{Request: req, Input: input, Copy: c.DescribeRiskConfigurationRequest} } const opDescribeUserImportJob = "DescribeUserImportJob" @@ -2575,6 +2624,7 @@ const opDescribeUserImportJob = "DescribeUserImportJob" type DescribeUserImportJobRequest struct { *aws.Request Input *DescribeUserImportJobInput + Copy func(*DescribeUserImportJobInput) DescribeUserImportJobRequest } // Send marshals and sends the DescribeUserImportJob API request. @@ -2615,7 +2665,7 @@ func (c *CognitoIdentityProvider) DescribeUserImportJobRequest(input *DescribeUs req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUserImportJobRequest{Request: req, Input: input} + return DescribeUserImportJobRequest{Request: req, Input: input, Copy: c.DescribeUserImportJobRequest} } const opDescribeUserPool = "DescribeUserPool" @@ -2624,6 +2674,7 @@ const opDescribeUserPool = "DescribeUserPool" type DescribeUserPoolRequest struct { *aws.Request Input *DescribeUserPoolInput + Copy func(*DescribeUserPoolInput) DescribeUserPoolRequest } // Send marshals and sends the DescribeUserPool API request. @@ -2665,7 +2716,7 @@ func (c *CognitoIdentityProvider) DescribeUserPoolRequest(input *DescribeUserPoo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUserPoolRequest{Request: req, Input: input} + return DescribeUserPoolRequest{Request: req, Input: input, Copy: c.DescribeUserPoolRequest} } const opDescribeUserPoolClient = "DescribeUserPoolClient" @@ -2674,6 +2725,7 @@ const opDescribeUserPoolClient = "DescribeUserPoolClient" type DescribeUserPoolClientRequest struct { *aws.Request Input *DescribeUserPoolClientInput + Copy func(*DescribeUserPoolClientInput) DescribeUserPoolClientRequest } // Send marshals and sends the DescribeUserPoolClient API request. @@ -2715,7 +2767,7 @@ func (c *CognitoIdentityProvider) DescribeUserPoolClientRequest(input *DescribeU req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUserPoolClientRequest{Request: req, Input: input} + return DescribeUserPoolClientRequest{Request: req, Input: input, Copy: c.DescribeUserPoolClientRequest} } const opDescribeUserPoolDomain = "DescribeUserPoolDomain" @@ -2724,6 +2776,7 @@ const opDescribeUserPoolDomain = "DescribeUserPoolDomain" type DescribeUserPoolDomainRequest struct { *aws.Request Input *DescribeUserPoolDomainInput + Copy func(*DescribeUserPoolDomainInput) DescribeUserPoolDomainRequest } // Send marshals and sends the DescribeUserPoolDomain API request. @@ -2764,7 +2817,7 @@ func (c *CognitoIdentityProvider) DescribeUserPoolDomainRequest(input *DescribeU req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUserPoolDomainRequest{Request: req, Input: input} + return DescribeUserPoolDomainRequest{Request: req, Input: input, Copy: c.DescribeUserPoolDomainRequest} } const opForgetDevice = "ForgetDevice" @@ -2773,6 +2826,7 @@ const opForgetDevice = "ForgetDevice" type ForgetDeviceRequest struct { *aws.Request Input *ForgetDeviceInput + Copy func(*ForgetDeviceInput) ForgetDeviceRequest } // Send marshals and sends the ForgetDevice API request. @@ -2815,7 +2869,7 @@ func (c *CognitoIdentityProvider) ForgetDeviceRequest(input *ForgetDeviceInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ForgetDeviceRequest{Request: req, Input: input} + return ForgetDeviceRequest{Request: req, Input: input, Copy: c.ForgetDeviceRequest} } const opForgotPassword = "ForgotPassword" @@ -2824,6 +2878,7 @@ const opForgotPassword = "ForgotPassword" type ForgotPasswordRequest struct { *aws.Request Input *ForgotPasswordInput + Copy func(*ForgotPasswordInput) ForgotPasswordRequest } // Send marshals and sends the ForgotPassword API request. @@ -2872,7 +2927,7 @@ func (c *CognitoIdentityProvider) ForgotPasswordRequest(input *ForgotPasswordInp output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return ForgotPasswordRequest{Request: req, Input: input} + return ForgotPasswordRequest{Request: req, Input: input, Copy: c.ForgotPasswordRequest} } const opGetCSVHeader = "GetCSVHeader" @@ -2881,6 +2936,7 @@ const opGetCSVHeader = "GetCSVHeader" type GetCSVHeaderRequest struct { *aws.Request Input *GetCSVHeaderInput + Copy func(*GetCSVHeaderInput) GetCSVHeaderRequest } // Send marshals and sends the GetCSVHeader API request. @@ -2922,7 +2978,7 @@ func (c *CognitoIdentityProvider) GetCSVHeaderRequest(input *GetCSVHeaderInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCSVHeaderRequest{Request: req, Input: input} + return GetCSVHeaderRequest{Request: req, Input: input, Copy: c.GetCSVHeaderRequest} } const opGetDevice = "GetDevice" @@ -2931,6 +2987,7 @@ const opGetDevice = "GetDevice" type GetDeviceRequest struct { *aws.Request Input *GetDeviceInput + Copy func(*GetDeviceInput) GetDeviceRequest } // Send marshals and sends the GetDevice API request. @@ -2971,7 +3028,7 @@ func (c *CognitoIdentityProvider) GetDeviceRequest(input *GetDeviceInput) GetDev req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeviceRequest{Request: req, Input: input} + return GetDeviceRequest{Request: req, Input: input, Copy: c.GetDeviceRequest} } const opGetGroup = "GetGroup" @@ -2980,6 +3037,7 @@ const opGetGroup = "GetGroup" type GetGroupRequest struct { *aws.Request Input *GetGroupInput + Copy func(*GetGroupInput) GetGroupRequest } // Send marshals and sends the GetGroup API request. @@ -3022,7 +3080,7 @@ func (c *CognitoIdentityProvider) GetGroupRequest(input *GetGroupInput) GetGroup req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGroupRequest{Request: req, Input: input} + return GetGroupRequest{Request: req, Input: input, Copy: c.GetGroupRequest} } const opGetIdentityProviderByIdentifier = "GetIdentityProviderByIdentifier" @@ -3031,6 +3089,7 @@ const opGetIdentityProviderByIdentifier = "GetIdentityProviderByIdentifier" type GetIdentityProviderByIdentifierRequest struct { *aws.Request Input *GetIdentityProviderByIdentifierInput + Copy func(*GetIdentityProviderByIdentifierInput) GetIdentityProviderByIdentifierRequest } // Send marshals and sends the GetIdentityProviderByIdentifier API request. @@ -3071,7 +3130,7 @@ func (c *CognitoIdentityProvider) GetIdentityProviderByIdentifierRequest(input * req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIdentityProviderByIdentifierRequest{Request: req, Input: input} + return GetIdentityProviderByIdentifierRequest{Request: req, Input: input, Copy: c.GetIdentityProviderByIdentifierRequest} } const opGetUICustomization = "GetUICustomization" @@ -3080,6 +3139,7 @@ const opGetUICustomization = "GetUICustomization" type GetUICustomizationRequest struct { *aws.Request Input *GetUICustomizationInput + Copy func(*GetUICustomizationInput) GetUICustomizationRequest } // Send marshals and sends the GetUICustomization API request. @@ -3123,7 +3183,7 @@ func (c *CognitoIdentityProvider) GetUICustomizationRequest(input *GetUICustomiz req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUICustomizationRequest{Request: req, Input: input} + return GetUICustomizationRequest{Request: req, Input: input, Copy: c.GetUICustomizationRequest} } const opGetUser = "GetUser" @@ -3132,6 +3192,7 @@ const opGetUser = "GetUser" type GetUserRequest struct { *aws.Request Input *GetUserInput + Copy func(*GetUserInput) GetUserRequest } // Send marshals and sends the GetUser API request. @@ -3173,7 +3234,7 @@ func (c *CognitoIdentityProvider) GetUserRequest(input *GetUserInput) GetUserReq output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return GetUserRequest{Request: req, Input: input} + return GetUserRequest{Request: req, Input: input, Copy: c.GetUserRequest} } const opGetUserAttributeVerificationCode = "GetUserAttributeVerificationCode" @@ -3182,6 +3243,7 @@ const opGetUserAttributeVerificationCode = "GetUserAttributeVerificationCode" type GetUserAttributeVerificationCodeRequest struct { *aws.Request Input *GetUserAttributeVerificationCodeInput + Copy func(*GetUserAttributeVerificationCodeInput) GetUserAttributeVerificationCodeRequest } // Send marshals and sends the GetUserAttributeVerificationCode API request. @@ -3223,7 +3285,7 @@ func (c *CognitoIdentityProvider) GetUserAttributeVerificationCodeRequest(input output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return GetUserAttributeVerificationCodeRequest{Request: req, Input: input} + return GetUserAttributeVerificationCodeRequest{Request: req, Input: input, Copy: c.GetUserAttributeVerificationCodeRequest} } const opGetUserPoolMfaConfig = "GetUserPoolMfaConfig" @@ -3232,6 +3294,7 @@ const opGetUserPoolMfaConfig = "GetUserPoolMfaConfig" type GetUserPoolMfaConfigRequest struct { *aws.Request Input *GetUserPoolMfaConfigInput + Copy func(*GetUserPoolMfaConfigInput) GetUserPoolMfaConfigRequest } // Send marshals and sends the GetUserPoolMfaConfig API request. @@ -3272,7 +3335,7 @@ func (c *CognitoIdentityProvider) GetUserPoolMfaConfigRequest(input *GetUserPool req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUserPoolMfaConfigRequest{Request: req, Input: input} + return GetUserPoolMfaConfigRequest{Request: req, Input: input, Copy: c.GetUserPoolMfaConfigRequest} } const opGlobalSignOut = "GlobalSignOut" @@ -3281,6 +3344,7 @@ const opGlobalSignOut = "GlobalSignOut" type GlobalSignOutRequest struct { *aws.Request Input *GlobalSignOutInput + Copy func(*GlobalSignOutInput) GlobalSignOutRequest } // Send marshals and sends the GlobalSignOut API request. @@ -3321,7 +3385,7 @@ func (c *CognitoIdentityProvider) GlobalSignOutRequest(input *GlobalSignOutInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GlobalSignOutRequest{Request: req, Input: input} + return GlobalSignOutRequest{Request: req, Input: input, Copy: c.GlobalSignOutRequest} } const opInitiateAuth = "InitiateAuth" @@ -3330,6 +3394,7 @@ const opInitiateAuth = "InitiateAuth" type InitiateAuthRequest struct { *aws.Request Input *InitiateAuthInput + Copy func(*InitiateAuthInput) InitiateAuthRequest } // Send marshals and sends the InitiateAuth API request. @@ -3370,7 +3435,7 @@ func (c *CognitoIdentityProvider) InitiateAuthRequest(input *InitiateAuthInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InitiateAuthRequest{Request: req, Input: input} + return InitiateAuthRequest{Request: req, Input: input, Copy: c.InitiateAuthRequest} } const opListDevices = "ListDevices" @@ -3379,6 +3444,7 @@ const opListDevices = "ListDevices" type ListDevicesRequest struct { *aws.Request Input *ListDevicesInput + Copy func(*ListDevicesInput) ListDevicesRequest } // Send marshals and sends the ListDevices API request. @@ -3419,7 +3485,7 @@ func (c *CognitoIdentityProvider) ListDevicesRequest(input *ListDevicesInput) Li req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDevicesRequest{Request: req, Input: input} + return ListDevicesRequest{Request: req, Input: input, Copy: c.ListDevicesRequest} } const opListGroups = "ListGroups" @@ -3428,6 +3494,7 @@ const opListGroups = "ListGroups" type ListGroupsRequest struct { *aws.Request Input *ListGroupsInput + Copy func(*ListGroupsInput) ListGroupsRequest } // Send marshals and sends the ListGroups API request. @@ -3470,7 +3537,7 @@ func (c *CognitoIdentityProvider) ListGroupsRequest(input *ListGroupsInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupsRequest{Request: req, Input: input} + return ListGroupsRequest{Request: req, Input: input, Copy: c.ListGroupsRequest} } const opListIdentityProviders = "ListIdentityProviders" @@ -3479,6 +3546,7 @@ const opListIdentityProviders = "ListIdentityProviders" type ListIdentityProvidersRequest struct { *aws.Request Input *ListIdentityProvidersInput + Copy func(*ListIdentityProvidersInput) ListIdentityProvidersRequest } // Send marshals and sends the ListIdentityProviders API request. @@ -3519,7 +3587,7 @@ func (c *CognitoIdentityProvider) ListIdentityProvidersRequest(input *ListIdenti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIdentityProvidersRequest{Request: req, Input: input} + return ListIdentityProvidersRequest{Request: req, Input: input, Copy: c.ListIdentityProvidersRequest} } const opListResourceServers = "ListResourceServers" @@ -3528,6 +3596,7 @@ const opListResourceServers = "ListResourceServers" type ListResourceServersRequest struct { *aws.Request Input *ListResourceServersInput + Copy func(*ListResourceServersInput) ListResourceServersRequest } // Send marshals and sends the ListResourceServers API request. @@ -3568,7 +3637,7 @@ func (c *CognitoIdentityProvider) ListResourceServersRequest(input *ListResource req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourceServersRequest{Request: req, Input: input} + return ListResourceServersRequest{Request: req, Input: input, Copy: c.ListResourceServersRequest} } const opListUserImportJobs = "ListUserImportJobs" @@ -3577,6 +3646,7 @@ const opListUserImportJobs = "ListUserImportJobs" type ListUserImportJobsRequest struct { *aws.Request Input *ListUserImportJobsInput + Copy func(*ListUserImportJobsInput) ListUserImportJobsRequest } // Send marshals and sends the ListUserImportJobs API request. @@ -3617,7 +3687,7 @@ func (c *CognitoIdentityProvider) ListUserImportJobsRequest(input *ListUserImpor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUserImportJobsRequest{Request: req, Input: input} + return ListUserImportJobsRequest{Request: req, Input: input, Copy: c.ListUserImportJobsRequest} } const opListUserPoolClients = "ListUserPoolClients" @@ -3626,6 +3696,7 @@ const opListUserPoolClients = "ListUserPoolClients" type ListUserPoolClientsRequest struct { *aws.Request Input *ListUserPoolClientsInput + Copy func(*ListUserPoolClientsInput) ListUserPoolClientsRequest } // Send marshals and sends the ListUserPoolClients API request. @@ -3666,7 +3737,7 @@ func (c *CognitoIdentityProvider) ListUserPoolClientsRequest(input *ListUserPool req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUserPoolClientsRequest{Request: req, Input: input} + return ListUserPoolClientsRequest{Request: req, Input: input, Copy: c.ListUserPoolClientsRequest} } const opListUserPools = "ListUserPools" @@ -3675,6 +3746,7 @@ const opListUserPools = "ListUserPools" type ListUserPoolsRequest struct { *aws.Request Input *ListUserPoolsInput + Copy func(*ListUserPoolsInput) ListUserPoolsRequest } // Send marshals and sends the ListUserPools API request. @@ -3715,7 +3787,7 @@ func (c *CognitoIdentityProvider) ListUserPoolsRequest(input *ListUserPoolsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUserPoolsRequest{Request: req, Input: input} + return ListUserPoolsRequest{Request: req, Input: input, Copy: c.ListUserPoolsRequest} } const opListUsers = "ListUsers" @@ -3724,6 +3796,7 @@ const opListUsers = "ListUsers" type ListUsersRequest struct { *aws.Request Input *ListUsersInput + Copy func(*ListUsersInput) ListUsersRequest } // Send marshals and sends the ListUsers API request. @@ -3764,7 +3837,7 @@ func (c *CognitoIdentityProvider) ListUsersRequest(input *ListUsersInput) ListUs req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUsersRequest{Request: req, Input: input} + return ListUsersRequest{Request: req, Input: input, Copy: c.ListUsersRequest} } const opListUsersInGroup = "ListUsersInGroup" @@ -3773,6 +3846,7 @@ const opListUsersInGroup = "ListUsersInGroup" type ListUsersInGroupRequest struct { *aws.Request Input *ListUsersInGroupInput + Copy func(*ListUsersInGroupInput) ListUsersInGroupRequest } // Send marshals and sends the ListUsersInGroup API request. @@ -3815,7 +3889,7 @@ func (c *CognitoIdentityProvider) ListUsersInGroupRequest(input *ListUsersInGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUsersInGroupRequest{Request: req, Input: input} + return ListUsersInGroupRequest{Request: req, Input: input, Copy: c.ListUsersInGroupRequest} } const opResendConfirmationCode = "ResendConfirmationCode" @@ -3824,6 +3898,7 @@ const opResendConfirmationCode = "ResendConfirmationCode" type ResendConfirmationCodeRequest struct { *aws.Request Input *ResendConfirmationCodeInput + Copy func(*ResendConfirmationCodeInput) ResendConfirmationCodeRequest } // Send marshals and sends the ResendConfirmationCode API request. @@ -3866,7 +3941,7 @@ func (c *CognitoIdentityProvider) ResendConfirmationCodeRequest(input *ResendCon output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return ResendConfirmationCodeRequest{Request: req, Input: input} + return ResendConfirmationCodeRequest{Request: req, Input: input, Copy: c.ResendConfirmationCodeRequest} } const opRespondToAuthChallenge = "RespondToAuthChallenge" @@ -3875,6 +3950,7 @@ const opRespondToAuthChallenge = "RespondToAuthChallenge" type RespondToAuthChallengeRequest struct { *aws.Request Input *RespondToAuthChallengeInput + Copy func(*RespondToAuthChallengeInput) RespondToAuthChallengeRequest } // Send marshals and sends the RespondToAuthChallenge API request. @@ -3915,7 +3991,7 @@ func (c *CognitoIdentityProvider) RespondToAuthChallengeRequest(input *RespondTo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RespondToAuthChallengeRequest{Request: req, Input: input} + return RespondToAuthChallengeRequest{Request: req, Input: input, Copy: c.RespondToAuthChallengeRequest} } const opSetRiskConfiguration = "SetRiskConfiguration" @@ -3924,6 +4000,7 @@ const opSetRiskConfiguration = "SetRiskConfiguration" type SetRiskConfigurationRequest struct { *aws.Request Input *SetRiskConfigurationInput + Copy func(*SetRiskConfigurationInput) SetRiskConfigurationRequest } // Send marshals and sends the SetRiskConfiguration API request. @@ -3970,7 +4047,7 @@ func (c *CognitoIdentityProvider) SetRiskConfigurationRequest(input *SetRiskConf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetRiskConfigurationRequest{Request: req, Input: input} + return SetRiskConfigurationRequest{Request: req, Input: input, Copy: c.SetRiskConfigurationRequest} } const opSetUICustomization = "SetUICustomization" @@ -3979,6 +4056,7 @@ const opSetUICustomization = "SetUICustomization" type SetUICustomizationRequest struct { *aws.Request Input *SetUICustomizationInput + Copy func(*SetUICustomizationInput) SetUICustomizationRequest } // Send marshals and sends the SetUICustomization API request. @@ -4030,7 +4108,7 @@ func (c *CognitoIdentityProvider) SetUICustomizationRequest(input *SetUICustomiz req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetUICustomizationRequest{Request: req, Input: input} + return SetUICustomizationRequest{Request: req, Input: input, Copy: c.SetUICustomizationRequest} } const opSetUserMFAPreference = "SetUserMFAPreference" @@ -4039,6 +4117,7 @@ const opSetUserMFAPreference = "SetUserMFAPreference" type SetUserMFAPreferenceRequest struct { *aws.Request Input *SetUserMFAPreferenceInput + Copy func(*SetUserMFAPreferenceInput) SetUserMFAPreferenceRequest } // Send marshals and sends the SetUserMFAPreference API request. @@ -4079,7 +4158,7 @@ func (c *CognitoIdentityProvider) SetUserMFAPreferenceRequest(input *SetUserMFAP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetUserMFAPreferenceRequest{Request: req, Input: input} + return SetUserMFAPreferenceRequest{Request: req, Input: input, Copy: c.SetUserMFAPreferenceRequest} } const opSetUserPoolMfaConfig = "SetUserPoolMfaConfig" @@ -4088,6 +4167,7 @@ const opSetUserPoolMfaConfig = "SetUserPoolMfaConfig" type SetUserPoolMfaConfigRequest struct { *aws.Request Input *SetUserPoolMfaConfigInput + Copy func(*SetUserPoolMfaConfigInput) SetUserPoolMfaConfigRequest } // Send marshals and sends the SetUserPoolMfaConfig API request. @@ -4128,7 +4208,7 @@ func (c *CognitoIdentityProvider) SetUserPoolMfaConfigRequest(input *SetUserPool req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetUserPoolMfaConfigRequest{Request: req, Input: input} + return SetUserPoolMfaConfigRequest{Request: req, Input: input, Copy: c.SetUserPoolMfaConfigRequest} } const opSetUserSettings = "SetUserSettings" @@ -4137,6 +4217,7 @@ const opSetUserSettings = "SetUserSettings" type SetUserSettingsRequest struct { *aws.Request Input *SetUserSettingsInput + Copy func(*SetUserSettingsInput) SetUserSettingsRequest } // Send marshals and sends the SetUserSettings API request. @@ -4180,7 +4261,7 @@ func (c *CognitoIdentityProvider) SetUserSettingsRequest(input *SetUserSettingsI output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return SetUserSettingsRequest{Request: req, Input: input} + return SetUserSettingsRequest{Request: req, Input: input, Copy: c.SetUserSettingsRequest} } const opSignUp = "SignUp" @@ -4189,6 +4270,7 @@ const opSignUp = "SignUp" type SignUpRequest struct { *aws.Request Input *SignUpInput + Copy func(*SignUpInput) SignUpRequest } // Send marshals and sends the SignUp API request. @@ -4231,7 +4313,7 @@ func (c *CognitoIdentityProvider) SignUpRequest(input *SignUpInput) SignUpReques output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return SignUpRequest{Request: req, Input: input} + return SignUpRequest{Request: req, Input: input, Copy: c.SignUpRequest} } const opStartUserImportJob = "StartUserImportJob" @@ -4240,6 +4322,7 @@ const opStartUserImportJob = "StartUserImportJob" type StartUserImportJobRequest struct { *aws.Request Input *StartUserImportJobInput + Copy func(*StartUserImportJobInput) StartUserImportJobRequest } // Send marshals and sends the StartUserImportJob API request. @@ -4280,7 +4363,7 @@ func (c *CognitoIdentityProvider) StartUserImportJobRequest(input *StartUserImpo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartUserImportJobRequest{Request: req, Input: input} + return StartUserImportJobRequest{Request: req, Input: input, Copy: c.StartUserImportJobRequest} } const opStopUserImportJob = "StopUserImportJob" @@ -4289,6 +4372,7 @@ const opStopUserImportJob = "StopUserImportJob" type StopUserImportJobRequest struct { *aws.Request Input *StopUserImportJobInput + Copy func(*StopUserImportJobInput) StopUserImportJobRequest } // Send marshals and sends the StopUserImportJob API request. @@ -4329,7 +4413,7 @@ func (c *CognitoIdentityProvider) StopUserImportJobRequest(input *StopUserImport req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopUserImportJobRequest{Request: req, Input: input} + return StopUserImportJobRequest{Request: req, Input: input, Copy: c.StopUserImportJobRequest} } const opUpdateAuthEventFeedback = "UpdateAuthEventFeedback" @@ -4338,6 +4422,7 @@ const opUpdateAuthEventFeedback = "UpdateAuthEventFeedback" type UpdateAuthEventFeedbackRequest struct { *aws.Request Input *UpdateAuthEventFeedbackInput + Copy func(*UpdateAuthEventFeedbackInput) UpdateAuthEventFeedbackRequest } // Send marshals and sends the UpdateAuthEventFeedback API request. @@ -4380,7 +4465,7 @@ func (c *CognitoIdentityProvider) UpdateAuthEventFeedbackRequest(input *UpdateAu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAuthEventFeedbackRequest{Request: req, Input: input} + return UpdateAuthEventFeedbackRequest{Request: req, Input: input, Copy: c.UpdateAuthEventFeedbackRequest} } const opUpdateDeviceStatus = "UpdateDeviceStatus" @@ -4389,6 +4474,7 @@ const opUpdateDeviceStatus = "UpdateDeviceStatus" type UpdateDeviceStatusRequest struct { *aws.Request Input *UpdateDeviceStatusInput + Copy func(*UpdateDeviceStatusInput) UpdateDeviceStatusRequest } // Send marshals and sends the UpdateDeviceStatus API request. @@ -4429,7 +4515,7 @@ func (c *CognitoIdentityProvider) UpdateDeviceStatusRequest(input *UpdateDeviceS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDeviceStatusRequest{Request: req, Input: input} + return UpdateDeviceStatusRequest{Request: req, Input: input, Copy: c.UpdateDeviceStatusRequest} } const opUpdateGroup = "UpdateGroup" @@ -4438,6 +4524,7 @@ const opUpdateGroup = "UpdateGroup" type UpdateGroupRequest struct { *aws.Request Input *UpdateGroupInput + Copy func(*UpdateGroupInput) UpdateGroupRequest } // Send marshals and sends the UpdateGroup API request. @@ -4480,7 +4567,7 @@ func (c *CognitoIdentityProvider) UpdateGroupRequest(input *UpdateGroupInput) Up req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGroupRequest{Request: req, Input: input} + return UpdateGroupRequest{Request: req, Input: input, Copy: c.UpdateGroupRequest} } const opUpdateIdentityProvider = "UpdateIdentityProvider" @@ -4489,6 +4576,7 @@ const opUpdateIdentityProvider = "UpdateIdentityProvider" type UpdateIdentityProviderRequest struct { *aws.Request Input *UpdateIdentityProviderInput + Copy func(*UpdateIdentityProviderInput) UpdateIdentityProviderRequest } // Send marshals and sends the UpdateIdentityProvider API request. @@ -4529,7 +4617,7 @@ func (c *CognitoIdentityProvider) UpdateIdentityProviderRequest(input *UpdateIde req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateIdentityProviderRequest{Request: req, Input: input} + return UpdateIdentityProviderRequest{Request: req, Input: input, Copy: c.UpdateIdentityProviderRequest} } const opUpdateResourceServer = "UpdateResourceServer" @@ -4538,6 +4626,7 @@ const opUpdateResourceServer = "UpdateResourceServer" type UpdateResourceServerRequest struct { *aws.Request Input *UpdateResourceServerInput + Copy func(*UpdateResourceServerInput) UpdateResourceServerRequest } // Send marshals and sends the UpdateResourceServer API request. @@ -4578,7 +4667,7 @@ func (c *CognitoIdentityProvider) UpdateResourceServerRequest(input *UpdateResou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateResourceServerRequest{Request: req, Input: input} + return UpdateResourceServerRequest{Request: req, Input: input, Copy: c.UpdateResourceServerRequest} } const opUpdateUserAttributes = "UpdateUserAttributes" @@ -4587,6 +4676,7 @@ const opUpdateUserAttributes = "UpdateUserAttributes" type UpdateUserAttributesRequest struct { *aws.Request Input *UpdateUserAttributesInput + Copy func(*UpdateUserAttributesInput) UpdateUserAttributesRequest } // Send marshals and sends the UpdateUserAttributes API request. @@ -4628,7 +4718,7 @@ func (c *CognitoIdentityProvider) UpdateUserAttributesRequest(input *UpdateUserA output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return UpdateUserAttributesRequest{Request: req, Input: input} + return UpdateUserAttributesRequest{Request: req, Input: input, Copy: c.UpdateUserAttributesRequest} } const opUpdateUserPool = "UpdateUserPool" @@ -4637,6 +4727,7 @@ const opUpdateUserPool = "UpdateUserPool" type UpdateUserPoolRequest struct { *aws.Request Input *UpdateUserPoolInput + Copy func(*UpdateUserPoolInput) UpdateUserPoolRequest } // Send marshals and sends the UpdateUserPool API request. @@ -4677,7 +4768,7 @@ func (c *CognitoIdentityProvider) UpdateUserPoolRequest(input *UpdateUserPoolInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateUserPoolRequest{Request: req, Input: input} + return UpdateUserPoolRequest{Request: req, Input: input, Copy: c.UpdateUserPoolRequest} } const opUpdateUserPoolClient = "UpdateUserPoolClient" @@ -4686,6 +4777,7 @@ const opUpdateUserPoolClient = "UpdateUserPoolClient" type UpdateUserPoolClientRequest struct { *aws.Request Input *UpdateUserPoolClientInput + Copy func(*UpdateUserPoolClientInput) UpdateUserPoolClientRequest } // Send marshals and sends the UpdateUserPoolClient API request. @@ -4727,7 +4819,7 @@ func (c *CognitoIdentityProvider) UpdateUserPoolClientRequest(input *UpdateUserP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateUserPoolClientRequest{Request: req, Input: input} + return UpdateUserPoolClientRequest{Request: req, Input: input, Copy: c.UpdateUserPoolClientRequest} } const opVerifySoftwareToken = "VerifySoftwareToken" @@ -4736,6 +4828,7 @@ const opVerifySoftwareToken = "VerifySoftwareToken" type VerifySoftwareTokenRequest struct { *aws.Request Input *VerifySoftwareTokenInput + Copy func(*VerifySoftwareTokenInput) VerifySoftwareTokenRequest } // Send marshals and sends the VerifySoftwareToken API request. @@ -4777,7 +4870,7 @@ func (c *CognitoIdentityProvider) VerifySoftwareTokenRequest(input *VerifySoftwa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return VerifySoftwareTokenRequest{Request: req, Input: input} + return VerifySoftwareTokenRequest{Request: req, Input: input, Copy: c.VerifySoftwareTokenRequest} } const opVerifyUserAttribute = "VerifyUserAttribute" @@ -4786,6 +4879,7 @@ const opVerifyUserAttribute = "VerifyUserAttribute" type VerifyUserAttributeRequest struct { *aws.Request Input *VerifyUserAttributeInput + Copy func(*VerifyUserAttributeInput) VerifyUserAttributeRequest } // Send marshals and sends the VerifyUserAttribute API request. @@ -4827,7 +4921,7 @@ func (c *CognitoIdentityProvider) VerifyUserAttributeRequest(input *VerifyUserAt output.responseMetadata = aws.Response{Request: req} req.Config.Credentials = aws.AnonymousCredentials - return VerifyUserAttributeRequest{Request: req, Input: input} + return VerifyUserAttributeRequest{Request: req, Input: input, Copy: c.VerifyUserAttributeRequest} } // Account takeover action type. diff --git a/service/cognitosync/api.go b/service/cognitosync/api.go index f86226a6def..76fe289276d 100644 --- a/service/cognitosync/api.go +++ b/service/cognitosync/api.go @@ -18,6 +18,7 @@ const opBulkPublish = "BulkPublish" type BulkPublishRequest struct { *aws.Request Input *BulkPublishInput + Copy func(*BulkPublishInput) BulkPublishRequest } // Send marshals and sends the BulkPublish API request. @@ -64,7 +65,7 @@ func (c *CognitoSync) BulkPublishRequest(input *BulkPublishInput) BulkPublishReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BulkPublishRequest{Request: req, Input: input} + return BulkPublishRequest{Request: req, Input: input, Copy: c.BulkPublishRequest} } const opDeleteDataset = "DeleteDataset" @@ -73,6 +74,7 @@ const opDeleteDataset = "DeleteDataset" type DeleteDatasetRequest struct { *aws.Request Input *DeleteDatasetInput + Copy func(*DeleteDatasetInput) DeleteDatasetRequest } // Send marshals and sends the DeleteDataset API request. @@ -119,7 +121,7 @@ func (c *CognitoSync) DeleteDatasetRequest(input *DeleteDatasetInput) DeleteData req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDatasetRequest{Request: req, Input: input} + return DeleteDatasetRequest{Request: req, Input: input, Copy: c.DeleteDatasetRequest} } const opDescribeDataset = "DescribeDataset" @@ -128,6 +130,7 @@ const opDescribeDataset = "DescribeDataset" type DescribeDatasetRequest struct { *aws.Request Input *DescribeDatasetInput + Copy func(*DescribeDatasetInput) DescribeDatasetRequest } // Send marshals and sends the DescribeDataset API request. @@ -174,7 +177,7 @@ func (c *CognitoSync) DescribeDatasetRequest(input *DescribeDatasetInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDatasetRequest{Request: req, Input: input} + return DescribeDatasetRequest{Request: req, Input: input, Copy: c.DescribeDatasetRequest} } const opDescribeIdentityPoolUsage = "DescribeIdentityPoolUsage" @@ -183,6 +186,7 @@ const opDescribeIdentityPoolUsage = "DescribeIdentityPoolUsage" type DescribeIdentityPoolUsageRequest struct { *aws.Request Input *DescribeIdentityPoolUsageInput + Copy func(*DescribeIdentityPoolUsageInput) DescribeIdentityPoolUsageRequest } // Send marshals and sends the DescribeIdentityPoolUsage API request. @@ -227,7 +231,7 @@ func (c *CognitoSync) DescribeIdentityPoolUsageRequest(input *DescribeIdentityPo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIdentityPoolUsageRequest{Request: req, Input: input} + return DescribeIdentityPoolUsageRequest{Request: req, Input: input, Copy: c.DescribeIdentityPoolUsageRequest} } const opDescribeIdentityUsage = "DescribeIdentityUsage" @@ -236,6 +240,7 @@ const opDescribeIdentityUsage = "DescribeIdentityUsage" type DescribeIdentityUsageRequest struct { *aws.Request Input *DescribeIdentityUsageInput + Copy func(*DescribeIdentityUsageInput) DescribeIdentityUsageRequest } // Send marshals and sends the DescribeIdentityUsage API request. @@ -280,7 +285,7 @@ func (c *CognitoSync) DescribeIdentityUsageRequest(input *DescribeIdentityUsageI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIdentityUsageRequest{Request: req, Input: input} + return DescribeIdentityUsageRequest{Request: req, Input: input, Copy: c.DescribeIdentityUsageRequest} } const opGetBulkPublishDetails = "GetBulkPublishDetails" @@ -289,6 +294,7 @@ const opGetBulkPublishDetails = "GetBulkPublishDetails" type GetBulkPublishDetailsRequest struct { *aws.Request Input *GetBulkPublishDetailsInput + Copy func(*GetBulkPublishDetailsInput) GetBulkPublishDetailsRequest } // Send marshals and sends the GetBulkPublishDetails API request. @@ -332,7 +338,7 @@ func (c *CognitoSync) GetBulkPublishDetailsRequest(input *GetBulkPublishDetailsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBulkPublishDetailsRequest{Request: req, Input: input} + return GetBulkPublishDetailsRequest{Request: req, Input: input, Copy: c.GetBulkPublishDetailsRequest} } const opGetCognitoEvents = "GetCognitoEvents" @@ -341,6 +347,7 @@ const opGetCognitoEvents = "GetCognitoEvents" type GetCognitoEventsRequest struct { *aws.Request Input *GetCognitoEventsInput + Copy func(*GetCognitoEventsInput) GetCognitoEventsRequest } // Send marshals and sends the GetCognitoEvents API request. @@ -385,7 +392,7 @@ func (c *CognitoSync) GetCognitoEventsRequest(input *GetCognitoEventsInput) GetC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCognitoEventsRequest{Request: req, Input: input} + return GetCognitoEventsRequest{Request: req, Input: input, Copy: c.GetCognitoEventsRequest} } const opGetIdentityPoolConfiguration = "GetIdentityPoolConfiguration" @@ -394,6 +401,7 @@ const opGetIdentityPoolConfiguration = "GetIdentityPoolConfiguration" type GetIdentityPoolConfigurationRequest struct { *aws.Request Input *GetIdentityPoolConfigurationInput + Copy func(*GetIdentityPoolConfigurationInput) GetIdentityPoolConfigurationRequest } // Send marshals and sends the GetIdentityPoolConfiguration API request. @@ -437,7 +445,7 @@ func (c *CognitoSync) GetIdentityPoolConfigurationRequest(input *GetIdentityPool req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIdentityPoolConfigurationRequest{Request: req, Input: input} + return GetIdentityPoolConfigurationRequest{Request: req, Input: input, Copy: c.GetIdentityPoolConfigurationRequest} } const opListDatasets = "ListDatasets" @@ -446,6 +454,7 @@ const opListDatasets = "ListDatasets" type ListDatasetsRequest struct { *aws.Request Input *ListDatasetsInput + Copy func(*ListDatasetsInput) ListDatasetsRequest } // Send marshals and sends the ListDatasets API request. @@ -492,7 +501,7 @@ func (c *CognitoSync) ListDatasetsRequest(input *ListDatasetsInput) ListDatasets req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDatasetsRequest{Request: req, Input: input} + return ListDatasetsRequest{Request: req, Input: input, Copy: c.ListDatasetsRequest} } const opListIdentityPoolUsage = "ListIdentityPoolUsage" @@ -501,6 +510,7 @@ const opListIdentityPoolUsage = "ListIdentityPoolUsage" type ListIdentityPoolUsageRequest struct { *aws.Request Input *ListIdentityPoolUsageInput + Copy func(*ListIdentityPoolUsageInput) ListIdentityPoolUsageRequest } // Send marshals and sends the ListIdentityPoolUsage API request. @@ -545,7 +555,7 @@ func (c *CognitoSync) ListIdentityPoolUsageRequest(input *ListIdentityPoolUsageI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIdentityPoolUsageRequest{Request: req, Input: input} + return ListIdentityPoolUsageRequest{Request: req, Input: input, Copy: c.ListIdentityPoolUsageRequest} } const opListRecords = "ListRecords" @@ -554,6 +564,7 @@ const opListRecords = "ListRecords" type ListRecordsRequest struct { *aws.Request Input *ListRecordsInput + Copy func(*ListRecordsInput) ListRecordsRequest } // Send marshals and sends the ListRecords API request. @@ -601,7 +612,7 @@ func (c *CognitoSync) ListRecordsRequest(input *ListRecordsInput) ListRecordsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRecordsRequest{Request: req, Input: input} + return ListRecordsRequest{Request: req, Input: input, Copy: c.ListRecordsRequest} } const opRegisterDevice = "RegisterDevice" @@ -610,6 +621,7 @@ const opRegisterDevice = "RegisterDevice" type RegisterDeviceRequest struct { *aws.Request Input *RegisterDeviceInput + Copy func(*RegisterDeviceInput) RegisterDeviceRequest } // Send marshals and sends the RegisterDevice API request. @@ -653,7 +665,7 @@ func (c *CognitoSync) RegisterDeviceRequest(input *RegisterDeviceInput) Register req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterDeviceRequest{Request: req, Input: input} + return RegisterDeviceRequest{Request: req, Input: input, Copy: c.RegisterDeviceRequest} } const opSetCognitoEvents = "SetCognitoEvents" @@ -662,6 +674,7 @@ const opSetCognitoEvents = "SetCognitoEvents" type SetCognitoEventsRequest struct { *aws.Request Input *SetCognitoEventsInput + Copy func(*SetCognitoEventsInput) SetCognitoEventsRequest } // Send marshals and sends the SetCognitoEvents API request. @@ -710,7 +723,7 @@ func (c *CognitoSync) SetCognitoEventsRequest(input *SetCognitoEventsInput) SetC req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetCognitoEventsRequest{Request: req, Input: input} + return SetCognitoEventsRequest{Request: req, Input: input, Copy: c.SetCognitoEventsRequest} } const opSetIdentityPoolConfiguration = "SetIdentityPoolConfiguration" @@ -719,6 +732,7 @@ const opSetIdentityPoolConfiguration = "SetIdentityPoolConfiguration" type SetIdentityPoolConfigurationRequest struct { *aws.Request Input *SetIdentityPoolConfigurationInput + Copy func(*SetIdentityPoolConfigurationInput) SetIdentityPoolConfigurationRequest } // Send marshals and sends the SetIdentityPoolConfiguration API request. @@ -762,7 +776,7 @@ func (c *CognitoSync) SetIdentityPoolConfigurationRequest(input *SetIdentityPool req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetIdentityPoolConfigurationRequest{Request: req, Input: input} + return SetIdentityPoolConfigurationRequest{Request: req, Input: input, Copy: c.SetIdentityPoolConfigurationRequest} } const opSubscribeToDataset = "SubscribeToDataset" @@ -771,6 +785,7 @@ const opSubscribeToDataset = "SubscribeToDataset" type SubscribeToDatasetRequest struct { *aws.Request Input *SubscribeToDatasetInput + Copy func(*SubscribeToDatasetInput) SubscribeToDatasetRequest } // Send marshals and sends the SubscribeToDataset API request. @@ -815,7 +830,7 @@ func (c *CognitoSync) SubscribeToDatasetRequest(input *SubscribeToDatasetInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SubscribeToDatasetRequest{Request: req, Input: input} + return SubscribeToDatasetRequest{Request: req, Input: input, Copy: c.SubscribeToDatasetRequest} } const opUnsubscribeFromDataset = "UnsubscribeFromDataset" @@ -824,6 +839,7 @@ const opUnsubscribeFromDataset = "UnsubscribeFromDataset" type UnsubscribeFromDatasetRequest struct { *aws.Request Input *UnsubscribeFromDatasetInput + Copy func(*UnsubscribeFromDatasetInput) UnsubscribeFromDatasetRequest } // Send marshals and sends the UnsubscribeFromDataset API request. @@ -868,7 +884,7 @@ func (c *CognitoSync) UnsubscribeFromDatasetRequest(input *UnsubscribeFromDatase req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UnsubscribeFromDatasetRequest{Request: req, Input: input} + return UnsubscribeFromDatasetRequest{Request: req, Input: input, Copy: c.UnsubscribeFromDatasetRequest} } const opUpdateRecords = "UpdateRecords" @@ -877,6 +893,7 @@ const opUpdateRecords = "UpdateRecords" type UpdateRecordsRequest struct { *aws.Request Input *UpdateRecordsInput + Copy func(*UpdateRecordsInput) UpdateRecordsRequest } // Send marshals and sends the UpdateRecords API request. @@ -932,7 +949,7 @@ func (c *CognitoSync) UpdateRecordsRequest(input *UpdateRecordsInput) UpdateReco req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRecordsRequest{Request: req, Input: input} + return UpdateRecordsRequest{Request: req, Input: input, Copy: c.UpdateRecordsRequest} } // The input for the BulkPublish operation. diff --git a/service/comprehend/api.go b/service/comprehend/api.go index 06e08442e5f..b69b7480f06 100644 --- a/service/comprehend/api.go +++ b/service/comprehend/api.go @@ -15,6 +15,7 @@ const opBatchDetectDominantLanguage = "BatchDetectDominantLanguage" type BatchDetectDominantLanguageRequest struct { *aws.Request Input *BatchDetectDominantLanguageInput + Copy func(*BatchDetectDominantLanguageInput) BatchDetectDominantLanguageRequest } // Send marshals and sends the BatchDetectDominantLanguage API request. @@ -57,7 +58,7 @@ func (c *Comprehend) BatchDetectDominantLanguageRequest(input *BatchDetectDomina req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchDetectDominantLanguageRequest{Request: req, Input: input} + return BatchDetectDominantLanguageRequest{Request: req, Input: input, Copy: c.BatchDetectDominantLanguageRequest} } const opBatchDetectEntities = "BatchDetectEntities" @@ -66,6 +67,7 @@ const opBatchDetectEntities = "BatchDetectEntities" type BatchDetectEntitiesRequest struct { *aws.Request Input *BatchDetectEntitiesInput + Copy func(*BatchDetectEntitiesInput) BatchDetectEntitiesRequest } // Send marshals and sends the BatchDetectEntities API request. @@ -107,7 +109,7 @@ func (c *Comprehend) BatchDetectEntitiesRequest(input *BatchDetectEntitiesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchDetectEntitiesRequest{Request: req, Input: input} + return BatchDetectEntitiesRequest{Request: req, Input: input, Copy: c.BatchDetectEntitiesRequest} } const opBatchDetectKeyPhrases = "BatchDetectKeyPhrases" @@ -116,6 +118,7 @@ const opBatchDetectKeyPhrases = "BatchDetectKeyPhrases" type BatchDetectKeyPhrasesRequest struct { *aws.Request Input *BatchDetectKeyPhrasesInput + Copy func(*BatchDetectKeyPhrasesInput) BatchDetectKeyPhrasesRequest } // Send marshals and sends the BatchDetectKeyPhrases API request. @@ -156,7 +159,7 @@ func (c *Comprehend) BatchDetectKeyPhrasesRequest(input *BatchDetectKeyPhrasesIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchDetectKeyPhrasesRequest{Request: req, Input: input} + return BatchDetectKeyPhrasesRequest{Request: req, Input: input, Copy: c.BatchDetectKeyPhrasesRequest} } const opBatchDetectSentiment = "BatchDetectSentiment" @@ -165,6 +168,7 @@ const opBatchDetectSentiment = "BatchDetectSentiment" type BatchDetectSentimentRequest struct { *aws.Request Input *BatchDetectSentimentInput + Copy func(*BatchDetectSentimentInput) BatchDetectSentimentRequest } // Send marshals and sends the BatchDetectSentiment API request. @@ -206,7 +210,7 @@ func (c *Comprehend) BatchDetectSentimentRequest(input *BatchDetectSentimentInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchDetectSentimentRequest{Request: req, Input: input} + return BatchDetectSentimentRequest{Request: req, Input: input, Copy: c.BatchDetectSentimentRequest} } const opDescribeTopicsDetectionJob = "DescribeTopicsDetectionJob" @@ -215,6 +219,7 @@ const opDescribeTopicsDetectionJob = "DescribeTopicsDetectionJob" type DescribeTopicsDetectionJobRequest struct { *aws.Request Input *DescribeTopicsDetectionJobInput + Copy func(*DescribeTopicsDetectionJobInput) DescribeTopicsDetectionJobRequest } // Send marshals and sends the DescribeTopicsDetectionJob API request. @@ -256,7 +261,7 @@ func (c *Comprehend) DescribeTopicsDetectionJobRequest(input *DescribeTopicsDete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTopicsDetectionJobRequest{Request: req, Input: input} + return DescribeTopicsDetectionJobRequest{Request: req, Input: input, Copy: c.DescribeTopicsDetectionJobRequest} } const opDetectDominantLanguage = "DetectDominantLanguage" @@ -265,6 +270,7 @@ const opDetectDominantLanguage = "DetectDominantLanguage" type DetectDominantLanguageRequest struct { *aws.Request Input *DetectDominantLanguageInput + Copy func(*DetectDominantLanguageInput) DetectDominantLanguageRequest } // Send marshals and sends the DetectDominantLanguage API request. @@ -307,7 +313,7 @@ func (c *Comprehend) DetectDominantLanguageRequest(input *DetectDominantLanguage req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetectDominantLanguageRequest{Request: req, Input: input} + return DetectDominantLanguageRequest{Request: req, Input: input, Copy: c.DetectDominantLanguageRequest} } const opDetectEntities = "DetectEntities" @@ -316,6 +322,7 @@ const opDetectEntities = "DetectEntities" type DetectEntitiesRequest struct { *aws.Request Input *DetectEntitiesInput + Copy func(*DetectEntitiesInput) DetectEntitiesRequest } // Send marshals and sends the DetectEntities API request. @@ -357,7 +364,7 @@ func (c *Comprehend) DetectEntitiesRequest(input *DetectEntitiesInput) DetectEnt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetectEntitiesRequest{Request: req, Input: input} + return DetectEntitiesRequest{Request: req, Input: input, Copy: c.DetectEntitiesRequest} } const opDetectKeyPhrases = "DetectKeyPhrases" @@ -366,6 +373,7 @@ const opDetectKeyPhrases = "DetectKeyPhrases" type DetectKeyPhrasesRequest struct { *aws.Request Input *DetectKeyPhrasesInput + Copy func(*DetectKeyPhrasesInput) DetectKeyPhrasesRequest } // Send marshals and sends the DetectKeyPhrases API request. @@ -406,7 +414,7 @@ func (c *Comprehend) DetectKeyPhrasesRequest(input *DetectKeyPhrasesInput) Detec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetectKeyPhrasesRequest{Request: req, Input: input} + return DetectKeyPhrasesRequest{Request: req, Input: input, Copy: c.DetectKeyPhrasesRequest} } const opDetectSentiment = "DetectSentiment" @@ -415,6 +423,7 @@ const opDetectSentiment = "DetectSentiment" type DetectSentimentRequest struct { *aws.Request Input *DetectSentimentInput + Copy func(*DetectSentimentInput) DetectSentimentRequest } // Send marshals and sends the DetectSentiment API request. @@ -456,7 +465,7 @@ func (c *Comprehend) DetectSentimentRequest(input *DetectSentimentInput) DetectS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetectSentimentRequest{Request: req, Input: input} + return DetectSentimentRequest{Request: req, Input: input, Copy: c.DetectSentimentRequest} } const opListTopicsDetectionJobs = "ListTopicsDetectionJobs" @@ -465,6 +474,7 @@ const opListTopicsDetectionJobs = "ListTopicsDetectionJobs" type ListTopicsDetectionJobsRequest struct { *aws.Request Input *ListTopicsDetectionJobsInput + Copy func(*ListTopicsDetectionJobsInput) ListTopicsDetectionJobsRequest } // Send marshals and sends the ListTopicsDetectionJobs API request. @@ -511,57 +521,53 @@ func (c *Comprehend) ListTopicsDetectionJobsRequest(input *ListTopicsDetectionJo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTopicsDetectionJobsRequest{Request: req, Input: input} + return ListTopicsDetectionJobsRequest{Request: req, Input: input, Copy: c.ListTopicsDetectionJobsRequest} } -// ListTopicsDetectionJobsPages iterates over the pages of a ListTopicsDetectionJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTopicsDetectionJobs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTopicsDetectionJobsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTopicsDetectionJobs operation. -// pageNum := 0 -// err := client.ListTopicsDetectionJobsPages(params, -// func(page *ListTopicsDetectionJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListTopicsDetectionJobsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Comprehend) ListTopicsDetectionJobsPages(input *ListTopicsDetectionJobsInput, fn func(*ListTopicsDetectionJobsOutput, bool) bool) error { - return c.ListTopicsDetectionJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTopicsDetectionJobsPagesWithContext same as ListTopicsDetectionJobsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Comprehend) ListTopicsDetectionJobsPagesWithContext(ctx aws.Context, input *ListTopicsDetectionJobsInput, fn func(*ListTopicsDetectionJobsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTopicsDetectionJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTopicsDetectionJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListTopicsDetectionJobsRequest) Paginate(opts ...aws.Option) ListTopicsDetectionJobsPager { + return ListTopicsDetectionJobsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTopicsDetectionJobsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTopicsDetectionJobsOutput), !p.HasNextPage()) - } - return p.Err() +// ListTopicsDetectionJobsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTopicsDetectionJobsPager struct { + aws.Pager +} + +func (p *ListTopicsDetectionJobsPager) CurrentPage() *ListTopicsDetectionJobsOutput { + return p.Pager.CurrentPage().(*ListTopicsDetectionJobsOutput) } const opStartTopicsDetectionJob = "StartTopicsDetectionJob" @@ -570,6 +576,7 @@ const opStartTopicsDetectionJob = "StartTopicsDetectionJob" type StartTopicsDetectionJobRequest struct { *aws.Request Input *StartTopicsDetectionJobInput + Copy func(*StartTopicsDetectionJobInput) StartTopicsDetectionJobRequest } // Send marshals and sends the StartTopicsDetectionJob API request. @@ -611,7 +618,7 @@ func (c *Comprehend) StartTopicsDetectionJobRequest(input *StartTopicsDetectionJ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartTopicsDetectionJobRequest{Request: req, Input: input} + return StartTopicsDetectionJobRequest{Request: req, Input: input, Copy: c.StartTopicsDetectionJobRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/BatchDetectDominantLanguageRequest diff --git a/service/comprehend/comprehendiface/interface.go b/service/comprehend/comprehendiface/interface.go index 463b0029e7a..fb43935b46e 100644 --- a/service/comprehend/comprehendiface/interface.go +++ b/service/comprehend/comprehendiface/interface.go @@ -9,7 +9,6 @@ package comprehendiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/comprehend" ) @@ -83,9 +82,6 @@ type ComprehendAPI interface { ListTopicsDetectionJobsRequest(*comprehend.ListTopicsDetectionJobsInput) comprehend.ListTopicsDetectionJobsRequest - ListTopicsDetectionJobsPages(*comprehend.ListTopicsDetectionJobsInput, func(*comprehend.ListTopicsDetectionJobsOutput, bool) bool) error - ListTopicsDetectionJobsPagesWithContext(aws.Context, *comprehend.ListTopicsDetectionJobsInput, func(*comprehend.ListTopicsDetectionJobsOutput, bool) bool, ...aws.Option) error - StartTopicsDetectionJobRequest(*comprehend.StartTopicsDetectionJobInput) comprehend.StartTopicsDetectionJobRequest } diff --git a/service/configservice/api.go b/service/configservice/api.go index 13a3a8ba6ab..7940bf25c8d 100644 --- a/service/configservice/api.go +++ b/service/configservice/api.go @@ -18,6 +18,7 @@ const opDeleteConfigRule = "DeleteConfigRule" type DeleteConfigRuleRequest struct { *aws.Request Input *DeleteConfigRuleInput + Copy func(*DeleteConfigRuleInput) DeleteConfigRuleRequest } // Send marshals and sends the DeleteConfigRule API request. @@ -66,7 +67,7 @@ func (c *ConfigService) DeleteConfigRuleRequest(input *DeleteConfigRuleInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteConfigRuleRequest{Request: req, Input: input} + return DeleteConfigRuleRequest{Request: req, Input: input, Copy: c.DeleteConfigRuleRequest} } const opDeleteConfigurationRecorder = "DeleteConfigurationRecorder" @@ -75,6 +76,7 @@ const opDeleteConfigurationRecorder = "DeleteConfigurationRecorder" type DeleteConfigurationRecorderRequest struct { *aws.Request Input *DeleteConfigurationRecorderInput + Copy func(*DeleteConfigurationRecorderInput) DeleteConfigurationRecorderRequest } // Send marshals and sends the DeleteConfigurationRecorder API request. @@ -126,7 +128,7 @@ func (c *ConfigService) DeleteConfigurationRecorderRequest(input *DeleteConfigur req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteConfigurationRecorderRequest{Request: req, Input: input} + return DeleteConfigurationRecorderRequest{Request: req, Input: input, Copy: c.DeleteConfigurationRecorderRequest} } const opDeleteDeliveryChannel = "DeleteDeliveryChannel" @@ -135,6 +137,7 @@ const opDeleteDeliveryChannel = "DeleteDeliveryChannel" type DeleteDeliveryChannelRequest struct { *aws.Request Input *DeleteDeliveryChannelInput + Copy func(*DeleteDeliveryChannelInput) DeleteDeliveryChannelRequest } // Send marshals and sends the DeleteDeliveryChannel API request. @@ -180,7 +183,7 @@ func (c *ConfigService) DeleteDeliveryChannelRequest(input *DeleteDeliveryChanne req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDeliveryChannelRequest{Request: req, Input: input} + return DeleteDeliveryChannelRequest{Request: req, Input: input, Copy: c.DeleteDeliveryChannelRequest} } const opDeleteEvaluationResults = "DeleteEvaluationResults" @@ -189,6 +192,7 @@ const opDeleteEvaluationResults = "DeleteEvaluationResults" type DeleteEvaluationResultsRequest struct { *aws.Request Input *DeleteEvaluationResultsInput + Copy func(*DeleteEvaluationResultsInput) DeleteEvaluationResultsRequest } // Send marshals and sends the DeleteEvaluationResults API request. @@ -232,7 +236,7 @@ func (c *ConfigService) DeleteEvaluationResultsRequest(input *DeleteEvaluationRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEvaluationResultsRequest{Request: req, Input: input} + return DeleteEvaluationResultsRequest{Request: req, Input: input, Copy: c.DeleteEvaluationResultsRequest} } const opDeliverConfigSnapshot = "DeliverConfigSnapshot" @@ -241,6 +245,7 @@ const opDeliverConfigSnapshot = "DeliverConfigSnapshot" type DeliverConfigSnapshotRequest struct { *aws.Request Input *DeliverConfigSnapshotInput + Copy func(*DeliverConfigSnapshotInput) DeliverConfigSnapshotRequest } // Send marshals and sends the DeliverConfigSnapshot API request. @@ -290,7 +295,7 @@ func (c *ConfigService) DeliverConfigSnapshotRequest(input *DeliverConfigSnapsho req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeliverConfigSnapshotRequest{Request: req, Input: input} + return DeliverConfigSnapshotRequest{Request: req, Input: input, Copy: c.DeliverConfigSnapshotRequest} } const opDescribeComplianceByConfigRule = "DescribeComplianceByConfigRule" @@ -299,6 +304,7 @@ const opDescribeComplianceByConfigRule = "DescribeComplianceByConfigRule" type DescribeComplianceByConfigRuleRequest struct { *aws.Request Input *DescribeComplianceByConfigRuleInput + Copy func(*DescribeComplianceByConfigRuleInput) DescribeComplianceByConfigRuleRequest } // Send marshals and sends the DescribeComplianceByConfigRule API request. @@ -361,7 +367,7 @@ func (c *ConfigService) DescribeComplianceByConfigRuleRequest(input *DescribeCom req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeComplianceByConfigRuleRequest{Request: req, Input: input} + return DescribeComplianceByConfigRuleRequest{Request: req, Input: input, Copy: c.DescribeComplianceByConfigRuleRequest} } const opDescribeComplianceByResource = "DescribeComplianceByResource" @@ -370,6 +376,7 @@ const opDescribeComplianceByResource = "DescribeComplianceByResource" type DescribeComplianceByResourceRequest struct { *aws.Request Input *DescribeComplianceByResourceInput + Copy func(*DescribeComplianceByResourceInput) DescribeComplianceByResourceRequest } // Send marshals and sends the DescribeComplianceByResource API request. @@ -434,7 +441,7 @@ func (c *ConfigService) DescribeComplianceByResourceRequest(input *DescribeCompl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeComplianceByResourceRequest{Request: req, Input: input} + return DescribeComplianceByResourceRequest{Request: req, Input: input, Copy: c.DescribeComplianceByResourceRequest} } const opDescribeConfigRuleEvaluationStatus = "DescribeConfigRuleEvaluationStatus" @@ -443,6 +450,7 @@ const opDescribeConfigRuleEvaluationStatus = "DescribeConfigRuleEvaluationStatus type DescribeConfigRuleEvaluationStatusRequest struct { *aws.Request Input *DescribeConfigRuleEvaluationStatusInput + Copy func(*DescribeConfigRuleEvaluationStatusInput) DescribeConfigRuleEvaluationStatusRequest } // Send marshals and sends the DescribeConfigRuleEvaluationStatus API request. @@ -486,7 +494,7 @@ func (c *ConfigService) DescribeConfigRuleEvaluationStatusRequest(input *Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigRuleEvaluationStatusRequest{Request: req, Input: input} + return DescribeConfigRuleEvaluationStatusRequest{Request: req, Input: input, Copy: c.DescribeConfigRuleEvaluationStatusRequest} } const opDescribeConfigRules = "DescribeConfigRules" @@ -495,6 +503,7 @@ const opDescribeConfigRules = "DescribeConfigRules" type DescribeConfigRulesRequest struct { *aws.Request Input *DescribeConfigRulesInput + Copy func(*DescribeConfigRulesInput) DescribeConfigRulesRequest } // Send marshals and sends the DescribeConfigRules API request. @@ -535,7 +544,7 @@ func (c *ConfigService) DescribeConfigRulesRequest(input *DescribeConfigRulesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigRulesRequest{Request: req, Input: input} + return DescribeConfigRulesRequest{Request: req, Input: input, Copy: c.DescribeConfigRulesRequest} } const opDescribeConfigurationRecorderStatus = "DescribeConfigurationRecorderStatus" @@ -544,6 +553,7 @@ const opDescribeConfigurationRecorderStatus = "DescribeConfigurationRecorderStat type DescribeConfigurationRecorderStatusRequest struct { *aws.Request Input *DescribeConfigurationRecorderStatusInput + Copy func(*DescribeConfigurationRecorderStatusInput) DescribeConfigurationRecorderStatusRequest } // Send marshals and sends the DescribeConfigurationRecorderStatus API request. @@ -589,7 +599,7 @@ func (c *ConfigService) DescribeConfigurationRecorderStatusRequest(input *Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigurationRecorderStatusRequest{Request: req, Input: input} + return DescribeConfigurationRecorderStatusRequest{Request: req, Input: input, Copy: c.DescribeConfigurationRecorderStatusRequest} } const opDescribeConfigurationRecorders = "DescribeConfigurationRecorders" @@ -598,6 +608,7 @@ const opDescribeConfigurationRecorders = "DescribeConfigurationRecorders" type DescribeConfigurationRecordersRequest struct { *aws.Request Input *DescribeConfigurationRecordersInput + Copy func(*DescribeConfigurationRecordersInput) DescribeConfigurationRecordersRequest } // Send marshals and sends the DescribeConfigurationRecorders API request. @@ -643,7 +654,7 @@ func (c *ConfigService) DescribeConfigurationRecordersRequest(input *DescribeCon req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigurationRecordersRequest{Request: req, Input: input} + return DescribeConfigurationRecordersRequest{Request: req, Input: input, Copy: c.DescribeConfigurationRecordersRequest} } const opDescribeDeliveryChannelStatus = "DescribeDeliveryChannelStatus" @@ -652,6 +663,7 @@ const opDescribeDeliveryChannelStatus = "DescribeDeliveryChannelStatus" type DescribeDeliveryChannelStatusRequest struct { *aws.Request Input *DescribeDeliveryChannelStatusInput + Copy func(*DescribeDeliveryChannelStatusInput) DescribeDeliveryChannelStatusRequest } // Send marshals and sends the DescribeDeliveryChannelStatus API request. @@ -696,7 +708,7 @@ func (c *ConfigService) DescribeDeliveryChannelStatusRequest(input *DescribeDeli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDeliveryChannelStatusRequest{Request: req, Input: input} + return DescribeDeliveryChannelStatusRequest{Request: req, Input: input, Copy: c.DescribeDeliveryChannelStatusRequest} } const opDescribeDeliveryChannels = "DescribeDeliveryChannels" @@ -705,6 +717,7 @@ const opDescribeDeliveryChannels = "DescribeDeliveryChannels" type DescribeDeliveryChannelsRequest struct { *aws.Request Input *DescribeDeliveryChannelsInput + Copy func(*DescribeDeliveryChannelsInput) DescribeDeliveryChannelsRequest } // Send marshals and sends the DescribeDeliveryChannels API request. @@ -749,7 +762,7 @@ func (c *ConfigService) DescribeDeliveryChannelsRequest(input *DescribeDeliveryC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDeliveryChannelsRequest{Request: req, Input: input} + return DescribeDeliveryChannelsRequest{Request: req, Input: input, Copy: c.DescribeDeliveryChannelsRequest} } const opGetComplianceDetailsByConfigRule = "GetComplianceDetailsByConfigRule" @@ -758,6 +771,7 @@ const opGetComplianceDetailsByConfigRule = "GetComplianceDetailsByConfigRule" type GetComplianceDetailsByConfigRuleRequest struct { *aws.Request Input *GetComplianceDetailsByConfigRuleInput + Copy func(*GetComplianceDetailsByConfigRuleInput) GetComplianceDetailsByConfigRuleRequest } // Send marshals and sends the GetComplianceDetailsByConfigRule API request. @@ -800,7 +814,7 @@ func (c *ConfigService) GetComplianceDetailsByConfigRuleRequest(input *GetCompli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetComplianceDetailsByConfigRuleRequest{Request: req, Input: input} + return GetComplianceDetailsByConfigRuleRequest{Request: req, Input: input, Copy: c.GetComplianceDetailsByConfigRuleRequest} } const opGetComplianceDetailsByResource = "GetComplianceDetailsByResource" @@ -809,6 +823,7 @@ const opGetComplianceDetailsByResource = "GetComplianceDetailsByResource" type GetComplianceDetailsByResourceRequest struct { *aws.Request Input *GetComplianceDetailsByResourceInput + Copy func(*GetComplianceDetailsByResourceInput) GetComplianceDetailsByResourceRequest } // Send marshals and sends the GetComplianceDetailsByResource API request. @@ -851,7 +866,7 @@ func (c *ConfigService) GetComplianceDetailsByResourceRequest(input *GetComplian req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetComplianceDetailsByResourceRequest{Request: req, Input: input} + return GetComplianceDetailsByResourceRequest{Request: req, Input: input, Copy: c.GetComplianceDetailsByResourceRequest} } const opGetComplianceSummaryByConfigRule = "GetComplianceSummaryByConfigRule" @@ -860,6 +875,7 @@ const opGetComplianceSummaryByConfigRule = "GetComplianceSummaryByConfigRule" type GetComplianceSummaryByConfigRuleRequest struct { *aws.Request Input *GetComplianceSummaryByConfigRuleInput + Copy func(*GetComplianceSummaryByConfigRuleInput) GetComplianceSummaryByConfigRuleRequest } // Send marshals and sends the GetComplianceSummaryByConfigRule API request. @@ -901,7 +917,7 @@ func (c *ConfigService) GetComplianceSummaryByConfigRuleRequest(input *GetCompli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetComplianceSummaryByConfigRuleRequest{Request: req, Input: input} + return GetComplianceSummaryByConfigRuleRequest{Request: req, Input: input, Copy: c.GetComplianceSummaryByConfigRuleRequest} } const opGetComplianceSummaryByResourceType = "GetComplianceSummaryByResourceType" @@ -910,6 +926,7 @@ const opGetComplianceSummaryByResourceType = "GetComplianceSummaryByResourceType type GetComplianceSummaryByResourceTypeRequest struct { *aws.Request Input *GetComplianceSummaryByResourceTypeInput + Copy func(*GetComplianceSummaryByResourceTypeInput) GetComplianceSummaryByResourceTypeRequest } // Send marshals and sends the GetComplianceSummaryByResourceType API request. @@ -952,7 +969,7 @@ func (c *ConfigService) GetComplianceSummaryByResourceTypeRequest(input *GetComp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetComplianceSummaryByResourceTypeRequest{Request: req, Input: input} + return GetComplianceSummaryByResourceTypeRequest{Request: req, Input: input, Copy: c.GetComplianceSummaryByResourceTypeRequest} } const opGetDiscoveredResourceCounts = "GetDiscoveredResourceCounts" @@ -961,6 +978,7 @@ const opGetDiscoveredResourceCounts = "GetDiscoveredResourceCounts" type GetDiscoveredResourceCountsRequest struct { *aws.Request Input *GetDiscoveredResourceCountsInput + Copy func(*GetDiscoveredResourceCountsInput) GetDiscoveredResourceCountsRequest } // Send marshals and sends the GetDiscoveredResourceCounts API request. @@ -1034,7 +1052,7 @@ func (c *ConfigService) GetDiscoveredResourceCountsRequest(input *GetDiscoveredR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDiscoveredResourceCountsRequest{Request: req, Input: input} + return GetDiscoveredResourceCountsRequest{Request: req, Input: input, Copy: c.GetDiscoveredResourceCountsRequest} } const opGetResourceConfigHistory = "GetResourceConfigHistory" @@ -1043,6 +1061,7 @@ const opGetResourceConfigHistory = "GetResourceConfigHistory" type GetResourceConfigHistoryRequest struct { *aws.Request Input *GetResourceConfigHistoryInput + Copy func(*GetResourceConfigHistoryInput) GetResourceConfigHistoryRequest } // Send marshals and sends the GetResourceConfigHistory API request. @@ -1100,57 +1119,53 @@ func (c *ConfigService) GetResourceConfigHistoryRequest(input *GetResourceConfig req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetResourceConfigHistoryRequest{Request: req, Input: input} + return GetResourceConfigHistoryRequest{Request: req, Input: input, Copy: c.GetResourceConfigHistoryRequest} } -// GetResourceConfigHistoryPages iterates over the pages of a GetResourceConfigHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetResourceConfigHistory method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetResourceConfigHistoryRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetResourceConfigHistory operation. -// pageNum := 0 -// err := client.GetResourceConfigHistoryPages(params, -// func(page *GetResourceConfigHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ConfigService) GetResourceConfigHistoryPages(input *GetResourceConfigHistoryInput, fn func(*GetResourceConfigHistoryOutput, bool) bool) error { - return c.GetResourceConfigHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetResourceConfigHistoryPagesWithContext same as GetResourceConfigHistoryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ConfigService) GetResourceConfigHistoryPagesWithContext(ctx aws.Context, input *GetResourceConfigHistoryInput, fn func(*GetResourceConfigHistoryOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetResourceConfigHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetResourceConfigHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetResourceConfigHistoryRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetResourceConfigHistoryRequest) Paginate(opts ...aws.Option) GetResourceConfigHistoryPager { + return GetResourceConfigHistoryPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetResourceConfigHistoryInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetResourceConfigHistoryOutput), !p.HasNextPage()) - } - return p.Err() +// GetResourceConfigHistoryPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetResourceConfigHistoryPager struct { + aws.Pager +} + +func (p *GetResourceConfigHistoryPager) CurrentPage() *GetResourceConfigHistoryOutput { + return p.Pager.CurrentPage().(*GetResourceConfigHistoryOutput) } const opListDiscoveredResources = "ListDiscoveredResources" @@ -1159,6 +1174,7 @@ const opListDiscoveredResources = "ListDiscoveredResources" type ListDiscoveredResourcesRequest struct { *aws.Request Input *ListDiscoveredResourcesInput + Copy func(*ListDiscoveredResourcesInput) ListDiscoveredResourcesRequest } // Send marshals and sends the ListDiscoveredResources API request. @@ -1212,7 +1228,7 @@ func (c *ConfigService) ListDiscoveredResourcesRequest(input *ListDiscoveredReso req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDiscoveredResourcesRequest{Request: req, Input: input} + return ListDiscoveredResourcesRequest{Request: req, Input: input, Copy: c.ListDiscoveredResourcesRequest} } const opPutConfigRule = "PutConfigRule" @@ -1221,6 +1237,7 @@ const opPutConfigRule = "PutConfigRule" type PutConfigRuleRequest struct { *aws.Request Input *PutConfigRuleInput + Copy func(*PutConfigRuleInput) PutConfigRuleRequest } // Send marshals and sends the PutConfigRule API request. @@ -1297,7 +1314,7 @@ func (c *ConfigService) PutConfigRuleRequest(input *PutConfigRuleInput) PutConfi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutConfigRuleRequest{Request: req, Input: input} + return PutConfigRuleRequest{Request: req, Input: input, Copy: c.PutConfigRuleRequest} } const opPutConfigurationRecorder = "PutConfigurationRecorder" @@ -1306,6 +1323,7 @@ const opPutConfigurationRecorder = "PutConfigurationRecorder" type PutConfigurationRecorderRequest struct { *aws.Request Input *PutConfigurationRecorderInput + Copy func(*PutConfigurationRecorderInput) PutConfigurationRecorderRequest } // Send marshals and sends the PutConfigurationRecorder API request. @@ -1358,7 +1376,7 @@ func (c *ConfigService) PutConfigurationRecorderRequest(input *PutConfigurationR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutConfigurationRecorderRequest{Request: req, Input: input} + return PutConfigurationRecorderRequest{Request: req, Input: input, Copy: c.PutConfigurationRecorderRequest} } const opPutDeliveryChannel = "PutDeliveryChannel" @@ -1367,6 +1385,7 @@ const opPutDeliveryChannel = "PutDeliveryChannel" type PutDeliveryChannelRequest struct { *aws.Request Input *PutDeliveryChannelInput + Copy func(*PutDeliveryChannelInput) PutDeliveryChannelRequest } // Send marshals and sends the PutDeliveryChannel API request. @@ -1422,7 +1441,7 @@ func (c *ConfigService) PutDeliveryChannelRequest(input *PutDeliveryChannelInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutDeliveryChannelRequest{Request: req, Input: input} + return PutDeliveryChannelRequest{Request: req, Input: input, Copy: c.PutDeliveryChannelRequest} } const opPutEvaluations = "PutEvaluations" @@ -1431,6 +1450,7 @@ const opPutEvaluations = "PutEvaluations" type PutEvaluationsRequest struct { *aws.Request Input *PutEvaluationsInput + Copy func(*PutEvaluationsInput) PutEvaluationsRequest } // Send marshals and sends the PutEvaluations API request. @@ -1473,7 +1493,7 @@ func (c *ConfigService) PutEvaluationsRequest(input *PutEvaluationsInput) PutEva req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutEvaluationsRequest{Request: req, Input: input} + return PutEvaluationsRequest{Request: req, Input: input, Copy: c.PutEvaluationsRequest} } const opStartConfigRulesEvaluation = "StartConfigRulesEvaluation" @@ -1482,6 +1502,7 @@ const opStartConfigRulesEvaluation = "StartConfigRulesEvaluation" type StartConfigRulesEvaluationRequest struct { *aws.Request Input *StartConfigRulesEvaluationInput + Copy func(*StartConfigRulesEvaluationInput) StartConfigRulesEvaluationRequest } // Send marshals and sends the StartConfigRulesEvaluation API request. @@ -1551,7 +1572,7 @@ func (c *ConfigService) StartConfigRulesEvaluationRequest(input *StartConfigRule req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartConfigRulesEvaluationRequest{Request: req, Input: input} + return StartConfigRulesEvaluationRequest{Request: req, Input: input, Copy: c.StartConfigRulesEvaluationRequest} } const opStartConfigurationRecorder = "StartConfigurationRecorder" @@ -1560,6 +1581,7 @@ const opStartConfigurationRecorder = "StartConfigurationRecorder" type StartConfigurationRecorderRequest struct { *aws.Request Input *StartConfigurationRecorderInput + Copy func(*StartConfigurationRecorderInput) StartConfigurationRecorderRequest } // Send marshals and sends the StartConfigurationRecorder API request. @@ -1606,7 +1628,7 @@ func (c *ConfigService) StartConfigurationRecorderRequest(input *StartConfigurat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StartConfigurationRecorderRequest{Request: req, Input: input} + return StartConfigurationRecorderRequest{Request: req, Input: input, Copy: c.StartConfigurationRecorderRequest} } const opStopConfigurationRecorder = "StopConfigurationRecorder" @@ -1615,6 +1637,7 @@ const opStopConfigurationRecorder = "StopConfigurationRecorder" type StopConfigurationRecorderRequest struct { *aws.Request Input *StopConfigurationRecorderInput + Copy func(*StopConfigurationRecorderInput) StopConfigurationRecorderRequest } // Send marshals and sends the StopConfigurationRecorder API request. @@ -1658,7 +1681,7 @@ func (c *ConfigService) StopConfigurationRecorderRequest(input *StopConfiguratio req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StopConfigurationRecorderRequest{Request: req, Input: input} + return StopConfigurationRecorderRequest{Request: req, Input: input, Copy: c.StopConfigurationRecorderRequest} } // Indicates whether an AWS resource or AWS Config rule is compliant and provides diff --git a/service/configservice/configserviceiface/interface.go b/service/configservice/configserviceiface/interface.go index f08fa1fb7d4..5c62e2ab06c 100644 --- a/service/configservice/configserviceiface/interface.go +++ b/service/configservice/configserviceiface/interface.go @@ -9,7 +9,6 @@ package configserviceiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/configservice" ) @@ -101,9 +100,6 @@ type ConfigServiceAPI interface { GetResourceConfigHistoryRequest(*configservice.GetResourceConfigHistoryInput) configservice.GetResourceConfigHistoryRequest - GetResourceConfigHistoryPages(*configservice.GetResourceConfigHistoryInput, func(*configservice.GetResourceConfigHistoryOutput, bool) bool) error - GetResourceConfigHistoryPagesWithContext(aws.Context, *configservice.GetResourceConfigHistoryInput, func(*configservice.GetResourceConfigHistoryOutput, bool) bool, ...aws.Option) error - ListDiscoveredResourcesRequest(*configservice.ListDiscoveredResourcesInput) configservice.ListDiscoveredResourcesRequest PutConfigRuleRequest(*configservice.PutConfigRuleInput) configservice.PutConfigRuleRequest diff --git a/service/costandusagereportservice/api.go b/service/costandusagereportservice/api.go index 48f20388be8..088d9f281d0 100644 --- a/service/costandusagereportservice/api.go +++ b/service/costandusagereportservice/api.go @@ -13,6 +13,7 @@ const opDeleteReportDefinition = "DeleteReportDefinition" type DeleteReportDefinitionRequest struct { *aws.Request Input *DeleteReportDefinitionInput + Copy func(*DeleteReportDefinitionInput) DeleteReportDefinitionRequest } // Send marshals and sends the DeleteReportDefinition API request. @@ -53,7 +54,7 @@ func (c *CostAndUsageReportService) DeleteReportDefinitionRequest(input *DeleteR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReportDefinitionRequest{Request: req, Input: input} + return DeleteReportDefinitionRequest{Request: req, Input: input, Copy: c.DeleteReportDefinitionRequest} } const opDescribeReportDefinitions = "DescribeReportDefinitions" @@ -62,6 +63,7 @@ const opDescribeReportDefinitions = "DescribeReportDefinitions" type DescribeReportDefinitionsRequest struct { *aws.Request Input *DescribeReportDefinitionsInput + Copy func(*DescribeReportDefinitionsInput) DescribeReportDefinitionsRequest } // Send marshals and sends the DescribeReportDefinitions API request. @@ -108,57 +110,53 @@ func (c *CostAndUsageReportService) DescribeReportDefinitionsRequest(input *Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReportDefinitionsRequest{Request: req, Input: input} + return DescribeReportDefinitionsRequest{Request: req, Input: input, Copy: c.DescribeReportDefinitionsRequest} } -// DescribeReportDefinitionsPages iterates over the pages of a DescribeReportDefinitions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReportDefinitions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReportDefinitionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReportDefinitions operation. -// pageNum := 0 -// err := client.DescribeReportDefinitionsPages(params, -// func(page *DescribeReportDefinitionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.DescribeReportDefinitionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *CostAndUsageReportService) DescribeReportDefinitionsPages(input *DescribeReportDefinitionsInput, fn func(*DescribeReportDefinitionsOutput, bool) bool) error { - return c.DescribeReportDefinitionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReportDefinitionsPagesWithContext same as DescribeReportDefinitionsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CostAndUsageReportService) DescribeReportDefinitionsPagesWithContext(ctx aws.Context, input *DescribeReportDefinitionsInput, fn func(*DescribeReportDefinitionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReportDefinitionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReportDefinitionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *DescribeReportDefinitionsRequest) Paginate(opts ...aws.Option) DescribeReportDefinitionsPager { + return DescribeReportDefinitionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReportDefinitionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReportDefinitionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReportDefinitionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReportDefinitionsPager struct { + aws.Pager +} + +func (p *DescribeReportDefinitionsPager) CurrentPage() *DescribeReportDefinitionsOutput { + return p.Pager.CurrentPage().(*DescribeReportDefinitionsOutput) } const opPutReportDefinition = "PutReportDefinition" @@ -167,6 +165,7 @@ const opPutReportDefinition = "PutReportDefinition" type PutReportDefinitionRequest struct { *aws.Request Input *PutReportDefinitionInput + Copy func(*PutReportDefinitionInput) PutReportDefinitionRequest } // Send marshals and sends the PutReportDefinition API request. @@ -207,7 +206,7 @@ func (c *CostAndUsageReportService) PutReportDefinitionRequest(input *PutReportD req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutReportDefinitionRequest{Request: req, Input: input} + return PutReportDefinitionRequest{Request: req, Input: input, Copy: c.PutReportDefinitionRequest} } // Request of DeleteReportDefinition diff --git a/service/costandusagereportservice/costandusagereportserviceiface/interface.go b/service/costandusagereportservice/costandusagereportserviceiface/interface.go index 38e437993e7..6fa75e24089 100644 --- a/service/costandusagereportservice/costandusagereportserviceiface/interface.go +++ b/service/costandusagereportservice/costandusagereportserviceiface/interface.go @@ -9,7 +9,6 @@ package costandusagereportserviceiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/costandusagereportservice" ) @@ -67,9 +66,6 @@ type CostAndUsageReportServiceAPI interface { DescribeReportDefinitionsRequest(*costandusagereportservice.DescribeReportDefinitionsInput) costandusagereportservice.DescribeReportDefinitionsRequest - DescribeReportDefinitionsPages(*costandusagereportservice.DescribeReportDefinitionsInput, func(*costandusagereportservice.DescribeReportDefinitionsOutput, bool) bool) error - DescribeReportDefinitionsPagesWithContext(aws.Context, *costandusagereportservice.DescribeReportDefinitionsInput, func(*costandusagereportservice.DescribeReportDefinitionsOutput, bool) bool, ...aws.Option) error - PutReportDefinitionRequest(*costandusagereportservice.PutReportDefinitionInput) costandusagereportservice.PutReportDefinitionRequest } diff --git a/service/costexplorer/api.go b/service/costexplorer/api.go index 06151137a93..69fc3c2f16f 100644 --- a/service/costexplorer/api.go +++ b/service/costexplorer/api.go @@ -13,6 +13,7 @@ const opGetCostAndUsage = "GetCostAndUsage" type GetCostAndUsageRequest struct { *aws.Request Input *GetCostAndUsageInput + Copy func(*GetCostAndUsageInput) GetCostAndUsageRequest } // Send marshals and sends the GetCostAndUsage API request. @@ -58,7 +59,7 @@ func (c *CostExplorer) GetCostAndUsageRequest(input *GetCostAndUsageInput) GetCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCostAndUsageRequest{Request: req, Input: input} + return GetCostAndUsageRequest{Request: req, Input: input, Copy: c.GetCostAndUsageRequest} } const opGetDimensionValues = "GetDimensionValues" @@ -67,6 +68,7 @@ const opGetDimensionValues = "GetDimensionValues" type GetDimensionValuesRequest struct { *aws.Request Input *GetDimensionValuesInput + Copy func(*GetDimensionValuesInput) GetDimensionValuesRequest } // Send marshals and sends the GetDimensionValues API request. @@ -109,7 +111,7 @@ func (c *CostExplorer) GetDimensionValuesRequest(input *GetDimensionValuesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDimensionValuesRequest{Request: req, Input: input} + return GetDimensionValuesRequest{Request: req, Input: input, Copy: c.GetDimensionValuesRequest} } const opGetReservationUtilization = "GetReservationUtilization" @@ -118,6 +120,7 @@ const opGetReservationUtilization = "GetReservationUtilization" type GetReservationUtilizationRequest struct { *aws.Request Input *GetReservationUtilizationInput + Copy func(*GetReservationUtilizationInput) GetReservationUtilizationRequest } // Send marshals and sends the GetReservationUtilization API request. @@ -162,7 +165,7 @@ func (c *CostExplorer) GetReservationUtilizationRequest(input *GetReservationUti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetReservationUtilizationRequest{Request: req, Input: input} + return GetReservationUtilizationRequest{Request: req, Input: input, Copy: c.GetReservationUtilizationRequest} } const opGetTags = "GetTags" @@ -171,6 +174,7 @@ const opGetTags = "GetTags" type GetTagsRequest struct { *aws.Request Input *GetTagsInput + Copy func(*GetTagsInput) GetTagsRequest } // Send marshals and sends the GetTags API request. @@ -212,7 +216,7 @@ func (c *CostExplorer) GetTagsRequest(input *GetTagsInput) GetTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTagsRequest{Request: req, Input: input} + return GetTagsRequest{Request: req, Input: input, Copy: c.GetTagsRequest} } // The time period that you want the usage and costs for. diff --git a/service/databasemigrationservice/api.go b/service/databasemigrationservice/api.go index 20a8f505453..9d4927ae1fa 100644 --- a/service/databasemigrationservice/api.go +++ b/service/databasemigrationservice/api.go @@ -16,6 +16,7 @@ const opAddTagsToResource = "AddTagsToResource" type AddTagsToResourceRequest struct { *aws.Request Input *AddTagsToResourceInput + Copy func(*AddTagsToResourceInput) AddTagsToResourceRequest } // Send marshals and sends the AddTagsToResource API request. @@ -59,7 +60,7 @@ func (c *DatabaseMigrationService) AddTagsToResourceRequest(input *AddTagsToReso req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsToResourceRequest{Request: req, Input: input} + return AddTagsToResourceRequest{Request: req, Input: input, Copy: c.AddTagsToResourceRequest} } const opCreateEndpoint = "CreateEndpoint" @@ -68,6 +69,7 @@ const opCreateEndpoint = "CreateEndpoint" type CreateEndpointRequest struct { *aws.Request Input *CreateEndpointInput + Copy func(*CreateEndpointInput) CreateEndpointRequest } // Send marshals and sends the CreateEndpoint API request. @@ -108,7 +110,7 @@ func (c *DatabaseMigrationService) CreateEndpointRequest(input *CreateEndpointIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEndpointRequest{Request: req, Input: input} + return CreateEndpointRequest{Request: req, Input: input, Copy: c.CreateEndpointRequest} } const opCreateEventSubscription = "CreateEventSubscription" @@ -117,6 +119,7 @@ const opCreateEventSubscription = "CreateEventSubscription" type CreateEventSubscriptionRequest struct { *aws.Request Input *CreateEventSubscriptionInput + Copy func(*CreateEventSubscriptionInput) CreateEventSubscriptionRequest } // Send marshals and sends the CreateEventSubscription API request. @@ -173,7 +176,7 @@ func (c *DatabaseMigrationService) CreateEventSubscriptionRequest(input *CreateE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEventSubscriptionRequest{Request: req, Input: input} + return CreateEventSubscriptionRequest{Request: req, Input: input, Copy: c.CreateEventSubscriptionRequest} } const opCreateReplicationInstance = "CreateReplicationInstance" @@ -182,6 +185,7 @@ const opCreateReplicationInstance = "CreateReplicationInstance" type CreateReplicationInstanceRequest struct { *aws.Request Input *CreateReplicationInstanceInput + Copy func(*CreateReplicationInstanceInput) CreateReplicationInstanceRequest } // Send marshals and sends the CreateReplicationInstance API request. @@ -222,7 +226,7 @@ func (c *DatabaseMigrationService) CreateReplicationInstanceRequest(input *Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReplicationInstanceRequest{Request: req, Input: input} + return CreateReplicationInstanceRequest{Request: req, Input: input, Copy: c.CreateReplicationInstanceRequest} } const opCreateReplicationSubnetGroup = "CreateReplicationSubnetGroup" @@ -231,6 +235,7 @@ const opCreateReplicationSubnetGroup = "CreateReplicationSubnetGroup" type CreateReplicationSubnetGroupRequest struct { *aws.Request Input *CreateReplicationSubnetGroupInput + Copy func(*CreateReplicationSubnetGroupInput) CreateReplicationSubnetGroupRequest } // Send marshals and sends the CreateReplicationSubnetGroup API request. @@ -271,7 +276,7 @@ func (c *DatabaseMigrationService) CreateReplicationSubnetGroupRequest(input *Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReplicationSubnetGroupRequest{Request: req, Input: input} + return CreateReplicationSubnetGroupRequest{Request: req, Input: input, Copy: c.CreateReplicationSubnetGroupRequest} } const opCreateReplicationTask = "CreateReplicationTask" @@ -280,6 +285,7 @@ const opCreateReplicationTask = "CreateReplicationTask" type CreateReplicationTaskRequest struct { *aws.Request Input *CreateReplicationTaskInput + Copy func(*CreateReplicationTaskInput) CreateReplicationTaskRequest } // Send marshals and sends the CreateReplicationTask API request. @@ -320,7 +326,7 @@ func (c *DatabaseMigrationService) CreateReplicationTaskRequest(input *CreateRep req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReplicationTaskRequest{Request: req, Input: input} + return CreateReplicationTaskRequest{Request: req, Input: input, Copy: c.CreateReplicationTaskRequest} } const opDeleteCertificate = "DeleteCertificate" @@ -329,6 +335,7 @@ const opDeleteCertificate = "DeleteCertificate" type DeleteCertificateRequest struct { *aws.Request Input *DeleteCertificateInput + Copy func(*DeleteCertificateInput) DeleteCertificateRequest } // Send marshals and sends the DeleteCertificate API request. @@ -369,7 +376,7 @@ func (c *DatabaseMigrationService) DeleteCertificateRequest(input *DeleteCertifi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteCertificateRequest{Request: req, Input: input} + return DeleteCertificateRequest{Request: req, Input: input, Copy: c.DeleteCertificateRequest} } const opDeleteEndpoint = "DeleteEndpoint" @@ -378,6 +385,7 @@ const opDeleteEndpoint = "DeleteEndpoint" type DeleteEndpointRequest struct { *aws.Request Input *DeleteEndpointInput + Copy func(*DeleteEndpointInput) DeleteEndpointRequest } // Send marshals and sends the DeleteEndpoint API request. @@ -421,7 +429,7 @@ func (c *DatabaseMigrationService) DeleteEndpointRequest(input *DeleteEndpointIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEndpointRequest{Request: req, Input: input} + return DeleteEndpointRequest{Request: req, Input: input, Copy: c.DeleteEndpointRequest} } const opDeleteEventSubscription = "DeleteEventSubscription" @@ -430,6 +438,7 @@ const opDeleteEventSubscription = "DeleteEventSubscription" type DeleteEventSubscriptionRequest struct { *aws.Request Input *DeleteEventSubscriptionInput + Copy func(*DeleteEventSubscriptionInput) DeleteEventSubscriptionRequest } // Send marshals and sends the DeleteEventSubscription API request. @@ -470,7 +479,7 @@ func (c *DatabaseMigrationService) DeleteEventSubscriptionRequest(input *DeleteE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEventSubscriptionRequest{Request: req, Input: input} + return DeleteEventSubscriptionRequest{Request: req, Input: input, Copy: c.DeleteEventSubscriptionRequest} } const opDeleteReplicationInstance = "DeleteReplicationInstance" @@ -479,6 +488,7 @@ const opDeleteReplicationInstance = "DeleteReplicationInstance" type DeleteReplicationInstanceRequest struct { *aws.Request Input *DeleteReplicationInstanceInput + Copy func(*DeleteReplicationInstanceInput) DeleteReplicationInstanceRequest } // Send marshals and sends the DeleteReplicationInstance API request. @@ -522,7 +532,7 @@ func (c *DatabaseMigrationService) DeleteReplicationInstanceRequest(input *Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReplicationInstanceRequest{Request: req, Input: input} + return DeleteReplicationInstanceRequest{Request: req, Input: input, Copy: c.DeleteReplicationInstanceRequest} } const opDeleteReplicationSubnetGroup = "DeleteReplicationSubnetGroup" @@ -531,6 +541,7 @@ const opDeleteReplicationSubnetGroup = "DeleteReplicationSubnetGroup" type DeleteReplicationSubnetGroupRequest struct { *aws.Request Input *DeleteReplicationSubnetGroupInput + Copy func(*DeleteReplicationSubnetGroupInput) DeleteReplicationSubnetGroupRequest } // Send marshals and sends the DeleteReplicationSubnetGroup API request. @@ -571,7 +582,7 @@ func (c *DatabaseMigrationService) DeleteReplicationSubnetGroupRequest(input *De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReplicationSubnetGroupRequest{Request: req, Input: input} + return DeleteReplicationSubnetGroupRequest{Request: req, Input: input, Copy: c.DeleteReplicationSubnetGroupRequest} } const opDeleteReplicationTask = "DeleteReplicationTask" @@ -580,6 +591,7 @@ const opDeleteReplicationTask = "DeleteReplicationTask" type DeleteReplicationTaskRequest struct { *aws.Request Input *DeleteReplicationTaskInput + Copy func(*DeleteReplicationTaskInput) DeleteReplicationTaskRequest } // Send marshals and sends the DeleteReplicationTask API request. @@ -620,7 +632,7 @@ func (c *DatabaseMigrationService) DeleteReplicationTaskRequest(input *DeleteRep req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReplicationTaskRequest{Request: req, Input: input} + return DeleteReplicationTaskRequest{Request: req, Input: input, Copy: c.DeleteReplicationTaskRequest} } const opDescribeAccountAttributes = "DescribeAccountAttributes" @@ -629,6 +641,7 @@ const opDescribeAccountAttributes = "DescribeAccountAttributes" type DescribeAccountAttributesRequest struct { *aws.Request Input *DescribeAccountAttributesInput + Copy func(*DescribeAccountAttributesInput) DescribeAccountAttributesRequest } // Send marshals and sends the DescribeAccountAttributes API request. @@ -674,7 +687,7 @@ func (c *DatabaseMigrationService) DescribeAccountAttributesRequest(input *Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAccountAttributesRequest{Request: req, Input: input} + return DescribeAccountAttributesRequest{Request: req, Input: input, Copy: c.DescribeAccountAttributesRequest} } const opDescribeCertificates = "DescribeCertificates" @@ -683,6 +696,7 @@ const opDescribeCertificates = "DescribeCertificates" type DescribeCertificatesRequest struct { *aws.Request Input *DescribeCertificatesInput + Copy func(*DescribeCertificatesInput) DescribeCertificatesRequest } // Send marshals and sends the DescribeCertificates API request. @@ -729,57 +743,53 @@ func (c *DatabaseMigrationService) DescribeCertificatesRequest(input *DescribeCe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCertificatesRequest{Request: req, Input: input} + return DescribeCertificatesRequest{Request: req, Input: input, Copy: c.DescribeCertificatesRequest} } -// DescribeCertificatesPages iterates over the pages of a DescribeCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCertificates method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeCertificatesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCertificates operation. -// pageNum := 0 -// err := client.DescribeCertificatesPages(params, -// func(page *DescribeCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeCertificatesPages(input *DescribeCertificatesInput, fn func(*DescribeCertificatesOutput, bool) bool) error { - return c.DescribeCertificatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeCertificatesPagesWithContext same as DescribeCertificatesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeCertificatesPagesWithContext(ctx aws.Context, input *DescribeCertificatesInput, fn func(*DescribeCertificatesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeCertificatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeCertificatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeCertificatesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeCertificatesRequest) Paginate(opts ...aws.Option) DescribeCertificatesPager { + return DescribeCertificatesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeCertificatesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCertificatesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeCertificatesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeCertificatesPager struct { + aws.Pager +} + +func (p *DescribeCertificatesPager) CurrentPage() *DescribeCertificatesOutput { + return p.Pager.CurrentPage().(*DescribeCertificatesOutput) } const opDescribeConnections = "DescribeConnections" @@ -788,6 +798,7 @@ const opDescribeConnections = "DescribeConnections" type DescribeConnectionsRequest struct { *aws.Request Input *DescribeConnectionsInput + Copy func(*DescribeConnectionsInput) DescribeConnectionsRequest } // Send marshals and sends the DescribeConnections API request. @@ -835,57 +846,53 @@ func (c *DatabaseMigrationService) DescribeConnectionsRequest(input *DescribeCon req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConnectionsRequest{Request: req, Input: input} + return DescribeConnectionsRequest{Request: req, Input: input, Copy: c.DescribeConnectionsRequest} } -// DescribeConnectionsPages iterates over the pages of a DescribeConnections operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeConnections method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeConnectionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeConnections operation. -// pageNum := 0 -// err := client.DescribeConnectionsPages(params, -// func(page *DescribeConnectionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeConnectionsPages(input *DescribeConnectionsInput, fn func(*DescribeConnectionsOutput, bool) bool) error { - return c.DescribeConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeConnectionsPagesWithContext same as DescribeConnectionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeConnectionsPagesWithContext(ctx aws.Context, input *DescribeConnectionsInput, fn func(*DescribeConnectionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeConnectionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeConnectionsRequest) Paginate(opts ...aws.Option) DescribeConnectionsPager { + return DescribeConnectionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeConnectionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeConnectionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeConnectionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeConnectionsPager struct { + aws.Pager +} + +func (p *DescribeConnectionsPager) CurrentPage() *DescribeConnectionsOutput { + return p.Pager.CurrentPage().(*DescribeConnectionsOutput) } const opDescribeEndpointTypes = "DescribeEndpointTypes" @@ -894,6 +901,7 @@ const opDescribeEndpointTypes = "DescribeEndpointTypes" type DescribeEndpointTypesRequest struct { *aws.Request Input *DescribeEndpointTypesInput + Copy func(*DescribeEndpointTypesInput) DescribeEndpointTypesRequest } // Send marshals and sends the DescribeEndpointTypes API request. @@ -940,57 +948,53 @@ func (c *DatabaseMigrationService) DescribeEndpointTypesRequest(input *DescribeE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEndpointTypesRequest{Request: req, Input: input} + return DescribeEndpointTypesRequest{Request: req, Input: input, Copy: c.DescribeEndpointTypesRequest} } -// DescribeEndpointTypesPages iterates over the pages of a DescribeEndpointTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEndpointTypes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEndpointTypesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEndpointTypes operation. -// pageNum := 0 -// err := client.DescribeEndpointTypesPages(params, -// func(page *DescribeEndpointTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeEndpointTypesPages(input *DescribeEndpointTypesInput, fn func(*DescribeEndpointTypesOutput, bool) bool) error { - return c.DescribeEndpointTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEndpointTypesPagesWithContext same as DescribeEndpointTypesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeEndpointTypesPagesWithContext(ctx aws.Context, input *DescribeEndpointTypesInput, fn func(*DescribeEndpointTypesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEndpointTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEndpointTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEndpointTypesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEndpointTypesRequest) Paginate(opts ...aws.Option) DescribeEndpointTypesPager { + return DescribeEndpointTypesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEndpointTypesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEndpointTypesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEndpointTypesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEndpointTypesPager struct { + aws.Pager +} + +func (p *DescribeEndpointTypesPager) CurrentPage() *DescribeEndpointTypesOutput { + return p.Pager.CurrentPage().(*DescribeEndpointTypesOutput) } const opDescribeEndpoints = "DescribeEndpoints" @@ -999,6 +1003,7 @@ const opDescribeEndpoints = "DescribeEndpoints" type DescribeEndpointsRequest struct { *aws.Request Input *DescribeEndpointsInput + Copy func(*DescribeEndpointsInput) DescribeEndpointsRequest } // Send marshals and sends the DescribeEndpoints API request. @@ -1045,57 +1050,53 @@ func (c *DatabaseMigrationService) DescribeEndpointsRequest(input *DescribeEndpo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEndpointsRequest{Request: req, Input: input} + return DescribeEndpointsRequest{Request: req, Input: input, Copy: c.DescribeEndpointsRequest} } -// DescribeEndpointsPages iterates over the pages of a DescribeEndpoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEndpoints method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEndpointsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEndpoints operation. -// pageNum := 0 -// err := client.DescribeEndpointsPages(params, -// func(page *DescribeEndpointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeEndpointsPages(input *DescribeEndpointsInput, fn func(*DescribeEndpointsOutput, bool) bool) error { - return c.DescribeEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEndpointsPagesWithContext same as DescribeEndpointsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeEndpointsPagesWithContext(ctx aws.Context, input *DescribeEndpointsInput, fn func(*DescribeEndpointsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEndpointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEndpointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEndpointsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEndpointsRequest) Paginate(opts ...aws.Option) DescribeEndpointsPager { + return DescribeEndpointsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEndpointsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEndpointsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEndpointsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEndpointsPager struct { + aws.Pager +} + +func (p *DescribeEndpointsPager) CurrentPage() *DescribeEndpointsOutput { + return p.Pager.CurrentPage().(*DescribeEndpointsOutput) } const opDescribeEventCategories = "DescribeEventCategories" @@ -1104,6 +1105,7 @@ const opDescribeEventCategories = "DescribeEventCategories" type DescribeEventCategoriesRequest struct { *aws.Request Input *DescribeEventCategoriesInput + Copy func(*DescribeEventCategoriesInput) DescribeEventCategoriesRequest } // Send marshals and sends the DescribeEventCategories API request. @@ -1147,7 +1149,7 @@ func (c *DatabaseMigrationService) DescribeEventCategoriesRequest(input *Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventCategoriesRequest{Request: req, Input: input} + return DescribeEventCategoriesRequest{Request: req, Input: input, Copy: c.DescribeEventCategoriesRequest} } const opDescribeEventSubscriptions = "DescribeEventSubscriptions" @@ -1156,6 +1158,7 @@ const opDescribeEventSubscriptions = "DescribeEventSubscriptions" type DescribeEventSubscriptionsRequest struct { *aws.Request Input *DescribeEventSubscriptionsInput + Copy func(*DescribeEventSubscriptionsInput) DescribeEventSubscriptionsRequest } // Send marshals and sends the DescribeEventSubscriptions API request. @@ -1207,57 +1210,53 @@ func (c *DatabaseMigrationService) DescribeEventSubscriptionsRequest(input *Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventSubscriptionsRequest{Request: req, Input: input} + return DescribeEventSubscriptionsRequest{Request: req, Input: input, Copy: c.DescribeEventSubscriptionsRequest} } -// DescribeEventSubscriptionsPages iterates over the pages of a DescribeEventSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEventSubscriptions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventSubscriptionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEventSubscriptions operation. -// pageNum := 0 -// err := client.DescribeEventSubscriptionsPages(params, -// func(page *DescribeEventSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeEventSubscriptionsPages(input *DescribeEventSubscriptionsInput, fn func(*DescribeEventSubscriptionsOutput, bool) bool) error { - return c.DescribeEventSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventSubscriptionsPagesWithContext same as DescribeEventSubscriptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeEventSubscriptionsPagesWithContext(ctx aws.Context, input *DescribeEventSubscriptionsInput, fn func(*DescribeEventSubscriptionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventSubscriptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventSubscriptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEventSubscriptionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEventSubscriptionsRequest) Paginate(opts ...aws.Option) DescribeEventSubscriptionsPager { + return DescribeEventSubscriptionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventSubscriptionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventSubscriptionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventSubscriptionsPager struct { + aws.Pager +} + +func (p *DescribeEventSubscriptionsPager) CurrentPage() *DescribeEventSubscriptionsOutput { + return p.Pager.CurrentPage().(*DescribeEventSubscriptionsOutput) } const opDescribeEvents = "DescribeEvents" @@ -1266,6 +1265,7 @@ const opDescribeEvents = "DescribeEvents" type DescribeEventsRequest struct { *aws.Request Input *DescribeEventsInput + Copy func(*DescribeEventsInput) DescribeEventsRequest } // Send marshals and sends the DescribeEvents API request. @@ -1314,57 +1314,53 @@ func (c *DatabaseMigrationService) DescribeEventsRequest(input *DescribeEventsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventsRequest{Request: req, Input: input} + return DescribeEventsRequest{Request: req, Input: input, Copy: c.DescribeEventsRequest} } -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeEventsPages(input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool) error { - return c.DescribeEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventsPagesWithContext same as DescribeEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeEventsPagesWithContext(ctx aws.Context, input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEventsRequest) Paginate(opts ...aws.Option) DescribeEventsPager { + return DescribeEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventsPager struct { + aws.Pager +} + +func (p *DescribeEventsPager) CurrentPage() *DescribeEventsOutput { + return p.Pager.CurrentPage().(*DescribeEventsOutput) } const opDescribeOrderableReplicationInstances = "DescribeOrderableReplicationInstances" @@ -1373,6 +1369,7 @@ const opDescribeOrderableReplicationInstances = "DescribeOrderableReplicationIns type DescribeOrderableReplicationInstancesRequest struct { *aws.Request Input *DescribeOrderableReplicationInstancesInput + Copy func(*DescribeOrderableReplicationInstancesInput) DescribeOrderableReplicationInstancesRequest } // Send marshals and sends the DescribeOrderableReplicationInstances API request. @@ -1420,57 +1417,53 @@ func (c *DatabaseMigrationService) DescribeOrderableReplicationInstancesRequest( req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeOrderableReplicationInstancesRequest{Request: req, Input: input} + return DescribeOrderableReplicationInstancesRequest{Request: req, Input: input, Copy: c.DescribeOrderableReplicationInstancesRequest} } -// DescribeOrderableReplicationInstancesPages iterates over the pages of a DescribeOrderableReplicationInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeOrderableReplicationInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeOrderableReplicationInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeOrderableReplicationInstances operation. -// pageNum := 0 -// err := client.DescribeOrderableReplicationInstancesPages(params, -// func(page *DescribeOrderableReplicationInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeOrderableReplicationInstancesPages(input *DescribeOrderableReplicationInstancesInput, fn func(*DescribeOrderableReplicationInstancesOutput, bool) bool) error { - return c.DescribeOrderableReplicationInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeOrderableReplicationInstancesPagesWithContext same as DescribeOrderableReplicationInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeOrderableReplicationInstancesPagesWithContext(ctx aws.Context, input *DescribeOrderableReplicationInstancesInput, fn func(*DescribeOrderableReplicationInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeOrderableReplicationInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeOrderableReplicationInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeOrderableReplicationInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeOrderableReplicationInstancesRequest) Paginate(opts ...aws.Option) DescribeOrderableReplicationInstancesPager { + return DescribeOrderableReplicationInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeOrderableReplicationInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOrderableReplicationInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeOrderableReplicationInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeOrderableReplicationInstancesPager struct { + aws.Pager +} + +func (p *DescribeOrderableReplicationInstancesPager) CurrentPage() *DescribeOrderableReplicationInstancesOutput { + return p.Pager.CurrentPage().(*DescribeOrderableReplicationInstancesOutput) } const opDescribeRefreshSchemasStatus = "DescribeRefreshSchemasStatus" @@ -1479,6 +1472,7 @@ const opDescribeRefreshSchemasStatus = "DescribeRefreshSchemasStatus" type DescribeRefreshSchemasStatusRequest struct { *aws.Request Input *DescribeRefreshSchemasStatusInput + Copy func(*DescribeRefreshSchemasStatusInput) DescribeRefreshSchemasStatusRequest } // Send marshals and sends the DescribeRefreshSchemasStatus API request. @@ -1519,7 +1513,7 @@ func (c *DatabaseMigrationService) DescribeRefreshSchemasStatusRequest(input *De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRefreshSchemasStatusRequest{Request: req, Input: input} + return DescribeRefreshSchemasStatusRequest{Request: req, Input: input, Copy: c.DescribeRefreshSchemasStatusRequest} } const opDescribeReplicationInstances = "DescribeReplicationInstances" @@ -1528,6 +1522,7 @@ const opDescribeReplicationInstances = "DescribeReplicationInstances" type DescribeReplicationInstancesRequest struct { *aws.Request Input *DescribeReplicationInstancesInput + Copy func(*DescribeReplicationInstancesInput) DescribeReplicationInstancesRequest } // Send marshals and sends the DescribeReplicationInstances API request. @@ -1575,57 +1570,53 @@ func (c *DatabaseMigrationService) DescribeReplicationInstancesRequest(input *De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReplicationInstancesRequest{Request: req, Input: input} + return DescribeReplicationInstancesRequest{Request: req, Input: input, Copy: c.DescribeReplicationInstancesRequest} } -// DescribeReplicationInstancesPages iterates over the pages of a DescribeReplicationInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReplicationInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReplicationInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReplicationInstances operation. -// pageNum := 0 -// err := client.DescribeReplicationInstancesPages(params, -// func(page *DescribeReplicationInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeReplicationInstancesPages(input *DescribeReplicationInstancesInput, fn func(*DescribeReplicationInstancesOutput, bool) bool) error { - return c.DescribeReplicationInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReplicationInstancesPagesWithContext same as DescribeReplicationInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeReplicationInstancesPagesWithContext(ctx aws.Context, input *DescribeReplicationInstancesInput, fn func(*DescribeReplicationInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReplicationInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReplicationInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReplicationInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReplicationInstancesRequest) Paginate(opts ...aws.Option) DescribeReplicationInstancesPager { + return DescribeReplicationInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReplicationInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReplicationInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReplicationInstancesPager struct { + aws.Pager +} + +func (p *DescribeReplicationInstancesPager) CurrentPage() *DescribeReplicationInstancesOutput { + return p.Pager.CurrentPage().(*DescribeReplicationInstancesOutput) } const opDescribeReplicationSubnetGroups = "DescribeReplicationSubnetGroups" @@ -1634,6 +1625,7 @@ const opDescribeReplicationSubnetGroups = "DescribeReplicationSubnetGroups" type DescribeReplicationSubnetGroupsRequest struct { *aws.Request Input *DescribeReplicationSubnetGroupsInput + Copy func(*DescribeReplicationSubnetGroupsInput) DescribeReplicationSubnetGroupsRequest } // Send marshals and sends the DescribeReplicationSubnetGroups API request. @@ -1680,57 +1672,53 @@ func (c *DatabaseMigrationService) DescribeReplicationSubnetGroupsRequest(input req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReplicationSubnetGroupsRequest{Request: req, Input: input} + return DescribeReplicationSubnetGroupsRequest{Request: req, Input: input, Copy: c.DescribeReplicationSubnetGroupsRequest} } -// DescribeReplicationSubnetGroupsPages iterates over the pages of a DescribeReplicationSubnetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReplicationSubnetGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReplicationSubnetGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReplicationSubnetGroups operation. -// pageNum := 0 -// err := client.DescribeReplicationSubnetGroupsPages(params, -// func(page *DescribeReplicationSubnetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeReplicationSubnetGroupsPages(input *DescribeReplicationSubnetGroupsInput, fn func(*DescribeReplicationSubnetGroupsOutput, bool) bool) error { - return c.DescribeReplicationSubnetGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReplicationSubnetGroupsPagesWithContext same as DescribeReplicationSubnetGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeReplicationSubnetGroupsPagesWithContext(ctx aws.Context, input *DescribeReplicationSubnetGroupsInput, fn func(*DescribeReplicationSubnetGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReplicationSubnetGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReplicationSubnetGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReplicationSubnetGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReplicationSubnetGroupsRequest) Paginate(opts ...aws.Option) DescribeReplicationSubnetGroupsPager { + return DescribeReplicationSubnetGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReplicationSubnetGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationSubnetGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReplicationSubnetGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReplicationSubnetGroupsPager struct { + aws.Pager +} + +func (p *DescribeReplicationSubnetGroupsPager) CurrentPage() *DescribeReplicationSubnetGroupsOutput { + return p.Pager.CurrentPage().(*DescribeReplicationSubnetGroupsOutput) } const opDescribeReplicationTaskAssessmentResults = "DescribeReplicationTaskAssessmentResults" @@ -1739,6 +1727,7 @@ const opDescribeReplicationTaskAssessmentResults = "DescribeReplicationTaskAsses type DescribeReplicationTaskAssessmentResultsRequest struct { *aws.Request Input *DescribeReplicationTaskAssessmentResultsInput + Copy func(*DescribeReplicationTaskAssessmentResultsInput) DescribeReplicationTaskAssessmentResultsRequest } // Send marshals and sends the DescribeReplicationTaskAssessmentResults API request. @@ -1786,57 +1775,53 @@ func (c *DatabaseMigrationService) DescribeReplicationTaskAssessmentResultsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReplicationTaskAssessmentResultsRequest{Request: req, Input: input} + return DescribeReplicationTaskAssessmentResultsRequest{Request: req, Input: input, Copy: c.DescribeReplicationTaskAssessmentResultsRequest} } -// DescribeReplicationTaskAssessmentResultsPages iterates over the pages of a DescribeReplicationTaskAssessmentResults operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReplicationTaskAssessmentResults method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReplicationTaskAssessmentResultsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReplicationTaskAssessmentResults operation. -// pageNum := 0 -// err := client.DescribeReplicationTaskAssessmentResultsPages(params, -// func(page *DescribeReplicationTaskAssessmentResultsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeReplicationTaskAssessmentResultsPages(input *DescribeReplicationTaskAssessmentResultsInput, fn func(*DescribeReplicationTaskAssessmentResultsOutput, bool) bool) error { - return c.DescribeReplicationTaskAssessmentResultsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReplicationTaskAssessmentResultsPagesWithContext same as DescribeReplicationTaskAssessmentResultsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeReplicationTaskAssessmentResultsPagesWithContext(ctx aws.Context, input *DescribeReplicationTaskAssessmentResultsInput, fn func(*DescribeReplicationTaskAssessmentResultsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReplicationTaskAssessmentResultsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReplicationTaskAssessmentResultsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReplicationTaskAssessmentResultsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReplicationTaskAssessmentResultsRequest) Paginate(opts ...aws.Option) DescribeReplicationTaskAssessmentResultsPager { + return DescribeReplicationTaskAssessmentResultsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReplicationTaskAssessmentResultsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationTaskAssessmentResultsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReplicationTaskAssessmentResultsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReplicationTaskAssessmentResultsPager struct { + aws.Pager +} + +func (p *DescribeReplicationTaskAssessmentResultsPager) CurrentPage() *DescribeReplicationTaskAssessmentResultsOutput { + return p.Pager.CurrentPage().(*DescribeReplicationTaskAssessmentResultsOutput) } const opDescribeReplicationTasks = "DescribeReplicationTasks" @@ -1845,6 +1830,7 @@ const opDescribeReplicationTasks = "DescribeReplicationTasks" type DescribeReplicationTasksRequest struct { *aws.Request Input *DescribeReplicationTasksInput + Copy func(*DescribeReplicationTasksInput) DescribeReplicationTasksRequest } // Send marshals and sends the DescribeReplicationTasks API request. @@ -1892,57 +1878,53 @@ func (c *DatabaseMigrationService) DescribeReplicationTasksRequest(input *Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReplicationTasksRequest{Request: req, Input: input} + return DescribeReplicationTasksRequest{Request: req, Input: input, Copy: c.DescribeReplicationTasksRequest} } -// DescribeReplicationTasksPages iterates over the pages of a DescribeReplicationTasks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReplicationTasks method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReplicationTasksRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReplicationTasks operation. -// pageNum := 0 -// err := client.DescribeReplicationTasksPages(params, -// func(page *DescribeReplicationTasksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeReplicationTasksPages(input *DescribeReplicationTasksInput, fn func(*DescribeReplicationTasksOutput, bool) bool) error { - return c.DescribeReplicationTasksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReplicationTasksPagesWithContext same as DescribeReplicationTasksPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeReplicationTasksPagesWithContext(ctx aws.Context, input *DescribeReplicationTasksInput, fn func(*DescribeReplicationTasksOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReplicationTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReplicationTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReplicationTasksRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReplicationTasksRequest) Paginate(opts ...aws.Option) DescribeReplicationTasksPager { + return DescribeReplicationTasksPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReplicationTasksInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationTasksOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReplicationTasksPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReplicationTasksPager struct { + aws.Pager +} + +func (p *DescribeReplicationTasksPager) CurrentPage() *DescribeReplicationTasksOutput { + return p.Pager.CurrentPage().(*DescribeReplicationTasksOutput) } const opDescribeSchemas = "DescribeSchemas" @@ -1951,6 +1933,7 @@ const opDescribeSchemas = "DescribeSchemas" type DescribeSchemasRequest struct { *aws.Request Input *DescribeSchemasInput + Copy func(*DescribeSchemasInput) DescribeSchemasRequest } // Send marshals and sends the DescribeSchemas API request. @@ -1997,57 +1980,53 @@ func (c *DatabaseMigrationService) DescribeSchemasRequest(input *DescribeSchemas req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSchemasRequest{Request: req, Input: input} + return DescribeSchemasRequest{Request: req, Input: input, Copy: c.DescribeSchemasRequest} } -// DescribeSchemasPages iterates over the pages of a DescribeSchemas operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSchemas method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeSchemasRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeSchemas operation. -// pageNum := 0 -// err := client.DescribeSchemasPages(params, -// func(page *DescribeSchemasOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeSchemasPages(input *DescribeSchemasInput, fn func(*DescribeSchemasOutput, bool) bool) error { - return c.DescribeSchemasPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSchemasPagesWithContext same as DescribeSchemasPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeSchemasPagesWithContext(ctx aws.Context, input *DescribeSchemasInput, fn func(*DescribeSchemasOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeSchemasInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeSchemasRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeSchemasRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeSchemasRequest) Paginate(opts ...aws.Option) DescribeSchemasPager { + return DescribeSchemasPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeSchemasInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSchemasOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeSchemasPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeSchemasPager struct { + aws.Pager +} + +func (p *DescribeSchemasPager) CurrentPage() *DescribeSchemasOutput { + return p.Pager.CurrentPage().(*DescribeSchemasOutput) } const opDescribeTableStatistics = "DescribeTableStatistics" @@ -2056,6 +2035,7 @@ const opDescribeTableStatistics = "DescribeTableStatistics" type DescribeTableStatisticsRequest struct { *aws.Request Input *DescribeTableStatisticsInput + Copy func(*DescribeTableStatisticsInput) DescribeTableStatisticsRequest } // Send marshals and sends the DescribeTableStatistics API request. @@ -2107,57 +2087,53 @@ func (c *DatabaseMigrationService) DescribeTableStatisticsRequest(input *Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTableStatisticsRequest{Request: req, Input: input} + return DescribeTableStatisticsRequest{Request: req, Input: input, Copy: c.DescribeTableStatisticsRequest} } -// DescribeTableStatisticsPages iterates over the pages of a DescribeTableStatistics operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTableStatistics method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeTableStatisticsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeTableStatistics operation. -// pageNum := 0 -// err := client.DescribeTableStatisticsPages(params, -// func(page *DescribeTableStatisticsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DatabaseMigrationService) DescribeTableStatisticsPages(input *DescribeTableStatisticsInput, fn func(*DescribeTableStatisticsOutput, bool) bool) error { - return c.DescribeTableStatisticsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTableStatisticsPagesWithContext same as DescribeTableStatisticsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DatabaseMigrationService) DescribeTableStatisticsPagesWithContext(ctx aws.Context, input *DescribeTableStatisticsInput, fn func(*DescribeTableStatisticsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeTableStatisticsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeTableStatisticsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeTableStatisticsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeTableStatisticsRequest) Paginate(opts ...aws.Option) DescribeTableStatisticsPager { + return DescribeTableStatisticsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeTableStatisticsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTableStatisticsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeTableStatisticsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeTableStatisticsPager struct { + aws.Pager +} + +func (p *DescribeTableStatisticsPager) CurrentPage() *DescribeTableStatisticsOutput { + return p.Pager.CurrentPage().(*DescribeTableStatisticsOutput) } const opImportCertificate = "ImportCertificate" @@ -2166,6 +2142,7 @@ const opImportCertificate = "ImportCertificate" type ImportCertificateRequest struct { *aws.Request Input *ImportCertificateInput + Copy func(*ImportCertificateInput) ImportCertificateRequest } // Send marshals and sends the ImportCertificate API request. @@ -2206,7 +2183,7 @@ func (c *DatabaseMigrationService) ImportCertificateRequest(input *ImportCertifi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportCertificateRequest{Request: req, Input: input} + return ImportCertificateRequest{Request: req, Input: input, Copy: c.ImportCertificateRequest} } const opListTagsForResource = "ListTagsForResource" @@ -2215,6 +2192,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -2255,7 +2233,7 @@ func (c *DatabaseMigrationService) ListTagsForResourceRequest(input *ListTagsFor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opModifyEndpoint = "ModifyEndpoint" @@ -2264,6 +2242,7 @@ const opModifyEndpoint = "ModifyEndpoint" type ModifyEndpointRequest struct { *aws.Request Input *ModifyEndpointInput + Copy func(*ModifyEndpointInput) ModifyEndpointRequest } // Send marshals and sends the ModifyEndpoint API request. @@ -2304,7 +2283,7 @@ func (c *DatabaseMigrationService) ModifyEndpointRequest(input *ModifyEndpointIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyEndpointRequest{Request: req, Input: input} + return ModifyEndpointRequest{Request: req, Input: input, Copy: c.ModifyEndpointRequest} } const opModifyEventSubscription = "ModifyEventSubscription" @@ -2313,6 +2292,7 @@ const opModifyEventSubscription = "ModifyEventSubscription" type ModifyEventSubscriptionRequest struct { *aws.Request Input *ModifyEventSubscriptionInput + Copy func(*ModifyEventSubscriptionInput) ModifyEventSubscriptionRequest } // Send marshals and sends the ModifyEventSubscription API request. @@ -2353,7 +2333,7 @@ func (c *DatabaseMigrationService) ModifyEventSubscriptionRequest(input *ModifyE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyEventSubscriptionRequest{Request: req, Input: input} + return ModifyEventSubscriptionRequest{Request: req, Input: input, Copy: c.ModifyEventSubscriptionRequest} } const opModifyReplicationInstance = "ModifyReplicationInstance" @@ -2362,6 +2342,7 @@ const opModifyReplicationInstance = "ModifyReplicationInstance" type ModifyReplicationInstanceRequest struct { *aws.Request Input *ModifyReplicationInstanceInput + Copy func(*ModifyReplicationInstanceInput) ModifyReplicationInstanceRequest } // Send marshals and sends the ModifyReplicationInstance API request. @@ -2406,7 +2387,7 @@ func (c *DatabaseMigrationService) ModifyReplicationInstanceRequest(input *Modif req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyReplicationInstanceRequest{Request: req, Input: input} + return ModifyReplicationInstanceRequest{Request: req, Input: input, Copy: c.ModifyReplicationInstanceRequest} } const opModifyReplicationSubnetGroup = "ModifyReplicationSubnetGroup" @@ -2415,6 +2396,7 @@ const opModifyReplicationSubnetGroup = "ModifyReplicationSubnetGroup" type ModifyReplicationSubnetGroupRequest struct { *aws.Request Input *ModifyReplicationSubnetGroupInput + Copy func(*ModifyReplicationSubnetGroupInput) ModifyReplicationSubnetGroupRequest } // Send marshals and sends the ModifyReplicationSubnetGroup API request. @@ -2455,7 +2437,7 @@ func (c *DatabaseMigrationService) ModifyReplicationSubnetGroupRequest(input *Mo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyReplicationSubnetGroupRequest{Request: req, Input: input} + return ModifyReplicationSubnetGroupRequest{Request: req, Input: input, Copy: c.ModifyReplicationSubnetGroupRequest} } const opModifyReplicationTask = "ModifyReplicationTask" @@ -2464,6 +2446,7 @@ const opModifyReplicationTask = "ModifyReplicationTask" type ModifyReplicationTaskRequest struct { *aws.Request Input *ModifyReplicationTaskInput + Copy func(*ModifyReplicationTaskInput) ModifyReplicationTaskRequest } // Send marshals and sends the ModifyReplicationTask API request. @@ -2510,7 +2493,7 @@ func (c *DatabaseMigrationService) ModifyReplicationTaskRequest(input *ModifyRep req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyReplicationTaskRequest{Request: req, Input: input} + return ModifyReplicationTaskRequest{Request: req, Input: input, Copy: c.ModifyReplicationTaskRequest} } const opRefreshSchemas = "RefreshSchemas" @@ -2519,6 +2502,7 @@ const opRefreshSchemas = "RefreshSchemas" type RefreshSchemasRequest struct { *aws.Request Input *RefreshSchemasInput + Copy func(*RefreshSchemasInput) RefreshSchemasRequest } // Send marshals and sends the RefreshSchemas API request. @@ -2561,7 +2545,7 @@ func (c *DatabaseMigrationService) RefreshSchemasRequest(input *RefreshSchemasIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RefreshSchemasRequest{Request: req, Input: input} + return RefreshSchemasRequest{Request: req, Input: input, Copy: c.RefreshSchemasRequest} } const opReloadTables = "ReloadTables" @@ -2570,6 +2554,7 @@ const opReloadTables = "ReloadTables" type ReloadTablesRequest struct { *aws.Request Input *ReloadTablesInput + Copy func(*ReloadTablesInput) ReloadTablesRequest } // Send marshals and sends the ReloadTables API request. @@ -2610,7 +2595,7 @@ func (c *DatabaseMigrationService) ReloadTablesRequest(input *ReloadTablesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReloadTablesRequest{Request: req, Input: input} + return ReloadTablesRequest{Request: req, Input: input, Copy: c.ReloadTablesRequest} } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -2619,6 +2604,7 @@ const opRemoveTagsFromResource = "RemoveTagsFromResource" type RemoveTagsFromResourceRequest struct { *aws.Request Input *RemoveTagsFromResourceInput + Copy func(*RemoveTagsFromResourceInput) RemoveTagsFromResourceRequest } // Send marshals and sends the RemoveTagsFromResource API request. @@ -2659,7 +2645,7 @@ func (c *DatabaseMigrationService) RemoveTagsFromResourceRequest(input *RemoveTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromResourceRequest{Request: req, Input: input} + return RemoveTagsFromResourceRequest{Request: req, Input: input, Copy: c.RemoveTagsFromResourceRequest} } const opStartReplicationTask = "StartReplicationTask" @@ -2668,6 +2654,7 @@ const opStartReplicationTask = "StartReplicationTask" type StartReplicationTaskRequest struct { *aws.Request Input *StartReplicationTaskInput + Copy func(*StartReplicationTaskInput) StartReplicationTaskRequest } // Send marshals and sends the StartReplicationTask API request. @@ -2711,7 +2698,7 @@ func (c *DatabaseMigrationService) StartReplicationTaskRequest(input *StartRepli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartReplicationTaskRequest{Request: req, Input: input} + return StartReplicationTaskRequest{Request: req, Input: input, Copy: c.StartReplicationTaskRequest} } const opStartReplicationTaskAssessment = "StartReplicationTaskAssessment" @@ -2720,6 +2707,7 @@ const opStartReplicationTaskAssessment = "StartReplicationTaskAssessment" type StartReplicationTaskAssessmentRequest struct { *aws.Request Input *StartReplicationTaskAssessmentInput + Copy func(*StartReplicationTaskAssessmentInput) StartReplicationTaskAssessmentRequest } // Send marshals and sends the StartReplicationTaskAssessment API request. @@ -2761,7 +2749,7 @@ func (c *DatabaseMigrationService) StartReplicationTaskAssessmentRequest(input * req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartReplicationTaskAssessmentRequest{Request: req, Input: input} + return StartReplicationTaskAssessmentRequest{Request: req, Input: input, Copy: c.StartReplicationTaskAssessmentRequest} } const opStopReplicationTask = "StopReplicationTask" @@ -2770,6 +2758,7 @@ const opStopReplicationTask = "StopReplicationTask" type StopReplicationTaskRequest struct { *aws.Request Input *StopReplicationTaskInput + Copy func(*StopReplicationTaskInput) StopReplicationTaskRequest } // Send marshals and sends the StopReplicationTask API request. @@ -2810,7 +2799,7 @@ func (c *DatabaseMigrationService) StopReplicationTaskRequest(input *StopReplica req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopReplicationTaskRequest{Request: req, Input: input} + return StopReplicationTaskRequest{Request: req, Input: input, Copy: c.StopReplicationTaskRequest} } const opTestConnection = "TestConnection" @@ -2819,6 +2808,7 @@ const opTestConnection = "TestConnection" type TestConnectionRequest struct { *aws.Request Input *TestConnectionInput + Copy func(*TestConnectionInput) TestConnectionRequest } // Send marshals and sends the TestConnection API request. @@ -2859,7 +2849,7 @@ func (c *DatabaseMigrationService) TestConnectionRequest(input *TestConnectionIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestConnectionRequest{Request: req, Input: input} + return TestConnectionRequest{Request: req, Input: input, Copy: c.TestConnectionRequest} } // Describes a quota for an AWS account, for example, the number of replication diff --git a/service/databasemigrationservice/databasemigrationserviceiface/interface.go b/service/databasemigrationservice/databasemigrationserviceiface/interface.go index cac6e7fe0d5..065e71a8a29 100644 --- a/service/databasemigrationservice/databasemigrationserviceiface/interface.go +++ b/service/databasemigrationservice/databasemigrationserviceiface/interface.go @@ -9,7 +9,6 @@ package databasemigrationserviceiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice" ) @@ -91,73 +90,34 @@ type DatabaseMigrationServiceAPI interface { DescribeCertificatesRequest(*databasemigrationservice.DescribeCertificatesInput) databasemigrationservice.DescribeCertificatesRequest - DescribeCertificatesPages(*databasemigrationservice.DescribeCertificatesInput, func(*databasemigrationservice.DescribeCertificatesOutput, bool) bool) error - DescribeCertificatesPagesWithContext(aws.Context, *databasemigrationservice.DescribeCertificatesInput, func(*databasemigrationservice.DescribeCertificatesOutput, bool) bool, ...aws.Option) error - DescribeConnectionsRequest(*databasemigrationservice.DescribeConnectionsInput) databasemigrationservice.DescribeConnectionsRequest - DescribeConnectionsPages(*databasemigrationservice.DescribeConnectionsInput, func(*databasemigrationservice.DescribeConnectionsOutput, bool) bool) error - DescribeConnectionsPagesWithContext(aws.Context, *databasemigrationservice.DescribeConnectionsInput, func(*databasemigrationservice.DescribeConnectionsOutput, bool) bool, ...aws.Option) error - DescribeEndpointTypesRequest(*databasemigrationservice.DescribeEndpointTypesInput) databasemigrationservice.DescribeEndpointTypesRequest - DescribeEndpointTypesPages(*databasemigrationservice.DescribeEndpointTypesInput, func(*databasemigrationservice.DescribeEndpointTypesOutput, bool) bool) error - DescribeEndpointTypesPagesWithContext(aws.Context, *databasemigrationservice.DescribeEndpointTypesInput, func(*databasemigrationservice.DescribeEndpointTypesOutput, bool) bool, ...aws.Option) error - DescribeEndpointsRequest(*databasemigrationservice.DescribeEndpointsInput) databasemigrationservice.DescribeEndpointsRequest - DescribeEndpointsPages(*databasemigrationservice.DescribeEndpointsInput, func(*databasemigrationservice.DescribeEndpointsOutput, bool) bool) error - DescribeEndpointsPagesWithContext(aws.Context, *databasemigrationservice.DescribeEndpointsInput, func(*databasemigrationservice.DescribeEndpointsOutput, bool) bool, ...aws.Option) error - DescribeEventCategoriesRequest(*databasemigrationservice.DescribeEventCategoriesInput) databasemigrationservice.DescribeEventCategoriesRequest DescribeEventSubscriptionsRequest(*databasemigrationservice.DescribeEventSubscriptionsInput) databasemigrationservice.DescribeEventSubscriptionsRequest - DescribeEventSubscriptionsPages(*databasemigrationservice.DescribeEventSubscriptionsInput, func(*databasemigrationservice.DescribeEventSubscriptionsOutput, bool) bool) error - DescribeEventSubscriptionsPagesWithContext(aws.Context, *databasemigrationservice.DescribeEventSubscriptionsInput, func(*databasemigrationservice.DescribeEventSubscriptionsOutput, bool) bool, ...aws.Option) error - DescribeEventsRequest(*databasemigrationservice.DescribeEventsInput) databasemigrationservice.DescribeEventsRequest - DescribeEventsPages(*databasemigrationservice.DescribeEventsInput, func(*databasemigrationservice.DescribeEventsOutput, bool) bool) error - DescribeEventsPagesWithContext(aws.Context, *databasemigrationservice.DescribeEventsInput, func(*databasemigrationservice.DescribeEventsOutput, bool) bool, ...aws.Option) error - DescribeOrderableReplicationInstancesRequest(*databasemigrationservice.DescribeOrderableReplicationInstancesInput) databasemigrationservice.DescribeOrderableReplicationInstancesRequest - DescribeOrderableReplicationInstancesPages(*databasemigrationservice.DescribeOrderableReplicationInstancesInput, func(*databasemigrationservice.DescribeOrderableReplicationInstancesOutput, bool) bool) error - DescribeOrderableReplicationInstancesPagesWithContext(aws.Context, *databasemigrationservice.DescribeOrderableReplicationInstancesInput, func(*databasemigrationservice.DescribeOrderableReplicationInstancesOutput, bool) bool, ...aws.Option) error - DescribeRefreshSchemasStatusRequest(*databasemigrationservice.DescribeRefreshSchemasStatusInput) databasemigrationservice.DescribeRefreshSchemasStatusRequest DescribeReplicationInstancesRequest(*databasemigrationservice.DescribeReplicationInstancesInput) databasemigrationservice.DescribeReplicationInstancesRequest - DescribeReplicationInstancesPages(*databasemigrationservice.DescribeReplicationInstancesInput, func(*databasemigrationservice.DescribeReplicationInstancesOutput, bool) bool) error - DescribeReplicationInstancesPagesWithContext(aws.Context, *databasemigrationservice.DescribeReplicationInstancesInput, func(*databasemigrationservice.DescribeReplicationInstancesOutput, bool) bool, ...aws.Option) error - DescribeReplicationSubnetGroupsRequest(*databasemigrationservice.DescribeReplicationSubnetGroupsInput) databasemigrationservice.DescribeReplicationSubnetGroupsRequest - DescribeReplicationSubnetGroupsPages(*databasemigrationservice.DescribeReplicationSubnetGroupsInput, func(*databasemigrationservice.DescribeReplicationSubnetGroupsOutput, bool) bool) error - DescribeReplicationSubnetGroupsPagesWithContext(aws.Context, *databasemigrationservice.DescribeReplicationSubnetGroupsInput, func(*databasemigrationservice.DescribeReplicationSubnetGroupsOutput, bool) bool, ...aws.Option) error - DescribeReplicationTaskAssessmentResultsRequest(*databasemigrationservice.DescribeReplicationTaskAssessmentResultsInput) databasemigrationservice.DescribeReplicationTaskAssessmentResultsRequest - DescribeReplicationTaskAssessmentResultsPages(*databasemigrationservice.DescribeReplicationTaskAssessmentResultsInput, func(*databasemigrationservice.DescribeReplicationTaskAssessmentResultsOutput, bool) bool) error - DescribeReplicationTaskAssessmentResultsPagesWithContext(aws.Context, *databasemigrationservice.DescribeReplicationTaskAssessmentResultsInput, func(*databasemigrationservice.DescribeReplicationTaskAssessmentResultsOutput, bool) bool, ...aws.Option) error - DescribeReplicationTasksRequest(*databasemigrationservice.DescribeReplicationTasksInput) databasemigrationservice.DescribeReplicationTasksRequest - DescribeReplicationTasksPages(*databasemigrationservice.DescribeReplicationTasksInput, func(*databasemigrationservice.DescribeReplicationTasksOutput, bool) bool) error - DescribeReplicationTasksPagesWithContext(aws.Context, *databasemigrationservice.DescribeReplicationTasksInput, func(*databasemigrationservice.DescribeReplicationTasksOutput, bool) bool, ...aws.Option) error - DescribeSchemasRequest(*databasemigrationservice.DescribeSchemasInput) databasemigrationservice.DescribeSchemasRequest - DescribeSchemasPages(*databasemigrationservice.DescribeSchemasInput, func(*databasemigrationservice.DescribeSchemasOutput, bool) bool) error - DescribeSchemasPagesWithContext(aws.Context, *databasemigrationservice.DescribeSchemasInput, func(*databasemigrationservice.DescribeSchemasOutput, bool) bool, ...aws.Option) error - DescribeTableStatisticsRequest(*databasemigrationservice.DescribeTableStatisticsInput) databasemigrationservice.DescribeTableStatisticsRequest - DescribeTableStatisticsPages(*databasemigrationservice.DescribeTableStatisticsInput, func(*databasemigrationservice.DescribeTableStatisticsOutput, bool) bool) error - DescribeTableStatisticsPagesWithContext(aws.Context, *databasemigrationservice.DescribeTableStatisticsInput, func(*databasemigrationservice.DescribeTableStatisticsOutput, bool) bool, ...aws.Option) error - ImportCertificateRequest(*databasemigrationservice.ImportCertificateInput) databasemigrationservice.ImportCertificateRequest ListTagsForResourceRequest(*databasemigrationservice.ListTagsForResourceInput) databasemigrationservice.ListTagsForResourceRequest diff --git a/service/datapipeline/api.go b/service/datapipeline/api.go index 33d06059115..f6bfc25f2fb 100644 --- a/service/datapipeline/api.go +++ b/service/datapipeline/api.go @@ -18,6 +18,7 @@ const opActivatePipeline = "ActivatePipeline" type ActivatePipelineRequest struct { *aws.Request Input *ActivatePipelineInput + Copy func(*ActivatePipelineInput) ActivatePipelineRequest } // Send marshals and sends the ActivatePipeline API request. @@ -65,7 +66,7 @@ func (c *DataPipeline) ActivatePipelineRequest(input *ActivatePipelineInput) Act req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ActivatePipelineRequest{Request: req, Input: input} + return ActivatePipelineRequest{Request: req, Input: input, Copy: c.ActivatePipelineRequest} } const opAddTags = "AddTags" @@ -74,6 +75,7 @@ const opAddTags = "AddTags" type AddTagsRequest struct { *aws.Request Input *AddTagsInput + Copy func(*AddTagsInput) AddTagsRequest } // Send marshals and sends the AddTags API request. @@ -114,7 +116,7 @@ func (c *DataPipeline) AddTagsRequest(input *AddTagsInput) AddTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsRequest{Request: req, Input: input} + return AddTagsRequest{Request: req, Input: input, Copy: c.AddTagsRequest} } const opCreatePipeline = "CreatePipeline" @@ -123,6 +125,7 @@ const opCreatePipeline = "CreatePipeline" type CreatePipelineRequest struct { *aws.Request Input *CreatePipelineInput + Copy func(*CreatePipelineInput) CreatePipelineRequest } // Send marshals and sends the CreatePipeline API request. @@ -164,7 +167,7 @@ func (c *DataPipeline) CreatePipelineRequest(input *CreatePipelineInput) CreateP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePipelineRequest{Request: req, Input: input} + return CreatePipelineRequest{Request: req, Input: input, Copy: c.CreatePipelineRequest} } const opDeactivatePipeline = "DeactivatePipeline" @@ -173,6 +176,7 @@ const opDeactivatePipeline = "DeactivatePipeline" type DeactivatePipelineRequest struct { *aws.Request Input *DeactivatePipelineInput + Copy func(*DeactivatePipelineInput) DeactivatePipelineRequest } // Send marshals and sends the DeactivatePipeline API request. @@ -218,7 +222,7 @@ func (c *DataPipeline) DeactivatePipelineRequest(input *DeactivatePipelineInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeactivatePipelineRequest{Request: req, Input: input} + return DeactivatePipelineRequest{Request: req, Input: input, Copy: c.DeactivatePipelineRequest} } const opDeletePipeline = "DeletePipeline" @@ -227,6 +231,7 @@ const opDeletePipeline = "DeletePipeline" type DeletePipelineRequest struct { *aws.Request Input *DeletePipelineInput + Copy func(*DeletePipelineInput) DeletePipelineRequest } // Send marshals and sends the DeletePipeline API request. @@ -276,7 +281,7 @@ func (c *DataPipeline) DeletePipelineRequest(input *DeletePipelineInput) DeleteP req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePipelineRequest{Request: req, Input: input} + return DeletePipelineRequest{Request: req, Input: input, Copy: c.DeletePipelineRequest} } const opDescribeObjects = "DescribeObjects" @@ -285,6 +290,7 @@ const opDescribeObjects = "DescribeObjects" type DescribeObjectsRequest struct { *aws.Request Input *DescribeObjectsInput + Copy func(*DescribeObjectsInput) DescribeObjectsRequest } // Send marshals and sends the DescribeObjects API request. @@ -333,57 +339,53 @@ func (c *DataPipeline) DescribeObjectsRequest(input *DescribeObjectsInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeObjectsRequest{Request: req, Input: input} + return DescribeObjectsRequest{Request: req, Input: input, Copy: c.DescribeObjectsRequest} } -// DescribeObjectsPages iterates over the pages of a DescribeObjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeObjects method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeObjectsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeObjects operation. -// pageNum := 0 -// err := client.DescribeObjectsPages(params, -// func(page *DescribeObjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DataPipeline) DescribeObjectsPages(input *DescribeObjectsInput, fn func(*DescribeObjectsOutput, bool) bool) error { - return c.DescribeObjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeObjectsPagesWithContext same as DescribeObjectsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DataPipeline) DescribeObjectsPagesWithContext(ctx aws.Context, input *DescribeObjectsInput, fn func(*DescribeObjectsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeObjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeObjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeObjectsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeObjectsRequest) Paginate(opts ...aws.Option) DescribeObjectsPager { + return DescribeObjectsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeObjectsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeObjectsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeObjectsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeObjectsPager struct { + aws.Pager +} + +func (p *DescribeObjectsPager) CurrentPage() *DescribeObjectsOutput { + return p.Pager.CurrentPage().(*DescribeObjectsOutput) } const opDescribePipelines = "DescribePipelines" @@ -392,6 +394,7 @@ const opDescribePipelines = "DescribePipelines" type DescribePipelinesRequest struct { *aws.Request Input *DescribePipelinesInput + Copy func(*DescribePipelinesInput) DescribePipelinesRequest } // Send marshals and sends the DescribePipelines API request. @@ -440,7 +443,7 @@ func (c *DataPipeline) DescribePipelinesRequest(input *DescribePipelinesInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePipelinesRequest{Request: req, Input: input} + return DescribePipelinesRequest{Request: req, Input: input, Copy: c.DescribePipelinesRequest} } const opEvaluateExpression = "EvaluateExpression" @@ -449,6 +452,7 @@ const opEvaluateExpression = "EvaluateExpression" type EvaluateExpressionRequest struct { *aws.Request Input *EvaluateExpressionInput + Copy func(*EvaluateExpressionInput) EvaluateExpressionRequest } // Send marshals and sends the EvaluateExpression API request. @@ -491,7 +495,7 @@ func (c *DataPipeline) EvaluateExpressionRequest(input *EvaluateExpressionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EvaluateExpressionRequest{Request: req, Input: input} + return EvaluateExpressionRequest{Request: req, Input: input, Copy: c.EvaluateExpressionRequest} } const opGetPipelineDefinition = "GetPipelineDefinition" @@ -500,6 +504,7 @@ const opGetPipelineDefinition = "GetPipelineDefinition" type GetPipelineDefinitionRequest struct { *aws.Request Input *GetPipelineDefinitionInput + Copy func(*GetPipelineDefinitionInput) GetPipelineDefinitionRequest } // Send marshals and sends the GetPipelineDefinition API request. @@ -541,7 +546,7 @@ func (c *DataPipeline) GetPipelineDefinitionRequest(input *GetPipelineDefinition req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPipelineDefinitionRequest{Request: req, Input: input} + return GetPipelineDefinitionRequest{Request: req, Input: input, Copy: c.GetPipelineDefinitionRequest} } const opListPipelines = "ListPipelines" @@ -550,6 +555,7 @@ const opListPipelines = "ListPipelines" type ListPipelinesRequest struct { *aws.Request Input *ListPipelinesInput + Copy func(*ListPipelinesInput) ListPipelinesRequest } // Send marshals and sends the ListPipelines API request. @@ -597,57 +603,53 @@ func (c *DataPipeline) ListPipelinesRequest(input *ListPipelinesInput) ListPipel req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPipelinesRequest{Request: req, Input: input} + return ListPipelinesRequest{Request: req, Input: input, Copy: c.ListPipelinesRequest} } -// ListPipelinesPages iterates over the pages of a ListPipelines operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPipelines method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPipelinesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPipelines operation. -// pageNum := 0 -// err := client.ListPipelinesPages(params, -// func(page *ListPipelinesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DataPipeline) ListPipelinesPages(input *ListPipelinesInput, fn func(*ListPipelinesOutput, bool) bool) error { - return c.ListPipelinesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPipelinesPagesWithContext same as ListPipelinesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DataPipeline) ListPipelinesPagesWithContext(ctx aws.Context, input *ListPipelinesInput, fn func(*ListPipelinesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPipelinesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPipelinesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPipelinesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPipelinesRequest) Paginate(opts ...aws.Option) ListPipelinesPager { + return ListPipelinesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPipelinesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) - } - return p.Err() +// ListPipelinesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPipelinesPager struct { + aws.Pager +} + +func (p *ListPipelinesPager) CurrentPage() *ListPipelinesOutput { + return p.Pager.CurrentPage().(*ListPipelinesOutput) } const opPollForTask = "PollForTask" @@ -656,6 +658,7 @@ const opPollForTask = "PollForTask" type PollForTaskRequest struct { *aws.Request Input *PollForTaskInput + Copy func(*PollForTaskInput) PollForTaskRequest } // Send marshals and sends the PollForTask API request. @@ -709,7 +712,7 @@ func (c *DataPipeline) PollForTaskRequest(input *PollForTaskInput) PollForTaskRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PollForTaskRequest{Request: req, Input: input} + return PollForTaskRequest{Request: req, Input: input, Copy: c.PollForTaskRequest} } const opPutPipelineDefinition = "PutPipelineDefinition" @@ -718,6 +721,7 @@ const opPutPipelineDefinition = "PutPipelineDefinition" type PutPipelineDefinitionRequest struct { *aws.Request Input *PutPipelineDefinitionInput + Copy func(*PutPipelineDefinitionInput) PutPipelineDefinitionRequest } // Send marshals and sends the PutPipelineDefinition API request. @@ -771,7 +775,7 @@ func (c *DataPipeline) PutPipelineDefinitionRequest(input *PutPipelineDefinition req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutPipelineDefinitionRequest{Request: req, Input: input} + return PutPipelineDefinitionRequest{Request: req, Input: input, Copy: c.PutPipelineDefinitionRequest} } const opQueryObjects = "QueryObjects" @@ -780,6 +784,7 @@ const opQueryObjects = "QueryObjects" type QueryObjectsRequest struct { *aws.Request Input *QueryObjectsInput + Copy func(*QueryObjectsInput) QueryObjectsRequest } // Send marshals and sends the QueryObjects API request. @@ -827,57 +832,53 @@ func (c *DataPipeline) QueryObjectsRequest(input *QueryObjectsInput) QueryObject req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return QueryObjectsRequest{Request: req, Input: input} + return QueryObjectsRequest{Request: req, Input: input, Copy: c.QueryObjectsRequest} } -// QueryObjectsPages iterates over the pages of a QueryObjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See QueryObjects method for more information on how to use this operation. +// Paginate pages iterates over the pages of a QueryObjectsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a QueryObjects operation. -// pageNum := 0 -// err := client.QueryObjectsPages(params, -// func(page *QueryObjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DataPipeline) QueryObjectsPages(input *QueryObjectsInput, fn func(*QueryObjectsOutput, bool) bool) error { - return c.QueryObjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// QueryObjectsPagesWithContext same as QueryObjectsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DataPipeline) QueryObjectsPagesWithContext(ctx aws.Context, input *QueryObjectsInput, fn func(*QueryObjectsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *QueryObjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.QueryObjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.QueryObjectsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *QueryObjectsRequest) Paginate(opts ...aws.Option) QueryObjectsPager { + return QueryObjectsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *QueryObjectsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*QueryObjectsOutput), !p.HasNextPage()) - } - return p.Err() +// QueryObjectsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type QueryObjectsPager struct { + aws.Pager +} + +func (p *QueryObjectsPager) CurrentPage() *QueryObjectsOutput { + return p.Pager.CurrentPage().(*QueryObjectsOutput) } const opRemoveTags = "RemoveTags" @@ -886,6 +887,7 @@ const opRemoveTags = "RemoveTags" type RemoveTagsRequest struct { *aws.Request Input *RemoveTagsInput + Copy func(*RemoveTagsInput) RemoveTagsRequest } // Send marshals and sends the RemoveTags API request. @@ -926,7 +928,7 @@ func (c *DataPipeline) RemoveTagsRequest(input *RemoveTagsInput) RemoveTagsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsRequest{Request: req, Input: input} + return RemoveTagsRequest{Request: req, Input: input, Copy: c.RemoveTagsRequest} } const opReportTaskProgress = "ReportTaskProgress" @@ -935,6 +937,7 @@ const opReportTaskProgress = "ReportTaskProgress" type ReportTaskProgressRequest struct { *aws.Request Input *ReportTaskProgressInput + Copy func(*ReportTaskProgressInput) ReportTaskProgressRequest } // Send marshals and sends the ReportTaskProgress API request. @@ -986,7 +989,7 @@ func (c *DataPipeline) ReportTaskProgressRequest(input *ReportTaskProgressInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReportTaskProgressRequest{Request: req, Input: input} + return ReportTaskProgressRequest{Request: req, Input: input, Copy: c.ReportTaskProgressRequest} } const opReportTaskRunnerHeartbeat = "ReportTaskRunnerHeartbeat" @@ -995,6 +998,7 @@ const opReportTaskRunnerHeartbeat = "ReportTaskRunnerHeartbeat" type ReportTaskRunnerHeartbeatRequest struct { *aws.Request Input *ReportTaskRunnerHeartbeatInput + Copy func(*ReportTaskRunnerHeartbeatInput) ReportTaskRunnerHeartbeatRequest } // Send marshals and sends the ReportTaskRunnerHeartbeat API request. @@ -1039,7 +1043,7 @@ func (c *DataPipeline) ReportTaskRunnerHeartbeatRequest(input *ReportTaskRunnerH req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReportTaskRunnerHeartbeatRequest{Request: req, Input: input} + return ReportTaskRunnerHeartbeatRequest{Request: req, Input: input, Copy: c.ReportTaskRunnerHeartbeatRequest} } const opSetStatus = "SetStatus" @@ -1048,6 +1052,7 @@ const opSetStatus = "SetStatus" type SetStatusRequest struct { *aws.Request Input *SetStatusInput + Copy func(*SetStatusInput) SetStatusRequest } // Send marshals and sends the SetStatus API request. @@ -1094,7 +1099,7 @@ func (c *DataPipeline) SetStatusRequest(input *SetStatusInput) SetStatusRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetStatusRequest{Request: req, Input: input} + return SetStatusRequest{Request: req, Input: input, Copy: c.SetStatusRequest} } const opSetTaskStatus = "SetTaskStatus" @@ -1103,6 +1108,7 @@ const opSetTaskStatus = "SetTaskStatus" type SetTaskStatusRequest struct { *aws.Request Input *SetTaskStatusInput + Copy func(*SetTaskStatusInput) SetTaskStatusRequest } // Send marshals and sends the SetTaskStatus API request. @@ -1147,7 +1153,7 @@ func (c *DataPipeline) SetTaskStatusRequest(input *SetTaskStatusInput) SetTaskSt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetTaskStatusRequest{Request: req, Input: input} + return SetTaskStatusRequest{Request: req, Input: input, Copy: c.SetTaskStatusRequest} } const opValidatePipelineDefinition = "ValidatePipelineDefinition" @@ -1156,6 +1162,7 @@ const opValidatePipelineDefinition = "ValidatePipelineDefinition" type ValidatePipelineDefinitionRequest struct { *aws.Request Input *ValidatePipelineDefinitionInput + Copy func(*ValidatePipelineDefinitionInput) ValidatePipelineDefinitionRequest } // Send marshals and sends the ValidatePipelineDefinition API request. @@ -1197,7 +1204,7 @@ func (c *DataPipeline) ValidatePipelineDefinitionRequest(input *ValidatePipeline req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ValidatePipelineDefinitionRequest{Request: req, Input: input} + return ValidatePipelineDefinitionRequest{Request: req, Input: input, Copy: c.ValidatePipelineDefinitionRequest} } // Contains the parameters for ActivatePipeline. diff --git a/service/datapipeline/datapipelineiface/interface.go b/service/datapipeline/datapipelineiface/interface.go index 82df241d519..7de42a6926e 100644 --- a/service/datapipeline/datapipelineiface/interface.go +++ b/service/datapipeline/datapipelineiface/interface.go @@ -9,7 +9,6 @@ package datapipelineiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/datapipeline" ) @@ -75,9 +74,6 @@ type DataPipelineAPI interface { DescribeObjectsRequest(*datapipeline.DescribeObjectsInput) datapipeline.DescribeObjectsRequest - DescribeObjectsPages(*datapipeline.DescribeObjectsInput, func(*datapipeline.DescribeObjectsOutput, bool) bool) error - DescribeObjectsPagesWithContext(aws.Context, *datapipeline.DescribeObjectsInput, func(*datapipeline.DescribeObjectsOutput, bool) bool, ...aws.Option) error - DescribePipelinesRequest(*datapipeline.DescribePipelinesInput) datapipeline.DescribePipelinesRequest EvaluateExpressionRequest(*datapipeline.EvaluateExpressionInput) datapipeline.EvaluateExpressionRequest @@ -86,18 +82,12 @@ type DataPipelineAPI interface { ListPipelinesRequest(*datapipeline.ListPipelinesInput) datapipeline.ListPipelinesRequest - ListPipelinesPages(*datapipeline.ListPipelinesInput, func(*datapipeline.ListPipelinesOutput, bool) bool) error - ListPipelinesPagesWithContext(aws.Context, *datapipeline.ListPipelinesInput, func(*datapipeline.ListPipelinesOutput, bool) bool, ...aws.Option) error - PollForTaskRequest(*datapipeline.PollForTaskInput) datapipeline.PollForTaskRequest PutPipelineDefinitionRequest(*datapipeline.PutPipelineDefinitionInput) datapipeline.PutPipelineDefinitionRequest QueryObjectsRequest(*datapipeline.QueryObjectsInput) datapipeline.QueryObjectsRequest - QueryObjectsPages(*datapipeline.QueryObjectsInput, func(*datapipeline.QueryObjectsOutput, bool) bool) error - QueryObjectsPagesWithContext(aws.Context, *datapipeline.QueryObjectsInput, func(*datapipeline.QueryObjectsOutput, bool) bool, ...aws.Option) error - RemoveTagsRequest(*datapipeline.RemoveTagsInput) datapipeline.RemoveTagsRequest ReportTaskProgressRequest(*datapipeline.ReportTaskProgressInput) datapipeline.ReportTaskProgressRequest diff --git a/service/dax/api.go b/service/dax/api.go index 3480baa30e6..12890c1b808 100644 --- a/service/dax/api.go +++ b/service/dax/api.go @@ -15,6 +15,7 @@ const opCreateCluster = "CreateCluster" type CreateClusterRequest struct { *aws.Request Input *CreateClusterInput + Copy func(*CreateClusterInput) CreateClusterRequest } // Send marshals and sends the CreateCluster API request. @@ -56,7 +57,7 @@ func (c *DAX) CreateClusterRequest(input *CreateClusterInput) CreateClusterReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClusterRequest{Request: req, Input: input} + return CreateClusterRequest{Request: req, Input: input, Copy: c.CreateClusterRequest} } const opCreateParameterGroup = "CreateParameterGroup" @@ -65,6 +66,7 @@ const opCreateParameterGroup = "CreateParameterGroup" type CreateParameterGroupRequest struct { *aws.Request Input *CreateParameterGroupInput + Copy func(*CreateParameterGroupInput) CreateParameterGroupRequest } // Send marshals and sends the CreateParameterGroup API request. @@ -106,7 +108,7 @@ func (c *DAX) CreateParameterGroupRequest(input *CreateParameterGroupInput) Crea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateParameterGroupRequest{Request: req, Input: input} + return CreateParameterGroupRequest{Request: req, Input: input, Copy: c.CreateParameterGroupRequest} } const opCreateSubnetGroup = "CreateSubnetGroup" @@ -115,6 +117,7 @@ const opCreateSubnetGroup = "CreateSubnetGroup" type CreateSubnetGroupRequest struct { *aws.Request Input *CreateSubnetGroupInput + Copy func(*CreateSubnetGroupInput) CreateSubnetGroupRequest } // Send marshals and sends the CreateSubnetGroup API request. @@ -155,7 +158,7 @@ func (c *DAX) CreateSubnetGroupRequest(input *CreateSubnetGroupInput) CreateSubn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSubnetGroupRequest{Request: req, Input: input} + return CreateSubnetGroupRequest{Request: req, Input: input, Copy: c.CreateSubnetGroupRequest} } const opDecreaseReplicationFactor = "DecreaseReplicationFactor" @@ -164,6 +167,7 @@ const opDecreaseReplicationFactor = "DecreaseReplicationFactor" type DecreaseReplicationFactorRequest struct { *aws.Request Input *DecreaseReplicationFactorInput + Copy func(*DecreaseReplicationFactorInput) DecreaseReplicationFactorRequest } // Send marshals and sends the DecreaseReplicationFactor API request. @@ -207,7 +211,7 @@ func (c *DAX) DecreaseReplicationFactorRequest(input *DecreaseReplicationFactorI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DecreaseReplicationFactorRequest{Request: req, Input: input} + return DecreaseReplicationFactorRequest{Request: req, Input: input, Copy: c.DecreaseReplicationFactorRequest} } const opDeleteCluster = "DeleteCluster" @@ -216,6 +220,7 @@ const opDeleteCluster = "DeleteCluster" type DeleteClusterRequest struct { *aws.Request Input *DeleteClusterInput + Copy func(*DeleteClusterInput) DeleteClusterRequest } // Send marshals and sends the DeleteCluster API request. @@ -259,7 +264,7 @@ func (c *DAX) DeleteClusterRequest(input *DeleteClusterInput) DeleteClusterReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteClusterRequest{Request: req, Input: input} + return DeleteClusterRequest{Request: req, Input: input, Copy: c.DeleteClusterRequest} } const opDeleteParameterGroup = "DeleteParameterGroup" @@ -268,6 +273,7 @@ const opDeleteParameterGroup = "DeleteParameterGroup" type DeleteParameterGroupRequest struct { *aws.Request Input *DeleteParameterGroupInput + Copy func(*DeleteParameterGroupInput) DeleteParameterGroupRequest } // Send marshals and sends the DeleteParameterGroup API request. @@ -309,7 +315,7 @@ func (c *DAX) DeleteParameterGroupRequest(input *DeleteParameterGroupInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteParameterGroupRequest{Request: req, Input: input} + return DeleteParameterGroupRequest{Request: req, Input: input, Copy: c.DeleteParameterGroupRequest} } const opDeleteSubnetGroup = "DeleteSubnetGroup" @@ -318,6 +324,7 @@ const opDeleteSubnetGroup = "DeleteSubnetGroup" type DeleteSubnetGroupRequest struct { *aws.Request Input *DeleteSubnetGroupInput + Copy func(*DeleteSubnetGroupInput) DeleteSubnetGroupRequest } // Send marshals and sends the DeleteSubnetGroup API request. @@ -360,7 +367,7 @@ func (c *DAX) DeleteSubnetGroupRequest(input *DeleteSubnetGroupInput) DeleteSubn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSubnetGroupRequest{Request: req, Input: input} + return DeleteSubnetGroupRequest{Request: req, Input: input, Copy: c.DeleteSubnetGroupRequest} } const opDescribeClusters = "DescribeClusters" @@ -369,6 +376,7 @@ const opDescribeClusters = "DescribeClusters" type DescribeClustersRequest struct { *aws.Request Input *DescribeClustersInput + Copy func(*DescribeClustersInput) DescribeClustersRequest } // Send marshals and sends the DescribeClusters API request. @@ -425,7 +433,7 @@ func (c *DAX) DescribeClustersRequest(input *DescribeClustersInput) DescribeClus req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClustersRequest{Request: req, Input: input} + return DescribeClustersRequest{Request: req, Input: input, Copy: c.DescribeClustersRequest} } const opDescribeDefaultParameters = "DescribeDefaultParameters" @@ -434,6 +442,7 @@ const opDescribeDefaultParameters = "DescribeDefaultParameters" type DescribeDefaultParametersRequest struct { *aws.Request Input *DescribeDefaultParametersInput + Copy func(*DescribeDefaultParametersInput) DescribeDefaultParametersRequest } // Send marshals and sends the DescribeDefaultParameters API request. @@ -474,7 +483,7 @@ func (c *DAX) DescribeDefaultParametersRequest(input *DescribeDefaultParametersI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDefaultParametersRequest{Request: req, Input: input} + return DescribeDefaultParametersRequest{Request: req, Input: input, Copy: c.DescribeDefaultParametersRequest} } const opDescribeEvents = "DescribeEvents" @@ -483,6 +492,7 @@ const opDescribeEvents = "DescribeEvents" type DescribeEventsRequest struct { *aws.Request Input *DescribeEventsInput + Copy func(*DescribeEventsInput) DescribeEventsRequest } // Send marshals and sends the DescribeEvents API request. @@ -528,7 +538,7 @@ func (c *DAX) DescribeEventsRequest(input *DescribeEventsInput) DescribeEventsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventsRequest{Request: req, Input: input} + return DescribeEventsRequest{Request: req, Input: input, Copy: c.DescribeEventsRequest} } const opDescribeParameterGroups = "DescribeParameterGroups" @@ -537,6 +547,7 @@ const opDescribeParameterGroups = "DescribeParameterGroups" type DescribeParameterGroupsRequest struct { *aws.Request Input *DescribeParameterGroupsInput + Copy func(*DescribeParameterGroupsInput) DescribeParameterGroupsRequest } // Send marshals and sends the DescribeParameterGroups API request. @@ -578,7 +589,7 @@ func (c *DAX) DescribeParameterGroupsRequest(input *DescribeParameterGroupsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeParameterGroupsRequest{Request: req, Input: input} + return DescribeParameterGroupsRequest{Request: req, Input: input, Copy: c.DescribeParameterGroupsRequest} } const opDescribeParameters = "DescribeParameters" @@ -587,6 +598,7 @@ const opDescribeParameters = "DescribeParameters" type DescribeParametersRequest struct { *aws.Request Input *DescribeParametersInput + Copy func(*DescribeParametersInput) DescribeParametersRequest } // Send marshals and sends the DescribeParameters API request. @@ -627,7 +639,7 @@ func (c *DAX) DescribeParametersRequest(input *DescribeParametersInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeParametersRequest{Request: req, Input: input} + return DescribeParametersRequest{Request: req, Input: input, Copy: c.DescribeParametersRequest} } const opDescribeSubnetGroups = "DescribeSubnetGroups" @@ -636,6 +648,7 @@ const opDescribeSubnetGroups = "DescribeSubnetGroups" type DescribeSubnetGroupsRequest struct { *aws.Request Input *DescribeSubnetGroupsInput + Copy func(*DescribeSubnetGroupsInput) DescribeSubnetGroupsRequest } // Send marshals and sends the DescribeSubnetGroups API request. @@ -677,7 +690,7 @@ func (c *DAX) DescribeSubnetGroupsRequest(input *DescribeSubnetGroupsInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSubnetGroupsRequest{Request: req, Input: input} + return DescribeSubnetGroupsRequest{Request: req, Input: input, Copy: c.DescribeSubnetGroupsRequest} } const opIncreaseReplicationFactor = "IncreaseReplicationFactor" @@ -686,6 +699,7 @@ const opIncreaseReplicationFactor = "IncreaseReplicationFactor" type IncreaseReplicationFactorRequest struct { *aws.Request Input *IncreaseReplicationFactorInput + Copy func(*IncreaseReplicationFactorInput) IncreaseReplicationFactorRequest } // Send marshals and sends the IncreaseReplicationFactor API request. @@ -726,7 +740,7 @@ func (c *DAX) IncreaseReplicationFactorRequest(input *IncreaseReplicationFactorI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return IncreaseReplicationFactorRequest{Request: req, Input: input} + return IncreaseReplicationFactorRequest{Request: req, Input: input, Copy: c.IncreaseReplicationFactorRequest} } const opListTags = "ListTags" @@ -735,6 +749,7 @@ const opListTags = "ListTags" type ListTagsRequest struct { *aws.Request Input *ListTagsInput + Copy func(*ListTagsInput) ListTagsRequest } // Send marshals and sends the ListTags API request. @@ -776,7 +791,7 @@ func (c *DAX) ListTagsRequest(input *ListTagsInput) ListTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsRequest{Request: req, Input: input} + return ListTagsRequest{Request: req, Input: input, Copy: c.ListTagsRequest} } const opRebootNode = "RebootNode" @@ -785,6 +800,7 @@ const opRebootNode = "RebootNode" type RebootNodeRequest struct { *aws.Request Input *RebootNodeInput + Copy func(*RebootNodeInput) RebootNodeRequest } // Send marshals and sends the RebootNode API request. @@ -826,7 +842,7 @@ func (c *DAX) RebootNodeRequest(input *RebootNodeInput) RebootNodeRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RebootNodeRequest{Request: req, Input: input} + return RebootNodeRequest{Request: req, Input: input, Copy: c.RebootNodeRequest} } const opTagResource = "TagResource" @@ -835,6 +851,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -876,7 +893,7 @@ func (c *DAX) TagResourceRequest(input *TagResourceInput) TagResourceRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource" @@ -885,6 +902,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -926,7 +944,7 @@ func (c *DAX) UntagResourceRequest(input *UntagResourceInput) UntagResourceReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateCluster = "UpdateCluster" @@ -935,6 +953,7 @@ const opUpdateCluster = "UpdateCluster" type UpdateClusterRequest struct { *aws.Request Input *UpdateClusterInput + Copy func(*UpdateClusterInput) UpdateClusterRequest } // Send marshals and sends the UpdateCluster API request. @@ -977,7 +996,7 @@ func (c *DAX) UpdateClusterRequest(input *UpdateClusterInput) UpdateClusterReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateClusterRequest{Request: req, Input: input} + return UpdateClusterRequest{Request: req, Input: input, Copy: c.UpdateClusterRequest} } const opUpdateParameterGroup = "UpdateParameterGroup" @@ -986,6 +1005,7 @@ const opUpdateParameterGroup = "UpdateParameterGroup" type UpdateParameterGroupRequest struct { *aws.Request Input *UpdateParameterGroupInput + Copy func(*UpdateParameterGroupInput) UpdateParameterGroupRequest } // Send marshals and sends the UpdateParameterGroup API request. @@ -1027,7 +1047,7 @@ func (c *DAX) UpdateParameterGroupRequest(input *UpdateParameterGroupInput) Upda req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateParameterGroupRequest{Request: req, Input: input} + return UpdateParameterGroupRequest{Request: req, Input: input, Copy: c.UpdateParameterGroupRequest} } const opUpdateSubnetGroup = "UpdateSubnetGroup" @@ -1036,6 +1056,7 @@ const opUpdateSubnetGroup = "UpdateSubnetGroup" type UpdateSubnetGroupRequest struct { *aws.Request Input *UpdateSubnetGroupInput + Copy func(*UpdateSubnetGroupInput) UpdateSubnetGroupRequest } // Send marshals and sends the UpdateSubnetGroup API request. @@ -1076,7 +1097,7 @@ func (c *DAX) UpdateSubnetGroupRequest(input *UpdateSubnetGroupInput) UpdateSubn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSubnetGroupRequest{Request: req, Input: input} + return UpdateSubnetGroupRequest{Request: req, Input: input, Copy: c.UpdateSubnetGroupRequest} } // Contains all of the attributes of a specific DAX cluster. diff --git a/service/devicefarm/api.go b/service/devicefarm/api.go index 0b81c72756b..ee4fa7fa788 100644 --- a/service/devicefarm/api.go +++ b/service/devicefarm/api.go @@ -15,6 +15,7 @@ const opCreateDevicePool = "CreateDevicePool" type CreateDevicePoolRequest struct { *aws.Request Input *CreateDevicePoolInput + Copy func(*CreateDevicePoolInput) CreateDevicePoolRequest } // Send marshals and sends the CreateDevicePool API request. @@ -55,7 +56,7 @@ func (c *DeviceFarm) CreateDevicePoolRequest(input *CreateDevicePoolInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDevicePoolRequest{Request: req, Input: input} + return CreateDevicePoolRequest{Request: req, Input: input, Copy: c.CreateDevicePoolRequest} } const opCreateNetworkProfile = "CreateNetworkProfile" @@ -64,6 +65,7 @@ const opCreateNetworkProfile = "CreateNetworkProfile" type CreateNetworkProfileRequest struct { *aws.Request Input *CreateNetworkProfileInput + Copy func(*CreateNetworkProfileInput) CreateNetworkProfileRequest } // Send marshals and sends the CreateNetworkProfile API request. @@ -104,7 +106,7 @@ func (c *DeviceFarm) CreateNetworkProfileRequest(input *CreateNetworkProfileInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNetworkProfileRequest{Request: req, Input: input} + return CreateNetworkProfileRequest{Request: req, Input: input, Copy: c.CreateNetworkProfileRequest} } const opCreateProject = "CreateProject" @@ -113,6 +115,7 @@ const opCreateProject = "CreateProject" type CreateProjectRequest struct { *aws.Request Input *CreateProjectInput + Copy func(*CreateProjectInput) CreateProjectRequest } // Send marshals and sends the CreateProject API request. @@ -153,7 +156,7 @@ func (c *DeviceFarm) CreateProjectRequest(input *CreateProjectInput) CreateProje req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateProjectRequest{Request: req, Input: input} + return CreateProjectRequest{Request: req, Input: input, Copy: c.CreateProjectRequest} } const opCreateRemoteAccessSession = "CreateRemoteAccessSession" @@ -162,6 +165,7 @@ const opCreateRemoteAccessSession = "CreateRemoteAccessSession" type CreateRemoteAccessSessionRequest struct { *aws.Request Input *CreateRemoteAccessSessionInput + Copy func(*CreateRemoteAccessSessionInput) CreateRemoteAccessSessionRequest } // Send marshals and sends the CreateRemoteAccessSession API request. @@ -202,7 +206,7 @@ func (c *DeviceFarm) CreateRemoteAccessSessionRequest(input *CreateRemoteAccessS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRemoteAccessSessionRequest{Request: req, Input: input} + return CreateRemoteAccessSessionRequest{Request: req, Input: input, Copy: c.CreateRemoteAccessSessionRequest} } const opCreateUpload = "CreateUpload" @@ -211,6 +215,7 @@ const opCreateUpload = "CreateUpload" type CreateUploadRequest struct { *aws.Request Input *CreateUploadInput + Copy func(*CreateUploadInput) CreateUploadRequest } // Send marshals and sends the CreateUpload API request. @@ -251,7 +256,7 @@ func (c *DeviceFarm) CreateUploadRequest(input *CreateUploadInput) CreateUploadR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUploadRequest{Request: req, Input: input} + return CreateUploadRequest{Request: req, Input: input, Copy: c.CreateUploadRequest} } const opDeleteDevicePool = "DeleteDevicePool" @@ -260,6 +265,7 @@ const opDeleteDevicePool = "DeleteDevicePool" type DeleteDevicePoolRequest struct { *aws.Request Input *DeleteDevicePoolInput + Copy func(*DeleteDevicePoolInput) DeleteDevicePoolRequest } // Send marshals and sends the DeleteDevicePool API request. @@ -301,7 +307,7 @@ func (c *DeviceFarm) DeleteDevicePoolRequest(input *DeleteDevicePoolInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDevicePoolRequest{Request: req, Input: input} + return DeleteDevicePoolRequest{Request: req, Input: input, Copy: c.DeleteDevicePoolRequest} } const opDeleteNetworkProfile = "DeleteNetworkProfile" @@ -310,6 +316,7 @@ const opDeleteNetworkProfile = "DeleteNetworkProfile" type DeleteNetworkProfileRequest struct { *aws.Request Input *DeleteNetworkProfileInput + Copy func(*DeleteNetworkProfileInput) DeleteNetworkProfileRequest } // Send marshals and sends the DeleteNetworkProfile API request. @@ -350,7 +357,7 @@ func (c *DeviceFarm) DeleteNetworkProfileRequest(input *DeleteNetworkProfileInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteNetworkProfileRequest{Request: req, Input: input} + return DeleteNetworkProfileRequest{Request: req, Input: input, Copy: c.DeleteNetworkProfileRequest} } const opDeleteProject = "DeleteProject" @@ -359,6 +366,7 @@ const opDeleteProject = "DeleteProject" type DeleteProjectRequest struct { *aws.Request Input *DeleteProjectInput + Copy func(*DeleteProjectInput) DeleteProjectRequest } // Send marshals and sends the DeleteProject API request. @@ -401,7 +409,7 @@ func (c *DeviceFarm) DeleteProjectRequest(input *DeleteProjectInput) DeleteProje req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteProjectRequest{Request: req, Input: input} + return DeleteProjectRequest{Request: req, Input: input, Copy: c.DeleteProjectRequest} } const opDeleteRemoteAccessSession = "DeleteRemoteAccessSession" @@ -410,6 +418,7 @@ const opDeleteRemoteAccessSession = "DeleteRemoteAccessSession" type DeleteRemoteAccessSessionRequest struct { *aws.Request Input *DeleteRemoteAccessSessionInput + Copy func(*DeleteRemoteAccessSessionInput) DeleteRemoteAccessSessionRequest } // Send marshals and sends the DeleteRemoteAccessSession API request. @@ -450,7 +459,7 @@ func (c *DeviceFarm) DeleteRemoteAccessSessionRequest(input *DeleteRemoteAccessS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRemoteAccessSessionRequest{Request: req, Input: input} + return DeleteRemoteAccessSessionRequest{Request: req, Input: input, Copy: c.DeleteRemoteAccessSessionRequest} } const opDeleteRun = "DeleteRun" @@ -459,6 +468,7 @@ const opDeleteRun = "DeleteRun" type DeleteRunRequest struct { *aws.Request Input *DeleteRunInput + Copy func(*DeleteRunInput) DeleteRunRequest } // Send marshals and sends the DeleteRun API request. @@ -501,7 +511,7 @@ func (c *DeviceFarm) DeleteRunRequest(input *DeleteRunInput) DeleteRunRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRunRequest{Request: req, Input: input} + return DeleteRunRequest{Request: req, Input: input, Copy: c.DeleteRunRequest} } const opDeleteUpload = "DeleteUpload" @@ -510,6 +520,7 @@ const opDeleteUpload = "DeleteUpload" type DeleteUploadRequest struct { *aws.Request Input *DeleteUploadInput + Copy func(*DeleteUploadInput) DeleteUploadRequest } // Send marshals and sends the DeleteUpload API request. @@ -550,7 +561,7 @@ func (c *DeviceFarm) DeleteUploadRequest(input *DeleteUploadInput) DeleteUploadR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteUploadRequest{Request: req, Input: input} + return DeleteUploadRequest{Request: req, Input: input, Copy: c.DeleteUploadRequest} } const opGetAccountSettings = "GetAccountSettings" @@ -559,6 +570,7 @@ const opGetAccountSettings = "GetAccountSettings" type GetAccountSettingsRequest struct { *aws.Request Input *GetAccountSettingsInput + Copy func(*GetAccountSettingsInput) GetAccountSettingsRequest } // Send marshals and sends the GetAccountSettings API request. @@ -600,7 +612,7 @@ func (c *DeviceFarm) GetAccountSettingsRequest(input *GetAccountSettingsInput) G req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccountSettingsRequest{Request: req, Input: input} + return GetAccountSettingsRequest{Request: req, Input: input, Copy: c.GetAccountSettingsRequest} } const opGetDevice = "GetDevice" @@ -609,6 +621,7 @@ const opGetDevice = "GetDevice" type GetDeviceRequest struct { *aws.Request Input *GetDeviceInput + Copy func(*GetDeviceInput) GetDeviceRequest } // Send marshals and sends the GetDevice API request. @@ -649,7 +662,7 @@ func (c *DeviceFarm) GetDeviceRequest(input *GetDeviceInput) GetDeviceRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeviceRequest{Request: req, Input: input} + return GetDeviceRequest{Request: req, Input: input, Copy: c.GetDeviceRequest} } const opGetDevicePool = "GetDevicePool" @@ -658,6 +671,7 @@ const opGetDevicePool = "GetDevicePool" type GetDevicePoolRequest struct { *aws.Request Input *GetDevicePoolInput + Copy func(*GetDevicePoolInput) GetDevicePoolRequest } // Send marshals and sends the GetDevicePool API request. @@ -698,7 +712,7 @@ func (c *DeviceFarm) GetDevicePoolRequest(input *GetDevicePoolInput) GetDevicePo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDevicePoolRequest{Request: req, Input: input} + return GetDevicePoolRequest{Request: req, Input: input, Copy: c.GetDevicePoolRequest} } const opGetDevicePoolCompatibility = "GetDevicePoolCompatibility" @@ -707,6 +721,7 @@ const opGetDevicePoolCompatibility = "GetDevicePoolCompatibility" type GetDevicePoolCompatibilityRequest struct { *aws.Request Input *GetDevicePoolCompatibilityInput + Copy func(*GetDevicePoolCompatibilityInput) GetDevicePoolCompatibilityRequest } // Send marshals and sends the GetDevicePoolCompatibility API request. @@ -747,7 +762,7 @@ func (c *DeviceFarm) GetDevicePoolCompatibilityRequest(input *GetDevicePoolCompa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDevicePoolCompatibilityRequest{Request: req, Input: input} + return GetDevicePoolCompatibilityRequest{Request: req, Input: input, Copy: c.GetDevicePoolCompatibilityRequest} } const opGetJob = "GetJob" @@ -756,6 +771,7 @@ const opGetJob = "GetJob" type GetJobRequest struct { *aws.Request Input *GetJobInput + Copy func(*GetJobInput) GetJobRequest } // Send marshals and sends the GetJob API request. @@ -796,7 +812,7 @@ func (c *DeviceFarm) GetJobRequest(input *GetJobInput) GetJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobRequest{Request: req, Input: input} + return GetJobRequest{Request: req, Input: input, Copy: c.GetJobRequest} } const opGetNetworkProfile = "GetNetworkProfile" @@ -805,6 +821,7 @@ const opGetNetworkProfile = "GetNetworkProfile" type GetNetworkProfileRequest struct { *aws.Request Input *GetNetworkProfileInput + Copy func(*GetNetworkProfileInput) GetNetworkProfileRequest } // Send marshals and sends the GetNetworkProfile API request. @@ -845,7 +862,7 @@ func (c *DeviceFarm) GetNetworkProfileRequest(input *GetNetworkProfileInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetNetworkProfileRequest{Request: req, Input: input} + return GetNetworkProfileRequest{Request: req, Input: input, Copy: c.GetNetworkProfileRequest} } const opGetOfferingStatus = "GetOfferingStatus" @@ -854,6 +871,7 @@ const opGetOfferingStatus = "GetOfferingStatus" type GetOfferingStatusRequest struct { *aws.Request Input *GetOfferingStatusInput + Copy func(*GetOfferingStatusInput) GetOfferingStatusRequest } // Send marshals and sends the GetOfferingStatus API request. @@ -905,57 +923,53 @@ func (c *DeviceFarm) GetOfferingStatusRequest(input *GetOfferingStatusInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOfferingStatusRequest{Request: req, Input: input} + return GetOfferingStatusRequest{Request: req, Input: input, Copy: c.GetOfferingStatusRequest} } -// GetOfferingStatusPages iterates over the pages of a GetOfferingStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetOfferingStatus method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetOfferingStatusRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetOfferingStatus operation. -// pageNum := 0 -// err := client.GetOfferingStatusPages(params, -// func(page *GetOfferingStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) GetOfferingStatusPages(input *GetOfferingStatusInput, fn func(*GetOfferingStatusOutput, bool) bool) error { - return c.GetOfferingStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetOfferingStatusPagesWithContext same as GetOfferingStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) GetOfferingStatusPagesWithContext(ctx aws.Context, input *GetOfferingStatusInput, fn func(*GetOfferingStatusOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetOfferingStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetOfferingStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetOfferingStatusRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetOfferingStatusRequest) Paginate(opts ...aws.Option) GetOfferingStatusPager { + return GetOfferingStatusPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetOfferingStatusInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetOfferingStatusOutput), !p.HasNextPage()) - } - return p.Err() +// GetOfferingStatusPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetOfferingStatusPager struct { + aws.Pager +} + +func (p *GetOfferingStatusPager) CurrentPage() *GetOfferingStatusOutput { + return p.Pager.CurrentPage().(*GetOfferingStatusOutput) } const opGetProject = "GetProject" @@ -964,6 +978,7 @@ const opGetProject = "GetProject" type GetProjectRequest struct { *aws.Request Input *GetProjectInput + Copy func(*GetProjectInput) GetProjectRequest } // Send marshals and sends the GetProject API request. @@ -1004,7 +1019,7 @@ func (c *DeviceFarm) GetProjectRequest(input *GetProjectInput) GetProjectRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetProjectRequest{Request: req, Input: input} + return GetProjectRequest{Request: req, Input: input, Copy: c.GetProjectRequest} } const opGetRemoteAccessSession = "GetRemoteAccessSession" @@ -1013,6 +1028,7 @@ const opGetRemoteAccessSession = "GetRemoteAccessSession" type GetRemoteAccessSessionRequest struct { *aws.Request Input *GetRemoteAccessSessionInput + Copy func(*GetRemoteAccessSessionInput) GetRemoteAccessSessionRequest } // Send marshals and sends the GetRemoteAccessSession API request. @@ -1053,7 +1069,7 @@ func (c *DeviceFarm) GetRemoteAccessSessionRequest(input *GetRemoteAccessSession req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRemoteAccessSessionRequest{Request: req, Input: input} + return GetRemoteAccessSessionRequest{Request: req, Input: input, Copy: c.GetRemoteAccessSessionRequest} } const opGetRun = "GetRun" @@ -1062,6 +1078,7 @@ const opGetRun = "GetRun" type GetRunRequest struct { *aws.Request Input *GetRunInput + Copy func(*GetRunInput) GetRunRequest } // Send marshals and sends the GetRun API request. @@ -1102,7 +1119,7 @@ func (c *DeviceFarm) GetRunRequest(input *GetRunInput) GetRunRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRunRequest{Request: req, Input: input} + return GetRunRequest{Request: req, Input: input, Copy: c.GetRunRequest} } const opGetSuite = "GetSuite" @@ -1111,6 +1128,7 @@ const opGetSuite = "GetSuite" type GetSuiteRequest struct { *aws.Request Input *GetSuiteInput + Copy func(*GetSuiteInput) GetSuiteRequest } // Send marshals and sends the GetSuite API request. @@ -1151,7 +1169,7 @@ func (c *DeviceFarm) GetSuiteRequest(input *GetSuiteInput) GetSuiteRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSuiteRequest{Request: req, Input: input} + return GetSuiteRequest{Request: req, Input: input, Copy: c.GetSuiteRequest} } const opGetTest = "GetTest" @@ -1160,6 +1178,7 @@ const opGetTest = "GetTest" type GetTestRequest struct { *aws.Request Input *GetTestInput + Copy func(*GetTestInput) GetTestRequest } // Send marshals and sends the GetTest API request. @@ -1200,7 +1219,7 @@ func (c *DeviceFarm) GetTestRequest(input *GetTestInput) GetTestRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTestRequest{Request: req, Input: input} + return GetTestRequest{Request: req, Input: input, Copy: c.GetTestRequest} } const opGetUpload = "GetUpload" @@ -1209,6 +1228,7 @@ const opGetUpload = "GetUpload" type GetUploadRequest struct { *aws.Request Input *GetUploadInput + Copy func(*GetUploadInput) GetUploadRequest } // Send marshals and sends the GetUpload API request. @@ -1249,7 +1269,7 @@ func (c *DeviceFarm) GetUploadRequest(input *GetUploadInput) GetUploadRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUploadRequest{Request: req, Input: input} + return GetUploadRequest{Request: req, Input: input, Copy: c.GetUploadRequest} } const opInstallToRemoteAccessSession = "InstallToRemoteAccessSession" @@ -1258,6 +1278,7 @@ const opInstallToRemoteAccessSession = "InstallToRemoteAccessSession" type InstallToRemoteAccessSessionRequest struct { *aws.Request Input *InstallToRemoteAccessSessionInput + Copy func(*InstallToRemoteAccessSessionInput) InstallToRemoteAccessSessionRequest } // Send marshals and sends the InstallToRemoteAccessSession API request. @@ -1300,7 +1321,7 @@ func (c *DeviceFarm) InstallToRemoteAccessSessionRequest(input *InstallToRemoteA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InstallToRemoteAccessSessionRequest{Request: req, Input: input} + return InstallToRemoteAccessSessionRequest{Request: req, Input: input, Copy: c.InstallToRemoteAccessSessionRequest} } const opListArtifacts = "ListArtifacts" @@ -1309,6 +1330,7 @@ const opListArtifacts = "ListArtifacts" type ListArtifactsRequest struct { *aws.Request Input *ListArtifactsInput + Copy func(*ListArtifactsInput) ListArtifactsRequest } // Send marshals and sends the ListArtifacts API request. @@ -1355,57 +1377,53 @@ func (c *DeviceFarm) ListArtifactsRequest(input *ListArtifactsInput) ListArtifac req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListArtifactsRequest{Request: req, Input: input} + return ListArtifactsRequest{Request: req, Input: input, Copy: c.ListArtifactsRequest} } -// ListArtifactsPages iterates over the pages of a ListArtifacts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListArtifacts method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListArtifactsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListArtifacts operation. -// pageNum := 0 -// err := client.ListArtifactsPages(params, -// func(page *ListArtifactsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListArtifactsPages(input *ListArtifactsInput, fn func(*ListArtifactsOutput, bool) bool) error { - return c.ListArtifactsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListArtifactsPagesWithContext same as ListArtifactsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListArtifactsPagesWithContext(ctx aws.Context, input *ListArtifactsInput, fn func(*ListArtifactsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListArtifactsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListArtifactsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListArtifactsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListArtifactsRequest) Paginate(opts ...aws.Option) ListArtifactsPager { + return ListArtifactsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListArtifactsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListArtifactsOutput), !p.HasNextPage()) - } - return p.Err() +// ListArtifactsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListArtifactsPager struct { + aws.Pager +} + +func (p *ListArtifactsPager) CurrentPage() *ListArtifactsOutput { + return p.Pager.CurrentPage().(*ListArtifactsOutput) } const opListDevicePools = "ListDevicePools" @@ -1414,6 +1432,7 @@ const opListDevicePools = "ListDevicePools" type ListDevicePoolsRequest struct { *aws.Request Input *ListDevicePoolsInput + Copy func(*ListDevicePoolsInput) ListDevicePoolsRequest } // Send marshals and sends the ListDevicePools API request. @@ -1460,57 +1479,53 @@ func (c *DeviceFarm) ListDevicePoolsRequest(input *ListDevicePoolsInput) ListDev req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDevicePoolsRequest{Request: req, Input: input} + return ListDevicePoolsRequest{Request: req, Input: input, Copy: c.ListDevicePoolsRequest} } -// ListDevicePoolsPages iterates over the pages of a ListDevicePools operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDevicePools method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDevicePoolsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDevicePools operation. -// pageNum := 0 -// err := client.ListDevicePoolsPages(params, -// func(page *ListDevicePoolsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListDevicePoolsPages(input *ListDevicePoolsInput, fn func(*ListDevicePoolsOutput, bool) bool) error { - return c.ListDevicePoolsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDevicePoolsPagesWithContext same as ListDevicePoolsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListDevicePoolsPagesWithContext(ctx aws.Context, input *ListDevicePoolsInput, fn func(*ListDevicePoolsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDevicePoolsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDevicePoolsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDevicePoolsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDevicePoolsRequest) Paginate(opts ...aws.Option) ListDevicePoolsPager { + return ListDevicePoolsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDevicePoolsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDevicePoolsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDevicePoolsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDevicePoolsPager struct { + aws.Pager +} + +func (p *ListDevicePoolsPager) CurrentPage() *ListDevicePoolsOutput { + return p.Pager.CurrentPage().(*ListDevicePoolsOutput) } const opListDevices = "ListDevices" @@ -1519,6 +1534,7 @@ const opListDevices = "ListDevices" type ListDevicesRequest struct { *aws.Request Input *ListDevicesInput + Copy func(*ListDevicesInput) ListDevicesRequest } // Send marshals and sends the ListDevices API request. @@ -1565,57 +1581,53 @@ func (c *DeviceFarm) ListDevicesRequest(input *ListDevicesInput) ListDevicesRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDevicesRequest{Request: req, Input: input} + return ListDevicesRequest{Request: req, Input: input, Copy: c.ListDevicesRequest} } -// ListDevicesPages iterates over the pages of a ListDevices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDevices method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDevicesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDevices operation. -// pageNum := 0 -// err := client.ListDevicesPages(params, -// func(page *ListDevicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListDevicesPages(input *ListDevicesInput, fn func(*ListDevicesOutput, bool) bool) error { - return c.ListDevicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDevicesPagesWithContext same as ListDevicesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListDevicesPagesWithContext(ctx aws.Context, input *ListDevicesInput, fn func(*ListDevicesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDevicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDevicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDevicesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDevicesRequest) Paginate(opts ...aws.Option) ListDevicesPager { + return ListDevicesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDevicesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDevicesOutput), !p.HasNextPage()) - } - return p.Err() +// ListDevicesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDevicesPager struct { + aws.Pager +} + +func (p *ListDevicesPager) CurrentPage() *ListDevicesOutput { + return p.Pager.CurrentPage().(*ListDevicesOutput) } const opListJobs = "ListJobs" @@ -1624,6 +1636,7 @@ const opListJobs = "ListJobs" type ListJobsRequest struct { *aws.Request Input *ListJobsInput + Copy func(*ListJobsInput) ListJobsRequest } // Send marshals and sends the ListJobs API request. @@ -1670,57 +1683,53 @@ func (c *DeviceFarm) ListJobsRequest(input *ListJobsInput) ListJobsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobsRequest{Request: req, Input: input} + return ListJobsRequest{Request: req, Input: input, Copy: c.ListJobsRequest} } -// ListJobsPages iterates over the pages of a ListJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListJobs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListJobsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListJobs operation. -// pageNum := 0 -// err := client.ListJobsPages(params, -// func(page *ListJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListJobsPages(input *ListJobsInput, fn func(*ListJobsOutput, bool) bool) error { - return c.ListJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListJobsPagesWithContext same as ListJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsInput, fn func(*ListJobsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListJobsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListJobsRequest) Paginate(opts ...aws.Option) ListJobsPager { + return ListJobsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListJobsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) - } - return p.Err() +// ListJobsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListJobsPager struct { + aws.Pager +} + +func (p *ListJobsPager) CurrentPage() *ListJobsOutput { + return p.Pager.CurrentPage().(*ListJobsOutput) } const opListNetworkProfiles = "ListNetworkProfiles" @@ -1729,6 +1738,7 @@ const opListNetworkProfiles = "ListNetworkProfiles" type ListNetworkProfilesRequest struct { *aws.Request Input *ListNetworkProfilesInput + Copy func(*ListNetworkProfilesInput) ListNetworkProfilesRequest } // Send marshals and sends the ListNetworkProfiles API request. @@ -1769,7 +1779,7 @@ func (c *DeviceFarm) ListNetworkProfilesRequest(input *ListNetworkProfilesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListNetworkProfilesRequest{Request: req, Input: input} + return ListNetworkProfilesRequest{Request: req, Input: input, Copy: c.ListNetworkProfilesRequest} } const opListOfferingPromotions = "ListOfferingPromotions" @@ -1778,6 +1788,7 @@ const opListOfferingPromotions = "ListOfferingPromotions" type ListOfferingPromotionsRequest struct { *aws.Request Input *ListOfferingPromotionsInput + Copy func(*ListOfferingPromotionsInput) ListOfferingPromotionsRequest } // Send marshals and sends the ListOfferingPromotions API request. @@ -1822,7 +1833,7 @@ func (c *DeviceFarm) ListOfferingPromotionsRequest(input *ListOfferingPromotions req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOfferingPromotionsRequest{Request: req, Input: input} + return ListOfferingPromotionsRequest{Request: req, Input: input, Copy: c.ListOfferingPromotionsRequest} } const opListOfferingTransactions = "ListOfferingTransactions" @@ -1831,6 +1842,7 @@ const opListOfferingTransactions = "ListOfferingTransactions" type ListOfferingTransactionsRequest struct { *aws.Request Input *ListOfferingTransactionsInput + Copy func(*ListOfferingTransactionsInput) ListOfferingTransactionsRequest } // Send marshals and sends the ListOfferingTransactions API request. @@ -1882,57 +1894,53 @@ func (c *DeviceFarm) ListOfferingTransactionsRequest(input *ListOfferingTransact req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOfferingTransactionsRequest{Request: req, Input: input} + return ListOfferingTransactionsRequest{Request: req, Input: input, Copy: c.ListOfferingTransactionsRequest} } -// ListOfferingTransactionsPages iterates over the pages of a ListOfferingTransactions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOfferingTransactions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListOfferingTransactionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListOfferingTransactions operation. -// pageNum := 0 -// err := client.ListOfferingTransactionsPages(params, -// func(page *ListOfferingTransactionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListOfferingTransactionsPages(input *ListOfferingTransactionsInput, fn func(*ListOfferingTransactionsOutput, bool) bool) error { - return c.ListOfferingTransactionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOfferingTransactionsPagesWithContext same as ListOfferingTransactionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListOfferingTransactionsPagesWithContext(ctx aws.Context, input *ListOfferingTransactionsInput, fn func(*ListOfferingTransactionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListOfferingTransactionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListOfferingTransactionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListOfferingTransactionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListOfferingTransactionsRequest) Paginate(opts ...aws.Option) ListOfferingTransactionsPager { + return ListOfferingTransactionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListOfferingTransactionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOfferingTransactionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListOfferingTransactionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListOfferingTransactionsPager struct { + aws.Pager +} + +func (p *ListOfferingTransactionsPager) CurrentPage() *ListOfferingTransactionsOutput { + return p.Pager.CurrentPage().(*ListOfferingTransactionsOutput) } const opListOfferings = "ListOfferings" @@ -1941,6 +1949,7 @@ const opListOfferings = "ListOfferings" type ListOfferingsRequest struct { *aws.Request Input *ListOfferingsInput + Copy func(*ListOfferingsInput) ListOfferingsRequest } // Send marshals and sends the ListOfferings API request. @@ -1992,57 +2001,53 @@ func (c *DeviceFarm) ListOfferingsRequest(input *ListOfferingsInput) ListOfferin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOfferingsRequest{Request: req, Input: input} + return ListOfferingsRequest{Request: req, Input: input, Copy: c.ListOfferingsRequest} } -// ListOfferingsPages iterates over the pages of a ListOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOfferings method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListOfferingsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListOfferings operation. -// pageNum := 0 -// err := client.ListOfferingsPages(params, -// func(page *ListOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListOfferingsPages(input *ListOfferingsInput, fn func(*ListOfferingsOutput, bool) bool) error { - return c.ListOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOfferingsPagesWithContext same as ListOfferingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListOfferingsPagesWithContext(ctx aws.Context, input *ListOfferingsInput, fn func(*ListOfferingsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListOfferingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListOfferingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListOfferingsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListOfferingsRequest) Paginate(opts ...aws.Option) ListOfferingsPager { + return ListOfferingsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListOfferingsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOfferingsOutput), !p.HasNextPage()) - } - return p.Err() +// ListOfferingsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListOfferingsPager struct { + aws.Pager +} + +func (p *ListOfferingsPager) CurrentPage() *ListOfferingsOutput { + return p.Pager.CurrentPage().(*ListOfferingsOutput) } const opListProjects = "ListProjects" @@ -2051,6 +2056,7 @@ const opListProjects = "ListProjects" type ListProjectsRequest struct { *aws.Request Input *ListProjectsInput + Copy func(*ListProjectsInput) ListProjectsRequest } // Send marshals and sends the ListProjects API request. @@ -2097,57 +2103,53 @@ func (c *DeviceFarm) ListProjectsRequest(input *ListProjectsInput) ListProjectsR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListProjectsRequest{Request: req, Input: input} + return ListProjectsRequest{Request: req, Input: input, Copy: c.ListProjectsRequest} } -// ListProjectsPages iterates over the pages of a ListProjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProjects method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListProjectsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListProjects operation. -// pageNum := 0 -// err := client.ListProjectsPages(params, -// func(page *ListProjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListProjectsPages(input *ListProjectsInput, fn func(*ListProjectsOutput, bool) bool) error { - return c.ListProjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProjectsPagesWithContext same as ListProjectsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListProjectsPagesWithContext(ctx aws.Context, input *ListProjectsInput, fn func(*ListProjectsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListProjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListProjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListProjectsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListProjectsRequest) Paginate(opts ...aws.Option) ListProjectsPager { + return ListProjectsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListProjectsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListProjectsOutput), !p.HasNextPage()) - } - return p.Err() +// ListProjectsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListProjectsPager struct { + aws.Pager +} + +func (p *ListProjectsPager) CurrentPage() *ListProjectsOutput { + return p.Pager.CurrentPage().(*ListProjectsOutput) } const opListRemoteAccessSessions = "ListRemoteAccessSessions" @@ -2156,6 +2158,7 @@ const opListRemoteAccessSessions = "ListRemoteAccessSessions" type ListRemoteAccessSessionsRequest struct { *aws.Request Input *ListRemoteAccessSessionsInput + Copy func(*ListRemoteAccessSessionsInput) ListRemoteAccessSessionsRequest } // Send marshals and sends the ListRemoteAccessSessions API request. @@ -2196,7 +2199,7 @@ func (c *DeviceFarm) ListRemoteAccessSessionsRequest(input *ListRemoteAccessSess req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRemoteAccessSessionsRequest{Request: req, Input: input} + return ListRemoteAccessSessionsRequest{Request: req, Input: input, Copy: c.ListRemoteAccessSessionsRequest} } const opListRuns = "ListRuns" @@ -2205,6 +2208,7 @@ const opListRuns = "ListRuns" type ListRunsRequest struct { *aws.Request Input *ListRunsInput + Copy func(*ListRunsInput) ListRunsRequest } // Send marshals and sends the ListRuns API request. @@ -2251,57 +2255,53 @@ func (c *DeviceFarm) ListRunsRequest(input *ListRunsInput) ListRunsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRunsRequest{Request: req, Input: input} + return ListRunsRequest{Request: req, Input: input, Copy: c.ListRunsRequest} } -// ListRunsPages iterates over the pages of a ListRuns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRuns method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListRunsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListRuns operation. -// pageNum := 0 -// err := client.ListRunsPages(params, -// func(page *ListRunsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListRunsPages(input *ListRunsInput, fn func(*ListRunsOutput, bool) bool) error { - return c.ListRunsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRunsPagesWithContext same as ListRunsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListRunsPagesWithContext(ctx aws.Context, input *ListRunsInput, fn func(*ListRunsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListRunsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListRunsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListRunsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListRunsRequest) Paginate(opts ...aws.Option) ListRunsPager { + return ListRunsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListRunsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRunsOutput), !p.HasNextPage()) - } - return p.Err() +// ListRunsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListRunsPager struct { + aws.Pager +} + +func (p *ListRunsPager) CurrentPage() *ListRunsOutput { + return p.Pager.CurrentPage().(*ListRunsOutput) } const opListSamples = "ListSamples" @@ -2310,6 +2310,7 @@ const opListSamples = "ListSamples" type ListSamplesRequest struct { *aws.Request Input *ListSamplesInput + Copy func(*ListSamplesInput) ListSamplesRequest } // Send marshals and sends the ListSamples API request. @@ -2356,57 +2357,53 @@ func (c *DeviceFarm) ListSamplesRequest(input *ListSamplesInput) ListSamplesRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSamplesRequest{Request: req, Input: input} + return ListSamplesRequest{Request: req, Input: input, Copy: c.ListSamplesRequest} } -// ListSamplesPages iterates over the pages of a ListSamples operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSamples method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListSamplesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListSamples operation. -// pageNum := 0 -// err := client.ListSamplesPages(params, -// func(page *ListSamplesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListSamplesPages(input *ListSamplesInput, fn func(*ListSamplesOutput, bool) bool) error { - return c.ListSamplesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSamplesPagesWithContext same as ListSamplesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListSamplesPagesWithContext(ctx aws.Context, input *ListSamplesInput, fn func(*ListSamplesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListSamplesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListSamplesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListSamplesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListSamplesRequest) Paginate(opts ...aws.Option) ListSamplesPager { + return ListSamplesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListSamplesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSamplesOutput), !p.HasNextPage()) - } - return p.Err() +// ListSamplesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListSamplesPager struct { + aws.Pager +} + +func (p *ListSamplesPager) CurrentPage() *ListSamplesOutput { + return p.Pager.CurrentPage().(*ListSamplesOutput) } const opListSuites = "ListSuites" @@ -2415,6 +2412,7 @@ const opListSuites = "ListSuites" type ListSuitesRequest struct { *aws.Request Input *ListSuitesInput + Copy func(*ListSuitesInput) ListSuitesRequest } // Send marshals and sends the ListSuites API request. @@ -2461,57 +2459,53 @@ func (c *DeviceFarm) ListSuitesRequest(input *ListSuitesInput) ListSuitesRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSuitesRequest{Request: req, Input: input} + return ListSuitesRequest{Request: req, Input: input, Copy: c.ListSuitesRequest} } -// ListSuitesPages iterates over the pages of a ListSuites operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSuites method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListSuitesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListSuites operation. -// pageNum := 0 -// err := client.ListSuitesPages(params, -// func(page *ListSuitesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListSuitesPages(input *ListSuitesInput, fn func(*ListSuitesOutput, bool) bool) error { - return c.ListSuitesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSuitesPagesWithContext same as ListSuitesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListSuitesPagesWithContext(ctx aws.Context, input *ListSuitesInput, fn func(*ListSuitesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListSuitesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListSuitesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListSuitesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListSuitesRequest) Paginate(opts ...aws.Option) ListSuitesPager { + return ListSuitesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListSuitesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSuitesOutput), !p.HasNextPage()) - } - return p.Err() +// ListSuitesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListSuitesPager struct { + aws.Pager +} + +func (p *ListSuitesPager) CurrentPage() *ListSuitesOutput { + return p.Pager.CurrentPage().(*ListSuitesOutput) } const opListTests = "ListTests" @@ -2520,6 +2514,7 @@ const opListTests = "ListTests" type ListTestsRequest struct { *aws.Request Input *ListTestsInput + Copy func(*ListTestsInput) ListTestsRequest } // Send marshals and sends the ListTests API request. @@ -2566,57 +2561,53 @@ func (c *DeviceFarm) ListTestsRequest(input *ListTestsInput) ListTestsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTestsRequest{Request: req, Input: input} + return ListTestsRequest{Request: req, Input: input, Copy: c.ListTestsRequest} } -// ListTestsPages iterates over the pages of a ListTests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTests method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTestsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTests operation. -// pageNum := 0 -// err := client.ListTestsPages(params, -// func(page *ListTestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListTestsPages(input *ListTestsInput, fn func(*ListTestsOutput, bool) bool) error { - return c.ListTestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTestsPagesWithContext same as ListTestsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListTestsPagesWithContext(ctx aws.Context, input *ListTestsInput, fn func(*ListTestsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTestsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTestsRequest) Paginate(opts ...aws.Option) ListTestsPager { + return ListTestsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTestsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTestsOutput), !p.HasNextPage()) - } - return p.Err() +// ListTestsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTestsPager struct { + aws.Pager +} + +func (p *ListTestsPager) CurrentPage() *ListTestsOutput { + return p.Pager.CurrentPage().(*ListTestsOutput) } const opListUniqueProblems = "ListUniqueProblems" @@ -2625,6 +2616,7 @@ const opListUniqueProblems = "ListUniqueProblems" type ListUniqueProblemsRequest struct { *aws.Request Input *ListUniqueProblemsInput + Copy func(*ListUniqueProblemsInput) ListUniqueProblemsRequest } // Send marshals and sends the ListUniqueProblems API request. @@ -2671,57 +2663,53 @@ func (c *DeviceFarm) ListUniqueProblemsRequest(input *ListUniqueProblemsInput) L req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUniqueProblemsRequest{Request: req, Input: input} + return ListUniqueProblemsRequest{Request: req, Input: input, Copy: c.ListUniqueProblemsRequest} } -// ListUniqueProblemsPages iterates over the pages of a ListUniqueProblems operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUniqueProblems method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListUniqueProblemsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListUniqueProblems operation. -// pageNum := 0 -// err := client.ListUniqueProblemsPages(params, -// func(page *ListUniqueProblemsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListUniqueProblemsPages(input *ListUniqueProblemsInput, fn func(*ListUniqueProblemsOutput, bool) bool) error { - return c.ListUniqueProblemsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListUniqueProblemsPagesWithContext same as ListUniqueProblemsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListUniqueProblemsPagesWithContext(ctx aws.Context, input *ListUniqueProblemsInput, fn func(*ListUniqueProblemsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListUniqueProblemsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListUniqueProblemsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListUniqueProblemsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListUniqueProblemsRequest) Paginate(opts ...aws.Option) ListUniqueProblemsPager { + return ListUniqueProblemsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListUniqueProblemsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUniqueProblemsOutput), !p.HasNextPage()) - } - return p.Err() +// ListUniqueProblemsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListUniqueProblemsPager struct { + aws.Pager +} + +func (p *ListUniqueProblemsPager) CurrentPage() *ListUniqueProblemsOutput { + return p.Pager.CurrentPage().(*ListUniqueProblemsOutput) } const opListUploads = "ListUploads" @@ -2730,6 +2718,7 @@ const opListUploads = "ListUploads" type ListUploadsRequest struct { *aws.Request Input *ListUploadsInput + Copy func(*ListUploadsInput) ListUploadsRequest } // Send marshals and sends the ListUploads API request. @@ -2776,57 +2765,53 @@ func (c *DeviceFarm) ListUploadsRequest(input *ListUploadsInput) ListUploadsRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUploadsRequest{Request: req, Input: input} + return ListUploadsRequest{Request: req, Input: input, Copy: c.ListUploadsRequest} } -// ListUploadsPages iterates over the pages of a ListUploads operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUploads method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListUploadsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListUploads operation. -// pageNum := 0 -// err := client.ListUploadsPages(params, -// func(page *ListUploadsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DeviceFarm) ListUploadsPages(input *ListUploadsInput, fn func(*ListUploadsOutput, bool) bool) error { - return c.ListUploadsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListUploadsPagesWithContext same as ListUploadsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DeviceFarm) ListUploadsPagesWithContext(ctx aws.Context, input *ListUploadsInput, fn func(*ListUploadsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListUploadsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListUploadsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListUploadsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListUploadsRequest) Paginate(opts ...aws.Option) ListUploadsPager { + return ListUploadsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListUploadsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUploadsOutput), !p.HasNextPage()) - } - return p.Err() +// ListUploadsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListUploadsPager struct { + aws.Pager +} + +func (p *ListUploadsPager) CurrentPage() *ListUploadsOutput { + return p.Pager.CurrentPage().(*ListUploadsOutput) } const opPurchaseOffering = "PurchaseOffering" @@ -2835,6 +2820,7 @@ const opPurchaseOffering = "PurchaseOffering" type PurchaseOfferingRequest struct { *aws.Request Input *PurchaseOfferingInput + Copy func(*PurchaseOfferingInput) PurchaseOfferingRequest } // Send marshals and sends the PurchaseOffering API request. @@ -2880,7 +2866,7 @@ func (c *DeviceFarm) PurchaseOfferingRequest(input *PurchaseOfferingInput) Purch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PurchaseOfferingRequest{Request: req, Input: input} + return PurchaseOfferingRequest{Request: req, Input: input, Copy: c.PurchaseOfferingRequest} } const opRenewOffering = "RenewOffering" @@ -2889,6 +2875,7 @@ const opRenewOffering = "RenewOffering" type RenewOfferingRequest struct { *aws.Request Input *RenewOfferingInput + Copy func(*RenewOfferingInput) RenewOfferingRequest } // Send marshals and sends the RenewOffering API request. @@ -2933,7 +2920,7 @@ func (c *DeviceFarm) RenewOfferingRequest(input *RenewOfferingInput) RenewOfferi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RenewOfferingRequest{Request: req, Input: input} + return RenewOfferingRequest{Request: req, Input: input, Copy: c.RenewOfferingRequest} } const opScheduleRun = "ScheduleRun" @@ -2942,6 +2929,7 @@ const opScheduleRun = "ScheduleRun" type ScheduleRunRequest struct { *aws.Request Input *ScheduleRunInput + Copy func(*ScheduleRunInput) ScheduleRunRequest } // Send marshals and sends the ScheduleRun API request. @@ -2982,7 +2970,7 @@ func (c *DeviceFarm) ScheduleRunRequest(input *ScheduleRunInput) ScheduleRunRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ScheduleRunRequest{Request: req, Input: input} + return ScheduleRunRequest{Request: req, Input: input, Copy: c.ScheduleRunRequest} } const opStopRemoteAccessSession = "StopRemoteAccessSession" @@ -2991,6 +2979,7 @@ const opStopRemoteAccessSession = "StopRemoteAccessSession" type StopRemoteAccessSessionRequest struct { *aws.Request Input *StopRemoteAccessSessionInput + Copy func(*StopRemoteAccessSessionInput) StopRemoteAccessSessionRequest } // Send marshals and sends the StopRemoteAccessSession API request. @@ -3031,7 +3020,7 @@ func (c *DeviceFarm) StopRemoteAccessSessionRequest(input *StopRemoteAccessSessi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopRemoteAccessSessionRequest{Request: req, Input: input} + return StopRemoteAccessSessionRequest{Request: req, Input: input, Copy: c.StopRemoteAccessSessionRequest} } const opStopRun = "StopRun" @@ -3040,6 +3029,7 @@ const opStopRun = "StopRun" type StopRunRequest struct { *aws.Request Input *StopRunInput + Copy func(*StopRunInput) StopRunRequest } // Send marshals and sends the StopRun API request. @@ -3085,7 +3075,7 @@ func (c *DeviceFarm) StopRunRequest(input *StopRunInput) StopRunRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopRunRequest{Request: req, Input: input} + return StopRunRequest{Request: req, Input: input, Copy: c.StopRunRequest} } const opUpdateDevicePool = "UpdateDevicePool" @@ -3094,6 +3084,7 @@ const opUpdateDevicePool = "UpdateDevicePool" type UpdateDevicePoolRequest struct { *aws.Request Input *UpdateDevicePoolInput + Copy func(*UpdateDevicePoolInput) UpdateDevicePoolRequest } // Send marshals and sends the UpdateDevicePool API request. @@ -3136,7 +3127,7 @@ func (c *DeviceFarm) UpdateDevicePoolRequest(input *UpdateDevicePoolInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDevicePoolRequest{Request: req, Input: input} + return UpdateDevicePoolRequest{Request: req, Input: input, Copy: c.UpdateDevicePoolRequest} } const opUpdateNetworkProfile = "UpdateNetworkProfile" @@ -3145,6 +3136,7 @@ const opUpdateNetworkProfile = "UpdateNetworkProfile" type UpdateNetworkProfileRequest struct { *aws.Request Input *UpdateNetworkProfileInput + Copy func(*UpdateNetworkProfileInput) UpdateNetworkProfileRequest } // Send marshals and sends the UpdateNetworkProfile API request. @@ -3185,7 +3177,7 @@ func (c *DeviceFarm) UpdateNetworkProfileRequest(input *UpdateNetworkProfileInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateNetworkProfileRequest{Request: req, Input: input} + return UpdateNetworkProfileRequest{Request: req, Input: input, Copy: c.UpdateNetworkProfileRequest} } const opUpdateProject = "UpdateProject" @@ -3194,6 +3186,7 @@ const opUpdateProject = "UpdateProject" type UpdateProjectRequest struct { *aws.Request Input *UpdateProjectInput + Copy func(*UpdateProjectInput) UpdateProjectRequest } // Send marshals and sends the UpdateProject API request. @@ -3234,7 +3227,7 @@ func (c *DeviceFarm) UpdateProjectRequest(input *UpdateProjectInput) UpdateProje req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateProjectRequest{Request: req, Input: input} + return UpdateProjectRequest{Request: req, Input: input, Copy: c.UpdateProjectRequest} } // A container for account-level settings within AWS Device Farm. diff --git a/service/devicefarm/devicefarmiface/interface.go b/service/devicefarm/devicefarmiface/interface.go index a4784ca8de4..2d025f18695 100644 --- a/service/devicefarm/devicefarmiface/interface.go +++ b/service/devicefarm/devicefarmiface/interface.go @@ -9,7 +9,6 @@ package devicefarmiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/devicefarm" ) @@ -99,9 +98,6 @@ type DeviceFarmAPI interface { GetOfferingStatusRequest(*devicefarm.GetOfferingStatusInput) devicefarm.GetOfferingStatusRequest - GetOfferingStatusPages(*devicefarm.GetOfferingStatusInput, func(*devicefarm.GetOfferingStatusOutput, bool) bool) error - GetOfferingStatusPagesWithContext(aws.Context, *devicefarm.GetOfferingStatusInput, func(*devicefarm.GetOfferingStatusOutput, bool) bool, ...aws.Option) error - GetProjectRequest(*devicefarm.GetProjectInput) devicefarm.GetProjectRequest GetRemoteAccessSessionRequest(*devicefarm.GetRemoteAccessSessionInput) devicefarm.GetRemoteAccessSessionRequest @@ -118,75 +114,36 @@ type DeviceFarmAPI interface { ListArtifactsRequest(*devicefarm.ListArtifactsInput) devicefarm.ListArtifactsRequest - ListArtifactsPages(*devicefarm.ListArtifactsInput, func(*devicefarm.ListArtifactsOutput, bool) bool) error - ListArtifactsPagesWithContext(aws.Context, *devicefarm.ListArtifactsInput, func(*devicefarm.ListArtifactsOutput, bool) bool, ...aws.Option) error - ListDevicePoolsRequest(*devicefarm.ListDevicePoolsInput) devicefarm.ListDevicePoolsRequest - ListDevicePoolsPages(*devicefarm.ListDevicePoolsInput, func(*devicefarm.ListDevicePoolsOutput, bool) bool) error - ListDevicePoolsPagesWithContext(aws.Context, *devicefarm.ListDevicePoolsInput, func(*devicefarm.ListDevicePoolsOutput, bool) bool, ...aws.Option) error - ListDevicesRequest(*devicefarm.ListDevicesInput) devicefarm.ListDevicesRequest - ListDevicesPages(*devicefarm.ListDevicesInput, func(*devicefarm.ListDevicesOutput, bool) bool) error - ListDevicesPagesWithContext(aws.Context, *devicefarm.ListDevicesInput, func(*devicefarm.ListDevicesOutput, bool) bool, ...aws.Option) error - ListJobsRequest(*devicefarm.ListJobsInput) devicefarm.ListJobsRequest - ListJobsPages(*devicefarm.ListJobsInput, func(*devicefarm.ListJobsOutput, bool) bool) error - ListJobsPagesWithContext(aws.Context, *devicefarm.ListJobsInput, func(*devicefarm.ListJobsOutput, bool) bool, ...aws.Option) error - ListNetworkProfilesRequest(*devicefarm.ListNetworkProfilesInput) devicefarm.ListNetworkProfilesRequest ListOfferingPromotionsRequest(*devicefarm.ListOfferingPromotionsInput) devicefarm.ListOfferingPromotionsRequest ListOfferingTransactionsRequest(*devicefarm.ListOfferingTransactionsInput) devicefarm.ListOfferingTransactionsRequest - ListOfferingTransactionsPages(*devicefarm.ListOfferingTransactionsInput, func(*devicefarm.ListOfferingTransactionsOutput, bool) bool) error - ListOfferingTransactionsPagesWithContext(aws.Context, *devicefarm.ListOfferingTransactionsInput, func(*devicefarm.ListOfferingTransactionsOutput, bool) bool, ...aws.Option) error - ListOfferingsRequest(*devicefarm.ListOfferingsInput) devicefarm.ListOfferingsRequest - ListOfferingsPages(*devicefarm.ListOfferingsInput, func(*devicefarm.ListOfferingsOutput, bool) bool) error - ListOfferingsPagesWithContext(aws.Context, *devicefarm.ListOfferingsInput, func(*devicefarm.ListOfferingsOutput, bool) bool, ...aws.Option) error - ListProjectsRequest(*devicefarm.ListProjectsInput) devicefarm.ListProjectsRequest - ListProjectsPages(*devicefarm.ListProjectsInput, func(*devicefarm.ListProjectsOutput, bool) bool) error - ListProjectsPagesWithContext(aws.Context, *devicefarm.ListProjectsInput, func(*devicefarm.ListProjectsOutput, bool) bool, ...aws.Option) error - ListRemoteAccessSessionsRequest(*devicefarm.ListRemoteAccessSessionsInput) devicefarm.ListRemoteAccessSessionsRequest ListRunsRequest(*devicefarm.ListRunsInput) devicefarm.ListRunsRequest - ListRunsPages(*devicefarm.ListRunsInput, func(*devicefarm.ListRunsOutput, bool) bool) error - ListRunsPagesWithContext(aws.Context, *devicefarm.ListRunsInput, func(*devicefarm.ListRunsOutput, bool) bool, ...aws.Option) error - ListSamplesRequest(*devicefarm.ListSamplesInput) devicefarm.ListSamplesRequest - ListSamplesPages(*devicefarm.ListSamplesInput, func(*devicefarm.ListSamplesOutput, bool) bool) error - ListSamplesPagesWithContext(aws.Context, *devicefarm.ListSamplesInput, func(*devicefarm.ListSamplesOutput, bool) bool, ...aws.Option) error - ListSuitesRequest(*devicefarm.ListSuitesInput) devicefarm.ListSuitesRequest - ListSuitesPages(*devicefarm.ListSuitesInput, func(*devicefarm.ListSuitesOutput, bool) bool) error - ListSuitesPagesWithContext(aws.Context, *devicefarm.ListSuitesInput, func(*devicefarm.ListSuitesOutput, bool) bool, ...aws.Option) error - ListTestsRequest(*devicefarm.ListTestsInput) devicefarm.ListTestsRequest - ListTestsPages(*devicefarm.ListTestsInput, func(*devicefarm.ListTestsOutput, bool) bool) error - ListTestsPagesWithContext(aws.Context, *devicefarm.ListTestsInput, func(*devicefarm.ListTestsOutput, bool) bool, ...aws.Option) error - ListUniqueProblemsRequest(*devicefarm.ListUniqueProblemsInput) devicefarm.ListUniqueProblemsRequest - ListUniqueProblemsPages(*devicefarm.ListUniqueProblemsInput, func(*devicefarm.ListUniqueProblemsOutput, bool) bool) error - ListUniqueProblemsPagesWithContext(aws.Context, *devicefarm.ListUniqueProblemsInput, func(*devicefarm.ListUniqueProblemsOutput, bool) bool, ...aws.Option) error - ListUploadsRequest(*devicefarm.ListUploadsInput) devicefarm.ListUploadsRequest - ListUploadsPages(*devicefarm.ListUploadsInput, func(*devicefarm.ListUploadsOutput, bool) bool) error - ListUploadsPagesWithContext(aws.Context, *devicefarm.ListUploadsInput, func(*devicefarm.ListUploadsOutput, bool) bool, ...aws.Option) error - PurchaseOfferingRequest(*devicefarm.PurchaseOfferingInput) devicefarm.PurchaseOfferingRequest RenewOfferingRequest(*devicefarm.RenewOfferingInput) devicefarm.RenewOfferingRequest diff --git a/service/directconnect/api.go b/service/directconnect/api.go index 5e142d4b90e..0f3c15fe6b1 100644 --- a/service/directconnect/api.go +++ b/service/directconnect/api.go @@ -16,6 +16,7 @@ const opAllocateConnectionOnInterconnect = "AllocateConnectionOnInterconnect" type AllocateConnectionOnInterconnectRequest struct { *aws.Request Input *AllocateConnectionOnInterconnectInput + Copy func(*AllocateConnectionOnInterconnectInput) AllocateConnectionOnInterconnectRequest } // Send marshals and sends the AllocateConnectionOnInterconnect API request. @@ -66,7 +67,7 @@ func (c *DirectConnect) AllocateConnectionOnInterconnectRequest(input *AllocateC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AllocateConnectionOnInterconnectRequest{Request: req, Input: input} + return AllocateConnectionOnInterconnectRequest{Request: req, Input: input, Copy: c.AllocateConnectionOnInterconnectRequest} } const opAllocateHostedConnection = "AllocateHostedConnection" @@ -75,6 +76,7 @@ const opAllocateHostedConnection = "AllocateHostedConnection" type AllocateHostedConnectionRequest struct { *aws.Request Input *AllocateHostedConnectionInput + Copy func(*AllocateHostedConnectionInput) AllocateHostedConnectionRequest } // Send marshals and sends the AllocateHostedConnection API request. @@ -121,7 +123,7 @@ func (c *DirectConnect) AllocateHostedConnectionRequest(input *AllocateHostedCon req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AllocateHostedConnectionRequest{Request: req, Input: input} + return AllocateHostedConnectionRequest{Request: req, Input: input, Copy: c.AllocateHostedConnectionRequest} } const opAllocatePrivateVirtualInterface = "AllocatePrivateVirtualInterface" @@ -130,6 +132,7 @@ const opAllocatePrivateVirtualInterface = "AllocatePrivateVirtualInterface" type AllocatePrivateVirtualInterfaceRequest struct { *aws.Request Input *AllocatePrivateVirtualInterfaceInput + Copy func(*AllocatePrivateVirtualInterfaceInput) AllocatePrivateVirtualInterfaceRequest } // Send marshals and sends the AllocatePrivateVirtualInterface API request. @@ -175,7 +178,7 @@ func (c *DirectConnect) AllocatePrivateVirtualInterfaceRequest(input *AllocatePr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AllocatePrivateVirtualInterfaceRequest{Request: req, Input: input} + return AllocatePrivateVirtualInterfaceRequest{Request: req, Input: input, Copy: c.AllocatePrivateVirtualInterfaceRequest} } const opAllocatePublicVirtualInterface = "AllocatePublicVirtualInterface" @@ -184,6 +187,7 @@ const opAllocatePublicVirtualInterface = "AllocatePublicVirtualInterface" type AllocatePublicVirtualInterfaceRequest struct { *aws.Request Input *AllocatePublicVirtualInterfaceInput + Copy func(*AllocatePublicVirtualInterfaceInput) AllocatePublicVirtualInterfaceRequest } // Send marshals and sends the AllocatePublicVirtualInterface API request. @@ -236,7 +240,7 @@ func (c *DirectConnect) AllocatePublicVirtualInterfaceRequest(input *AllocatePub req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AllocatePublicVirtualInterfaceRequest{Request: req, Input: input} + return AllocatePublicVirtualInterfaceRequest{Request: req, Input: input, Copy: c.AllocatePublicVirtualInterfaceRequest} } const opAssociateConnectionWithLag = "AssociateConnectionWithLag" @@ -245,6 +249,7 @@ const opAssociateConnectionWithLag = "AssociateConnectionWithLag" type AssociateConnectionWithLagRequest struct { *aws.Request Input *AssociateConnectionWithLagInput + Copy func(*AssociateConnectionWithLagInput) AssociateConnectionWithLagRequest } // Send marshals and sends the AssociateConnectionWithLag API request. @@ -301,7 +306,7 @@ func (c *DirectConnect) AssociateConnectionWithLagRequest(input *AssociateConnec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateConnectionWithLagRequest{Request: req, Input: input} + return AssociateConnectionWithLagRequest{Request: req, Input: input, Copy: c.AssociateConnectionWithLagRequest} } const opAssociateHostedConnection = "AssociateHostedConnection" @@ -310,6 +315,7 @@ const opAssociateHostedConnection = "AssociateHostedConnection" type AssociateHostedConnectionRequest struct { *aws.Request Input *AssociateHostedConnectionInput + Copy func(*AssociateHostedConnectionInput) AssociateHostedConnectionRequest } // Send marshals and sends the AssociateHostedConnection API request. @@ -356,7 +362,7 @@ func (c *DirectConnect) AssociateHostedConnectionRequest(input *AssociateHostedC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateHostedConnectionRequest{Request: req, Input: input} + return AssociateHostedConnectionRequest{Request: req, Input: input, Copy: c.AssociateHostedConnectionRequest} } const opAssociateVirtualInterface = "AssociateVirtualInterface" @@ -365,6 +371,7 @@ const opAssociateVirtualInterface = "AssociateVirtualInterface" type AssociateVirtualInterfaceRequest struct { *aws.Request Input *AssociateVirtualInterfaceInput + Copy func(*AssociateVirtualInterfaceInput) AssociateVirtualInterfaceRequest } // Send marshals and sends the AssociateVirtualInterface API request. @@ -419,7 +426,7 @@ func (c *DirectConnect) AssociateVirtualInterfaceRequest(input *AssociateVirtual req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateVirtualInterfaceRequest{Request: req, Input: input} + return AssociateVirtualInterfaceRequest{Request: req, Input: input, Copy: c.AssociateVirtualInterfaceRequest} } const opConfirmConnection = "ConfirmConnection" @@ -428,6 +435,7 @@ const opConfirmConnection = "ConfirmConnection" type ConfirmConnectionRequest struct { *aws.Request Input *ConfirmConnectionInput + Copy func(*ConfirmConnectionInput) ConfirmConnectionRequest } // Send marshals and sends the ConfirmConnection API request. @@ -472,7 +480,7 @@ func (c *DirectConnect) ConfirmConnectionRequest(input *ConfirmConnectionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ConfirmConnectionRequest{Request: req, Input: input} + return ConfirmConnectionRequest{Request: req, Input: input, Copy: c.ConfirmConnectionRequest} } const opConfirmPrivateVirtualInterface = "ConfirmPrivateVirtualInterface" @@ -481,6 +489,7 @@ const opConfirmPrivateVirtualInterface = "ConfirmPrivateVirtualInterface" type ConfirmPrivateVirtualInterfaceRequest struct { *aws.Request Input *ConfirmPrivateVirtualInterfaceInput + Copy func(*ConfirmPrivateVirtualInterfaceInput) ConfirmPrivateVirtualInterfaceRequest } // Send marshals and sends the ConfirmPrivateVirtualInterface API request. @@ -525,7 +534,7 @@ func (c *DirectConnect) ConfirmPrivateVirtualInterfaceRequest(input *ConfirmPriv req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ConfirmPrivateVirtualInterfaceRequest{Request: req, Input: input} + return ConfirmPrivateVirtualInterfaceRequest{Request: req, Input: input, Copy: c.ConfirmPrivateVirtualInterfaceRequest} } const opConfirmPublicVirtualInterface = "ConfirmPublicVirtualInterface" @@ -534,6 +543,7 @@ const opConfirmPublicVirtualInterface = "ConfirmPublicVirtualInterface" type ConfirmPublicVirtualInterfaceRequest struct { *aws.Request Input *ConfirmPublicVirtualInterfaceInput + Copy func(*ConfirmPublicVirtualInterfaceInput) ConfirmPublicVirtualInterfaceRequest } // Send marshals and sends the ConfirmPublicVirtualInterface API request. @@ -577,7 +587,7 @@ func (c *DirectConnect) ConfirmPublicVirtualInterfaceRequest(input *ConfirmPubli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ConfirmPublicVirtualInterfaceRequest{Request: req, Input: input} + return ConfirmPublicVirtualInterfaceRequest{Request: req, Input: input, Copy: c.ConfirmPublicVirtualInterfaceRequest} } const opCreateBGPPeer = "CreateBGPPeer" @@ -586,6 +596,7 @@ const opCreateBGPPeer = "CreateBGPPeer" type CreateBGPPeerRequest struct { *aws.Request Input *CreateBGPPeerInput + Copy func(*CreateBGPPeerInput) CreateBGPPeerRequest } // Send marshals and sends the CreateBGPPeer API request. @@ -638,7 +649,7 @@ func (c *DirectConnect) CreateBGPPeerRequest(input *CreateBGPPeerInput) CreateBG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBGPPeerRequest{Request: req, Input: input} + return CreateBGPPeerRequest{Request: req, Input: input, Copy: c.CreateBGPPeerRequest} } const opCreateConnection = "CreateConnection" @@ -647,6 +658,7 @@ const opCreateConnection = "CreateConnection" type CreateConnectionRequest struct { *aws.Request Input *CreateConnectionInput + Copy func(*CreateConnectionInput) CreateConnectionRequest } // Send marshals and sends the CreateConnection API request. @@ -704,7 +716,7 @@ func (c *DirectConnect) CreateConnectionRequest(input *CreateConnectionInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateConnectionRequest{Request: req, Input: input} + return CreateConnectionRequest{Request: req, Input: input, Copy: c.CreateConnectionRequest} } const opCreateDirectConnectGateway = "CreateDirectConnectGateway" @@ -713,6 +725,7 @@ const opCreateDirectConnectGateway = "CreateDirectConnectGateway" type CreateDirectConnectGatewayRequest struct { *aws.Request Input *CreateDirectConnectGatewayInput + Copy func(*CreateDirectConnectGatewayInput) CreateDirectConnectGatewayRequest } // Send marshals and sends the CreateDirectConnectGateway API request. @@ -760,7 +773,7 @@ func (c *DirectConnect) CreateDirectConnectGatewayRequest(input *CreateDirectCon req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDirectConnectGatewayRequest{Request: req, Input: input} + return CreateDirectConnectGatewayRequest{Request: req, Input: input, Copy: c.CreateDirectConnectGatewayRequest} } const opCreateDirectConnectGatewayAssociation = "CreateDirectConnectGatewayAssociation" @@ -769,6 +782,7 @@ const opCreateDirectConnectGatewayAssociation = "CreateDirectConnectGatewayAssoc type CreateDirectConnectGatewayAssociationRequest struct { *aws.Request Input *CreateDirectConnectGatewayAssociationInput + Copy func(*CreateDirectConnectGatewayAssociationInput) CreateDirectConnectGatewayAssociationRequest } // Send marshals and sends the CreateDirectConnectGatewayAssociation API request. @@ -811,7 +825,7 @@ func (c *DirectConnect) CreateDirectConnectGatewayAssociationRequest(input *Crea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDirectConnectGatewayAssociationRequest{Request: req, Input: input} + return CreateDirectConnectGatewayAssociationRequest{Request: req, Input: input, Copy: c.CreateDirectConnectGatewayAssociationRequest} } const opCreateInterconnect = "CreateInterconnect" @@ -820,6 +834,7 @@ const opCreateInterconnect = "CreateInterconnect" type CreateInterconnectRequest struct { *aws.Request Input *CreateInterconnectInput + Copy func(*CreateInterconnectInput) CreateInterconnectRequest } // Send marshals and sends the CreateInterconnect API request. @@ -883,7 +898,7 @@ func (c *DirectConnect) CreateInterconnectRequest(input *CreateInterconnectInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInterconnectRequest{Request: req, Input: input} + return CreateInterconnectRequest{Request: req, Input: input, Copy: c.CreateInterconnectRequest} } const opCreateLag = "CreateLag" @@ -892,6 +907,7 @@ const opCreateLag = "CreateLag" type CreateLagRequest struct { *aws.Request Input *CreateLagInput + Copy func(*CreateLagInput) CreateLagRequest } // Send marshals and sends the CreateLag API request. @@ -956,7 +972,7 @@ func (c *DirectConnect) CreateLagRequest(input *CreateLagInput) CreateLagRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLagRequest{Request: req, Input: input} + return CreateLagRequest{Request: req, Input: input, Copy: c.CreateLagRequest} } const opCreatePrivateVirtualInterface = "CreatePrivateVirtualInterface" @@ -965,6 +981,7 @@ const opCreatePrivateVirtualInterface = "CreatePrivateVirtualInterface" type CreatePrivateVirtualInterfaceRequest struct { *aws.Request Input *CreatePrivateVirtualInterfaceInput + Copy func(*CreatePrivateVirtualInterfaceInput) CreatePrivateVirtualInterfaceRequest } // Send marshals and sends the CreatePrivateVirtualInterface API request. @@ -1007,7 +1024,7 @@ func (c *DirectConnect) CreatePrivateVirtualInterfaceRequest(input *CreatePrivat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePrivateVirtualInterfaceRequest{Request: req, Input: input} + return CreatePrivateVirtualInterfaceRequest{Request: req, Input: input, Copy: c.CreatePrivateVirtualInterfaceRequest} } const opCreatePublicVirtualInterface = "CreatePublicVirtualInterface" @@ -1016,6 +1033,7 @@ const opCreatePublicVirtualInterface = "CreatePublicVirtualInterface" type CreatePublicVirtualInterfaceRequest struct { *aws.Request Input *CreatePublicVirtualInterfaceInput + Copy func(*CreatePublicVirtualInterfaceInput) CreatePublicVirtualInterfaceRequest } // Send marshals and sends the CreatePublicVirtualInterface API request. @@ -1063,7 +1081,7 @@ func (c *DirectConnect) CreatePublicVirtualInterfaceRequest(input *CreatePublicV req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePublicVirtualInterfaceRequest{Request: req, Input: input} + return CreatePublicVirtualInterfaceRequest{Request: req, Input: input, Copy: c.CreatePublicVirtualInterfaceRequest} } const opDeleteBGPPeer = "DeleteBGPPeer" @@ -1072,6 +1090,7 @@ const opDeleteBGPPeer = "DeleteBGPPeer" type DeleteBGPPeerRequest struct { *aws.Request Input *DeleteBGPPeerInput + Copy func(*DeleteBGPPeerInput) DeleteBGPPeerRequest } // Send marshals and sends the DeleteBGPPeer API request. @@ -1114,7 +1133,7 @@ func (c *DirectConnect) DeleteBGPPeerRequest(input *DeleteBGPPeerInput) DeleteBG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteBGPPeerRequest{Request: req, Input: input} + return DeleteBGPPeerRequest{Request: req, Input: input, Copy: c.DeleteBGPPeerRequest} } const opDeleteConnection = "DeleteConnection" @@ -1123,6 +1142,7 @@ const opDeleteConnection = "DeleteConnection" type DeleteConnectionRequest struct { *aws.Request Input *DeleteConnectionInput + Copy func(*DeleteConnectionInput) DeleteConnectionRequest } // Send marshals and sends the DeleteConnection API request. @@ -1168,7 +1188,7 @@ func (c *DirectConnect) DeleteConnectionRequest(input *DeleteConnectionInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteConnectionRequest{Request: req, Input: input} + return DeleteConnectionRequest{Request: req, Input: input, Copy: c.DeleteConnectionRequest} } const opDeleteDirectConnectGateway = "DeleteDirectConnectGateway" @@ -1177,6 +1197,7 @@ const opDeleteDirectConnectGateway = "DeleteDirectConnectGateway" type DeleteDirectConnectGatewayRequest struct { *aws.Request Input *DeleteDirectConnectGatewayInput + Copy func(*DeleteDirectConnectGatewayInput) DeleteDirectConnectGatewayRequest } // Send marshals and sends the DeleteDirectConnectGateway API request. @@ -1219,7 +1240,7 @@ func (c *DirectConnect) DeleteDirectConnectGatewayRequest(input *DeleteDirectCon req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDirectConnectGatewayRequest{Request: req, Input: input} + return DeleteDirectConnectGatewayRequest{Request: req, Input: input, Copy: c.DeleteDirectConnectGatewayRequest} } const opDeleteDirectConnectGatewayAssociation = "DeleteDirectConnectGatewayAssociation" @@ -1228,6 +1249,7 @@ const opDeleteDirectConnectGatewayAssociation = "DeleteDirectConnectGatewayAssoc type DeleteDirectConnectGatewayAssociationRequest struct { *aws.Request Input *DeleteDirectConnectGatewayAssociationInput + Copy func(*DeleteDirectConnectGatewayAssociationInput) DeleteDirectConnectGatewayAssociationRequest } // Send marshals and sends the DeleteDirectConnectGatewayAssociation API request. @@ -1269,7 +1291,7 @@ func (c *DirectConnect) DeleteDirectConnectGatewayAssociationRequest(input *Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDirectConnectGatewayAssociationRequest{Request: req, Input: input} + return DeleteDirectConnectGatewayAssociationRequest{Request: req, Input: input, Copy: c.DeleteDirectConnectGatewayAssociationRequest} } const opDeleteInterconnect = "DeleteInterconnect" @@ -1278,6 +1300,7 @@ const opDeleteInterconnect = "DeleteInterconnect" type DeleteInterconnectRequest struct { *aws.Request Input *DeleteInterconnectInput + Copy func(*DeleteInterconnectInput) DeleteInterconnectRequest } // Send marshals and sends the DeleteInterconnect API request. @@ -1320,7 +1343,7 @@ func (c *DirectConnect) DeleteInterconnectRequest(input *DeleteInterconnectInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteInterconnectRequest{Request: req, Input: input} + return DeleteInterconnectRequest{Request: req, Input: input, Copy: c.DeleteInterconnectRequest} } const opDeleteLag = "DeleteLag" @@ -1329,6 +1352,7 @@ const opDeleteLag = "DeleteLag" type DeleteLagRequest struct { *aws.Request Input *DeleteLagInput + Copy func(*DeleteLagInput) DeleteLagRequest } // Send marshals and sends the DeleteLag API request. @@ -1370,7 +1394,7 @@ func (c *DirectConnect) DeleteLagRequest(input *DeleteLagInput) DeleteLagRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLagRequest{Request: req, Input: input} + return DeleteLagRequest{Request: req, Input: input, Copy: c.DeleteLagRequest} } const opDeleteVirtualInterface = "DeleteVirtualInterface" @@ -1379,6 +1403,7 @@ const opDeleteVirtualInterface = "DeleteVirtualInterface" type DeleteVirtualInterfaceRequest struct { *aws.Request Input *DeleteVirtualInterfaceInput + Copy func(*DeleteVirtualInterfaceInput) DeleteVirtualInterfaceRequest } // Send marshals and sends the DeleteVirtualInterface API request. @@ -1419,7 +1444,7 @@ func (c *DirectConnect) DeleteVirtualInterfaceRequest(input *DeleteVirtualInterf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteVirtualInterfaceRequest{Request: req, Input: input} + return DeleteVirtualInterfaceRequest{Request: req, Input: input, Copy: c.DeleteVirtualInterfaceRequest} } const opDescribeConnectionLoa = "DescribeConnectionLoa" @@ -1428,6 +1453,7 @@ const opDescribeConnectionLoa = "DescribeConnectionLoa" type DescribeConnectionLoaRequest struct { *aws.Request Input *DescribeConnectionLoaInput + Copy func(*DescribeConnectionLoaInput) DescribeConnectionLoaRequest } // Send marshals and sends the DescribeConnectionLoa API request. @@ -1479,7 +1505,7 @@ func (c *DirectConnect) DescribeConnectionLoaRequest(input *DescribeConnectionLo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConnectionLoaRequest{Request: req, Input: input} + return DescribeConnectionLoaRequest{Request: req, Input: input, Copy: c.DescribeConnectionLoaRequest} } const opDescribeConnections = "DescribeConnections" @@ -1488,6 +1514,7 @@ const opDescribeConnections = "DescribeConnections" type DescribeConnectionsRequest struct { *aws.Request Input *DescribeConnectionsInput + Copy func(*DescribeConnectionsInput) DescribeConnectionsRequest } // Send marshals and sends the DescribeConnections API request. @@ -1530,7 +1557,7 @@ func (c *DirectConnect) DescribeConnectionsRequest(input *DescribeConnectionsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConnectionsRequest{Request: req, Input: input} + return DescribeConnectionsRequest{Request: req, Input: input, Copy: c.DescribeConnectionsRequest} } const opDescribeConnectionsOnInterconnect = "DescribeConnectionsOnInterconnect" @@ -1539,6 +1566,7 @@ const opDescribeConnectionsOnInterconnect = "DescribeConnectionsOnInterconnect" type DescribeConnectionsOnInterconnectRequest struct { *aws.Request Input *DescribeConnectionsOnInterconnectInput + Copy func(*DescribeConnectionsOnInterconnectInput) DescribeConnectionsOnInterconnectRequest } // Send marshals and sends the DescribeConnectionsOnInterconnect API request. @@ -1586,7 +1614,7 @@ func (c *DirectConnect) DescribeConnectionsOnInterconnectRequest(input *Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConnectionsOnInterconnectRequest{Request: req, Input: input} + return DescribeConnectionsOnInterconnectRequest{Request: req, Input: input, Copy: c.DescribeConnectionsOnInterconnectRequest} } const opDescribeDirectConnectGatewayAssociations = "DescribeDirectConnectGatewayAssociations" @@ -1595,6 +1623,7 @@ const opDescribeDirectConnectGatewayAssociations = "DescribeDirectConnectGateway type DescribeDirectConnectGatewayAssociationsRequest struct { *aws.Request Input *DescribeDirectConnectGatewayAssociationsInput + Copy func(*DescribeDirectConnectGatewayAssociationsInput) DescribeDirectConnectGatewayAssociationsRequest } // Send marshals and sends the DescribeDirectConnectGatewayAssociations API request. @@ -1641,7 +1670,7 @@ func (c *DirectConnect) DescribeDirectConnectGatewayAssociationsRequest(input *D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDirectConnectGatewayAssociationsRequest{Request: req, Input: input} + return DescribeDirectConnectGatewayAssociationsRequest{Request: req, Input: input, Copy: c.DescribeDirectConnectGatewayAssociationsRequest} } const opDescribeDirectConnectGatewayAttachments = "DescribeDirectConnectGatewayAttachments" @@ -1650,6 +1679,7 @@ const opDescribeDirectConnectGatewayAttachments = "DescribeDirectConnectGatewayA type DescribeDirectConnectGatewayAttachmentsRequest struct { *aws.Request Input *DescribeDirectConnectGatewayAttachmentsInput + Copy func(*DescribeDirectConnectGatewayAttachmentsInput) DescribeDirectConnectGatewayAttachmentsRequest } // Send marshals and sends the DescribeDirectConnectGatewayAttachments API request. @@ -1696,7 +1726,7 @@ func (c *DirectConnect) DescribeDirectConnectGatewayAttachmentsRequest(input *De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDirectConnectGatewayAttachmentsRequest{Request: req, Input: input} + return DescribeDirectConnectGatewayAttachmentsRequest{Request: req, Input: input, Copy: c.DescribeDirectConnectGatewayAttachmentsRequest} } const opDescribeDirectConnectGateways = "DescribeDirectConnectGateways" @@ -1705,6 +1735,7 @@ const opDescribeDirectConnectGateways = "DescribeDirectConnectGateways" type DescribeDirectConnectGatewaysRequest struct { *aws.Request Input *DescribeDirectConnectGatewaysInput + Copy func(*DescribeDirectConnectGatewaysInput) DescribeDirectConnectGatewaysRequest } // Send marshals and sends the DescribeDirectConnectGateways API request. @@ -1749,7 +1780,7 @@ func (c *DirectConnect) DescribeDirectConnectGatewaysRequest(input *DescribeDire req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDirectConnectGatewaysRequest{Request: req, Input: input} + return DescribeDirectConnectGatewaysRequest{Request: req, Input: input, Copy: c.DescribeDirectConnectGatewaysRequest} } const opDescribeHostedConnections = "DescribeHostedConnections" @@ -1758,6 +1789,7 @@ const opDescribeHostedConnections = "DescribeHostedConnections" type DescribeHostedConnectionsRequest struct { *aws.Request Input *DescribeHostedConnectionsInput + Copy func(*DescribeHostedConnectionsInput) DescribeHostedConnectionsRequest } // Send marshals and sends the DescribeHostedConnections API request. @@ -1801,7 +1833,7 @@ func (c *DirectConnect) DescribeHostedConnectionsRequest(input *DescribeHostedCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeHostedConnectionsRequest{Request: req, Input: input} + return DescribeHostedConnectionsRequest{Request: req, Input: input, Copy: c.DescribeHostedConnectionsRequest} } const opDescribeInterconnectLoa = "DescribeInterconnectLoa" @@ -1810,6 +1842,7 @@ const opDescribeInterconnectLoa = "DescribeInterconnectLoa" type DescribeInterconnectLoaRequest struct { *aws.Request Input *DescribeInterconnectLoaInput + Copy func(*DescribeInterconnectLoaInput) DescribeInterconnectLoaRequest } // Send marshals and sends the DescribeInterconnectLoa API request. @@ -1861,7 +1894,7 @@ func (c *DirectConnect) DescribeInterconnectLoaRequest(input *DescribeInterconne req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInterconnectLoaRequest{Request: req, Input: input} + return DescribeInterconnectLoaRequest{Request: req, Input: input, Copy: c.DescribeInterconnectLoaRequest} } const opDescribeInterconnects = "DescribeInterconnects" @@ -1870,6 +1903,7 @@ const opDescribeInterconnects = "DescribeInterconnects" type DescribeInterconnectsRequest struct { *aws.Request Input *DescribeInterconnectsInput + Copy func(*DescribeInterconnectsInput) DescribeInterconnectsRequest } // Send marshals and sends the DescribeInterconnects API request. @@ -1912,7 +1946,7 @@ func (c *DirectConnect) DescribeInterconnectsRequest(input *DescribeInterconnect req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInterconnectsRequest{Request: req, Input: input} + return DescribeInterconnectsRequest{Request: req, Input: input, Copy: c.DescribeInterconnectsRequest} } const opDescribeLags = "DescribeLags" @@ -1921,6 +1955,7 @@ const opDescribeLags = "DescribeLags" type DescribeLagsRequest struct { *aws.Request Input *DescribeLagsInput + Copy func(*DescribeLagsInput) DescribeLagsRequest } // Send marshals and sends the DescribeLags API request. @@ -1963,7 +1998,7 @@ func (c *DirectConnect) DescribeLagsRequest(input *DescribeLagsInput) DescribeLa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLagsRequest{Request: req, Input: input} + return DescribeLagsRequest{Request: req, Input: input, Copy: c.DescribeLagsRequest} } const opDescribeLoa = "DescribeLoa" @@ -1972,6 +2007,7 @@ const opDescribeLoa = "DescribeLoa" type DescribeLoaRequest struct { *aws.Request Input *DescribeLoaInput + Copy func(*DescribeLoaInput) DescribeLoaRequest } // Send marshals and sends the DescribeLoa API request. @@ -2019,7 +2055,7 @@ func (c *DirectConnect) DescribeLoaRequest(input *DescribeLoaInput) DescribeLoaR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoaRequest{Request: req, Input: input} + return DescribeLoaRequest{Request: req, Input: input, Copy: c.DescribeLoaRequest} } const opDescribeLocations = "DescribeLocations" @@ -2028,6 +2064,7 @@ const opDescribeLocations = "DescribeLocations" type DescribeLocationsRequest struct { *aws.Request Input *DescribeLocationsInput + Copy func(*DescribeLocationsInput) DescribeLocationsRequest } // Send marshals and sends the DescribeLocations API request. @@ -2070,7 +2107,7 @@ func (c *DirectConnect) DescribeLocationsRequest(input *DescribeLocationsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLocationsRequest{Request: req, Input: input} + return DescribeLocationsRequest{Request: req, Input: input, Copy: c.DescribeLocationsRequest} } const opDescribeTags = "DescribeTags" @@ -2079,6 +2116,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -2119,7 +2157,7 @@ func (c *DirectConnect) DescribeTagsRequest(input *DescribeTagsInput) DescribeTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } const opDescribeVirtualGateways = "DescribeVirtualGateways" @@ -2128,6 +2166,7 @@ const opDescribeVirtualGateways = "DescribeVirtualGateways" type DescribeVirtualGatewaysRequest struct { *aws.Request Input *DescribeVirtualGatewaysInput + Copy func(*DescribeVirtualGatewaysInput) DescribeVirtualGatewaysRequest } // Send marshals and sends the DescribeVirtualGateways API request. @@ -2174,7 +2213,7 @@ func (c *DirectConnect) DescribeVirtualGatewaysRequest(input *DescribeVirtualGat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVirtualGatewaysRequest{Request: req, Input: input} + return DescribeVirtualGatewaysRequest{Request: req, Input: input, Copy: c.DescribeVirtualGatewaysRequest} } const opDescribeVirtualInterfaces = "DescribeVirtualInterfaces" @@ -2183,6 +2222,7 @@ const opDescribeVirtualInterfaces = "DescribeVirtualInterfaces" type DescribeVirtualInterfacesRequest struct { *aws.Request Input *DescribeVirtualInterfacesInput + Copy func(*DescribeVirtualInterfacesInput) DescribeVirtualInterfacesRequest } // Send marshals and sends the DescribeVirtualInterfaces API request. @@ -2230,7 +2270,7 @@ func (c *DirectConnect) DescribeVirtualInterfacesRequest(input *DescribeVirtualI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVirtualInterfacesRequest{Request: req, Input: input} + return DescribeVirtualInterfacesRequest{Request: req, Input: input, Copy: c.DescribeVirtualInterfacesRequest} } const opDisassociateConnectionFromLag = "DisassociateConnectionFromLag" @@ -2239,6 +2279,7 @@ const opDisassociateConnectionFromLag = "DisassociateConnectionFromLag" type DisassociateConnectionFromLagRequest struct { *aws.Request Input *DisassociateConnectionFromLagInput + Copy func(*DisassociateConnectionFromLagInput) DisassociateConnectionFromLagRequest } // Send marshals and sends the DisassociateConnectionFromLag API request. @@ -2289,7 +2330,7 @@ func (c *DirectConnect) DisassociateConnectionFromLagRequest(input *Disassociate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateConnectionFromLagRequest{Request: req, Input: input} + return DisassociateConnectionFromLagRequest{Request: req, Input: input, Copy: c.DisassociateConnectionFromLagRequest} } const opTagResource = "TagResource" @@ -2298,6 +2339,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -2343,7 +2385,7 @@ func (c *DirectConnect) TagResourceRequest(input *TagResourceInput) TagResourceR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource" @@ -2352,6 +2394,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -2392,7 +2435,7 @@ func (c *DirectConnect) UntagResourceRequest(input *UntagResourceInput) UntagRes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateLag = "UpdateLag" @@ -2401,6 +2444,7 @@ const opUpdateLag = "UpdateLag" type UpdateLagRequest struct { *aws.Request Input *UpdateLagInput + Copy func(*UpdateLagInput) UpdateLagRequest } // Send marshals and sends the UpdateLag API request. @@ -2455,7 +2499,7 @@ func (c *DirectConnect) UpdateLagRequest(input *UpdateLagInput) UpdateLagRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateLagRequest{Request: req, Input: input} + return UpdateLagRequest{Request: req, Input: input, Copy: c.UpdateLagRequest} } // Container for the parameters to the AllocateConnectionOnInterconnect operation. diff --git a/service/directoryservice/api.go b/service/directoryservice/api.go index 43947ca1f80..da0921d8bcb 100644 --- a/service/directoryservice/api.go +++ b/service/directoryservice/api.go @@ -16,6 +16,7 @@ const opAddIpRoutes = "AddIpRoutes" type AddIpRoutesRequest struct { *aws.Request Input *AddIpRoutesInput + Copy func(*AddIpRoutesInput) AddIpRoutesRequest } // Send marshals and sends the AddIpRoutes API request. @@ -65,7 +66,7 @@ func (c *DirectoryService) AddIpRoutesRequest(input *AddIpRoutesInput) AddIpRout req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddIpRoutesRequest{Request: req, Input: input} + return AddIpRoutesRequest{Request: req, Input: input, Copy: c.AddIpRoutesRequest} } const opAddTagsToResource = "AddTagsToResource" @@ -74,6 +75,7 @@ const opAddTagsToResource = "AddTagsToResource" type AddTagsToResourceRequest struct { *aws.Request Input *AddTagsToResourceInput + Copy func(*AddTagsToResourceInput) AddTagsToResourceRequest } // Send marshals and sends the AddTagsToResource API request. @@ -116,7 +118,7 @@ func (c *DirectoryService) AddTagsToResourceRequest(input *AddTagsToResourceInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsToResourceRequest{Request: req, Input: input} + return AddTagsToResourceRequest{Request: req, Input: input, Copy: c.AddTagsToResourceRequest} } const opCancelSchemaExtension = "CancelSchemaExtension" @@ -125,6 +127,7 @@ const opCancelSchemaExtension = "CancelSchemaExtension" type CancelSchemaExtensionRequest struct { *aws.Request Input *CancelSchemaExtensionInput + Copy func(*CancelSchemaExtensionInput) CancelSchemaExtensionRequest } // Send marshals and sends the CancelSchemaExtension API request. @@ -168,7 +171,7 @@ func (c *DirectoryService) CancelSchemaExtensionRequest(input *CancelSchemaExten req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelSchemaExtensionRequest{Request: req, Input: input} + return CancelSchemaExtensionRequest{Request: req, Input: input, Copy: c.CancelSchemaExtensionRequest} } const opConnectDirectory = "ConnectDirectory" @@ -177,6 +180,7 @@ const opConnectDirectory = "ConnectDirectory" type ConnectDirectoryRequest struct { *aws.Request Input *ConnectDirectoryInput + Copy func(*ConnectDirectoryInput) ConnectDirectoryRequest } // Send marshals and sends the ConnectDirectory API request. @@ -222,7 +226,7 @@ func (c *DirectoryService) ConnectDirectoryRequest(input *ConnectDirectoryInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ConnectDirectoryRequest{Request: req, Input: input} + return ConnectDirectoryRequest{Request: req, Input: input, Copy: c.ConnectDirectoryRequest} } const opCreateAlias = "CreateAlias" @@ -231,6 +235,7 @@ const opCreateAlias = "CreateAlias" type CreateAliasRequest struct { *aws.Request Input *CreateAliasInput + Copy func(*CreateAliasInput) CreateAliasRequest } // Send marshals and sends the CreateAlias API request. @@ -276,7 +281,7 @@ func (c *DirectoryService) CreateAliasRequest(input *CreateAliasInput) CreateAli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAliasRequest{Request: req, Input: input} + return CreateAliasRequest{Request: req, Input: input, Copy: c.CreateAliasRequest} } const opCreateComputer = "CreateComputer" @@ -285,6 +290,7 @@ const opCreateComputer = "CreateComputer" type CreateComputerRequest struct { *aws.Request Input *CreateComputerInput + Copy func(*CreateComputerInput) CreateComputerRequest } // Send marshals and sends the CreateComputer API request. @@ -326,7 +332,7 @@ func (c *DirectoryService) CreateComputerRequest(input *CreateComputerInput) Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateComputerRequest{Request: req, Input: input} + return CreateComputerRequest{Request: req, Input: input, Copy: c.CreateComputerRequest} } const opCreateConditionalForwarder = "CreateConditionalForwarder" @@ -335,6 +341,7 @@ const opCreateConditionalForwarder = "CreateConditionalForwarder" type CreateConditionalForwarderRequest struct { *aws.Request Input *CreateConditionalForwarderInput + Copy func(*CreateConditionalForwarderInput) CreateConditionalForwarderRequest } // Send marshals and sends the CreateConditionalForwarder API request. @@ -377,7 +384,7 @@ func (c *DirectoryService) CreateConditionalForwarderRequest(input *CreateCondit req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateConditionalForwarderRequest{Request: req, Input: input} + return CreateConditionalForwarderRequest{Request: req, Input: input, Copy: c.CreateConditionalForwarderRequest} } const opCreateDirectory = "CreateDirectory" @@ -386,6 +393,7 @@ const opCreateDirectory = "CreateDirectory" type CreateDirectoryRequest struct { *aws.Request Input *CreateDirectoryInput + Copy func(*CreateDirectoryInput) CreateDirectoryRequest } // Send marshals and sends the CreateDirectory API request. @@ -431,7 +439,7 @@ func (c *DirectoryService) CreateDirectoryRequest(input *CreateDirectoryInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDirectoryRequest{Request: req, Input: input} + return CreateDirectoryRequest{Request: req, Input: input, Copy: c.CreateDirectoryRequest} } const opCreateMicrosoftAD = "CreateMicrosoftAD" @@ -440,6 +448,7 @@ const opCreateMicrosoftAD = "CreateMicrosoftAD" type CreateMicrosoftADRequest struct { *aws.Request Input *CreateMicrosoftADInput + Copy func(*CreateMicrosoftADInput) CreateMicrosoftADRequest } // Send marshals and sends the CreateMicrosoftAD API request. @@ -485,7 +494,7 @@ func (c *DirectoryService) CreateMicrosoftADRequest(input *CreateMicrosoftADInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateMicrosoftADRequest{Request: req, Input: input} + return CreateMicrosoftADRequest{Request: req, Input: input, Copy: c.CreateMicrosoftADRequest} } const opCreateSnapshot = "CreateSnapshot" @@ -494,6 +503,7 @@ const opCreateSnapshot = "CreateSnapshot" type CreateSnapshotRequest struct { *aws.Request Input *CreateSnapshotInput + Copy func(*CreateSnapshotInput) CreateSnapshotRequest } // Send marshals and sends the CreateSnapshot API request. @@ -536,7 +546,7 @@ func (c *DirectoryService) CreateSnapshotRequest(input *CreateSnapshotInput) Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSnapshotRequest{Request: req, Input: input} + return CreateSnapshotRequest{Request: req, Input: input, Copy: c.CreateSnapshotRequest} } const opCreateTrust = "CreateTrust" @@ -545,6 +555,7 @@ const opCreateTrust = "CreateTrust" type CreateTrustRequest struct { *aws.Request Input *CreateTrustInput + Copy func(*CreateTrustInput) CreateTrustRequest } // Send marshals and sends the CreateTrust API request. @@ -592,7 +603,7 @@ func (c *DirectoryService) CreateTrustRequest(input *CreateTrustInput) CreateTru req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTrustRequest{Request: req, Input: input} + return CreateTrustRequest{Request: req, Input: input, Copy: c.CreateTrustRequest} } const opDeleteConditionalForwarder = "DeleteConditionalForwarder" @@ -601,6 +612,7 @@ const opDeleteConditionalForwarder = "DeleteConditionalForwarder" type DeleteConditionalForwarderRequest struct { *aws.Request Input *DeleteConditionalForwarderInput + Copy func(*DeleteConditionalForwarderInput) DeleteConditionalForwarderRequest } // Send marshals and sends the DeleteConditionalForwarder API request. @@ -641,7 +653,7 @@ func (c *DirectoryService) DeleteConditionalForwarderRequest(input *DeleteCondit req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteConditionalForwarderRequest{Request: req, Input: input} + return DeleteConditionalForwarderRequest{Request: req, Input: input, Copy: c.DeleteConditionalForwarderRequest} } const opDeleteDirectory = "DeleteDirectory" @@ -650,6 +662,7 @@ const opDeleteDirectory = "DeleteDirectory" type DeleteDirectoryRequest struct { *aws.Request Input *DeleteDirectoryInput + Copy func(*DeleteDirectoryInput) DeleteDirectoryRequest } // Send marshals and sends the DeleteDirectory API request. @@ -695,7 +708,7 @@ func (c *DirectoryService) DeleteDirectoryRequest(input *DeleteDirectoryInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDirectoryRequest{Request: req, Input: input} + return DeleteDirectoryRequest{Request: req, Input: input, Copy: c.DeleteDirectoryRequest} } const opDeleteSnapshot = "DeleteSnapshot" @@ -704,6 +717,7 @@ const opDeleteSnapshot = "DeleteSnapshot" type DeleteSnapshotRequest struct { *aws.Request Input *DeleteSnapshotInput + Copy func(*DeleteSnapshotInput) DeleteSnapshotRequest } // Send marshals and sends the DeleteSnapshot API request. @@ -744,7 +758,7 @@ func (c *DirectoryService) DeleteSnapshotRequest(input *DeleteSnapshotInput) Del req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSnapshotRequest{Request: req, Input: input} + return DeleteSnapshotRequest{Request: req, Input: input, Copy: c.DeleteSnapshotRequest} } const opDeleteTrust = "DeleteTrust" @@ -753,6 +767,7 @@ const opDeleteTrust = "DeleteTrust" type DeleteTrustRequest struct { *aws.Request Input *DeleteTrustInput + Copy func(*DeleteTrustInput) DeleteTrustRequest } // Send marshals and sends the DeleteTrust API request. @@ -794,7 +809,7 @@ func (c *DirectoryService) DeleteTrustRequest(input *DeleteTrustInput) DeleteTru req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTrustRequest{Request: req, Input: input} + return DeleteTrustRequest{Request: req, Input: input, Copy: c.DeleteTrustRequest} } const opDeregisterEventTopic = "DeregisterEventTopic" @@ -803,6 +818,7 @@ const opDeregisterEventTopic = "DeregisterEventTopic" type DeregisterEventTopicRequest struct { *aws.Request Input *DeregisterEventTopicInput + Copy func(*DeregisterEventTopicInput) DeregisterEventTopicRequest } // Send marshals and sends the DeregisterEventTopic API request. @@ -843,7 +859,7 @@ func (c *DirectoryService) DeregisterEventTopicRequest(input *DeregisterEventTop req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterEventTopicRequest{Request: req, Input: input} + return DeregisterEventTopicRequest{Request: req, Input: input, Copy: c.DeregisterEventTopicRequest} } const opDescribeConditionalForwarders = "DescribeConditionalForwarders" @@ -852,6 +868,7 @@ const opDescribeConditionalForwarders = "DescribeConditionalForwarders" type DescribeConditionalForwardersRequest struct { *aws.Request Input *DescribeConditionalForwardersInput + Copy func(*DescribeConditionalForwardersInput) DescribeConditionalForwardersRequest } // Send marshals and sends the DescribeConditionalForwarders API request. @@ -895,7 +912,7 @@ func (c *DirectoryService) DescribeConditionalForwardersRequest(input *DescribeC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConditionalForwardersRequest{Request: req, Input: input} + return DescribeConditionalForwardersRequest{Request: req, Input: input, Copy: c.DescribeConditionalForwardersRequest} } const opDescribeDirectories = "DescribeDirectories" @@ -904,6 +921,7 @@ const opDescribeDirectories = "DescribeDirectories" type DescribeDirectoriesRequest struct { *aws.Request Input *DescribeDirectoriesInput + Copy func(*DescribeDirectoriesInput) DescribeDirectoriesRequest } // Send marshals and sends the DescribeDirectories API request. @@ -955,7 +973,7 @@ func (c *DirectoryService) DescribeDirectoriesRequest(input *DescribeDirectories req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDirectoriesRequest{Request: req, Input: input} + return DescribeDirectoriesRequest{Request: req, Input: input, Copy: c.DescribeDirectoriesRequest} } const opDescribeDomainControllers = "DescribeDomainControllers" @@ -964,6 +982,7 @@ const opDescribeDomainControllers = "DescribeDomainControllers" type DescribeDomainControllersRequest struct { *aws.Request Input *DescribeDomainControllersInput + Copy func(*DescribeDomainControllersInput) DescribeDomainControllersRequest } // Send marshals and sends the DescribeDomainControllers API request. @@ -1010,57 +1029,53 @@ func (c *DirectoryService) DescribeDomainControllersRequest(input *DescribeDomai req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDomainControllersRequest{Request: req, Input: input} + return DescribeDomainControllersRequest{Request: req, Input: input, Copy: c.DescribeDomainControllersRequest} } -// DescribeDomainControllersPages iterates over the pages of a DescribeDomainControllers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDomainControllers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDomainControllersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDomainControllers operation. -// pageNum := 0 -// err := client.DescribeDomainControllersPages(params, -// func(page *DescribeDomainControllersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DirectoryService) DescribeDomainControllersPages(input *DescribeDomainControllersInput, fn func(*DescribeDomainControllersOutput, bool) bool) error { - return c.DescribeDomainControllersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDomainControllersPagesWithContext same as DescribeDomainControllersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DirectoryService) DescribeDomainControllersPagesWithContext(ctx aws.Context, input *DescribeDomainControllersInput, fn func(*DescribeDomainControllersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDomainControllersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDomainControllersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDomainControllersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDomainControllersRequest) Paginate(opts ...aws.Option) DescribeDomainControllersPager { + return DescribeDomainControllersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDomainControllersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDomainControllersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDomainControllersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDomainControllersPager struct { + aws.Pager +} + +func (p *DescribeDomainControllersPager) CurrentPage() *DescribeDomainControllersOutput { + return p.Pager.CurrentPage().(*DescribeDomainControllersOutput) } const opDescribeEventTopics = "DescribeEventTopics" @@ -1069,6 +1084,7 @@ const opDescribeEventTopics = "DescribeEventTopics" type DescribeEventTopicsRequest struct { *aws.Request Input *DescribeEventTopicsInput + Copy func(*DescribeEventTopicsInput) DescribeEventTopicsRequest } // Send marshals and sends the DescribeEventTopics API request. @@ -1113,7 +1129,7 @@ func (c *DirectoryService) DescribeEventTopicsRequest(input *DescribeEventTopics req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventTopicsRequest{Request: req, Input: input} + return DescribeEventTopicsRequest{Request: req, Input: input, Copy: c.DescribeEventTopicsRequest} } const opDescribeSnapshots = "DescribeSnapshots" @@ -1122,6 +1138,7 @@ const opDescribeSnapshots = "DescribeSnapshots" type DescribeSnapshotsRequest struct { *aws.Request Input *DescribeSnapshotsInput + Copy func(*DescribeSnapshotsInput) DescribeSnapshotsRequest } // Send marshals and sends the DescribeSnapshots API request. @@ -1169,7 +1186,7 @@ func (c *DirectoryService) DescribeSnapshotsRequest(input *DescribeSnapshotsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSnapshotsRequest{Request: req, Input: input} + return DescribeSnapshotsRequest{Request: req, Input: input, Copy: c.DescribeSnapshotsRequest} } const opDescribeTrusts = "DescribeTrusts" @@ -1178,6 +1195,7 @@ const opDescribeTrusts = "DescribeTrusts" type DescribeTrustsRequest struct { *aws.Request Input *DescribeTrustsInput + Copy func(*DescribeTrustsInput) DescribeTrustsRequest } // Send marshals and sends the DescribeTrusts API request. @@ -1221,7 +1239,7 @@ func (c *DirectoryService) DescribeTrustsRequest(input *DescribeTrustsInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTrustsRequest{Request: req, Input: input} + return DescribeTrustsRequest{Request: req, Input: input, Copy: c.DescribeTrustsRequest} } const opDisableRadius = "DisableRadius" @@ -1230,6 +1248,7 @@ const opDisableRadius = "DisableRadius" type DisableRadiusRequest struct { *aws.Request Input *DisableRadiusInput + Copy func(*DisableRadiusInput) DisableRadiusRequest } // Send marshals and sends the DisableRadius API request. @@ -1271,7 +1290,7 @@ func (c *DirectoryService) DisableRadiusRequest(input *DisableRadiusInput) Disab req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableRadiusRequest{Request: req, Input: input} + return DisableRadiusRequest{Request: req, Input: input, Copy: c.DisableRadiusRequest} } const opDisableSso = "DisableSso" @@ -1280,6 +1299,7 @@ const opDisableSso = "DisableSso" type DisableSsoRequest struct { *aws.Request Input *DisableSsoInput + Copy func(*DisableSsoInput) DisableSsoRequest } // Send marshals and sends the DisableSso API request. @@ -1320,7 +1340,7 @@ func (c *DirectoryService) DisableSsoRequest(input *DisableSsoInput) DisableSsoR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableSsoRequest{Request: req, Input: input} + return DisableSsoRequest{Request: req, Input: input, Copy: c.DisableSsoRequest} } const opEnableRadius = "EnableRadius" @@ -1329,6 +1349,7 @@ const opEnableRadius = "EnableRadius" type EnableRadiusRequest struct { *aws.Request Input *EnableRadiusInput + Copy func(*EnableRadiusInput) EnableRadiusRequest } // Send marshals and sends the EnableRadius API request. @@ -1370,7 +1391,7 @@ func (c *DirectoryService) EnableRadiusRequest(input *EnableRadiusInput) EnableR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableRadiusRequest{Request: req, Input: input} + return EnableRadiusRequest{Request: req, Input: input, Copy: c.EnableRadiusRequest} } const opEnableSso = "EnableSso" @@ -1379,6 +1400,7 @@ const opEnableSso = "EnableSso" type EnableSsoRequest struct { *aws.Request Input *EnableSsoInput + Copy func(*EnableSsoInput) EnableSsoRequest } // Send marshals and sends the EnableSso API request. @@ -1419,7 +1441,7 @@ func (c *DirectoryService) EnableSsoRequest(input *EnableSsoInput) EnableSsoRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableSsoRequest{Request: req, Input: input} + return EnableSsoRequest{Request: req, Input: input, Copy: c.EnableSsoRequest} } const opGetDirectoryLimits = "GetDirectoryLimits" @@ -1428,6 +1450,7 @@ const opGetDirectoryLimits = "GetDirectoryLimits" type GetDirectoryLimitsRequest struct { *aws.Request Input *GetDirectoryLimitsInput + Copy func(*GetDirectoryLimitsInput) GetDirectoryLimitsRequest } // Send marshals and sends the GetDirectoryLimits API request. @@ -1468,7 +1491,7 @@ func (c *DirectoryService) GetDirectoryLimitsRequest(input *GetDirectoryLimitsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDirectoryLimitsRequest{Request: req, Input: input} + return GetDirectoryLimitsRequest{Request: req, Input: input, Copy: c.GetDirectoryLimitsRequest} } const opGetSnapshotLimits = "GetSnapshotLimits" @@ -1477,6 +1500,7 @@ const opGetSnapshotLimits = "GetSnapshotLimits" type GetSnapshotLimitsRequest struct { *aws.Request Input *GetSnapshotLimitsInput + Copy func(*GetSnapshotLimitsInput) GetSnapshotLimitsRequest } // Send marshals and sends the GetSnapshotLimits API request. @@ -1517,7 +1541,7 @@ func (c *DirectoryService) GetSnapshotLimitsRequest(input *GetSnapshotLimitsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSnapshotLimitsRequest{Request: req, Input: input} + return GetSnapshotLimitsRequest{Request: req, Input: input, Copy: c.GetSnapshotLimitsRequest} } const opListIpRoutes = "ListIpRoutes" @@ -1526,6 +1550,7 @@ const opListIpRoutes = "ListIpRoutes" type ListIpRoutesRequest struct { *aws.Request Input *ListIpRoutesInput + Copy func(*ListIpRoutesInput) ListIpRoutesRequest } // Send marshals and sends the ListIpRoutes API request. @@ -1566,7 +1591,7 @@ func (c *DirectoryService) ListIpRoutesRequest(input *ListIpRoutesInput) ListIpR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIpRoutesRequest{Request: req, Input: input} + return ListIpRoutesRequest{Request: req, Input: input, Copy: c.ListIpRoutesRequest} } const opListSchemaExtensions = "ListSchemaExtensions" @@ -1575,6 +1600,7 @@ const opListSchemaExtensions = "ListSchemaExtensions" type ListSchemaExtensionsRequest struct { *aws.Request Input *ListSchemaExtensionsInput + Copy func(*ListSchemaExtensionsInput) ListSchemaExtensionsRequest } // Send marshals and sends the ListSchemaExtensions API request. @@ -1615,7 +1641,7 @@ func (c *DirectoryService) ListSchemaExtensionsRequest(input *ListSchemaExtensio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSchemaExtensionsRequest{Request: req, Input: input} + return ListSchemaExtensionsRequest{Request: req, Input: input, Copy: c.ListSchemaExtensionsRequest} } const opListTagsForResource = "ListTagsForResource" @@ -1624,6 +1650,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -1664,7 +1691,7 @@ func (c *DirectoryService) ListTagsForResourceRequest(input *ListTagsForResource req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opRegisterEventTopic = "RegisterEventTopic" @@ -1673,6 +1700,7 @@ const opRegisterEventTopic = "RegisterEventTopic" type RegisterEventTopicRequest struct { *aws.Request Input *RegisterEventTopicInput + Copy func(*RegisterEventTopicInput) RegisterEventTopicRequest } // Send marshals and sends the RegisterEventTopic API request. @@ -1718,7 +1746,7 @@ func (c *DirectoryService) RegisterEventTopicRequest(input *RegisterEventTopicIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterEventTopicRequest{Request: req, Input: input} + return RegisterEventTopicRequest{Request: req, Input: input, Copy: c.RegisterEventTopicRequest} } const opRemoveIpRoutes = "RemoveIpRoutes" @@ -1727,6 +1755,7 @@ const opRemoveIpRoutes = "RemoveIpRoutes" type RemoveIpRoutesRequest struct { *aws.Request Input *RemoveIpRoutesInput + Copy func(*RemoveIpRoutesInput) RemoveIpRoutesRequest } // Send marshals and sends the RemoveIpRoutes API request. @@ -1767,7 +1796,7 @@ func (c *DirectoryService) RemoveIpRoutesRequest(input *RemoveIpRoutesInput) Rem req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveIpRoutesRequest{Request: req, Input: input} + return RemoveIpRoutesRequest{Request: req, Input: input, Copy: c.RemoveIpRoutesRequest} } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -1776,6 +1805,7 @@ const opRemoveTagsFromResource = "RemoveTagsFromResource" type RemoveTagsFromResourceRequest struct { *aws.Request Input *RemoveTagsFromResourceInput + Copy func(*RemoveTagsFromResourceInput) RemoveTagsFromResourceRequest } // Send marshals and sends the RemoveTagsFromResource API request. @@ -1816,7 +1846,7 @@ func (c *DirectoryService) RemoveTagsFromResourceRequest(input *RemoveTagsFromRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromResourceRequest{Request: req, Input: input} + return RemoveTagsFromResourceRequest{Request: req, Input: input, Copy: c.RemoveTagsFromResourceRequest} } const opRestoreFromSnapshot = "RestoreFromSnapshot" @@ -1825,6 +1855,7 @@ const opRestoreFromSnapshot = "RestoreFromSnapshot" type RestoreFromSnapshotRequest struct { *aws.Request Input *RestoreFromSnapshotInput + Copy func(*RestoreFromSnapshotInput) RestoreFromSnapshotRequest } // Send marshals and sends the RestoreFromSnapshot API request. @@ -1873,7 +1904,7 @@ func (c *DirectoryService) RestoreFromSnapshotRequest(input *RestoreFromSnapshot req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreFromSnapshotRequest{Request: req, Input: input} + return RestoreFromSnapshotRequest{Request: req, Input: input, Copy: c.RestoreFromSnapshotRequest} } const opStartSchemaExtension = "StartSchemaExtension" @@ -1882,6 +1913,7 @@ const opStartSchemaExtension = "StartSchemaExtension" type StartSchemaExtensionRequest struct { *aws.Request Input *StartSchemaExtensionInput + Copy func(*StartSchemaExtensionInput) StartSchemaExtensionRequest } // Send marshals and sends the StartSchemaExtension API request. @@ -1922,7 +1954,7 @@ func (c *DirectoryService) StartSchemaExtensionRequest(input *StartSchemaExtensi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartSchemaExtensionRequest{Request: req, Input: input} + return StartSchemaExtensionRequest{Request: req, Input: input, Copy: c.StartSchemaExtensionRequest} } const opUpdateConditionalForwarder = "UpdateConditionalForwarder" @@ -1931,6 +1963,7 @@ const opUpdateConditionalForwarder = "UpdateConditionalForwarder" type UpdateConditionalForwarderRequest struct { *aws.Request Input *UpdateConditionalForwarderInput + Copy func(*UpdateConditionalForwarderInput) UpdateConditionalForwarderRequest } // Send marshals and sends the UpdateConditionalForwarder API request. @@ -1971,7 +2004,7 @@ func (c *DirectoryService) UpdateConditionalForwarderRequest(input *UpdateCondit req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateConditionalForwarderRequest{Request: req, Input: input} + return UpdateConditionalForwarderRequest{Request: req, Input: input, Copy: c.UpdateConditionalForwarderRequest} } const opUpdateNumberOfDomainControllers = "UpdateNumberOfDomainControllers" @@ -1980,6 +2013,7 @@ const opUpdateNumberOfDomainControllers = "UpdateNumberOfDomainControllers" type UpdateNumberOfDomainControllersRequest struct { *aws.Request Input *UpdateNumberOfDomainControllersInput + Copy func(*UpdateNumberOfDomainControllersInput) UpdateNumberOfDomainControllersRequest } // Send marshals and sends the UpdateNumberOfDomainControllers API request. @@ -2025,7 +2059,7 @@ func (c *DirectoryService) UpdateNumberOfDomainControllersRequest(input *UpdateN req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateNumberOfDomainControllersRequest{Request: req, Input: input} + return UpdateNumberOfDomainControllersRequest{Request: req, Input: input, Copy: c.UpdateNumberOfDomainControllersRequest} } const opUpdateRadius = "UpdateRadius" @@ -2034,6 +2068,7 @@ const opUpdateRadius = "UpdateRadius" type UpdateRadiusRequest struct { *aws.Request Input *UpdateRadiusInput + Copy func(*UpdateRadiusInput) UpdateRadiusRequest } // Send marshals and sends the UpdateRadius API request. @@ -2075,7 +2110,7 @@ func (c *DirectoryService) UpdateRadiusRequest(input *UpdateRadiusInput) UpdateR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRadiusRequest{Request: req, Input: input} + return UpdateRadiusRequest{Request: req, Input: input, Copy: c.UpdateRadiusRequest} } const opVerifyTrust = "VerifyTrust" @@ -2084,6 +2119,7 @@ const opVerifyTrust = "VerifyTrust" type VerifyTrustRequest struct { *aws.Request Input *VerifyTrustInput + Copy func(*VerifyTrustInput) VerifyTrustRequest } // Send marshals and sends the VerifyTrust API request. @@ -2128,7 +2164,7 @@ func (c *DirectoryService) VerifyTrustRequest(input *VerifyTrustInput) VerifyTru req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return VerifyTrustRequest{Request: req, Input: input} + return VerifyTrustRequest{Request: req, Input: input, Copy: c.VerifyTrustRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddIpRoutesRequest diff --git a/service/directoryservice/directoryserviceiface/interface.go b/service/directoryservice/directoryserviceiface/interface.go index e967e71f5b4..431b66df5b0 100644 --- a/service/directoryservice/directoryserviceiface/interface.go +++ b/service/directoryservice/directoryserviceiface/interface.go @@ -9,7 +9,6 @@ package directoryserviceiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/directoryservice" ) @@ -101,9 +100,6 @@ type DirectoryServiceAPI interface { DescribeDomainControllersRequest(*directoryservice.DescribeDomainControllersInput) directoryservice.DescribeDomainControllersRequest - DescribeDomainControllersPages(*directoryservice.DescribeDomainControllersInput, func(*directoryservice.DescribeDomainControllersOutput, bool) bool) error - DescribeDomainControllersPagesWithContext(aws.Context, *directoryservice.DescribeDomainControllersInput, func(*directoryservice.DescribeDomainControllersOutput, bool) bool, ...aws.Option) error - DescribeEventTopicsRequest(*directoryservice.DescribeEventTopicsInput) directoryservice.DescribeEventTopicsRequest DescribeSnapshotsRequest(*directoryservice.DescribeSnapshotsInput) directoryservice.DescribeSnapshotsRequest diff --git a/service/dynamodb/api.go b/service/dynamodb/api.go index b7ec9c2d164..8ca3dab5fbc 100644 --- a/service/dynamodb/api.go +++ b/service/dynamodb/api.go @@ -18,6 +18,7 @@ const opBatchGetItem = "BatchGetItem" type BatchGetItemRequest struct { *aws.Request Input *BatchGetItemInput + Copy func(*BatchGetItemInput) BatchGetItemRequest } // Send marshals and sends the BatchGetItem API request. @@ -112,57 +113,53 @@ func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) BatchGetItemReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetItemRequest{Request: req, Input: input} + return BatchGetItemRequest{Request: req, Input: input, Copy: c.BatchGetItemRequest} } -// BatchGetItemPages iterates over the pages of a BatchGetItem operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See BatchGetItem method for more information on how to use this operation. +// Paginate pages iterates over the pages of a BatchGetItemRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a BatchGetItem operation. -// pageNum := 0 -// err := client.BatchGetItemPages(params, -// func(page *BatchGetItemOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) BatchGetItemPages(input *BatchGetItemInput, fn func(*BatchGetItemOutput, bool) bool) error { - return c.BatchGetItemPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// BatchGetItemPagesWithContext same as BatchGetItemPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) BatchGetItemPagesWithContext(ctx aws.Context, input *BatchGetItemInput, fn func(*BatchGetItemOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *BatchGetItemInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.BatchGetItemRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.BatchGetItemRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *BatchGetItemRequest) Paginate(opts ...aws.Option) BatchGetItemPager { + return BatchGetItemPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *BatchGetItemInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*BatchGetItemOutput), !p.HasNextPage()) - } - return p.Err() +// BatchGetItemPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type BatchGetItemPager struct { + aws.Pager +} + +func (p *BatchGetItemPager) CurrentPage() *BatchGetItemOutput { + return p.Pager.CurrentPage().(*BatchGetItemOutput) } const opBatchWriteItem = "BatchWriteItem" @@ -171,6 +168,7 @@ const opBatchWriteItem = "BatchWriteItem" type BatchWriteItemRequest struct { *aws.Request Input *BatchWriteItemInput + Copy func(*BatchWriteItemInput) BatchWriteItemRequest } // Send marshals and sends the BatchWriteItem API request. @@ -279,7 +277,7 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) BatchWriteI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchWriteItemRequest{Request: req, Input: input} + return BatchWriteItemRequest{Request: req, Input: input, Copy: c.BatchWriteItemRequest} } const opCreateBackup = "CreateBackup" @@ -288,6 +286,7 @@ const opCreateBackup = "CreateBackup" type CreateBackupRequest struct { *aws.Request Input *CreateBackupInput + Copy func(*CreateBackupInput) CreateBackupRequest } // Send marshals and sends the CreateBackup API request. @@ -359,7 +358,7 @@ func (c *DynamoDB) CreateBackupRequest(input *CreateBackupInput) CreateBackupReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBackupRequest{Request: req, Input: input} + return CreateBackupRequest{Request: req, Input: input, Copy: c.CreateBackupRequest} } const opCreateGlobalTable = "CreateGlobalTable" @@ -368,6 +367,7 @@ const opCreateGlobalTable = "CreateGlobalTable" type CreateGlobalTableRequest struct { *aws.Request Input *CreateGlobalTableInput + Copy func(*CreateGlobalTableInput) CreateGlobalTableRequest } // Send marshals and sends the CreateGlobalTable API request. @@ -421,7 +421,7 @@ func (c *DynamoDB) CreateGlobalTableRequest(input *CreateGlobalTableInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGlobalTableRequest{Request: req, Input: input} + return CreateGlobalTableRequest{Request: req, Input: input, Copy: c.CreateGlobalTableRequest} } const opCreateTable = "CreateTable" @@ -430,6 +430,7 @@ const opCreateTable = "CreateTable" type CreateTableRequest struct { *aws.Request Input *CreateTableInput + Copy func(*CreateTableInput) CreateTableRequest } // Send marshals and sends the CreateTable API request. @@ -484,7 +485,7 @@ func (c *DynamoDB) CreateTableRequest(input *CreateTableInput) CreateTableReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTableRequest{Request: req, Input: input} + return CreateTableRequest{Request: req, Input: input, Copy: c.CreateTableRequest} } const opDeleteBackup = "DeleteBackup" @@ -493,6 +494,7 @@ const opDeleteBackup = "DeleteBackup" type DeleteBackupRequest struct { *aws.Request Input *DeleteBackupInput + Copy func(*DeleteBackupInput) DeleteBackupRequest } // Send marshals and sends the DeleteBackup API request. @@ -535,7 +537,7 @@ func (c *DynamoDB) DeleteBackupRequest(input *DeleteBackupInput) DeleteBackupReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteBackupRequest{Request: req, Input: input} + return DeleteBackupRequest{Request: req, Input: input, Copy: c.DeleteBackupRequest} } const opDeleteItem = "DeleteItem" @@ -544,6 +546,7 @@ const opDeleteItem = "DeleteItem" type DeleteItemRequest struct { *aws.Request Input *DeleteItemInput + Copy func(*DeleteItemInput) DeleteItemRequest } // Send marshals and sends the DeleteItem API request. @@ -597,7 +600,7 @@ func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) DeleteItemRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteItemRequest{Request: req, Input: input} + return DeleteItemRequest{Request: req, Input: input, Copy: c.DeleteItemRequest} } const opDeleteTable = "DeleteTable" @@ -606,6 +609,7 @@ const opDeleteTable = "DeleteTable" type DeleteTableRequest struct { *aws.Request Input *DeleteTableInput + Copy func(*DeleteTableInput) DeleteTableRequest } // Send marshals and sends the DeleteTable API request. @@ -663,7 +667,7 @@ func (c *DynamoDB) DeleteTableRequest(input *DeleteTableInput) DeleteTableReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTableRequest{Request: req, Input: input} + return DeleteTableRequest{Request: req, Input: input, Copy: c.DeleteTableRequest} } const opDescribeBackup = "DescribeBackup" @@ -672,6 +676,7 @@ const opDescribeBackup = "DescribeBackup" type DescribeBackupRequest struct { *aws.Request Input *DescribeBackupInput + Copy func(*DescribeBackupInput) DescribeBackupRequest } // Send marshals and sends the DescribeBackup API request. @@ -714,7 +719,7 @@ func (c *DynamoDB) DescribeBackupRequest(input *DescribeBackupInput) DescribeBac req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBackupRequest{Request: req, Input: input} + return DescribeBackupRequest{Request: req, Input: input, Copy: c.DescribeBackupRequest} } const opDescribeContinuousBackups = "DescribeContinuousBackups" @@ -723,6 +728,7 @@ const opDescribeContinuousBackups = "DescribeContinuousBackups" type DescribeContinuousBackupsRequest struct { *aws.Request Input *DescribeContinuousBackupsInput + Copy func(*DescribeContinuousBackupsInput) DescribeContinuousBackupsRequest } // Send marshals and sends the DescribeContinuousBackups API request. @@ -767,7 +773,7 @@ func (c *DynamoDB) DescribeContinuousBackupsRequest(input *DescribeContinuousBac req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeContinuousBackupsRequest{Request: req, Input: input} + return DescribeContinuousBackupsRequest{Request: req, Input: input, Copy: c.DescribeContinuousBackupsRequest} } const opDescribeGlobalTable = "DescribeGlobalTable" @@ -776,6 +782,7 @@ const opDescribeGlobalTable = "DescribeGlobalTable" type DescribeGlobalTableRequest struct { *aws.Request Input *DescribeGlobalTableInput + Copy func(*DescribeGlobalTableInput) DescribeGlobalTableRequest } // Send marshals and sends the DescribeGlobalTable API request. @@ -816,7 +823,7 @@ func (c *DynamoDB) DescribeGlobalTableRequest(input *DescribeGlobalTableInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeGlobalTableRequest{Request: req, Input: input} + return DescribeGlobalTableRequest{Request: req, Input: input, Copy: c.DescribeGlobalTableRequest} } const opDescribeLimits = "DescribeLimits" @@ -825,6 +832,7 @@ const opDescribeLimits = "DescribeLimits" type DescribeLimitsRequest struct { *aws.Request Input *DescribeLimitsInput + Copy func(*DescribeLimitsInput) DescribeLimitsRequest } // Send marshals and sends the DescribeLimits API request. @@ -921,7 +929,7 @@ func (c *DynamoDB) DescribeLimitsRequest(input *DescribeLimitsInput) DescribeLim req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLimitsRequest{Request: req, Input: input} + return DescribeLimitsRequest{Request: req, Input: input, Copy: c.DescribeLimitsRequest} } const opDescribeTable = "DescribeTable" @@ -930,6 +938,7 @@ const opDescribeTable = "DescribeTable" type DescribeTableRequest struct { *aws.Request Input *DescribeTableInput + Copy func(*DescribeTableInput) DescribeTableRequest } // Send marshals and sends the DescribeTable API request. @@ -978,7 +987,7 @@ func (c *DynamoDB) DescribeTableRequest(input *DescribeTableInput) DescribeTable req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTableRequest{Request: req, Input: input} + return DescribeTableRequest{Request: req, Input: input, Copy: c.DescribeTableRequest} } const opDescribeTimeToLive = "DescribeTimeToLive" @@ -987,6 +996,7 @@ const opDescribeTimeToLive = "DescribeTimeToLive" type DescribeTimeToLiveRequest struct { *aws.Request Input *DescribeTimeToLiveInput + Copy func(*DescribeTimeToLiveInput) DescribeTimeToLiveRequest } // Send marshals and sends the DescribeTimeToLive API request. @@ -1027,7 +1037,7 @@ func (c *DynamoDB) DescribeTimeToLiveRequest(input *DescribeTimeToLiveInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTimeToLiveRequest{Request: req, Input: input} + return DescribeTimeToLiveRequest{Request: req, Input: input, Copy: c.DescribeTimeToLiveRequest} } const opGetItem = "GetItem" @@ -1036,6 +1046,7 @@ const opGetItem = "GetItem" type GetItemRequest struct { *aws.Request Input *GetItemInput + Copy func(*GetItemInput) GetItemRequest } // Send marshals and sends the GetItem API request. @@ -1083,7 +1094,7 @@ func (c *DynamoDB) GetItemRequest(input *GetItemInput) GetItemRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetItemRequest{Request: req, Input: input} + return GetItemRequest{Request: req, Input: input, Copy: c.GetItemRequest} } const opListBackups = "ListBackups" @@ -1092,6 +1103,7 @@ const opListBackups = "ListBackups" type ListBackupsRequest struct { *aws.Request Input *ListBackupsInput + Copy func(*ListBackupsInput) ListBackupsRequest } // Send marshals and sends the ListBackups API request. @@ -1140,7 +1152,7 @@ func (c *DynamoDB) ListBackupsRequest(input *ListBackupsInput) ListBackupsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBackupsRequest{Request: req, Input: input} + return ListBackupsRequest{Request: req, Input: input, Copy: c.ListBackupsRequest} } const opListGlobalTables = "ListGlobalTables" @@ -1149,6 +1161,7 @@ const opListGlobalTables = "ListGlobalTables" type ListGlobalTablesRequest struct { *aws.Request Input *ListGlobalTablesInput + Copy func(*ListGlobalTablesInput) ListGlobalTablesRequest } // Send marshals and sends the ListGlobalTables API request. @@ -1190,7 +1203,7 @@ func (c *DynamoDB) ListGlobalTablesRequest(input *ListGlobalTablesInput) ListGlo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGlobalTablesRequest{Request: req, Input: input} + return ListGlobalTablesRequest{Request: req, Input: input, Copy: c.ListGlobalTablesRequest} } const opListTables = "ListTables" @@ -1199,6 +1212,7 @@ const opListTables = "ListTables" type ListTablesRequest struct { *aws.Request Input *ListTablesInput + Copy func(*ListTablesInput) ListTablesRequest } // Send marshals and sends the ListTables API request. @@ -1247,57 +1261,53 @@ func (c *DynamoDB) ListTablesRequest(input *ListTablesInput) ListTablesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTablesRequest{Request: req, Input: input} + return ListTablesRequest{Request: req, Input: input, Copy: c.ListTablesRequest} } -// ListTablesPages iterates over the pages of a ListTables operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTables method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTablesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTables operation. -// pageNum := 0 -// err := client.ListTablesPages(params, -// func(page *ListTablesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) ListTablesPages(input *ListTablesInput, fn func(*ListTablesOutput, bool) bool) error { - return c.ListTablesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTablesPagesWithContext same as ListTablesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) ListTablesPagesWithContext(ctx aws.Context, input *ListTablesInput, fn func(*ListTablesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTablesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTablesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTablesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTablesRequest) Paginate(opts ...aws.Option) ListTablesPager { + return ListTablesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTablesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTablesOutput), !p.HasNextPage()) - } - return p.Err() +// ListTablesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTablesPager struct { + aws.Pager +} + +func (p *ListTablesPager) CurrentPage() *ListTablesOutput { + return p.Pager.CurrentPage().(*ListTablesOutput) } const opListTagsOfResource = "ListTagsOfResource" @@ -1306,6 +1316,7 @@ const opListTagsOfResource = "ListTagsOfResource" type ListTagsOfResourceRequest struct { *aws.Request Input *ListTagsOfResourceInput + Copy func(*ListTagsOfResourceInput) ListTagsOfResourceRequest } // Send marshals and sends the ListTagsOfResource API request. @@ -1350,7 +1361,7 @@ func (c *DynamoDB) ListTagsOfResourceRequest(input *ListTagsOfResourceInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsOfResourceRequest{Request: req, Input: input} + return ListTagsOfResourceRequest{Request: req, Input: input, Copy: c.ListTagsOfResourceRequest} } const opPutItem = "PutItem" @@ -1359,6 +1370,7 @@ const opPutItem = "PutItem" type PutItemRequest struct { *aws.Request Input *PutItemInput + Copy func(*PutItemInput) PutItemRequest } // Send marshals and sends the PutItem API request. @@ -1442,7 +1454,7 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) PutItemRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutItemRequest{Request: req, Input: input} + return PutItemRequest{Request: req, Input: input, Copy: c.PutItemRequest} } const opQuery = "Query" @@ -1451,6 +1463,7 @@ const opQuery = "Query" type QueryRequest struct { *aws.Request Input *QueryInput + Copy func(*QueryInput) QueryRequest } // Send marshals and sends the Query API request. @@ -1544,57 +1557,53 @@ func (c *DynamoDB) QueryRequest(input *QueryInput) QueryRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return QueryRequest{Request: req, Input: input} + return QueryRequest{Request: req, Input: input, Copy: c.QueryRequest} } -// QueryPages iterates over the pages of a Query operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Query method for more information on how to use this operation. +// Paginate pages iterates over the pages of a QueryRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a Query operation. -// pageNum := 0 -// err := client.QueryPages(params, -// func(page *QueryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) QueryPages(input *QueryInput, fn func(*QueryOutput, bool) bool) error { - return c.QueryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// QueryPagesWithContext same as QueryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) QueryPagesWithContext(ctx aws.Context, input *QueryInput, fn func(*QueryOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *QueryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.QueryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.QueryRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *QueryRequest) Paginate(opts ...aws.Option) QueryPager { + return QueryPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *QueryInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*QueryOutput), !p.HasNextPage()) - } - return p.Err() +// QueryPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type QueryPager struct { + aws.Pager +} + +func (p *QueryPager) CurrentPage() *QueryOutput { + return p.Pager.CurrentPage().(*QueryOutput) } const opRestoreTableFromBackup = "RestoreTableFromBackup" @@ -1603,6 +1612,7 @@ const opRestoreTableFromBackup = "RestoreTableFromBackup" type RestoreTableFromBackupRequest struct { *aws.Request Input *RestoreTableFromBackupInput + Copy func(*RestoreTableFromBackupInput) RestoreTableFromBackupRequest } // Send marshals and sends the RestoreTableFromBackup API request. @@ -1658,7 +1668,7 @@ func (c *DynamoDB) RestoreTableFromBackupRequest(input *RestoreTableFromBackupIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreTableFromBackupRequest{Request: req, Input: input} + return RestoreTableFromBackupRequest{Request: req, Input: input, Copy: c.RestoreTableFromBackupRequest} } const opScan = "Scan" @@ -1667,6 +1677,7 @@ const opScan = "Scan" type ScanRequest struct { *aws.Request Input *ScanInput + Copy func(*ScanInput) ScanRequest } // Send marshals and sends the Scan API request. @@ -1740,57 +1751,53 @@ func (c *DynamoDB) ScanRequest(input *ScanInput) ScanRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ScanRequest{Request: req, Input: input} + return ScanRequest{Request: req, Input: input, Copy: c.ScanRequest} } -// ScanPages iterates over the pages of a Scan operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Scan method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ScanRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a Scan operation. -// pageNum := 0 -// err := client.ScanPages(params, -// func(page *ScanOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) ScanPages(input *ScanInput, fn func(*ScanOutput, bool) bool) error { - return c.ScanPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ScanPagesWithContext same as ScanPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) ScanPagesWithContext(ctx aws.Context, input *ScanInput, fn func(*ScanOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ScanInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ScanRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ScanRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ScanRequest) Paginate(opts ...aws.Option) ScanPager { + return ScanPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ScanInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ScanOutput), !p.HasNextPage()) - } - return p.Err() +// ScanPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ScanPager struct { + aws.Pager +} + +func (p *ScanPager) CurrentPage() *ScanOutput { + return p.Pager.CurrentPage().(*ScanOutput) } const opTagResource = "TagResource" @@ -1799,6 +1806,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -1847,7 +1855,7 @@ func (c *DynamoDB) TagResourceRequest(input *TagResourceInput) TagResourceReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource" @@ -1856,6 +1864,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -1902,7 +1911,7 @@ func (c *DynamoDB) UntagResourceRequest(input *UntagResourceInput) UntagResource req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateGlobalTable = "UpdateGlobalTable" @@ -1911,6 +1920,7 @@ const opUpdateGlobalTable = "UpdateGlobalTable" type UpdateGlobalTableRequest struct { *aws.Request Input *UpdateGlobalTableInput + Copy func(*UpdateGlobalTableInput) UpdateGlobalTableRequest } // Send marshals and sends the UpdateGlobalTable API request. @@ -1953,7 +1963,7 @@ func (c *DynamoDB) UpdateGlobalTableRequest(input *UpdateGlobalTableInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGlobalTableRequest{Request: req, Input: input} + return UpdateGlobalTableRequest{Request: req, Input: input, Copy: c.UpdateGlobalTableRequest} } const opUpdateItem = "UpdateItem" @@ -1962,6 +1972,7 @@ const opUpdateItem = "UpdateItem" type UpdateItemRequest struct { *aws.Request Input *UpdateItemInput + Copy func(*UpdateItemInput) UpdateItemRequest } // Send marshals and sends the UpdateItem API request. @@ -2009,7 +2020,7 @@ func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) UpdateItemRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateItemRequest{Request: req, Input: input} + return UpdateItemRequest{Request: req, Input: input, Copy: c.UpdateItemRequest} } const opUpdateTable = "UpdateTable" @@ -2018,6 +2029,7 @@ const opUpdateTable = "UpdateTable" type UpdateTableRequest struct { *aws.Request Input *UpdateTableInput + Copy func(*UpdateTableInput) UpdateTableRequest } // Send marshals and sends the UpdateTable API request. @@ -2075,7 +2087,7 @@ func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) UpdateTableReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTableRequest{Request: req, Input: input} + return UpdateTableRequest{Request: req, Input: input, Copy: c.UpdateTableRequest} } const opUpdateTimeToLive = "UpdateTimeToLive" @@ -2084,6 +2096,7 @@ const opUpdateTimeToLive = "UpdateTimeToLive" type UpdateTimeToLiveRequest struct { *aws.Request Input *UpdateTimeToLiveInput + Copy func(*UpdateTimeToLiveInput) UpdateTimeToLiveRequest } // Send marshals and sends the UpdateTimeToLive API request. @@ -2151,7 +2164,7 @@ func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) UpdateT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTimeToLiveRequest{Request: req, Input: input} + return UpdateTimeToLiveRequest{Request: req, Input: input, Copy: c.UpdateTimeToLiveRequest} } // Represents an attribute for describing the key schema for the table and indexes. diff --git a/service/dynamodb/dynamodbiface/interface.go b/service/dynamodb/dynamodbiface/interface.go index 1fa23243c4b..5c73068bcfc 100644 --- a/service/dynamodb/dynamodbiface/interface.go +++ b/service/dynamodb/dynamodbiface/interface.go @@ -65,9 +65,6 @@ import ( type DynamoDBAPI interface { BatchGetItemRequest(*dynamodb.BatchGetItemInput) dynamodb.BatchGetItemRequest - BatchGetItemPages(*dynamodb.BatchGetItemInput, func(*dynamodb.BatchGetItemOutput, bool) bool) error - BatchGetItemPagesWithContext(aws.Context, *dynamodb.BatchGetItemInput, func(*dynamodb.BatchGetItemOutput, bool) bool, ...aws.Option) error - BatchWriteItemRequest(*dynamodb.BatchWriteItemInput) dynamodb.BatchWriteItemRequest CreateBackupRequest(*dynamodb.CreateBackupInput) dynamodb.CreateBackupRequest @@ -102,25 +99,16 @@ type DynamoDBAPI interface { ListTablesRequest(*dynamodb.ListTablesInput) dynamodb.ListTablesRequest - ListTablesPages(*dynamodb.ListTablesInput, func(*dynamodb.ListTablesOutput, bool) bool) error - ListTablesPagesWithContext(aws.Context, *dynamodb.ListTablesInput, func(*dynamodb.ListTablesOutput, bool) bool, ...aws.Option) error - ListTagsOfResourceRequest(*dynamodb.ListTagsOfResourceInput) dynamodb.ListTagsOfResourceRequest PutItemRequest(*dynamodb.PutItemInput) dynamodb.PutItemRequest QueryRequest(*dynamodb.QueryInput) dynamodb.QueryRequest - QueryPages(*dynamodb.QueryInput, func(*dynamodb.QueryOutput, bool) bool) error - QueryPagesWithContext(aws.Context, *dynamodb.QueryInput, func(*dynamodb.QueryOutput, bool) bool, ...aws.Option) error - RestoreTableFromBackupRequest(*dynamodb.RestoreTableFromBackupInput) dynamodb.RestoreTableFromBackupRequest ScanRequest(*dynamodb.ScanInput) dynamodb.ScanRequest - ScanPages(*dynamodb.ScanInput, func(*dynamodb.ScanOutput, bool) bool) error - ScanPagesWithContext(aws.Context, *dynamodb.ScanInput, func(*dynamodb.ScanOutput, bool) bool, ...aws.Option) error - TagResourceRequest(*dynamodb.TagResourceInput) dynamodb.TagResourceRequest UntagResourceRequest(*dynamodb.UntagResourceInput) dynamodb.UntagResourceRequest diff --git a/service/dynamodbstreams/api.go b/service/dynamodbstreams/api.go index dbe98de2be6..6b2b050173a 100644 --- a/service/dynamodbstreams/api.go +++ b/service/dynamodbstreams/api.go @@ -16,6 +16,7 @@ const opDescribeStream = "DescribeStream" type DescribeStreamRequest struct { *aws.Request Input *DescribeStreamInput + Copy func(*DescribeStreamInput) DescribeStreamRequest } // Send marshals and sends the DescribeStream API request. @@ -66,7 +67,7 @@ func (c *DynamoDBStreams) DescribeStreamRequest(input *DescribeStreamInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStreamRequest{Request: req, Input: input} + return DescribeStreamRequest{Request: req, Input: input, Copy: c.DescribeStreamRequest} } const opGetRecords = "GetRecords" @@ -75,6 +76,7 @@ const opGetRecords = "GetRecords" type GetRecordsRequest struct { *aws.Request Input *GetRecordsInput + Copy func(*GetRecordsInput) GetRecordsRequest } // Send marshals and sends the GetRecords API request. @@ -125,7 +127,7 @@ func (c *DynamoDBStreams) GetRecordsRequest(input *GetRecordsInput) GetRecordsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRecordsRequest{Request: req, Input: input} + return GetRecordsRequest{Request: req, Input: input, Copy: c.GetRecordsRequest} } const opGetShardIterator = "GetShardIterator" @@ -134,6 +136,7 @@ const opGetShardIterator = "GetShardIterator" type GetShardIteratorRequest struct { *aws.Request Input *GetShardIteratorInput + Copy func(*GetShardIteratorInput) GetShardIteratorRequest } // Send marshals and sends the GetShardIterator API request. @@ -178,7 +181,7 @@ func (c *DynamoDBStreams) GetShardIteratorRequest(input *GetShardIteratorInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetShardIteratorRequest{Request: req, Input: input} + return GetShardIteratorRequest{Request: req, Input: input, Copy: c.GetShardIteratorRequest} } const opListStreams = "ListStreams" @@ -187,6 +190,7 @@ const opListStreams = "ListStreams" type ListStreamsRequest struct { *aws.Request Input *ListStreamsInput + Copy func(*ListStreamsInput) ListStreamsRequest } // Send marshals and sends the ListStreams API request. @@ -231,7 +235,7 @@ func (c *DynamoDBStreams) ListStreamsRequest(input *ListStreamsInput) ListStream req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStreamsRequest{Request: req, Input: input} + return ListStreamsRequest{Request: req, Input: input, Copy: c.ListStreamsRequest} } // Represents the input of a DescribeStream operation. diff --git a/service/ec2/api.go b/service/ec2/api.go index bf8703f1ff3..c7090ebf0de 100644 --- a/service/ec2/api.go +++ b/service/ec2/api.go @@ -18,6 +18,7 @@ const opAcceptReservedInstancesExchangeQuote = "AcceptReservedInstancesExchangeQ type AcceptReservedInstancesExchangeQuoteRequest struct { *aws.Request Input *AcceptReservedInstancesExchangeQuoteInput + Copy func(*AcceptReservedInstancesExchangeQuoteInput) AcceptReservedInstancesExchangeQuoteRequest } // Send marshals and sends the AcceptReservedInstancesExchangeQuote API request. @@ -59,7 +60,7 @@ func (c *EC2) AcceptReservedInstancesExchangeQuoteRequest(input *AcceptReservedI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcceptReservedInstancesExchangeQuoteRequest{Request: req, Input: input} + return AcceptReservedInstancesExchangeQuoteRequest{Request: req, Input: input, Copy: c.AcceptReservedInstancesExchangeQuoteRequest} } const opAcceptVpcEndpointConnections = "AcceptVpcEndpointConnections" @@ -68,6 +69,7 @@ const opAcceptVpcEndpointConnections = "AcceptVpcEndpointConnections" type AcceptVpcEndpointConnectionsRequest struct { *aws.Request Input *AcceptVpcEndpointConnectionsInput + Copy func(*AcceptVpcEndpointConnectionsInput) AcceptVpcEndpointConnectionsRequest } // Send marshals and sends the AcceptVpcEndpointConnections API request. @@ -109,7 +111,7 @@ func (c *EC2) AcceptVpcEndpointConnectionsRequest(input *AcceptVpcEndpointConnec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcceptVpcEndpointConnectionsRequest{Request: req, Input: input} + return AcceptVpcEndpointConnectionsRequest{Request: req, Input: input, Copy: c.AcceptVpcEndpointConnectionsRequest} } const opAcceptVpcPeeringConnection = "AcceptVpcPeeringConnection" @@ -118,6 +120,7 @@ const opAcceptVpcPeeringConnection = "AcceptVpcPeeringConnection" type AcceptVpcPeeringConnectionRequest struct { *aws.Request Input *AcceptVpcPeeringConnectionInput + Copy func(*AcceptVpcPeeringConnectionInput) AcceptVpcPeeringConnectionRequest } // Send marshals and sends the AcceptVpcPeeringConnection API request. @@ -164,7 +167,7 @@ func (c *EC2) AcceptVpcPeeringConnectionRequest(input *AcceptVpcPeeringConnectio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcceptVpcPeeringConnectionRequest{Request: req, Input: input} + return AcceptVpcPeeringConnectionRequest{Request: req, Input: input, Copy: c.AcceptVpcPeeringConnectionRequest} } const opAllocateAddress = "AllocateAddress" @@ -173,6 +176,7 @@ const opAllocateAddress = "AllocateAddress" type AllocateAddressRequest struct { *aws.Request Input *AllocateAddressInput + Copy func(*AllocateAddressInput) AllocateAddressRequest } // Send marshals and sends the AllocateAddress API request. @@ -225,7 +229,7 @@ func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) AllocateAddres req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AllocateAddressRequest{Request: req, Input: input} + return AllocateAddressRequest{Request: req, Input: input, Copy: c.AllocateAddressRequest} } const opAllocateHosts = "AllocateHosts" @@ -234,6 +238,7 @@ const opAllocateHosts = "AllocateHosts" type AllocateHostsRequest struct { *aws.Request Input *AllocateHostsInput + Copy func(*AllocateHostsInput) AllocateHostsRequest } // Send marshals and sends the AllocateHosts API request. @@ -276,7 +281,7 @@ func (c *EC2) AllocateHostsRequest(input *AllocateHostsInput) AllocateHostsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AllocateHostsRequest{Request: req, Input: input} + return AllocateHostsRequest{Request: req, Input: input, Copy: c.AllocateHostsRequest} } const opAssignIpv6Addresses = "AssignIpv6Addresses" @@ -285,6 +290,7 @@ const opAssignIpv6Addresses = "AssignIpv6Addresses" type AssignIpv6AddressesRequest struct { *aws.Request Input *AssignIpv6AddressesInput + Copy func(*AssignIpv6AddressesInput) AssignIpv6AddressesRequest } // Send marshals and sends the AssignIpv6Addresses API request. @@ -332,7 +338,7 @@ func (c *EC2) AssignIpv6AddressesRequest(input *AssignIpv6AddressesInput) Assign req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssignIpv6AddressesRequest{Request: req, Input: input} + return AssignIpv6AddressesRequest{Request: req, Input: input, Copy: c.AssignIpv6AddressesRequest} } const opAssignPrivateIpAddresses = "AssignPrivateIpAddresses" @@ -341,6 +347,7 @@ const opAssignPrivateIpAddresses = "AssignPrivateIpAddresses" type AssignPrivateIpAddressesRequest struct { *aws.Request Input *AssignPrivateIpAddressesInput + Copy func(*AssignPrivateIpAddressesInput) AssignPrivateIpAddressesRequest } // Send marshals and sends the AssignPrivateIpAddresses API request. @@ -393,7 +400,7 @@ func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AssignPrivateIpAddressesRequest{Request: req, Input: input} + return AssignPrivateIpAddressesRequest{Request: req, Input: input, Copy: c.AssignPrivateIpAddressesRequest} } const opAssociateAddress = "AssociateAddress" @@ -402,6 +409,7 @@ const opAssociateAddress = "AssociateAddress" type AssociateAddressRequest struct { *aws.Request Input *AssociateAddressInput + Copy func(*AssociateAddressInput) AssociateAddressRequest } // Send marshals and sends the AssociateAddress API request. @@ -465,7 +473,7 @@ func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) AssociateAdd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateAddressRequest{Request: req, Input: input} + return AssociateAddressRequest{Request: req, Input: input, Copy: c.AssociateAddressRequest} } const opAssociateDhcpOptions = "AssociateDhcpOptions" @@ -474,6 +482,7 @@ const opAssociateDhcpOptions = "AssociateDhcpOptions" type AssociateDhcpOptionsRequest struct { *aws.Request Input *AssociateDhcpOptionsInput + Copy func(*AssociateDhcpOptionsInput) AssociateDhcpOptionsRequest } // Send marshals and sends the AssociateDhcpOptions API request. @@ -527,7 +536,7 @@ func (c *EC2) AssociateDhcpOptionsRequest(input *AssociateDhcpOptionsInput) Asso req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AssociateDhcpOptionsRequest{Request: req, Input: input} + return AssociateDhcpOptionsRequest{Request: req, Input: input, Copy: c.AssociateDhcpOptionsRequest} } const opAssociateIamInstanceProfile = "AssociateIamInstanceProfile" @@ -536,6 +545,7 @@ const opAssociateIamInstanceProfile = "AssociateIamInstanceProfile" type AssociateIamInstanceProfileRequest struct { *aws.Request Input *AssociateIamInstanceProfileInput + Copy func(*AssociateIamInstanceProfileInput) AssociateIamInstanceProfileRequest } // Send marshals and sends the AssociateIamInstanceProfile API request. @@ -577,7 +587,7 @@ func (c *EC2) AssociateIamInstanceProfileRequest(input *AssociateIamInstanceProf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateIamInstanceProfileRequest{Request: req, Input: input} + return AssociateIamInstanceProfileRequest{Request: req, Input: input, Copy: c.AssociateIamInstanceProfileRequest} } const opAssociateRouteTable = "AssociateRouteTable" @@ -586,6 +596,7 @@ const opAssociateRouteTable = "AssociateRouteTable" type AssociateRouteTableRequest struct { *aws.Request Input *AssociateRouteTableInput + Copy func(*AssociateRouteTableInput) AssociateRouteTableRequest } // Send marshals and sends the AssociateRouteTable API request. @@ -633,7 +644,7 @@ func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) Associ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateRouteTableRequest{Request: req, Input: input} + return AssociateRouteTableRequest{Request: req, Input: input, Copy: c.AssociateRouteTableRequest} } const opAssociateSubnetCidrBlock = "AssociateSubnetCidrBlock" @@ -642,6 +653,7 @@ const opAssociateSubnetCidrBlock = "AssociateSubnetCidrBlock" type AssociateSubnetCidrBlockRequest struct { *aws.Request Input *AssociateSubnetCidrBlockInput + Copy func(*AssociateSubnetCidrBlockInput) AssociateSubnetCidrBlockRequest } // Send marshals and sends the AssociateSubnetCidrBlock API request. @@ -684,7 +696,7 @@ func (c *EC2) AssociateSubnetCidrBlockRequest(input *AssociateSubnetCidrBlockInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateSubnetCidrBlockRequest{Request: req, Input: input} + return AssociateSubnetCidrBlockRequest{Request: req, Input: input, Copy: c.AssociateSubnetCidrBlockRequest} } const opAssociateVpcCidrBlock = "AssociateVpcCidrBlock" @@ -693,6 +705,7 @@ const opAssociateVpcCidrBlock = "AssociateVpcCidrBlock" type AssociateVpcCidrBlockRequest struct { *aws.Request Input *AssociateVpcCidrBlockInput + Copy func(*AssociateVpcCidrBlockInput) AssociateVpcCidrBlockRequest } // Send marshals and sends the AssociateVpcCidrBlock API request. @@ -739,7 +752,7 @@ func (c *EC2) AssociateVpcCidrBlockRequest(input *AssociateVpcCidrBlockInput) As req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateVpcCidrBlockRequest{Request: req, Input: input} + return AssociateVpcCidrBlockRequest{Request: req, Input: input, Copy: c.AssociateVpcCidrBlockRequest} } const opAttachClassicLinkVpc = "AttachClassicLinkVpc" @@ -748,6 +761,7 @@ const opAttachClassicLinkVpc = "AttachClassicLinkVpc" type AttachClassicLinkVpcRequest struct { *aws.Request Input *AttachClassicLinkVpcInput + Copy func(*AttachClassicLinkVpcInput) AttachClassicLinkVpcRequest } // Send marshals and sends the AttachClassicLinkVpc API request. @@ -799,7 +813,7 @@ func (c *EC2) AttachClassicLinkVpcRequest(input *AttachClassicLinkVpcInput) Atta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachClassicLinkVpcRequest{Request: req, Input: input} + return AttachClassicLinkVpcRequest{Request: req, Input: input, Copy: c.AttachClassicLinkVpcRequest} } const opAttachInternetGateway = "AttachInternetGateway" @@ -808,6 +822,7 @@ const opAttachInternetGateway = "AttachInternetGateway" type AttachInternetGatewayRequest struct { *aws.Request Input *AttachInternetGatewayInput + Copy func(*AttachInternetGatewayInput) AttachInternetGatewayRequest } // Send marshals and sends the AttachInternetGateway API request. @@ -852,7 +867,7 @@ func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) At req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AttachInternetGatewayRequest{Request: req, Input: input} + return AttachInternetGatewayRequest{Request: req, Input: input, Copy: c.AttachInternetGatewayRequest} } const opAttachNetworkInterface = "AttachNetworkInterface" @@ -861,6 +876,7 @@ const opAttachNetworkInterface = "AttachNetworkInterface" type AttachNetworkInterfaceRequest struct { *aws.Request Input *AttachNetworkInterfaceInput + Copy func(*AttachNetworkInterfaceInput) AttachNetworkInterfaceRequest } // Send marshals and sends the AttachNetworkInterface API request. @@ -901,7 +917,7 @@ func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachNetworkInterfaceRequest{Request: req, Input: input} + return AttachNetworkInterfaceRequest{Request: req, Input: input, Copy: c.AttachNetworkInterfaceRequest} } const opAttachVolume = "AttachVolume" @@ -910,6 +926,7 @@ const opAttachVolume = "AttachVolume" type AttachVolumeRequest struct { *aws.Request Input *AttachVolumeInput + Copy func(*AttachVolumeInput) AttachVolumeRequest } // Send marshals and sends the AttachVolume API request. @@ -979,7 +996,7 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) AttachVolumeRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachVolumeRequest{Request: req, Input: input} + return AttachVolumeRequest{Request: req, Input: input, Copy: c.AttachVolumeRequest} } const opAttachVpnGateway = "AttachVpnGateway" @@ -988,6 +1005,7 @@ const opAttachVpnGateway = "AttachVpnGateway" type AttachVpnGatewayRequest struct { *aws.Request Input *AttachVpnGatewayInput + Copy func(*AttachVpnGatewayInput) AttachVpnGatewayRequest } // Send marshals and sends the AttachVpnGateway API request. @@ -1032,7 +1050,7 @@ func (c *EC2) AttachVpnGatewayRequest(input *AttachVpnGatewayInput) AttachVpnGat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachVpnGatewayRequest{Request: req, Input: input} + return AttachVpnGatewayRequest{Request: req, Input: input, Copy: c.AttachVpnGatewayRequest} } const opAuthorizeSecurityGroupEgress = "AuthorizeSecurityGroupEgress" @@ -1041,6 +1059,7 @@ const opAuthorizeSecurityGroupEgress = "AuthorizeSecurityGroupEgress" type AuthorizeSecurityGroupEgressRequest struct { *aws.Request Input *AuthorizeSecurityGroupEgressInput + Copy func(*AuthorizeSecurityGroupEgressInput) AuthorizeSecurityGroupEgressRequest } // Send marshals and sends the AuthorizeSecurityGroupEgress API request. @@ -1100,7 +1119,7 @@ func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupE req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AuthorizeSecurityGroupEgressRequest{Request: req, Input: input} + return AuthorizeSecurityGroupEgressRequest{Request: req, Input: input, Copy: c.AuthorizeSecurityGroupEgressRequest} } const opAuthorizeSecurityGroupIngress = "AuthorizeSecurityGroupIngress" @@ -1109,6 +1128,7 @@ const opAuthorizeSecurityGroupIngress = "AuthorizeSecurityGroupIngress" type AuthorizeSecurityGroupIngressRequest struct { *aws.Request Input *AuthorizeSecurityGroupIngressInput + Copy func(*AuthorizeSecurityGroupIngressInput) AuthorizeSecurityGroupIngressRequest } // Send marshals and sends the AuthorizeSecurityGroupIngress API request. @@ -1169,7 +1189,7 @@ func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroup req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AuthorizeSecurityGroupIngressRequest{Request: req, Input: input} + return AuthorizeSecurityGroupIngressRequest{Request: req, Input: input, Copy: c.AuthorizeSecurityGroupIngressRequest} } const opBundleInstance = "BundleInstance" @@ -1178,6 +1198,7 @@ const opBundleInstance = "BundleInstance" type BundleInstanceRequest struct { *aws.Request Input *BundleInstanceInput + Copy func(*BundleInstanceInput) BundleInstanceRequest } // Send marshals and sends the BundleInstance API request. @@ -1226,7 +1247,7 @@ func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) BundleInstanceRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BundleInstanceRequest{Request: req, Input: input} + return BundleInstanceRequest{Request: req, Input: input, Copy: c.BundleInstanceRequest} } const opCancelBundleTask = "CancelBundleTask" @@ -1235,6 +1256,7 @@ const opCancelBundleTask = "CancelBundleTask" type CancelBundleTaskRequest struct { *aws.Request Input *CancelBundleTaskInput + Copy func(*CancelBundleTaskInput) CancelBundleTaskRequest } // Send marshals and sends the CancelBundleTask API request. @@ -1275,7 +1297,7 @@ func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) CancelBundle req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelBundleTaskRequest{Request: req, Input: input} + return CancelBundleTaskRequest{Request: req, Input: input, Copy: c.CancelBundleTaskRequest} } const opCancelConversionTask = "CancelConversionTask" @@ -1284,6 +1306,7 @@ const opCancelConversionTask = "CancelConversionTask" type CancelConversionTaskRequest struct { *aws.Request Input *CancelConversionTaskInput + Copy func(*CancelConversionTaskInput) CancelConversionTaskRequest } // Send marshals and sends the CancelConversionTask API request. @@ -1333,7 +1356,7 @@ func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) Canc req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CancelConversionTaskRequest{Request: req, Input: input} + return CancelConversionTaskRequest{Request: req, Input: input, Copy: c.CancelConversionTaskRequest} } const opCancelExportTask = "CancelExportTask" @@ -1342,6 +1365,7 @@ const opCancelExportTask = "CancelExportTask" type CancelExportTaskRequest struct { *aws.Request Input *CancelExportTaskInput + Copy func(*CancelExportTaskInput) CancelExportTaskRequest } // Send marshals and sends the CancelExportTask API request. @@ -1387,7 +1411,7 @@ func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) CancelExport req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CancelExportTaskRequest{Request: req, Input: input} + return CancelExportTaskRequest{Request: req, Input: input, Copy: c.CancelExportTaskRequest} } const opCancelImportTask = "CancelImportTask" @@ -1396,6 +1420,7 @@ const opCancelImportTask = "CancelImportTask" type CancelImportTaskRequest struct { *aws.Request Input *CancelImportTaskInput + Copy func(*CancelImportTaskInput) CancelImportTaskRequest } // Send marshals and sends the CancelImportTask API request. @@ -1436,7 +1461,7 @@ func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) CancelImport req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelImportTaskRequest{Request: req, Input: input} + return CancelImportTaskRequest{Request: req, Input: input, Copy: c.CancelImportTaskRequest} } const opCancelReservedInstancesListing = "CancelReservedInstancesListing" @@ -1445,6 +1470,7 @@ const opCancelReservedInstancesListing = "CancelReservedInstancesListing" type CancelReservedInstancesListingRequest struct { *aws.Request Input *CancelReservedInstancesListingInput + Copy func(*CancelReservedInstancesListingInput) CancelReservedInstancesListingRequest } // Send marshals and sends the CancelReservedInstancesListing API request. @@ -1489,7 +1515,7 @@ func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelReservedInstancesListingRequest{Request: req, Input: input} + return CancelReservedInstancesListingRequest{Request: req, Input: input, Copy: c.CancelReservedInstancesListingRequest} } const opCancelSpotFleetRequests = "CancelSpotFleetRequests" @@ -1498,6 +1524,7 @@ const opCancelSpotFleetRequests = "CancelSpotFleetRequests" type CancelSpotFleetRequestsRequest struct { *aws.Request Input *CancelSpotFleetRequestsInput + Copy func(*CancelSpotFleetRequestsInput) CancelSpotFleetRequestsRequest } // Send marshals and sends the CancelSpotFleetRequests API request. @@ -1545,7 +1572,7 @@ func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelSpotFleetRequestsRequest{Request: req, Input: input} + return CancelSpotFleetRequestsRequest{Request: req, Input: input, Copy: c.CancelSpotFleetRequestsRequest} } const opCancelSpotInstanceRequests = "CancelSpotInstanceRequests" @@ -1554,6 +1581,7 @@ const opCancelSpotInstanceRequests = "CancelSpotInstanceRequests" type CancelSpotInstanceRequestsRequest struct { *aws.Request Input *CancelSpotInstanceRequestsInput + Copy func(*CancelSpotInstanceRequestsInput) CancelSpotInstanceRequestsRequest } // Send marshals and sends the CancelSpotInstanceRequests API request. @@ -1601,7 +1629,7 @@ func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelSpotInstanceRequestsRequest{Request: req, Input: input} + return CancelSpotInstanceRequestsRequest{Request: req, Input: input, Copy: c.CancelSpotInstanceRequestsRequest} } const opConfirmProductInstance = "ConfirmProductInstance" @@ -1610,6 +1638,7 @@ const opConfirmProductInstance = "ConfirmProductInstance" type ConfirmProductInstanceRequest struct { *aws.Request Input *ConfirmProductInstanceInput + Copy func(*ConfirmProductInstanceInput) ConfirmProductInstanceRequest } // Send marshals and sends the ConfirmProductInstance API request. @@ -1652,7 +1681,7 @@ func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ConfirmProductInstanceRequest{Request: req, Input: input} + return ConfirmProductInstanceRequest{Request: req, Input: input, Copy: c.ConfirmProductInstanceRequest} } const opCopyFpgaImage = "CopyFpgaImage" @@ -1661,6 +1690,7 @@ const opCopyFpgaImage = "CopyFpgaImage" type CopyFpgaImageRequest struct { *aws.Request Input *CopyFpgaImageInput + Copy func(*CopyFpgaImageInput) CopyFpgaImageRequest } // Send marshals and sends the CopyFpgaImage API request. @@ -1701,7 +1731,7 @@ func (c *EC2) CopyFpgaImageRequest(input *CopyFpgaImageInput) CopyFpgaImageReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyFpgaImageRequest{Request: req, Input: input} + return CopyFpgaImageRequest{Request: req, Input: input, Copy: c.CopyFpgaImageRequest} } const opCopyImage = "CopyImage" @@ -1710,6 +1740,7 @@ const opCopyImage = "CopyImage" type CopyImageRequest struct { *aws.Request Input *CopyImageInput + Copy func(*CopyImageInput) CopyImageRequest } // Send marshals and sends the CopyImage API request. @@ -1756,7 +1787,7 @@ func (c *EC2) CopyImageRequest(input *CopyImageInput) CopyImageRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyImageRequest{Request: req, Input: input} + return CopyImageRequest{Request: req, Input: input, Copy: c.CopyImageRequest} } const opCopySnapshot = "CopySnapshot" @@ -1765,6 +1796,7 @@ const opCopySnapshot = "CopySnapshot" type CopySnapshotRequest struct { *aws.Request Input *CopySnapshotInput + Copy func(*CopySnapshotInput) CopySnapshotRequest } // Send marshals and sends the CopySnapshot API request. @@ -1824,7 +1856,7 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) CopySnapshotRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopySnapshotRequest{Request: req, Input: input} + return CopySnapshotRequest{Request: req, Input: input, Copy: c.CopySnapshotRequest} } const opCreateCustomerGateway = "CreateCustomerGateway" @@ -1833,6 +1865,7 @@ const opCreateCustomerGateway = "CreateCustomerGateway" type CreateCustomerGatewayRequest struct { *aws.Request Input *CreateCustomerGatewayInput + Copy func(*CreateCustomerGatewayInput) CreateCustomerGatewayRequest } // Send marshals and sends the CreateCustomerGateway API request. @@ -1897,7 +1930,7 @@ func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCustomerGatewayRequest{Request: req, Input: input} + return CreateCustomerGatewayRequest{Request: req, Input: input, Copy: c.CreateCustomerGatewayRequest} } const opCreateDefaultSubnet = "CreateDefaultSubnet" @@ -1906,6 +1939,7 @@ const opCreateDefaultSubnet = "CreateDefaultSubnet" type CreateDefaultSubnetRequest struct { *aws.Request Input *CreateDefaultSubnetInput + Copy func(*CreateDefaultSubnetInput) CreateDefaultSubnetRequest } // Send marshals and sends the CreateDefaultSubnet API request. @@ -1950,7 +1984,7 @@ func (c *EC2) CreateDefaultSubnetRequest(input *CreateDefaultSubnetInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDefaultSubnetRequest{Request: req, Input: input} + return CreateDefaultSubnetRequest{Request: req, Input: input, Copy: c.CreateDefaultSubnetRequest} } const opCreateDefaultVpc = "CreateDefaultVpc" @@ -1959,6 +1993,7 @@ const opCreateDefaultVpc = "CreateDefaultVpc" type CreateDefaultVpcRequest struct { *aws.Request Input *CreateDefaultVpcInput + Copy func(*CreateDefaultVpcInput) CreateDefaultVpcRequest } // Send marshals and sends the CreateDefaultVpc API request. @@ -2011,7 +2046,7 @@ func (c *EC2) CreateDefaultVpcRequest(input *CreateDefaultVpcInput) CreateDefaul req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDefaultVpcRequest{Request: req, Input: input} + return CreateDefaultVpcRequest{Request: req, Input: input, Copy: c.CreateDefaultVpcRequest} } const opCreateDhcpOptions = "CreateDhcpOptions" @@ -2020,6 +2055,7 @@ const opCreateDhcpOptions = "CreateDhcpOptions" type CreateDhcpOptionsRequest struct { *aws.Request Input *CreateDhcpOptionsInput + Copy func(*CreateDhcpOptionsInput) CreateDhcpOptionsRequest } // Send marshals and sends the CreateDhcpOptions API request. @@ -2099,7 +2135,7 @@ func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) CreateDhcp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDhcpOptionsRequest{Request: req, Input: input} + return CreateDhcpOptionsRequest{Request: req, Input: input, Copy: c.CreateDhcpOptionsRequest} } const opCreateEgressOnlyInternetGateway = "CreateEgressOnlyInternetGateway" @@ -2108,6 +2144,7 @@ const opCreateEgressOnlyInternetGateway = "CreateEgressOnlyInternetGateway" type CreateEgressOnlyInternetGatewayRequest struct { *aws.Request Input *CreateEgressOnlyInternetGatewayInput + Copy func(*CreateEgressOnlyInternetGatewayInput) CreateEgressOnlyInternetGatewayRequest } // Send marshals and sends the CreateEgressOnlyInternetGateway API request. @@ -2151,7 +2188,7 @@ func (c *EC2) CreateEgressOnlyInternetGatewayRequest(input *CreateEgressOnlyInte req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEgressOnlyInternetGatewayRequest{Request: req, Input: input} + return CreateEgressOnlyInternetGatewayRequest{Request: req, Input: input, Copy: c.CreateEgressOnlyInternetGatewayRequest} } const opCreateFlowLogs = "CreateFlowLogs" @@ -2160,6 +2197,7 @@ const opCreateFlowLogs = "CreateFlowLogs" type CreateFlowLogsRequest struct { *aws.Request Input *CreateFlowLogsInput + Copy func(*CreateFlowLogsInput) CreateFlowLogsRequest } // Send marshals and sends the CreateFlowLogs API request. @@ -2209,7 +2247,7 @@ func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) CreateFlowLogsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFlowLogsRequest{Request: req, Input: input} + return CreateFlowLogsRequest{Request: req, Input: input, Copy: c.CreateFlowLogsRequest} } const opCreateFpgaImage = "CreateFpgaImage" @@ -2218,6 +2256,7 @@ const opCreateFpgaImage = "CreateFpgaImage" type CreateFpgaImageRequest struct { *aws.Request Input *CreateFpgaImageInput + Copy func(*CreateFpgaImageInput) CreateFpgaImageRequest } // Send marshals and sends the CreateFpgaImage API request. @@ -2265,7 +2304,7 @@ func (c *EC2) CreateFpgaImageRequest(input *CreateFpgaImageInput) CreateFpgaImag req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFpgaImageRequest{Request: req, Input: input} + return CreateFpgaImageRequest{Request: req, Input: input, Copy: c.CreateFpgaImageRequest} } const opCreateImage = "CreateImage" @@ -2274,6 +2313,7 @@ const opCreateImage = "CreateImage" type CreateImageRequest struct { *aws.Request Input *CreateImageInput + Copy func(*CreateImageInput) CreateImageRequest } // Send marshals and sends the CreateImage API request. @@ -2323,7 +2363,7 @@ func (c *EC2) CreateImageRequest(input *CreateImageInput) CreateImageRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateImageRequest{Request: req, Input: input} + return CreateImageRequest{Request: req, Input: input, Copy: c.CreateImageRequest} } const opCreateInstanceExportTask = "CreateInstanceExportTask" @@ -2332,6 +2372,7 @@ const opCreateInstanceExportTask = "CreateInstanceExportTask" type CreateInstanceExportTaskRequest struct { *aws.Request Input *CreateInstanceExportTaskInput + Copy func(*CreateInstanceExportTaskInput) CreateInstanceExportTaskRequest } // Send marshals and sends the CreateInstanceExportTask API request. @@ -2377,7 +2418,7 @@ func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInstanceExportTaskRequest{Request: req, Input: input} + return CreateInstanceExportTaskRequest{Request: req, Input: input, Copy: c.CreateInstanceExportTaskRequest} } const opCreateInternetGateway = "CreateInternetGateway" @@ -2386,6 +2427,7 @@ const opCreateInternetGateway = "CreateInternetGateway" type CreateInternetGatewayRequest struct { *aws.Request Input *CreateInternetGatewayInput + Copy func(*CreateInternetGatewayInput) CreateInternetGatewayRequest } // Send marshals and sends the CreateInternetGateway API request. @@ -2430,7 +2472,7 @@ func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInternetGatewayRequest{Request: req, Input: input} + return CreateInternetGatewayRequest{Request: req, Input: input, Copy: c.CreateInternetGatewayRequest} } const opCreateKeyPair = "CreateKeyPair" @@ -2439,6 +2481,7 @@ const opCreateKeyPair = "CreateKeyPair" type CreateKeyPairRequest struct { *aws.Request Input *CreateKeyPairInput + Copy func(*CreateKeyPairInput) CreateKeyPairRequest } // Send marshals and sends the CreateKeyPair API request. @@ -2491,7 +2534,7 @@ func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) CreateKeyPairReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateKeyPairRequest{Request: req, Input: input} + return CreateKeyPairRequest{Request: req, Input: input, Copy: c.CreateKeyPairRequest} } const opCreateLaunchTemplate = "CreateLaunchTemplate" @@ -2500,6 +2543,7 @@ const opCreateLaunchTemplate = "CreateLaunchTemplate" type CreateLaunchTemplateRequest struct { *aws.Request Input *CreateLaunchTemplateInput + Copy func(*CreateLaunchTemplateInput) CreateLaunchTemplateRequest } // Send marshals and sends the CreateLaunchTemplate API request. @@ -2542,7 +2586,7 @@ func (c *EC2) CreateLaunchTemplateRequest(input *CreateLaunchTemplateInput) Crea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLaunchTemplateRequest{Request: req, Input: input} + return CreateLaunchTemplateRequest{Request: req, Input: input, Copy: c.CreateLaunchTemplateRequest} } const opCreateLaunchTemplateVersion = "CreateLaunchTemplateVersion" @@ -2551,6 +2595,7 @@ const opCreateLaunchTemplateVersion = "CreateLaunchTemplateVersion" type CreateLaunchTemplateVersionRequest struct { *aws.Request Input *CreateLaunchTemplateVersionInput + Copy func(*CreateLaunchTemplateVersionInput) CreateLaunchTemplateVersionRequest } // Send marshals and sends the CreateLaunchTemplateVersion API request. @@ -2595,7 +2640,7 @@ func (c *EC2) CreateLaunchTemplateVersionRequest(input *CreateLaunchTemplateVers req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLaunchTemplateVersionRequest{Request: req, Input: input} + return CreateLaunchTemplateVersionRequest{Request: req, Input: input, Copy: c.CreateLaunchTemplateVersionRequest} } const opCreateNatGateway = "CreateNatGateway" @@ -2604,6 +2649,7 @@ const opCreateNatGateway = "CreateNatGateway" type CreateNatGatewayRequest struct { *aws.Request Input *CreateNatGatewayInput + Copy func(*CreateNatGatewayInput) CreateNatGatewayRequest } // Send marshals and sends the CreateNatGateway API request. @@ -2649,7 +2695,7 @@ func (c *EC2) CreateNatGatewayRequest(input *CreateNatGatewayInput) CreateNatGat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNatGatewayRequest{Request: req, Input: input} + return CreateNatGatewayRequest{Request: req, Input: input, Copy: c.CreateNatGatewayRequest} } const opCreateNetworkAcl = "CreateNetworkAcl" @@ -2658,6 +2704,7 @@ const opCreateNetworkAcl = "CreateNetworkAcl" type CreateNetworkAclRequest struct { *aws.Request Input *CreateNetworkAclInput + Copy func(*CreateNetworkAclInput) CreateNetworkAclRequest } // Send marshals and sends the CreateNetworkAcl API request. @@ -2702,7 +2749,7 @@ func (c *EC2) CreateNetworkAclRequest(input *CreateNetworkAclInput) CreateNetwor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNetworkAclRequest{Request: req, Input: input} + return CreateNetworkAclRequest{Request: req, Input: input, Copy: c.CreateNetworkAclRequest} } const opCreateNetworkAclEntry = "CreateNetworkAclEntry" @@ -2711,6 +2758,7 @@ const opCreateNetworkAclEntry = "CreateNetworkAclEntry" type CreateNetworkAclEntryRequest struct { *aws.Request Input *CreateNetworkAclEntryInput + Copy func(*CreateNetworkAclEntryInput) CreateNetworkAclEntryRequest } // Send marshals and sends the CreateNetworkAclEntry API request. @@ -2769,7 +2817,7 @@ func (c *EC2) CreateNetworkAclEntryRequest(input *CreateNetworkAclEntryInput) Cr req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateNetworkAclEntryRequest{Request: req, Input: input} + return CreateNetworkAclEntryRequest{Request: req, Input: input, Copy: c.CreateNetworkAclEntryRequest} } const opCreateNetworkInterface = "CreateNetworkInterface" @@ -2778,6 +2826,7 @@ const opCreateNetworkInterface = "CreateNetworkInterface" type CreateNetworkInterfaceRequest struct { *aws.Request Input *CreateNetworkInterfaceInput + Copy func(*CreateNetworkInterfaceInput) CreateNetworkInterfaceRequest } // Send marshals and sends the CreateNetworkInterface API request. @@ -2822,7 +2871,7 @@ func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNetworkInterfaceRequest{Request: req, Input: input} + return CreateNetworkInterfaceRequest{Request: req, Input: input, Copy: c.CreateNetworkInterfaceRequest} } const opCreateNetworkInterfacePermission = "CreateNetworkInterfacePermission" @@ -2831,6 +2880,7 @@ const opCreateNetworkInterfacePermission = "CreateNetworkInterfacePermission" type CreateNetworkInterfacePermissionRequest struct { *aws.Request Input *CreateNetworkInterfacePermissionInput + Copy func(*CreateNetworkInterfacePermissionInput) CreateNetworkInterfacePermissionRequest } // Send marshals and sends the CreateNetworkInterfacePermission API request. @@ -2875,7 +2925,7 @@ func (c *EC2) CreateNetworkInterfacePermissionRequest(input *CreateNetworkInterf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNetworkInterfacePermissionRequest{Request: req, Input: input} + return CreateNetworkInterfacePermissionRequest{Request: req, Input: input, Copy: c.CreateNetworkInterfacePermissionRequest} } const opCreatePlacementGroup = "CreatePlacementGroup" @@ -2884,6 +2934,7 @@ const opCreatePlacementGroup = "CreatePlacementGroup" type CreatePlacementGroupRequest struct { *aws.Request Input *CreatePlacementGroupInput + Copy func(*CreatePlacementGroupInput) CreatePlacementGroupRequest } // Send marshals and sends the CreatePlacementGroup API request. @@ -2934,7 +2985,7 @@ func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) Crea req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreatePlacementGroupRequest{Request: req, Input: input} + return CreatePlacementGroupRequest{Request: req, Input: input, Copy: c.CreatePlacementGroupRequest} } const opCreateReservedInstancesListing = "CreateReservedInstancesListing" @@ -2943,6 +2994,7 @@ const opCreateReservedInstancesListing = "CreateReservedInstancesListing" type CreateReservedInstancesListingRequest struct { *aws.Request Input *CreateReservedInstancesListingInput + Copy func(*CreateReservedInstancesListingInput) CreateReservedInstancesListingRequest } // Send marshals and sends the CreateReservedInstancesListing API request. @@ -3006,7 +3058,7 @@ func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReservedInstancesListingRequest{Request: req, Input: input} + return CreateReservedInstancesListingRequest{Request: req, Input: input, Copy: c.CreateReservedInstancesListingRequest} } const opCreateRoute = "CreateRoute" @@ -3015,6 +3067,7 @@ const opCreateRoute = "CreateRoute" type CreateRouteRequest struct { *aws.Request Input *CreateRouteInput + Copy func(*CreateRouteInput) CreateRouteRequest } // Send marshals and sends the CreateRoute API request. @@ -3074,7 +3127,7 @@ func (c *EC2) CreateRouteRequest(input *CreateRouteInput) CreateRouteRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRouteRequest{Request: req, Input: input} + return CreateRouteRequest{Request: req, Input: input, Copy: c.CreateRouteRequest} } const opCreateRouteTable = "CreateRouteTable" @@ -3083,6 +3136,7 @@ const opCreateRouteTable = "CreateRouteTable" type CreateRouteTableRequest struct { *aws.Request Input *CreateRouteTableInput + Copy func(*CreateRouteTableInput) CreateRouteTableRequest } // Send marshals and sends the CreateRouteTable API request. @@ -3127,7 +3181,7 @@ func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) CreateRouteT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRouteTableRequest{Request: req, Input: input} + return CreateRouteTableRequest{Request: req, Input: input, Copy: c.CreateRouteTableRequest} } const opCreateSecurityGroup = "CreateSecurityGroup" @@ -3136,6 +3190,7 @@ const opCreateSecurityGroup = "CreateSecurityGroup" type CreateSecurityGroupRequest struct { *aws.Request Input *CreateSecurityGroupInput + Copy func(*CreateSecurityGroupInput) CreateSecurityGroupRequest } // Send marshals and sends the CreateSecurityGroup API request. @@ -3202,7 +3257,7 @@ func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSecurityGroupRequest{Request: req, Input: input} + return CreateSecurityGroupRequest{Request: req, Input: input, Copy: c.CreateSecurityGroupRequest} } const opCreateSnapshot = "CreateSnapshot" @@ -3211,6 +3266,7 @@ const opCreateSnapshot = "CreateSnapshot" type CreateSnapshotRequest struct { *aws.Request Input *CreateSnapshotInput + Copy func(*CreateSnapshotInput) CreateSnapshotRequest } // Send marshals and sends the CreateSnapshot API request. @@ -3278,7 +3334,7 @@ func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) CreateSnapshotRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSnapshotRequest{Request: req, Input: input} + return CreateSnapshotRequest{Request: req, Input: input, Copy: c.CreateSnapshotRequest} } const opCreateSpotDatafeedSubscription = "CreateSpotDatafeedSubscription" @@ -3287,6 +3343,7 @@ const opCreateSpotDatafeedSubscription = "CreateSpotDatafeedSubscription" type CreateSpotDatafeedSubscriptionRequest struct { *aws.Request Input *CreateSpotDatafeedSubscriptionInput + Copy func(*CreateSpotDatafeedSubscriptionInput) CreateSpotDatafeedSubscriptionRequest } // Send marshals and sends the CreateSpotDatafeedSubscription API request. @@ -3330,7 +3387,7 @@ func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSub req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSpotDatafeedSubscriptionRequest{Request: req, Input: input} + return CreateSpotDatafeedSubscriptionRequest{Request: req, Input: input, Copy: c.CreateSpotDatafeedSubscriptionRequest} } const opCreateSubnet = "CreateSubnet" @@ -3339,6 +3396,7 @@ const opCreateSubnet = "CreateSubnet" type CreateSubnetRequest struct { *aws.Request Input *CreateSubnetInput + Copy func(*CreateSubnetInput) CreateSubnetRequest } // Send marshals and sends the CreateSubnet API request. @@ -3405,7 +3463,7 @@ func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) CreateSubnetRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSubnetRequest{Request: req, Input: input} + return CreateSubnetRequest{Request: req, Input: input, Copy: c.CreateSubnetRequest} } const opCreateTags = "CreateTags" @@ -3414,6 +3472,7 @@ const opCreateTags = "CreateTags" type CreateTagsRequest struct { *aws.Request Input *CreateTagsInput + Copy func(*CreateTagsInput) CreateTagsRequest } // Send marshals and sends the CreateTags API request. @@ -3464,7 +3523,7 @@ func (c *EC2) CreateTagsRequest(input *CreateTagsInput) CreateTagsRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateTagsRequest{Request: req, Input: input} + return CreateTagsRequest{Request: req, Input: input, Copy: c.CreateTagsRequest} } const opCreateVolume = "CreateVolume" @@ -3473,6 +3532,7 @@ const opCreateVolume = "CreateVolume" type CreateVolumeRequest struct { *aws.Request Input *CreateVolumeInput + Copy func(*CreateVolumeInput) CreateVolumeRequest } // Send marshals and sends the CreateVolume API request. @@ -3531,7 +3591,7 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) CreateVolumeRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVolumeRequest{Request: req, Input: input} + return CreateVolumeRequest{Request: req, Input: input, Copy: c.CreateVolumeRequest} } const opCreateVpc = "CreateVpc" @@ -3540,6 +3600,7 @@ const opCreateVpc = "CreateVpc" type CreateVpcRequest struct { *aws.Request Input *CreateVpcInput + Copy func(*CreateVpcInput) CreateVpcRequest } // Send marshals and sends the CreateVpc API request. @@ -3598,7 +3659,7 @@ func (c *EC2) CreateVpcRequest(input *CreateVpcInput) CreateVpcRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpcRequest{Request: req, Input: input} + return CreateVpcRequest{Request: req, Input: input, Copy: c.CreateVpcRequest} } const opCreateVpcEndpoint = "CreateVpcEndpoint" @@ -3607,6 +3668,7 @@ const opCreateVpcEndpoint = "CreateVpcEndpoint" type CreateVpcEndpointRequest struct { *aws.Request Input *CreateVpcEndpointInput + Copy func(*CreateVpcEndpointInput) CreateVpcEndpointRequest } // Send marshals and sends the CreateVpcEndpoint API request. @@ -3663,7 +3725,7 @@ func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) CreateVpcE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpcEndpointRequest{Request: req, Input: input} + return CreateVpcEndpointRequest{Request: req, Input: input, Copy: c.CreateVpcEndpointRequest} } const opCreateVpcEndpointConnectionNotification = "CreateVpcEndpointConnectionNotification" @@ -3672,6 +3734,7 @@ const opCreateVpcEndpointConnectionNotification = "CreateVpcEndpointConnectionNo type CreateVpcEndpointConnectionNotificationRequest struct { *aws.Request Input *CreateVpcEndpointConnectionNotificationInput + Copy func(*CreateVpcEndpointConnectionNotificationInput) CreateVpcEndpointConnectionNotificationRequest } // Send marshals and sends the CreateVpcEndpointConnectionNotification API request. @@ -3718,7 +3781,7 @@ func (c *EC2) CreateVpcEndpointConnectionNotificationRequest(input *CreateVpcEnd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpcEndpointConnectionNotificationRequest{Request: req, Input: input} + return CreateVpcEndpointConnectionNotificationRequest{Request: req, Input: input, Copy: c.CreateVpcEndpointConnectionNotificationRequest} } const opCreateVpcEndpointServiceConfiguration = "CreateVpcEndpointServiceConfiguration" @@ -3727,6 +3790,7 @@ const opCreateVpcEndpointServiceConfiguration = "CreateVpcEndpointServiceConfigu type CreateVpcEndpointServiceConfigurationRequest struct { *aws.Request Input *CreateVpcEndpointServiceConfigurationInput + Copy func(*CreateVpcEndpointServiceConfigurationInput) CreateVpcEndpointServiceConfigurationRequest } // Send marshals and sends the CreateVpcEndpointServiceConfiguration API request. @@ -3774,7 +3838,7 @@ func (c *EC2) CreateVpcEndpointServiceConfigurationRequest(input *CreateVpcEndpo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpcEndpointServiceConfigurationRequest{Request: req, Input: input} + return CreateVpcEndpointServiceConfigurationRequest{Request: req, Input: input, Copy: c.CreateVpcEndpointServiceConfigurationRequest} } const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection" @@ -3783,6 +3847,7 @@ const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection" type CreateVpcPeeringConnectionRequest struct { *aws.Request Input *CreateVpcPeeringConnectionInput + Copy func(*CreateVpcPeeringConnectionInput) CreateVpcPeeringConnectionRequest } // Send marshals and sends the CreateVpcPeeringConnection API request. @@ -3834,7 +3899,7 @@ func (c *EC2) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConnectio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpcPeeringConnectionRequest{Request: req, Input: input} + return CreateVpcPeeringConnectionRequest{Request: req, Input: input, Copy: c.CreateVpcPeeringConnectionRequest} } const opCreateVpnConnection = "CreateVpnConnection" @@ -3843,6 +3908,7 @@ const opCreateVpnConnection = "CreateVpnConnection" type CreateVpnConnectionRequest struct { *aws.Request Input *CreateVpnConnectionInput + Copy func(*CreateVpnConnectionInput) CreateVpnConnectionRequest } // Send marshals and sends the CreateVpnConnection API request. @@ -3901,7 +3967,7 @@ func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpnConnectionRequest{Request: req, Input: input} + return CreateVpnConnectionRequest{Request: req, Input: input, Copy: c.CreateVpnConnectionRequest} } const opCreateVpnConnectionRoute = "CreateVpnConnectionRoute" @@ -3910,6 +3976,7 @@ const opCreateVpnConnectionRoute = "CreateVpnConnectionRoute" type CreateVpnConnectionRouteRequest struct { *aws.Request Input *CreateVpnConnectionRouteInput + Copy func(*CreateVpnConnectionRouteInput) CreateVpnConnectionRouteRequest } // Send marshals and sends the CreateVpnConnectionRoute API request. @@ -3959,7 +4026,7 @@ func (c *EC2) CreateVpnConnectionRouteRequest(input *CreateVpnConnectionRouteInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateVpnConnectionRouteRequest{Request: req, Input: input} + return CreateVpnConnectionRouteRequest{Request: req, Input: input, Copy: c.CreateVpnConnectionRouteRequest} } const opCreateVpnGateway = "CreateVpnGateway" @@ -3968,6 +4035,7 @@ const opCreateVpnGateway = "CreateVpnGateway" type CreateVpnGatewayRequest struct { *aws.Request Input *CreateVpnGatewayInput + Copy func(*CreateVpnGatewayInput) CreateVpnGatewayRequest } // Send marshals and sends the CreateVpnGateway API request. @@ -4014,7 +4082,7 @@ func (c *EC2) CreateVpnGatewayRequest(input *CreateVpnGatewayInput) CreateVpnGat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpnGatewayRequest{Request: req, Input: input} + return CreateVpnGatewayRequest{Request: req, Input: input, Copy: c.CreateVpnGatewayRequest} } const opDeleteCustomerGateway = "DeleteCustomerGateway" @@ -4023,6 +4091,7 @@ const opDeleteCustomerGateway = "DeleteCustomerGateway" type DeleteCustomerGatewayRequest struct { *aws.Request Input *DeleteCustomerGatewayInput + Copy func(*DeleteCustomerGatewayInput) DeleteCustomerGatewayRequest } // Send marshals and sends the DeleteCustomerGateway API request. @@ -4066,7 +4135,7 @@ func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCustomerGatewayRequest{Request: req, Input: input} + return DeleteCustomerGatewayRequest{Request: req, Input: input, Copy: c.DeleteCustomerGatewayRequest} } const opDeleteDhcpOptions = "DeleteDhcpOptions" @@ -4075,6 +4144,7 @@ const opDeleteDhcpOptions = "DeleteDhcpOptions" type DeleteDhcpOptionsRequest struct { *aws.Request Input *DeleteDhcpOptionsInput + Copy func(*DeleteDhcpOptionsInput) DeleteDhcpOptionsRequest } // Send marshals and sends the DeleteDhcpOptions API request. @@ -4120,7 +4190,7 @@ func (c *EC2) DeleteDhcpOptionsRequest(input *DeleteDhcpOptionsInput) DeleteDhcp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDhcpOptionsRequest{Request: req, Input: input} + return DeleteDhcpOptionsRequest{Request: req, Input: input, Copy: c.DeleteDhcpOptionsRequest} } const opDeleteEgressOnlyInternetGateway = "DeleteEgressOnlyInternetGateway" @@ -4129,6 +4199,7 @@ const opDeleteEgressOnlyInternetGateway = "DeleteEgressOnlyInternetGateway" type DeleteEgressOnlyInternetGatewayRequest struct { *aws.Request Input *DeleteEgressOnlyInternetGatewayInput + Copy func(*DeleteEgressOnlyInternetGatewayInput) DeleteEgressOnlyInternetGatewayRequest } // Send marshals and sends the DeleteEgressOnlyInternetGateway API request. @@ -4169,7 +4240,7 @@ func (c *EC2) DeleteEgressOnlyInternetGatewayRequest(input *DeleteEgressOnlyInte req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEgressOnlyInternetGatewayRequest{Request: req, Input: input} + return DeleteEgressOnlyInternetGatewayRequest{Request: req, Input: input, Copy: c.DeleteEgressOnlyInternetGatewayRequest} } const opDeleteFlowLogs = "DeleteFlowLogs" @@ -4178,6 +4249,7 @@ const opDeleteFlowLogs = "DeleteFlowLogs" type DeleteFlowLogsRequest struct { *aws.Request Input *DeleteFlowLogsInput + Copy func(*DeleteFlowLogsInput) DeleteFlowLogsRequest } // Send marshals and sends the DeleteFlowLogs API request. @@ -4218,7 +4290,7 @@ func (c *EC2) DeleteFlowLogsRequest(input *DeleteFlowLogsInput) DeleteFlowLogsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteFlowLogsRequest{Request: req, Input: input} + return DeleteFlowLogsRequest{Request: req, Input: input, Copy: c.DeleteFlowLogsRequest} } const opDeleteFpgaImage = "DeleteFpgaImage" @@ -4227,6 +4299,7 @@ const opDeleteFpgaImage = "DeleteFpgaImage" type DeleteFpgaImageRequest struct { *aws.Request Input *DeleteFpgaImageInput + Copy func(*DeleteFpgaImageInput) DeleteFpgaImageRequest } // Send marshals and sends the DeleteFpgaImage API request. @@ -4267,7 +4340,7 @@ func (c *EC2) DeleteFpgaImageRequest(input *DeleteFpgaImageInput) DeleteFpgaImag req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteFpgaImageRequest{Request: req, Input: input} + return DeleteFpgaImageRequest{Request: req, Input: input, Copy: c.DeleteFpgaImageRequest} } const opDeleteInternetGateway = "DeleteInternetGateway" @@ -4276,6 +4349,7 @@ const opDeleteInternetGateway = "DeleteInternetGateway" type DeleteInternetGatewayRequest struct { *aws.Request Input *DeleteInternetGatewayInput + Copy func(*DeleteInternetGatewayInput) DeleteInternetGatewayRequest } // Send marshals and sends the DeleteInternetGateway API request. @@ -4319,7 +4393,7 @@ func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteInternetGatewayRequest{Request: req, Input: input} + return DeleteInternetGatewayRequest{Request: req, Input: input, Copy: c.DeleteInternetGatewayRequest} } const opDeleteKeyPair = "DeleteKeyPair" @@ -4328,6 +4402,7 @@ const opDeleteKeyPair = "DeleteKeyPair" type DeleteKeyPairRequest struct { *aws.Request Input *DeleteKeyPairInput + Copy func(*DeleteKeyPairInput) DeleteKeyPairRequest } // Send marshals and sends the DeleteKeyPair API request. @@ -4370,7 +4445,7 @@ func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) DeleteKeyPairReque req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteKeyPairRequest{Request: req, Input: input} + return DeleteKeyPairRequest{Request: req, Input: input, Copy: c.DeleteKeyPairRequest} } const opDeleteLaunchTemplate = "DeleteLaunchTemplate" @@ -4379,6 +4454,7 @@ const opDeleteLaunchTemplate = "DeleteLaunchTemplate" type DeleteLaunchTemplateRequest struct { *aws.Request Input *DeleteLaunchTemplateInput + Copy func(*DeleteLaunchTemplateInput) DeleteLaunchTemplateRequest } // Send marshals and sends the DeleteLaunchTemplate API request. @@ -4420,7 +4496,7 @@ func (c *EC2) DeleteLaunchTemplateRequest(input *DeleteLaunchTemplateInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLaunchTemplateRequest{Request: req, Input: input} + return DeleteLaunchTemplateRequest{Request: req, Input: input, Copy: c.DeleteLaunchTemplateRequest} } const opDeleteLaunchTemplateVersions = "DeleteLaunchTemplateVersions" @@ -4429,6 +4505,7 @@ const opDeleteLaunchTemplateVersions = "DeleteLaunchTemplateVersions" type DeleteLaunchTemplateVersionsRequest struct { *aws.Request Input *DeleteLaunchTemplateVersionsInput + Copy func(*DeleteLaunchTemplateVersionsInput) DeleteLaunchTemplateVersionsRequest } // Send marshals and sends the DeleteLaunchTemplateVersions API request. @@ -4472,7 +4549,7 @@ func (c *EC2) DeleteLaunchTemplateVersionsRequest(input *DeleteLaunchTemplateVer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLaunchTemplateVersionsRequest{Request: req, Input: input} + return DeleteLaunchTemplateVersionsRequest{Request: req, Input: input, Copy: c.DeleteLaunchTemplateVersionsRequest} } const opDeleteNatGateway = "DeleteNatGateway" @@ -4481,6 +4558,7 @@ const opDeleteNatGateway = "DeleteNatGateway" type DeleteNatGatewayRequest struct { *aws.Request Input *DeleteNatGatewayInput + Copy func(*DeleteNatGatewayInput) DeleteNatGatewayRequest } // Send marshals and sends the DeleteNatGateway API request. @@ -4523,7 +4601,7 @@ func (c *EC2) DeleteNatGatewayRequest(input *DeleteNatGatewayInput) DeleteNatGat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteNatGatewayRequest{Request: req, Input: input} + return DeleteNatGatewayRequest{Request: req, Input: input, Copy: c.DeleteNatGatewayRequest} } const opDeleteNetworkAcl = "DeleteNetworkAcl" @@ -4532,6 +4610,7 @@ const opDeleteNetworkAcl = "DeleteNetworkAcl" type DeleteNetworkAclRequest struct { *aws.Request Input *DeleteNetworkAclInput + Copy func(*DeleteNetworkAclInput) DeleteNetworkAclRequest } // Send marshals and sends the DeleteNetworkAcl API request. @@ -4575,7 +4654,7 @@ func (c *EC2) DeleteNetworkAclRequest(input *DeleteNetworkAclInput) DeleteNetwor req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteNetworkAclRequest{Request: req, Input: input} + return DeleteNetworkAclRequest{Request: req, Input: input, Copy: c.DeleteNetworkAclRequest} } const opDeleteNetworkAclEntry = "DeleteNetworkAclEntry" @@ -4584,6 +4663,7 @@ const opDeleteNetworkAclEntry = "DeleteNetworkAclEntry" type DeleteNetworkAclEntryRequest struct { *aws.Request Input *DeleteNetworkAclEntryInput + Copy func(*DeleteNetworkAclEntryInput) DeleteNetworkAclEntryRequest } // Send marshals and sends the DeleteNetworkAclEntry API request. @@ -4627,7 +4707,7 @@ func (c *EC2) DeleteNetworkAclEntryRequest(input *DeleteNetworkAclEntryInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteNetworkAclEntryRequest{Request: req, Input: input} + return DeleteNetworkAclEntryRequest{Request: req, Input: input, Copy: c.DeleteNetworkAclEntryRequest} } const opDeleteNetworkInterface = "DeleteNetworkInterface" @@ -4636,6 +4716,7 @@ const opDeleteNetworkInterface = "DeleteNetworkInterface" type DeleteNetworkInterfaceRequest struct { *aws.Request Input *DeleteNetworkInterfaceInput + Copy func(*DeleteNetworkInterfaceInput) DeleteNetworkInterfaceRequest } // Send marshals and sends the DeleteNetworkInterface API request. @@ -4679,7 +4760,7 @@ func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteNetworkInterfaceRequest{Request: req, Input: input} + return DeleteNetworkInterfaceRequest{Request: req, Input: input, Copy: c.DeleteNetworkInterfaceRequest} } const opDeleteNetworkInterfacePermission = "DeleteNetworkInterfacePermission" @@ -4688,6 +4769,7 @@ const opDeleteNetworkInterfacePermission = "DeleteNetworkInterfacePermission" type DeleteNetworkInterfacePermissionRequest struct { *aws.Request Input *DeleteNetworkInterfacePermissionInput + Copy func(*DeleteNetworkInterfacePermissionInput) DeleteNetworkInterfacePermissionRequest } // Send marshals and sends the DeleteNetworkInterfacePermission API request. @@ -4731,7 +4813,7 @@ func (c *EC2) DeleteNetworkInterfacePermissionRequest(input *DeleteNetworkInterf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteNetworkInterfacePermissionRequest{Request: req, Input: input} + return DeleteNetworkInterfacePermissionRequest{Request: req, Input: input, Copy: c.DeleteNetworkInterfacePermissionRequest} } const opDeletePlacementGroup = "DeletePlacementGroup" @@ -4740,6 +4822,7 @@ const opDeletePlacementGroup = "DeletePlacementGroup" type DeletePlacementGroupRequest struct { *aws.Request Input *DeletePlacementGroupInput + Copy func(*DeletePlacementGroupInput) DeletePlacementGroupRequest } // Send marshals and sends the DeletePlacementGroup API request. @@ -4785,7 +4868,7 @@ func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) Dele req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePlacementGroupRequest{Request: req, Input: input} + return DeletePlacementGroupRequest{Request: req, Input: input, Copy: c.DeletePlacementGroupRequest} } const opDeleteRoute = "DeleteRoute" @@ -4794,6 +4877,7 @@ const opDeleteRoute = "DeleteRoute" type DeleteRouteRequest struct { *aws.Request Input *DeleteRouteInput + Copy func(*DeleteRouteInput) DeleteRouteRequest } // Send marshals and sends the DeleteRoute API request. @@ -4836,7 +4920,7 @@ func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) DeleteRouteRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteRouteRequest{Request: req, Input: input} + return DeleteRouteRequest{Request: req, Input: input, Copy: c.DeleteRouteRequest} } const opDeleteRouteTable = "DeleteRouteTable" @@ -4845,6 +4929,7 @@ const opDeleteRouteTable = "DeleteRouteTable" type DeleteRouteTableRequest struct { *aws.Request Input *DeleteRouteTableInput + Copy func(*DeleteRouteTableInput) DeleteRouteTableRequest } // Send marshals and sends the DeleteRouteTable API request. @@ -4889,7 +4974,7 @@ func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) DeleteRouteT req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteRouteTableRequest{Request: req, Input: input} + return DeleteRouteTableRequest{Request: req, Input: input, Copy: c.DeleteRouteTableRequest} } const opDeleteSecurityGroup = "DeleteSecurityGroup" @@ -4898,6 +4983,7 @@ const opDeleteSecurityGroup = "DeleteSecurityGroup" type DeleteSecurityGroupRequest struct { *aws.Request Input *DeleteSecurityGroupInput + Copy func(*DeleteSecurityGroupInput) DeleteSecurityGroupRequest } // Send marshals and sends the DeleteSecurityGroup API request. @@ -4944,7 +5030,7 @@ func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) Delete req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSecurityGroupRequest{Request: req, Input: input} + return DeleteSecurityGroupRequest{Request: req, Input: input, Copy: c.DeleteSecurityGroupRequest} } const opDeleteSnapshot = "DeleteSnapshot" @@ -4953,6 +5039,7 @@ const opDeleteSnapshot = "DeleteSnapshot" type DeleteSnapshotRequest struct { *aws.Request Input *DeleteSnapshotInput + Copy func(*DeleteSnapshotInput) DeleteSnapshotRequest } // Send marshals and sends the DeleteSnapshot API request. @@ -5009,7 +5096,7 @@ func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) DeleteSnapshotRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSnapshotRequest{Request: req, Input: input} + return DeleteSnapshotRequest{Request: req, Input: input, Copy: c.DeleteSnapshotRequest} } const opDeleteSpotDatafeedSubscription = "DeleteSpotDatafeedSubscription" @@ -5018,6 +5105,7 @@ const opDeleteSpotDatafeedSubscription = "DeleteSpotDatafeedSubscription" type DeleteSpotDatafeedSubscriptionRequest struct { *aws.Request Input *DeleteSpotDatafeedSubscriptionInput + Copy func(*DeleteSpotDatafeedSubscriptionInput) DeleteSpotDatafeedSubscriptionRequest } // Send marshals and sends the DeleteSpotDatafeedSubscription API request. @@ -5060,7 +5148,7 @@ func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSub req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSpotDatafeedSubscriptionRequest{Request: req, Input: input} + return DeleteSpotDatafeedSubscriptionRequest{Request: req, Input: input, Copy: c.DeleteSpotDatafeedSubscriptionRequest} } const opDeleteSubnet = "DeleteSubnet" @@ -5069,6 +5157,7 @@ const opDeleteSubnet = "DeleteSubnet" type DeleteSubnetRequest struct { *aws.Request Input *DeleteSubnetInput + Copy func(*DeleteSubnetInput) DeleteSubnetRequest } // Send marshals and sends the DeleteSubnet API request. @@ -5112,7 +5201,7 @@ func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) DeleteSubnetRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSubnetRequest{Request: req, Input: input} + return DeleteSubnetRequest{Request: req, Input: input, Copy: c.DeleteSubnetRequest} } const opDeleteTags = "DeleteTags" @@ -5121,6 +5210,7 @@ const opDeleteTags = "DeleteTags" type DeleteTagsRequest struct { *aws.Request Input *DeleteTagsInput + Copy func(*DeleteTagsInput) DeleteTagsRequest } // Send marshals and sends the DeleteTags API request. @@ -5167,7 +5257,7 @@ func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) DeleteTagsRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteTagsRequest{Request: req, Input: input} + return DeleteTagsRequest{Request: req, Input: input, Copy: c.DeleteTagsRequest} } const opDeleteVolume = "DeleteVolume" @@ -5176,6 +5266,7 @@ const opDeleteVolume = "DeleteVolume" type DeleteVolumeRequest struct { *aws.Request Input *DeleteVolumeInput + Copy func(*DeleteVolumeInput) DeleteVolumeRequest } // Send marshals and sends the DeleteVolume API request. @@ -5224,7 +5315,7 @@ func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) DeleteVolumeRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVolumeRequest{Request: req, Input: input} + return DeleteVolumeRequest{Request: req, Input: input, Copy: c.DeleteVolumeRequest} } const opDeleteVpc = "DeleteVpc" @@ -5233,6 +5324,7 @@ const opDeleteVpc = "DeleteVpc" type DeleteVpcRequest struct { *aws.Request Input *DeleteVpcInput + Copy func(*DeleteVpcInput) DeleteVpcRequest } // Send marshals and sends the DeleteVpc API request. @@ -5279,7 +5371,7 @@ func (c *EC2) DeleteVpcRequest(input *DeleteVpcInput) DeleteVpcRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVpcRequest{Request: req, Input: input} + return DeleteVpcRequest{Request: req, Input: input, Copy: c.DeleteVpcRequest} } const opDeleteVpcEndpointConnectionNotifications = "DeleteVpcEndpointConnectionNotifications" @@ -5288,6 +5380,7 @@ const opDeleteVpcEndpointConnectionNotifications = "DeleteVpcEndpointConnectionN type DeleteVpcEndpointConnectionNotificationsRequest struct { *aws.Request Input *DeleteVpcEndpointConnectionNotificationsInput + Copy func(*DeleteVpcEndpointConnectionNotificationsInput) DeleteVpcEndpointConnectionNotificationsRequest } // Send marshals and sends the DeleteVpcEndpointConnectionNotifications API request. @@ -5328,7 +5421,7 @@ func (c *EC2) DeleteVpcEndpointConnectionNotificationsRequest(input *DeleteVpcEn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteVpcEndpointConnectionNotificationsRequest{Request: req, Input: input} + return DeleteVpcEndpointConnectionNotificationsRequest{Request: req, Input: input, Copy: c.DeleteVpcEndpointConnectionNotificationsRequest} } const opDeleteVpcEndpointServiceConfigurations = "DeleteVpcEndpointServiceConfigurations" @@ -5337,6 +5430,7 @@ const opDeleteVpcEndpointServiceConfigurations = "DeleteVpcEndpointServiceConfig type DeleteVpcEndpointServiceConfigurationsRequest struct { *aws.Request Input *DeleteVpcEndpointServiceConfigurationsInput + Copy func(*DeleteVpcEndpointServiceConfigurationsInput) DeleteVpcEndpointServiceConfigurationsRequest } // Send marshals and sends the DeleteVpcEndpointServiceConfigurations API request. @@ -5380,7 +5474,7 @@ func (c *EC2) DeleteVpcEndpointServiceConfigurationsRequest(input *DeleteVpcEndp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteVpcEndpointServiceConfigurationsRequest{Request: req, Input: input} + return DeleteVpcEndpointServiceConfigurationsRequest{Request: req, Input: input, Copy: c.DeleteVpcEndpointServiceConfigurationsRequest} } const opDeleteVpcEndpoints = "DeleteVpcEndpoints" @@ -5389,6 +5483,7 @@ const opDeleteVpcEndpoints = "DeleteVpcEndpoints" type DeleteVpcEndpointsRequest struct { *aws.Request Input *DeleteVpcEndpointsInput + Copy func(*DeleteVpcEndpointsInput) DeleteVpcEndpointsRequest } // Send marshals and sends the DeleteVpcEndpoints API request. @@ -5432,7 +5527,7 @@ func (c *EC2) DeleteVpcEndpointsRequest(input *DeleteVpcEndpointsInput) DeleteVp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteVpcEndpointsRequest{Request: req, Input: input} + return DeleteVpcEndpointsRequest{Request: req, Input: input, Copy: c.DeleteVpcEndpointsRequest} } const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection" @@ -5441,6 +5536,7 @@ const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection" type DeleteVpcPeeringConnectionRequest struct { *aws.Request Input *DeleteVpcPeeringConnectionInput + Copy func(*DeleteVpcPeeringConnectionInput) DeleteVpcPeeringConnectionRequest } // Send marshals and sends the DeleteVpcPeeringConnection API request. @@ -5484,7 +5580,7 @@ func (c *EC2) DeleteVpcPeeringConnectionRequest(input *DeleteVpcPeeringConnectio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteVpcPeeringConnectionRequest{Request: req, Input: input} + return DeleteVpcPeeringConnectionRequest{Request: req, Input: input, Copy: c.DeleteVpcPeeringConnectionRequest} } const opDeleteVpnConnection = "DeleteVpnConnection" @@ -5493,6 +5589,7 @@ const opDeleteVpnConnection = "DeleteVpnConnection" type DeleteVpnConnectionRequest struct { *aws.Request Input *DeleteVpnConnectionInput + Copy func(*DeleteVpnConnectionInput) DeleteVpnConnectionRequest } // Send marshals and sends the DeleteVpnConnection API request. @@ -5544,7 +5641,7 @@ func (c *EC2) DeleteVpnConnectionRequest(input *DeleteVpnConnectionInput) Delete req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVpnConnectionRequest{Request: req, Input: input} + return DeleteVpnConnectionRequest{Request: req, Input: input, Copy: c.DeleteVpnConnectionRequest} } const opDeleteVpnConnectionRoute = "DeleteVpnConnectionRoute" @@ -5553,6 +5650,7 @@ const opDeleteVpnConnectionRoute = "DeleteVpnConnectionRoute" type DeleteVpnConnectionRouteRequest struct { *aws.Request Input *DeleteVpnConnectionRouteInput + Copy func(*DeleteVpnConnectionRouteInput) DeleteVpnConnectionRouteRequest } // Send marshals and sends the DeleteVpnConnectionRoute API request. @@ -5598,7 +5696,7 @@ func (c *EC2) DeleteVpnConnectionRouteRequest(input *DeleteVpnConnectionRouteInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVpnConnectionRouteRequest{Request: req, Input: input} + return DeleteVpnConnectionRouteRequest{Request: req, Input: input, Copy: c.DeleteVpnConnectionRouteRequest} } const opDeleteVpnGateway = "DeleteVpnGateway" @@ -5607,6 +5705,7 @@ const opDeleteVpnGateway = "DeleteVpnGateway" type DeleteVpnGatewayRequest struct { *aws.Request Input *DeleteVpnGatewayInput + Copy func(*DeleteVpnGatewayInput) DeleteVpnGatewayRequest } // Send marshals and sends the DeleteVpnGateway API request. @@ -5653,7 +5752,7 @@ func (c *EC2) DeleteVpnGatewayRequest(input *DeleteVpnGatewayInput) DeleteVpnGat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVpnGatewayRequest{Request: req, Input: input} + return DeleteVpnGatewayRequest{Request: req, Input: input, Copy: c.DeleteVpnGatewayRequest} } const opDeregisterImage = "DeregisterImage" @@ -5662,6 +5761,7 @@ const opDeregisterImage = "DeregisterImage" type DeregisterImageRequest struct { *aws.Request Input *DeregisterImageInput + Copy func(*DeregisterImageInput) DeregisterImageRequest } // Send marshals and sends the DeregisterImage API request. @@ -5712,7 +5812,7 @@ func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) DeregisterImag req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeregisterImageRequest{Request: req, Input: input} + return DeregisterImageRequest{Request: req, Input: input, Copy: c.DeregisterImageRequest} } const opDescribeAccountAttributes = "DescribeAccountAttributes" @@ -5721,6 +5821,7 @@ const opDescribeAccountAttributes = "DescribeAccountAttributes" type DescribeAccountAttributesRequest struct { *aws.Request Input *DescribeAccountAttributesInput + Copy func(*DescribeAccountAttributesInput) DescribeAccountAttributesRequest } // Send marshals and sends the DescribeAccountAttributes API request. @@ -5779,7 +5880,7 @@ func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAccountAttributesRequest{Request: req, Input: input} + return DescribeAccountAttributesRequest{Request: req, Input: input, Copy: c.DescribeAccountAttributesRequest} } const opDescribeAddresses = "DescribeAddresses" @@ -5788,6 +5889,7 @@ const opDescribeAddresses = "DescribeAddresses" type DescribeAddressesRequest struct { *aws.Request Input *DescribeAddressesInput + Copy func(*DescribeAddressesInput) DescribeAddressesRequest } // Send marshals and sends the DescribeAddresses API request. @@ -5832,7 +5934,7 @@ func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) DescribeAd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAddressesRequest{Request: req, Input: input} + return DescribeAddressesRequest{Request: req, Input: input, Copy: c.DescribeAddressesRequest} } const opDescribeAvailabilityZones = "DescribeAvailabilityZones" @@ -5841,6 +5943,7 @@ const opDescribeAvailabilityZones = "DescribeAvailabilityZones" type DescribeAvailabilityZonesRequest struct { *aws.Request Input *DescribeAvailabilityZonesInput + Copy func(*DescribeAvailabilityZonesInput) DescribeAvailabilityZonesRequest } // Send marshals and sends the DescribeAvailabilityZones API request. @@ -5887,7 +5990,7 @@ func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAvailabilityZonesRequest{Request: req, Input: input} + return DescribeAvailabilityZonesRequest{Request: req, Input: input, Copy: c.DescribeAvailabilityZonesRequest} } const opDescribeBundleTasks = "DescribeBundleTasks" @@ -5896,6 +5999,7 @@ const opDescribeBundleTasks = "DescribeBundleTasks" type DescribeBundleTasksRequest struct { *aws.Request Input *DescribeBundleTasksInput + Copy func(*DescribeBundleTasksInput) DescribeBundleTasksRequest } // Send marshals and sends the DescribeBundleTasks API request. @@ -5941,7 +6045,7 @@ func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBundleTasksRequest{Request: req, Input: input} + return DescribeBundleTasksRequest{Request: req, Input: input, Copy: c.DescribeBundleTasksRequest} } const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" @@ -5950,6 +6054,7 @@ const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" type DescribeClassicLinkInstancesRequest struct { *aws.Request Input *DescribeClassicLinkInstancesInput + Copy func(*DescribeClassicLinkInstancesInput) DescribeClassicLinkInstancesRequest } // Send marshals and sends the DescribeClassicLinkInstances API request. @@ -5993,7 +6098,7 @@ func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClassicLinkInstancesRequest{Request: req, Input: input} + return DescribeClassicLinkInstancesRequest{Request: req, Input: input, Copy: c.DescribeClassicLinkInstancesRequest} } const opDescribeConversionTasks = "DescribeConversionTasks" @@ -6002,6 +6107,7 @@ const opDescribeConversionTasks = "DescribeConversionTasks" type DescribeConversionTasksRequest struct { *aws.Request Input *DescribeConversionTasksInput + Copy func(*DescribeConversionTasksInput) DescribeConversionTasksRequest } // Send marshals and sends the DescribeConversionTasks API request. @@ -6046,7 +6152,7 @@ func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConversionTasksRequest{Request: req, Input: input} + return DescribeConversionTasksRequest{Request: req, Input: input, Copy: c.DescribeConversionTasksRequest} } const opDescribeCustomerGateways = "DescribeCustomerGateways" @@ -6055,6 +6161,7 @@ const opDescribeCustomerGateways = "DescribeCustomerGateways" type DescribeCustomerGatewaysRequest struct { *aws.Request Input *DescribeCustomerGatewaysInput + Copy func(*DescribeCustomerGatewaysInput) DescribeCustomerGatewaysRequest } // Send marshals and sends the DescribeCustomerGateways API request. @@ -6099,7 +6206,7 @@ func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCustomerGatewaysRequest{Request: req, Input: input} + return DescribeCustomerGatewaysRequest{Request: req, Input: input, Copy: c.DescribeCustomerGatewaysRequest} } const opDescribeDhcpOptions = "DescribeDhcpOptions" @@ -6108,6 +6215,7 @@ const opDescribeDhcpOptions = "DescribeDhcpOptions" type DescribeDhcpOptionsRequest struct { *aws.Request Input *DescribeDhcpOptionsInput + Copy func(*DescribeDhcpOptionsInput) DescribeDhcpOptionsRequest } // Send marshals and sends the DescribeDhcpOptions API request. @@ -6151,7 +6259,7 @@ func (c *EC2) DescribeDhcpOptionsRequest(input *DescribeDhcpOptionsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDhcpOptionsRequest{Request: req, Input: input} + return DescribeDhcpOptionsRequest{Request: req, Input: input, Copy: c.DescribeDhcpOptionsRequest} } const opDescribeEgressOnlyInternetGateways = "DescribeEgressOnlyInternetGateways" @@ -6160,6 +6268,7 @@ const opDescribeEgressOnlyInternetGateways = "DescribeEgressOnlyInternetGateways type DescribeEgressOnlyInternetGatewaysRequest struct { *aws.Request Input *DescribeEgressOnlyInternetGatewaysInput + Copy func(*DescribeEgressOnlyInternetGatewaysInput) DescribeEgressOnlyInternetGatewaysRequest } // Send marshals and sends the DescribeEgressOnlyInternetGateways API request. @@ -6200,7 +6309,7 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysRequest(input *DescribeEgressOnl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEgressOnlyInternetGatewaysRequest{Request: req, Input: input} + return DescribeEgressOnlyInternetGatewaysRequest{Request: req, Input: input, Copy: c.DescribeEgressOnlyInternetGatewaysRequest} } const opDescribeElasticGpus = "DescribeElasticGpus" @@ -6209,6 +6318,7 @@ const opDescribeElasticGpus = "DescribeElasticGpus" type DescribeElasticGpusRequest struct { *aws.Request Input *DescribeElasticGpusInput + Copy func(*DescribeElasticGpusInput) DescribeElasticGpusRequest } // Send marshals and sends the DescribeElasticGpus API request. @@ -6250,7 +6360,7 @@ func (c *EC2) DescribeElasticGpusRequest(input *DescribeElasticGpusInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeElasticGpusRequest{Request: req, Input: input} + return DescribeElasticGpusRequest{Request: req, Input: input, Copy: c.DescribeElasticGpusRequest} } const opDescribeExportTasks = "DescribeExportTasks" @@ -6259,6 +6369,7 @@ const opDescribeExportTasks = "DescribeExportTasks" type DescribeExportTasksRequest struct { *aws.Request Input *DescribeExportTasksInput + Copy func(*DescribeExportTasksInput) DescribeExportTasksRequest } // Send marshals and sends the DescribeExportTasks API request. @@ -6299,7 +6410,7 @@ func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeExportTasksRequest{Request: req, Input: input} + return DescribeExportTasksRequest{Request: req, Input: input, Copy: c.DescribeExportTasksRequest} } const opDescribeFlowLogs = "DescribeFlowLogs" @@ -6308,6 +6419,7 @@ const opDescribeFlowLogs = "DescribeFlowLogs" type DescribeFlowLogsRequest struct { *aws.Request Input *DescribeFlowLogsInput + Copy func(*DescribeFlowLogsInput) DescribeFlowLogsRequest } // Send marshals and sends the DescribeFlowLogs API request. @@ -6350,7 +6462,7 @@ func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) DescribeFlow req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFlowLogsRequest{Request: req, Input: input} + return DescribeFlowLogsRequest{Request: req, Input: input, Copy: c.DescribeFlowLogsRequest} } const opDescribeFpgaImageAttribute = "DescribeFpgaImageAttribute" @@ -6359,6 +6471,7 @@ const opDescribeFpgaImageAttribute = "DescribeFpgaImageAttribute" type DescribeFpgaImageAttributeRequest struct { *aws.Request Input *DescribeFpgaImageAttributeInput + Copy func(*DescribeFpgaImageAttributeInput) DescribeFpgaImageAttributeRequest } // Send marshals and sends the DescribeFpgaImageAttribute API request. @@ -6399,7 +6512,7 @@ func (c *EC2) DescribeFpgaImageAttributeRequest(input *DescribeFpgaImageAttribut req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFpgaImageAttributeRequest{Request: req, Input: input} + return DescribeFpgaImageAttributeRequest{Request: req, Input: input, Copy: c.DescribeFpgaImageAttributeRequest} } const opDescribeFpgaImages = "DescribeFpgaImages" @@ -6408,6 +6521,7 @@ const opDescribeFpgaImages = "DescribeFpgaImages" type DescribeFpgaImagesRequest struct { *aws.Request Input *DescribeFpgaImagesInput + Copy func(*DescribeFpgaImagesInput) DescribeFpgaImagesRequest } // Send marshals and sends the DescribeFpgaImages API request. @@ -6450,7 +6564,7 @@ func (c *EC2) DescribeFpgaImagesRequest(input *DescribeFpgaImagesInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFpgaImagesRequest{Request: req, Input: input} + return DescribeFpgaImagesRequest{Request: req, Input: input, Copy: c.DescribeFpgaImagesRequest} } const opDescribeHostReservationOfferings = "DescribeHostReservationOfferings" @@ -6459,6 +6573,7 @@ const opDescribeHostReservationOfferings = "DescribeHostReservationOfferings" type DescribeHostReservationOfferingsRequest struct { *aws.Request Input *DescribeHostReservationOfferingsInput + Copy func(*DescribeHostReservationOfferingsInput) DescribeHostReservationOfferingsRequest } // Send marshals and sends the DescribeHostReservationOfferings API request. @@ -6507,7 +6622,7 @@ func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReserva req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeHostReservationOfferingsRequest{Request: req, Input: input} + return DescribeHostReservationOfferingsRequest{Request: req, Input: input, Copy: c.DescribeHostReservationOfferingsRequest} } const opDescribeHostReservations = "DescribeHostReservations" @@ -6516,6 +6631,7 @@ const opDescribeHostReservations = "DescribeHostReservations" type DescribeHostReservationsRequest struct { *aws.Request Input *DescribeHostReservationsInput + Copy func(*DescribeHostReservationsInput) DescribeHostReservationsRequest } // Send marshals and sends the DescribeHostReservations API request. @@ -6557,7 +6673,7 @@ func (c *EC2) DescribeHostReservationsRequest(input *DescribeHostReservationsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeHostReservationsRequest{Request: req, Input: input} + return DescribeHostReservationsRequest{Request: req, Input: input, Copy: c.DescribeHostReservationsRequest} } const opDescribeHosts = "DescribeHosts" @@ -6566,6 +6682,7 @@ const opDescribeHosts = "DescribeHosts" type DescribeHostsRequest struct { *aws.Request Input *DescribeHostsInput + Copy func(*DescribeHostsInput) DescribeHostsRequest } // Send marshals and sends the DescribeHosts API request. @@ -6610,7 +6727,7 @@ func (c *EC2) DescribeHostsRequest(input *DescribeHostsInput) DescribeHostsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeHostsRequest{Request: req, Input: input} + return DescribeHostsRequest{Request: req, Input: input, Copy: c.DescribeHostsRequest} } const opDescribeIamInstanceProfileAssociations = "DescribeIamInstanceProfileAssociations" @@ -6619,6 +6736,7 @@ const opDescribeIamInstanceProfileAssociations = "DescribeIamInstanceProfileAsso type DescribeIamInstanceProfileAssociationsRequest struct { *aws.Request Input *DescribeIamInstanceProfileAssociationsInput + Copy func(*DescribeIamInstanceProfileAssociationsInput) DescribeIamInstanceProfileAssociationsRequest } // Send marshals and sends the DescribeIamInstanceProfileAssociations API request. @@ -6659,7 +6777,7 @@ func (c *EC2) DescribeIamInstanceProfileAssociationsRequest(input *DescribeIamIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIamInstanceProfileAssociationsRequest{Request: req, Input: input} + return DescribeIamInstanceProfileAssociationsRequest{Request: req, Input: input, Copy: c.DescribeIamInstanceProfileAssociationsRequest} } const opDescribeIdFormat = "DescribeIdFormat" @@ -6668,6 +6786,7 @@ const opDescribeIdFormat = "DescribeIdFormat" type DescribeIdFormatRequest struct { *aws.Request Input *DescribeIdFormatInput + Copy func(*DescribeIdFormatInput) DescribeIdFormatRequest } // Send marshals and sends the DescribeIdFormat API request. @@ -6721,7 +6840,7 @@ func (c *EC2) DescribeIdFormatRequest(input *DescribeIdFormatInput) DescribeIdFo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIdFormatRequest{Request: req, Input: input} + return DescribeIdFormatRequest{Request: req, Input: input, Copy: c.DescribeIdFormatRequest} } const opDescribeIdentityIdFormat = "DescribeIdentityIdFormat" @@ -6730,6 +6849,7 @@ const opDescribeIdentityIdFormat = "DescribeIdentityIdFormat" type DescribeIdentityIdFormatRequest struct { *aws.Request Input *DescribeIdentityIdFormatInput + Copy func(*DescribeIdentityIdFormatInput) DescribeIdentityIdFormatRequest } // Send marshals and sends the DescribeIdentityIdFormat API request. @@ -6781,7 +6901,7 @@ func (c *EC2) DescribeIdentityIdFormatRequest(input *DescribeIdentityIdFormatInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIdentityIdFormatRequest{Request: req, Input: input} + return DescribeIdentityIdFormatRequest{Request: req, Input: input, Copy: c.DescribeIdentityIdFormatRequest} } const opDescribeImageAttribute = "DescribeImageAttribute" @@ -6790,6 +6910,7 @@ const opDescribeImageAttribute = "DescribeImageAttribute" type DescribeImageAttributeRequest struct { *aws.Request Input *DescribeImageAttributeInput + Copy func(*DescribeImageAttributeInput) DescribeImageAttributeRequest } // Send marshals and sends the DescribeImageAttribute API request. @@ -6831,7 +6952,7 @@ func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeImageAttributeRequest{Request: req, Input: input} + return DescribeImageAttributeRequest{Request: req, Input: input, Copy: c.DescribeImageAttributeRequest} } const opDescribeImages = "DescribeImages" @@ -6840,6 +6961,7 @@ const opDescribeImages = "DescribeImages" type DescribeImagesRequest struct { *aws.Request Input *DescribeImagesInput + Copy func(*DescribeImagesInput) DescribeImagesRequest } // Send marshals and sends the DescribeImages API request. @@ -6886,7 +7008,7 @@ func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) DescribeImagesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeImagesRequest{Request: req, Input: input} + return DescribeImagesRequest{Request: req, Input: input, Copy: c.DescribeImagesRequest} } const opDescribeImportImageTasks = "DescribeImportImageTasks" @@ -6895,6 +7017,7 @@ const opDescribeImportImageTasks = "DescribeImportImageTasks" type DescribeImportImageTasksRequest struct { *aws.Request Input *DescribeImportImageTasksInput + Copy func(*DescribeImportImageTasksInput) DescribeImportImageTasksRequest } // Send marshals and sends the DescribeImportImageTasks API request. @@ -6936,7 +7059,7 @@ func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeImportImageTasksRequest{Request: req, Input: input} + return DescribeImportImageTasksRequest{Request: req, Input: input, Copy: c.DescribeImportImageTasksRequest} } const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks" @@ -6945,6 +7068,7 @@ const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks" type DescribeImportSnapshotTasksRequest struct { *aws.Request Input *DescribeImportSnapshotTasksInput + Copy func(*DescribeImportSnapshotTasksInput) DescribeImportSnapshotTasksRequest } // Send marshals and sends the DescribeImportSnapshotTasks API request. @@ -6985,7 +7109,7 @@ func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeImportSnapshotTasksRequest{Request: req, Input: input} + return DescribeImportSnapshotTasksRequest{Request: req, Input: input, Copy: c.DescribeImportSnapshotTasksRequest} } const opDescribeInstanceAttribute = "DescribeInstanceAttribute" @@ -6994,6 +7118,7 @@ const opDescribeInstanceAttribute = "DescribeInstanceAttribute" type DescribeInstanceAttributeRequest struct { *aws.Request Input *DescribeInstanceAttributeInput + Copy func(*DescribeInstanceAttributeInput) DescribeInstanceAttributeRequest } // Send marshals and sends the DescribeInstanceAttribute API request. @@ -7038,7 +7163,7 @@ func (c *EC2) DescribeInstanceAttributeRequest(input *DescribeInstanceAttributeI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstanceAttributeRequest{Request: req, Input: input} + return DescribeInstanceAttributeRequest{Request: req, Input: input, Copy: c.DescribeInstanceAttributeRequest} } const opDescribeInstanceCreditSpecifications = "DescribeInstanceCreditSpecifications" @@ -7047,6 +7172,7 @@ const opDescribeInstanceCreditSpecifications = "DescribeInstanceCreditSpecificat type DescribeInstanceCreditSpecificationsRequest struct { *aws.Request Input *DescribeInstanceCreditSpecificationsInput + Copy func(*DescribeInstanceCreditSpecificationsInput) DescribeInstanceCreditSpecificationsRequest } // Send marshals and sends the DescribeInstanceCreditSpecifications API request. @@ -7105,7 +7231,7 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstanceCreditSpecificationsRequest{Request: req, Input: input} + return DescribeInstanceCreditSpecificationsRequest{Request: req, Input: input, Copy: c.DescribeInstanceCreditSpecificationsRequest} } const opDescribeInstanceStatus = "DescribeInstanceStatus" @@ -7114,6 +7240,7 @@ const opDescribeInstanceStatus = "DescribeInstanceStatus" type DescribeInstanceStatusRequest struct { *aws.Request Input *DescribeInstanceStatusInput + Copy func(*DescribeInstanceStatusInput) DescribeInstanceStatusRequest } // Send marshals and sends the DescribeInstanceStatus API request. @@ -7181,57 +7308,53 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstanceStatusRequest{Request: req, Input: input} + return DescribeInstanceStatusRequest{Request: req, Input: input, Copy: c.DescribeInstanceStatusRequest} } -// DescribeInstanceStatusPages iterates over the pages of a DescribeInstanceStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeInstanceStatus method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeInstanceStatusRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeInstanceStatus operation. -// pageNum := 0 -// err := client.DescribeInstanceStatusPages(params, -// func(page *DescribeInstanceStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeInstanceStatusPages(input *DescribeInstanceStatusInput, fn func(*DescribeInstanceStatusOutput, bool) bool) error { - return c.DescribeInstanceStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeInstanceStatusPagesWithContext same as DescribeInstanceStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeInstanceStatusPagesWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, fn func(*DescribeInstanceStatusOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeInstanceStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeInstanceStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeInstanceStatusRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeInstanceStatusRequest) Paginate(opts ...aws.Option) DescribeInstanceStatusPager { + return DescribeInstanceStatusPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeInstanceStatusInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstanceStatusOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeInstanceStatusPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeInstanceStatusPager struct { + aws.Pager +} + +func (p *DescribeInstanceStatusPager) CurrentPage() *DescribeInstanceStatusOutput { + return p.Pager.CurrentPage().(*DescribeInstanceStatusOutput) } const opDescribeInstances = "DescribeInstances" @@ -7240,6 +7363,7 @@ const opDescribeInstances = "DescribeInstances" type DescribeInstancesRequest struct { *aws.Request Input *DescribeInstancesInput + Copy func(*DescribeInstancesInput) DescribeInstancesRequest } // Send marshals and sends the DescribeInstances API request. @@ -7301,57 +7425,53 @@ func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) DescribeIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstancesRequest{Request: req, Input: input} + return DescribeInstancesRequest{Request: req, Input: input, Copy: c.DescribeInstancesRequest} } -// DescribeInstancesPages iterates over the pages of a DescribeInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeInstances operation. -// pageNum := 0 -// err := client.DescribeInstancesPages(params, -// func(page *DescribeInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeInstancesPages(input *DescribeInstancesInput, fn func(*DescribeInstancesOutput, bool) bool) error { - return c.DescribeInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeInstancesPagesWithContext same as DescribeInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeInstancesPagesWithContext(ctx aws.Context, input *DescribeInstancesInput, fn func(*DescribeInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeInstancesRequest) Paginate(opts ...aws.Option) DescribeInstancesPager { + return DescribeInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeInstancesPager struct { + aws.Pager +} + +func (p *DescribeInstancesPager) CurrentPage() *DescribeInstancesOutput { + return p.Pager.CurrentPage().(*DescribeInstancesOutput) } const opDescribeInternetGateways = "DescribeInternetGateways" @@ -7360,6 +7480,7 @@ const opDescribeInternetGateways = "DescribeInternetGateways" type DescribeInternetGatewaysRequest struct { *aws.Request Input *DescribeInternetGatewaysInput + Copy func(*DescribeInternetGatewaysInput) DescribeInternetGatewaysRequest } // Send marshals and sends the DescribeInternetGateways API request. @@ -7400,7 +7521,7 @@ func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInternetGatewaysRequest{Request: req, Input: input} + return DescribeInternetGatewaysRequest{Request: req, Input: input, Copy: c.DescribeInternetGatewaysRequest} } const opDescribeKeyPairs = "DescribeKeyPairs" @@ -7409,6 +7530,7 @@ const opDescribeKeyPairs = "DescribeKeyPairs" type DescribeKeyPairsRequest struct { *aws.Request Input *DescribeKeyPairsInput + Copy func(*DescribeKeyPairsInput) DescribeKeyPairsRequest } // Send marshals and sends the DescribeKeyPairs API request. @@ -7452,7 +7574,7 @@ func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) DescribeKeyP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeKeyPairsRequest{Request: req, Input: input} + return DescribeKeyPairsRequest{Request: req, Input: input, Copy: c.DescribeKeyPairsRequest} } const opDescribeLaunchTemplateVersions = "DescribeLaunchTemplateVersions" @@ -7461,6 +7583,7 @@ const opDescribeLaunchTemplateVersions = "DescribeLaunchTemplateVersions" type DescribeLaunchTemplateVersionsRequest struct { *aws.Request Input *DescribeLaunchTemplateVersionsInput + Copy func(*DescribeLaunchTemplateVersionsInput) DescribeLaunchTemplateVersionsRequest } // Send marshals and sends the DescribeLaunchTemplateVersions API request. @@ -7502,7 +7625,7 @@ func (c *EC2) DescribeLaunchTemplateVersionsRequest(input *DescribeLaunchTemplat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLaunchTemplateVersionsRequest{Request: req, Input: input} + return DescribeLaunchTemplateVersionsRequest{Request: req, Input: input, Copy: c.DescribeLaunchTemplateVersionsRequest} } const opDescribeLaunchTemplates = "DescribeLaunchTemplates" @@ -7511,6 +7634,7 @@ const opDescribeLaunchTemplates = "DescribeLaunchTemplates" type DescribeLaunchTemplatesRequest struct { *aws.Request Input *DescribeLaunchTemplatesInput + Copy func(*DescribeLaunchTemplatesInput) DescribeLaunchTemplatesRequest } // Send marshals and sends the DescribeLaunchTemplates API request. @@ -7551,7 +7675,7 @@ func (c *EC2) DescribeLaunchTemplatesRequest(input *DescribeLaunchTemplatesInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLaunchTemplatesRequest{Request: req, Input: input} + return DescribeLaunchTemplatesRequest{Request: req, Input: input, Copy: c.DescribeLaunchTemplatesRequest} } const opDescribeMovingAddresses = "DescribeMovingAddresses" @@ -7560,6 +7684,7 @@ const opDescribeMovingAddresses = "DescribeMovingAddresses" type DescribeMovingAddressesRequest struct { *aws.Request Input *DescribeMovingAddressesInput + Copy func(*DescribeMovingAddressesInput) DescribeMovingAddressesRequest } // Send marshals and sends the DescribeMovingAddresses API request. @@ -7602,7 +7727,7 @@ func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMovingAddressesRequest{Request: req, Input: input} + return DescribeMovingAddressesRequest{Request: req, Input: input, Copy: c.DescribeMovingAddressesRequest} } const opDescribeNatGateways = "DescribeNatGateways" @@ -7611,6 +7736,7 @@ const opDescribeNatGateways = "DescribeNatGateways" type DescribeNatGatewaysRequest struct { *aws.Request Input *DescribeNatGatewaysInput + Copy func(*DescribeNatGatewaysInput) DescribeNatGatewaysRequest } // Send marshals and sends the DescribeNatGateways API request. @@ -7657,57 +7783,53 @@ func (c *EC2) DescribeNatGatewaysRequest(input *DescribeNatGatewaysInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNatGatewaysRequest{Request: req, Input: input} + return DescribeNatGatewaysRequest{Request: req, Input: input, Copy: c.DescribeNatGatewaysRequest} } -// DescribeNatGatewaysPages iterates over the pages of a DescribeNatGateways operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeNatGateways method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeNatGatewaysRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeNatGateways operation. -// pageNum := 0 -// err := client.DescribeNatGatewaysPages(params, -// func(page *DescribeNatGatewaysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeNatGatewaysPages(input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool) error { - return c.DescribeNatGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeNatGatewaysPagesWithContext same as DescribeNatGatewaysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeNatGatewaysPagesWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeNatGatewaysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeNatGatewaysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeNatGatewaysRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeNatGatewaysRequest) Paginate(opts ...aws.Option) DescribeNatGatewaysPager { + return DescribeNatGatewaysPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeNatGatewaysInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNatGatewaysOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeNatGatewaysPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeNatGatewaysPager struct { + aws.Pager +} + +func (p *DescribeNatGatewaysPager) CurrentPage() *DescribeNatGatewaysOutput { + return p.Pager.CurrentPage().(*DescribeNatGatewaysOutput) } const opDescribeNetworkAcls = "DescribeNetworkAcls" @@ -7716,6 +7838,7 @@ const opDescribeNetworkAcls = "DescribeNetworkAcls" type DescribeNetworkAclsRequest struct { *aws.Request Input *DescribeNetworkAclsInput + Copy func(*DescribeNetworkAclsInput) DescribeNetworkAclsRequest } // Send marshals and sends the DescribeNetworkAcls API request. @@ -7759,7 +7882,7 @@ func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNetworkAclsRequest{Request: req, Input: input} + return DescribeNetworkAclsRequest{Request: req, Input: input, Copy: c.DescribeNetworkAclsRequest} } const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" @@ -7768,6 +7891,7 @@ const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" type DescribeNetworkInterfaceAttributeRequest struct { *aws.Request Input *DescribeNetworkInterfaceAttributeInput + Copy func(*DescribeNetworkInterfaceAttributeInput) DescribeNetworkInterfaceAttributeRequest } // Send marshals and sends the DescribeNetworkInterfaceAttribute API request. @@ -7809,7 +7933,7 @@ func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNetworkInterfaceAttributeRequest{Request: req, Input: input} + return DescribeNetworkInterfaceAttributeRequest{Request: req, Input: input, Copy: c.DescribeNetworkInterfaceAttributeRequest} } const opDescribeNetworkInterfacePermissions = "DescribeNetworkInterfacePermissions" @@ -7818,6 +7942,7 @@ const opDescribeNetworkInterfacePermissions = "DescribeNetworkInterfacePermissio type DescribeNetworkInterfacePermissionsRequest struct { *aws.Request Input *DescribeNetworkInterfacePermissionsInput + Copy func(*DescribeNetworkInterfacePermissionsInput) DescribeNetworkInterfacePermissionsRequest } // Send marshals and sends the DescribeNetworkInterfacePermissions API request. @@ -7858,7 +7983,7 @@ func (c *EC2) DescribeNetworkInterfacePermissionsRequest(input *DescribeNetworkI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNetworkInterfacePermissionsRequest{Request: req, Input: input} + return DescribeNetworkInterfacePermissionsRequest{Request: req, Input: input, Copy: c.DescribeNetworkInterfacePermissionsRequest} } const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" @@ -7867,6 +7992,7 @@ const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" type DescribeNetworkInterfacesRequest struct { *aws.Request Input *DescribeNetworkInterfacesInput + Copy func(*DescribeNetworkInterfacesInput) DescribeNetworkInterfacesRequest } // Send marshals and sends the DescribeNetworkInterfaces API request. @@ -7907,7 +8033,7 @@ func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNetworkInterfacesRequest{Request: req, Input: input} + return DescribeNetworkInterfacesRequest{Request: req, Input: input, Copy: c.DescribeNetworkInterfacesRequest} } const opDescribePlacementGroups = "DescribePlacementGroups" @@ -7916,6 +8042,7 @@ const opDescribePlacementGroups = "DescribePlacementGroups" type DescribePlacementGroupsRequest struct { *aws.Request Input *DescribePlacementGroupsInput + Copy func(*DescribePlacementGroupsInput) DescribePlacementGroupsRequest } // Send marshals and sends the DescribePlacementGroups API request. @@ -7958,7 +8085,7 @@ func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePlacementGroupsRequest{Request: req, Input: input} + return DescribePlacementGroupsRequest{Request: req, Input: input, Copy: c.DescribePlacementGroupsRequest} } const opDescribePrefixLists = "DescribePrefixLists" @@ -7967,6 +8094,7 @@ const opDescribePrefixLists = "DescribePrefixLists" type DescribePrefixListsRequest struct { *aws.Request Input *DescribePrefixListsInput + Copy func(*DescribePrefixListsInput) DescribePrefixListsRequest } // Send marshals and sends the DescribePrefixLists API request. @@ -8011,7 +8139,7 @@ func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePrefixListsRequest{Request: req, Input: input} + return DescribePrefixListsRequest{Request: req, Input: input, Copy: c.DescribePrefixListsRequest} } const opDescribeRegions = "DescribeRegions" @@ -8020,6 +8148,7 @@ const opDescribeRegions = "DescribeRegions" type DescribeRegionsRequest struct { *aws.Request Input *DescribeRegionsInput + Copy func(*DescribeRegionsInput) DescribeRegionsRequest } // Send marshals and sends the DescribeRegions API request. @@ -8063,7 +8192,7 @@ func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) DescribeRegion req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRegionsRequest{Request: req, Input: input} + return DescribeRegionsRequest{Request: req, Input: input, Copy: c.DescribeRegionsRequest} } const opDescribeReservedInstances = "DescribeReservedInstances" @@ -8072,6 +8201,7 @@ const opDescribeReservedInstances = "DescribeReservedInstances" type DescribeReservedInstancesRequest struct { *aws.Request Input *DescribeReservedInstancesInput + Copy func(*DescribeReservedInstancesInput) DescribeReservedInstancesRequest } // Send marshals and sends the DescribeReservedInstances API request. @@ -8115,7 +8245,7 @@ func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedInstancesRequest{Request: req, Input: input} + return DescribeReservedInstancesRequest{Request: req, Input: input, Copy: c.DescribeReservedInstancesRequest} } const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings" @@ -8124,6 +8254,7 @@ const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings" type DescribeReservedInstancesListingsRequest struct { *aws.Request Input *DescribeReservedInstancesListingsInput + Copy func(*DescribeReservedInstancesListingsInput) DescribeReservedInstancesListingsRequest } // Send marshals and sends the DescribeReservedInstancesListings API request. @@ -8185,7 +8316,7 @@ func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedInstancesListingsRequest{Request: req, Input: input} + return DescribeReservedInstancesListingsRequest{Request: req, Input: input, Copy: c.DescribeReservedInstancesListingsRequest} } const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModifications" @@ -8194,6 +8325,7 @@ const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModif type DescribeReservedInstancesModificationsRequest struct { *aws.Request Input *DescribeReservedInstancesModificationsInput + Copy func(*DescribeReservedInstancesModificationsInput) DescribeReservedInstancesModificationsRequest } // Send marshals and sends the DescribeReservedInstancesModifications API request. @@ -8246,57 +8378,53 @@ func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReser req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedInstancesModificationsRequest{Request: req, Input: input} + return DescribeReservedInstancesModificationsRequest{Request: req, Input: input, Copy: c.DescribeReservedInstancesModificationsRequest} } -// DescribeReservedInstancesModificationsPages iterates over the pages of a DescribeReservedInstancesModifications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedInstancesModifications method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReservedInstancesModificationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReservedInstancesModifications operation. -// pageNum := 0 -// err := client.DescribeReservedInstancesModificationsPages(params, -// func(page *DescribeReservedInstancesModificationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool) error { - return c.DescribeReservedInstancesModificationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedInstancesModificationsPagesWithContext same as DescribeReservedInstancesModificationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesModificationsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReservedInstancesModificationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReservedInstancesModificationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReservedInstancesModificationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReservedInstancesModificationsRequest) Paginate(opts ...aws.Option) DescribeReservedInstancesModificationsPager { + return DescribeReservedInstancesModificationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReservedInstancesModificationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedInstancesModificationsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReservedInstancesModificationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReservedInstancesModificationsPager struct { + aws.Pager +} + +func (p *DescribeReservedInstancesModificationsPager) CurrentPage() *DescribeReservedInstancesModificationsOutput { + return p.Pager.CurrentPage().(*DescribeReservedInstancesModificationsOutput) } const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings" @@ -8305,6 +8433,7 @@ const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings type DescribeReservedInstancesOfferingsRequest struct { *aws.Request Input *DescribeReservedInstancesOfferingsInput + Copy func(*DescribeReservedInstancesOfferingsInput) DescribeReservedInstancesOfferingsRequest } // Send marshals and sends the DescribeReservedInstancesOfferings API request. @@ -8362,57 +8491,53 @@ func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedInstancesOfferingsRequest{Request: req, Input: input} + return DescribeReservedInstancesOfferingsRequest{Request: req, Input: input, Copy: c.DescribeReservedInstancesOfferingsRequest} } -// DescribeReservedInstancesOfferingsPages iterates over the pages of a DescribeReservedInstancesOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedInstancesOfferings method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReservedInstancesOfferingsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReservedInstancesOfferings operation. -// pageNum := 0 -// err := client.DescribeReservedInstancesOfferingsPages(params, -// func(page *DescribeReservedInstancesOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool) error { - return c.DescribeReservedInstancesOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedInstancesOfferingsPagesWithContext same as DescribeReservedInstancesOfferingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesOfferingsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReservedInstancesOfferingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReservedInstancesOfferingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReservedInstancesOfferingsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReservedInstancesOfferingsRequest) Paginate(opts ...aws.Option) DescribeReservedInstancesOfferingsPager { + return DescribeReservedInstancesOfferingsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReservedInstancesOfferingsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedInstancesOfferingsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReservedInstancesOfferingsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReservedInstancesOfferingsPager struct { + aws.Pager +} + +func (p *DescribeReservedInstancesOfferingsPager) CurrentPage() *DescribeReservedInstancesOfferingsOutput { + return p.Pager.CurrentPage().(*DescribeReservedInstancesOfferingsOutput) } const opDescribeRouteTables = "DescribeRouteTables" @@ -8421,6 +8546,7 @@ const opDescribeRouteTables = "DescribeRouteTables" type DescribeRouteTablesRequest struct { *aws.Request Input *DescribeRouteTablesInput + Copy func(*DescribeRouteTablesInput) DescribeRouteTablesRequest } // Send marshals and sends the DescribeRouteTables API request. @@ -8469,7 +8595,7 @@ func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRouteTablesRequest{Request: req, Input: input} + return DescribeRouteTablesRequest{Request: req, Input: input, Copy: c.DescribeRouteTablesRequest} } const opDescribeScheduledInstanceAvailability = "DescribeScheduledInstanceAvailability" @@ -8478,6 +8604,7 @@ const opDescribeScheduledInstanceAvailability = "DescribeScheduledInstanceAvaila type DescribeScheduledInstanceAvailabilityRequest struct { *aws.Request Input *DescribeScheduledInstanceAvailabilityInput + Copy func(*DescribeScheduledInstanceAvailabilityInput) DescribeScheduledInstanceAvailabilityRequest } // Send marshals and sends the DescribeScheduledInstanceAvailability API request. @@ -8526,7 +8653,7 @@ func (c *EC2) DescribeScheduledInstanceAvailabilityRequest(input *DescribeSchedu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScheduledInstanceAvailabilityRequest{Request: req, Input: input} + return DescribeScheduledInstanceAvailabilityRequest{Request: req, Input: input, Copy: c.DescribeScheduledInstanceAvailabilityRequest} } const opDescribeScheduledInstances = "DescribeScheduledInstances" @@ -8535,6 +8662,7 @@ const opDescribeScheduledInstances = "DescribeScheduledInstances" type DescribeScheduledInstancesRequest struct { *aws.Request Input *DescribeScheduledInstancesInput + Copy func(*DescribeScheduledInstancesInput) DescribeScheduledInstancesRequest } // Send marshals and sends the DescribeScheduledInstances API request. @@ -8575,7 +8703,7 @@ func (c *EC2) DescribeScheduledInstancesRequest(input *DescribeScheduledInstance req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScheduledInstancesRequest{Request: req, Input: input} + return DescribeScheduledInstancesRequest{Request: req, Input: input, Copy: c.DescribeScheduledInstancesRequest} } const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences" @@ -8584,6 +8712,7 @@ const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences" type DescribeSecurityGroupReferencesRequest struct { *aws.Request Input *DescribeSecurityGroupReferencesInput + Copy func(*DescribeSecurityGroupReferencesInput) DescribeSecurityGroupReferencesRequest } // Send marshals and sends the DescribeSecurityGroupReferences API request. @@ -8625,7 +8754,7 @@ func (c *EC2) DescribeSecurityGroupReferencesRequest(input *DescribeSecurityGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSecurityGroupReferencesRequest{Request: req, Input: input} + return DescribeSecurityGroupReferencesRequest{Request: req, Input: input, Copy: c.DescribeSecurityGroupReferencesRequest} } const opDescribeSecurityGroups = "DescribeSecurityGroups" @@ -8634,6 +8763,7 @@ const opDescribeSecurityGroups = "DescribeSecurityGroups" type DescribeSecurityGroupsRequest struct { *aws.Request Input *DescribeSecurityGroupsInput + Copy func(*DescribeSecurityGroupsInput) DescribeSecurityGroupsRequest } // Send marshals and sends the DescribeSecurityGroups API request. @@ -8681,7 +8811,7 @@ func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSecurityGroupsRequest{Request: req, Input: input} + return DescribeSecurityGroupsRequest{Request: req, Input: input, Copy: c.DescribeSecurityGroupsRequest} } const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute" @@ -8690,6 +8820,7 @@ const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute" type DescribeSnapshotAttributeRequest struct { *aws.Request Input *DescribeSnapshotAttributeInput + Copy func(*DescribeSnapshotAttributeInput) DescribeSnapshotAttributeRequest } // Send marshals and sends the DescribeSnapshotAttribute API request. @@ -8734,7 +8865,7 @@ func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSnapshotAttributeRequest{Request: req, Input: input} + return DescribeSnapshotAttributeRequest{Request: req, Input: input, Copy: c.DescribeSnapshotAttributeRequest} } const opDescribeSnapshots = "DescribeSnapshots" @@ -8743,6 +8874,7 @@ const opDescribeSnapshots = "DescribeSnapshots" type DescribeSnapshotsRequest struct { *aws.Request Input *DescribeSnapshotsInput + Copy func(*DescribeSnapshotsInput) DescribeSnapshotsRequest } // Send marshals and sends the DescribeSnapshots API request. @@ -8834,57 +8966,53 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) DescribeSn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSnapshotsRequest{Request: req, Input: input} + return DescribeSnapshotsRequest{Request: req, Input: input, Copy: c.DescribeSnapshotsRequest} } -// DescribeSnapshotsPages iterates over the pages of a DescribeSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSnapshots method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeSnapshotsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeSnapshots operation. -// pageNum := 0 -// err := client.DescribeSnapshotsPages(params, -// func(page *DescribeSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool) error { - return c.DescribeSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSnapshotsPagesWithContext same as DescribeSnapshotsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSnapshotsPagesWithContext(ctx aws.Context, input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeSnapshotsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeSnapshotsRequest) Paginate(opts ...aws.Option) DescribeSnapshotsPager { + return DescribeSnapshotsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeSnapshotsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeSnapshotsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeSnapshotsPager struct { + aws.Pager +} + +func (p *DescribeSnapshotsPager) CurrentPage() *DescribeSnapshotsOutput { + return p.Pager.CurrentPage().(*DescribeSnapshotsOutput) } const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription" @@ -8893,6 +9021,7 @@ const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription" type DescribeSpotDatafeedSubscriptionRequest struct { *aws.Request Input *DescribeSpotDatafeedSubscriptionInput + Copy func(*DescribeSpotDatafeedSubscriptionInput) DescribeSpotDatafeedSubscriptionRequest } // Send marshals and sends the DescribeSpotDatafeedSubscription API request. @@ -8935,7 +9064,7 @@ func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafee req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSpotDatafeedSubscriptionRequest{Request: req, Input: input} + return DescribeSpotDatafeedSubscriptionRequest{Request: req, Input: input, Copy: c.DescribeSpotDatafeedSubscriptionRequest} } const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances" @@ -8944,6 +9073,7 @@ const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances" type DescribeSpotFleetInstancesRequest struct { *aws.Request Input *DescribeSpotFleetInstancesInput + Copy func(*DescribeSpotFleetInstancesInput) DescribeSpotFleetInstancesRequest } // Send marshals and sends the DescribeSpotFleetInstances API request. @@ -8984,7 +9114,7 @@ func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstance req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSpotFleetInstancesRequest{Request: req, Input: input} + return DescribeSpotFleetInstancesRequest{Request: req, Input: input, Copy: c.DescribeSpotFleetInstancesRequest} } const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory" @@ -8993,6 +9123,7 @@ const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory" type DescribeSpotFleetRequestHistoryRequest struct { *aws.Request Input *DescribeSpotFleetRequestHistoryInput + Copy func(*DescribeSpotFleetRequestHistoryInput) DescribeSpotFleetRequestHistoryRequest } // Send marshals and sends the DescribeSpotFleetRequestHistory API request. @@ -9038,7 +9169,7 @@ func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSpotFleetRequestHistoryRequest{Request: req, Input: input} + return DescribeSpotFleetRequestHistoryRequest{Request: req, Input: input, Copy: c.DescribeSpotFleetRequestHistoryRequest} } const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests" @@ -9047,6 +9178,7 @@ const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests" type DescribeSpotFleetRequestsRequest struct { *aws.Request Input *DescribeSpotFleetRequestsInput + Copy func(*DescribeSpotFleetRequestsInput) DescribeSpotFleetRequestsRequest } // Send marshals and sends the DescribeSpotFleetRequests API request. @@ -9096,57 +9228,53 @@ func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSpotFleetRequestsRequest{Request: req, Input: input} + return DescribeSpotFleetRequestsRequest{Request: req, Input: input, Copy: c.DescribeSpotFleetRequestsRequest} } -// DescribeSpotFleetRequestsPages iterates over the pages of a DescribeSpotFleetRequests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSpotFleetRequests method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeSpotFleetRequestsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeSpotFleetRequests operation. -// pageNum := 0 -// err := client.DescribeSpotFleetRequestsPages(params, -// func(page *DescribeSpotFleetRequestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSpotFleetRequestsPages(input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool) error { - return c.DescribeSpotFleetRequestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSpotFleetRequestsPagesWithContext same as DescribeSpotFleetRequestsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotFleetRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeSpotFleetRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeSpotFleetRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeSpotFleetRequestsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeSpotFleetRequestsRequest) Paginate(opts ...aws.Option) DescribeSpotFleetRequestsPager { + return DescribeSpotFleetRequestsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeSpotFleetRequestsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSpotFleetRequestsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeSpotFleetRequestsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeSpotFleetRequestsPager struct { + aws.Pager +} + +func (p *DescribeSpotFleetRequestsPager) CurrentPage() *DescribeSpotFleetRequestsOutput { + return p.Pager.CurrentPage().(*DescribeSpotFleetRequestsOutput) } const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests" @@ -9155,6 +9283,7 @@ const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests" type DescribeSpotInstanceRequestsRequest struct { *aws.Request Input *DescribeSpotInstanceRequestsInput + Copy func(*DescribeSpotInstanceRequestsInput) DescribeSpotInstanceRequestsRequest } // Send marshals and sends the DescribeSpotInstanceRequests API request. @@ -9208,7 +9337,7 @@ func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSpotInstanceRequestsRequest{Request: req, Input: input} + return DescribeSpotInstanceRequestsRequest{Request: req, Input: input, Copy: c.DescribeSpotInstanceRequestsRequest} } const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" @@ -9217,6 +9346,7 @@ const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" type DescribeSpotPriceHistoryRequest struct { *aws.Request Input *DescribeSpotPriceHistoryInput + Copy func(*DescribeSpotPriceHistoryInput) DescribeSpotPriceHistoryRequest } // Send marshals and sends the DescribeSpotPriceHistory API request. @@ -9270,57 +9400,53 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSpotPriceHistoryRequest{Request: req, Input: input} + return DescribeSpotPriceHistoryRequest{Request: req, Input: input, Copy: c.DescribeSpotPriceHistoryRequest} } -// DescribeSpotPriceHistoryPages iterates over the pages of a DescribeSpotPriceHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSpotPriceHistory method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeSpotPriceHistoryRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeSpotPriceHistory operation. -// pageNum := 0 -// err := client.DescribeSpotPriceHistoryPages(params, -// func(page *DescribeSpotPriceHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool) error { - return c.DescribeSpotPriceHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSpotPriceHistoryPagesWithContext same as DescribeSpotPriceHistoryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotPriceHistoryPagesWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeSpotPriceHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeSpotPriceHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeSpotPriceHistoryRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeSpotPriceHistoryRequest) Paginate(opts ...aws.Option) DescribeSpotPriceHistoryPager { + return DescribeSpotPriceHistoryPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeSpotPriceHistoryInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSpotPriceHistoryOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeSpotPriceHistoryPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeSpotPriceHistoryPager struct { + aws.Pager +} + +func (p *DescribeSpotPriceHistoryPager) CurrentPage() *DescribeSpotPriceHistoryOutput { + return p.Pager.CurrentPage().(*DescribeSpotPriceHistoryOutput) } const opDescribeStaleSecurityGroups = "DescribeStaleSecurityGroups" @@ -9329,6 +9455,7 @@ const opDescribeStaleSecurityGroups = "DescribeStaleSecurityGroups" type DescribeStaleSecurityGroupsRequest struct { *aws.Request Input *DescribeStaleSecurityGroupsInput + Copy func(*DescribeStaleSecurityGroupsInput) DescribeStaleSecurityGroupsRequest } // Send marshals and sends the DescribeStaleSecurityGroups API request. @@ -9372,7 +9499,7 @@ func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStaleSecurityGroupsRequest{Request: req, Input: input} + return DescribeStaleSecurityGroupsRequest{Request: req, Input: input, Copy: c.DescribeStaleSecurityGroupsRequest} } const opDescribeSubnets = "DescribeSubnets" @@ -9381,6 +9508,7 @@ const opDescribeSubnets = "DescribeSubnets" type DescribeSubnetsRequest struct { *aws.Request Input *DescribeSubnetsInput + Copy func(*DescribeSubnetsInput) DescribeSubnetsRequest } // Send marshals and sends the DescribeSubnets API request. @@ -9424,7 +9552,7 @@ func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) DescribeSubnet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSubnetsRequest{Request: req, Input: input} + return DescribeSubnetsRequest{Request: req, Input: input, Copy: c.DescribeSubnetsRequest} } const opDescribeTags = "DescribeTags" @@ -9433,6 +9561,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -9482,57 +9611,53 @@ func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) DescribeTagsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } -// DescribeTagsPages iterates over the pages of a DescribeTags operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTags method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeTagsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeTags operation. -// pageNum := 0 -// err := client.DescribeTagsPages(params, -// func(page *DescribeTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeTagsPages(input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool) error { - return c.DescribeTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTagsPagesWithContext same as DescribeTagsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeTagsPagesWithContext(ctx aws.Context, input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeTagsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeTagsRequest) Paginate(opts ...aws.Option) DescribeTagsPager { + return DescribeTagsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeTagsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeTagsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeTagsPager struct { + aws.Pager +} + +func (p *DescribeTagsPager) CurrentPage() *DescribeTagsOutput { + return p.Pager.CurrentPage().(*DescribeTagsOutput) } const opDescribeVolumeAttribute = "DescribeVolumeAttribute" @@ -9541,6 +9666,7 @@ const opDescribeVolumeAttribute = "DescribeVolumeAttribute" type DescribeVolumeAttributeRequest struct { *aws.Request Input *DescribeVolumeAttributeInput + Copy func(*DescribeVolumeAttributeInput) DescribeVolumeAttributeRequest } // Send marshals and sends the DescribeVolumeAttribute API request. @@ -9585,7 +9711,7 @@ func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVolumeAttributeRequest{Request: req, Input: input} + return DescribeVolumeAttributeRequest{Request: req, Input: input, Copy: c.DescribeVolumeAttributeRequest} } const opDescribeVolumeStatus = "DescribeVolumeStatus" @@ -9594,6 +9720,7 @@ const opDescribeVolumeStatus = "DescribeVolumeStatus" type DescribeVolumeStatusRequest struct { *aws.Request Input *DescribeVolumeStatusInput + Copy func(*DescribeVolumeStatusInput) DescribeVolumeStatusRequest } // Send marshals and sends the DescribeVolumeStatus API request. @@ -9674,57 +9801,53 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVolumeStatusRequest{Request: req, Input: input} + return DescribeVolumeStatusRequest{Request: req, Input: input, Copy: c.DescribeVolumeStatusRequest} } -// DescribeVolumeStatusPages iterates over the pages of a DescribeVolumeStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeVolumeStatus method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeVolumeStatusRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeVolumeStatus operation. -// pageNum := 0 -// err := client.DescribeVolumeStatusPages(params, -// func(page *DescribeVolumeStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool) error { - return c.DescribeVolumeStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeVolumeStatusPagesWithContext same as DescribeVolumeStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVolumeStatusPagesWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeVolumeStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeVolumeStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeVolumeStatusRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeVolumeStatusRequest) Paginate(opts ...aws.Option) DescribeVolumeStatusPager { + return DescribeVolumeStatusPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeVolumeStatusInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVolumeStatusOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeVolumeStatusPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeVolumeStatusPager struct { + aws.Pager +} + +func (p *DescribeVolumeStatusPager) CurrentPage() *DescribeVolumeStatusOutput { + return p.Pager.CurrentPage().(*DescribeVolumeStatusOutput) } const opDescribeVolumes = "DescribeVolumes" @@ -9733,6 +9856,7 @@ const opDescribeVolumes = "DescribeVolumes" type DescribeVolumesRequest struct { *aws.Request Input *DescribeVolumesInput + Copy func(*DescribeVolumesInput) DescribeVolumesRequest } // Send marshals and sends the DescribeVolumes API request. @@ -9789,57 +9913,53 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) DescribeVolume req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVolumesRequest{Request: req, Input: input} + return DescribeVolumesRequest{Request: req, Input: input, Copy: c.DescribeVolumesRequest} } -// DescribeVolumesPages iterates over the pages of a DescribeVolumes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeVolumes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeVolumesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeVolumes operation. -// pageNum := 0 -// err := client.DescribeVolumesPages(params, -// func(page *DescribeVolumesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool) error { - return c.DescribeVolumesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeVolumesPagesWithContext same as DescribeVolumesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVolumesPagesWithContext(ctx aws.Context, input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeVolumesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeVolumesRequest) Paginate(opts ...aws.Option) DescribeVolumesPager { + return DescribeVolumesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeVolumesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVolumesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeVolumesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeVolumesPager struct { + aws.Pager +} + +func (p *DescribeVolumesPager) CurrentPage() *DescribeVolumesOutput { + return p.Pager.CurrentPage().(*DescribeVolumesOutput) } const opDescribeVolumesModifications = "DescribeVolumesModifications" @@ -9848,6 +9968,7 @@ const opDescribeVolumesModifications = "DescribeVolumesModifications" type DescribeVolumesModificationsRequest struct { *aws.Request Input *DescribeVolumesModificationsInput + Copy func(*DescribeVolumesModificationsInput) DescribeVolumesModificationsRequest } // Send marshals and sends the DescribeVolumesModifications API request. @@ -9900,7 +10021,7 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVolumesModificationsRequest{Request: req, Input: input} + return DescribeVolumesModificationsRequest{Request: req, Input: input, Copy: c.DescribeVolumesModificationsRequest} } const opDescribeVpcAttribute = "DescribeVpcAttribute" @@ -9909,6 +10030,7 @@ const opDescribeVpcAttribute = "DescribeVpcAttribute" type DescribeVpcAttributeRequest struct { *aws.Request Input *DescribeVpcAttributeInput + Copy func(*DescribeVpcAttributeInput) DescribeVpcAttributeRequest } // Send marshals and sends the DescribeVpcAttribute API request. @@ -9950,7 +10072,7 @@ func (c *EC2) DescribeVpcAttributeRequest(input *DescribeVpcAttributeInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcAttributeRequest{Request: req, Input: input} + return DescribeVpcAttributeRequest{Request: req, Input: input, Copy: c.DescribeVpcAttributeRequest} } const opDescribeVpcClassicLink = "DescribeVpcClassicLink" @@ -9959,6 +10081,7 @@ const opDescribeVpcClassicLink = "DescribeVpcClassicLink" type DescribeVpcClassicLinkRequest struct { *aws.Request Input *DescribeVpcClassicLinkInput + Copy func(*DescribeVpcClassicLinkInput) DescribeVpcClassicLinkRequest } // Send marshals and sends the DescribeVpcClassicLink API request. @@ -9999,7 +10122,7 @@ func (c *EC2) DescribeVpcClassicLinkRequest(input *DescribeVpcClassicLinkInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcClassicLinkRequest{Request: req, Input: input} + return DescribeVpcClassicLinkRequest{Request: req, Input: input, Copy: c.DescribeVpcClassicLinkRequest} } const opDescribeVpcClassicLinkDnsSupport = "DescribeVpcClassicLinkDnsSupport" @@ -10008,6 +10131,7 @@ const opDescribeVpcClassicLinkDnsSupport = "DescribeVpcClassicLinkDnsSupport" type DescribeVpcClassicLinkDnsSupportRequest struct { *aws.Request Input *DescribeVpcClassicLinkDnsSupportInput + Copy func(*DescribeVpcClassicLinkDnsSupportInput) DescribeVpcClassicLinkDnsSupportRequest } // Send marshals and sends the DescribeVpcClassicLinkDnsSupport API request. @@ -10054,7 +10178,7 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcClassicLinkDnsSupportRequest{Request: req, Input: input} + return DescribeVpcClassicLinkDnsSupportRequest{Request: req, Input: input, Copy: c.DescribeVpcClassicLinkDnsSupportRequest} } const opDescribeVpcEndpointConnectionNotifications = "DescribeVpcEndpointConnectionNotifications" @@ -10063,6 +10187,7 @@ const opDescribeVpcEndpointConnectionNotifications = "DescribeVpcEndpointConnect type DescribeVpcEndpointConnectionNotificationsRequest struct { *aws.Request Input *DescribeVpcEndpointConnectionNotificationsInput + Copy func(*DescribeVpcEndpointConnectionNotificationsInput) DescribeVpcEndpointConnectionNotificationsRequest } // Send marshals and sends the DescribeVpcEndpointConnectionNotifications API request. @@ -10104,7 +10229,7 @@ func (c *EC2) DescribeVpcEndpointConnectionNotificationsRequest(input *DescribeV req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcEndpointConnectionNotificationsRequest{Request: req, Input: input} + return DescribeVpcEndpointConnectionNotificationsRequest{Request: req, Input: input, Copy: c.DescribeVpcEndpointConnectionNotificationsRequest} } const opDescribeVpcEndpointConnections = "DescribeVpcEndpointConnections" @@ -10113,6 +10238,7 @@ const opDescribeVpcEndpointConnections = "DescribeVpcEndpointConnections" type DescribeVpcEndpointConnectionsRequest struct { *aws.Request Input *DescribeVpcEndpointConnectionsInput + Copy func(*DescribeVpcEndpointConnectionsInput) DescribeVpcEndpointConnectionsRequest } // Send marshals and sends the DescribeVpcEndpointConnections API request. @@ -10154,7 +10280,7 @@ func (c *EC2) DescribeVpcEndpointConnectionsRequest(input *DescribeVpcEndpointCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcEndpointConnectionsRequest{Request: req, Input: input} + return DescribeVpcEndpointConnectionsRequest{Request: req, Input: input, Copy: c.DescribeVpcEndpointConnectionsRequest} } const opDescribeVpcEndpointServiceConfigurations = "DescribeVpcEndpointServiceConfigurations" @@ -10163,6 +10289,7 @@ const opDescribeVpcEndpointServiceConfigurations = "DescribeVpcEndpointServiceCo type DescribeVpcEndpointServiceConfigurationsRequest struct { *aws.Request Input *DescribeVpcEndpointServiceConfigurationsInput + Copy func(*DescribeVpcEndpointServiceConfigurationsInput) DescribeVpcEndpointServiceConfigurationsRequest } // Send marshals and sends the DescribeVpcEndpointServiceConfigurations API request. @@ -10203,7 +10330,7 @@ func (c *EC2) DescribeVpcEndpointServiceConfigurationsRequest(input *DescribeVpc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcEndpointServiceConfigurationsRequest{Request: req, Input: input} + return DescribeVpcEndpointServiceConfigurationsRequest{Request: req, Input: input, Copy: c.DescribeVpcEndpointServiceConfigurationsRequest} } const opDescribeVpcEndpointServicePermissions = "DescribeVpcEndpointServicePermissions" @@ -10212,6 +10339,7 @@ const opDescribeVpcEndpointServicePermissions = "DescribeVpcEndpointServicePermi type DescribeVpcEndpointServicePermissionsRequest struct { *aws.Request Input *DescribeVpcEndpointServicePermissionsInput + Copy func(*DescribeVpcEndpointServicePermissionsInput) DescribeVpcEndpointServicePermissionsRequest } // Send marshals and sends the DescribeVpcEndpointServicePermissions API request. @@ -10253,7 +10381,7 @@ func (c *EC2) DescribeVpcEndpointServicePermissionsRequest(input *DescribeVpcEnd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcEndpointServicePermissionsRequest{Request: req, Input: input} + return DescribeVpcEndpointServicePermissionsRequest{Request: req, Input: input, Copy: c.DescribeVpcEndpointServicePermissionsRequest} } const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" @@ -10262,6 +10390,7 @@ const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" type DescribeVpcEndpointServicesRequest struct { *aws.Request Input *DescribeVpcEndpointServicesInput + Copy func(*DescribeVpcEndpointServicesInput) DescribeVpcEndpointServicesRequest } // Send marshals and sends the DescribeVpcEndpointServices API request. @@ -10302,7 +10431,7 @@ func (c *EC2) DescribeVpcEndpointServicesRequest(input *DescribeVpcEndpointServi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcEndpointServicesRequest{Request: req, Input: input} + return DescribeVpcEndpointServicesRequest{Request: req, Input: input, Copy: c.DescribeVpcEndpointServicesRequest} } const opDescribeVpcEndpoints = "DescribeVpcEndpoints" @@ -10311,6 +10440,7 @@ const opDescribeVpcEndpoints = "DescribeVpcEndpoints" type DescribeVpcEndpointsRequest struct { *aws.Request Input *DescribeVpcEndpointsInput + Copy func(*DescribeVpcEndpointsInput) DescribeVpcEndpointsRequest } // Send marshals and sends the DescribeVpcEndpoints API request. @@ -10351,7 +10481,7 @@ func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcEndpointsRequest{Request: req, Input: input} + return DescribeVpcEndpointsRequest{Request: req, Input: input, Copy: c.DescribeVpcEndpointsRequest} } const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" @@ -10360,6 +10490,7 @@ const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" type DescribeVpcPeeringConnectionsRequest struct { *aws.Request Input *DescribeVpcPeeringConnectionsInput + Copy func(*DescribeVpcPeeringConnectionsInput) DescribeVpcPeeringConnectionsRequest } // Send marshals and sends the DescribeVpcPeeringConnections API request. @@ -10400,7 +10531,7 @@ func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcPeeringConnectionsRequest{Request: req, Input: input} + return DescribeVpcPeeringConnectionsRequest{Request: req, Input: input, Copy: c.DescribeVpcPeeringConnectionsRequest} } const opDescribeVpcs = "DescribeVpcs" @@ -10409,6 +10540,7 @@ const opDescribeVpcs = "DescribeVpcs" type DescribeVpcsRequest struct { *aws.Request Input *DescribeVpcsInput + Copy func(*DescribeVpcsInput) DescribeVpcsRequest } // Send marshals and sends the DescribeVpcs API request. @@ -10449,7 +10581,7 @@ func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) DescribeVpcsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcsRequest{Request: req, Input: input} + return DescribeVpcsRequest{Request: req, Input: input, Copy: c.DescribeVpcsRequest} } const opDescribeVpnConnections = "DescribeVpnConnections" @@ -10458,6 +10590,7 @@ const opDescribeVpnConnections = "DescribeVpnConnections" type DescribeVpnConnectionsRequest struct { *aws.Request Input *DescribeVpnConnectionsInput + Copy func(*DescribeVpnConnectionsInput) DescribeVpnConnectionsRequest } // Send marshals and sends the DescribeVpnConnections API request. @@ -10502,7 +10635,7 @@ func (c *EC2) DescribeVpnConnectionsRequest(input *DescribeVpnConnectionsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpnConnectionsRequest{Request: req, Input: input} + return DescribeVpnConnectionsRequest{Request: req, Input: input, Copy: c.DescribeVpnConnectionsRequest} } const opDescribeVpnGateways = "DescribeVpnGateways" @@ -10511,6 +10644,7 @@ const opDescribeVpnGateways = "DescribeVpnGateways" type DescribeVpnGatewaysRequest struct { *aws.Request Input *DescribeVpnGatewaysInput + Copy func(*DescribeVpnGatewaysInput) DescribeVpnGatewaysRequest } // Send marshals and sends the DescribeVpnGateways API request. @@ -10555,7 +10689,7 @@ func (c *EC2) DescribeVpnGatewaysRequest(input *DescribeVpnGatewaysInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpnGatewaysRequest{Request: req, Input: input} + return DescribeVpnGatewaysRequest{Request: req, Input: input, Copy: c.DescribeVpnGatewaysRequest} } const opDetachClassicLinkVpc = "DetachClassicLinkVpc" @@ -10564,6 +10698,7 @@ const opDetachClassicLinkVpc = "DetachClassicLinkVpc" type DetachClassicLinkVpcRequest struct { *aws.Request Input *DetachClassicLinkVpcInput + Copy func(*DetachClassicLinkVpcInput) DetachClassicLinkVpcRequest } // Send marshals and sends the DetachClassicLinkVpc API request. @@ -10606,7 +10741,7 @@ func (c *EC2) DetachClassicLinkVpcRequest(input *DetachClassicLinkVpcInput) Deta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachClassicLinkVpcRequest{Request: req, Input: input} + return DetachClassicLinkVpcRequest{Request: req, Input: input, Copy: c.DetachClassicLinkVpcRequest} } const opDetachInternetGateway = "DetachInternetGateway" @@ -10615,6 +10750,7 @@ const opDetachInternetGateway = "DetachInternetGateway" type DetachInternetGatewayRequest struct { *aws.Request Input *DetachInternetGatewayInput + Copy func(*DetachInternetGatewayInput) DetachInternetGatewayRequest } // Send marshals and sends the DetachInternetGateway API request. @@ -10659,7 +10795,7 @@ func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachInternetGatewayRequest{Request: req, Input: input} + return DetachInternetGatewayRequest{Request: req, Input: input, Copy: c.DetachInternetGatewayRequest} } const opDetachNetworkInterface = "DetachNetworkInterface" @@ -10668,6 +10804,7 @@ const opDetachNetworkInterface = "DetachNetworkInterface" type DetachNetworkInterfaceRequest struct { *aws.Request Input *DetachNetworkInterfaceInput + Copy func(*DetachNetworkInterfaceInput) DetachNetworkInterfaceRequest } // Send marshals and sends the DetachNetworkInterface API request. @@ -10710,7 +10847,7 @@ func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachNetworkInterfaceRequest{Request: req, Input: input} + return DetachNetworkInterfaceRequest{Request: req, Input: input, Copy: c.DetachNetworkInterfaceRequest} } const opDetachVolume = "DetachVolume" @@ -10719,6 +10856,7 @@ const opDetachVolume = "DetachVolume" type DetachVolumeRequest struct { *aws.Request Input *DetachVolumeInput + Copy func(*DetachVolumeInput) DetachVolumeRequest } // Send marshals and sends the DetachVolume API request. @@ -10772,7 +10910,7 @@ func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) DetachVolumeRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachVolumeRequest{Request: req, Input: input} + return DetachVolumeRequest{Request: req, Input: input, Copy: c.DetachVolumeRequest} } const opDetachVpnGateway = "DetachVpnGateway" @@ -10781,6 +10919,7 @@ const opDetachVpnGateway = "DetachVpnGateway" type DetachVpnGatewayRequest struct { *aws.Request Input *DetachVpnGatewayInput + Copy func(*DetachVpnGatewayInput) DetachVpnGatewayRequest } // Send marshals and sends the DetachVpnGateway API request. @@ -10830,7 +10969,7 @@ func (c *EC2) DetachVpnGatewayRequest(input *DetachVpnGatewayInput) DetachVpnGat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachVpnGatewayRequest{Request: req, Input: input} + return DetachVpnGatewayRequest{Request: req, Input: input, Copy: c.DetachVpnGatewayRequest} } const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation" @@ -10839,6 +10978,7 @@ const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation" type DisableVgwRoutePropagationRequest struct { *aws.Request Input *DisableVgwRoutePropagationInput + Copy func(*DisableVgwRoutePropagationInput) DisableVgwRoutePropagationRequest } // Send marshals and sends the DisableVgwRoutePropagation API request. @@ -10882,7 +11022,7 @@ func (c *EC2) DisableVgwRoutePropagationRequest(input *DisableVgwRoutePropagatio req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisableVgwRoutePropagationRequest{Request: req, Input: input} + return DisableVgwRoutePropagationRequest{Request: req, Input: input, Copy: c.DisableVgwRoutePropagationRequest} } const opDisableVpcClassicLink = "DisableVpcClassicLink" @@ -10891,6 +11031,7 @@ const opDisableVpcClassicLink = "DisableVpcClassicLink" type DisableVpcClassicLinkRequest struct { *aws.Request Input *DisableVpcClassicLinkInput + Copy func(*DisableVpcClassicLinkInput) DisableVpcClassicLinkRequest } // Send marshals and sends the DisableVpcClassicLink API request. @@ -10932,7 +11073,7 @@ func (c *EC2) DisableVpcClassicLinkRequest(input *DisableVpcClassicLinkInput) Di req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableVpcClassicLinkRequest{Request: req, Input: input} + return DisableVpcClassicLinkRequest{Request: req, Input: input, Copy: c.DisableVpcClassicLinkRequest} } const opDisableVpcClassicLinkDnsSupport = "DisableVpcClassicLinkDnsSupport" @@ -10941,6 +11082,7 @@ const opDisableVpcClassicLinkDnsSupport = "DisableVpcClassicLinkDnsSupport" type DisableVpcClassicLinkDnsSupportRequest struct { *aws.Request Input *DisableVpcClassicLinkDnsSupportInput + Copy func(*DisableVpcClassicLinkDnsSupportInput) DisableVpcClassicLinkDnsSupportRequest } // Send marshals and sends the DisableVpcClassicLinkDnsSupport API request. @@ -10985,7 +11127,7 @@ func (c *EC2) DisableVpcClassicLinkDnsSupportRequest(input *DisableVpcClassicLin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableVpcClassicLinkDnsSupportRequest{Request: req, Input: input} + return DisableVpcClassicLinkDnsSupportRequest{Request: req, Input: input, Copy: c.DisableVpcClassicLinkDnsSupportRequest} } const opDisassociateAddress = "DisassociateAddress" @@ -10994,6 +11136,7 @@ const opDisassociateAddress = "DisassociateAddress" type DisassociateAddressRequest struct { *aws.Request Input *DisassociateAddressInput + Copy func(*DisassociateAddressInput) DisassociateAddressRequest } // Send marshals and sends the DisassociateAddress API request. @@ -11044,7 +11187,7 @@ func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) Disass req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisassociateAddressRequest{Request: req, Input: input} + return DisassociateAddressRequest{Request: req, Input: input, Copy: c.DisassociateAddressRequest} } const opDisassociateIamInstanceProfile = "DisassociateIamInstanceProfile" @@ -11053,6 +11196,7 @@ const opDisassociateIamInstanceProfile = "DisassociateIamInstanceProfile" type DisassociateIamInstanceProfileRequest struct { *aws.Request Input *DisassociateIamInstanceProfileInput + Copy func(*DisassociateIamInstanceProfileInput) DisassociateIamInstanceProfileRequest } // Send marshals and sends the DisassociateIamInstanceProfile API request. @@ -11095,7 +11239,7 @@ func (c *EC2) DisassociateIamInstanceProfileRequest(input *DisassociateIamInstan req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateIamInstanceProfileRequest{Request: req, Input: input} + return DisassociateIamInstanceProfileRequest{Request: req, Input: input, Copy: c.DisassociateIamInstanceProfileRequest} } const opDisassociateRouteTable = "DisassociateRouteTable" @@ -11104,6 +11248,7 @@ const opDisassociateRouteTable = "DisassociateRouteTable" type DisassociateRouteTableRequest struct { *aws.Request Input *DisassociateRouteTableInput + Copy func(*DisassociateRouteTableInput) DisassociateRouteTableRequest } // Send marshals and sends the DisassociateRouteTable API request. @@ -11151,7 +11296,7 @@ func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisassociateRouteTableRequest{Request: req, Input: input} + return DisassociateRouteTableRequest{Request: req, Input: input, Copy: c.DisassociateRouteTableRequest} } const opDisassociateSubnetCidrBlock = "DisassociateSubnetCidrBlock" @@ -11160,6 +11305,7 @@ const opDisassociateSubnetCidrBlock = "DisassociateSubnetCidrBlock" type DisassociateSubnetCidrBlockRequest struct { *aws.Request Input *DisassociateSubnetCidrBlockInput + Copy func(*DisassociateSubnetCidrBlockInput) DisassociateSubnetCidrBlockRequest } // Send marshals and sends the DisassociateSubnetCidrBlock API request. @@ -11202,7 +11348,7 @@ func (c *EC2) DisassociateSubnetCidrBlockRequest(input *DisassociateSubnetCidrBl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateSubnetCidrBlockRequest{Request: req, Input: input} + return DisassociateSubnetCidrBlockRequest{Request: req, Input: input, Copy: c.DisassociateSubnetCidrBlockRequest} } const opDisassociateVpcCidrBlock = "DisassociateVpcCidrBlock" @@ -11211,6 +11357,7 @@ const opDisassociateVpcCidrBlock = "DisassociateVpcCidrBlock" type DisassociateVpcCidrBlockRequest struct { *aws.Request Input *DisassociateVpcCidrBlockInput + Copy func(*DisassociateVpcCidrBlockInput) DisassociateVpcCidrBlockRequest } // Send marshals and sends the DisassociateVpcCidrBlock API request. @@ -11257,7 +11404,7 @@ func (c *EC2) DisassociateVpcCidrBlockRequest(input *DisassociateVpcCidrBlockInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateVpcCidrBlockRequest{Request: req, Input: input} + return DisassociateVpcCidrBlockRequest{Request: req, Input: input, Copy: c.DisassociateVpcCidrBlockRequest} } const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation" @@ -11266,6 +11413,7 @@ const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation" type EnableVgwRoutePropagationRequest struct { *aws.Request Input *EnableVgwRoutePropagationInput + Copy func(*EnableVgwRoutePropagationInput) EnableVgwRoutePropagationRequest } // Send marshals and sends the EnableVgwRoutePropagation API request. @@ -11309,7 +11457,7 @@ func (c *EC2) EnableVgwRoutePropagationRequest(input *EnableVgwRoutePropagationI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableVgwRoutePropagationRequest{Request: req, Input: input} + return EnableVgwRoutePropagationRequest{Request: req, Input: input, Copy: c.EnableVgwRoutePropagationRequest} } const opEnableVolumeIO = "EnableVolumeIO" @@ -11318,6 +11466,7 @@ const opEnableVolumeIO = "EnableVolumeIO" type EnableVolumeIORequest struct { *aws.Request Input *EnableVolumeIOInput + Copy func(*EnableVolumeIOInput) EnableVolumeIORequest } // Send marshals and sends the EnableVolumeIO API request. @@ -11361,7 +11510,7 @@ func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) EnableVolumeIORe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableVolumeIORequest{Request: req, Input: input} + return EnableVolumeIORequest{Request: req, Input: input, Copy: c.EnableVolumeIORequest} } const opEnableVpcClassicLink = "EnableVpcClassicLink" @@ -11370,6 +11519,7 @@ const opEnableVpcClassicLink = "EnableVpcClassicLink" type EnableVpcClassicLinkRequest struct { *aws.Request Input *EnableVpcClassicLinkInput + Copy func(*EnableVpcClassicLinkInput) EnableVpcClassicLinkRequest } // Send marshals and sends the EnableVpcClassicLink API request. @@ -11416,7 +11566,7 @@ func (c *EC2) EnableVpcClassicLinkRequest(input *EnableVpcClassicLinkInput) Enab req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableVpcClassicLinkRequest{Request: req, Input: input} + return EnableVpcClassicLinkRequest{Request: req, Input: input, Copy: c.EnableVpcClassicLinkRequest} } const opEnableVpcClassicLinkDnsSupport = "EnableVpcClassicLinkDnsSupport" @@ -11425,6 +11575,7 @@ const opEnableVpcClassicLinkDnsSupport = "EnableVpcClassicLinkDnsSupport" type EnableVpcClassicLinkDnsSupportRequest struct { *aws.Request Input *EnableVpcClassicLinkDnsSupportInput + Copy func(*EnableVpcClassicLinkDnsSupportInput) EnableVpcClassicLinkDnsSupportRequest } // Send marshals and sends the EnableVpcClassicLinkDnsSupport API request. @@ -11471,7 +11622,7 @@ func (c *EC2) EnableVpcClassicLinkDnsSupportRequest(input *EnableVpcClassicLinkD req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableVpcClassicLinkDnsSupportRequest{Request: req, Input: input} + return EnableVpcClassicLinkDnsSupportRequest{Request: req, Input: input, Copy: c.EnableVpcClassicLinkDnsSupportRequest} } const opGetConsoleOutput = "GetConsoleOutput" @@ -11480,6 +11631,7 @@ const opGetConsoleOutput = "GetConsoleOutput" type GetConsoleOutputRequest struct { *aws.Request Input *GetConsoleOutputInput + Copy func(*GetConsoleOutputInput) GetConsoleOutputRequest } // Send marshals and sends the GetConsoleOutput API request. @@ -11537,7 +11689,7 @@ func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) GetConsoleOu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetConsoleOutputRequest{Request: req, Input: input} + return GetConsoleOutputRequest{Request: req, Input: input, Copy: c.GetConsoleOutputRequest} } const opGetConsoleScreenshot = "GetConsoleScreenshot" @@ -11546,6 +11698,7 @@ const opGetConsoleScreenshot = "GetConsoleScreenshot" type GetConsoleScreenshotRequest struct { *aws.Request Input *GetConsoleScreenshotInput + Copy func(*GetConsoleScreenshotInput) GetConsoleScreenshotRequest } // Send marshals and sends the GetConsoleScreenshot API request. @@ -11588,7 +11741,7 @@ func (c *EC2) GetConsoleScreenshotRequest(input *GetConsoleScreenshotInput) GetC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetConsoleScreenshotRequest{Request: req, Input: input} + return GetConsoleScreenshotRequest{Request: req, Input: input, Copy: c.GetConsoleScreenshotRequest} } const opGetHostReservationPurchasePreview = "GetHostReservationPurchasePreview" @@ -11597,6 +11750,7 @@ const opGetHostReservationPurchasePreview = "GetHostReservationPurchasePreview" type GetHostReservationPurchasePreviewRequest struct { *aws.Request Input *GetHostReservationPurchasePreviewInput + Copy func(*GetHostReservationPurchasePreviewInput) GetHostReservationPurchasePreviewRequest } // Send marshals and sends the GetHostReservationPurchasePreview API request. @@ -11642,7 +11796,7 @@ func (c *EC2) GetHostReservationPurchasePreviewRequest(input *GetHostReservation req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHostReservationPurchasePreviewRequest{Request: req, Input: input} + return GetHostReservationPurchasePreviewRequest{Request: req, Input: input, Copy: c.GetHostReservationPurchasePreviewRequest} } const opGetLaunchTemplateData = "GetLaunchTemplateData" @@ -11651,6 +11805,7 @@ const opGetLaunchTemplateData = "GetLaunchTemplateData" type GetLaunchTemplateDataRequest struct { *aws.Request Input *GetLaunchTemplateDataInput + Copy func(*GetLaunchTemplateDataInput) GetLaunchTemplateDataRequest } // Send marshals and sends the GetLaunchTemplateData API request. @@ -11692,7 +11847,7 @@ func (c *EC2) GetLaunchTemplateDataRequest(input *GetLaunchTemplateDataInput) Ge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLaunchTemplateDataRequest{Request: req, Input: input} + return GetLaunchTemplateDataRequest{Request: req, Input: input, Copy: c.GetLaunchTemplateDataRequest} } const opGetPasswordData = "GetPasswordData" @@ -11701,6 +11856,7 @@ const opGetPasswordData = "GetPasswordData" type GetPasswordDataRequest struct { *aws.Request Input *GetPasswordDataInput + Copy func(*GetPasswordDataInput) GetPasswordDataRequest } // Send marshals and sends the GetPasswordData API request. @@ -11758,7 +11914,7 @@ func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) GetPasswordDat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPasswordDataRequest{Request: req, Input: input} + return GetPasswordDataRequest{Request: req, Input: input, Copy: c.GetPasswordDataRequest} } const opGetReservedInstancesExchangeQuote = "GetReservedInstancesExchangeQuote" @@ -11767,6 +11923,7 @@ const opGetReservedInstancesExchangeQuote = "GetReservedInstancesExchangeQuote" type GetReservedInstancesExchangeQuoteRequest struct { *aws.Request Input *GetReservedInstancesExchangeQuoteInput + Copy func(*GetReservedInstancesExchangeQuoteInput) GetReservedInstancesExchangeQuoteRequest } // Send marshals and sends the GetReservedInstancesExchangeQuote API request. @@ -11810,7 +11967,7 @@ func (c *EC2) GetReservedInstancesExchangeQuoteRequest(input *GetReservedInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetReservedInstancesExchangeQuoteRequest{Request: req, Input: input} + return GetReservedInstancesExchangeQuoteRequest{Request: req, Input: input, Copy: c.GetReservedInstancesExchangeQuoteRequest} } const opImportImage = "ImportImage" @@ -11819,6 +11976,7 @@ const opImportImage = "ImportImage" type ImportImageRequest struct { *aws.Request Input *ImportImageInput + Copy func(*ImportImageInput) ImportImageRequest } // Send marshals and sends the ImportImage API request. @@ -11862,7 +12020,7 @@ func (c *EC2) ImportImageRequest(input *ImportImageInput) ImportImageRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportImageRequest{Request: req, Input: input} + return ImportImageRequest{Request: req, Input: input, Copy: c.ImportImageRequest} } const opImportInstance = "ImportInstance" @@ -11871,6 +12029,7 @@ const opImportInstance = "ImportInstance" type ImportInstanceRequest struct { *aws.Request Input *ImportInstanceInput + Copy func(*ImportInstanceInput) ImportInstanceRequest } // Send marshals and sends the ImportInstance API request. @@ -11917,7 +12076,7 @@ func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) ImportInstanceRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportInstanceRequest{Request: req, Input: input} + return ImportInstanceRequest{Request: req, Input: input, Copy: c.ImportInstanceRequest} } const opImportKeyPair = "ImportKeyPair" @@ -11926,6 +12085,7 @@ const opImportKeyPair = "ImportKeyPair" type ImportKeyPairRequest struct { *aws.Request Input *ImportKeyPairInput + Copy func(*ImportKeyPairInput) ImportKeyPairRequest } // Send marshals and sends the ImportKeyPair API request. @@ -11973,7 +12133,7 @@ func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) ImportKeyPairReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportKeyPairRequest{Request: req, Input: input} + return ImportKeyPairRequest{Request: req, Input: input, Copy: c.ImportKeyPairRequest} } const opImportSnapshot = "ImportSnapshot" @@ -11982,6 +12142,7 @@ const opImportSnapshot = "ImportSnapshot" type ImportSnapshotRequest struct { *aws.Request Input *ImportSnapshotInput + Copy func(*ImportSnapshotInput) ImportSnapshotRequest } // Send marshals and sends the ImportSnapshot API request. @@ -12022,7 +12183,7 @@ func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) ImportSnapshotRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportSnapshotRequest{Request: req, Input: input} + return ImportSnapshotRequest{Request: req, Input: input, Copy: c.ImportSnapshotRequest} } const opImportVolume = "ImportVolume" @@ -12031,6 +12192,7 @@ const opImportVolume = "ImportVolume" type ImportVolumeRequest struct { *aws.Request Input *ImportVolumeInput + Copy func(*ImportVolumeInput) ImportVolumeRequest } // Send marshals and sends the ImportVolume API request. @@ -12075,7 +12237,7 @@ func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) ImportVolumeRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportVolumeRequest{Request: req, Input: input} + return ImportVolumeRequest{Request: req, Input: input, Copy: c.ImportVolumeRequest} } const opModifyFpgaImageAttribute = "ModifyFpgaImageAttribute" @@ -12084,6 +12246,7 @@ const opModifyFpgaImageAttribute = "ModifyFpgaImageAttribute" type ModifyFpgaImageAttributeRequest struct { *aws.Request Input *ModifyFpgaImageAttributeInput + Copy func(*ModifyFpgaImageAttributeInput) ModifyFpgaImageAttributeRequest } // Send marshals and sends the ModifyFpgaImageAttribute API request. @@ -12124,7 +12287,7 @@ func (c *EC2) ModifyFpgaImageAttributeRequest(input *ModifyFpgaImageAttributeInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyFpgaImageAttributeRequest{Request: req, Input: input} + return ModifyFpgaImageAttributeRequest{Request: req, Input: input, Copy: c.ModifyFpgaImageAttributeRequest} } const opModifyHosts = "ModifyHosts" @@ -12133,6 +12296,7 @@ const opModifyHosts = "ModifyHosts" type ModifyHostsRequest struct { *aws.Request Input *ModifyHostsInput + Copy func(*ModifyHostsInput) ModifyHostsRequest } // Send marshals and sends the ModifyHosts API request. @@ -12179,7 +12343,7 @@ func (c *EC2) ModifyHostsRequest(input *ModifyHostsInput) ModifyHostsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyHostsRequest{Request: req, Input: input} + return ModifyHostsRequest{Request: req, Input: input, Copy: c.ModifyHostsRequest} } const opModifyIdFormat = "ModifyIdFormat" @@ -12188,6 +12352,7 @@ const opModifyIdFormat = "ModifyIdFormat" type ModifyIdFormatRequest struct { *aws.Request Input *ModifyIdFormatInput + Copy func(*ModifyIdFormatInput) ModifyIdFormatRequest } // Send marshals and sends the ModifyIdFormat API request. @@ -12244,7 +12409,7 @@ func (c *EC2) ModifyIdFormatRequest(input *ModifyIdFormatInput) ModifyIdFormatRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyIdFormatRequest{Request: req, Input: input} + return ModifyIdFormatRequest{Request: req, Input: input, Copy: c.ModifyIdFormatRequest} } const opModifyIdentityIdFormat = "ModifyIdentityIdFormat" @@ -12253,6 +12418,7 @@ const opModifyIdentityIdFormat = "ModifyIdentityIdFormat" type ModifyIdentityIdFormatRequest struct { *aws.Request Input *ModifyIdentityIdFormatInput + Copy func(*ModifyIdentityIdFormatInput) ModifyIdentityIdFormatRequest } // Send marshals and sends the ModifyIdentityIdFormat API request. @@ -12309,7 +12475,7 @@ func (c *EC2) ModifyIdentityIdFormatRequest(input *ModifyIdentityIdFormatInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyIdentityIdFormatRequest{Request: req, Input: input} + return ModifyIdentityIdFormatRequest{Request: req, Input: input, Copy: c.ModifyIdentityIdFormatRequest} } const opModifyImageAttribute = "ModifyImageAttribute" @@ -12318,6 +12484,7 @@ const opModifyImageAttribute = "ModifyImageAttribute" type ModifyImageAttributeRequest struct { *aws.Request Input *ModifyImageAttributeInput + Copy func(*ModifyImageAttributeInput) ModifyImageAttributeRequest } // Send marshals and sends the ModifyImageAttribute API request. @@ -12369,7 +12536,7 @@ func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) Modi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyImageAttributeRequest{Request: req, Input: input} + return ModifyImageAttributeRequest{Request: req, Input: input, Copy: c.ModifyImageAttributeRequest} } const opModifyInstanceAttribute = "ModifyInstanceAttribute" @@ -12378,6 +12545,7 @@ const opModifyInstanceAttribute = "ModifyInstanceAttribute" type ModifyInstanceAttributeRequest struct { *aws.Request Input *ModifyInstanceAttributeInput + Copy func(*ModifyInstanceAttributeInput) ModifyInstanceAttributeRequest } // Send marshals and sends the ModifyInstanceAttribute API request. @@ -12425,7 +12593,7 @@ func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyInstanceAttributeRequest{Request: req, Input: input} + return ModifyInstanceAttributeRequest{Request: req, Input: input, Copy: c.ModifyInstanceAttributeRequest} } const opModifyInstanceCreditSpecification = "ModifyInstanceCreditSpecification" @@ -12434,6 +12602,7 @@ const opModifyInstanceCreditSpecification = "ModifyInstanceCreditSpecification" type ModifyInstanceCreditSpecificationRequest struct { *aws.Request Input *ModifyInstanceCreditSpecificationInput + Copy func(*ModifyInstanceCreditSpecificationInput) ModifyInstanceCreditSpecificationRequest } // Send marshals and sends the ModifyInstanceCreditSpecification API request. @@ -12478,7 +12647,7 @@ func (c *EC2) ModifyInstanceCreditSpecificationRequest(input *ModifyInstanceCred req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyInstanceCreditSpecificationRequest{Request: req, Input: input} + return ModifyInstanceCreditSpecificationRequest{Request: req, Input: input, Copy: c.ModifyInstanceCreditSpecificationRequest} } const opModifyInstancePlacement = "ModifyInstancePlacement" @@ -12487,6 +12656,7 @@ const opModifyInstancePlacement = "ModifyInstancePlacement" type ModifyInstancePlacementRequest struct { *aws.Request Input *ModifyInstancePlacementInput + Copy func(*ModifyInstancePlacementInput) ModifyInstancePlacementRequest } // Send marshals and sends the ModifyInstancePlacement API request. @@ -12545,7 +12715,7 @@ func (c *EC2) ModifyInstancePlacementRequest(input *ModifyInstancePlacementInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyInstancePlacementRequest{Request: req, Input: input} + return ModifyInstancePlacementRequest{Request: req, Input: input, Copy: c.ModifyInstancePlacementRequest} } const opModifyLaunchTemplate = "ModifyLaunchTemplate" @@ -12554,6 +12724,7 @@ const opModifyLaunchTemplate = "ModifyLaunchTemplate" type ModifyLaunchTemplateRequest struct { *aws.Request Input *ModifyLaunchTemplateInput + Copy func(*ModifyLaunchTemplateInput) ModifyLaunchTemplateRequest } // Send marshals and sends the ModifyLaunchTemplate API request. @@ -12596,7 +12767,7 @@ func (c *EC2) ModifyLaunchTemplateRequest(input *ModifyLaunchTemplateInput) Modi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyLaunchTemplateRequest{Request: req, Input: input} + return ModifyLaunchTemplateRequest{Request: req, Input: input, Copy: c.ModifyLaunchTemplateRequest} } const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" @@ -12605,6 +12776,7 @@ const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" type ModifyNetworkInterfaceAttributeRequest struct { *aws.Request Input *ModifyNetworkInterfaceAttributeInput + Copy func(*ModifyNetworkInterfaceAttributeInput) ModifyNetworkInterfaceAttributeRequest } // Send marshals and sends the ModifyNetworkInterfaceAttribute API request. @@ -12648,7 +12820,7 @@ func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfa req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyNetworkInterfaceAttributeRequest{Request: req, Input: input} + return ModifyNetworkInterfaceAttributeRequest{Request: req, Input: input, Copy: c.ModifyNetworkInterfaceAttributeRequest} } const opModifyReservedInstances = "ModifyReservedInstances" @@ -12657,6 +12829,7 @@ const opModifyReservedInstances = "ModifyReservedInstances" type ModifyReservedInstancesRequest struct { *aws.Request Input *ModifyReservedInstancesInput + Copy func(*ModifyReservedInstancesInput) ModifyReservedInstancesRequest } // Send marshals and sends the ModifyReservedInstances API request. @@ -12703,7 +12876,7 @@ func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyReservedInstancesRequest{Request: req, Input: input} + return ModifyReservedInstancesRequest{Request: req, Input: input, Copy: c.ModifyReservedInstancesRequest} } const opModifySnapshotAttribute = "ModifySnapshotAttribute" @@ -12712,6 +12885,7 @@ const opModifySnapshotAttribute = "ModifySnapshotAttribute" type ModifySnapshotAttributeRequest struct { *aws.Request Input *ModifySnapshotAttributeInput + Copy func(*ModifySnapshotAttributeInput) ModifySnapshotAttributeRequest } // Send marshals and sends the ModifySnapshotAttribute API request. @@ -12766,7 +12940,7 @@ func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifySnapshotAttributeRequest{Request: req, Input: input} + return ModifySnapshotAttributeRequest{Request: req, Input: input, Copy: c.ModifySnapshotAttributeRequest} } const opModifySpotFleetRequest = "ModifySpotFleetRequest" @@ -12775,6 +12949,7 @@ const opModifySpotFleetRequest = "ModifySpotFleetRequest" type ModifySpotFleetRequestRequest struct { *aws.Request Input *ModifySpotFleetRequestInput + Copy func(*ModifySpotFleetRequestInput) ModifySpotFleetRequestRequest } // Send marshals and sends the ModifySpotFleetRequest API request. @@ -12837,7 +13012,7 @@ func (c *EC2) ModifySpotFleetRequestRequest(input *ModifySpotFleetRequestInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifySpotFleetRequestRequest{Request: req, Input: input} + return ModifySpotFleetRequestRequest{Request: req, Input: input, Copy: c.ModifySpotFleetRequestRequest} } const opModifySubnetAttribute = "ModifySubnetAttribute" @@ -12846,6 +13021,7 @@ const opModifySubnetAttribute = "ModifySubnetAttribute" type ModifySubnetAttributeRequest struct { *aws.Request Input *ModifySubnetAttributeInput + Copy func(*ModifySubnetAttributeInput) ModifySubnetAttributeRequest } // Send marshals and sends the ModifySubnetAttribute API request. @@ -12888,7 +13064,7 @@ func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) Mo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifySubnetAttributeRequest{Request: req, Input: input} + return ModifySubnetAttributeRequest{Request: req, Input: input, Copy: c.ModifySubnetAttributeRequest} } const opModifyVolume = "ModifyVolume" @@ -12897,6 +13073,7 @@ const opModifyVolume = "ModifyVolume" type ModifyVolumeRequest struct { *aws.Request Input *ModifyVolumeInput + Copy func(*ModifyVolumeInput) ModifyVolumeRequest } // Send marshals and sends the ModifyVolume API request. @@ -12969,7 +13146,7 @@ func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) ModifyVolumeRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyVolumeRequest{Request: req, Input: input} + return ModifyVolumeRequest{Request: req, Input: input, Copy: c.ModifyVolumeRequest} } const opModifyVolumeAttribute = "ModifyVolumeAttribute" @@ -12978,6 +13155,7 @@ const opModifyVolumeAttribute = "ModifyVolumeAttribute" type ModifyVolumeAttributeRequest struct { *aws.Request Input *ModifyVolumeAttributeInput + Copy func(*ModifyVolumeAttributeInput) ModifyVolumeAttributeRequest } // Send marshals and sends the ModifyVolumeAttribute API request. @@ -13029,7 +13207,7 @@ func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) Mo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyVolumeAttributeRequest{Request: req, Input: input} + return ModifyVolumeAttributeRequest{Request: req, Input: input, Copy: c.ModifyVolumeAttributeRequest} } const opModifyVpcAttribute = "ModifyVpcAttribute" @@ -13038,6 +13216,7 @@ const opModifyVpcAttribute = "ModifyVpcAttribute" type ModifyVpcAttributeRequest struct { *aws.Request Input *ModifyVpcAttributeInput + Copy func(*ModifyVpcAttributeInput) ModifyVpcAttributeRequest } // Send marshals and sends the ModifyVpcAttribute API request. @@ -13080,7 +13259,7 @@ func (c *EC2) ModifyVpcAttributeRequest(input *ModifyVpcAttributeInput) ModifyVp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyVpcAttributeRequest{Request: req, Input: input} + return ModifyVpcAttributeRequest{Request: req, Input: input, Copy: c.ModifyVpcAttributeRequest} } const opModifyVpcEndpoint = "ModifyVpcEndpoint" @@ -13089,6 +13268,7 @@ const opModifyVpcEndpoint = "ModifyVpcEndpoint" type ModifyVpcEndpointRequest struct { *aws.Request Input *ModifyVpcEndpointInput + Copy func(*ModifyVpcEndpointInput) ModifyVpcEndpointRequest } // Send marshals and sends the ModifyVpcEndpoint API request. @@ -13132,7 +13312,7 @@ func (c *EC2) ModifyVpcEndpointRequest(input *ModifyVpcEndpointInput) ModifyVpcE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyVpcEndpointRequest{Request: req, Input: input} + return ModifyVpcEndpointRequest{Request: req, Input: input, Copy: c.ModifyVpcEndpointRequest} } const opModifyVpcEndpointConnectionNotification = "ModifyVpcEndpointConnectionNotification" @@ -13141,6 +13321,7 @@ const opModifyVpcEndpointConnectionNotification = "ModifyVpcEndpointConnectionNo type ModifyVpcEndpointConnectionNotificationRequest struct { *aws.Request Input *ModifyVpcEndpointConnectionNotificationInput + Copy func(*ModifyVpcEndpointConnectionNotificationInput) ModifyVpcEndpointConnectionNotificationRequest } // Send marshals and sends the ModifyVpcEndpointConnectionNotification API request. @@ -13183,7 +13364,7 @@ func (c *EC2) ModifyVpcEndpointConnectionNotificationRequest(input *ModifyVpcEnd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyVpcEndpointConnectionNotificationRequest{Request: req, Input: input} + return ModifyVpcEndpointConnectionNotificationRequest{Request: req, Input: input, Copy: c.ModifyVpcEndpointConnectionNotificationRequest} } const opModifyVpcEndpointServiceConfiguration = "ModifyVpcEndpointServiceConfiguration" @@ -13192,6 +13373,7 @@ const opModifyVpcEndpointServiceConfiguration = "ModifyVpcEndpointServiceConfigu type ModifyVpcEndpointServiceConfigurationRequest struct { *aws.Request Input *ModifyVpcEndpointServiceConfigurationInput + Copy func(*ModifyVpcEndpointServiceConfigurationInput) ModifyVpcEndpointServiceConfigurationRequest } // Send marshals and sends the ModifyVpcEndpointServiceConfiguration API request. @@ -13235,7 +13417,7 @@ func (c *EC2) ModifyVpcEndpointServiceConfigurationRequest(input *ModifyVpcEndpo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyVpcEndpointServiceConfigurationRequest{Request: req, Input: input} + return ModifyVpcEndpointServiceConfigurationRequest{Request: req, Input: input, Copy: c.ModifyVpcEndpointServiceConfigurationRequest} } const opModifyVpcEndpointServicePermissions = "ModifyVpcEndpointServicePermissions" @@ -13244,6 +13426,7 @@ const opModifyVpcEndpointServicePermissions = "ModifyVpcEndpointServicePermissio type ModifyVpcEndpointServicePermissionsRequest struct { *aws.Request Input *ModifyVpcEndpointServicePermissionsInput + Copy func(*ModifyVpcEndpointServicePermissionsInput) ModifyVpcEndpointServicePermissionsRequest } // Send marshals and sends the ModifyVpcEndpointServicePermissions API request. @@ -13286,7 +13469,7 @@ func (c *EC2) ModifyVpcEndpointServicePermissionsRequest(input *ModifyVpcEndpoin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyVpcEndpointServicePermissionsRequest{Request: req, Input: input} + return ModifyVpcEndpointServicePermissionsRequest{Request: req, Input: input, Copy: c.ModifyVpcEndpointServicePermissionsRequest} } const opModifyVpcPeeringConnectionOptions = "ModifyVpcPeeringConnectionOptions" @@ -13295,6 +13478,7 @@ const opModifyVpcPeeringConnectionOptions = "ModifyVpcPeeringConnectionOptions" type ModifyVpcPeeringConnectionOptionsRequest struct { *aws.Request Input *ModifyVpcPeeringConnectionOptionsInput + Copy func(*ModifyVpcPeeringConnectionOptionsInput) ModifyVpcPeeringConnectionOptionsRequest } // Send marshals and sends the ModifyVpcPeeringConnectionOptions API request. @@ -13354,7 +13538,7 @@ func (c *EC2) ModifyVpcPeeringConnectionOptionsRequest(input *ModifyVpcPeeringCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyVpcPeeringConnectionOptionsRequest{Request: req, Input: input} + return ModifyVpcPeeringConnectionOptionsRequest{Request: req, Input: input, Copy: c.ModifyVpcPeeringConnectionOptionsRequest} } const opModifyVpcTenancy = "ModifyVpcTenancy" @@ -13363,6 +13547,7 @@ const opModifyVpcTenancy = "ModifyVpcTenancy" type ModifyVpcTenancyRequest struct { *aws.Request Input *ModifyVpcTenancyInput + Copy func(*ModifyVpcTenancyInput) ModifyVpcTenancyRequest } // Send marshals and sends the ModifyVpcTenancy API request. @@ -13412,7 +13597,7 @@ func (c *EC2) ModifyVpcTenancyRequest(input *ModifyVpcTenancyInput) ModifyVpcTen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyVpcTenancyRequest{Request: req, Input: input} + return ModifyVpcTenancyRequest{Request: req, Input: input, Copy: c.ModifyVpcTenancyRequest} } const opMonitorInstances = "MonitorInstances" @@ -13421,6 +13606,7 @@ const opMonitorInstances = "MonitorInstances" type MonitorInstancesRequest struct { *aws.Request Input *MonitorInstancesInput + Copy func(*MonitorInstancesInput) MonitorInstancesRequest } // Send marshals and sends the MonitorInstances API request. @@ -13466,7 +13652,7 @@ func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) MonitorInsta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return MonitorInstancesRequest{Request: req, Input: input} + return MonitorInstancesRequest{Request: req, Input: input, Copy: c.MonitorInstancesRequest} } const opMoveAddressToVpc = "MoveAddressToVpc" @@ -13475,6 +13661,7 @@ const opMoveAddressToVpc = "MoveAddressToVpc" type MoveAddressToVpcRequest struct { *aws.Request Input *MoveAddressToVpcInput + Copy func(*MoveAddressToVpcInput) MoveAddressToVpcRequest } // Send marshals and sends the MoveAddressToVpc API request. @@ -13521,7 +13708,7 @@ func (c *EC2) MoveAddressToVpcRequest(input *MoveAddressToVpcInput) MoveAddressT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return MoveAddressToVpcRequest{Request: req, Input: input} + return MoveAddressToVpcRequest{Request: req, Input: input, Copy: c.MoveAddressToVpcRequest} } const opPurchaseHostReservation = "PurchaseHostReservation" @@ -13530,6 +13717,7 @@ const opPurchaseHostReservation = "PurchaseHostReservation" type PurchaseHostReservationRequest struct { *aws.Request Input *PurchaseHostReservationInput + Copy func(*PurchaseHostReservationInput) PurchaseHostReservationRequest } // Send marshals and sends the PurchaseHostReservation API request. @@ -13573,7 +13761,7 @@ func (c *EC2) PurchaseHostReservationRequest(input *PurchaseHostReservationInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PurchaseHostReservationRequest{Request: req, Input: input} + return PurchaseHostReservationRequest{Request: req, Input: input, Copy: c.PurchaseHostReservationRequest} } const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering" @@ -13582,6 +13770,7 @@ const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering" type PurchaseReservedInstancesOfferingRequest struct { *aws.Request Input *PurchaseReservedInstancesOfferingInput + Copy func(*PurchaseReservedInstancesOfferingInput) PurchaseReservedInstancesOfferingRequest } // Send marshals and sends the PurchaseReservedInstancesOffering API request. @@ -13631,7 +13820,7 @@ func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PurchaseReservedInstancesOfferingRequest{Request: req, Input: input} + return PurchaseReservedInstancesOfferingRequest{Request: req, Input: input, Copy: c.PurchaseReservedInstancesOfferingRequest} } const opPurchaseScheduledInstances = "PurchaseScheduledInstances" @@ -13640,6 +13829,7 @@ const opPurchaseScheduledInstances = "PurchaseScheduledInstances" type PurchaseScheduledInstancesRequest struct { *aws.Request Input *PurchaseScheduledInstancesInput + Copy func(*PurchaseScheduledInstancesInput) PurchaseScheduledInstancesRequest } // Send marshals and sends the PurchaseScheduledInstances API request. @@ -13689,7 +13879,7 @@ func (c *EC2) PurchaseScheduledInstancesRequest(input *PurchaseScheduledInstance req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PurchaseScheduledInstancesRequest{Request: req, Input: input} + return PurchaseScheduledInstancesRequest{Request: req, Input: input, Copy: c.PurchaseScheduledInstancesRequest} } const opRebootInstances = "RebootInstances" @@ -13698,6 +13888,7 @@ const opRebootInstances = "RebootInstances" type RebootInstancesRequest struct { *aws.Request Input *RebootInstancesInput + Copy func(*RebootInstancesInput) RebootInstancesRequest } // Send marshals and sends the RebootInstances API request. @@ -13750,7 +13941,7 @@ func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) RebootInstance req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RebootInstancesRequest{Request: req, Input: input} + return RebootInstancesRequest{Request: req, Input: input, Copy: c.RebootInstancesRequest} } const opRegisterImage = "RegisterImage" @@ -13759,6 +13950,7 @@ const opRegisterImage = "RegisterImage" type RegisterImageRequest struct { *aws.Request Input *RegisterImageInput + Copy func(*RegisterImageInput) RegisterImageRequest } // Send marshals and sends the RegisterImage API request. @@ -13827,7 +14019,7 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) RegisterImageReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterImageRequest{Request: req, Input: input} + return RegisterImageRequest{Request: req, Input: input, Copy: c.RegisterImageRequest} } const opRejectVpcEndpointConnections = "RejectVpcEndpointConnections" @@ -13836,6 +14028,7 @@ const opRejectVpcEndpointConnections = "RejectVpcEndpointConnections" type RejectVpcEndpointConnectionsRequest struct { *aws.Request Input *RejectVpcEndpointConnectionsInput + Copy func(*RejectVpcEndpointConnectionsInput) RejectVpcEndpointConnectionsRequest } // Send marshals and sends the RejectVpcEndpointConnections API request. @@ -13877,7 +14070,7 @@ func (c *EC2) RejectVpcEndpointConnectionsRequest(input *RejectVpcEndpointConnec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RejectVpcEndpointConnectionsRequest{Request: req, Input: input} + return RejectVpcEndpointConnectionsRequest{Request: req, Input: input, Copy: c.RejectVpcEndpointConnectionsRequest} } const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection" @@ -13886,6 +14079,7 @@ const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection" type RejectVpcPeeringConnectionRequest struct { *aws.Request Input *RejectVpcPeeringConnectionInput + Copy func(*RejectVpcPeeringConnectionInput) RejectVpcPeeringConnectionRequest } // Send marshals and sends the RejectVpcPeeringConnection API request. @@ -13930,7 +14124,7 @@ func (c *EC2) RejectVpcPeeringConnectionRequest(input *RejectVpcPeeringConnectio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RejectVpcPeeringConnectionRequest{Request: req, Input: input} + return RejectVpcPeeringConnectionRequest{Request: req, Input: input, Copy: c.RejectVpcPeeringConnectionRequest} } const opReleaseAddress = "ReleaseAddress" @@ -13939,6 +14133,7 @@ const opReleaseAddress = "ReleaseAddress" type ReleaseAddressRequest struct { *aws.Request Input *ReleaseAddressInput + Copy func(*ReleaseAddressInput) ReleaseAddressRequest } // Send marshals and sends the ReleaseAddress API request. @@ -13998,7 +14193,7 @@ func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) ReleaseAddressRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ReleaseAddressRequest{Request: req, Input: input} + return ReleaseAddressRequest{Request: req, Input: input, Copy: c.ReleaseAddressRequest} } const opReleaseHosts = "ReleaseHosts" @@ -14007,6 +14202,7 @@ const opReleaseHosts = "ReleaseHosts" type ReleaseHostsRequest struct { *aws.Request Input *ReleaseHostsInput + Copy func(*ReleaseHostsInput) ReleaseHostsRequest } // Send marshals and sends the ReleaseHosts API request. @@ -14058,7 +14254,7 @@ func (c *EC2) ReleaseHostsRequest(input *ReleaseHostsInput) ReleaseHostsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReleaseHostsRequest{Request: req, Input: input} + return ReleaseHostsRequest{Request: req, Input: input, Copy: c.ReleaseHostsRequest} } const opReplaceIamInstanceProfileAssociation = "ReplaceIamInstanceProfileAssociation" @@ -14067,6 +14263,7 @@ const opReplaceIamInstanceProfileAssociation = "ReplaceIamInstanceProfileAssocia type ReplaceIamInstanceProfileAssociationRequest struct { *aws.Request Input *ReplaceIamInstanceProfileAssociationInput + Copy func(*ReplaceIamInstanceProfileAssociationInput) ReplaceIamInstanceProfileAssociationRequest } // Send marshals and sends the ReplaceIamInstanceProfileAssociation API request. @@ -14112,7 +14309,7 @@ func (c *EC2) ReplaceIamInstanceProfileAssociationRequest(input *ReplaceIamInsta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReplaceIamInstanceProfileAssociationRequest{Request: req, Input: input} + return ReplaceIamInstanceProfileAssociationRequest{Request: req, Input: input, Copy: c.ReplaceIamInstanceProfileAssociationRequest} } const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" @@ -14121,6 +14318,7 @@ const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" type ReplaceNetworkAclAssociationRequest struct { *aws.Request Input *ReplaceNetworkAclAssociationInput + Copy func(*ReplaceNetworkAclAssociationInput) ReplaceNetworkAclAssociationRequest } // Send marshals and sends the ReplaceNetworkAclAssociation API request. @@ -14166,7 +14364,7 @@ func (c *EC2) ReplaceNetworkAclAssociationRequest(input *ReplaceNetworkAclAssoci req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReplaceNetworkAclAssociationRequest{Request: req, Input: input} + return ReplaceNetworkAclAssociationRequest{Request: req, Input: input, Copy: c.ReplaceNetworkAclAssociationRequest} } const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry" @@ -14175,6 +14373,7 @@ const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry" type ReplaceNetworkAclEntryRequest struct { *aws.Request Input *ReplaceNetworkAclEntryInput + Copy func(*ReplaceNetworkAclEntryInput) ReplaceNetworkAclEntryRequest } // Send marshals and sends the ReplaceNetworkAclEntry API request. @@ -14219,7 +14418,7 @@ func (c *EC2) ReplaceNetworkAclEntryRequest(input *ReplaceNetworkAclEntryInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ReplaceNetworkAclEntryRequest{Request: req, Input: input} + return ReplaceNetworkAclEntryRequest{Request: req, Input: input, Copy: c.ReplaceNetworkAclEntryRequest} } const opReplaceRoute = "ReplaceRoute" @@ -14228,6 +14427,7 @@ const opReplaceRoute = "ReplaceRoute" type ReplaceRouteRequest struct { *aws.Request Input *ReplaceRouteInput + Copy func(*ReplaceRouteInput) ReplaceRouteRequest } // Send marshals and sends the ReplaceRoute API request. @@ -14276,7 +14476,7 @@ func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) ReplaceRouteRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ReplaceRouteRequest{Request: req, Input: input} + return ReplaceRouteRequest{Request: req, Input: input, Copy: c.ReplaceRouteRequest} } const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation" @@ -14285,6 +14485,7 @@ const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation" type ReplaceRouteTableAssociationRequest struct { *aws.Request Input *ReplaceRouteTableAssociationInput + Copy func(*ReplaceRouteTableAssociationInput) ReplaceRouteTableAssociationRequest } // Send marshals and sends the ReplaceRouteTableAssociation API request. @@ -14333,7 +14534,7 @@ func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssoci req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReplaceRouteTableAssociationRequest{Request: req, Input: input} + return ReplaceRouteTableAssociationRequest{Request: req, Input: input, Copy: c.ReplaceRouteTableAssociationRequest} } const opReportInstanceStatus = "ReportInstanceStatus" @@ -14342,6 +14543,7 @@ const opReportInstanceStatus = "ReportInstanceStatus" type ReportInstanceStatusRequest struct { *aws.Request Input *ReportInstanceStatusInput + Copy func(*ReportInstanceStatusInput) ReportInstanceStatusRequest } // Send marshals and sends the ReportInstanceStatus API request. @@ -14390,7 +14592,7 @@ func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) Repo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ReportInstanceStatusRequest{Request: req, Input: input} + return ReportInstanceStatusRequest{Request: req, Input: input, Copy: c.ReportInstanceStatusRequest} } const opRequestSpotFleet = "RequestSpotFleet" @@ -14399,6 +14601,7 @@ const opRequestSpotFleet = "RequestSpotFleet" type RequestSpotFleetRequest struct { *aws.Request Input *RequestSpotFleetInput + Copy func(*RequestSpotFleetInput) RequestSpotFleetRequest } // Send marshals and sends the RequestSpotFleet API request. @@ -14458,7 +14661,7 @@ func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) RequestSpotF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RequestSpotFleetRequest{Request: req, Input: input} + return RequestSpotFleetRequest{Request: req, Input: input, Copy: c.RequestSpotFleetRequest} } const opRequestSpotInstances = "RequestSpotInstances" @@ -14467,6 +14670,7 @@ const opRequestSpotInstances = "RequestSpotInstances" type RequestSpotInstancesRequest struct { *aws.Request Input *RequestSpotInstancesInput + Copy func(*RequestSpotInstancesInput) RequestSpotInstancesRequest } // Send marshals and sends the RequestSpotInstances API request. @@ -14510,7 +14714,7 @@ func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) Requ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RequestSpotInstancesRequest{Request: req, Input: input} + return RequestSpotInstancesRequest{Request: req, Input: input, Copy: c.RequestSpotInstancesRequest} } const opResetFpgaImageAttribute = "ResetFpgaImageAttribute" @@ -14519,6 +14723,7 @@ const opResetFpgaImageAttribute = "ResetFpgaImageAttribute" type ResetFpgaImageAttributeRequest struct { *aws.Request Input *ResetFpgaImageAttributeInput + Copy func(*ResetFpgaImageAttributeInput) ResetFpgaImageAttributeRequest } // Send marshals and sends the ResetFpgaImageAttribute API request. @@ -14560,7 +14765,7 @@ func (c *EC2) ResetFpgaImageAttributeRequest(input *ResetFpgaImageAttributeInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetFpgaImageAttributeRequest{Request: req, Input: input} + return ResetFpgaImageAttributeRequest{Request: req, Input: input, Copy: c.ResetFpgaImageAttributeRequest} } const opResetImageAttribute = "ResetImageAttribute" @@ -14569,6 +14774,7 @@ const opResetImageAttribute = "ResetImageAttribute" type ResetImageAttributeRequest struct { *aws.Request Input *ResetImageAttributeInput + Copy func(*ResetImageAttributeInput) ResetImageAttributeRequest } // Send marshals and sends the ResetImageAttribute API request. @@ -14613,7 +14819,7 @@ func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) ResetI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ResetImageAttributeRequest{Request: req, Input: input} + return ResetImageAttributeRequest{Request: req, Input: input, Copy: c.ResetImageAttributeRequest} } const opResetInstanceAttribute = "ResetInstanceAttribute" @@ -14622,6 +14828,7 @@ const opResetInstanceAttribute = "ResetInstanceAttribute" type ResetInstanceAttributeRequest struct { *aws.Request Input *ResetInstanceAttributeInput + Copy func(*ResetInstanceAttributeInput) ResetInstanceAttributeRequest } // Send marshals and sends the ResetInstanceAttribute API request. @@ -14672,7 +14879,7 @@ func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ResetInstanceAttributeRequest{Request: req, Input: input} + return ResetInstanceAttributeRequest{Request: req, Input: input, Copy: c.ResetInstanceAttributeRequest} } const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute" @@ -14681,6 +14888,7 @@ const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute" type ResetNetworkInterfaceAttributeRequest struct { *aws.Request Input *ResetNetworkInterfaceAttributeInput + Copy func(*ResetNetworkInterfaceAttributeInput) ResetNetworkInterfaceAttributeRequest } // Send marshals and sends the ResetNetworkInterfaceAttribute API request. @@ -14724,7 +14932,7 @@ func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterface req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ResetNetworkInterfaceAttributeRequest{Request: req, Input: input} + return ResetNetworkInterfaceAttributeRequest{Request: req, Input: input, Copy: c.ResetNetworkInterfaceAttributeRequest} } const opResetSnapshotAttribute = "ResetSnapshotAttribute" @@ -14733,6 +14941,7 @@ const opResetSnapshotAttribute = "ResetSnapshotAttribute" type ResetSnapshotAttributeRequest struct { *aws.Request Input *ResetSnapshotAttributeInput + Copy func(*ResetSnapshotAttributeInput) ResetSnapshotAttributeRequest } // Send marshals and sends the ResetSnapshotAttribute API request. @@ -14779,7 +14988,7 @@ func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ResetSnapshotAttributeRequest{Request: req, Input: input} + return ResetSnapshotAttributeRequest{Request: req, Input: input, Copy: c.ResetSnapshotAttributeRequest} } const opRestoreAddressToClassic = "RestoreAddressToClassic" @@ -14788,6 +14997,7 @@ const opRestoreAddressToClassic = "RestoreAddressToClassic" type RestoreAddressToClassicRequest struct { *aws.Request Input *RestoreAddressToClassicInput + Copy func(*RestoreAddressToClassicInput) RestoreAddressToClassicRequest } // Send marshals and sends the RestoreAddressToClassic API request. @@ -14831,7 +15041,7 @@ func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreAddressToClassicRequest{Request: req, Input: input} + return RestoreAddressToClassicRequest{Request: req, Input: input, Copy: c.RestoreAddressToClassicRequest} } const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress" @@ -14840,6 +15050,7 @@ const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress" type RevokeSecurityGroupEgressRequest struct { *aws.Request Input *RevokeSecurityGroupEgressInput + Copy func(*RevokeSecurityGroupEgressInput) RevokeSecurityGroupEgressRequest } // Send marshals and sends the RevokeSecurityGroupEgress API request. @@ -14894,7 +15105,7 @@ func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RevokeSecurityGroupEgressRequest{Request: req, Input: input} + return RevokeSecurityGroupEgressRequest{Request: req, Input: input, Copy: c.RevokeSecurityGroupEgressRequest} } const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress" @@ -14903,6 +15114,7 @@ const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress" type RevokeSecurityGroupIngressRequest struct { *aws.Request Input *RevokeSecurityGroupIngressInput + Copy func(*RevokeSecurityGroupIngressInput) RevokeSecurityGroupIngressRequest } // Send marshals and sends the RevokeSecurityGroupIngress API request. @@ -14960,7 +15172,7 @@ func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngres req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RevokeSecurityGroupIngressRequest{Request: req, Input: input} + return RevokeSecurityGroupIngressRequest{Request: req, Input: input, Copy: c.RevokeSecurityGroupIngressRequest} } const opRunInstances = "RunInstances" @@ -14969,6 +15181,7 @@ const opRunInstances = "RunInstances" type RunInstancesRequest struct { *aws.Request Input *RunInstancesInput + Copy func(*RunInstancesInput) RunInstancesRequest } // Send marshals and sends the RunInstances API request. @@ -15062,7 +15275,7 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) RunInstancesRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RunInstancesRequest{Request: req, Input: input} + return RunInstancesRequest{Request: req, Input: input, Copy: c.RunInstancesRequest} } const opRunScheduledInstances = "RunScheduledInstances" @@ -15071,6 +15284,7 @@ const opRunScheduledInstances = "RunScheduledInstances" type RunScheduledInstancesRequest struct { *aws.Request Input *RunScheduledInstancesInput + Copy func(*RunScheduledInstancesInput) RunScheduledInstancesRequest } // Send marshals and sends the RunScheduledInstances API request. @@ -15121,7 +15335,7 @@ func (c *EC2) RunScheduledInstancesRequest(input *RunScheduledInstancesInput) Ru req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RunScheduledInstancesRequest{Request: req, Input: input} + return RunScheduledInstancesRequest{Request: req, Input: input, Copy: c.RunScheduledInstancesRequest} } const opStartInstances = "StartInstances" @@ -15130,6 +15344,7 @@ const opStartInstances = "StartInstances" type StartInstancesRequest struct { *aws.Request Input *StartInstancesInput + Copy func(*StartInstancesInput) StartInstancesRequest } // Send marshals and sends the StartInstances API request. @@ -15192,7 +15407,7 @@ func (c *EC2) StartInstancesRequest(input *StartInstancesInput) StartInstancesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartInstancesRequest{Request: req, Input: input} + return StartInstancesRequest{Request: req, Input: input, Copy: c.StartInstancesRequest} } const opStopInstances = "StopInstances" @@ -15201,6 +15416,7 @@ const opStopInstances = "StopInstances" type StopInstancesRequest struct { *aws.Request Input *StopInstancesInput + Copy func(*StopInstancesInput) StopInstancesRequest } // Send marshals and sends the StopInstances API request. @@ -15273,7 +15489,7 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) StopInstancesReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopInstancesRequest{Request: req, Input: input} + return StopInstancesRequest{Request: req, Input: input, Copy: c.StopInstancesRequest} } const opTerminateInstances = "TerminateInstances" @@ -15282,6 +15498,7 @@ const opTerminateInstances = "TerminateInstances" type TerminateInstancesRequest struct { *aws.Request Input *TerminateInstancesInput + Copy func(*TerminateInstancesInput) TerminateInstancesRequest } // Send marshals and sends the TerminateInstances API request. @@ -15346,7 +15563,7 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) Terminat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TerminateInstancesRequest{Request: req, Input: input} + return TerminateInstancesRequest{Request: req, Input: input, Copy: c.TerminateInstancesRequest} } const opUnassignIpv6Addresses = "UnassignIpv6Addresses" @@ -15355,6 +15572,7 @@ const opUnassignIpv6Addresses = "UnassignIpv6Addresses" type UnassignIpv6AddressesRequest struct { *aws.Request Input *UnassignIpv6AddressesInput + Copy func(*UnassignIpv6AddressesInput) UnassignIpv6AddressesRequest } // Send marshals and sends the UnassignIpv6Addresses API request. @@ -15395,7 +15613,7 @@ func (c *EC2) UnassignIpv6AddressesRequest(input *UnassignIpv6AddressesInput) Un req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UnassignIpv6AddressesRequest{Request: req, Input: input} + return UnassignIpv6AddressesRequest{Request: req, Input: input, Copy: c.UnassignIpv6AddressesRequest} } const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses" @@ -15404,6 +15622,7 @@ const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses" type UnassignPrivateIpAddressesRequest struct { *aws.Request Input *UnassignPrivateIpAddressesInput + Copy func(*UnassignPrivateIpAddressesInput) UnassignPrivateIpAddressesRequest } // Send marshals and sends the UnassignPrivateIpAddresses API request. @@ -15446,7 +15665,7 @@ func (c *EC2) UnassignPrivateIpAddressesRequest(input *UnassignPrivateIpAddresse req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UnassignPrivateIpAddressesRequest{Request: req, Input: input} + return UnassignPrivateIpAddressesRequest{Request: req, Input: input, Copy: c.UnassignPrivateIpAddressesRequest} } const opUnmonitorInstances = "UnmonitorInstances" @@ -15455,6 +15674,7 @@ const opUnmonitorInstances = "UnmonitorInstances" type UnmonitorInstancesRequest struct { *aws.Request Input *UnmonitorInstancesInput + Copy func(*UnmonitorInstancesInput) UnmonitorInstancesRequest } // Send marshals and sends the UnmonitorInstances API request. @@ -15497,7 +15717,7 @@ func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) Unmonito req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UnmonitorInstancesRequest{Request: req, Input: input} + return UnmonitorInstancesRequest{Request: req, Input: input, Copy: c.UnmonitorInstancesRequest} } const opUpdateSecurityGroupRuleDescriptionsEgress = "UpdateSecurityGroupRuleDescriptionsEgress" @@ -15506,6 +15726,7 @@ const opUpdateSecurityGroupRuleDescriptionsEgress = "UpdateSecurityGroupRuleDesc type UpdateSecurityGroupRuleDescriptionsEgressRequest struct { *aws.Request Input *UpdateSecurityGroupRuleDescriptionsEgressInput + Copy func(*UpdateSecurityGroupRuleDescriptionsEgressInput) UpdateSecurityGroupRuleDescriptionsEgressRequest } // Send marshals and sends the UpdateSecurityGroupRuleDescriptionsEgress API request. @@ -15552,7 +15773,7 @@ func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgressRequest(input *UpdateSecu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSecurityGroupRuleDescriptionsEgressRequest{Request: req, Input: input} + return UpdateSecurityGroupRuleDescriptionsEgressRequest{Request: req, Input: input, Copy: c.UpdateSecurityGroupRuleDescriptionsEgressRequest} } const opUpdateSecurityGroupRuleDescriptionsIngress = "UpdateSecurityGroupRuleDescriptionsIngress" @@ -15561,6 +15782,7 @@ const opUpdateSecurityGroupRuleDescriptionsIngress = "UpdateSecurityGroupRuleDes type UpdateSecurityGroupRuleDescriptionsIngressRequest struct { *aws.Request Input *UpdateSecurityGroupRuleDescriptionsIngressInput + Copy func(*UpdateSecurityGroupRuleDescriptionsIngressInput) UpdateSecurityGroupRuleDescriptionsIngressRequest } // Send marshals and sends the UpdateSecurityGroupRuleDescriptionsIngress API request. @@ -15607,7 +15829,7 @@ func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngressRequest(input *UpdateSec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSecurityGroupRuleDescriptionsIngressRequest{Request: req, Input: input} + return UpdateSecurityGroupRuleDescriptionsIngressRequest{Request: req, Input: input, Copy: c.UpdateSecurityGroupRuleDescriptionsIngressRequest} } // Contains the parameters for accepting the quote. diff --git a/service/ec2/ec2iface/interface.go b/service/ec2/ec2iface/interface.go index 004fef61e1a..ccfd60ec859 100644 --- a/service/ec2/ec2iface/interface.go +++ b/service/ec2/ec2iface/interface.go @@ -317,14 +317,8 @@ type EC2API interface { DescribeInstanceStatusRequest(*ec2.DescribeInstanceStatusInput) ec2.DescribeInstanceStatusRequest - DescribeInstanceStatusPages(*ec2.DescribeInstanceStatusInput, func(*ec2.DescribeInstanceStatusOutput, bool) bool) error - DescribeInstanceStatusPagesWithContext(aws.Context, *ec2.DescribeInstanceStatusInput, func(*ec2.DescribeInstanceStatusOutput, bool) bool, ...aws.Option) error - DescribeInstancesRequest(*ec2.DescribeInstancesInput) ec2.DescribeInstancesRequest - DescribeInstancesPages(*ec2.DescribeInstancesInput, func(*ec2.DescribeInstancesOutput, bool) bool) error - DescribeInstancesPagesWithContext(aws.Context, *ec2.DescribeInstancesInput, func(*ec2.DescribeInstancesOutput, bool) bool, ...aws.Option) error - DescribeInternetGatewaysRequest(*ec2.DescribeInternetGatewaysInput) ec2.DescribeInternetGatewaysRequest DescribeKeyPairsRequest(*ec2.DescribeKeyPairsInput) ec2.DescribeKeyPairsRequest @@ -337,9 +331,6 @@ type EC2API interface { DescribeNatGatewaysRequest(*ec2.DescribeNatGatewaysInput) ec2.DescribeNatGatewaysRequest - DescribeNatGatewaysPages(*ec2.DescribeNatGatewaysInput, func(*ec2.DescribeNatGatewaysOutput, bool) bool) error - DescribeNatGatewaysPagesWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, func(*ec2.DescribeNatGatewaysOutput, bool) bool, ...aws.Option) error - DescribeNetworkAclsRequest(*ec2.DescribeNetworkAclsInput) ec2.DescribeNetworkAclsRequest DescribeNetworkInterfaceAttributeRequest(*ec2.DescribeNetworkInterfaceAttributeInput) ec2.DescribeNetworkInterfaceAttributeRequest @@ -360,14 +351,8 @@ type EC2API interface { DescribeReservedInstancesModificationsRequest(*ec2.DescribeReservedInstancesModificationsInput) ec2.DescribeReservedInstancesModificationsRequest - DescribeReservedInstancesModificationsPages(*ec2.DescribeReservedInstancesModificationsInput, func(*ec2.DescribeReservedInstancesModificationsOutput, bool) bool) error - DescribeReservedInstancesModificationsPagesWithContext(aws.Context, *ec2.DescribeReservedInstancesModificationsInput, func(*ec2.DescribeReservedInstancesModificationsOutput, bool) bool, ...aws.Option) error - DescribeReservedInstancesOfferingsRequest(*ec2.DescribeReservedInstancesOfferingsInput) ec2.DescribeReservedInstancesOfferingsRequest - DescribeReservedInstancesOfferingsPages(*ec2.DescribeReservedInstancesOfferingsInput, func(*ec2.DescribeReservedInstancesOfferingsOutput, bool) bool) error - DescribeReservedInstancesOfferingsPagesWithContext(aws.Context, *ec2.DescribeReservedInstancesOfferingsInput, func(*ec2.DescribeReservedInstancesOfferingsOutput, bool) bool, ...aws.Option) error - DescribeRouteTablesRequest(*ec2.DescribeRouteTablesInput) ec2.DescribeRouteTablesRequest DescribeScheduledInstanceAvailabilityRequest(*ec2.DescribeScheduledInstanceAvailabilityInput) ec2.DescribeScheduledInstanceAvailabilityRequest @@ -382,9 +367,6 @@ type EC2API interface { DescribeSnapshotsRequest(*ec2.DescribeSnapshotsInput) ec2.DescribeSnapshotsRequest - DescribeSnapshotsPages(*ec2.DescribeSnapshotsInput, func(*ec2.DescribeSnapshotsOutput, bool) bool) error - DescribeSnapshotsPagesWithContext(aws.Context, *ec2.DescribeSnapshotsInput, func(*ec2.DescribeSnapshotsOutput, bool) bool, ...aws.Option) error - DescribeSpotDatafeedSubscriptionRequest(*ec2.DescribeSpotDatafeedSubscriptionInput) ec2.DescribeSpotDatafeedSubscriptionRequest DescribeSpotFleetInstancesRequest(*ec2.DescribeSpotFleetInstancesInput) ec2.DescribeSpotFleetInstancesRequest @@ -393,37 +375,22 @@ type EC2API interface { DescribeSpotFleetRequestsRequest(*ec2.DescribeSpotFleetRequestsInput) ec2.DescribeSpotFleetRequestsRequest - DescribeSpotFleetRequestsPages(*ec2.DescribeSpotFleetRequestsInput, func(*ec2.DescribeSpotFleetRequestsOutput, bool) bool) error - DescribeSpotFleetRequestsPagesWithContext(aws.Context, *ec2.DescribeSpotFleetRequestsInput, func(*ec2.DescribeSpotFleetRequestsOutput, bool) bool, ...aws.Option) error - DescribeSpotInstanceRequestsRequest(*ec2.DescribeSpotInstanceRequestsInput) ec2.DescribeSpotInstanceRequestsRequest DescribeSpotPriceHistoryRequest(*ec2.DescribeSpotPriceHistoryInput) ec2.DescribeSpotPriceHistoryRequest - DescribeSpotPriceHistoryPages(*ec2.DescribeSpotPriceHistoryInput, func(*ec2.DescribeSpotPriceHistoryOutput, bool) bool) error - DescribeSpotPriceHistoryPagesWithContext(aws.Context, *ec2.DescribeSpotPriceHistoryInput, func(*ec2.DescribeSpotPriceHistoryOutput, bool) bool, ...aws.Option) error - DescribeStaleSecurityGroupsRequest(*ec2.DescribeStaleSecurityGroupsInput) ec2.DescribeStaleSecurityGroupsRequest DescribeSubnetsRequest(*ec2.DescribeSubnetsInput) ec2.DescribeSubnetsRequest DescribeTagsRequest(*ec2.DescribeTagsInput) ec2.DescribeTagsRequest - DescribeTagsPages(*ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool) error - DescribeTagsPagesWithContext(aws.Context, *ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool, ...aws.Option) error - DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) ec2.DescribeVolumeAttributeRequest DescribeVolumeStatusRequest(*ec2.DescribeVolumeStatusInput) ec2.DescribeVolumeStatusRequest - DescribeVolumeStatusPages(*ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool) error - DescribeVolumeStatusPagesWithContext(aws.Context, *ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool, ...aws.Option) error - DescribeVolumesRequest(*ec2.DescribeVolumesInput) ec2.DescribeVolumesRequest - DescribeVolumesPages(*ec2.DescribeVolumesInput, func(*ec2.DescribeVolumesOutput, bool) bool) error - DescribeVolumesPagesWithContext(aws.Context, *ec2.DescribeVolumesInput, func(*ec2.DescribeVolumesOutput, bool) bool, ...aws.Option) error - DescribeVolumesModificationsRequest(*ec2.DescribeVolumesModificationsInput) ec2.DescribeVolumesModificationsRequest DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) ec2.DescribeVpcAttributeRequest diff --git a/service/ecr/api.go b/service/ecr/api.go index c7a1e4a6da3..e35d98b8119 100644 --- a/service/ecr/api.go +++ b/service/ecr/api.go @@ -15,6 +15,7 @@ const opBatchCheckLayerAvailability = "BatchCheckLayerAvailability" type BatchCheckLayerAvailabilityRequest struct { *aws.Request Input *BatchCheckLayerAvailabilityInput + Copy func(*BatchCheckLayerAvailabilityInput) BatchCheckLayerAvailabilityRequest } // Send marshals and sends the BatchCheckLayerAvailability API request. @@ -60,7 +61,7 @@ func (c *ECR) BatchCheckLayerAvailabilityRequest(input *BatchCheckLayerAvailabil req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchCheckLayerAvailabilityRequest{Request: req, Input: input} + return BatchCheckLayerAvailabilityRequest{Request: req, Input: input, Copy: c.BatchCheckLayerAvailabilityRequest} } const opBatchDeleteImage = "BatchDeleteImage" @@ -69,6 +70,7 @@ const opBatchDeleteImage = "BatchDeleteImage" type BatchDeleteImageRequest struct { *aws.Request Input *BatchDeleteImageInput + Copy func(*BatchDeleteImageInput) BatchDeleteImageRequest } // Send marshals and sends the BatchDeleteImage API request. @@ -117,7 +119,7 @@ func (c *ECR) BatchDeleteImageRequest(input *BatchDeleteImageInput) BatchDeleteI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchDeleteImageRequest{Request: req, Input: input} + return BatchDeleteImageRequest{Request: req, Input: input, Copy: c.BatchDeleteImageRequest} } const opBatchGetImage = "BatchGetImage" @@ -126,6 +128,7 @@ const opBatchGetImage = "BatchGetImage" type BatchGetImageRequest struct { *aws.Request Input *BatchGetImageInput + Copy func(*BatchGetImageInput) BatchGetImageRequest } // Send marshals and sends the BatchGetImage API request. @@ -167,7 +170,7 @@ func (c *ECR) BatchGetImageRequest(input *BatchGetImageInput) BatchGetImageReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetImageRequest{Request: req, Input: input} + return BatchGetImageRequest{Request: req, Input: input, Copy: c.BatchGetImageRequest} } const opCompleteLayerUpload = "CompleteLayerUpload" @@ -176,6 +179,7 @@ const opCompleteLayerUpload = "CompleteLayerUpload" type CompleteLayerUploadRequest struct { *aws.Request Input *CompleteLayerUploadInput + Copy func(*CompleteLayerUploadInput) CompleteLayerUploadRequest } // Send marshals and sends the CompleteLayerUpload API request. @@ -222,7 +226,7 @@ func (c *ECR) CompleteLayerUploadRequest(input *CompleteLayerUploadInput) Comple req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CompleteLayerUploadRequest{Request: req, Input: input} + return CompleteLayerUploadRequest{Request: req, Input: input, Copy: c.CompleteLayerUploadRequest} } const opCreateRepository = "CreateRepository" @@ -231,6 +235,7 @@ const opCreateRepository = "CreateRepository" type CreateRepositoryRequest struct { *aws.Request Input *CreateRepositoryInput + Copy func(*CreateRepositoryInput) CreateRepositoryRequest } // Send marshals and sends the CreateRepository API request. @@ -271,7 +276,7 @@ func (c *ECR) CreateRepositoryRequest(input *CreateRepositoryInput) CreateReposi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRepositoryRequest{Request: req, Input: input} + return CreateRepositoryRequest{Request: req, Input: input, Copy: c.CreateRepositoryRequest} } const opDeleteLifecyclePolicy = "DeleteLifecyclePolicy" @@ -280,6 +285,7 @@ const opDeleteLifecyclePolicy = "DeleteLifecyclePolicy" type DeleteLifecyclePolicyRequest struct { *aws.Request Input *DeleteLifecyclePolicyInput + Copy func(*DeleteLifecyclePolicyInput) DeleteLifecyclePolicyRequest } // Send marshals and sends the DeleteLifecyclePolicy API request. @@ -320,7 +326,7 @@ func (c *ECR) DeleteLifecyclePolicyRequest(input *DeleteLifecyclePolicyInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLifecyclePolicyRequest{Request: req, Input: input} + return DeleteLifecyclePolicyRequest{Request: req, Input: input, Copy: c.DeleteLifecyclePolicyRequest} } const opDeleteRepository = "DeleteRepository" @@ -329,6 +335,7 @@ const opDeleteRepository = "DeleteRepository" type DeleteRepositoryRequest struct { *aws.Request Input *DeleteRepositoryInput + Copy func(*DeleteRepositoryInput) DeleteRepositoryRequest } // Send marshals and sends the DeleteRepository API request. @@ -370,7 +377,7 @@ func (c *ECR) DeleteRepositoryRequest(input *DeleteRepositoryInput) DeleteReposi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRepositoryRequest{Request: req, Input: input} + return DeleteRepositoryRequest{Request: req, Input: input, Copy: c.DeleteRepositoryRequest} } const opDeleteRepositoryPolicy = "DeleteRepositoryPolicy" @@ -379,6 +386,7 @@ const opDeleteRepositoryPolicy = "DeleteRepositoryPolicy" type DeleteRepositoryPolicyRequest struct { *aws.Request Input *DeleteRepositoryPolicyInput + Copy func(*DeleteRepositoryPolicyInput) DeleteRepositoryPolicyRequest } // Send marshals and sends the DeleteRepositoryPolicy API request. @@ -419,7 +427,7 @@ func (c *ECR) DeleteRepositoryPolicyRequest(input *DeleteRepositoryPolicyInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRepositoryPolicyRequest{Request: req, Input: input} + return DeleteRepositoryPolicyRequest{Request: req, Input: input, Copy: c.DeleteRepositoryPolicyRequest} } const opDescribeImages = "DescribeImages" @@ -428,6 +436,7 @@ const opDescribeImages = "DescribeImages" type DescribeImagesRequest struct { *aws.Request Input *DescribeImagesInput + Copy func(*DescribeImagesInput) DescribeImagesRequest } // Send marshals and sends the DescribeImages API request. @@ -480,57 +489,53 @@ func (c *ECR) DescribeImagesRequest(input *DescribeImagesInput) DescribeImagesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeImagesRequest{Request: req, Input: input} + return DescribeImagesRequest{Request: req, Input: input, Copy: c.DescribeImagesRequest} } -// DescribeImagesPages iterates over the pages of a DescribeImages operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeImages method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeImagesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeImages operation. -// pageNum := 0 -// err := client.DescribeImagesPages(params, -// func(page *DescribeImagesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECR) DescribeImagesPages(input *DescribeImagesInput, fn func(*DescribeImagesOutput, bool) bool) error { - return c.DescribeImagesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeImagesPagesWithContext same as DescribeImagesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECR) DescribeImagesPagesWithContext(ctx aws.Context, input *DescribeImagesInput, fn func(*DescribeImagesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeImagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeImagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeImagesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeImagesRequest) Paginate(opts ...aws.Option) DescribeImagesPager { + return DescribeImagesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeImagesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeImagesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeImagesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeImagesPager struct { + aws.Pager +} + +func (p *DescribeImagesPager) CurrentPage() *DescribeImagesOutput { + return p.Pager.CurrentPage().(*DescribeImagesOutput) } const opDescribeRepositories = "DescribeRepositories" @@ -539,6 +544,7 @@ const opDescribeRepositories = "DescribeRepositories" type DescribeRepositoriesRequest struct { *aws.Request Input *DescribeRepositoriesInput + Copy func(*DescribeRepositoriesInput) DescribeRepositoriesRequest } // Send marshals and sends the DescribeRepositories API request. @@ -585,57 +591,53 @@ func (c *ECR) DescribeRepositoriesRequest(input *DescribeRepositoriesInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRepositoriesRequest{Request: req, Input: input} + return DescribeRepositoriesRequest{Request: req, Input: input, Copy: c.DescribeRepositoriesRequest} } -// DescribeRepositoriesPages iterates over the pages of a DescribeRepositories operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeRepositories method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeRepositoriesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeRepositories operation. -// pageNum := 0 -// err := client.DescribeRepositoriesPages(params, -// func(page *DescribeRepositoriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECR) DescribeRepositoriesPages(input *DescribeRepositoriesInput, fn func(*DescribeRepositoriesOutput, bool) bool) error { - return c.DescribeRepositoriesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeRepositoriesPagesWithContext same as DescribeRepositoriesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECR) DescribeRepositoriesPagesWithContext(ctx aws.Context, input *DescribeRepositoriesInput, fn func(*DescribeRepositoriesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeRepositoriesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeRepositoriesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeRepositoriesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeRepositoriesRequest) Paginate(opts ...aws.Option) DescribeRepositoriesPager { + return DescribeRepositoriesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeRepositoriesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeRepositoriesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeRepositoriesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeRepositoriesPager struct { + aws.Pager +} + +func (p *DescribeRepositoriesPager) CurrentPage() *DescribeRepositoriesOutput { + return p.Pager.CurrentPage().(*DescribeRepositoriesOutput) } const opGetAuthorizationToken = "GetAuthorizationToken" @@ -644,6 +646,7 @@ const opGetAuthorizationToken = "GetAuthorizationToken" type GetAuthorizationTokenRequest struct { *aws.Request Input *GetAuthorizationTokenInput + Copy func(*GetAuthorizationTokenInput) GetAuthorizationTokenRequest } // Send marshals and sends the GetAuthorizationToken API request. @@ -691,7 +694,7 @@ func (c *ECR) GetAuthorizationTokenRequest(input *GetAuthorizationTokenInput) Ge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAuthorizationTokenRequest{Request: req, Input: input} + return GetAuthorizationTokenRequest{Request: req, Input: input, Copy: c.GetAuthorizationTokenRequest} } const opGetDownloadUrlForLayer = "GetDownloadUrlForLayer" @@ -700,6 +703,7 @@ const opGetDownloadUrlForLayer = "GetDownloadUrlForLayer" type GetDownloadUrlForLayerRequest struct { *aws.Request Input *GetDownloadUrlForLayerInput + Copy func(*GetDownloadUrlForLayerInput) GetDownloadUrlForLayerRequest } // Send marshals and sends the GetDownloadUrlForLayer API request. @@ -745,7 +749,7 @@ func (c *ECR) GetDownloadUrlForLayerRequest(input *GetDownloadUrlForLayerInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDownloadUrlForLayerRequest{Request: req, Input: input} + return GetDownloadUrlForLayerRequest{Request: req, Input: input, Copy: c.GetDownloadUrlForLayerRequest} } const opGetLifecyclePolicy = "GetLifecyclePolicy" @@ -754,6 +758,7 @@ const opGetLifecyclePolicy = "GetLifecyclePolicy" type GetLifecyclePolicyRequest struct { *aws.Request Input *GetLifecyclePolicyInput + Copy func(*GetLifecyclePolicyInput) GetLifecyclePolicyRequest } // Send marshals and sends the GetLifecyclePolicy API request. @@ -794,7 +799,7 @@ func (c *ECR) GetLifecyclePolicyRequest(input *GetLifecyclePolicyInput) GetLifec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLifecyclePolicyRequest{Request: req, Input: input} + return GetLifecyclePolicyRequest{Request: req, Input: input, Copy: c.GetLifecyclePolicyRequest} } const opGetLifecyclePolicyPreview = "GetLifecyclePolicyPreview" @@ -803,6 +808,7 @@ const opGetLifecyclePolicyPreview = "GetLifecyclePolicyPreview" type GetLifecyclePolicyPreviewRequest struct { *aws.Request Input *GetLifecyclePolicyPreviewInput + Copy func(*GetLifecyclePolicyPreviewInput) GetLifecyclePolicyPreviewRequest } // Send marshals and sends the GetLifecyclePolicyPreview API request. @@ -843,7 +849,7 @@ func (c *ECR) GetLifecyclePolicyPreviewRequest(input *GetLifecyclePolicyPreviewI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLifecyclePolicyPreviewRequest{Request: req, Input: input} + return GetLifecyclePolicyPreviewRequest{Request: req, Input: input, Copy: c.GetLifecyclePolicyPreviewRequest} } const opGetRepositoryPolicy = "GetRepositoryPolicy" @@ -852,6 +858,7 @@ const opGetRepositoryPolicy = "GetRepositoryPolicy" type GetRepositoryPolicyRequest struct { *aws.Request Input *GetRepositoryPolicyInput + Copy func(*GetRepositoryPolicyInput) GetRepositoryPolicyRequest } // Send marshals and sends the GetRepositoryPolicy API request. @@ -892,7 +899,7 @@ func (c *ECR) GetRepositoryPolicyRequest(input *GetRepositoryPolicyInput) GetRep req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRepositoryPolicyRequest{Request: req, Input: input} + return GetRepositoryPolicyRequest{Request: req, Input: input, Copy: c.GetRepositoryPolicyRequest} } const opInitiateLayerUpload = "InitiateLayerUpload" @@ -901,6 +908,7 @@ const opInitiateLayerUpload = "InitiateLayerUpload" type InitiateLayerUploadRequest struct { *aws.Request Input *InitiateLayerUploadInput + Copy func(*InitiateLayerUploadInput) InitiateLayerUploadRequest } // Send marshals and sends the InitiateLayerUpload API request. @@ -945,7 +953,7 @@ func (c *ECR) InitiateLayerUploadRequest(input *InitiateLayerUploadInput) Initia req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InitiateLayerUploadRequest{Request: req, Input: input} + return InitiateLayerUploadRequest{Request: req, Input: input, Copy: c.InitiateLayerUploadRequest} } const opListImages = "ListImages" @@ -954,6 +962,7 @@ const opListImages = "ListImages" type ListImagesRequest struct { *aws.Request Input *ListImagesInput + Copy func(*ListImagesInput) ListImagesRequest } // Send marshals and sends the ListImages API request. @@ -1006,57 +1015,53 @@ func (c *ECR) ListImagesRequest(input *ListImagesInput) ListImagesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListImagesRequest{Request: req, Input: input} + return ListImagesRequest{Request: req, Input: input, Copy: c.ListImagesRequest} } -// ListImagesPages iterates over the pages of a ListImages operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListImages method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListImagesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListImages operation. -// pageNum := 0 -// err := client.ListImagesPages(params, -// func(page *ListImagesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECR) ListImagesPages(input *ListImagesInput, fn func(*ListImagesOutput, bool) bool) error { - return c.ListImagesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListImagesPagesWithContext same as ListImagesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECR) ListImagesPagesWithContext(ctx aws.Context, input *ListImagesInput, fn func(*ListImagesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListImagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListImagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListImagesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListImagesRequest) Paginate(opts ...aws.Option) ListImagesPager { + return ListImagesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListImagesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListImagesOutput), !p.HasNextPage()) - } - return p.Err() +// ListImagesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListImagesPager struct { + aws.Pager +} + +func (p *ListImagesPager) CurrentPage() *ListImagesOutput { + return p.Pager.CurrentPage().(*ListImagesOutput) } const opPutImage = "PutImage" @@ -1065,6 +1070,7 @@ const opPutImage = "PutImage" type PutImageRequest struct { *aws.Request Input *PutImageInput + Copy func(*PutImageInput) PutImageRequest } // Send marshals and sends the PutImage API request. @@ -1109,7 +1115,7 @@ func (c *ECR) PutImageRequest(input *PutImageInput) PutImageRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutImageRequest{Request: req, Input: input} + return PutImageRequest{Request: req, Input: input, Copy: c.PutImageRequest} } const opPutLifecyclePolicy = "PutLifecyclePolicy" @@ -1118,6 +1124,7 @@ const opPutLifecyclePolicy = "PutLifecyclePolicy" type PutLifecyclePolicyRequest struct { *aws.Request Input *PutLifecyclePolicyInput + Copy func(*PutLifecyclePolicyInput) PutLifecyclePolicyRequest } // Send marshals and sends the PutLifecyclePolicy API request. @@ -1158,7 +1165,7 @@ func (c *ECR) PutLifecyclePolicyRequest(input *PutLifecyclePolicyInput) PutLifec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutLifecyclePolicyRequest{Request: req, Input: input} + return PutLifecyclePolicyRequest{Request: req, Input: input, Copy: c.PutLifecyclePolicyRequest} } const opSetRepositoryPolicy = "SetRepositoryPolicy" @@ -1167,6 +1174,7 @@ const opSetRepositoryPolicy = "SetRepositoryPolicy" type SetRepositoryPolicyRequest struct { *aws.Request Input *SetRepositoryPolicyInput + Copy func(*SetRepositoryPolicyInput) SetRepositoryPolicyRequest } // Send marshals and sends the SetRepositoryPolicy API request. @@ -1207,7 +1215,7 @@ func (c *ECR) SetRepositoryPolicyRequest(input *SetRepositoryPolicyInput) SetRep req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetRepositoryPolicyRequest{Request: req, Input: input} + return SetRepositoryPolicyRequest{Request: req, Input: input, Copy: c.SetRepositoryPolicyRequest} } const opStartLifecyclePolicyPreview = "StartLifecyclePolicyPreview" @@ -1216,6 +1224,7 @@ const opStartLifecyclePolicyPreview = "StartLifecyclePolicyPreview" type StartLifecyclePolicyPreviewRequest struct { *aws.Request Input *StartLifecyclePolicyPreviewInput + Copy func(*StartLifecyclePolicyPreviewInput) StartLifecyclePolicyPreviewRequest } // Send marshals and sends the StartLifecyclePolicyPreview API request. @@ -1257,7 +1266,7 @@ func (c *ECR) StartLifecyclePolicyPreviewRequest(input *StartLifecyclePolicyPrev req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartLifecyclePolicyPreviewRequest{Request: req, Input: input} + return StartLifecyclePolicyPreviewRequest{Request: req, Input: input, Copy: c.StartLifecyclePolicyPreviewRequest} } const opUploadLayerPart = "UploadLayerPart" @@ -1266,6 +1275,7 @@ const opUploadLayerPart = "UploadLayerPart" type UploadLayerPartRequest struct { *aws.Request Input *UploadLayerPartInput + Copy func(*UploadLayerPartInput) UploadLayerPartRequest } // Send marshals and sends the UploadLayerPart API request. @@ -1310,7 +1320,7 @@ func (c *ECR) UploadLayerPartRequest(input *UploadLayerPartInput) UploadLayerPar req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UploadLayerPartRequest{Request: req, Input: input} + return UploadLayerPartRequest{Request: req, Input: input, Copy: c.UploadLayerPartRequest} } // An object representing authorization data for an Amazon ECR registry. diff --git a/service/ecr/ecriface/interface.go b/service/ecr/ecriface/interface.go index baa5a0b2894..7064a3b6cd9 100644 --- a/service/ecr/ecriface/interface.go +++ b/service/ecr/ecriface/interface.go @@ -9,7 +9,6 @@ package ecriface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ecr" ) @@ -81,14 +80,8 @@ type ECRAPI interface { DescribeImagesRequest(*ecr.DescribeImagesInput) ecr.DescribeImagesRequest - DescribeImagesPages(*ecr.DescribeImagesInput, func(*ecr.DescribeImagesOutput, bool) bool) error - DescribeImagesPagesWithContext(aws.Context, *ecr.DescribeImagesInput, func(*ecr.DescribeImagesOutput, bool) bool, ...aws.Option) error - DescribeRepositoriesRequest(*ecr.DescribeRepositoriesInput) ecr.DescribeRepositoriesRequest - DescribeRepositoriesPages(*ecr.DescribeRepositoriesInput, func(*ecr.DescribeRepositoriesOutput, bool) bool) error - DescribeRepositoriesPagesWithContext(aws.Context, *ecr.DescribeRepositoriesInput, func(*ecr.DescribeRepositoriesOutput, bool) bool, ...aws.Option) error - GetAuthorizationTokenRequest(*ecr.GetAuthorizationTokenInput) ecr.GetAuthorizationTokenRequest GetDownloadUrlForLayerRequest(*ecr.GetDownloadUrlForLayerInput) ecr.GetDownloadUrlForLayerRequest @@ -103,9 +96,6 @@ type ECRAPI interface { ListImagesRequest(*ecr.ListImagesInput) ecr.ListImagesRequest - ListImagesPages(*ecr.ListImagesInput, func(*ecr.ListImagesOutput, bool) bool) error - ListImagesPagesWithContext(aws.Context, *ecr.ListImagesInput, func(*ecr.ListImagesOutput, bool) bool, ...aws.Option) error - PutImageRequest(*ecr.PutImageInput) ecr.PutImageRequest PutLifecyclePolicyRequest(*ecr.PutLifecyclePolicyInput) ecr.PutLifecyclePolicyRequest diff --git a/service/ecs/api.go b/service/ecs/api.go index 563fa4ef66f..342962358ea 100644 --- a/service/ecs/api.go +++ b/service/ecs/api.go @@ -16,6 +16,7 @@ const opCreateCluster = "CreateCluster" type CreateClusterRequest struct { *aws.Request Input *CreateClusterInput + Copy func(*CreateClusterInput) CreateClusterRequest } // Send marshals and sends the CreateCluster API request. @@ -66,7 +67,7 @@ func (c *ECS) CreateClusterRequest(input *CreateClusterInput) CreateClusterReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClusterRequest{Request: req, Input: input} + return CreateClusterRequest{Request: req, Input: input, Copy: c.CreateClusterRequest} } const opCreateService = "CreateService" @@ -75,6 +76,7 @@ const opCreateService = "CreateService" type CreateServiceRequest struct { *aws.Request Input *CreateServiceInput + Copy func(*CreateServiceInput) CreateServiceRequest } // Send marshals and sends the CreateService API request. @@ -173,7 +175,7 @@ func (c *ECS) CreateServiceRequest(input *CreateServiceInput) CreateServiceReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateServiceRequest{Request: req, Input: input} + return CreateServiceRequest{Request: req, Input: input, Copy: c.CreateServiceRequest} } const opDeleteAttributes = "DeleteAttributes" @@ -182,6 +184,7 @@ const opDeleteAttributes = "DeleteAttributes" type DeleteAttributesRequest struct { *aws.Request Input *DeleteAttributesInput + Copy func(*DeleteAttributesInput) DeleteAttributesRequest } // Send marshals and sends the DeleteAttributes API request. @@ -222,7 +225,7 @@ func (c *ECS) DeleteAttributesRequest(input *DeleteAttributesInput) DeleteAttrib req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteAttributesRequest{Request: req, Input: input} + return DeleteAttributesRequest{Request: req, Input: input, Copy: c.DeleteAttributesRequest} } const opDeleteCluster = "DeleteCluster" @@ -231,6 +234,7 @@ const opDeleteCluster = "DeleteCluster" type DeleteClusterRequest struct { *aws.Request Input *DeleteClusterInput + Copy func(*DeleteClusterInput) DeleteClusterRequest } // Send marshals and sends the DeleteCluster API request. @@ -273,7 +277,7 @@ func (c *ECS) DeleteClusterRequest(input *DeleteClusterInput) DeleteClusterReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteClusterRequest{Request: req, Input: input} + return DeleteClusterRequest{Request: req, Input: input, Copy: c.DeleteClusterRequest} } const opDeleteService = "DeleteService" @@ -282,6 +286,7 @@ const opDeleteService = "DeleteService" type DeleteServiceRequest struct { *aws.Request Input *DeleteServiceInput + Copy func(*DeleteServiceInput) DeleteServiceRequest } // Send marshals and sends the DeleteService API request. @@ -335,7 +340,7 @@ func (c *ECS) DeleteServiceRequest(input *DeleteServiceInput) DeleteServiceReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteServiceRequest{Request: req, Input: input} + return DeleteServiceRequest{Request: req, Input: input, Copy: c.DeleteServiceRequest} } const opDeregisterContainerInstance = "DeregisterContainerInstance" @@ -344,6 +349,7 @@ const opDeregisterContainerInstance = "DeregisterContainerInstance" type DeregisterContainerInstanceRequest struct { *aws.Request Input *DeregisterContainerInstanceInput + Copy func(*DeregisterContainerInstanceInput) DeregisterContainerInstanceRequest } // Send marshals and sends the DeregisterContainerInstance API request. @@ -398,7 +404,7 @@ func (c *ECS) DeregisterContainerInstanceRequest(input *DeregisterContainerInsta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterContainerInstanceRequest{Request: req, Input: input} + return DeregisterContainerInstanceRequest{Request: req, Input: input, Copy: c.DeregisterContainerInstanceRequest} } const opDeregisterTaskDefinition = "DeregisterTaskDefinition" @@ -407,6 +413,7 @@ const opDeregisterTaskDefinition = "DeregisterTaskDefinition" type DeregisterTaskDefinitionRequest struct { *aws.Request Input *DeregisterTaskDefinitionInput + Copy func(*DeregisterTaskDefinitionInput) DeregisterTaskDefinitionRequest } // Send marshals and sends the DeregisterTaskDefinition API request. @@ -461,7 +468,7 @@ func (c *ECS) DeregisterTaskDefinitionRequest(input *DeregisterTaskDefinitionInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterTaskDefinitionRequest{Request: req, Input: input} + return DeregisterTaskDefinitionRequest{Request: req, Input: input, Copy: c.DeregisterTaskDefinitionRequest} } const opDescribeClusters = "DescribeClusters" @@ -470,6 +477,7 @@ const opDescribeClusters = "DescribeClusters" type DescribeClustersRequest struct { *aws.Request Input *DescribeClustersInput + Copy func(*DescribeClustersInput) DescribeClustersRequest } // Send marshals and sends the DescribeClusters API request. @@ -510,7 +518,7 @@ func (c *ECS) DescribeClustersRequest(input *DescribeClustersInput) DescribeClus req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClustersRequest{Request: req, Input: input} + return DescribeClustersRequest{Request: req, Input: input, Copy: c.DescribeClustersRequest} } const opDescribeContainerInstances = "DescribeContainerInstances" @@ -519,6 +527,7 @@ const opDescribeContainerInstances = "DescribeContainerInstances" type DescribeContainerInstancesRequest struct { *aws.Request Input *DescribeContainerInstancesInput + Copy func(*DescribeContainerInstancesInput) DescribeContainerInstancesRequest } // Send marshals and sends the DescribeContainerInstances API request. @@ -560,7 +569,7 @@ func (c *ECS) DescribeContainerInstancesRequest(input *DescribeContainerInstance req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeContainerInstancesRequest{Request: req, Input: input} + return DescribeContainerInstancesRequest{Request: req, Input: input, Copy: c.DescribeContainerInstancesRequest} } const opDescribeServices = "DescribeServices" @@ -569,6 +578,7 @@ const opDescribeServices = "DescribeServices" type DescribeServicesRequest struct { *aws.Request Input *DescribeServicesInput + Copy func(*DescribeServicesInput) DescribeServicesRequest } // Send marshals and sends the DescribeServices API request. @@ -609,7 +619,7 @@ func (c *ECS) DescribeServicesRequest(input *DescribeServicesInput) DescribeServ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeServicesRequest{Request: req, Input: input} + return DescribeServicesRequest{Request: req, Input: input, Copy: c.DescribeServicesRequest} } const opDescribeTaskDefinition = "DescribeTaskDefinition" @@ -618,6 +628,7 @@ const opDescribeTaskDefinition = "DescribeTaskDefinition" type DescribeTaskDefinitionRequest struct { *aws.Request Input *DescribeTaskDefinitionInput + Copy func(*DescribeTaskDefinitionInput) DescribeTaskDefinitionRequest } // Send marshals and sends the DescribeTaskDefinition API request. @@ -663,7 +674,7 @@ func (c *ECS) DescribeTaskDefinitionRequest(input *DescribeTaskDefinitionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTaskDefinitionRequest{Request: req, Input: input} + return DescribeTaskDefinitionRequest{Request: req, Input: input, Copy: c.DescribeTaskDefinitionRequest} } const opDescribeTasks = "DescribeTasks" @@ -672,6 +683,7 @@ const opDescribeTasks = "DescribeTasks" type DescribeTasksRequest struct { *aws.Request Input *DescribeTasksInput + Copy func(*DescribeTasksInput) DescribeTasksRequest } // Send marshals and sends the DescribeTasks API request. @@ -712,7 +724,7 @@ func (c *ECS) DescribeTasksRequest(input *DescribeTasksInput) DescribeTasksReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTasksRequest{Request: req, Input: input} + return DescribeTasksRequest{Request: req, Input: input, Copy: c.DescribeTasksRequest} } const opDiscoverPollEndpoint = "DiscoverPollEndpoint" @@ -721,6 +733,7 @@ const opDiscoverPollEndpoint = "DiscoverPollEndpoint" type DiscoverPollEndpointRequest struct { *aws.Request Input *DiscoverPollEndpointInput + Copy func(*DiscoverPollEndpointInput) DiscoverPollEndpointRequest } // Send marshals and sends the DiscoverPollEndpoint API request. @@ -764,7 +777,7 @@ func (c *ECS) DiscoverPollEndpointRequest(input *DiscoverPollEndpointInput) Disc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DiscoverPollEndpointRequest{Request: req, Input: input} + return DiscoverPollEndpointRequest{Request: req, Input: input, Copy: c.DiscoverPollEndpointRequest} } const opListAttributes = "ListAttributes" @@ -773,6 +786,7 @@ const opListAttributes = "ListAttributes" type ListAttributesRequest struct { *aws.Request Input *ListAttributesInput + Copy func(*ListAttributesInput) ListAttributesRequest } // Send marshals and sends the ListAttributes API request. @@ -819,7 +833,7 @@ func (c *ECS) ListAttributesRequest(input *ListAttributesInput) ListAttributesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAttributesRequest{Request: req, Input: input} + return ListAttributesRequest{Request: req, Input: input, Copy: c.ListAttributesRequest} } const opListClusters = "ListClusters" @@ -828,6 +842,7 @@ const opListClusters = "ListClusters" type ListClustersRequest struct { *aws.Request Input *ListClustersInput + Copy func(*ListClustersInput) ListClustersRequest } // Send marshals and sends the ListClusters API request. @@ -874,57 +889,53 @@ func (c *ECS) ListClustersRequest(input *ListClustersInput) ListClustersRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListClustersRequest{Request: req, Input: input} + return ListClustersRequest{Request: req, Input: input, Copy: c.ListClustersRequest} } -// ListClustersPages iterates over the pages of a ListClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListClusters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListClustersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListClusters operation. -// pageNum := 0 -// err := client.ListClustersPages(params, -// func(page *ListClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListClustersPages(input *ListClustersInput, fn func(*ListClustersOutput, bool) bool) error { - return c.ListClustersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListClustersPagesWithContext same as ListClustersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListClustersPagesWithContext(ctx aws.Context, input *ListClustersInput, fn func(*ListClustersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListClustersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListClustersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListClustersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListClustersRequest) Paginate(opts ...aws.Option) ListClustersPager { + return ListClustersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListClustersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) - } - return p.Err() +// ListClustersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListClustersPager struct { + aws.Pager +} + +func (p *ListClustersPager) CurrentPage() *ListClustersOutput { + return p.Pager.CurrentPage().(*ListClustersOutput) } const opListContainerInstances = "ListContainerInstances" @@ -933,6 +944,7 @@ const opListContainerInstances = "ListContainerInstances" type ListContainerInstancesRequest struct { *aws.Request Input *ListContainerInstancesInput + Copy func(*ListContainerInstancesInput) ListContainerInstancesRequest } // Send marshals and sends the ListContainerInstances API request. @@ -983,57 +995,53 @@ func (c *ECS) ListContainerInstancesRequest(input *ListContainerInstancesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListContainerInstancesRequest{Request: req, Input: input} + return ListContainerInstancesRequest{Request: req, Input: input, Copy: c.ListContainerInstancesRequest} } -// ListContainerInstancesPages iterates over the pages of a ListContainerInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListContainerInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListContainerInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListContainerInstances operation. -// pageNum := 0 -// err := client.ListContainerInstancesPages(params, -// func(page *ListContainerInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListContainerInstancesPages(input *ListContainerInstancesInput, fn func(*ListContainerInstancesOutput, bool) bool) error { - return c.ListContainerInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListContainerInstancesPagesWithContext same as ListContainerInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListContainerInstancesPagesWithContext(ctx aws.Context, input *ListContainerInstancesInput, fn func(*ListContainerInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListContainerInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListContainerInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListContainerInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListContainerInstancesRequest) Paginate(opts ...aws.Option) ListContainerInstancesPager { + return ListContainerInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListContainerInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListContainerInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// ListContainerInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListContainerInstancesPager struct { + aws.Pager +} + +func (p *ListContainerInstancesPager) CurrentPage() *ListContainerInstancesOutput { + return p.Pager.CurrentPage().(*ListContainerInstancesOutput) } const opListServices = "ListServices" @@ -1042,6 +1050,7 @@ const opListServices = "ListServices" type ListServicesRequest struct { *aws.Request Input *ListServicesInput + Copy func(*ListServicesInput) ListServicesRequest } // Send marshals and sends the ListServices API request. @@ -1088,57 +1097,53 @@ func (c *ECS) ListServicesRequest(input *ListServicesInput) ListServicesRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListServicesRequest{Request: req, Input: input} + return ListServicesRequest{Request: req, Input: input, Copy: c.ListServicesRequest} } -// ListServicesPages iterates over the pages of a ListServices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServices method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListServicesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListServices operation. -// pageNum := 0 -// err := client.ListServicesPages(params, -// func(page *ListServicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListServicesPages(input *ListServicesInput, fn func(*ListServicesOutput, bool) bool) error { - return c.ListServicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListServicesPagesWithContext same as ListServicesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListServicesPagesWithContext(ctx aws.Context, input *ListServicesInput, fn func(*ListServicesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListServicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListServicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListServicesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListServicesRequest) Paginate(opts ...aws.Option) ListServicesPager { + return ListServicesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListServicesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) - } - return p.Err() +// ListServicesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListServicesPager struct { + aws.Pager +} + +func (p *ListServicesPager) CurrentPage() *ListServicesOutput { + return p.Pager.CurrentPage().(*ListServicesOutput) } const opListTaskDefinitionFamilies = "ListTaskDefinitionFamilies" @@ -1147,6 +1152,7 @@ const opListTaskDefinitionFamilies = "ListTaskDefinitionFamilies" type ListTaskDefinitionFamiliesRequest struct { *aws.Request Input *ListTaskDefinitionFamiliesInput + Copy func(*ListTaskDefinitionFamiliesInput) ListTaskDefinitionFamiliesRequest } // Send marshals and sends the ListTaskDefinitionFamilies API request. @@ -1199,57 +1205,53 @@ func (c *ECS) ListTaskDefinitionFamiliesRequest(input *ListTaskDefinitionFamilie req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTaskDefinitionFamiliesRequest{Request: req, Input: input} + return ListTaskDefinitionFamiliesRequest{Request: req, Input: input, Copy: c.ListTaskDefinitionFamiliesRequest} } -// ListTaskDefinitionFamiliesPages iterates over the pages of a ListTaskDefinitionFamilies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTaskDefinitionFamilies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTaskDefinitionFamiliesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTaskDefinitionFamilies operation. -// pageNum := 0 -// err := client.ListTaskDefinitionFamiliesPages(params, -// func(page *ListTaskDefinitionFamiliesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListTaskDefinitionFamiliesPages(input *ListTaskDefinitionFamiliesInput, fn func(*ListTaskDefinitionFamiliesOutput, bool) bool) error { - return c.ListTaskDefinitionFamiliesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTaskDefinitionFamiliesPagesWithContext same as ListTaskDefinitionFamiliesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListTaskDefinitionFamiliesPagesWithContext(ctx aws.Context, input *ListTaskDefinitionFamiliesInput, fn func(*ListTaskDefinitionFamiliesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTaskDefinitionFamiliesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTaskDefinitionFamiliesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTaskDefinitionFamiliesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTaskDefinitionFamiliesRequest) Paginate(opts ...aws.Option) ListTaskDefinitionFamiliesPager { + return ListTaskDefinitionFamiliesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTaskDefinitionFamiliesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTaskDefinitionFamiliesOutput), !p.HasNextPage()) - } - return p.Err() +// ListTaskDefinitionFamiliesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTaskDefinitionFamiliesPager struct { + aws.Pager +} + +func (p *ListTaskDefinitionFamiliesPager) CurrentPage() *ListTaskDefinitionFamiliesOutput { + return p.Pager.CurrentPage().(*ListTaskDefinitionFamiliesOutput) } const opListTaskDefinitions = "ListTaskDefinitions" @@ -1258,6 +1260,7 @@ const opListTaskDefinitions = "ListTaskDefinitions" type ListTaskDefinitionsRequest struct { *aws.Request Input *ListTaskDefinitionsInput + Copy func(*ListTaskDefinitionsInput) ListTaskDefinitionsRequest } // Send marshals and sends the ListTaskDefinitions API request. @@ -1306,57 +1309,53 @@ func (c *ECS) ListTaskDefinitionsRequest(input *ListTaskDefinitionsInput) ListTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTaskDefinitionsRequest{Request: req, Input: input} + return ListTaskDefinitionsRequest{Request: req, Input: input, Copy: c.ListTaskDefinitionsRequest} } -// ListTaskDefinitionsPages iterates over the pages of a ListTaskDefinitions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTaskDefinitions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTaskDefinitionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTaskDefinitions operation. -// pageNum := 0 -// err := client.ListTaskDefinitionsPages(params, -// func(page *ListTaskDefinitionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListTaskDefinitionsPages(input *ListTaskDefinitionsInput, fn func(*ListTaskDefinitionsOutput, bool) bool) error { - return c.ListTaskDefinitionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTaskDefinitionsPagesWithContext same as ListTaskDefinitionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListTaskDefinitionsPagesWithContext(ctx aws.Context, input *ListTaskDefinitionsInput, fn func(*ListTaskDefinitionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTaskDefinitionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTaskDefinitionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTaskDefinitionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTaskDefinitionsRequest) Paginate(opts ...aws.Option) ListTaskDefinitionsPager { + return ListTaskDefinitionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTaskDefinitionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTaskDefinitionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListTaskDefinitionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTaskDefinitionsPager struct { + aws.Pager +} + +func (p *ListTaskDefinitionsPager) CurrentPage() *ListTaskDefinitionsOutput { + return p.Pager.CurrentPage().(*ListTaskDefinitionsOutput) } const opListTasks = "ListTasks" @@ -1365,6 +1364,7 @@ const opListTasks = "ListTasks" type ListTasksRequest struct { *aws.Request Input *ListTasksInput + Copy func(*ListTasksInput) ListTasksRequest } // Send marshals and sends the ListTasks API request. @@ -1416,57 +1416,53 @@ func (c *ECS) ListTasksRequest(input *ListTasksInput) ListTasksRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTasksRequest{Request: req, Input: input} + return ListTasksRequest{Request: req, Input: input, Copy: c.ListTasksRequest} } -// ListTasksPages iterates over the pages of a ListTasks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTasks method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTasksRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTasks operation. -// pageNum := 0 -// err := client.ListTasksPages(params, -// func(page *ListTasksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListTasksPages(input *ListTasksInput, fn func(*ListTasksOutput, bool) bool) error { - return c.ListTasksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTasksPagesWithContext same as ListTasksPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListTasksPagesWithContext(ctx aws.Context, input *ListTasksInput, fn func(*ListTasksOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTasksRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTasksRequest) Paginate(opts ...aws.Option) ListTasksPager { + return ListTasksPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTasksInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTasksOutput), !p.HasNextPage()) - } - return p.Err() +// ListTasksPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTasksPager struct { + aws.Pager +} + +func (p *ListTasksPager) CurrentPage() *ListTasksOutput { + return p.Pager.CurrentPage().(*ListTasksOutput) } const opPutAttributes = "PutAttributes" @@ -1475,6 +1471,7 @@ const opPutAttributes = "PutAttributes" type PutAttributesRequest struct { *aws.Request Input *PutAttributesInput + Copy func(*PutAttributesInput) PutAttributesRequest } // Send marshals and sends the PutAttributes API request. @@ -1519,7 +1516,7 @@ func (c *ECS) PutAttributesRequest(input *PutAttributesInput) PutAttributesReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutAttributesRequest{Request: req, Input: input} + return PutAttributesRequest{Request: req, Input: input, Copy: c.PutAttributesRequest} } const opRegisterContainerInstance = "RegisterContainerInstance" @@ -1528,6 +1525,7 @@ const opRegisterContainerInstance = "RegisterContainerInstance" type RegisterContainerInstanceRequest struct { *aws.Request Input *RegisterContainerInstanceInput + Copy func(*RegisterContainerInstanceInput) RegisterContainerInstanceRequest } // Send marshals and sends the RegisterContainerInstance API request. @@ -1572,7 +1570,7 @@ func (c *ECS) RegisterContainerInstanceRequest(input *RegisterContainerInstanceI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterContainerInstanceRequest{Request: req, Input: input} + return RegisterContainerInstanceRequest{Request: req, Input: input, Copy: c.RegisterContainerInstanceRequest} } const opRegisterTaskDefinition = "RegisterTaskDefinition" @@ -1581,6 +1579,7 @@ const opRegisterTaskDefinition = "RegisterTaskDefinition" type RegisterTaskDefinitionRequest struct { *aws.Request Input *RegisterTaskDefinitionInput + Copy func(*RegisterTaskDefinitionInput) RegisterTaskDefinitionRequest } // Send marshals and sends the RegisterTaskDefinition API request. @@ -1641,7 +1640,7 @@ func (c *ECS) RegisterTaskDefinitionRequest(input *RegisterTaskDefinitionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterTaskDefinitionRequest{Request: req, Input: input} + return RegisterTaskDefinitionRequest{Request: req, Input: input, Copy: c.RegisterTaskDefinitionRequest} } const opRunTask = "RunTask" @@ -1650,6 +1649,7 @@ const opRunTask = "RunTask" type RunTaskRequest struct { *aws.Request Input *RunTaskInput + Copy func(*RunTaskInput) RunTaskRequest } // Send marshals and sends the RunTask API request. @@ -1719,7 +1719,7 @@ func (c *ECS) RunTaskRequest(input *RunTaskInput) RunTaskRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RunTaskRequest{Request: req, Input: input} + return RunTaskRequest{Request: req, Input: input, Copy: c.RunTaskRequest} } const opStartTask = "StartTask" @@ -1728,6 +1728,7 @@ const opStartTask = "StartTask" type StartTaskRequest struct { *aws.Request Input *StartTaskInput + Copy func(*StartTaskInput) StartTaskRequest } // Send marshals and sends the StartTask API request. @@ -1773,7 +1774,7 @@ func (c *ECS) StartTaskRequest(input *StartTaskInput) StartTaskRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartTaskRequest{Request: req, Input: input} + return StartTaskRequest{Request: req, Input: input, Copy: c.StartTaskRequest} } const opStopTask = "StopTask" @@ -1782,6 +1783,7 @@ const opStopTask = "StopTask" type StopTaskRequest struct { *aws.Request Input *StopTaskInput + Copy func(*StopTaskInput) StopTaskRequest } // Send marshals and sends the StopTask API request. @@ -1833,7 +1835,7 @@ func (c *ECS) StopTaskRequest(input *StopTaskInput) StopTaskRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopTaskRequest{Request: req, Input: input} + return StopTaskRequest{Request: req, Input: input, Copy: c.StopTaskRequest} } const opSubmitContainerStateChange = "SubmitContainerStateChange" @@ -1842,6 +1844,7 @@ const opSubmitContainerStateChange = "SubmitContainerStateChange" type SubmitContainerStateChangeRequest struct { *aws.Request Input *SubmitContainerStateChangeInput + Copy func(*SubmitContainerStateChangeInput) SubmitContainerStateChangeRequest } // Send marshals and sends the SubmitContainerStateChange API request. @@ -1885,7 +1888,7 @@ func (c *ECS) SubmitContainerStateChangeRequest(input *SubmitContainerStateChang req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SubmitContainerStateChangeRequest{Request: req, Input: input} + return SubmitContainerStateChangeRequest{Request: req, Input: input, Copy: c.SubmitContainerStateChangeRequest} } const opSubmitTaskStateChange = "SubmitTaskStateChange" @@ -1894,6 +1897,7 @@ const opSubmitTaskStateChange = "SubmitTaskStateChange" type SubmitTaskStateChangeRequest struct { *aws.Request Input *SubmitTaskStateChangeInput + Copy func(*SubmitTaskStateChangeInput) SubmitTaskStateChangeRequest } // Send marshals and sends the SubmitTaskStateChange API request. @@ -1937,7 +1941,7 @@ func (c *ECS) SubmitTaskStateChangeRequest(input *SubmitTaskStateChangeInput) Su req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SubmitTaskStateChangeRequest{Request: req, Input: input} + return SubmitTaskStateChangeRequest{Request: req, Input: input, Copy: c.SubmitTaskStateChangeRequest} } const opUpdateContainerAgent = "UpdateContainerAgent" @@ -1946,6 +1950,7 @@ const opUpdateContainerAgent = "UpdateContainerAgent" type UpdateContainerAgentRequest struct { *aws.Request Input *UpdateContainerAgentInput + Copy func(*UpdateContainerAgentInput) UpdateContainerAgentRequest } // Send marshals and sends the UpdateContainerAgent API request. @@ -1996,7 +2001,7 @@ func (c *ECS) UpdateContainerAgentRequest(input *UpdateContainerAgentInput) Upda req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateContainerAgentRequest{Request: req, Input: input} + return UpdateContainerAgentRequest{Request: req, Input: input, Copy: c.UpdateContainerAgentRequest} } const opUpdateContainerInstancesState = "UpdateContainerInstancesState" @@ -2005,6 +2010,7 @@ const opUpdateContainerInstancesState = "UpdateContainerInstancesState" type UpdateContainerInstancesStateRequest struct { *aws.Request Input *UpdateContainerInstancesStateInput + Copy func(*UpdateContainerInstancesStateInput) UpdateContainerInstancesStateRequest } // Send marshals and sends the UpdateContainerInstancesState API request. @@ -2088,7 +2094,7 @@ func (c *ECS) UpdateContainerInstancesStateRequest(input *UpdateContainerInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateContainerInstancesStateRequest{Request: req, Input: input} + return UpdateContainerInstancesStateRequest{Request: req, Input: input, Copy: c.UpdateContainerInstancesStateRequest} } const opUpdateService = "UpdateService" @@ -2097,6 +2103,7 @@ const opUpdateService = "UpdateService" type UpdateServiceRequest struct { *aws.Request Input *UpdateServiceInput + Copy func(*UpdateServiceInput) UpdateServiceRequest } // Send marshals and sends the UpdateService API request. @@ -2203,7 +2210,7 @@ func (c *ECS) UpdateServiceRequest(input *UpdateServiceInput) UpdateServiceReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateServiceRequest{Request: req, Input: input} + return UpdateServiceRequest{Request: req, Input: input, Copy: c.UpdateServiceRequest} } // An object representing a container instance or task attachment. diff --git a/service/ecs/ecsiface/interface.go b/service/ecs/ecsiface/interface.go index a57bde6b09d..4b861c24543 100644 --- a/service/ecs/ecsiface/interface.go +++ b/service/ecs/ecsiface/interface.go @@ -93,34 +93,16 @@ type ECSAPI interface { ListClustersRequest(*ecs.ListClustersInput) ecs.ListClustersRequest - ListClustersPages(*ecs.ListClustersInput, func(*ecs.ListClustersOutput, bool) bool) error - ListClustersPagesWithContext(aws.Context, *ecs.ListClustersInput, func(*ecs.ListClustersOutput, bool) bool, ...aws.Option) error - ListContainerInstancesRequest(*ecs.ListContainerInstancesInput) ecs.ListContainerInstancesRequest - ListContainerInstancesPages(*ecs.ListContainerInstancesInput, func(*ecs.ListContainerInstancesOutput, bool) bool) error - ListContainerInstancesPagesWithContext(aws.Context, *ecs.ListContainerInstancesInput, func(*ecs.ListContainerInstancesOutput, bool) bool, ...aws.Option) error - ListServicesRequest(*ecs.ListServicesInput) ecs.ListServicesRequest - ListServicesPages(*ecs.ListServicesInput, func(*ecs.ListServicesOutput, bool) bool) error - ListServicesPagesWithContext(aws.Context, *ecs.ListServicesInput, func(*ecs.ListServicesOutput, bool) bool, ...aws.Option) error - ListTaskDefinitionFamiliesRequest(*ecs.ListTaskDefinitionFamiliesInput) ecs.ListTaskDefinitionFamiliesRequest - ListTaskDefinitionFamiliesPages(*ecs.ListTaskDefinitionFamiliesInput, func(*ecs.ListTaskDefinitionFamiliesOutput, bool) bool) error - ListTaskDefinitionFamiliesPagesWithContext(aws.Context, *ecs.ListTaskDefinitionFamiliesInput, func(*ecs.ListTaskDefinitionFamiliesOutput, bool) bool, ...aws.Option) error - ListTaskDefinitionsRequest(*ecs.ListTaskDefinitionsInput) ecs.ListTaskDefinitionsRequest - ListTaskDefinitionsPages(*ecs.ListTaskDefinitionsInput, func(*ecs.ListTaskDefinitionsOutput, bool) bool) error - ListTaskDefinitionsPagesWithContext(aws.Context, *ecs.ListTaskDefinitionsInput, func(*ecs.ListTaskDefinitionsOutput, bool) bool, ...aws.Option) error - ListTasksRequest(*ecs.ListTasksInput) ecs.ListTasksRequest - ListTasksPages(*ecs.ListTasksInput, func(*ecs.ListTasksOutput, bool) bool) error - ListTasksPagesWithContext(aws.Context, *ecs.ListTasksInput, func(*ecs.ListTasksOutput, bool) bool, ...aws.Option) error - PutAttributesRequest(*ecs.PutAttributesInput) ecs.PutAttributesRequest RegisterContainerInstanceRequest(*ecs.RegisterContainerInstanceInput) ecs.RegisterContainerInstanceRequest diff --git a/service/efs/api.go b/service/efs/api.go index 395861521c2..57bf26a1fcf 100644 --- a/service/efs/api.go +++ b/service/efs/api.go @@ -18,6 +18,7 @@ const opCreateFileSystem = "CreateFileSystem" type CreateFileSystemRequest struct { *aws.Request Input *CreateFileSystemInput + Copy func(*CreateFileSystemInput) CreateFileSystemRequest } // Send marshals and sends the CreateFileSystem API request. @@ -103,7 +104,7 @@ func (c *EFS) CreateFileSystemRequest(input *CreateFileSystemInput) CreateFileSy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFileSystemRequest{Request: req, Input: input} + return CreateFileSystemRequest{Request: req, Input: input, Copy: c.CreateFileSystemRequest} } const opCreateMountTarget = "CreateMountTarget" @@ -112,6 +113,7 @@ const opCreateMountTarget = "CreateMountTarget" type CreateMountTargetRequest struct { *aws.Request Input *CreateMountTargetInput + Copy func(*CreateMountTargetInput) CreateMountTargetRequest } // Send marshals and sends the CreateMountTarget API request. @@ -246,7 +248,7 @@ func (c *EFS) CreateMountTargetRequest(input *CreateMountTargetInput) CreateMoun req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateMountTargetRequest{Request: req, Input: input} + return CreateMountTargetRequest{Request: req, Input: input, Copy: c.CreateMountTargetRequest} } const opCreateTags = "CreateTags" @@ -255,6 +257,7 @@ const opCreateTags = "CreateTags" type CreateTagsRequest struct { *aws.Request Input *CreateTagsInput + Copy func(*CreateTagsInput) CreateTagsRequest } // Send marshals and sends the CreateTags API request. @@ -303,7 +306,7 @@ func (c *EFS) CreateTagsRequest(input *CreateTagsInput) CreateTagsRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateTagsRequest{Request: req, Input: input} + return CreateTagsRequest{Request: req, Input: input, Copy: c.CreateTagsRequest} } const opDeleteFileSystem = "DeleteFileSystem" @@ -312,6 +315,7 @@ const opDeleteFileSystem = "DeleteFileSystem" type DeleteFileSystemRequest struct { *aws.Request Input *DeleteFileSystemInput + Copy func(*DeleteFileSystemInput) DeleteFileSystemRequest } // Send marshals and sends the DeleteFileSystem API request. @@ -369,7 +373,7 @@ func (c *EFS) DeleteFileSystemRequest(input *DeleteFileSystemInput) DeleteFileSy req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteFileSystemRequest{Request: req, Input: input} + return DeleteFileSystemRequest{Request: req, Input: input, Copy: c.DeleteFileSystemRequest} } const opDeleteMountTarget = "DeleteMountTarget" @@ -378,6 +382,7 @@ const opDeleteMountTarget = "DeleteMountTarget" type DeleteMountTargetRequest struct { *aws.Request Input *DeleteMountTargetInput + Copy func(*DeleteMountTargetInput) DeleteMountTargetRequest } // Send marshals and sends the DeleteMountTarget API request. @@ -444,7 +449,7 @@ func (c *EFS) DeleteMountTargetRequest(input *DeleteMountTargetInput) DeleteMoun req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteMountTargetRequest{Request: req, Input: input} + return DeleteMountTargetRequest{Request: req, Input: input, Copy: c.DeleteMountTargetRequest} } const opDeleteTags = "DeleteTags" @@ -453,6 +458,7 @@ const opDeleteTags = "DeleteTags" type DeleteTagsRequest struct { *aws.Request Input *DeleteTagsInput + Copy func(*DeleteTagsInput) DeleteTagsRequest } // Send marshals and sends the DeleteTags API request. @@ -502,7 +508,7 @@ func (c *EFS) DeleteTagsRequest(input *DeleteTagsInput) DeleteTagsRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteTagsRequest{Request: req, Input: input} + return DeleteTagsRequest{Request: req, Input: input, Copy: c.DeleteTagsRequest} } const opDescribeFileSystems = "DescribeFileSystems" @@ -511,6 +517,7 @@ const opDescribeFileSystems = "DescribeFileSystems" type DescribeFileSystemsRequest struct { *aws.Request Input *DescribeFileSystemsInput + Copy func(*DescribeFileSystemsInput) DescribeFileSystemsRequest } // Send marshals and sends the DescribeFileSystems API request. @@ -576,7 +583,7 @@ func (c *EFS) DescribeFileSystemsRequest(input *DescribeFileSystemsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFileSystemsRequest{Request: req, Input: input} + return DescribeFileSystemsRequest{Request: req, Input: input, Copy: c.DescribeFileSystemsRequest} } const opDescribeMountTargetSecurityGroups = "DescribeMountTargetSecurityGroups" @@ -585,6 +592,7 @@ const opDescribeMountTargetSecurityGroups = "DescribeMountTargetSecurityGroups" type DescribeMountTargetSecurityGroupsRequest struct { *aws.Request Input *DescribeMountTargetSecurityGroupsInput + Copy func(*DescribeMountTargetSecurityGroupsInput) DescribeMountTargetSecurityGroupsRequest } // Send marshals and sends the DescribeMountTargetSecurityGroups API request. @@ -635,7 +643,7 @@ func (c *EFS) DescribeMountTargetSecurityGroupsRequest(input *DescribeMountTarge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMountTargetSecurityGroupsRequest{Request: req, Input: input} + return DescribeMountTargetSecurityGroupsRequest{Request: req, Input: input, Copy: c.DescribeMountTargetSecurityGroupsRequest} } const opDescribeMountTargets = "DescribeMountTargets" @@ -644,6 +652,7 @@ const opDescribeMountTargets = "DescribeMountTargets" type DescribeMountTargetsRequest struct { *aws.Request Input *DescribeMountTargetsInput + Copy func(*DescribeMountTargetsInput) DescribeMountTargetsRequest } // Send marshals and sends the DescribeMountTargets API request. @@ -690,7 +699,7 @@ func (c *EFS) DescribeMountTargetsRequest(input *DescribeMountTargetsInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMountTargetsRequest{Request: req, Input: input} + return DescribeMountTargetsRequest{Request: req, Input: input, Copy: c.DescribeMountTargetsRequest} } const opDescribeTags = "DescribeTags" @@ -699,6 +708,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -744,7 +754,7 @@ func (c *EFS) DescribeTagsRequest(input *DescribeTagsInput) DescribeTagsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } const opModifyMountTargetSecurityGroups = "ModifyMountTargetSecurityGroups" @@ -753,6 +763,7 @@ const opModifyMountTargetSecurityGroups = "ModifyMountTargetSecurityGroups" type ModifyMountTargetSecurityGroupsRequest struct { *aws.Request Input *ModifyMountTargetSecurityGroupsInput + Copy func(*ModifyMountTargetSecurityGroupsInput) ModifyMountTargetSecurityGroupsRequest } // Send marshals and sends the ModifyMountTargetSecurityGroups API request. @@ -810,7 +821,7 @@ func (c *EFS) ModifyMountTargetSecurityGroupsRequest(input *ModifyMountTargetSec req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyMountTargetSecurityGroupsRequest{Request: req, Input: input} + return ModifyMountTargetSecurityGroupsRequest{Request: req, Input: input, Copy: c.ModifyMountTargetSecurityGroupsRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateFileSystemRequest diff --git a/service/elasticache/api.go b/service/elasticache/api.go index 84214156241..87b136ea298 100644 --- a/service/elasticache/api.go +++ b/service/elasticache/api.go @@ -17,6 +17,7 @@ const opAddTagsToResource = "AddTagsToResource" type AddTagsToResourceRequest struct { *aws.Request Input *AddTagsToResourceInput + Copy func(*AddTagsToResourceInput) AddTagsToResourceRequest } // Send marshals and sends the AddTagsToResource API request. @@ -67,7 +68,7 @@ func (c *ElastiCache) AddTagsToResourceRequest(input *AddTagsToResourceInput) Ad req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsToResourceRequest{Request: req, Input: input} + return AddTagsToResourceRequest{Request: req, Input: input, Copy: c.AddTagsToResourceRequest} } const opAuthorizeCacheSecurityGroupIngress = "AuthorizeCacheSecurityGroupIngress" @@ -76,6 +77,7 @@ const opAuthorizeCacheSecurityGroupIngress = "AuthorizeCacheSecurityGroupIngress type AuthorizeCacheSecurityGroupIngressRequest struct { *aws.Request Input *AuthorizeCacheSecurityGroupIngressInput + Copy func(*AuthorizeCacheSecurityGroupIngressInput) AuthorizeCacheSecurityGroupIngressRequest } // Send marshals and sends the AuthorizeCacheSecurityGroupIngress API request. @@ -121,7 +123,7 @@ func (c *ElastiCache) AuthorizeCacheSecurityGroupIngressRequest(input *Authorize req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AuthorizeCacheSecurityGroupIngressRequest{Request: req, Input: input} + return AuthorizeCacheSecurityGroupIngressRequest{Request: req, Input: input, Copy: c.AuthorizeCacheSecurityGroupIngressRequest} } const opCopySnapshot = "CopySnapshot" @@ -130,6 +132,7 @@ const opCopySnapshot = "CopySnapshot" type CopySnapshotRequest struct { *aws.Request Input *CopySnapshotInput + Copy func(*CopySnapshotInput) CopySnapshotRequest } // Send marshals and sends the CopySnapshot API request. @@ -234,7 +237,7 @@ func (c *ElastiCache) CopySnapshotRequest(input *CopySnapshotInput) CopySnapshot req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopySnapshotRequest{Request: req, Input: input} + return CopySnapshotRequest{Request: req, Input: input, Copy: c.CopySnapshotRequest} } const opCreateCacheCluster = "CreateCacheCluster" @@ -243,6 +246,7 @@ const opCreateCacheCluster = "CreateCacheCluster" type CreateCacheClusterRequest struct { *aws.Request Input *CreateCacheClusterInput + Copy func(*CreateCacheClusterInput) CreateCacheClusterRequest } // Send marshals and sends the CreateCacheCluster API request. @@ -288,7 +292,7 @@ func (c *ElastiCache) CreateCacheClusterRequest(input *CreateCacheClusterInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCacheClusterRequest{Request: req, Input: input} + return CreateCacheClusterRequest{Request: req, Input: input, Copy: c.CreateCacheClusterRequest} } const opCreateCacheParameterGroup = "CreateCacheParameterGroup" @@ -297,6 +301,7 @@ const opCreateCacheParameterGroup = "CreateCacheParameterGroup" type CreateCacheParameterGroupRequest struct { *aws.Request Input *CreateCacheParameterGroupInput + Copy func(*CreateCacheParameterGroupInput) CreateCacheParameterGroupRequest } // Send marshals and sends the CreateCacheParameterGroup API request. @@ -350,7 +355,7 @@ func (c *ElastiCache) CreateCacheParameterGroupRequest(input *CreateCacheParamet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCacheParameterGroupRequest{Request: req, Input: input} + return CreateCacheParameterGroupRequest{Request: req, Input: input, Copy: c.CreateCacheParameterGroupRequest} } const opCreateCacheSecurityGroup = "CreateCacheSecurityGroup" @@ -359,6 +364,7 @@ const opCreateCacheSecurityGroup = "CreateCacheSecurityGroup" type CreateCacheSecurityGroupRequest struct { *aws.Request Input *CreateCacheSecurityGroupInput + Copy func(*CreateCacheSecurityGroupInput) CreateCacheSecurityGroupRequest } // Send marshals and sends the CreateCacheSecurityGroup API request. @@ -405,7 +411,7 @@ func (c *ElastiCache) CreateCacheSecurityGroupRequest(input *CreateCacheSecurity req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCacheSecurityGroupRequest{Request: req, Input: input} + return CreateCacheSecurityGroupRequest{Request: req, Input: input, Copy: c.CreateCacheSecurityGroupRequest} } const opCreateCacheSubnetGroup = "CreateCacheSubnetGroup" @@ -414,6 +420,7 @@ const opCreateCacheSubnetGroup = "CreateCacheSubnetGroup" type CreateCacheSubnetGroupRequest struct { *aws.Request Input *CreateCacheSubnetGroupInput + Copy func(*CreateCacheSubnetGroupInput) CreateCacheSubnetGroupRequest } // Send marshals and sends the CreateCacheSubnetGroup API request. @@ -457,7 +464,7 @@ func (c *ElastiCache) CreateCacheSubnetGroupRequest(input *CreateCacheSubnetGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCacheSubnetGroupRequest{Request: req, Input: input} + return CreateCacheSubnetGroupRequest{Request: req, Input: input, Copy: c.CreateCacheSubnetGroupRequest} } const opCreateReplicationGroup = "CreateReplicationGroup" @@ -466,6 +473,7 @@ const opCreateReplicationGroup = "CreateReplicationGroup" type CreateReplicationGroupRequest struct { *aws.Request Input *CreateReplicationGroupInput + Copy func(*CreateReplicationGroupInput) CreateReplicationGroupRequest } // Send marshals and sends the CreateReplicationGroup API request. @@ -528,7 +536,7 @@ func (c *ElastiCache) CreateReplicationGroupRequest(input *CreateReplicationGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReplicationGroupRequest{Request: req, Input: input} + return CreateReplicationGroupRequest{Request: req, Input: input, Copy: c.CreateReplicationGroupRequest} } const opCreateSnapshot = "CreateSnapshot" @@ -537,6 +545,7 @@ const opCreateSnapshot = "CreateSnapshot" type CreateSnapshotRequest struct { *aws.Request Input *CreateSnapshotInput + Copy func(*CreateSnapshotInput) CreateSnapshotRequest } // Send marshals and sends the CreateSnapshot API request. @@ -580,7 +589,7 @@ func (c *ElastiCache) CreateSnapshotRequest(input *CreateSnapshotInput) CreateSn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSnapshotRequest{Request: req, Input: input} + return CreateSnapshotRequest{Request: req, Input: input, Copy: c.CreateSnapshotRequest} } const opDeleteCacheCluster = "DeleteCacheCluster" @@ -589,6 +598,7 @@ const opDeleteCacheCluster = "DeleteCacheCluster" type DeleteCacheClusterRequest struct { *aws.Request Input *DeleteCacheClusterInput + Copy func(*DeleteCacheClusterInput) DeleteCacheClusterRequest } // Send marshals and sends the DeleteCacheCluster API request. @@ -640,7 +650,7 @@ func (c *ElastiCache) DeleteCacheClusterRequest(input *DeleteCacheClusterInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteCacheClusterRequest{Request: req, Input: input} + return DeleteCacheClusterRequest{Request: req, Input: input, Copy: c.DeleteCacheClusterRequest} } const opDeleteCacheParameterGroup = "DeleteCacheParameterGroup" @@ -649,6 +659,7 @@ const opDeleteCacheParameterGroup = "DeleteCacheParameterGroup" type DeleteCacheParameterGroupRequest struct { *aws.Request Input *DeleteCacheParameterGroupInput + Copy func(*DeleteCacheParameterGroupInput) DeleteCacheParameterGroupRequest } // Send marshals and sends the DeleteCacheParameterGroup API request. @@ -692,7 +703,7 @@ func (c *ElastiCache) DeleteCacheParameterGroupRequest(input *DeleteCacheParamet req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCacheParameterGroupRequest{Request: req, Input: input} + return DeleteCacheParameterGroupRequest{Request: req, Input: input, Copy: c.DeleteCacheParameterGroupRequest} } const opDeleteCacheSecurityGroup = "DeleteCacheSecurityGroup" @@ -701,6 +712,7 @@ const opDeleteCacheSecurityGroup = "DeleteCacheSecurityGroup" type DeleteCacheSecurityGroupRequest struct { *aws.Request Input *DeleteCacheSecurityGroupInput + Copy func(*DeleteCacheSecurityGroupInput) DeleteCacheSecurityGroupRequest } // Send marshals and sends the DeleteCacheSecurityGroup API request. @@ -745,7 +757,7 @@ func (c *ElastiCache) DeleteCacheSecurityGroupRequest(input *DeleteCacheSecurity req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCacheSecurityGroupRequest{Request: req, Input: input} + return DeleteCacheSecurityGroupRequest{Request: req, Input: input, Copy: c.DeleteCacheSecurityGroupRequest} } const opDeleteCacheSubnetGroup = "DeleteCacheSubnetGroup" @@ -754,6 +766,7 @@ const opDeleteCacheSubnetGroup = "DeleteCacheSubnetGroup" type DeleteCacheSubnetGroupRequest struct { *aws.Request Input *DeleteCacheSubnetGroupInput + Copy func(*DeleteCacheSubnetGroupInput) DeleteCacheSubnetGroupRequest } // Send marshals and sends the DeleteCacheSubnetGroup API request. @@ -798,7 +811,7 @@ func (c *ElastiCache) DeleteCacheSubnetGroupRequest(input *DeleteCacheSubnetGrou req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCacheSubnetGroupRequest{Request: req, Input: input} + return DeleteCacheSubnetGroupRequest{Request: req, Input: input, Copy: c.DeleteCacheSubnetGroupRequest} } const opDeleteReplicationGroup = "DeleteReplicationGroup" @@ -807,6 +820,7 @@ const opDeleteReplicationGroup = "DeleteReplicationGroup" type DeleteReplicationGroupRequest struct { *aws.Request Input *DeleteReplicationGroupInput + Copy func(*DeleteReplicationGroupInput) DeleteReplicationGroupRequest } // Send marshals and sends the DeleteReplicationGroup API request. @@ -857,7 +871,7 @@ func (c *ElastiCache) DeleteReplicationGroupRequest(input *DeleteReplicationGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReplicationGroupRequest{Request: req, Input: input} + return DeleteReplicationGroupRequest{Request: req, Input: input, Copy: c.DeleteReplicationGroupRequest} } const opDeleteSnapshot = "DeleteSnapshot" @@ -866,6 +880,7 @@ const opDeleteSnapshot = "DeleteSnapshot" type DeleteSnapshotRequest struct { *aws.Request Input *DeleteSnapshotInput + Copy func(*DeleteSnapshotInput) DeleteSnapshotRequest } // Send marshals and sends the DeleteSnapshot API request. @@ -910,7 +925,7 @@ func (c *ElastiCache) DeleteSnapshotRequest(input *DeleteSnapshotInput) DeleteSn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSnapshotRequest{Request: req, Input: input} + return DeleteSnapshotRequest{Request: req, Input: input, Copy: c.DeleteSnapshotRequest} } const opDescribeCacheClusters = "DescribeCacheClusters" @@ -919,6 +934,7 @@ const opDescribeCacheClusters = "DescribeCacheClusters" type DescribeCacheClustersRequest struct { *aws.Request Input *DescribeCacheClustersInput + Copy func(*DescribeCacheClustersInput) DescribeCacheClustersRequest } // Send marshals and sends the DescribeCacheClusters API request. @@ -986,57 +1002,53 @@ func (c *ElastiCache) DescribeCacheClustersRequest(input *DescribeCacheClustersI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCacheClustersRequest{Request: req, Input: input} + return DescribeCacheClustersRequest{Request: req, Input: input, Copy: c.DescribeCacheClustersRequest} } -// DescribeCacheClustersPages iterates over the pages of a DescribeCacheClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheClusters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeCacheClustersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCacheClusters operation. -// pageNum := 0 -// err := client.DescribeCacheClustersPages(params, -// func(page *DescribeCacheClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheClustersPages(input *DescribeCacheClustersInput, fn func(*DescribeCacheClustersOutput, bool) bool) error { - return c.DescribeCacheClustersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeCacheClustersPagesWithContext same as DescribeCacheClustersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeCacheClustersPagesWithContext(ctx aws.Context, input *DescribeCacheClustersInput, fn func(*DescribeCacheClustersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeCacheClustersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeCacheClustersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeCacheClustersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeCacheClustersRequest) Paginate(opts ...aws.Option) DescribeCacheClustersPager { + return DescribeCacheClustersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeCacheClustersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheClustersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeCacheClustersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeCacheClustersPager struct { + aws.Pager +} + +func (p *DescribeCacheClustersPager) CurrentPage() *DescribeCacheClustersOutput { + return p.Pager.CurrentPage().(*DescribeCacheClustersOutput) } const opDescribeCacheEngineVersions = "DescribeCacheEngineVersions" @@ -1045,6 +1057,7 @@ const opDescribeCacheEngineVersions = "DescribeCacheEngineVersions" type DescribeCacheEngineVersionsRequest struct { *aws.Request Input *DescribeCacheEngineVersionsInput + Copy func(*DescribeCacheEngineVersionsInput) DescribeCacheEngineVersionsRequest } // Send marshals and sends the DescribeCacheEngineVersions API request. @@ -1091,57 +1104,53 @@ func (c *ElastiCache) DescribeCacheEngineVersionsRequest(input *DescribeCacheEng req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCacheEngineVersionsRequest{Request: req, Input: input} + return DescribeCacheEngineVersionsRequest{Request: req, Input: input, Copy: c.DescribeCacheEngineVersionsRequest} } -// DescribeCacheEngineVersionsPages iterates over the pages of a DescribeCacheEngineVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheEngineVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeCacheEngineVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCacheEngineVersions operation. -// pageNum := 0 -// err := client.DescribeCacheEngineVersionsPages(params, -// func(page *DescribeCacheEngineVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheEngineVersionsPages(input *DescribeCacheEngineVersionsInput, fn func(*DescribeCacheEngineVersionsOutput, bool) bool) error { - return c.DescribeCacheEngineVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeCacheEngineVersionsPagesWithContext same as DescribeCacheEngineVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeCacheEngineVersionsPagesWithContext(ctx aws.Context, input *DescribeCacheEngineVersionsInput, fn func(*DescribeCacheEngineVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeCacheEngineVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeCacheEngineVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeCacheEngineVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeCacheEngineVersionsRequest) Paginate(opts ...aws.Option) DescribeCacheEngineVersionsPager { + return DescribeCacheEngineVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeCacheEngineVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheEngineVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeCacheEngineVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeCacheEngineVersionsPager struct { + aws.Pager +} + +func (p *DescribeCacheEngineVersionsPager) CurrentPage() *DescribeCacheEngineVersionsOutput { + return p.Pager.CurrentPage().(*DescribeCacheEngineVersionsOutput) } const opDescribeCacheParameterGroups = "DescribeCacheParameterGroups" @@ -1150,6 +1159,7 @@ const opDescribeCacheParameterGroups = "DescribeCacheParameterGroups" type DescribeCacheParameterGroupsRequest struct { *aws.Request Input *DescribeCacheParameterGroupsInput + Copy func(*DescribeCacheParameterGroupsInput) DescribeCacheParameterGroupsRequest } // Send marshals and sends the DescribeCacheParameterGroups API request. @@ -1198,57 +1208,53 @@ func (c *ElastiCache) DescribeCacheParameterGroupsRequest(input *DescribeCachePa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCacheParameterGroupsRequest{Request: req, Input: input} + return DescribeCacheParameterGroupsRequest{Request: req, Input: input, Copy: c.DescribeCacheParameterGroupsRequest} } -// DescribeCacheParameterGroupsPages iterates over the pages of a DescribeCacheParameterGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheParameterGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeCacheParameterGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCacheParameterGroups operation. -// pageNum := 0 -// err := client.DescribeCacheParameterGroupsPages(params, -// func(page *DescribeCacheParameterGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheParameterGroupsPages(input *DescribeCacheParameterGroupsInput, fn func(*DescribeCacheParameterGroupsOutput, bool) bool) error { - return c.DescribeCacheParameterGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeCacheParameterGroupsPagesWithContext same as DescribeCacheParameterGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeCacheParameterGroupsPagesWithContext(ctx aws.Context, input *DescribeCacheParameterGroupsInput, fn func(*DescribeCacheParameterGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeCacheParameterGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeCacheParameterGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeCacheParameterGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeCacheParameterGroupsRequest) Paginate(opts ...aws.Option) DescribeCacheParameterGroupsPager { + return DescribeCacheParameterGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeCacheParameterGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheParameterGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeCacheParameterGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeCacheParameterGroupsPager struct { + aws.Pager +} + +func (p *DescribeCacheParameterGroupsPager) CurrentPage() *DescribeCacheParameterGroupsOutput { + return p.Pager.CurrentPage().(*DescribeCacheParameterGroupsOutput) } const opDescribeCacheParameters = "DescribeCacheParameters" @@ -1257,6 +1263,7 @@ const opDescribeCacheParameters = "DescribeCacheParameters" type DescribeCacheParametersRequest struct { *aws.Request Input *DescribeCacheParametersInput + Copy func(*DescribeCacheParametersInput) DescribeCacheParametersRequest } // Send marshals and sends the DescribeCacheParameters API request. @@ -1303,57 +1310,53 @@ func (c *ElastiCache) DescribeCacheParametersRequest(input *DescribeCacheParamet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCacheParametersRequest{Request: req, Input: input} + return DescribeCacheParametersRequest{Request: req, Input: input, Copy: c.DescribeCacheParametersRequest} } -// DescribeCacheParametersPages iterates over the pages of a DescribeCacheParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheParameters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeCacheParametersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCacheParameters operation. -// pageNum := 0 -// err := client.DescribeCacheParametersPages(params, -// func(page *DescribeCacheParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheParametersPages(input *DescribeCacheParametersInput, fn func(*DescribeCacheParametersOutput, bool) bool) error { - return c.DescribeCacheParametersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeCacheParametersPagesWithContext same as DescribeCacheParametersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeCacheParametersPagesWithContext(ctx aws.Context, input *DescribeCacheParametersInput, fn func(*DescribeCacheParametersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeCacheParametersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeCacheParametersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeCacheParametersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeCacheParametersRequest) Paginate(opts ...aws.Option) DescribeCacheParametersPager { + return DescribeCacheParametersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeCacheParametersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheParametersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeCacheParametersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeCacheParametersPager struct { + aws.Pager +} + +func (p *DescribeCacheParametersPager) CurrentPage() *DescribeCacheParametersOutput { + return p.Pager.CurrentPage().(*DescribeCacheParametersOutput) } const opDescribeCacheSecurityGroups = "DescribeCacheSecurityGroups" @@ -1362,6 +1365,7 @@ const opDescribeCacheSecurityGroups = "DescribeCacheSecurityGroups" type DescribeCacheSecurityGroupsRequest struct { *aws.Request Input *DescribeCacheSecurityGroupsInput + Copy func(*DescribeCacheSecurityGroupsInput) DescribeCacheSecurityGroupsRequest } // Send marshals and sends the DescribeCacheSecurityGroups API request. @@ -1409,57 +1413,53 @@ func (c *ElastiCache) DescribeCacheSecurityGroupsRequest(input *DescribeCacheSec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCacheSecurityGroupsRequest{Request: req, Input: input} + return DescribeCacheSecurityGroupsRequest{Request: req, Input: input, Copy: c.DescribeCacheSecurityGroupsRequest} } -// DescribeCacheSecurityGroupsPages iterates over the pages of a DescribeCacheSecurityGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheSecurityGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeCacheSecurityGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCacheSecurityGroups operation. -// pageNum := 0 -// err := client.DescribeCacheSecurityGroupsPages(params, -// func(page *DescribeCacheSecurityGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheSecurityGroupsPages(input *DescribeCacheSecurityGroupsInput, fn func(*DescribeCacheSecurityGroupsOutput, bool) bool) error { - return c.DescribeCacheSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeCacheSecurityGroupsPagesWithContext same as DescribeCacheSecurityGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeCacheSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeCacheSecurityGroupsInput, fn func(*DescribeCacheSecurityGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeCacheSecurityGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeCacheSecurityGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeCacheSecurityGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeCacheSecurityGroupsRequest) Paginate(opts ...aws.Option) DescribeCacheSecurityGroupsPager { + return DescribeCacheSecurityGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeCacheSecurityGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheSecurityGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeCacheSecurityGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeCacheSecurityGroupsPager struct { + aws.Pager +} + +func (p *DescribeCacheSecurityGroupsPager) CurrentPage() *DescribeCacheSecurityGroupsOutput { + return p.Pager.CurrentPage().(*DescribeCacheSecurityGroupsOutput) } const opDescribeCacheSubnetGroups = "DescribeCacheSubnetGroups" @@ -1468,6 +1468,7 @@ const opDescribeCacheSubnetGroups = "DescribeCacheSubnetGroups" type DescribeCacheSubnetGroupsRequest struct { *aws.Request Input *DescribeCacheSubnetGroupsInput + Copy func(*DescribeCacheSubnetGroupsInput) DescribeCacheSubnetGroupsRequest } // Send marshals and sends the DescribeCacheSubnetGroups API request. @@ -1515,57 +1516,53 @@ func (c *ElastiCache) DescribeCacheSubnetGroupsRequest(input *DescribeCacheSubne req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCacheSubnetGroupsRequest{Request: req, Input: input} + return DescribeCacheSubnetGroupsRequest{Request: req, Input: input, Copy: c.DescribeCacheSubnetGroupsRequest} } -// DescribeCacheSubnetGroupsPages iterates over the pages of a DescribeCacheSubnetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheSubnetGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeCacheSubnetGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCacheSubnetGroups operation. -// pageNum := 0 -// err := client.DescribeCacheSubnetGroupsPages(params, -// func(page *DescribeCacheSubnetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheSubnetGroupsPages(input *DescribeCacheSubnetGroupsInput, fn func(*DescribeCacheSubnetGroupsOutput, bool) bool) error { - return c.DescribeCacheSubnetGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeCacheSubnetGroupsPagesWithContext same as DescribeCacheSubnetGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeCacheSubnetGroupsPagesWithContext(ctx aws.Context, input *DescribeCacheSubnetGroupsInput, fn func(*DescribeCacheSubnetGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeCacheSubnetGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeCacheSubnetGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeCacheSubnetGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeCacheSubnetGroupsRequest) Paginate(opts ...aws.Option) DescribeCacheSubnetGroupsPager { + return DescribeCacheSubnetGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeCacheSubnetGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheSubnetGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeCacheSubnetGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeCacheSubnetGroupsPager struct { + aws.Pager +} + +func (p *DescribeCacheSubnetGroupsPager) CurrentPage() *DescribeCacheSubnetGroupsOutput { + return p.Pager.CurrentPage().(*DescribeCacheSubnetGroupsOutput) } const opDescribeEngineDefaultParameters = "DescribeEngineDefaultParameters" @@ -1574,6 +1571,7 @@ const opDescribeEngineDefaultParameters = "DescribeEngineDefaultParameters" type DescribeEngineDefaultParametersRequest struct { *aws.Request Input *DescribeEngineDefaultParametersInput + Copy func(*DescribeEngineDefaultParametersInput) DescribeEngineDefaultParametersRequest } // Send marshals and sends the DescribeEngineDefaultParameters API request. @@ -1621,57 +1619,53 @@ func (c *ElastiCache) DescribeEngineDefaultParametersRequest(input *DescribeEngi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEngineDefaultParametersRequest{Request: req, Input: input} + return DescribeEngineDefaultParametersRequest{Request: req, Input: input, Copy: c.DescribeEngineDefaultParametersRequest} } -// DescribeEngineDefaultParametersPages iterates over the pages of a DescribeEngineDefaultParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEngineDefaultParameters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEngineDefaultParametersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEngineDefaultParameters operation. -// pageNum := 0 -// err := client.DescribeEngineDefaultParametersPages(params, -// func(page *DescribeEngineDefaultParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeEngineDefaultParametersPages(input *DescribeEngineDefaultParametersInput, fn func(*DescribeEngineDefaultParametersOutput, bool) bool) error { - return c.DescribeEngineDefaultParametersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEngineDefaultParametersPagesWithContext same as DescribeEngineDefaultParametersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeEngineDefaultParametersPagesWithContext(ctx aws.Context, input *DescribeEngineDefaultParametersInput, fn func(*DescribeEngineDefaultParametersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEngineDefaultParametersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEngineDefaultParametersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEngineDefaultParametersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEngineDefaultParametersRequest) Paginate(opts ...aws.Option) DescribeEngineDefaultParametersPager { + return DescribeEngineDefaultParametersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEngineDefaultParametersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEngineDefaultParametersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEngineDefaultParametersPager struct { + aws.Pager +} + +func (p *DescribeEngineDefaultParametersPager) CurrentPage() *DescribeEngineDefaultParametersOutput { + return p.Pager.CurrentPage().(*DescribeEngineDefaultParametersOutput) } const opDescribeEvents = "DescribeEvents" @@ -1680,6 +1674,7 @@ const opDescribeEvents = "DescribeEvents" type DescribeEventsRequest struct { *aws.Request Input *DescribeEventsInput + Copy func(*DescribeEventsInput) DescribeEventsRequest } // Send marshals and sends the DescribeEvents API request. @@ -1731,57 +1726,53 @@ func (c *ElastiCache) DescribeEventsRequest(input *DescribeEventsInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventsRequest{Request: req, Input: input} + return DescribeEventsRequest{Request: req, Input: input, Copy: c.DescribeEventsRequest} } -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeEventsPages(input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool) error { - return c.DescribeEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventsPagesWithContext same as DescribeEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeEventsPagesWithContext(ctx aws.Context, input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEventsRequest) Paginate(opts ...aws.Option) DescribeEventsPager { + return DescribeEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventsPager struct { + aws.Pager +} + +func (p *DescribeEventsPager) CurrentPage() *DescribeEventsOutput { + return p.Pager.CurrentPage().(*DescribeEventsOutput) } const opDescribeReplicationGroups = "DescribeReplicationGroups" @@ -1790,6 +1781,7 @@ const opDescribeReplicationGroups = "DescribeReplicationGroups" type DescribeReplicationGroupsRequest struct { *aws.Request Input *DescribeReplicationGroupsInput + Copy func(*DescribeReplicationGroupsInput) DescribeReplicationGroupsRequest } // Send marshals and sends the DescribeReplicationGroups API request. @@ -1840,57 +1832,53 @@ func (c *ElastiCache) DescribeReplicationGroupsRequest(input *DescribeReplicatio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReplicationGroupsRequest{Request: req, Input: input} + return DescribeReplicationGroupsRequest{Request: req, Input: input, Copy: c.DescribeReplicationGroupsRequest} } -// DescribeReplicationGroupsPages iterates over the pages of a DescribeReplicationGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReplicationGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReplicationGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReplicationGroups operation. -// pageNum := 0 -// err := client.DescribeReplicationGroupsPages(params, -// func(page *DescribeReplicationGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeReplicationGroupsPages(input *DescribeReplicationGroupsInput, fn func(*DescribeReplicationGroupsOutput, bool) bool) error { - return c.DescribeReplicationGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReplicationGroupsPagesWithContext same as DescribeReplicationGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeReplicationGroupsPagesWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, fn func(*DescribeReplicationGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReplicationGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReplicationGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReplicationGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReplicationGroupsRequest) Paginate(opts ...aws.Option) DescribeReplicationGroupsPager { + return DescribeReplicationGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReplicationGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReplicationGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReplicationGroupsPager struct { + aws.Pager +} + +func (p *DescribeReplicationGroupsPager) CurrentPage() *DescribeReplicationGroupsOutput { + return p.Pager.CurrentPage().(*DescribeReplicationGroupsOutput) } const opDescribeReservedCacheNodes = "DescribeReservedCacheNodes" @@ -1899,6 +1887,7 @@ const opDescribeReservedCacheNodes = "DescribeReservedCacheNodes" type DescribeReservedCacheNodesRequest struct { *aws.Request Input *DescribeReservedCacheNodesInput + Copy func(*DescribeReservedCacheNodesInput) DescribeReservedCacheNodesRequest } // Send marshals and sends the DescribeReservedCacheNodes API request. @@ -1946,57 +1935,53 @@ func (c *ElastiCache) DescribeReservedCacheNodesRequest(input *DescribeReservedC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedCacheNodesRequest{Request: req, Input: input} + return DescribeReservedCacheNodesRequest{Request: req, Input: input, Copy: c.DescribeReservedCacheNodesRequest} } -// DescribeReservedCacheNodesPages iterates over the pages of a DescribeReservedCacheNodes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedCacheNodes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReservedCacheNodesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReservedCacheNodes operation. -// pageNum := 0 -// err := client.DescribeReservedCacheNodesPages(params, -// func(page *DescribeReservedCacheNodesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeReservedCacheNodesPages(input *DescribeReservedCacheNodesInput, fn func(*DescribeReservedCacheNodesOutput, bool) bool) error { - return c.DescribeReservedCacheNodesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedCacheNodesPagesWithContext same as DescribeReservedCacheNodesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeReservedCacheNodesPagesWithContext(ctx aws.Context, input *DescribeReservedCacheNodesInput, fn func(*DescribeReservedCacheNodesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReservedCacheNodesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReservedCacheNodesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReservedCacheNodesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReservedCacheNodesRequest) Paginate(opts ...aws.Option) DescribeReservedCacheNodesPager { + return DescribeReservedCacheNodesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReservedCacheNodesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedCacheNodesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReservedCacheNodesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReservedCacheNodesPager struct { + aws.Pager +} + +func (p *DescribeReservedCacheNodesPager) CurrentPage() *DescribeReservedCacheNodesOutput { + return p.Pager.CurrentPage().(*DescribeReservedCacheNodesOutput) } const opDescribeReservedCacheNodesOfferings = "DescribeReservedCacheNodesOfferings" @@ -2005,6 +1990,7 @@ const opDescribeReservedCacheNodesOfferings = "DescribeReservedCacheNodesOfferin type DescribeReservedCacheNodesOfferingsRequest struct { *aws.Request Input *DescribeReservedCacheNodesOfferingsInput + Copy func(*DescribeReservedCacheNodesOfferingsInput) DescribeReservedCacheNodesOfferingsRequest } // Send marshals and sends the DescribeReservedCacheNodesOfferings API request. @@ -2051,57 +2037,53 @@ func (c *ElastiCache) DescribeReservedCacheNodesOfferingsRequest(input *Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedCacheNodesOfferingsRequest{Request: req, Input: input} + return DescribeReservedCacheNodesOfferingsRequest{Request: req, Input: input, Copy: c.DescribeReservedCacheNodesOfferingsRequest} } -// DescribeReservedCacheNodesOfferingsPages iterates over the pages of a DescribeReservedCacheNodesOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedCacheNodesOfferings method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReservedCacheNodesOfferingsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReservedCacheNodesOfferings operation. -// pageNum := 0 -// err := client.DescribeReservedCacheNodesOfferingsPages(params, -// func(page *DescribeReservedCacheNodesOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeReservedCacheNodesOfferingsPages(input *DescribeReservedCacheNodesOfferingsInput, fn func(*DescribeReservedCacheNodesOfferingsOutput, bool) bool) error { - return c.DescribeReservedCacheNodesOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedCacheNodesOfferingsPagesWithContext same as DescribeReservedCacheNodesOfferingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeReservedCacheNodesOfferingsPagesWithContext(ctx aws.Context, input *DescribeReservedCacheNodesOfferingsInput, fn func(*DescribeReservedCacheNodesOfferingsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReservedCacheNodesOfferingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReservedCacheNodesOfferingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReservedCacheNodesOfferingsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReservedCacheNodesOfferingsRequest) Paginate(opts ...aws.Option) DescribeReservedCacheNodesOfferingsPager { + return DescribeReservedCacheNodesOfferingsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReservedCacheNodesOfferingsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedCacheNodesOfferingsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReservedCacheNodesOfferingsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReservedCacheNodesOfferingsPager struct { + aws.Pager +} + +func (p *DescribeReservedCacheNodesOfferingsPager) CurrentPage() *DescribeReservedCacheNodesOfferingsOutput { + return p.Pager.CurrentPage().(*DescribeReservedCacheNodesOfferingsOutput) } const opDescribeSnapshots = "DescribeSnapshots" @@ -2110,6 +2092,7 @@ const opDescribeSnapshots = "DescribeSnapshots" type DescribeSnapshotsRequest struct { *aws.Request Input *DescribeSnapshotsInput + Copy func(*DescribeSnapshotsInput) DescribeSnapshotsRequest } // Send marshals and sends the DescribeSnapshots API request. @@ -2161,57 +2144,53 @@ func (c *ElastiCache) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSnapshotsRequest{Request: req, Input: input} + return DescribeSnapshotsRequest{Request: req, Input: input, Copy: c.DescribeSnapshotsRequest} } -// DescribeSnapshotsPages iterates over the pages of a DescribeSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSnapshots method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeSnapshotsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeSnapshots operation. -// pageNum := 0 -// err := client.DescribeSnapshotsPages(params, -// func(page *DescribeSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool) error { - return c.DescribeSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSnapshotsPagesWithContext same as DescribeSnapshotsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElastiCache) DescribeSnapshotsPagesWithContext(ctx aws.Context, input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeSnapshotsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeSnapshotsRequest) Paginate(opts ...aws.Option) DescribeSnapshotsPager { + return DescribeSnapshotsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeSnapshotsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeSnapshotsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeSnapshotsPager struct { + aws.Pager +} + +func (p *DescribeSnapshotsPager) CurrentPage() *DescribeSnapshotsOutput { + return p.Pager.CurrentPage().(*DescribeSnapshotsOutput) } const opListAllowedNodeTypeModifications = "ListAllowedNodeTypeModifications" @@ -2220,6 +2199,7 @@ const opListAllowedNodeTypeModifications = "ListAllowedNodeTypeModifications" type ListAllowedNodeTypeModificationsRequest struct { *aws.Request Input *ListAllowedNodeTypeModificationsInput + Copy func(*ListAllowedNodeTypeModificationsInput) ListAllowedNodeTypeModificationsRequest } // Send marshals and sends the ListAllowedNodeTypeModifications API request. @@ -2265,7 +2245,7 @@ func (c *ElastiCache) ListAllowedNodeTypeModificationsRequest(input *ListAllowed req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAllowedNodeTypeModificationsRequest{Request: req, Input: input} + return ListAllowedNodeTypeModificationsRequest{Request: req, Input: input, Copy: c.ListAllowedNodeTypeModificationsRequest} } const opListTagsForResource = "ListTagsForResource" @@ -2274,6 +2254,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -2321,7 +2302,7 @@ func (c *ElastiCache) ListTagsForResourceRequest(input *ListTagsForResourceInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opModifyCacheCluster = "ModifyCacheCluster" @@ -2330,6 +2311,7 @@ const opModifyCacheCluster = "ModifyCacheCluster" type ModifyCacheClusterRequest struct { *aws.Request Input *ModifyCacheClusterInput + Copy func(*ModifyCacheClusterInput) ModifyCacheClusterRequest } // Send marshals and sends the ModifyCacheCluster API request. @@ -2372,7 +2354,7 @@ func (c *ElastiCache) ModifyCacheClusterRequest(input *ModifyCacheClusterInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyCacheClusterRequest{Request: req, Input: input} + return ModifyCacheClusterRequest{Request: req, Input: input, Copy: c.ModifyCacheClusterRequest} } const opModifyCacheParameterGroup = "ModifyCacheParameterGroup" @@ -2381,6 +2363,7 @@ const opModifyCacheParameterGroup = "ModifyCacheParameterGroup" type ModifyCacheParameterGroupRequest struct { *aws.Request Input *ModifyCacheParameterGroupInput + Copy func(*ModifyCacheParameterGroupInput) ModifyCacheParameterGroupRequest } // Send marshals and sends the ModifyCacheParameterGroup API request. @@ -2423,7 +2406,7 @@ func (c *ElastiCache) ModifyCacheParameterGroupRequest(input *ModifyCacheParamet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyCacheParameterGroupRequest{Request: req, Input: input} + return ModifyCacheParameterGroupRequest{Request: req, Input: input, Copy: c.ModifyCacheParameterGroupRequest} } const opModifyCacheSubnetGroup = "ModifyCacheSubnetGroup" @@ -2432,6 +2415,7 @@ const opModifyCacheSubnetGroup = "ModifyCacheSubnetGroup" type ModifyCacheSubnetGroupRequest struct { *aws.Request Input *ModifyCacheSubnetGroupInput + Copy func(*ModifyCacheSubnetGroupInput) ModifyCacheSubnetGroupRequest } // Send marshals and sends the ModifyCacheSubnetGroup API request. @@ -2472,7 +2456,7 @@ func (c *ElastiCache) ModifyCacheSubnetGroupRequest(input *ModifyCacheSubnetGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyCacheSubnetGroupRequest{Request: req, Input: input} + return ModifyCacheSubnetGroupRequest{Request: req, Input: input, Copy: c.ModifyCacheSubnetGroupRequest} } const opModifyReplicationGroup = "ModifyReplicationGroup" @@ -2481,6 +2465,7 @@ const opModifyReplicationGroup = "ModifyReplicationGroup" type ModifyReplicationGroupRequest struct { *aws.Request Input *ModifyReplicationGroupInput + Copy func(*ModifyReplicationGroupInput) ModifyReplicationGroupRequest } // Send marshals and sends the ModifyReplicationGroup API request. @@ -2527,7 +2512,7 @@ func (c *ElastiCache) ModifyReplicationGroupRequest(input *ModifyReplicationGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyReplicationGroupRequest{Request: req, Input: input} + return ModifyReplicationGroupRequest{Request: req, Input: input, Copy: c.ModifyReplicationGroupRequest} } const opModifyReplicationGroupShardConfiguration = "ModifyReplicationGroupShardConfiguration" @@ -2536,6 +2521,7 @@ const opModifyReplicationGroupShardConfiguration = "ModifyReplicationGroupShardC type ModifyReplicationGroupShardConfigurationRequest struct { *aws.Request Input *ModifyReplicationGroupShardConfigurationInput + Copy func(*ModifyReplicationGroupShardConfigurationInput) ModifyReplicationGroupShardConfigurationRequest } // Send marshals and sends the ModifyReplicationGroupShardConfiguration API request. @@ -2583,7 +2569,7 @@ func (c *ElastiCache) ModifyReplicationGroupShardConfigurationRequest(input *Mod req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyReplicationGroupShardConfigurationRequest{Request: req, Input: input} + return ModifyReplicationGroupShardConfigurationRequest{Request: req, Input: input, Copy: c.ModifyReplicationGroupShardConfigurationRequest} } const opPurchaseReservedCacheNodesOffering = "PurchaseReservedCacheNodesOffering" @@ -2592,6 +2578,7 @@ const opPurchaseReservedCacheNodesOffering = "PurchaseReservedCacheNodesOffering type PurchaseReservedCacheNodesOfferingRequest struct { *aws.Request Input *PurchaseReservedCacheNodesOfferingInput + Copy func(*PurchaseReservedCacheNodesOfferingInput) PurchaseReservedCacheNodesOfferingRequest } // Send marshals and sends the PurchaseReservedCacheNodesOffering API request. @@ -2632,7 +2619,7 @@ func (c *ElastiCache) PurchaseReservedCacheNodesOfferingRequest(input *PurchaseR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PurchaseReservedCacheNodesOfferingRequest{Request: req, Input: input} + return PurchaseReservedCacheNodesOfferingRequest{Request: req, Input: input, Copy: c.PurchaseReservedCacheNodesOfferingRequest} } const opRebootCacheCluster = "RebootCacheCluster" @@ -2641,6 +2628,7 @@ const opRebootCacheCluster = "RebootCacheCluster" type RebootCacheClusterRequest struct { *aws.Request Input *RebootCacheClusterInput + Copy func(*RebootCacheClusterInput) RebootCacheClusterRequest } // Send marshals and sends the RebootCacheCluster API request. @@ -2697,7 +2685,7 @@ func (c *ElastiCache) RebootCacheClusterRequest(input *RebootCacheClusterInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RebootCacheClusterRequest{Request: req, Input: input} + return RebootCacheClusterRequest{Request: req, Input: input, Copy: c.RebootCacheClusterRequest} } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -2706,6 +2694,7 @@ const opRemoveTagsFromResource = "RemoveTagsFromResource" type RemoveTagsFromResourceRequest struct { *aws.Request Input *RemoveTagsFromResourceInput + Copy func(*RemoveTagsFromResourceInput) RemoveTagsFromResourceRequest } // Send marshals and sends the RemoveTagsFromResource API request. @@ -2746,7 +2735,7 @@ func (c *ElastiCache) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromResourceRequest{Request: req, Input: input} + return RemoveTagsFromResourceRequest{Request: req, Input: input, Copy: c.RemoveTagsFromResourceRequest} } const opResetCacheParameterGroup = "ResetCacheParameterGroup" @@ -2755,6 +2744,7 @@ const opResetCacheParameterGroup = "ResetCacheParameterGroup" type ResetCacheParameterGroupRequest struct { *aws.Request Input *ResetCacheParameterGroupInput + Copy func(*ResetCacheParameterGroupInput) ResetCacheParameterGroupRequest } // Send marshals and sends the ResetCacheParameterGroup API request. @@ -2798,7 +2788,7 @@ func (c *ElastiCache) ResetCacheParameterGroupRequest(input *ResetCacheParameter req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetCacheParameterGroupRequest{Request: req, Input: input} + return ResetCacheParameterGroupRequest{Request: req, Input: input, Copy: c.ResetCacheParameterGroupRequest} } const opRevokeCacheSecurityGroupIngress = "RevokeCacheSecurityGroupIngress" @@ -2807,6 +2797,7 @@ const opRevokeCacheSecurityGroupIngress = "RevokeCacheSecurityGroupIngress" type RevokeCacheSecurityGroupIngressRequest struct { *aws.Request Input *RevokeCacheSecurityGroupIngressInput + Copy func(*RevokeCacheSecurityGroupIngressInput) RevokeCacheSecurityGroupIngressRequest } // Send marshals and sends the RevokeCacheSecurityGroupIngress API request. @@ -2848,7 +2839,7 @@ func (c *ElastiCache) RevokeCacheSecurityGroupIngressRequest(input *RevokeCacheS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RevokeCacheSecurityGroupIngressRequest{Request: req, Input: input} + return RevokeCacheSecurityGroupIngressRequest{Request: req, Input: input, Copy: c.RevokeCacheSecurityGroupIngressRequest} } const opTestFailover = "TestFailover" @@ -2857,6 +2848,7 @@ const opTestFailover = "TestFailover" type TestFailoverRequest struct { *aws.Request Input *TestFailoverInput + Copy func(*TestFailoverInput) TestFailoverRequest } // Send marshals and sends the TestFailover API request. @@ -2940,7 +2932,7 @@ func (c *ElastiCache) TestFailoverRequest(input *TestFailoverInput) TestFailover req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestFailoverRequest{Request: req, Input: input} + return TestFailoverRequest{Request: req, Input: input, Copy: c.TestFailoverRequest} } // Represents the input of an AddTagsToResource operation. diff --git a/service/elasticache/elasticacheiface/interface.go b/service/elasticache/elasticacheiface/interface.go index b2f98ba897e..e731aedd3e9 100644 --- a/service/elasticache/elasticacheiface/interface.go +++ b/service/elasticache/elasticacheiface/interface.go @@ -95,64 +95,28 @@ type ElastiCacheAPI interface { DescribeCacheClustersRequest(*elasticache.DescribeCacheClustersInput) elasticache.DescribeCacheClustersRequest - DescribeCacheClustersPages(*elasticache.DescribeCacheClustersInput, func(*elasticache.DescribeCacheClustersOutput, bool) bool) error - DescribeCacheClustersPagesWithContext(aws.Context, *elasticache.DescribeCacheClustersInput, func(*elasticache.DescribeCacheClustersOutput, bool) bool, ...aws.Option) error - DescribeCacheEngineVersionsRequest(*elasticache.DescribeCacheEngineVersionsInput) elasticache.DescribeCacheEngineVersionsRequest - DescribeCacheEngineVersionsPages(*elasticache.DescribeCacheEngineVersionsInput, func(*elasticache.DescribeCacheEngineVersionsOutput, bool) bool) error - DescribeCacheEngineVersionsPagesWithContext(aws.Context, *elasticache.DescribeCacheEngineVersionsInput, func(*elasticache.DescribeCacheEngineVersionsOutput, bool) bool, ...aws.Option) error - DescribeCacheParameterGroupsRequest(*elasticache.DescribeCacheParameterGroupsInput) elasticache.DescribeCacheParameterGroupsRequest - DescribeCacheParameterGroupsPages(*elasticache.DescribeCacheParameterGroupsInput, func(*elasticache.DescribeCacheParameterGroupsOutput, bool) bool) error - DescribeCacheParameterGroupsPagesWithContext(aws.Context, *elasticache.DescribeCacheParameterGroupsInput, func(*elasticache.DescribeCacheParameterGroupsOutput, bool) bool, ...aws.Option) error - DescribeCacheParametersRequest(*elasticache.DescribeCacheParametersInput) elasticache.DescribeCacheParametersRequest - DescribeCacheParametersPages(*elasticache.DescribeCacheParametersInput, func(*elasticache.DescribeCacheParametersOutput, bool) bool) error - DescribeCacheParametersPagesWithContext(aws.Context, *elasticache.DescribeCacheParametersInput, func(*elasticache.DescribeCacheParametersOutput, bool) bool, ...aws.Option) error - DescribeCacheSecurityGroupsRequest(*elasticache.DescribeCacheSecurityGroupsInput) elasticache.DescribeCacheSecurityGroupsRequest - DescribeCacheSecurityGroupsPages(*elasticache.DescribeCacheSecurityGroupsInput, func(*elasticache.DescribeCacheSecurityGroupsOutput, bool) bool) error - DescribeCacheSecurityGroupsPagesWithContext(aws.Context, *elasticache.DescribeCacheSecurityGroupsInput, func(*elasticache.DescribeCacheSecurityGroupsOutput, bool) bool, ...aws.Option) error - DescribeCacheSubnetGroupsRequest(*elasticache.DescribeCacheSubnetGroupsInput) elasticache.DescribeCacheSubnetGroupsRequest - DescribeCacheSubnetGroupsPages(*elasticache.DescribeCacheSubnetGroupsInput, func(*elasticache.DescribeCacheSubnetGroupsOutput, bool) bool) error - DescribeCacheSubnetGroupsPagesWithContext(aws.Context, *elasticache.DescribeCacheSubnetGroupsInput, func(*elasticache.DescribeCacheSubnetGroupsOutput, bool) bool, ...aws.Option) error - DescribeEngineDefaultParametersRequest(*elasticache.DescribeEngineDefaultParametersInput) elasticache.DescribeEngineDefaultParametersRequest - DescribeEngineDefaultParametersPages(*elasticache.DescribeEngineDefaultParametersInput, func(*elasticache.DescribeEngineDefaultParametersOutput, bool) bool) error - DescribeEngineDefaultParametersPagesWithContext(aws.Context, *elasticache.DescribeEngineDefaultParametersInput, func(*elasticache.DescribeEngineDefaultParametersOutput, bool) bool, ...aws.Option) error - DescribeEventsRequest(*elasticache.DescribeEventsInput) elasticache.DescribeEventsRequest - DescribeEventsPages(*elasticache.DescribeEventsInput, func(*elasticache.DescribeEventsOutput, bool) bool) error - DescribeEventsPagesWithContext(aws.Context, *elasticache.DescribeEventsInput, func(*elasticache.DescribeEventsOutput, bool) bool, ...aws.Option) error - DescribeReplicationGroupsRequest(*elasticache.DescribeReplicationGroupsInput) elasticache.DescribeReplicationGroupsRequest - DescribeReplicationGroupsPages(*elasticache.DescribeReplicationGroupsInput, func(*elasticache.DescribeReplicationGroupsOutput, bool) bool) error - DescribeReplicationGroupsPagesWithContext(aws.Context, *elasticache.DescribeReplicationGroupsInput, func(*elasticache.DescribeReplicationGroupsOutput, bool) bool, ...aws.Option) error - DescribeReservedCacheNodesRequest(*elasticache.DescribeReservedCacheNodesInput) elasticache.DescribeReservedCacheNodesRequest - DescribeReservedCacheNodesPages(*elasticache.DescribeReservedCacheNodesInput, func(*elasticache.DescribeReservedCacheNodesOutput, bool) bool) error - DescribeReservedCacheNodesPagesWithContext(aws.Context, *elasticache.DescribeReservedCacheNodesInput, func(*elasticache.DescribeReservedCacheNodesOutput, bool) bool, ...aws.Option) error - DescribeReservedCacheNodesOfferingsRequest(*elasticache.DescribeReservedCacheNodesOfferingsInput) elasticache.DescribeReservedCacheNodesOfferingsRequest - DescribeReservedCacheNodesOfferingsPages(*elasticache.DescribeReservedCacheNodesOfferingsInput, func(*elasticache.DescribeReservedCacheNodesOfferingsOutput, bool) bool) error - DescribeReservedCacheNodesOfferingsPagesWithContext(aws.Context, *elasticache.DescribeReservedCacheNodesOfferingsInput, func(*elasticache.DescribeReservedCacheNodesOfferingsOutput, bool) bool, ...aws.Option) error - DescribeSnapshotsRequest(*elasticache.DescribeSnapshotsInput) elasticache.DescribeSnapshotsRequest - DescribeSnapshotsPages(*elasticache.DescribeSnapshotsInput, func(*elasticache.DescribeSnapshotsOutput, bool) bool) error - DescribeSnapshotsPagesWithContext(aws.Context, *elasticache.DescribeSnapshotsInput, func(*elasticache.DescribeSnapshotsOutput, bool) bool, ...aws.Option) error - ListAllowedNodeTypeModificationsRequest(*elasticache.ListAllowedNodeTypeModificationsInput) elasticache.ListAllowedNodeTypeModificationsRequest ListTagsForResourceRequest(*elasticache.ListTagsForResourceInput) elasticache.ListTagsForResourceRequest diff --git a/service/elasticbeanstalk/api.go b/service/elasticbeanstalk/api.go index fb3c44114f6..2f64a09d827 100644 --- a/service/elasticbeanstalk/api.go +++ b/service/elasticbeanstalk/api.go @@ -18,6 +18,7 @@ const opAbortEnvironmentUpdate = "AbortEnvironmentUpdate" type AbortEnvironmentUpdateRequest struct { *aws.Request Input *AbortEnvironmentUpdateInput + Copy func(*AbortEnvironmentUpdateInput) AbortEnvironmentUpdateRequest } // Send marshals and sends the AbortEnvironmentUpdate API request. @@ -61,7 +62,7 @@ func (c *ElasticBeanstalk) AbortEnvironmentUpdateRequest(input *AbortEnvironment req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AbortEnvironmentUpdateRequest{Request: req, Input: input} + return AbortEnvironmentUpdateRequest{Request: req, Input: input, Copy: c.AbortEnvironmentUpdateRequest} } const opApplyEnvironmentManagedAction = "ApplyEnvironmentManagedAction" @@ -70,6 +71,7 @@ const opApplyEnvironmentManagedAction = "ApplyEnvironmentManagedAction" type ApplyEnvironmentManagedActionRequest struct { *aws.Request Input *ApplyEnvironmentManagedActionInput + Copy func(*ApplyEnvironmentManagedActionInput) ApplyEnvironmentManagedActionRequest } // Send marshals and sends the ApplyEnvironmentManagedAction API request. @@ -112,7 +114,7 @@ func (c *ElasticBeanstalk) ApplyEnvironmentManagedActionRequest(input *ApplyEnvi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ApplyEnvironmentManagedActionRequest{Request: req, Input: input} + return ApplyEnvironmentManagedActionRequest{Request: req, Input: input, Copy: c.ApplyEnvironmentManagedActionRequest} } const opCheckDNSAvailability = "CheckDNSAvailability" @@ -121,6 +123,7 @@ const opCheckDNSAvailability = "CheckDNSAvailability" type CheckDNSAvailabilityRequest struct { *aws.Request Input *CheckDNSAvailabilityInput + Copy func(*CheckDNSAvailabilityInput) CheckDNSAvailabilityRequest } // Send marshals and sends the CheckDNSAvailability API request. @@ -161,7 +164,7 @@ func (c *ElasticBeanstalk) CheckDNSAvailabilityRequest(input *CheckDNSAvailabili req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CheckDNSAvailabilityRequest{Request: req, Input: input} + return CheckDNSAvailabilityRequest{Request: req, Input: input, Copy: c.CheckDNSAvailabilityRequest} } const opComposeEnvironments = "ComposeEnvironments" @@ -170,6 +173,7 @@ const opComposeEnvironments = "ComposeEnvironments" type ComposeEnvironmentsRequest struct { *aws.Request Input *ComposeEnvironmentsInput + Copy func(*ComposeEnvironmentsInput) ComposeEnvironmentsRequest } // Send marshals and sends the ComposeEnvironments API request. @@ -216,7 +220,7 @@ func (c *ElasticBeanstalk) ComposeEnvironmentsRequest(input *ComposeEnvironments req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ComposeEnvironmentsRequest{Request: req, Input: input} + return ComposeEnvironmentsRequest{Request: req, Input: input, Copy: c.ComposeEnvironmentsRequest} } const opCreateApplication = "CreateApplication" @@ -225,6 +229,7 @@ const opCreateApplication = "CreateApplication" type CreateApplicationRequest struct { *aws.Request Input *CreateApplicationInput + Copy func(*CreateApplicationInput) CreateApplicationRequest } // Send marshals and sends the CreateApplication API request. @@ -266,7 +271,7 @@ func (c *ElasticBeanstalk) CreateApplicationRequest(input *CreateApplicationInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateApplicationRequest{Request: req, Input: input} + return CreateApplicationRequest{Request: req, Input: input, Copy: c.CreateApplicationRequest} } const opCreateApplicationVersion = "CreateApplicationVersion" @@ -275,6 +280,7 @@ const opCreateApplicationVersion = "CreateApplicationVersion" type CreateApplicationVersionRequest struct { *aws.Request Input *CreateApplicationVersionInput + Copy func(*CreateApplicationVersionInput) CreateApplicationVersionRequest } // Send marshals and sends the CreateApplicationVersion API request. @@ -331,7 +337,7 @@ func (c *ElasticBeanstalk) CreateApplicationVersionRequest(input *CreateApplicat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateApplicationVersionRequest{Request: req, Input: input} + return CreateApplicationVersionRequest{Request: req, Input: input, Copy: c.CreateApplicationVersionRequest} } const opCreateConfigurationTemplate = "CreateConfigurationTemplate" @@ -340,6 +346,7 @@ const opCreateConfigurationTemplate = "CreateConfigurationTemplate" type CreateConfigurationTemplateRequest struct { *aws.Request Input *CreateConfigurationTemplateInput + Copy func(*CreateConfigurationTemplateInput) CreateConfigurationTemplateRequest } // Send marshals and sends the CreateConfigurationTemplate API request. @@ -390,7 +397,7 @@ func (c *ElasticBeanstalk) CreateConfigurationTemplateRequest(input *CreateConfi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateConfigurationTemplateRequest{Request: req, Input: input} + return CreateConfigurationTemplateRequest{Request: req, Input: input, Copy: c.CreateConfigurationTemplateRequest} } const opCreateEnvironment = "CreateEnvironment" @@ -399,6 +406,7 @@ const opCreateEnvironment = "CreateEnvironment" type CreateEnvironmentRequest struct { *aws.Request Input *CreateEnvironmentInput + Copy func(*CreateEnvironmentInput) CreateEnvironmentRequest } // Send marshals and sends the CreateEnvironment API request. @@ -440,7 +448,7 @@ func (c *ElasticBeanstalk) CreateEnvironmentRequest(input *CreateEnvironmentInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEnvironmentRequest{Request: req, Input: input} + return CreateEnvironmentRequest{Request: req, Input: input, Copy: c.CreateEnvironmentRequest} } const opCreatePlatformVersion = "CreatePlatformVersion" @@ -449,6 +457,7 @@ const opCreatePlatformVersion = "CreatePlatformVersion" type CreatePlatformVersionRequest struct { *aws.Request Input *CreatePlatformVersionInput + Copy func(*CreatePlatformVersionInput) CreatePlatformVersionRequest } // Send marshals and sends the CreatePlatformVersion API request. @@ -489,7 +498,7 @@ func (c *ElasticBeanstalk) CreatePlatformVersionRequest(input *CreatePlatformVer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePlatformVersionRequest{Request: req, Input: input} + return CreatePlatformVersionRequest{Request: req, Input: input, Copy: c.CreatePlatformVersionRequest} } const opCreateStorageLocation = "CreateStorageLocation" @@ -498,6 +507,7 @@ const opCreateStorageLocation = "CreateStorageLocation" type CreateStorageLocationRequest struct { *aws.Request Input *CreateStorageLocationInput + Copy func(*CreateStorageLocationInput) CreateStorageLocationRequest } // Send marshals and sends the CreateStorageLocation API request. @@ -542,7 +552,7 @@ func (c *ElasticBeanstalk) CreateStorageLocationRequest(input *CreateStorageLoca req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStorageLocationRequest{Request: req, Input: input} + return CreateStorageLocationRequest{Request: req, Input: input, Copy: c.CreateStorageLocationRequest} } const opDeleteApplication = "DeleteApplication" @@ -551,6 +561,7 @@ const opDeleteApplication = "DeleteApplication" type DeleteApplicationRequest struct { *aws.Request Input *DeleteApplicationInput + Copy func(*DeleteApplicationInput) DeleteApplicationRequest } // Send marshals and sends the DeleteApplication API request. @@ -597,7 +608,7 @@ func (c *ElasticBeanstalk) DeleteApplicationRequest(input *DeleteApplicationInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteApplicationRequest{Request: req, Input: input} + return DeleteApplicationRequest{Request: req, Input: input, Copy: c.DeleteApplicationRequest} } const opDeleteApplicationVersion = "DeleteApplicationVersion" @@ -606,6 +617,7 @@ const opDeleteApplicationVersion = "DeleteApplicationVersion" type DeleteApplicationVersionRequest struct { *aws.Request Input *DeleteApplicationVersionInput + Copy func(*DeleteApplicationVersionInput) DeleteApplicationVersionRequest } // Send marshals and sends the DeleteApplicationVersion API request. @@ -651,7 +663,7 @@ func (c *ElasticBeanstalk) DeleteApplicationVersionRequest(input *DeleteApplicat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteApplicationVersionRequest{Request: req, Input: input} + return DeleteApplicationVersionRequest{Request: req, Input: input, Copy: c.DeleteApplicationVersionRequest} } const opDeleteConfigurationTemplate = "DeleteConfigurationTemplate" @@ -660,6 +672,7 @@ const opDeleteConfigurationTemplate = "DeleteConfigurationTemplate" type DeleteConfigurationTemplateRequest struct { *aws.Request Input *DeleteConfigurationTemplateInput + Copy func(*DeleteConfigurationTemplateInput) DeleteConfigurationTemplateRequest } // Send marshals and sends the DeleteConfigurationTemplate API request. @@ -706,7 +719,7 @@ func (c *ElasticBeanstalk) DeleteConfigurationTemplateRequest(input *DeleteConfi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteConfigurationTemplateRequest{Request: req, Input: input} + return DeleteConfigurationTemplateRequest{Request: req, Input: input, Copy: c.DeleteConfigurationTemplateRequest} } const opDeleteEnvironmentConfiguration = "DeleteEnvironmentConfiguration" @@ -715,6 +728,7 @@ const opDeleteEnvironmentConfiguration = "DeleteEnvironmentConfiguration" type DeleteEnvironmentConfigurationRequest struct { *aws.Request Input *DeleteEnvironmentConfigurationInput + Copy func(*DeleteEnvironmentConfigurationInput) DeleteEnvironmentConfigurationRequest } // Send marshals and sends the DeleteEnvironmentConfiguration API request. @@ -764,7 +778,7 @@ func (c *ElasticBeanstalk) DeleteEnvironmentConfigurationRequest(input *DeleteEn req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteEnvironmentConfigurationRequest{Request: req, Input: input} + return DeleteEnvironmentConfigurationRequest{Request: req, Input: input, Copy: c.DeleteEnvironmentConfigurationRequest} } const opDeletePlatformVersion = "DeletePlatformVersion" @@ -773,6 +787,7 @@ const opDeletePlatformVersion = "DeletePlatformVersion" type DeletePlatformVersionRequest struct { *aws.Request Input *DeletePlatformVersionInput + Copy func(*DeletePlatformVersionInput) DeletePlatformVersionRequest } // Send marshals and sends the DeletePlatformVersion API request. @@ -813,7 +828,7 @@ func (c *ElasticBeanstalk) DeletePlatformVersionRequest(input *DeletePlatformVer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeletePlatformVersionRequest{Request: req, Input: input} + return DeletePlatformVersionRequest{Request: req, Input: input, Copy: c.DeletePlatformVersionRequest} } const opDescribeApplicationVersions = "DescribeApplicationVersions" @@ -822,6 +837,7 @@ const opDescribeApplicationVersions = "DescribeApplicationVersions" type DescribeApplicationVersionsRequest struct { *aws.Request Input *DescribeApplicationVersionsInput + Copy func(*DescribeApplicationVersionsInput) DescribeApplicationVersionsRequest } // Send marshals and sends the DescribeApplicationVersions API request. @@ -862,7 +878,7 @@ func (c *ElasticBeanstalk) DescribeApplicationVersionsRequest(input *DescribeApp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeApplicationVersionsRequest{Request: req, Input: input} + return DescribeApplicationVersionsRequest{Request: req, Input: input, Copy: c.DescribeApplicationVersionsRequest} } const opDescribeApplications = "DescribeApplications" @@ -871,6 +887,7 @@ const opDescribeApplications = "DescribeApplications" type DescribeApplicationsRequest struct { *aws.Request Input *DescribeApplicationsInput + Copy func(*DescribeApplicationsInput) DescribeApplicationsRequest } // Send marshals and sends the DescribeApplications API request. @@ -911,7 +928,7 @@ func (c *ElasticBeanstalk) DescribeApplicationsRequest(input *DescribeApplicatio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeApplicationsRequest{Request: req, Input: input} + return DescribeApplicationsRequest{Request: req, Input: input, Copy: c.DescribeApplicationsRequest} } const opDescribeConfigurationOptions = "DescribeConfigurationOptions" @@ -920,6 +937,7 @@ const opDescribeConfigurationOptions = "DescribeConfigurationOptions" type DescribeConfigurationOptionsRequest struct { *aws.Request Input *DescribeConfigurationOptionsInput + Copy func(*DescribeConfigurationOptionsInput) DescribeConfigurationOptionsRequest } // Send marshals and sends the DescribeConfigurationOptions API request. @@ -964,7 +982,7 @@ func (c *ElasticBeanstalk) DescribeConfigurationOptionsRequest(input *DescribeCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigurationOptionsRequest{Request: req, Input: input} + return DescribeConfigurationOptionsRequest{Request: req, Input: input, Copy: c.DescribeConfigurationOptionsRequest} } const opDescribeConfigurationSettings = "DescribeConfigurationSettings" @@ -973,6 +991,7 @@ const opDescribeConfigurationSettings = "DescribeConfigurationSettings" type DescribeConfigurationSettingsRequest struct { *aws.Request Input *DescribeConfigurationSettingsInput + Copy func(*DescribeConfigurationSettingsInput) DescribeConfigurationSettingsRequest } // Send marshals and sends the DescribeConfigurationSettings API request. @@ -1025,7 +1044,7 @@ func (c *ElasticBeanstalk) DescribeConfigurationSettingsRequest(input *DescribeC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigurationSettingsRequest{Request: req, Input: input} + return DescribeConfigurationSettingsRequest{Request: req, Input: input, Copy: c.DescribeConfigurationSettingsRequest} } const opDescribeEnvironmentHealth = "DescribeEnvironmentHealth" @@ -1034,6 +1053,7 @@ const opDescribeEnvironmentHealth = "DescribeEnvironmentHealth" type DescribeEnvironmentHealthRequest struct { *aws.Request Input *DescribeEnvironmentHealthInput + Copy func(*DescribeEnvironmentHealthInput) DescribeEnvironmentHealthRequest } // Send marshals and sends the DescribeEnvironmentHealth API request. @@ -1076,7 +1096,7 @@ func (c *ElasticBeanstalk) DescribeEnvironmentHealthRequest(input *DescribeEnvir req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEnvironmentHealthRequest{Request: req, Input: input} + return DescribeEnvironmentHealthRequest{Request: req, Input: input, Copy: c.DescribeEnvironmentHealthRequest} } const opDescribeEnvironmentManagedActionHistory = "DescribeEnvironmentManagedActionHistory" @@ -1085,6 +1105,7 @@ const opDescribeEnvironmentManagedActionHistory = "DescribeEnvironmentManagedAct type DescribeEnvironmentManagedActionHistoryRequest struct { *aws.Request Input *DescribeEnvironmentManagedActionHistoryInput + Copy func(*DescribeEnvironmentManagedActionHistoryInput) DescribeEnvironmentManagedActionHistoryRequest } // Send marshals and sends the DescribeEnvironmentManagedActionHistory API request. @@ -1125,7 +1146,7 @@ func (c *ElasticBeanstalk) DescribeEnvironmentManagedActionHistoryRequest(input req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEnvironmentManagedActionHistoryRequest{Request: req, Input: input} + return DescribeEnvironmentManagedActionHistoryRequest{Request: req, Input: input, Copy: c.DescribeEnvironmentManagedActionHistoryRequest} } const opDescribeEnvironmentManagedActions = "DescribeEnvironmentManagedActions" @@ -1134,6 +1155,7 @@ const opDescribeEnvironmentManagedActions = "DescribeEnvironmentManagedActions" type DescribeEnvironmentManagedActionsRequest struct { *aws.Request Input *DescribeEnvironmentManagedActionsInput + Copy func(*DescribeEnvironmentManagedActionsInput) DescribeEnvironmentManagedActionsRequest } // Send marshals and sends the DescribeEnvironmentManagedActions API request. @@ -1174,7 +1196,7 @@ func (c *ElasticBeanstalk) DescribeEnvironmentManagedActionsRequest(input *Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEnvironmentManagedActionsRequest{Request: req, Input: input} + return DescribeEnvironmentManagedActionsRequest{Request: req, Input: input, Copy: c.DescribeEnvironmentManagedActionsRequest} } const opDescribeEnvironmentResources = "DescribeEnvironmentResources" @@ -1183,6 +1205,7 @@ const opDescribeEnvironmentResources = "DescribeEnvironmentResources" type DescribeEnvironmentResourcesRequest struct { *aws.Request Input *DescribeEnvironmentResourcesInput + Copy func(*DescribeEnvironmentResourcesInput) DescribeEnvironmentResourcesRequest } // Send marshals and sends the DescribeEnvironmentResources API request. @@ -1223,7 +1246,7 @@ func (c *ElasticBeanstalk) DescribeEnvironmentResourcesRequest(input *DescribeEn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEnvironmentResourcesRequest{Request: req, Input: input} + return DescribeEnvironmentResourcesRequest{Request: req, Input: input, Copy: c.DescribeEnvironmentResourcesRequest} } const opDescribeEnvironments = "DescribeEnvironments" @@ -1232,6 +1255,7 @@ const opDescribeEnvironments = "DescribeEnvironments" type DescribeEnvironmentsRequest struct { *aws.Request Input *DescribeEnvironmentsInput + Copy func(*DescribeEnvironmentsInput) DescribeEnvironmentsRequest } // Send marshals and sends the DescribeEnvironments API request. @@ -1272,7 +1296,7 @@ func (c *ElasticBeanstalk) DescribeEnvironmentsRequest(input *DescribeEnvironmen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEnvironmentsRequest{Request: req, Input: input} + return DescribeEnvironmentsRequest{Request: req, Input: input, Copy: c.DescribeEnvironmentsRequest} } const opDescribeEvents = "DescribeEvents" @@ -1281,6 +1305,7 @@ const opDescribeEvents = "DescribeEvents" type DescribeEventsRequest struct { *aws.Request Input *DescribeEventsInput + Copy func(*DescribeEventsInput) DescribeEventsRequest } // Send marshals and sends the DescribeEvents API request. @@ -1329,57 +1354,53 @@ func (c *ElasticBeanstalk) DescribeEventsRequest(input *DescribeEventsInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventsRequest{Request: req, Input: input} + return DescribeEventsRequest{Request: req, Input: input, Copy: c.DescribeEventsRequest} } -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElasticBeanstalk) DescribeEventsPages(input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool) error { - return c.DescribeEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventsPagesWithContext same as DescribeEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElasticBeanstalk) DescribeEventsPagesWithContext(ctx aws.Context, input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEventsRequest) Paginate(opts ...aws.Option) DescribeEventsPager { + return DescribeEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventsPager struct { + aws.Pager +} + +func (p *DescribeEventsPager) CurrentPage() *DescribeEventsOutput { + return p.Pager.CurrentPage().(*DescribeEventsOutput) } const opDescribeInstancesHealth = "DescribeInstancesHealth" @@ -1388,6 +1409,7 @@ const opDescribeInstancesHealth = "DescribeInstancesHealth" type DescribeInstancesHealthRequest struct { *aws.Request Input *DescribeInstancesHealthInput + Copy func(*DescribeInstancesHealthInput) DescribeInstancesHealthRequest } // Send marshals and sends the DescribeInstancesHealth API request. @@ -1429,7 +1451,7 @@ func (c *ElasticBeanstalk) DescribeInstancesHealthRequest(input *DescribeInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstancesHealthRequest{Request: req, Input: input} + return DescribeInstancesHealthRequest{Request: req, Input: input, Copy: c.DescribeInstancesHealthRequest} } const opDescribePlatformVersion = "DescribePlatformVersion" @@ -1438,6 +1460,7 @@ const opDescribePlatformVersion = "DescribePlatformVersion" type DescribePlatformVersionRequest struct { *aws.Request Input *DescribePlatformVersionInput + Copy func(*DescribePlatformVersionInput) DescribePlatformVersionRequest } // Send marshals and sends the DescribePlatformVersion API request. @@ -1478,7 +1501,7 @@ func (c *ElasticBeanstalk) DescribePlatformVersionRequest(input *DescribePlatfor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePlatformVersionRequest{Request: req, Input: input} + return DescribePlatformVersionRequest{Request: req, Input: input, Copy: c.DescribePlatformVersionRequest} } const opListAvailableSolutionStacks = "ListAvailableSolutionStacks" @@ -1487,6 +1510,7 @@ const opListAvailableSolutionStacks = "ListAvailableSolutionStacks" type ListAvailableSolutionStacksRequest struct { *aws.Request Input *ListAvailableSolutionStacksInput + Copy func(*ListAvailableSolutionStacksInput) ListAvailableSolutionStacksRequest } // Send marshals and sends the ListAvailableSolutionStacks API request. @@ -1528,7 +1552,7 @@ func (c *ElasticBeanstalk) ListAvailableSolutionStacksRequest(input *ListAvailab req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAvailableSolutionStacksRequest{Request: req, Input: input} + return ListAvailableSolutionStacksRequest{Request: req, Input: input, Copy: c.ListAvailableSolutionStacksRequest} } const opListPlatformVersions = "ListPlatformVersions" @@ -1537,6 +1561,7 @@ const opListPlatformVersions = "ListPlatformVersions" type ListPlatformVersionsRequest struct { *aws.Request Input *ListPlatformVersionsInput + Copy func(*ListPlatformVersionsInput) ListPlatformVersionsRequest } // Send marshals and sends the ListPlatformVersions API request. @@ -1577,7 +1602,7 @@ func (c *ElasticBeanstalk) ListPlatformVersionsRequest(input *ListPlatformVersio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPlatformVersionsRequest{Request: req, Input: input} + return ListPlatformVersionsRequest{Request: req, Input: input, Copy: c.ListPlatformVersionsRequest} } const opListTagsForResource = "ListTagsForResource" @@ -1586,6 +1611,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -1631,7 +1657,7 @@ func (c *ElasticBeanstalk) ListTagsForResourceRequest(input *ListTagsForResource req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opRebuildEnvironment = "RebuildEnvironment" @@ -1640,6 +1666,7 @@ const opRebuildEnvironment = "RebuildEnvironment" type RebuildEnvironmentRequest struct { *aws.Request Input *RebuildEnvironmentInput + Copy func(*RebuildEnvironmentInput) RebuildEnvironmentRequest } // Send marshals and sends the RebuildEnvironment API request. @@ -1683,7 +1710,7 @@ func (c *ElasticBeanstalk) RebuildEnvironmentRequest(input *RebuildEnvironmentIn req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RebuildEnvironmentRequest{Request: req, Input: input} + return RebuildEnvironmentRequest{Request: req, Input: input, Copy: c.RebuildEnvironmentRequest} } const opRequestEnvironmentInfo = "RequestEnvironmentInfo" @@ -1692,6 +1719,7 @@ const opRequestEnvironmentInfo = "RequestEnvironmentInfo" type RequestEnvironmentInfoRequest struct { *aws.Request Input *RequestEnvironmentInfoInput + Copy func(*RequestEnvironmentInfoInput) RequestEnvironmentInfoRequest } // Send marshals and sends the RequestEnvironmentInfo API request. @@ -1748,7 +1776,7 @@ func (c *ElasticBeanstalk) RequestEnvironmentInfoRequest(input *RequestEnvironme req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RequestEnvironmentInfoRequest{Request: req, Input: input} + return RequestEnvironmentInfoRequest{Request: req, Input: input, Copy: c.RequestEnvironmentInfoRequest} } const opRestartAppServer = "RestartAppServer" @@ -1757,6 +1785,7 @@ const opRestartAppServer = "RestartAppServer" type RestartAppServerRequest struct { *aws.Request Input *RestartAppServerInput + Copy func(*RestartAppServerInput) RestartAppServerRequest } // Send marshals and sends the RestartAppServer API request. @@ -1800,7 +1829,7 @@ func (c *ElasticBeanstalk) RestartAppServerRequest(input *RestartAppServerInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RestartAppServerRequest{Request: req, Input: input} + return RestartAppServerRequest{Request: req, Input: input, Copy: c.RestartAppServerRequest} } const opRetrieveEnvironmentInfo = "RetrieveEnvironmentInfo" @@ -1809,6 +1838,7 @@ const opRetrieveEnvironmentInfo = "RetrieveEnvironmentInfo" type RetrieveEnvironmentInfoRequest struct { *aws.Request Input *RetrieveEnvironmentInfoInput + Copy func(*RetrieveEnvironmentInfoInput) RetrieveEnvironmentInfoRequest } // Send marshals and sends the RetrieveEnvironmentInfo API request. @@ -1853,7 +1883,7 @@ func (c *ElasticBeanstalk) RetrieveEnvironmentInfoRequest(input *RetrieveEnviron req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RetrieveEnvironmentInfoRequest{Request: req, Input: input} + return RetrieveEnvironmentInfoRequest{Request: req, Input: input, Copy: c.RetrieveEnvironmentInfoRequest} } const opSwapEnvironmentCNAMEs = "SwapEnvironmentCNAMEs" @@ -1862,6 +1892,7 @@ const opSwapEnvironmentCNAMEs = "SwapEnvironmentCNAMEs" type SwapEnvironmentCNAMEsRequest struct { *aws.Request Input *SwapEnvironmentCNAMEsInput + Copy func(*SwapEnvironmentCNAMEsInput) SwapEnvironmentCNAMEsRequest } // Send marshals and sends the SwapEnvironmentCNAMEs API request. @@ -1904,7 +1935,7 @@ func (c *ElasticBeanstalk) SwapEnvironmentCNAMEsRequest(input *SwapEnvironmentCN req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SwapEnvironmentCNAMEsRequest{Request: req, Input: input} + return SwapEnvironmentCNAMEsRequest{Request: req, Input: input, Copy: c.SwapEnvironmentCNAMEsRequest} } const opTerminateEnvironment = "TerminateEnvironment" @@ -1913,6 +1944,7 @@ const opTerminateEnvironment = "TerminateEnvironment" type TerminateEnvironmentRequest struct { *aws.Request Input *TerminateEnvironmentInput + Copy func(*TerminateEnvironmentInput) TerminateEnvironmentRequest } // Send marshals and sends the TerminateEnvironment API request. @@ -1953,7 +1985,7 @@ func (c *ElasticBeanstalk) TerminateEnvironmentRequest(input *TerminateEnvironme req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TerminateEnvironmentRequest{Request: req, Input: input} + return TerminateEnvironmentRequest{Request: req, Input: input, Copy: c.TerminateEnvironmentRequest} } const opUpdateApplication = "UpdateApplication" @@ -1962,6 +1994,7 @@ const opUpdateApplication = "UpdateApplication" type UpdateApplicationRequest struct { *aws.Request Input *UpdateApplicationInput + Copy func(*UpdateApplicationInput) UpdateApplicationRequest } // Send marshals and sends the UpdateApplication API request. @@ -2005,7 +2038,7 @@ func (c *ElasticBeanstalk) UpdateApplicationRequest(input *UpdateApplicationInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApplicationRequest{Request: req, Input: input} + return UpdateApplicationRequest{Request: req, Input: input, Copy: c.UpdateApplicationRequest} } const opUpdateApplicationResourceLifecycle = "UpdateApplicationResourceLifecycle" @@ -2014,6 +2047,7 @@ const opUpdateApplicationResourceLifecycle = "UpdateApplicationResourceLifecycle type UpdateApplicationResourceLifecycleRequest struct { *aws.Request Input *UpdateApplicationResourceLifecycleInput + Copy func(*UpdateApplicationResourceLifecycleInput) UpdateApplicationResourceLifecycleRequest } // Send marshals and sends the UpdateApplicationResourceLifecycle API request. @@ -2054,7 +2088,7 @@ func (c *ElasticBeanstalk) UpdateApplicationResourceLifecycleRequest(input *Upda req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApplicationResourceLifecycleRequest{Request: req, Input: input} + return UpdateApplicationResourceLifecycleRequest{Request: req, Input: input, Copy: c.UpdateApplicationResourceLifecycleRequest} } const opUpdateApplicationVersion = "UpdateApplicationVersion" @@ -2063,6 +2097,7 @@ const opUpdateApplicationVersion = "UpdateApplicationVersion" type UpdateApplicationVersionRequest struct { *aws.Request Input *UpdateApplicationVersionInput + Copy func(*UpdateApplicationVersionInput) UpdateApplicationVersionRequest } // Send marshals and sends the UpdateApplicationVersion API request. @@ -2106,7 +2141,7 @@ func (c *ElasticBeanstalk) UpdateApplicationVersionRequest(input *UpdateApplicat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApplicationVersionRequest{Request: req, Input: input} + return UpdateApplicationVersionRequest{Request: req, Input: input, Copy: c.UpdateApplicationVersionRequest} } const opUpdateConfigurationTemplate = "UpdateConfigurationTemplate" @@ -2115,6 +2150,7 @@ const opUpdateConfigurationTemplate = "UpdateConfigurationTemplate" type UpdateConfigurationTemplateRequest struct { *aws.Request Input *UpdateConfigurationTemplateInput + Copy func(*UpdateConfigurationTemplateInput) UpdateConfigurationTemplateRequest } // Send marshals and sends the UpdateConfigurationTemplate API request. @@ -2163,7 +2199,7 @@ func (c *ElasticBeanstalk) UpdateConfigurationTemplateRequest(input *UpdateConfi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateConfigurationTemplateRequest{Request: req, Input: input} + return UpdateConfigurationTemplateRequest{Request: req, Input: input, Copy: c.UpdateConfigurationTemplateRequest} } const opUpdateEnvironment = "UpdateEnvironment" @@ -2172,6 +2208,7 @@ const opUpdateEnvironment = "UpdateEnvironment" type UpdateEnvironmentRequest struct { *aws.Request Input *UpdateEnvironmentInput + Copy func(*UpdateEnvironmentInput) UpdateEnvironmentRequest } // Send marshals and sends the UpdateEnvironment API request. @@ -2222,7 +2259,7 @@ func (c *ElasticBeanstalk) UpdateEnvironmentRequest(input *UpdateEnvironmentInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEnvironmentRequest{Request: req, Input: input} + return UpdateEnvironmentRequest{Request: req, Input: input, Copy: c.UpdateEnvironmentRequest} } const opUpdateTagsForResource = "UpdateTagsForResource" @@ -2231,6 +2268,7 @@ const opUpdateTagsForResource = "UpdateTagsForResource" type UpdateTagsForResourceRequest struct { *aws.Request Input *UpdateTagsForResourceInput + Copy func(*UpdateTagsForResourceInput) UpdateTagsForResourceRequest } // Send marshals and sends the UpdateTagsForResource API request. @@ -2291,7 +2329,7 @@ func (c *ElasticBeanstalk) UpdateTagsForResourceRequest(input *UpdateTagsForReso req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateTagsForResourceRequest{Request: req, Input: input} + return UpdateTagsForResourceRequest{Request: req, Input: input, Copy: c.UpdateTagsForResourceRequest} } const opValidateConfigurationSettings = "ValidateConfigurationSettings" @@ -2300,6 +2338,7 @@ const opValidateConfigurationSettings = "ValidateConfigurationSettings" type ValidateConfigurationSettingsRequest struct { *aws.Request Input *ValidateConfigurationSettingsInput + Copy func(*ValidateConfigurationSettingsInput) ValidateConfigurationSettingsRequest } // Send marshals and sends the ValidateConfigurationSettings API request. @@ -2344,7 +2383,7 @@ func (c *ElasticBeanstalk) ValidateConfigurationSettingsRequest(input *ValidateC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ValidateConfigurationSettingsRequest{Request: req, Input: input} + return ValidateConfigurationSettingsRequest{Request: req, Input: input, Copy: c.ValidateConfigurationSettingsRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/AbortEnvironmentUpdateMessage diff --git a/service/elasticbeanstalk/elasticbeanstalkiface/interface.go b/service/elasticbeanstalk/elasticbeanstalkiface/interface.go index 1efe0b66755..b967b4021a3 100644 --- a/service/elasticbeanstalk/elasticbeanstalkiface/interface.go +++ b/service/elasticbeanstalk/elasticbeanstalkiface/interface.go @@ -9,7 +9,6 @@ package elasticbeanstalkiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk" ) @@ -113,9 +112,6 @@ type ElasticBeanstalkAPI interface { DescribeEventsRequest(*elasticbeanstalk.DescribeEventsInput) elasticbeanstalk.DescribeEventsRequest - DescribeEventsPages(*elasticbeanstalk.DescribeEventsInput, func(*elasticbeanstalk.DescribeEventsOutput, bool) bool) error - DescribeEventsPagesWithContext(aws.Context, *elasticbeanstalk.DescribeEventsInput, func(*elasticbeanstalk.DescribeEventsOutput, bool) bool, ...aws.Option) error - DescribeInstancesHealthRequest(*elasticbeanstalk.DescribeInstancesHealthInput) elasticbeanstalk.DescribeInstancesHealthRequest DescribePlatformVersionRequest(*elasticbeanstalk.DescribePlatformVersionInput) elasticbeanstalk.DescribePlatformVersionRequest diff --git a/service/elasticsearchservice/api.go b/service/elasticsearchservice/api.go index 11367b3a050..e3c68462610 100644 --- a/service/elasticsearchservice/api.go +++ b/service/elasticsearchservice/api.go @@ -18,6 +18,7 @@ const opAddTags = "AddTags" type AddTagsRequest struct { *aws.Request Input *AddTagsInput + Copy func(*AddTagsInput) AddTagsRequest } // Send marshals and sends the AddTags API request. @@ -60,7 +61,7 @@ func (c *ElasticsearchService) AddTagsRequest(input *AddTagsInput) AddTagsReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddTagsRequest{Request: req, Input: input} + return AddTagsRequest{Request: req, Input: input, Copy: c.AddTagsRequest} } const opCreateElasticsearchDomain = "CreateElasticsearchDomain" @@ -69,6 +70,7 @@ const opCreateElasticsearchDomain = "CreateElasticsearchDomain" type CreateElasticsearchDomainRequest struct { *aws.Request Input *CreateElasticsearchDomainInput + Copy func(*CreateElasticsearchDomainInput) CreateElasticsearchDomainRequest } // Send marshals and sends the CreateElasticsearchDomain API request. @@ -109,7 +111,7 @@ func (c *ElasticsearchService) CreateElasticsearchDomainRequest(input *CreateEla req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateElasticsearchDomainRequest{Request: req, Input: input} + return CreateElasticsearchDomainRequest{Request: req, Input: input, Copy: c.CreateElasticsearchDomainRequest} } const opDeleteElasticsearchDomain = "DeleteElasticsearchDomain" @@ -118,6 +120,7 @@ const opDeleteElasticsearchDomain = "DeleteElasticsearchDomain" type DeleteElasticsearchDomainRequest struct { *aws.Request Input *DeleteElasticsearchDomainInput + Copy func(*DeleteElasticsearchDomainInput) DeleteElasticsearchDomainRequest } // Send marshals and sends the DeleteElasticsearchDomain API request. @@ -157,7 +160,7 @@ func (c *ElasticsearchService) DeleteElasticsearchDomainRequest(input *DeleteEla req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteElasticsearchDomainRequest{Request: req, Input: input} + return DeleteElasticsearchDomainRequest{Request: req, Input: input, Copy: c.DeleteElasticsearchDomainRequest} } const opDeleteElasticsearchServiceRole = "DeleteElasticsearchServiceRole" @@ -166,6 +169,7 @@ const opDeleteElasticsearchServiceRole = "DeleteElasticsearchServiceRole" type DeleteElasticsearchServiceRoleRequest struct { *aws.Request Input *DeleteElasticsearchServiceRoleInput + Copy func(*DeleteElasticsearchServiceRoleInput) DeleteElasticsearchServiceRoleRequest } // Send marshals and sends the DeleteElasticsearchServiceRole API request. @@ -210,7 +214,7 @@ func (c *ElasticsearchService) DeleteElasticsearchServiceRoleRequest(input *Dele req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteElasticsearchServiceRoleRequest{Request: req, Input: input} + return DeleteElasticsearchServiceRoleRequest{Request: req, Input: input, Copy: c.DeleteElasticsearchServiceRoleRequest} } const opDescribeElasticsearchDomain = "DescribeElasticsearchDomain" @@ -219,6 +223,7 @@ const opDescribeElasticsearchDomain = "DescribeElasticsearchDomain" type DescribeElasticsearchDomainRequest struct { *aws.Request Input *DescribeElasticsearchDomainInput + Copy func(*DescribeElasticsearchDomainInput) DescribeElasticsearchDomainRequest } // Send marshals and sends the DescribeElasticsearchDomain API request. @@ -258,7 +263,7 @@ func (c *ElasticsearchService) DescribeElasticsearchDomainRequest(input *Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeElasticsearchDomainRequest{Request: req, Input: input} + return DescribeElasticsearchDomainRequest{Request: req, Input: input, Copy: c.DescribeElasticsearchDomainRequest} } const opDescribeElasticsearchDomainConfig = "DescribeElasticsearchDomainConfig" @@ -267,6 +272,7 @@ const opDescribeElasticsearchDomainConfig = "DescribeElasticsearchDomainConfig" type DescribeElasticsearchDomainConfigRequest struct { *aws.Request Input *DescribeElasticsearchDomainConfigInput + Copy func(*DescribeElasticsearchDomainConfigInput) DescribeElasticsearchDomainConfigRequest } // Send marshals and sends the DescribeElasticsearchDomainConfig API request. @@ -307,7 +313,7 @@ func (c *ElasticsearchService) DescribeElasticsearchDomainConfigRequest(input *D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeElasticsearchDomainConfigRequest{Request: req, Input: input} + return DescribeElasticsearchDomainConfigRequest{Request: req, Input: input, Copy: c.DescribeElasticsearchDomainConfigRequest} } const opDescribeElasticsearchDomains = "DescribeElasticsearchDomains" @@ -316,6 +322,7 @@ const opDescribeElasticsearchDomains = "DescribeElasticsearchDomains" type DescribeElasticsearchDomainsRequest struct { *aws.Request Input *DescribeElasticsearchDomainsInput + Copy func(*DescribeElasticsearchDomainsInput) DescribeElasticsearchDomainsRequest } // Send marshals and sends the DescribeElasticsearchDomains API request. @@ -355,7 +362,7 @@ func (c *ElasticsearchService) DescribeElasticsearchDomainsRequest(input *Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeElasticsearchDomainsRequest{Request: req, Input: input} + return DescribeElasticsearchDomainsRequest{Request: req, Input: input, Copy: c.DescribeElasticsearchDomainsRequest} } const opDescribeElasticsearchInstanceTypeLimits = "DescribeElasticsearchInstanceTypeLimits" @@ -364,6 +371,7 @@ const opDescribeElasticsearchInstanceTypeLimits = "DescribeElasticsearchInstance type DescribeElasticsearchInstanceTypeLimitsRequest struct { *aws.Request Input *DescribeElasticsearchInstanceTypeLimitsInput + Copy func(*DescribeElasticsearchInstanceTypeLimitsInput) DescribeElasticsearchInstanceTypeLimitsRequest } // Send marshals and sends the DescribeElasticsearchInstanceTypeLimits API request. @@ -404,7 +412,7 @@ func (c *ElasticsearchService) DescribeElasticsearchInstanceTypeLimitsRequest(in req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeElasticsearchInstanceTypeLimitsRequest{Request: req, Input: input} + return DescribeElasticsearchInstanceTypeLimitsRequest{Request: req, Input: input, Copy: c.DescribeElasticsearchInstanceTypeLimitsRequest} } const opListDomainNames = "ListDomainNames" @@ -413,6 +421,7 @@ const opListDomainNames = "ListDomainNames" type ListDomainNamesRequest struct { *aws.Request Input *ListDomainNamesInput + Copy func(*ListDomainNamesInput) ListDomainNamesRequest } // Send marshals and sends the ListDomainNames API request. @@ -452,7 +461,7 @@ func (c *ElasticsearchService) ListDomainNamesRequest(input *ListDomainNamesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDomainNamesRequest{Request: req, Input: input} + return ListDomainNamesRequest{Request: req, Input: input, Copy: c.ListDomainNamesRequest} } const opListElasticsearchInstanceTypes = "ListElasticsearchInstanceTypes" @@ -461,6 +470,7 @@ const opListElasticsearchInstanceTypes = "ListElasticsearchInstanceTypes" type ListElasticsearchInstanceTypesRequest struct { *aws.Request Input *ListElasticsearchInstanceTypesInput + Copy func(*ListElasticsearchInstanceTypesInput) ListElasticsearchInstanceTypesRequest } // Send marshals and sends the ListElasticsearchInstanceTypes API request. @@ -505,57 +515,53 @@ func (c *ElasticsearchService) ListElasticsearchInstanceTypesRequest(input *List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListElasticsearchInstanceTypesRequest{Request: req, Input: input} + return ListElasticsearchInstanceTypesRequest{Request: req, Input: input, Copy: c.ListElasticsearchInstanceTypesRequest} } -// ListElasticsearchInstanceTypesPages iterates over the pages of a ListElasticsearchInstanceTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListElasticsearchInstanceTypes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListElasticsearchInstanceTypesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListElasticsearchInstanceTypes operation. -// pageNum := 0 -// err := client.ListElasticsearchInstanceTypesPages(params, -// func(page *ListElasticsearchInstanceTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListElasticsearchInstanceTypesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ElasticsearchService) ListElasticsearchInstanceTypesPages(input *ListElasticsearchInstanceTypesInput, fn func(*ListElasticsearchInstanceTypesOutput, bool) bool) error { - return c.ListElasticsearchInstanceTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListElasticsearchInstanceTypesPagesWithContext same as ListElasticsearchInstanceTypesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElasticsearchService) ListElasticsearchInstanceTypesPagesWithContext(ctx aws.Context, input *ListElasticsearchInstanceTypesInput, fn func(*ListElasticsearchInstanceTypesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListElasticsearchInstanceTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListElasticsearchInstanceTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListElasticsearchInstanceTypesRequest) Paginate(opts ...aws.Option) ListElasticsearchInstanceTypesPager { + return ListElasticsearchInstanceTypesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListElasticsearchInstanceTypesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListElasticsearchInstanceTypesOutput), !p.HasNextPage()) - } - return p.Err() +// ListElasticsearchInstanceTypesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListElasticsearchInstanceTypesPager struct { + aws.Pager +} + +func (p *ListElasticsearchInstanceTypesPager) CurrentPage() *ListElasticsearchInstanceTypesOutput { + return p.Pager.CurrentPage().(*ListElasticsearchInstanceTypesOutput) } const opListElasticsearchVersions = "ListElasticsearchVersions" @@ -564,6 +570,7 @@ const opListElasticsearchVersions = "ListElasticsearchVersions" type ListElasticsearchVersionsRequest struct { *aws.Request Input *ListElasticsearchVersionsInput + Copy func(*ListElasticsearchVersionsInput) ListElasticsearchVersionsRequest } // Send marshals and sends the ListElasticsearchVersions API request. @@ -608,57 +615,53 @@ func (c *ElasticsearchService) ListElasticsearchVersionsRequest(input *ListElast req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListElasticsearchVersionsRequest{Request: req, Input: input} + return ListElasticsearchVersionsRequest{Request: req, Input: input, Copy: c.ListElasticsearchVersionsRequest} } -// ListElasticsearchVersionsPages iterates over the pages of a ListElasticsearchVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListElasticsearchVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListElasticsearchVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListElasticsearchVersions operation. -// pageNum := 0 -// err := client.ListElasticsearchVersionsPages(params, -// func(page *ListElasticsearchVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListElasticsearchVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ElasticsearchService) ListElasticsearchVersionsPages(input *ListElasticsearchVersionsInput, fn func(*ListElasticsearchVersionsOutput, bool) bool) error { - return c.ListElasticsearchVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListElasticsearchVersionsPagesWithContext same as ListElasticsearchVersionsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElasticsearchService) ListElasticsearchVersionsPagesWithContext(ctx aws.Context, input *ListElasticsearchVersionsInput, fn func(*ListElasticsearchVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListElasticsearchVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListElasticsearchVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListElasticsearchVersionsRequest) Paginate(opts ...aws.Option) ListElasticsearchVersionsPager { + return ListElasticsearchVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListElasticsearchVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListElasticsearchVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListElasticsearchVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListElasticsearchVersionsPager struct { + aws.Pager +} + +func (p *ListElasticsearchVersionsPager) CurrentPage() *ListElasticsearchVersionsOutput { + return p.Pager.CurrentPage().(*ListElasticsearchVersionsOutput) } const opListTags = "ListTags" @@ -667,6 +670,7 @@ const opListTags = "ListTags" type ListTagsRequest struct { *aws.Request Input *ListTagsInput + Copy func(*ListTagsInput) ListTagsRequest } // Send marshals and sends the ListTags API request. @@ -705,7 +709,7 @@ func (c *ElasticsearchService) ListTagsRequest(input *ListTagsInput) ListTagsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsRequest{Request: req, Input: input} + return ListTagsRequest{Request: req, Input: input, Copy: c.ListTagsRequest} } const opRemoveTags = "RemoveTags" @@ -714,6 +718,7 @@ const opRemoveTags = "RemoveTags" type RemoveTagsRequest struct { *aws.Request Input *RemoveTagsInput + Copy func(*RemoveTagsInput) RemoveTagsRequest } // Send marshals and sends the RemoveTags API request. @@ -754,7 +759,7 @@ func (c *ElasticsearchService) RemoveTagsRequest(input *RemoveTagsInput) RemoveT req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsRequest{Request: req, Input: input} + return RemoveTagsRequest{Request: req, Input: input, Copy: c.RemoveTagsRequest} } const opUpdateElasticsearchDomainConfig = "UpdateElasticsearchDomainConfig" @@ -763,6 +768,7 @@ const opUpdateElasticsearchDomainConfig = "UpdateElasticsearchDomainConfig" type UpdateElasticsearchDomainConfigRequest struct { *aws.Request Input *UpdateElasticsearchDomainConfigInput + Copy func(*UpdateElasticsearchDomainConfigInput) UpdateElasticsearchDomainConfigRequest } // Send marshals and sends the UpdateElasticsearchDomainConfig API request. @@ -802,7 +808,7 @@ func (c *ElasticsearchService) UpdateElasticsearchDomainConfigRequest(input *Upd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateElasticsearchDomainConfigRequest{Request: req, Input: input} + return UpdateElasticsearchDomainConfigRequest{Request: req, Input: input, Copy: c.UpdateElasticsearchDomainConfigRequest} } // The configured access rules for the domain's document and search endpoints, diff --git a/service/elasticsearchservice/elasticsearchserviceiface/interface.go b/service/elasticsearchservice/elasticsearchserviceiface/interface.go index 5d4b0a8cc4d..96d66578094 100644 --- a/service/elasticsearchservice/elasticsearchserviceiface/interface.go +++ b/service/elasticsearchservice/elasticsearchserviceiface/interface.go @@ -9,7 +9,6 @@ package elasticsearchserviceiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice" ) @@ -83,14 +82,8 @@ type ElasticsearchServiceAPI interface { ListElasticsearchInstanceTypesRequest(*elasticsearchservice.ListElasticsearchInstanceTypesInput) elasticsearchservice.ListElasticsearchInstanceTypesRequest - ListElasticsearchInstanceTypesPages(*elasticsearchservice.ListElasticsearchInstanceTypesInput, func(*elasticsearchservice.ListElasticsearchInstanceTypesOutput, bool) bool) error - ListElasticsearchInstanceTypesPagesWithContext(aws.Context, *elasticsearchservice.ListElasticsearchInstanceTypesInput, func(*elasticsearchservice.ListElasticsearchInstanceTypesOutput, bool) bool, ...aws.Option) error - ListElasticsearchVersionsRequest(*elasticsearchservice.ListElasticsearchVersionsInput) elasticsearchservice.ListElasticsearchVersionsRequest - ListElasticsearchVersionsPages(*elasticsearchservice.ListElasticsearchVersionsInput, func(*elasticsearchservice.ListElasticsearchVersionsOutput, bool) bool) error - ListElasticsearchVersionsPagesWithContext(aws.Context, *elasticsearchservice.ListElasticsearchVersionsInput, func(*elasticsearchservice.ListElasticsearchVersionsOutput, bool) bool, ...aws.Option) error - ListTagsRequest(*elasticsearchservice.ListTagsInput) elasticsearchservice.ListTagsRequest RemoveTagsRequest(*elasticsearchservice.RemoveTagsInput) elasticsearchservice.RemoveTagsRequest diff --git a/service/elastictranscoder/api.go b/service/elastictranscoder/api.go index 52d23091416..fbf97aa6a3f 100644 --- a/service/elastictranscoder/api.go +++ b/service/elastictranscoder/api.go @@ -16,6 +16,7 @@ const opCancelJob = "CancelJob" type CancelJobRequest struct { *aws.Request Input *CancelJobInput + Copy func(*CancelJobInput) CancelJobRequest } // Send marshals and sends the CancelJob API request. @@ -58,7 +59,7 @@ func (c *ElasticTranscoder) CancelJobRequest(input *CancelJobInput) CancelJobReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelJobRequest{Request: req, Input: input} + return CancelJobRequest{Request: req, Input: input, Copy: c.CancelJobRequest} } const opCreateJob = "CreateJob" @@ -67,6 +68,7 @@ const opCreateJob = "CreateJob" type CreateJobRequest struct { *aws.Request Input *CreateJobInput + Copy func(*CreateJobInput) CreateJobRequest } // Send marshals and sends the CreateJob API request. @@ -111,7 +113,7 @@ func (c *ElasticTranscoder) CreateJobRequest(input *CreateJobInput) CreateJobReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateJobRequest{Request: req, Input: input} + return CreateJobRequest{Request: req, Input: input, Copy: c.CreateJobRequest} } const opCreatePipeline = "CreatePipeline" @@ -120,6 +122,7 @@ const opCreatePipeline = "CreatePipeline" type CreatePipelineRequest struct { *aws.Request Input *CreatePipelineInput + Copy func(*CreatePipelineInput) CreatePipelineRequest } // Send marshals and sends the CreatePipeline API request. @@ -158,7 +161,7 @@ func (c *ElasticTranscoder) CreatePipelineRequest(input *CreatePipelineInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePipelineRequest{Request: req, Input: input} + return CreatePipelineRequest{Request: req, Input: input, Copy: c.CreatePipelineRequest} } const opCreatePreset = "CreatePreset" @@ -167,6 +170,7 @@ const opCreatePreset = "CreatePreset" type CreatePresetRequest struct { *aws.Request Input *CreatePresetInput + Copy func(*CreatePresetInput) CreatePresetRequest } // Send marshals and sends the CreatePreset API request. @@ -219,7 +223,7 @@ func (c *ElasticTranscoder) CreatePresetRequest(input *CreatePresetInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePresetRequest{Request: req, Input: input} + return CreatePresetRequest{Request: req, Input: input, Copy: c.CreatePresetRequest} } const opDeletePipeline = "DeletePipeline" @@ -228,6 +232,7 @@ const opDeletePipeline = "DeletePipeline" type DeletePipelineRequest struct { *aws.Request Input *DeletePipelineInput + Copy func(*DeletePipelineInput) DeletePipelineRequest } // Send marshals and sends the DeletePipeline API request. @@ -270,7 +275,7 @@ func (c *ElasticTranscoder) DeletePipelineRequest(input *DeletePipelineInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeletePipelineRequest{Request: req, Input: input} + return DeletePipelineRequest{Request: req, Input: input, Copy: c.DeletePipelineRequest} } const opDeletePreset = "DeletePreset" @@ -279,6 +284,7 @@ const opDeletePreset = "DeletePreset" type DeletePresetRequest struct { *aws.Request Input *DeletePresetInput + Copy func(*DeletePresetInput) DeletePresetRequest } // Send marshals and sends the DeletePreset API request. @@ -319,7 +325,7 @@ func (c *ElasticTranscoder) DeletePresetRequest(input *DeletePresetInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeletePresetRequest{Request: req, Input: input} + return DeletePresetRequest{Request: req, Input: input, Copy: c.DeletePresetRequest} } const opListJobsByPipeline = "ListJobsByPipeline" @@ -328,6 +334,7 @@ const opListJobsByPipeline = "ListJobsByPipeline" type ListJobsByPipelineRequest struct { *aws.Request Input *ListJobsByPipelineInput + Copy func(*ListJobsByPipelineInput) ListJobsByPipelineRequest } // Send marshals and sends the ListJobsByPipeline API request. @@ -376,57 +383,53 @@ func (c *ElasticTranscoder) ListJobsByPipelineRequest(input *ListJobsByPipelineI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobsByPipelineRequest{Request: req, Input: input} + return ListJobsByPipelineRequest{Request: req, Input: input, Copy: c.ListJobsByPipelineRequest} } -// ListJobsByPipelinePages iterates over the pages of a ListJobsByPipeline operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListJobsByPipeline method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListJobsByPipelineRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListJobsByPipeline operation. -// pageNum := 0 -// err := client.ListJobsByPipelinePages(params, -// func(page *ListJobsByPipelineOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListJobsByPipelineRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ElasticTranscoder) ListJobsByPipelinePages(input *ListJobsByPipelineInput, fn func(*ListJobsByPipelineOutput, bool) bool) error { - return c.ListJobsByPipelinePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListJobsByPipelinePagesWithContext same as ListJobsByPipelinePages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElasticTranscoder) ListJobsByPipelinePagesWithContext(ctx aws.Context, input *ListJobsByPipelineInput, fn func(*ListJobsByPipelineOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListJobsByPipelineInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListJobsByPipelineRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListJobsByPipelineRequest) Paginate(opts ...aws.Option) ListJobsByPipelinePager { + return ListJobsByPipelinePager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListJobsByPipelineInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsByPipelineOutput), !p.HasNextPage()) - } - return p.Err() +// ListJobsByPipelinePager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListJobsByPipelinePager struct { + aws.Pager +} + +func (p *ListJobsByPipelinePager) CurrentPage() *ListJobsByPipelineOutput { + return p.Pager.CurrentPage().(*ListJobsByPipelineOutput) } const opListJobsByStatus = "ListJobsByStatus" @@ -435,6 +438,7 @@ const opListJobsByStatus = "ListJobsByStatus" type ListJobsByStatusRequest struct { *aws.Request Input *ListJobsByStatusInput + Copy func(*ListJobsByStatusInput) ListJobsByStatusRequest } // Send marshals and sends the ListJobsByStatus API request. @@ -481,57 +485,53 @@ func (c *ElasticTranscoder) ListJobsByStatusRequest(input *ListJobsByStatusInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobsByStatusRequest{Request: req, Input: input} + return ListJobsByStatusRequest{Request: req, Input: input, Copy: c.ListJobsByStatusRequest} } -// ListJobsByStatusPages iterates over the pages of a ListJobsByStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListJobsByStatus method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListJobsByStatusRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListJobsByStatus operation. -// pageNum := 0 -// err := client.ListJobsByStatusPages(params, -// func(page *ListJobsByStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListJobsByStatusRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ElasticTranscoder) ListJobsByStatusPages(input *ListJobsByStatusInput, fn func(*ListJobsByStatusOutput, bool) bool) error { - return c.ListJobsByStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListJobsByStatusPagesWithContext same as ListJobsByStatusPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElasticTranscoder) ListJobsByStatusPagesWithContext(ctx aws.Context, input *ListJobsByStatusInput, fn func(*ListJobsByStatusOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListJobsByStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListJobsByStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListJobsByStatusRequest) Paginate(opts ...aws.Option) ListJobsByStatusPager { + return ListJobsByStatusPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListJobsByStatusInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsByStatusOutput), !p.HasNextPage()) - } - return p.Err() +// ListJobsByStatusPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListJobsByStatusPager struct { + aws.Pager +} + +func (p *ListJobsByStatusPager) CurrentPage() *ListJobsByStatusOutput { + return p.Pager.CurrentPage().(*ListJobsByStatusOutput) } const opListPipelines = "ListPipelines" @@ -540,6 +540,7 @@ const opListPipelines = "ListPipelines" type ListPipelinesRequest struct { *aws.Request Input *ListPipelinesInput + Copy func(*ListPipelinesInput) ListPipelinesRequest } // Send marshals and sends the ListPipelines API request. @@ -585,57 +586,53 @@ func (c *ElasticTranscoder) ListPipelinesRequest(input *ListPipelinesInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPipelinesRequest{Request: req, Input: input} + return ListPipelinesRequest{Request: req, Input: input, Copy: c.ListPipelinesRequest} } -// ListPipelinesPages iterates over the pages of a ListPipelines operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPipelines method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPipelinesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPipelines operation. -// pageNum := 0 -// err := client.ListPipelinesPages(params, -// func(page *ListPipelinesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListPipelinesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ElasticTranscoder) ListPipelinesPages(input *ListPipelinesInput, fn func(*ListPipelinesOutput, bool) bool) error { - return c.ListPipelinesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPipelinesPagesWithContext same as ListPipelinesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElasticTranscoder) ListPipelinesPagesWithContext(ctx aws.Context, input *ListPipelinesInput, fn func(*ListPipelinesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPipelinesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPipelinesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListPipelinesRequest) Paginate(opts ...aws.Option) ListPipelinesPager { + return ListPipelinesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPipelinesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) - } - return p.Err() +// ListPipelinesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPipelinesPager struct { + aws.Pager +} + +func (p *ListPipelinesPager) CurrentPage() *ListPipelinesOutput { + return p.Pager.CurrentPage().(*ListPipelinesOutput) } const opListPresets = "ListPresets" @@ -644,6 +641,7 @@ const opListPresets = "ListPresets" type ListPresetsRequest struct { *aws.Request Input *ListPresetsInput + Copy func(*ListPresetsInput) ListPresetsRequest } // Send marshals and sends the ListPresets API request. @@ -689,57 +687,53 @@ func (c *ElasticTranscoder) ListPresetsRequest(input *ListPresetsInput) ListPres req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPresetsRequest{Request: req, Input: input} + return ListPresetsRequest{Request: req, Input: input, Copy: c.ListPresetsRequest} } -// ListPresetsPages iterates over the pages of a ListPresets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPresets method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPresetsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPresets operation. -// pageNum := 0 -// err := client.ListPresetsPages(params, -// func(page *ListPresetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListPresetsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ElasticTranscoder) ListPresetsPages(input *ListPresetsInput, fn func(*ListPresetsOutput, bool) bool) error { - return c.ListPresetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPresetsPagesWithContext same as ListPresetsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ElasticTranscoder) ListPresetsPagesWithContext(ctx aws.Context, input *ListPresetsInput, fn func(*ListPresetsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPresetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPresetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListPresetsRequest) Paginate(opts ...aws.Option) ListPresetsPager { + return ListPresetsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPresetsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPresetsOutput), !p.HasNextPage()) - } - return p.Err() +// ListPresetsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPresetsPager struct { + aws.Pager +} + +func (p *ListPresetsPager) CurrentPage() *ListPresetsOutput { + return p.Pager.CurrentPage().(*ListPresetsOutput) } const opReadJob = "ReadJob" @@ -748,6 +742,7 @@ const opReadJob = "ReadJob" type ReadJobRequest struct { *aws.Request Input *ReadJobInput + Copy func(*ReadJobInput) ReadJobRequest } // Send marshals and sends the ReadJob API request. @@ -786,7 +781,7 @@ func (c *ElasticTranscoder) ReadJobRequest(input *ReadJobInput) ReadJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReadJobRequest{Request: req, Input: input} + return ReadJobRequest{Request: req, Input: input, Copy: c.ReadJobRequest} } const opReadPipeline = "ReadPipeline" @@ -795,6 +790,7 @@ const opReadPipeline = "ReadPipeline" type ReadPipelineRequest struct { *aws.Request Input *ReadPipelineInput + Copy func(*ReadPipelineInput) ReadPipelineRequest } // Send marshals and sends the ReadPipeline API request. @@ -833,7 +829,7 @@ func (c *ElasticTranscoder) ReadPipelineRequest(input *ReadPipelineInput) ReadPi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReadPipelineRequest{Request: req, Input: input} + return ReadPipelineRequest{Request: req, Input: input, Copy: c.ReadPipelineRequest} } const opReadPreset = "ReadPreset" @@ -842,6 +838,7 @@ const opReadPreset = "ReadPreset" type ReadPresetRequest struct { *aws.Request Input *ReadPresetInput + Copy func(*ReadPresetInput) ReadPresetRequest } // Send marshals and sends the ReadPreset API request. @@ -880,7 +877,7 @@ func (c *ElasticTranscoder) ReadPresetRequest(input *ReadPresetInput) ReadPreset req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReadPresetRequest{Request: req, Input: input} + return ReadPresetRequest{Request: req, Input: input, Copy: c.ReadPresetRequest} } const opTestRole = "TestRole" @@ -889,6 +886,7 @@ const opTestRole = "TestRole" type TestRoleRequest struct { *aws.Request Input *TestRoleInput + Copy func(*TestRoleInput) TestRoleRequest } // Send marshals and sends the TestRole API request. @@ -936,7 +934,7 @@ func (c *ElasticTranscoder) TestRoleRequest(input *TestRoleInput) TestRoleReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestRoleRequest{Request: req, Input: input} + return TestRoleRequest{Request: req, Input: input, Copy: c.TestRoleRequest} } const opUpdatePipeline = "UpdatePipeline" @@ -945,6 +943,7 @@ const opUpdatePipeline = "UpdatePipeline" type UpdatePipelineRequest struct { *aws.Request Input *UpdatePipelineInput + Copy func(*UpdatePipelineInput) UpdatePipelineRequest } // Send marshals and sends the UpdatePipeline API request. @@ -988,7 +987,7 @@ func (c *ElasticTranscoder) UpdatePipelineRequest(input *UpdatePipelineInput) Up req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePipelineRequest{Request: req, Input: input} + return UpdatePipelineRequest{Request: req, Input: input, Copy: c.UpdatePipelineRequest} } const opUpdatePipelineNotifications = "UpdatePipelineNotifications" @@ -997,6 +996,7 @@ const opUpdatePipelineNotifications = "UpdatePipelineNotifications" type UpdatePipelineNotificationsRequest struct { *aws.Request Input *UpdatePipelineNotificationsInput + Copy func(*UpdatePipelineNotificationsInput) UpdatePipelineNotificationsRequest } // Send marshals and sends the UpdatePipelineNotifications API request. @@ -1039,7 +1039,7 @@ func (c *ElasticTranscoder) UpdatePipelineNotificationsRequest(input *UpdatePipe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePipelineNotificationsRequest{Request: req, Input: input} + return UpdatePipelineNotificationsRequest{Request: req, Input: input, Copy: c.UpdatePipelineNotificationsRequest} } const opUpdatePipelineStatus = "UpdatePipelineStatus" @@ -1048,6 +1048,7 @@ const opUpdatePipelineStatus = "UpdatePipelineStatus" type UpdatePipelineStatusRequest struct { *aws.Request Input *UpdatePipelineStatusInput + Copy func(*UpdatePipelineStatusInput) UpdatePipelineStatusRequest } // Send marshals and sends the UpdatePipelineStatus API request. @@ -1093,7 +1094,7 @@ func (c *ElasticTranscoder) UpdatePipelineStatusRequest(input *UpdatePipelineSta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePipelineStatusRequest{Request: req, Input: input} + return UpdatePipelineStatusRequest{Request: req, Input: input, Copy: c.UpdatePipelineStatusRequest} } // The file to be used as album art. There can be multiple artworks associated diff --git a/service/elastictranscoder/elastictranscoderiface/interface.go b/service/elastictranscoder/elastictranscoderiface/interface.go index 5908dcbc0f8..3f26c3d9b12 100644 --- a/service/elastictranscoder/elastictranscoderiface/interface.go +++ b/service/elastictranscoder/elastictranscoderiface/interface.go @@ -77,24 +77,12 @@ type ElasticTranscoderAPI interface { ListJobsByPipelineRequest(*elastictranscoder.ListJobsByPipelineInput) elastictranscoder.ListJobsByPipelineRequest - ListJobsByPipelinePages(*elastictranscoder.ListJobsByPipelineInput, func(*elastictranscoder.ListJobsByPipelineOutput, bool) bool) error - ListJobsByPipelinePagesWithContext(aws.Context, *elastictranscoder.ListJobsByPipelineInput, func(*elastictranscoder.ListJobsByPipelineOutput, bool) bool, ...aws.Option) error - ListJobsByStatusRequest(*elastictranscoder.ListJobsByStatusInput) elastictranscoder.ListJobsByStatusRequest - ListJobsByStatusPages(*elastictranscoder.ListJobsByStatusInput, func(*elastictranscoder.ListJobsByStatusOutput, bool) bool) error - ListJobsByStatusPagesWithContext(aws.Context, *elastictranscoder.ListJobsByStatusInput, func(*elastictranscoder.ListJobsByStatusOutput, bool) bool, ...aws.Option) error - ListPipelinesRequest(*elastictranscoder.ListPipelinesInput) elastictranscoder.ListPipelinesRequest - ListPipelinesPages(*elastictranscoder.ListPipelinesInput, func(*elastictranscoder.ListPipelinesOutput, bool) bool) error - ListPipelinesPagesWithContext(aws.Context, *elastictranscoder.ListPipelinesInput, func(*elastictranscoder.ListPipelinesOutput, bool) bool, ...aws.Option) error - ListPresetsRequest(*elastictranscoder.ListPresetsInput) elastictranscoder.ListPresetsRequest - ListPresetsPages(*elastictranscoder.ListPresetsInput, func(*elastictranscoder.ListPresetsOutput, bool) bool) error - ListPresetsPagesWithContext(aws.Context, *elastictranscoder.ListPresetsInput, func(*elastictranscoder.ListPresetsOutput, bool) bool, ...aws.Option) error - ReadJobRequest(*elastictranscoder.ReadJobInput) elastictranscoder.ReadJobRequest ReadPipelineRequest(*elastictranscoder.ReadPipelineInput) elastictranscoder.ReadPipelineRequest diff --git a/service/elb/api.go b/service/elb/api.go index f05f8eb260c..9705be4cfe4 100644 --- a/service/elb/api.go +++ b/service/elb/api.go @@ -16,6 +16,7 @@ const opAddTags = "AddTags" type AddTagsRequest struct { *aws.Request Input *AddTagsInput + Copy func(*AddTagsInput) AddTagsRequest } // Send marshals and sends the AddTags API request. @@ -63,7 +64,7 @@ func (c *ELB) AddTagsRequest(input *AddTagsInput) AddTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsRequest{Request: req, Input: input} + return AddTagsRequest{Request: req, Input: input, Copy: c.AddTagsRequest} } const opApplySecurityGroupsToLoadBalancer = "ApplySecurityGroupsToLoadBalancer" @@ -72,6 +73,7 @@ const opApplySecurityGroupsToLoadBalancer = "ApplySecurityGroupsToLoadBalancer" type ApplySecurityGroupsToLoadBalancerRequest struct { *aws.Request Input *ApplySecurityGroupsToLoadBalancerInput + Copy func(*ApplySecurityGroupsToLoadBalancerInput) ApplySecurityGroupsToLoadBalancerRequest } // Send marshals and sends the ApplySecurityGroupsToLoadBalancer API request. @@ -117,7 +119,7 @@ func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroup req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ApplySecurityGroupsToLoadBalancerRequest{Request: req, Input: input} + return ApplySecurityGroupsToLoadBalancerRequest{Request: req, Input: input, Copy: c.ApplySecurityGroupsToLoadBalancerRequest} } const opAttachLoadBalancerToSubnets = "AttachLoadBalancerToSubnets" @@ -126,6 +128,7 @@ const opAttachLoadBalancerToSubnets = "AttachLoadBalancerToSubnets" type AttachLoadBalancerToSubnetsRequest struct { *aws.Request Input *AttachLoadBalancerToSubnetsInput + Copy func(*AttachLoadBalancerToSubnetsInput) AttachLoadBalancerToSubnetsRequest } // Send marshals and sends the AttachLoadBalancerToSubnets API request. @@ -172,7 +175,7 @@ func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachLoadBalancerToSubnetsRequest{Request: req, Input: input} + return AttachLoadBalancerToSubnetsRequest{Request: req, Input: input, Copy: c.AttachLoadBalancerToSubnetsRequest} } const opConfigureHealthCheck = "ConfigureHealthCheck" @@ -181,6 +184,7 @@ const opConfigureHealthCheck = "ConfigureHealthCheck" type ConfigureHealthCheckRequest struct { *aws.Request Input *ConfigureHealthCheckInput + Copy func(*ConfigureHealthCheckInput) ConfigureHealthCheckRequest } // Send marshals and sends the ConfigureHealthCheck API request. @@ -226,7 +230,7 @@ func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) Conf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ConfigureHealthCheckRequest{Request: req, Input: input} + return ConfigureHealthCheckRequest{Request: req, Input: input, Copy: c.ConfigureHealthCheckRequest} } const opCreateAppCookieStickinessPolicy = "CreateAppCookieStickinessPolicy" @@ -235,6 +239,7 @@ const opCreateAppCookieStickinessPolicy = "CreateAppCookieStickinessPolicy" type CreateAppCookieStickinessPolicyRequest struct { *aws.Request Input *CreateAppCookieStickinessPolicyInput + Copy func(*CreateAppCookieStickinessPolicyInput) CreateAppCookieStickinessPolicyRequest } // Send marshals and sends the CreateAppCookieStickinessPolicy API request. @@ -289,7 +294,7 @@ func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStick req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAppCookieStickinessPolicyRequest{Request: req, Input: input} + return CreateAppCookieStickinessPolicyRequest{Request: req, Input: input, Copy: c.CreateAppCookieStickinessPolicyRequest} } const opCreateLBCookieStickinessPolicy = "CreateLBCookieStickinessPolicy" @@ -298,6 +303,7 @@ const opCreateLBCookieStickinessPolicy = "CreateLBCookieStickinessPolicy" type CreateLBCookieStickinessPolicyRequest struct { *aws.Request Input *CreateLBCookieStickinessPolicyInput + Copy func(*CreateLBCookieStickinessPolicyInput) CreateLBCookieStickinessPolicyRequest } // Send marshals and sends the CreateLBCookieStickinessPolicy API request. @@ -354,7 +360,7 @@ func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLBCookieStickinessPolicyRequest{Request: req, Input: input} + return CreateLBCookieStickinessPolicyRequest{Request: req, Input: input, Copy: c.CreateLBCookieStickinessPolicyRequest} } const opCreateLoadBalancer = "CreateLoadBalancer" @@ -363,6 +369,7 @@ const opCreateLoadBalancer = "CreateLoadBalancer" type CreateLoadBalancerRequest struct { *aws.Request Input *CreateLoadBalancerInput + Copy func(*CreateLoadBalancerInput) CreateLoadBalancerRequest } // Send marshals and sends the CreateLoadBalancer API request. @@ -415,7 +422,7 @@ func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) CreateLo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLoadBalancerRequest{Request: req, Input: input} + return CreateLoadBalancerRequest{Request: req, Input: input, Copy: c.CreateLoadBalancerRequest} } const opCreateLoadBalancerListeners = "CreateLoadBalancerListeners" @@ -424,6 +431,7 @@ const opCreateLoadBalancerListeners = "CreateLoadBalancerListeners" type CreateLoadBalancerListenersRequest struct { *aws.Request Input *CreateLoadBalancerListenersInput + Copy func(*CreateLoadBalancerListenersInput) CreateLoadBalancerListenersRequest } // Send marshals and sends the CreateLoadBalancerListeners API request. @@ -470,7 +478,7 @@ func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLoadBalancerListenersRequest{Request: req, Input: input} + return CreateLoadBalancerListenersRequest{Request: req, Input: input, Copy: c.CreateLoadBalancerListenersRequest} } const opCreateLoadBalancerPolicy = "CreateLoadBalancerPolicy" @@ -479,6 +487,7 @@ const opCreateLoadBalancerPolicy = "CreateLoadBalancerPolicy" type CreateLoadBalancerPolicyRequest struct { *aws.Request Input *CreateLoadBalancerPolicyInput + Copy func(*CreateLoadBalancerPolicyInput) CreateLoadBalancerPolicyRequest } // Send marshals and sends the CreateLoadBalancerPolicy API request. @@ -523,7 +532,7 @@ func (c *ELB) CreateLoadBalancerPolicyRequest(input *CreateLoadBalancerPolicyInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLoadBalancerPolicyRequest{Request: req, Input: input} + return CreateLoadBalancerPolicyRequest{Request: req, Input: input, Copy: c.CreateLoadBalancerPolicyRequest} } const opDeleteLoadBalancer = "DeleteLoadBalancer" @@ -532,6 +541,7 @@ const opDeleteLoadBalancer = "DeleteLoadBalancer" type DeleteLoadBalancerRequest struct { *aws.Request Input *DeleteLoadBalancerInput + Copy func(*DeleteLoadBalancerInput) DeleteLoadBalancerRequest } // Send marshals and sends the DeleteLoadBalancer API request. @@ -581,7 +591,7 @@ func (c *ELB) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) DeleteLo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLoadBalancerRequest{Request: req, Input: input} + return DeleteLoadBalancerRequest{Request: req, Input: input, Copy: c.DeleteLoadBalancerRequest} } const opDeleteLoadBalancerListeners = "DeleteLoadBalancerListeners" @@ -590,6 +600,7 @@ const opDeleteLoadBalancerListeners = "DeleteLoadBalancerListeners" type DeleteLoadBalancerListenersRequest struct { *aws.Request Input *DeleteLoadBalancerListenersInput + Copy func(*DeleteLoadBalancerListenersInput) DeleteLoadBalancerListenersRequest } // Send marshals and sends the DeleteLoadBalancerListeners API request. @@ -630,7 +641,7 @@ func (c *ELB) DeleteLoadBalancerListenersRequest(input *DeleteLoadBalancerListen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLoadBalancerListenersRequest{Request: req, Input: input} + return DeleteLoadBalancerListenersRequest{Request: req, Input: input, Copy: c.DeleteLoadBalancerListenersRequest} } const opDeleteLoadBalancerPolicy = "DeleteLoadBalancerPolicy" @@ -639,6 +650,7 @@ const opDeleteLoadBalancerPolicy = "DeleteLoadBalancerPolicy" type DeleteLoadBalancerPolicyRequest struct { *aws.Request Input *DeleteLoadBalancerPolicyInput + Copy func(*DeleteLoadBalancerPolicyInput) DeleteLoadBalancerPolicyRequest } // Send marshals and sends the DeleteLoadBalancerPolicy API request. @@ -680,7 +692,7 @@ func (c *ELB) DeleteLoadBalancerPolicyRequest(input *DeleteLoadBalancerPolicyInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLoadBalancerPolicyRequest{Request: req, Input: input} + return DeleteLoadBalancerPolicyRequest{Request: req, Input: input, Copy: c.DeleteLoadBalancerPolicyRequest} } const opDeregisterInstancesFromLoadBalancer = "DeregisterInstancesFromLoadBalancer" @@ -689,6 +701,7 @@ const opDeregisterInstancesFromLoadBalancer = "DeregisterInstancesFromLoadBalanc type DeregisterInstancesFromLoadBalancerRequest struct { *aws.Request Input *DeregisterInstancesFromLoadBalancerInput + Copy func(*DeregisterInstancesFromLoadBalancerInput) DeregisterInstancesFromLoadBalancerRequest } // Send marshals and sends the DeregisterInstancesFromLoadBalancer API request. @@ -737,7 +750,7 @@ func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstan req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterInstancesFromLoadBalancerRequest{Request: req, Input: input} + return DeregisterInstancesFromLoadBalancerRequest{Request: req, Input: input, Copy: c.DeregisterInstancesFromLoadBalancerRequest} } const opDescribeAccountLimits = "DescribeAccountLimits" @@ -746,6 +759,7 @@ const opDescribeAccountLimits = "DescribeAccountLimits" type DescribeAccountLimitsRequest struct { *aws.Request Input *DescribeAccountLimitsInput + Copy func(*DescribeAccountLimitsInput) DescribeAccountLimitsRequest } // Send marshals and sends the DescribeAccountLimits API request. @@ -790,7 +804,7 @@ func (c *ELB) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAccountLimitsRequest{Request: req, Input: input} + return DescribeAccountLimitsRequest{Request: req, Input: input, Copy: c.DescribeAccountLimitsRequest} } const opDescribeInstanceHealth = "DescribeInstanceHealth" @@ -799,6 +813,7 @@ const opDescribeInstanceHealth = "DescribeInstanceHealth" type DescribeInstanceHealthRequest struct { *aws.Request Input *DescribeInstanceHealthInput + Copy func(*DescribeInstanceHealthInput) DescribeInstanceHealthRequest } // Send marshals and sends the DescribeInstanceHealth API request. @@ -844,7 +859,7 @@ func (c *ELB) DescribeInstanceHealthRequest(input *DescribeInstanceHealthInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstanceHealthRequest{Request: req, Input: input} + return DescribeInstanceHealthRequest{Request: req, Input: input, Copy: c.DescribeInstanceHealthRequest} } const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" @@ -853,6 +868,7 @@ const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" type DescribeLoadBalancerAttributesRequest struct { *aws.Request Input *DescribeLoadBalancerAttributesInput + Copy func(*DescribeLoadBalancerAttributesInput) DescribeLoadBalancerAttributesRequest } // Send marshals and sends the DescribeLoadBalancerAttributes API request. @@ -893,7 +909,7 @@ func (c *ELB) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoadBalancerAttributesRequest{Request: req, Input: input} + return DescribeLoadBalancerAttributesRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancerAttributesRequest} } const opDescribeLoadBalancerPolicies = "DescribeLoadBalancerPolicies" @@ -902,6 +918,7 @@ const opDescribeLoadBalancerPolicies = "DescribeLoadBalancerPolicies" type DescribeLoadBalancerPoliciesRequest struct { *aws.Request Input *DescribeLoadBalancerPoliciesInput + Copy func(*DescribeLoadBalancerPoliciesInput) DescribeLoadBalancerPoliciesRequest } // Send marshals and sends the DescribeLoadBalancerPolicies API request. @@ -949,7 +966,7 @@ func (c *ELB) DescribeLoadBalancerPoliciesRequest(input *DescribeLoadBalancerPol req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoadBalancerPoliciesRequest{Request: req, Input: input} + return DescribeLoadBalancerPoliciesRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancerPoliciesRequest} } const opDescribeLoadBalancerPolicyTypes = "DescribeLoadBalancerPolicyTypes" @@ -958,6 +975,7 @@ const opDescribeLoadBalancerPolicyTypes = "DescribeLoadBalancerPolicyTypes" type DescribeLoadBalancerPolicyTypesRequest struct { *aws.Request Input *DescribeLoadBalancerPolicyTypesInput + Copy func(*DescribeLoadBalancerPolicyTypesInput) DescribeLoadBalancerPolicyTypesRequest } // Send marshals and sends the DescribeLoadBalancerPolicyTypes API request. @@ -1009,7 +1027,7 @@ func (c *ELB) DescribeLoadBalancerPolicyTypesRequest(input *DescribeLoadBalancer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoadBalancerPolicyTypesRequest{Request: req, Input: input} + return DescribeLoadBalancerPolicyTypesRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancerPolicyTypesRequest} } const opDescribeLoadBalancers = "DescribeLoadBalancers" @@ -1018,6 +1036,7 @@ const opDescribeLoadBalancers = "DescribeLoadBalancers" type DescribeLoadBalancersRequest struct { *aws.Request Input *DescribeLoadBalancersInput + Copy func(*DescribeLoadBalancersInput) DescribeLoadBalancersRequest } // Send marshals and sends the DescribeLoadBalancers API request. @@ -1065,57 +1084,53 @@ func (c *ELB) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoadBalancersRequest{Request: req, Input: input} + return DescribeLoadBalancersRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancersRequest} } -// DescribeLoadBalancersPages iterates over the pages of a DescribeLoadBalancers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLoadBalancers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeLoadBalancersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeLoadBalancers operation. -// pageNum := 0 -// err := client.DescribeLoadBalancersPages(params, -// func(page *DescribeLoadBalancersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ELB) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(*DescribeLoadBalancersOutput, bool) bool) error { - return c.DescribeLoadBalancersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeLoadBalancersPagesWithContext same as DescribeLoadBalancersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ELB) DescribeLoadBalancersPagesWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, fn func(*DescribeLoadBalancersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeLoadBalancersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeLoadBalancersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeLoadBalancersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeLoadBalancersRequest) Paginate(opts ...aws.Option) DescribeLoadBalancersPager { + return DescribeLoadBalancersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeLoadBalancersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLoadBalancersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeLoadBalancersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeLoadBalancersPager struct { + aws.Pager +} + +func (p *DescribeLoadBalancersPager) CurrentPage() *DescribeLoadBalancersOutput { + return p.Pager.CurrentPage().(*DescribeLoadBalancersOutput) } const opDescribeTags = "DescribeTags" @@ -1124,6 +1139,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -1164,7 +1180,7 @@ func (c *ELB) DescribeTagsRequest(input *DescribeTagsInput) DescribeTagsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } const opDetachLoadBalancerFromSubnets = "DetachLoadBalancerFromSubnets" @@ -1173,6 +1189,7 @@ const opDetachLoadBalancerFromSubnets = "DetachLoadBalancerFromSubnets" type DetachLoadBalancerFromSubnetsRequest struct { *aws.Request Input *DetachLoadBalancerFromSubnetsInput + Copy func(*DetachLoadBalancerFromSubnetsInput) DetachLoadBalancerFromSubnetsRequest } // Send marshals and sends the DetachLoadBalancerFromSubnets API request. @@ -1218,7 +1235,7 @@ func (c *ELB) DetachLoadBalancerFromSubnetsRequest(input *DetachLoadBalancerFrom req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachLoadBalancerFromSubnetsRequest{Request: req, Input: input} + return DetachLoadBalancerFromSubnetsRequest{Request: req, Input: input, Copy: c.DetachLoadBalancerFromSubnetsRequest} } const opDisableAvailabilityZonesForLoadBalancer = "DisableAvailabilityZonesForLoadBalancer" @@ -1227,6 +1244,7 @@ const opDisableAvailabilityZonesForLoadBalancer = "DisableAvailabilityZonesForLo type DisableAvailabilityZonesForLoadBalancerRequest struct { *aws.Request Input *DisableAvailabilityZonesForLoadBalancerInput + Copy func(*DisableAvailabilityZonesForLoadBalancerInput) DisableAvailabilityZonesForLoadBalancerRequest } // Send marshals and sends the DisableAvailabilityZonesForLoadBalancer API request. @@ -1277,7 +1295,7 @@ func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvail req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableAvailabilityZonesForLoadBalancerRequest{Request: req, Input: input} + return DisableAvailabilityZonesForLoadBalancerRequest{Request: req, Input: input, Copy: c.DisableAvailabilityZonesForLoadBalancerRequest} } const opEnableAvailabilityZonesForLoadBalancer = "EnableAvailabilityZonesForLoadBalancer" @@ -1286,6 +1304,7 @@ const opEnableAvailabilityZonesForLoadBalancer = "EnableAvailabilityZonesForLoad type EnableAvailabilityZonesForLoadBalancerRequest struct { *aws.Request Input *EnableAvailabilityZonesForLoadBalancerInput + Copy func(*EnableAvailabilityZonesForLoadBalancerInput) EnableAvailabilityZonesForLoadBalancerRequest } // Send marshals and sends the EnableAvailabilityZonesForLoadBalancer API request. @@ -1333,7 +1352,7 @@ func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailab req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableAvailabilityZonesForLoadBalancerRequest{Request: req, Input: input} + return EnableAvailabilityZonesForLoadBalancerRequest{Request: req, Input: input, Copy: c.EnableAvailabilityZonesForLoadBalancerRequest} } const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" @@ -1342,6 +1361,7 @@ const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" type ModifyLoadBalancerAttributesRequest struct { *aws.Request Input *ModifyLoadBalancerAttributesInput + Copy func(*ModifyLoadBalancerAttributesInput) ModifyLoadBalancerAttributesRequest } // Send marshals and sends the ModifyLoadBalancerAttributes API request. @@ -1397,7 +1417,7 @@ func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyLoadBalancerAttributesRequest{Request: req, Input: input} + return ModifyLoadBalancerAttributesRequest{Request: req, Input: input, Copy: c.ModifyLoadBalancerAttributesRequest} } const opRegisterInstancesWithLoadBalancer = "RegisterInstancesWithLoadBalancer" @@ -1406,6 +1426,7 @@ const opRegisterInstancesWithLoadBalancer = "RegisterInstancesWithLoadBalancer" type RegisterInstancesWithLoadBalancerRequest struct { *aws.Request Input *RegisterInstancesWithLoadBalancerInput + Copy func(*RegisterInstancesWithLoadBalancerInput) RegisterInstancesWithLoadBalancerRequest } // Send marshals and sends the RegisterInstancesWithLoadBalancer API request. @@ -1468,7 +1489,7 @@ func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesW req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterInstancesWithLoadBalancerRequest{Request: req, Input: input} + return RegisterInstancesWithLoadBalancerRequest{Request: req, Input: input, Copy: c.RegisterInstancesWithLoadBalancerRequest} } const opRemoveTags = "RemoveTags" @@ -1477,6 +1498,7 @@ const opRemoveTags = "RemoveTags" type RemoveTagsRequest struct { *aws.Request Input *RemoveTagsInput + Copy func(*RemoveTagsInput) RemoveTagsRequest } // Send marshals and sends the RemoveTags API request. @@ -1517,7 +1539,7 @@ func (c *ELB) RemoveTagsRequest(input *RemoveTagsInput) RemoveTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsRequest{Request: req, Input: input} + return RemoveTagsRequest{Request: req, Input: input, Copy: c.RemoveTagsRequest} } const opSetLoadBalancerListenerSSLCertificate = "SetLoadBalancerListenerSSLCertificate" @@ -1526,6 +1548,7 @@ const opSetLoadBalancerListenerSSLCertificate = "SetLoadBalancerListenerSSLCerti type SetLoadBalancerListenerSSLCertificateRequest struct { *aws.Request Input *SetLoadBalancerListenerSSLCertificateInput + Copy func(*SetLoadBalancerListenerSSLCertificateInput) SetLoadBalancerListenerSSLCertificateRequest } // Send marshals and sends the SetLoadBalancerListenerSSLCertificate API request. @@ -1572,7 +1595,7 @@ func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalance req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetLoadBalancerListenerSSLCertificateRequest{Request: req, Input: input} + return SetLoadBalancerListenerSSLCertificateRequest{Request: req, Input: input, Copy: c.SetLoadBalancerListenerSSLCertificateRequest} } const opSetLoadBalancerPoliciesForBackendServer = "SetLoadBalancerPoliciesForBackendServer" @@ -1581,6 +1604,7 @@ const opSetLoadBalancerPoliciesForBackendServer = "SetLoadBalancerPoliciesForBac type SetLoadBalancerPoliciesForBackendServerRequest struct { *aws.Request Input *SetLoadBalancerPoliciesForBackendServerInput + Copy func(*SetLoadBalancerPoliciesForBackendServerInput) SetLoadBalancerPoliciesForBackendServerRequest } // Send marshals and sends the SetLoadBalancerPoliciesForBackendServer API request. @@ -1636,7 +1660,7 @@ func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalan req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetLoadBalancerPoliciesForBackendServerRequest{Request: req, Input: input} + return SetLoadBalancerPoliciesForBackendServerRequest{Request: req, Input: input, Copy: c.SetLoadBalancerPoliciesForBackendServerRequest} } const opSetLoadBalancerPoliciesOfListener = "SetLoadBalancerPoliciesOfListener" @@ -1645,6 +1669,7 @@ const opSetLoadBalancerPoliciesOfListener = "SetLoadBalancerPoliciesOfListener" type SetLoadBalancerPoliciesOfListenerRequest struct { *aws.Request Input *SetLoadBalancerPoliciesOfListenerInput + Copy func(*SetLoadBalancerPoliciesOfListenerInput) SetLoadBalancerPoliciesOfListenerRequest } // Send marshals and sends the SetLoadBalancerPoliciesOfListener API request. @@ -1694,7 +1719,7 @@ func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPol req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetLoadBalancerPoliciesOfListenerRequest{Request: req, Input: input} + return SetLoadBalancerPoliciesOfListenerRequest{Request: req, Input: input, Copy: c.SetLoadBalancerPoliciesOfListenerRequest} } // Information about the AccessLog attribute. diff --git a/service/elb/elbiface/interface.go b/service/elb/elbiface/interface.go index bf5d450e042..d0e2e4f8f4b 100644 --- a/service/elb/elbiface/interface.go +++ b/service/elb/elbiface/interface.go @@ -101,9 +101,6 @@ type ELBAPI interface { DescribeLoadBalancersRequest(*elb.DescribeLoadBalancersInput) elb.DescribeLoadBalancersRequest - DescribeLoadBalancersPages(*elb.DescribeLoadBalancersInput, func(*elb.DescribeLoadBalancersOutput, bool) bool) error - DescribeLoadBalancersPagesWithContext(aws.Context, *elb.DescribeLoadBalancersInput, func(*elb.DescribeLoadBalancersOutput, bool) bool, ...aws.Option) error - DescribeTagsRequest(*elb.DescribeTagsInput) elb.DescribeTagsRequest DetachLoadBalancerFromSubnetsRequest(*elb.DetachLoadBalancerFromSubnetsInput) elb.DetachLoadBalancerFromSubnetsRequest diff --git a/service/elbv2/api.go b/service/elbv2/api.go index 234bb8e7817..d0eccb25b85 100644 --- a/service/elbv2/api.go +++ b/service/elbv2/api.go @@ -16,6 +16,7 @@ const opAddListenerCertificates = "AddListenerCertificates" type AddListenerCertificatesRequest struct { *aws.Request Input *AddListenerCertificatesInput + Copy func(*AddListenerCertificatesInput) AddListenerCertificatesRequest } // Send marshals and sends the AddListenerCertificates API request. @@ -62,7 +63,7 @@ func (c *ELBV2) AddListenerCertificatesRequest(input *AddListenerCertificatesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddListenerCertificatesRequest{Request: req, Input: input} + return AddListenerCertificatesRequest{Request: req, Input: input, Copy: c.AddListenerCertificatesRequest} } const opAddTags = "AddTags" @@ -71,6 +72,7 @@ const opAddTags = "AddTags" type AddTagsRequest struct { *aws.Request Input *AddTagsInput + Copy func(*AddTagsInput) AddTagsRequest } // Send marshals and sends the AddTags API request. @@ -119,7 +121,7 @@ func (c *ELBV2) AddTagsRequest(input *AddTagsInput) AddTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsRequest{Request: req, Input: input} + return AddTagsRequest{Request: req, Input: input, Copy: c.AddTagsRequest} } const opCreateListener = "CreateListener" @@ -128,6 +130,7 @@ const opCreateListener = "CreateListener" type CreateListenerRequest struct { *aws.Request Input *CreateListenerInput + Copy func(*CreateListenerInput) CreateListenerRequest } // Send marshals and sends the CreateListener API request. @@ -180,7 +183,7 @@ func (c *ELBV2) CreateListenerRequest(input *CreateListenerInput) CreateListener req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateListenerRequest{Request: req, Input: input} + return CreateListenerRequest{Request: req, Input: input, Copy: c.CreateListenerRequest} } const opCreateLoadBalancer = "CreateLoadBalancer" @@ -189,6 +192,7 @@ const opCreateLoadBalancer = "CreateLoadBalancer" type CreateLoadBalancerRequest struct { *aws.Request Input *CreateLoadBalancerInput + Copy func(*CreateLoadBalancerInput) CreateLoadBalancerRequest } // Send marshals and sends the CreateLoadBalancer API request. @@ -248,7 +252,7 @@ func (c *ELBV2) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLoadBalancerRequest{Request: req, Input: input} + return CreateLoadBalancerRequest{Request: req, Input: input, Copy: c.CreateLoadBalancerRequest} } const opCreateRule = "CreateRule" @@ -257,6 +261,7 @@ const opCreateRule = "CreateRule" type CreateRuleRequest struct { *aws.Request Input *CreateRuleInput + Copy func(*CreateRuleInput) CreateRuleRequest } // Send marshals and sends the CreateRule API request. @@ -308,7 +313,7 @@ func (c *ELBV2) CreateRuleRequest(input *CreateRuleInput) CreateRuleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRuleRequest{Request: req, Input: input} + return CreateRuleRequest{Request: req, Input: input, Copy: c.CreateRuleRequest} } const opCreateTargetGroup = "CreateTargetGroup" @@ -317,6 +322,7 @@ const opCreateTargetGroup = "CreateTargetGroup" type CreateTargetGroupRequest struct { *aws.Request Input *CreateTargetGroupInput + Copy func(*CreateTargetGroupInput) CreateTargetGroupRequest } // Send marshals and sends the CreateTargetGroup API request. @@ -372,7 +378,7 @@ func (c *ELBV2) CreateTargetGroupRequest(input *CreateTargetGroupInput) CreateTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTargetGroupRequest{Request: req, Input: input} + return CreateTargetGroupRequest{Request: req, Input: input, Copy: c.CreateTargetGroupRequest} } const opDeleteListener = "DeleteListener" @@ -381,6 +387,7 @@ const opDeleteListener = "DeleteListener" type DeleteListenerRequest struct { *aws.Request Input *DeleteListenerInput + Copy func(*DeleteListenerInput) DeleteListenerRequest } // Send marshals and sends the DeleteListener API request. @@ -424,7 +431,7 @@ func (c *ELBV2) DeleteListenerRequest(input *DeleteListenerInput) DeleteListener req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteListenerRequest{Request: req, Input: input} + return DeleteListenerRequest{Request: req, Input: input, Copy: c.DeleteListenerRequest} } const opDeleteLoadBalancer = "DeleteLoadBalancer" @@ -433,6 +440,7 @@ const opDeleteLoadBalancer = "DeleteLoadBalancer" type DeleteLoadBalancerRequest struct { *aws.Request Input *DeleteLoadBalancerInput + Copy func(*DeleteLoadBalancerInput) DeleteLoadBalancerRequest } // Send marshals and sends the DeleteLoadBalancer API request. @@ -482,7 +490,7 @@ func (c *ELBV2) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLoadBalancerRequest{Request: req, Input: input} + return DeleteLoadBalancerRequest{Request: req, Input: input, Copy: c.DeleteLoadBalancerRequest} } const opDeleteRule = "DeleteRule" @@ -491,6 +499,7 @@ const opDeleteRule = "DeleteRule" type DeleteRuleRequest struct { *aws.Request Input *DeleteRuleInput + Copy func(*DeleteRuleInput) DeleteRuleRequest } // Send marshals and sends the DeleteRule API request. @@ -531,7 +540,7 @@ func (c *ELBV2) DeleteRuleRequest(input *DeleteRuleInput) DeleteRuleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRuleRequest{Request: req, Input: input} + return DeleteRuleRequest{Request: req, Input: input, Copy: c.DeleteRuleRequest} } const opDeleteTargetGroup = "DeleteTargetGroup" @@ -540,6 +549,7 @@ const opDeleteTargetGroup = "DeleteTargetGroup" type DeleteTargetGroupRequest struct { *aws.Request Input *DeleteTargetGroupInput + Copy func(*DeleteTargetGroupInput) DeleteTargetGroupRequest } // Send marshals and sends the DeleteTargetGroup API request. @@ -583,7 +593,7 @@ func (c *ELBV2) DeleteTargetGroupRequest(input *DeleteTargetGroupInput) DeleteTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTargetGroupRequest{Request: req, Input: input} + return DeleteTargetGroupRequest{Request: req, Input: input, Copy: c.DeleteTargetGroupRequest} } const opDeregisterTargets = "DeregisterTargets" @@ -592,6 +602,7 @@ const opDeregisterTargets = "DeregisterTargets" type DeregisterTargetsRequest struct { *aws.Request Input *DeregisterTargetsInput + Copy func(*DeregisterTargetsInput) DeregisterTargetsRequest } // Send marshals and sends the DeregisterTargets API request. @@ -634,7 +645,7 @@ func (c *ELBV2) DeregisterTargetsRequest(input *DeregisterTargetsInput) Deregist req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterTargetsRequest{Request: req, Input: input} + return DeregisterTargetsRequest{Request: req, Input: input, Copy: c.DeregisterTargetsRequest} } const opDescribeAccountLimits = "DescribeAccountLimits" @@ -643,6 +654,7 @@ const opDescribeAccountLimits = "DescribeAccountLimits" type DescribeAccountLimitsRequest struct { *aws.Request Input *DescribeAccountLimitsInput + Copy func(*DescribeAccountLimitsInput) DescribeAccountLimitsRequest } // Send marshals and sends the DescribeAccountLimits API request. @@ -689,7 +701,7 @@ func (c *ELBV2) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAccountLimitsRequest{Request: req, Input: input} + return DescribeAccountLimitsRequest{Request: req, Input: input, Copy: c.DescribeAccountLimitsRequest} } const opDescribeListenerCertificates = "DescribeListenerCertificates" @@ -698,6 +710,7 @@ const opDescribeListenerCertificates = "DescribeListenerCertificates" type DescribeListenerCertificatesRequest struct { *aws.Request Input *DescribeListenerCertificatesInput + Copy func(*DescribeListenerCertificatesInput) DescribeListenerCertificatesRequest } // Send marshals and sends the DescribeListenerCertificates API request. @@ -738,7 +751,7 @@ func (c *ELBV2) DescribeListenerCertificatesRequest(input *DescribeListenerCerti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeListenerCertificatesRequest{Request: req, Input: input} + return DescribeListenerCertificatesRequest{Request: req, Input: input, Copy: c.DescribeListenerCertificatesRequest} } const opDescribeListeners = "DescribeListeners" @@ -747,6 +760,7 @@ const opDescribeListeners = "DescribeListeners" type DescribeListenersRequest struct { *aws.Request Input *DescribeListenersInput + Copy func(*DescribeListenersInput) DescribeListenersRequest } // Send marshals and sends the DescribeListeners API request. @@ -795,57 +809,53 @@ func (c *ELBV2) DescribeListenersRequest(input *DescribeListenersInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeListenersRequest{Request: req, Input: input} + return DescribeListenersRequest{Request: req, Input: input, Copy: c.DescribeListenersRequest} } -// DescribeListenersPages iterates over the pages of a DescribeListeners operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeListeners method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeListenersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeListeners operation. -// pageNum := 0 -// err := client.DescribeListenersPages(params, -// func(page *DescribeListenersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ELBV2) DescribeListenersPages(input *DescribeListenersInput, fn func(*DescribeListenersOutput, bool) bool) error { - return c.DescribeListenersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeListenersPagesWithContext same as DescribeListenersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ELBV2) DescribeListenersPagesWithContext(ctx aws.Context, input *DescribeListenersInput, fn func(*DescribeListenersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeListenersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeListenersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeListenersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeListenersRequest) Paginate(opts ...aws.Option) DescribeListenersPager { + return DescribeListenersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeListenersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeListenersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeListenersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeListenersPager struct { + aws.Pager +} + +func (p *DescribeListenersPager) CurrentPage() *DescribeListenersOutput { + return p.Pager.CurrentPage().(*DescribeListenersOutput) } const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" @@ -854,6 +864,7 @@ const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" type DescribeLoadBalancerAttributesRequest struct { *aws.Request Input *DescribeLoadBalancerAttributesInput + Copy func(*DescribeLoadBalancerAttributesInput) DescribeLoadBalancerAttributesRequest } // Send marshals and sends the DescribeLoadBalancerAttributes API request. @@ -895,7 +906,7 @@ func (c *ELBV2) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalance req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoadBalancerAttributesRequest{Request: req, Input: input} + return DescribeLoadBalancerAttributesRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancerAttributesRequest} } const opDescribeLoadBalancers = "DescribeLoadBalancers" @@ -904,6 +915,7 @@ const opDescribeLoadBalancers = "DescribeLoadBalancers" type DescribeLoadBalancersRequest struct { *aws.Request Input *DescribeLoadBalancersInput + Copy func(*DescribeLoadBalancersInput) DescribeLoadBalancersRequest } // Send marshals and sends the DescribeLoadBalancers API request. @@ -953,57 +965,53 @@ func (c *ELBV2) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoadBalancersRequest{Request: req, Input: input} + return DescribeLoadBalancersRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancersRequest} } -// DescribeLoadBalancersPages iterates over the pages of a DescribeLoadBalancers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLoadBalancers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeLoadBalancersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeLoadBalancers operation. -// pageNum := 0 -// err := client.DescribeLoadBalancersPages(params, -// func(page *DescribeLoadBalancersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ELBV2) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(*DescribeLoadBalancersOutput, bool) bool) error { - return c.DescribeLoadBalancersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeLoadBalancersPagesWithContext same as DescribeLoadBalancersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ELBV2) DescribeLoadBalancersPagesWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, fn func(*DescribeLoadBalancersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeLoadBalancersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeLoadBalancersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeLoadBalancersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeLoadBalancersRequest) Paginate(opts ...aws.Option) DescribeLoadBalancersPager { + return DescribeLoadBalancersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeLoadBalancersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLoadBalancersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeLoadBalancersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeLoadBalancersPager struct { + aws.Pager +} + +func (p *DescribeLoadBalancersPager) CurrentPage() *DescribeLoadBalancersOutput { + return p.Pager.CurrentPage().(*DescribeLoadBalancersOutput) } const opDescribeRules = "DescribeRules" @@ -1012,6 +1020,7 @@ const opDescribeRules = "DescribeRules" type DescribeRulesRequest struct { *aws.Request Input *DescribeRulesInput + Copy func(*DescribeRulesInput) DescribeRulesRequest } // Send marshals and sends the DescribeRules API request. @@ -1053,7 +1062,7 @@ func (c *ELBV2) DescribeRulesRequest(input *DescribeRulesInput) DescribeRulesReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRulesRequest{Request: req, Input: input} + return DescribeRulesRequest{Request: req, Input: input, Copy: c.DescribeRulesRequest} } const opDescribeSSLPolicies = "DescribeSSLPolicies" @@ -1062,6 +1071,7 @@ const opDescribeSSLPolicies = "DescribeSSLPolicies" type DescribeSSLPoliciesRequest struct { *aws.Request Input *DescribeSSLPoliciesInput + Copy func(*DescribeSSLPoliciesInput) DescribeSSLPoliciesRequest } // Send marshals and sends the DescribeSSLPolicies API request. @@ -1105,7 +1115,7 @@ func (c *ELBV2) DescribeSSLPoliciesRequest(input *DescribeSSLPoliciesInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSSLPoliciesRequest{Request: req, Input: input} + return DescribeSSLPoliciesRequest{Request: req, Input: input, Copy: c.DescribeSSLPoliciesRequest} } const opDescribeTags = "DescribeTags" @@ -1114,6 +1124,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -1156,7 +1167,7 @@ func (c *ELBV2) DescribeTagsRequest(input *DescribeTagsInput) DescribeTagsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } const opDescribeTargetGroupAttributes = "DescribeTargetGroupAttributes" @@ -1165,6 +1176,7 @@ const opDescribeTargetGroupAttributes = "DescribeTargetGroupAttributes" type DescribeTargetGroupAttributesRequest struct { *aws.Request Input *DescribeTargetGroupAttributesInput + Copy func(*DescribeTargetGroupAttributesInput) DescribeTargetGroupAttributesRequest } // Send marshals and sends the DescribeTargetGroupAttributes API request. @@ -1205,7 +1217,7 @@ func (c *ELBV2) DescribeTargetGroupAttributesRequest(input *DescribeTargetGroupA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTargetGroupAttributesRequest{Request: req, Input: input} + return DescribeTargetGroupAttributesRequest{Request: req, Input: input, Copy: c.DescribeTargetGroupAttributesRequest} } const opDescribeTargetGroups = "DescribeTargetGroups" @@ -1214,6 +1226,7 @@ const opDescribeTargetGroups = "DescribeTargetGroups" type DescribeTargetGroupsRequest struct { *aws.Request Input *DescribeTargetGroupsInput + Copy func(*DescribeTargetGroupsInput) DescribeTargetGroupsRequest } // Send marshals and sends the DescribeTargetGroups API request. @@ -1266,57 +1279,53 @@ func (c *ELBV2) DescribeTargetGroupsRequest(input *DescribeTargetGroupsInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTargetGroupsRequest{Request: req, Input: input} + return DescribeTargetGroupsRequest{Request: req, Input: input, Copy: c.DescribeTargetGroupsRequest} } -// DescribeTargetGroupsPages iterates over the pages of a DescribeTargetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTargetGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeTargetGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeTargetGroups operation. -// pageNum := 0 -// err := client.DescribeTargetGroupsPages(params, -// func(page *DescribeTargetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ELBV2) DescribeTargetGroupsPages(input *DescribeTargetGroupsInput, fn func(*DescribeTargetGroupsOutput, bool) bool) error { - return c.DescribeTargetGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTargetGroupsPagesWithContext same as DescribeTargetGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ELBV2) DescribeTargetGroupsPagesWithContext(ctx aws.Context, input *DescribeTargetGroupsInput, fn func(*DescribeTargetGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeTargetGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeTargetGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeTargetGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeTargetGroupsRequest) Paginate(opts ...aws.Option) DescribeTargetGroupsPager { + return DescribeTargetGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeTargetGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTargetGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeTargetGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeTargetGroupsPager struct { + aws.Pager +} + +func (p *DescribeTargetGroupsPager) CurrentPage() *DescribeTargetGroupsOutput { + return p.Pager.CurrentPage().(*DescribeTargetGroupsOutput) } const opDescribeTargetHealth = "DescribeTargetHealth" @@ -1325,6 +1334,7 @@ const opDescribeTargetHealth = "DescribeTargetHealth" type DescribeTargetHealthRequest struct { *aws.Request Input *DescribeTargetHealthInput + Copy func(*DescribeTargetHealthInput) DescribeTargetHealthRequest } // Send marshals and sends the DescribeTargetHealth API request. @@ -1365,7 +1375,7 @@ func (c *ELBV2) DescribeTargetHealthRequest(input *DescribeTargetHealthInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTargetHealthRequest{Request: req, Input: input} + return DescribeTargetHealthRequest{Request: req, Input: input, Copy: c.DescribeTargetHealthRequest} } const opModifyListener = "ModifyListener" @@ -1374,6 +1384,7 @@ const opModifyListener = "ModifyListener" type ModifyListenerRequest struct { *aws.Request Input *ModifyListenerInput + Copy func(*ModifyListenerInput) ModifyListenerRequest } // Send marshals and sends the ModifyListener API request. @@ -1419,7 +1430,7 @@ func (c *ELBV2) ModifyListenerRequest(input *ModifyListenerInput) ModifyListener req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyListenerRequest{Request: req, Input: input} + return ModifyListenerRequest{Request: req, Input: input, Copy: c.ModifyListenerRequest} } const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" @@ -1428,6 +1439,7 @@ const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" type ModifyLoadBalancerAttributesRequest struct { *aws.Request Input *ModifyLoadBalancerAttributesInput + Copy func(*ModifyLoadBalancerAttributesInput) ModifyLoadBalancerAttributesRequest } // Send marshals and sends the ModifyLoadBalancerAttributes API request. @@ -1473,7 +1485,7 @@ func (c *ELBV2) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAtt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyLoadBalancerAttributesRequest{Request: req, Input: input} + return ModifyLoadBalancerAttributesRequest{Request: req, Input: input, Copy: c.ModifyLoadBalancerAttributesRequest} } const opModifyRule = "ModifyRule" @@ -1482,6 +1494,7 @@ const opModifyRule = "ModifyRule" type ModifyRuleRequest struct { *aws.Request Input *ModifyRuleInput + Copy func(*ModifyRuleInput) ModifyRuleRequest } // Send marshals and sends the ModifyRule API request. @@ -1526,7 +1539,7 @@ func (c *ELBV2) ModifyRuleRequest(input *ModifyRuleInput) ModifyRuleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyRuleRequest{Request: req, Input: input} + return ModifyRuleRequest{Request: req, Input: input, Copy: c.ModifyRuleRequest} } const opModifyTargetGroup = "ModifyTargetGroup" @@ -1535,6 +1548,7 @@ const opModifyTargetGroup = "ModifyTargetGroup" type ModifyTargetGroupRequest struct { *aws.Request Input *ModifyTargetGroupInput + Copy func(*ModifyTargetGroupInput) ModifyTargetGroupRequest } // Send marshals and sends the ModifyTargetGroup API request. @@ -1578,7 +1592,7 @@ func (c *ELBV2) ModifyTargetGroupRequest(input *ModifyTargetGroupInput) ModifyTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyTargetGroupRequest{Request: req, Input: input} + return ModifyTargetGroupRequest{Request: req, Input: input, Copy: c.ModifyTargetGroupRequest} } const opModifyTargetGroupAttributes = "ModifyTargetGroupAttributes" @@ -1587,6 +1601,7 @@ const opModifyTargetGroupAttributes = "ModifyTargetGroupAttributes" type ModifyTargetGroupAttributesRequest struct { *aws.Request Input *ModifyTargetGroupAttributesInput + Copy func(*ModifyTargetGroupAttributesInput) ModifyTargetGroupAttributesRequest } // Send marshals and sends the ModifyTargetGroupAttributes API request. @@ -1627,7 +1642,7 @@ func (c *ELBV2) ModifyTargetGroupAttributesRequest(input *ModifyTargetGroupAttri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyTargetGroupAttributesRequest{Request: req, Input: input} + return ModifyTargetGroupAttributesRequest{Request: req, Input: input, Copy: c.ModifyTargetGroupAttributesRequest} } const opRegisterTargets = "RegisterTargets" @@ -1636,6 +1651,7 @@ const opRegisterTargets = "RegisterTargets" type RegisterTargetsRequest struct { *aws.Request Input *RegisterTargetsInput + Copy func(*RegisterTargetsInput) RegisterTargetsRequest } // Send marshals and sends the RegisterTargets API request. @@ -1691,7 +1707,7 @@ func (c *ELBV2) RegisterTargetsRequest(input *RegisterTargetsInput) RegisterTarg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterTargetsRequest{Request: req, Input: input} + return RegisterTargetsRequest{Request: req, Input: input, Copy: c.RegisterTargetsRequest} } const opRemoveListenerCertificates = "RemoveListenerCertificates" @@ -1700,6 +1716,7 @@ const opRemoveListenerCertificates = "RemoveListenerCertificates" type RemoveListenerCertificatesRequest struct { *aws.Request Input *RemoveListenerCertificatesInput + Copy func(*RemoveListenerCertificatesInput) RemoveListenerCertificatesRequest } // Send marshals and sends the RemoveListenerCertificates API request. @@ -1745,7 +1762,7 @@ func (c *ELBV2) RemoveListenerCertificatesRequest(input *RemoveListenerCertifica req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveListenerCertificatesRequest{Request: req, Input: input} + return RemoveListenerCertificatesRequest{Request: req, Input: input, Copy: c.RemoveListenerCertificatesRequest} } const opRemoveTags = "RemoveTags" @@ -1754,6 +1771,7 @@ const opRemoveTags = "RemoveTags" type RemoveTagsRequest struct { *aws.Request Input *RemoveTagsInput + Copy func(*RemoveTagsInput) RemoveTagsRequest } // Send marshals and sends the RemoveTags API request. @@ -1796,7 +1814,7 @@ func (c *ELBV2) RemoveTagsRequest(input *RemoveTagsInput) RemoveTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsRequest{Request: req, Input: input} + return RemoveTagsRequest{Request: req, Input: input, Copy: c.RemoveTagsRequest} } const opSetIpAddressType = "SetIpAddressType" @@ -1805,6 +1823,7 @@ const opSetIpAddressType = "SetIpAddressType" type SetIpAddressTypeRequest struct { *aws.Request Input *SetIpAddressTypeInput + Copy func(*SetIpAddressTypeInput) SetIpAddressTypeRequest } // Send marshals and sends the SetIpAddressType API request. @@ -1848,7 +1867,7 @@ func (c *ELBV2) SetIpAddressTypeRequest(input *SetIpAddressTypeInput) SetIpAddre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetIpAddressTypeRequest{Request: req, Input: input} + return SetIpAddressTypeRequest{Request: req, Input: input, Copy: c.SetIpAddressTypeRequest} } const opSetRulePriorities = "SetRulePriorities" @@ -1857,6 +1876,7 @@ const opSetRulePriorities = "SetRulePriorities" type SetRulePrioritiesRequest struct { *aws.Request Input *SetRulePrioritiesInput + Copy func(*SetRulePrioritiesInput) SetRulePrioritiesRequest } // Send marshals and sends the SetRulePriorities API request. @@ -1901,7 +1921,7 @@ func (c *ELBV2) SetRulePrioritiesRequest(input *SetRulePrioritiesInput) SetRuleP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetRulePrioritiesRequest{Request: req, Input: input} + return SetRulePrioritiesRequest{Request: req, Input: input, Copy: c.SetRulePrioritiesRequest} } const opSetSecurityGroups = "SetSecurityGroups" @@ -1910,6 +1930,7 @@ const opSetSecurityGroups = "SetSecurityGroups" type SetSecurityGroupsRequest struct { *aws.Request Input *SetSecurityGroupsInput + Copy func(*SetSecurityGroupsInput) SetSecurityGroupsRequest } // Send marshals and sends the SetSecurityGroups API request. @@ -1954,7 +1975,7 @@ func (c *ELBV2) SetSecurityGroupsRequest(input *SetSecurityGroupsInput) SetSecur req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetSecurityGroupsRequest{Request: req, Input: input} + return SetSecurityGroupsRequest{Request: req, Input: input, Copy: c.SetSecurityGroupsRequest} } const opSetSubnets = "SetSubnets" @@ -1963,6 +1984,7 @@ const opSetSubnets = "SetSubnets" type SetSubnetsRequest struct { *aws.Request Input *SetSubnetsInput + Copy func(*SetSubnetsInput) SetSubnetsRequest } // Send marshals and sends the SetSubnets API request. @@ -2007,7 +2029,7 @@ func (c *ELBV2) SetSubnetsRequest(input *SetSubnetsInput) SetSubnetsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetSubnetsRequest{Request: req, Input: input} + return SetSubnetsRequest{Request: req, Input: input, Copy: c.SetSubnetsRequest} } // Information about an action. diff --git a/service/elbv2/elbv2iface/interface.go b/service/elbv2/elbv2iface/interface.go index 080521f07f7..b53f3a165bd 100644 --- a/service/elbv2/elbv2iface/interface.go +++ b/service/elbv2/elbv2iface/interface.go @@ -91,16 +91,10 @@ type ELBV2API interface { DescribeListenersRequest(*elbv2.DescribeListenersInput) elbv2.DescribeListenersRequest - DescribeListenersPages(*elbv2.DescribeListenersInput, func(*elbv2.DescribeListenersOutput, bool) bool) error - DescribeListenersPagesWithContext(aws.Context, *elbv2.DescribeListenersInput, func(*elbv2.DescribeListenersOutput, bool) bool, ...aws.Option) error - DescribeLoadBalancerAttributesRequest(*elbv2.DescribeLoadBalancerAttributesInput) elbv2.DescribeLoadBalancerAttributesRequest DescribeLoadBalancersRequest(*elbv2.DescribeLoadBalancersInput) elbv2.DescribeLoadBalancersRequest - DescribeLoadBalancersPages(*elbv2.DescribeLoadBalancersInput, func(*elbv2.DescribeLoadBalancersOutput, bool) bool) error - DescribeLoadBalancersPagesWithContext(aws.Context, *elbv2.DescribeLoadBalancersInput, func(*elbv2.DescribeLoadBalancersOutput, bool) bool, ...aws.Option) error - DescribeRulesRequest(*elbv2.DescribeRulesInput) elbv2.DescribeRulesRequest DescribeSSLPoliciesRequest(*elbv2.DescribeSSLPoliciesInput) elbv2.DescribeSSLPoliciesRequest @@ -111,9 +105,6 @@ type ELBV2API interface { DescribeTargetGroupsRequest(*elbv2.DescribeTargetGroupsInput) elbv2.DescribeTargetGroupsRequest - DescribeTargetGroupsPages(*elbv2.DescribeTargetGroupsInput, func(*elbv2.DescribeTargetGroupsOutput, bool) bool) error - DescribeTargetGroupsPagesWithContext(aws.Context, *elbv2.DescribeTargetGroupsInput, func(*elbv2.DescribeTargetGroupsOutput, bool) bool, ...aws.Option) error - DescribeTargetHealthRequest(*elbv2.DescribeTargetHealthInput) elbv2.DescribeTargetHealthRequest ModifyListenerRequest(*elbv2.ModifyListenerInput) elbv2.ModifyListenerRequest diff --git a/service/emr/api.go b/service/emr/api.go index 28f64bb3af8..23c9c20bf67 100644 --- a/service/emr/api.go +++ b/service/emr/api.go @@ -18,6 +18,7 @@ const opAddInstanceFleet = "AddInstanceFleet" type AddInstanceFleetRequest struct { *aws.Request Input *AddInstanceFleetInput + Copy func(*AddInstanceFleetInput) AddInstanceFleetRequest } // Send marshals and sends the AddInstanceFleet API request. @@ -61,7 +62,7 @@ func (c *EMR) AddInstanceFleetRequest(input *AddInstanceFleetInput) AddInstanceF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddInstanceFleetRequest{Request: req, Input: input} + return AddInstanceFleetRequest{Request: req, Input: input, Copy: c.AddInstanceFleetRequest} } const opAddInstanceGroups = "AddInstanceGroups" @@ -70,6 +71,7 @@ const opAddInstanceGroups = "AddInstanceGroups" type AddInstanceGroupsRequest struct { *aws.Request Input *AddInstanceGroupsInput + Copy func(*AddInstanceGroupsInput) AddInstanceGroupsRequest } // Send marshals and sends the AddInstanceGroups API request. @@ -110,7 +112,7 @@ func (c *EMR) AddInstanceGroupsRequest(input *AddInstanceGroupsInput) AddInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddInstanceGroupsRequest{Request: req, Input: input} + return AddInstanceGroupsRequest{Request: req, Input: input, Copy: c.AddInstanceGroupsRequest} } const opAddJobFlowSteps = "AddJobFlowSteps" @@ -119,6 +121,7 @@ const opAddJobFlowSteps = "AddJobFlowSteps" type AddJobFlowStepsRequest struct { *aws.Request Input *AddJobFlowStepsInput + Copy func(*AddJobFlowStepsInput) AddJobFlowStepsRequest } // Send marshals and sends the AddJobFlowSteps API request. @@ -181,7 +184,7 @@ func (c *EMR) AddJobFlowStepsRequest(input *AddJobFlowStepsInput) AddJobFlowStep req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddJobFlowStepsRequest{Request: req, Input: input} + return AddJobFlowStepsRequest{Request: req, Input: input, Copy: c.AddJobFlowStepsRequest} } const opAddTags = "AddTags" @@ -190,6 +193,7 @@ const opAddTags = "AddTags" type AddTagsRequest struct { *aws.Request Input *AddTagsInput + Copy func(*AddTagsInput) AddTagsRequest } // Send marshals and sends the AddTags API request. @@ -232,7 +236,7 @@ func (c *EMR) AddTagsRequest(input *AddTagsInput) AddTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsRequest{Request: req, Input: input} + return AddTagsRequest{Request: req, Input: input, Copy: c.AddTagsRequest} } const opCancelSteps = "CancelSteps" @@ -241,6 +245,7 @@ const opCancelSteps = "CancelSteps" type CancelStepsRequest struct { *aws.Request Input *CancelStepsInput + Copy func(*CancelStepsInput) CancelStepsRequest } // Send marshals and sends the CancelSteps API request. @@ -285,7 +290,7 @@ func (c *EMR) CancelStepsRequest(input *CancelStepsInput) CancelStepsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelStepsRequest{Request: req, Input: input} + return CancelStepsRequest{Request: req, Input: input, Copy: c.CancelStepsRequest} } const opCreateSecurityConfiguration = "CreateSecurityConfiguration" @@ -294,6 +299,7 @@ const opCreateSecurityConfiguration = "CreateSecurityConfiguration" type CreateSecurityConfigurationRequest struct { *aws.Request Input *CreateSecurityConfigurationInput + Copy func(*CreateSecurityConfigurationInput) CreateSecurityConfigurationRequest } // Send marshals and sends the CreateSecurityConfiguration API request. @@ -335,7 +341,7 @@ func (c *EMR) CreateSecurityConfigurationRequest(input *CreateSecurityConfigurat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSecurityConfigurationRequest{Request: req, Input: input} + return CreateSecurityConfigurationRequest{Request: req, Input: input, Copy: c.CreateSecurityConfigurationRequest} } const opDeleteSecurityConfiguration = "DeleteSecurityConfiguration" @@ -344,6 +350,7 @@ const opDeleteSecurityConfiguration = "DeleteSecurityConfiguration" type DeleteSecurityConfigurationRequest struct { *aws.Request Input *DeleteSecurityConfigurationInput + Copy func(*DeleteSecurityConfigurationInput) DeleteSecurityConfigurationRequest } // Send marshals and sends the DeleteSecurityConfiguration API request. @@ -384,7 +391,7 @@ func (c *EMR) DeleteSecurityConfigurationRequest(input *DeleteSecurityConfigurat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSecurityConfigurationRequest{Request: req, Input: input} + return DeleteSecurityConfigurationRequest{Request: req, Input: input, Copy: c.DeleteSecurityConfigurationRequest} } const opDescribeCluster = "DescribeCluster" @@ -393,6 +400,7 @@ const opDescribeCluster = "DescribeCluster" type DescribeClusterRequest struct { *aws.Request Input *DescribeClusterInput + Copy func(*DescribeClusterInput) DescribeClusterRequest } // Send marshals and sends the DescribeCluster API request. @@ -434,7 +442,7 @@ func (c *EMR) DescribeClusterRequest(input *DescribeClusterInput) DescribeCluste req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClusterRequest{Request: req, Input: input} + return DescribeClusterRequest{Request: req, Input: input, Copy: c.DescribeClusterRequest} } const opDescribeJobFlows = "DescribeJobFlows" @@ -443,6 +451,7 @@ const opDescribeJobFlows = "DescribeJobFlows" type DescribeJobFlowsRequest struct { *aws.Request Input *DescribeJobFlowsInput + Copy func(*DescribeJobFlowsInput) DescribeJobFlowsRequest } // Send marshals and sends the DescribeJobFlows API request. @@ -505,7 +514,7 @@ func (c *EMR) DescribeJobFlowsRequest(input *DescribeJobFlowsInput) DescribeJobF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeJobFlowsRequest{Request: req, Input: input} + return DescribeJobFlowsRequest{Request: req, Input: input, Copy: c.DescribeJobFlowsRequest} } const opDescribeSecurityConfiguration = "DescribeSecurityConfiguration" @@ -514,6 +523,7 @@ const opDescribeSecurityConfiguration = "DescribeSecurityConfiguration" type DescribeSecurityConfigurationRequest struct { *aws.Request Input *DescribeSecurityConfigurationInput + Copy func(*DescribeSecurityConfigurationInput) DescribeSecurityConfigurationRequest } // Send marshals and sends the DescribeSecurityConfiguration API request. @@ -555,7 +565,7 @@ func (c *EMR) DescribeSecurityConfigurationRequest(input *DescribeSecurityConfig req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSecurityConfigurationRequest{Request: req, Input: input} + return DescribeSecurityConfigurationRequest{Request: req, Input: input, Copy: c.DescribeSecurityConfigurationRequest} } const opDescribeStep = "DescribeStep" @@ -564,6 +574,7 @@ const opDescribeStep = "DescribeStep" type DescribeStepRequest struct { *aws.Request Input *DescribeStepInput + Copy func(*DescribeStepInput) DescribeStepRequest } // Send marshals and sends the DescribeStep API request. @@ -604,7 +615,7 @@ func (c *EMR) DescribeStepRequest(input *DescribeStepInput) DescribeStepRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStepRequest{Request: req, Input: input} + return DescribeStepRequest{Request: req, Input: input, Copy: c.DescribeStepRequest} } const opListBootstrapActions = "ListBootstrapActions" @@ -613,6 +624,7 @@ const opListBootstrapActions = "ListBootstrapActions" type ListBootstrapActionsRequest struct { *aws.Request Input *ListBootstrapActionsInput + Copy func(*ListBootstrapActionsInput) ListBootstrapActionsRequest } // Send marshals and sends the ListBootstrapActions API request. @@ -659,57 +671,53 @@ func (c *EMR) ListBootstrapActionsRequest(input *ListBootstrapActionsInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBootstrapActionsRequest{Request: req, Input: input} + return ListBootstrapActionsRequest{Request: req, Input: input, Copy: c.ListBootstrapActionsRequest} } -// ListBootstrapActionsPages iterates over the pages of a ListBootstrapActions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListBootstrapActions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListBootstrapActionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListBootstrapActions operation. -// pageNum := 0 -// err := client.ListBootstrapActionsPages(params, -// func(page *ListBootstrapActionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListBootstrapActionsPages(input *ListBootstrapActionsInput, fn func(*ListBootstrapActionsOutput, bool) bool) error { - return c.ListBootstrapActionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListBootstrapActionsPagesWithContext same as ListBootstrapActionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EMR) ListBootstrapActionsPagesWithContext(ctx aws.Context, input *ListBootstrapActionsInput, fn func(*ListBootstrapActionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListBootstrapActionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListBootstrapActionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListBootstrapActionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListBootstrapActionsRequest) Paginate(opts ...aws.Option) ListBootstrapActionsPager { + return ListBootstrapActionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListBootstrapActionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBootstrapActionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListBootstrapActionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListBootstrapActionsPager struct { + aws.Pager +} + +func (p *ListBootstrapActionsPager) CurrentPage() *ListBootstrapActionsOutput { + return p.Pager.CurrentPage().(*ListBootstrapActionsOutput) } const opListClusters = "ListClusters" @@ -718,6 +726,7 @@ const opListClusters = "ListClusters" type ListClustersRequest struct { *aws.Request Input *ListClustersInput + Copy func(*ListClustersInput) ListClustersRequest } // Send marshals and sends the ListClusters API request. @@ -768,57 +777,53 @@ func (c *EMR) ListClustersRequest(input *ListClustersInput) ListClustersRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListClustersRequest{Request: req, Input: input} + return ListClustersRequest{Request: req, Input: input, Copy: c.ListClustersRequest} } -// ListClustersPages iterates over the pages of a ListClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListClusters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListClustersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListClusters operation. -// pageNum := 0 -// err := client.ListClustersPages(params, -// func(page *ListClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListClustersPages(input *ListClustersInput, fn func(*ListClustersOutput, bool) bool) error { - return c.ListClustersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListClustersPagesWithContext same as ListClustersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EMR) ListClustersPagesWithContext(ctx aws.Context, input *ListClustersInput, fn func(*ListClustersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListClustersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListClustersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListClustersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListClustersRequest) Paginate(opts ...aws.Option) ListClustersPager { + return ListClustersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListClustersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) - } - return p.Err() +// ListClustersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListClustersPager struct { + aws.Pager +} + +func (p *ListClustersPager) CurrentPage() *ListClustersOutput { + return p.Pager.CurrentPage().(*ListClustersOutput) } const opListInstanceFleets = "ListInstanceFleets" @@ -827,6 +832,7 @@ const opListInstanceFleets = "ListInstanceFleets" type ListInstanceFleetsRequest struct { *aws.Request Input *ListInstanceFleetsInput + Copy func(*ListInstanceFleetsInput) ListInstanceFleetsRequest } // Send marshals and sends the ListInstanceFleets API request. @@ -876,57 +882,53 @@ func (c *EMR) ListInstanceFleetsRequest(input *ListInstanceFleetsInput) ListInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInstanceFleetsRequest{Request: req, Input: input} + return ListInstanceFleetsRequest{Request: req, Input: input, Copy: c.ListInstanceFleetsRequest} } -// ListInstanceFleetsPages iterates over the pages of a ListInstanceFleets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstanceFleets method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInstanceFleetsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInstanceFleets operation. -// pageNum := 0 -// err := client.ListInstanceFleetsPages(params, -// func(page *ListInstanceFleetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListInstanceFleetsPages(input *ListInstanceFleetsInput, fn func(*ListInstanceFleetsOutput, bool) bool) error { - return c.ListInstanceFleetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInstanceFleetsPagesWithContext same as ListInstanceFleetsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EMR) ListInstanceFleetsPagesWithContext(ctx aws.Context, input *ListInstanceFleetsInput, fn func(*ListInstanceFleetsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInstanceFleetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInstanceFleetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListInstanceFleetsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListInstanceFleetsRequest) Paginate(opts ...aws.Option) ListInstanceFleetsPager { + return ListInstanceFleetsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInstanceFleetsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstanceFleetsOutput), !p.HasNextPage()) - } - return p.Err() +// ListInstanceFleetsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInstanceFleetsPager struct { + aws.Pager +} + +func (p *ListInstanceFleetsPager) CurrentPage() *ListInstanceFleetsOutput { + return p.Pager.CurrentPage().(*ListInstanceFleetsOutput) } const opListInstanceGroups = "ListInstanceGroups" @@ -935,6 +937,7 @@ const opListInstanceGroups = "ListInstanceGroups" type ListInstanceGroupsRequest struct { *aws.Request Input *ListInstanceGroupsInput + Copy func(*ListInstanceGroupsInput) ListInstanceGroupsRequest } // Send marshals and sends the ListInstanceGroups API request. @@ -981,57 +984,53 @@ func (c *EMR) ListInstanceGroupsRequest(input *ListInstanceGroupsInput) ListInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInstanceGroupsRequest{Request: req, Input: input} + return ListInstanceGroupsRequest{Request: req, Input: input, Copy: c.ListInstanceGroupsRequest} } -// ListInstanceGroupsPages iterates over the pages of a ListInstanceGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstanceGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInstanceGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInstanceGroups operation. -// pageNum := 0 -// err := client.ListInstanceGroupsPages(params, -// func(page *ListInstanceGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListInstanceGroupsPages(input *ListInstanceGroupsInput, fn func(*ListInstanceGroupsOutput, bool) bool) error { - return c.ListInstanceGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInstanceGroupsPagesWithContext same as ListInstanceGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EMR) ListInstanceGroupsPagesWithContext(ctx aws.Context, input *ListInstanceGroupsInput, fn func(*ListInstanceGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInstanceGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInstanceGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListInstanceGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListInstanceGroupsRequest) Paginate(opts ...aws.Option) ListInstanceGroupsPager { + return ListInstanceGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInstanceGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstanceGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// ListInstanceGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInstanceGroupsPager struct { + aws.Pager +} + +func (p *ListInstanceGroupsPager) CurrentPage() *ListInstanceGroupsOutput { + return p.Pager.CurrentPage().(*ListInstanceGroupsOutput) } const opListInstances = "ListInstances" @@ -1040,6 +1039,7 @@ const opListInstances = "ListInstances" type ListInstancesRequest struct { *aws.Request Input *ListInstancesInput + Copy func(*ListInstancesInput) ListInstancesRequest } // Send marshals and sends the ListInstances API request. @@ -1089,57 +1089,53 @@ func (c *EMR) ListInstancesRequest(input *ListInstancesInput) ListInstancesReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInstancesRequest{Request: req, Input: input} + return ListInstancesRequest{Request: req, Input: input, Copy: c.ListInstancesRequest} } -// ListInstancesPages iterates over the pages of a ListInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInstances operation. -// pageNum := 0 -// err := client.ListInstancesPages(params, -// func(page *ListInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListInstancesPages(input *ListInstancesInput, fn func(*ListInstancesOutput, bool) bool) error { - return c.ListInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInstancesPagesWithContext same as ListInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EMR) ListInstancesPagesWithContext(ctx aws.Context, input *ListInstancesInput, fn func(*ListInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListInstancesRequest) Paginate(opts ...aws.Option) ListInstancesPager { + return ListInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// ListInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInstancesPager struct { + aws.Pager +} + +func (p *ListInstancesPager) CurrentPage() *ListInstancesOutput { + return p.Pager.CurrentPage().(*ListInstancesOutput) } const opListSecurityConfigurations = "ListSecurityConfigurations" @@ -1148,6 +1144,7 @@ const opListSecurityConfigurations = "ListSecurityConfigurations" type ListSecurityConfigurationsRequest struct { *aws.Request Input *ListSecurityConfigurationsInput + Copy func(*ListSecurityConfigurationsInput) ListSecurityConfigurationsRequest } // Send marshals and sends the ListSecurityConfigurations API request. @@ -1191,7 +1188,7 @@ func (c *EMR) ListSecurityConfigurationsRequest(input *ListSecurityConfiguration req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSecurityConfigurationsRequest{Request: req, Input: input} + return ListSecurityConfigurationsRequest{Request: req, Input: input, Copy: c.ListSecurityConfigurationsRequest} } const opListSteps = "ListSteps" @@ -1200,6 +1197,7 @@ const opListSteps = "ListSteps" type ListStepsRequest struct { *aws.Request Input *ListStepsInput + Copy func(*ListStepsInput) ListStepsRequest } // Send marshals and sends the ListSteps API request. @@ -1247,57 +1245,53 @@ func (c *EMR) ListStepsRequest(input *ListStepsInput) ListStepsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStepsRequest{Request: req, Input: input} + return ListStepsRequest{Request: req, Input: input, Copy: c.ListStepsRequest} } -// ListStepsPages iterates over the pages of a ListSteps operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSteps method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListStepsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListSteps operation. -// pageNum := 0 -// err := client.ListStepsPages(params, -// func(page *ListStepsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListStepsPages(input *ListStepsInput, fn func(*ListStepsOutput, bool) bool) error { - return c.ListStepsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStepsPagesWithContext same as ListStepsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EMR) ListStepsPagesWithContext(ctx aws.Context, input *ListStepsInput, fn func(*ListStepsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListStepsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListStepsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListStepsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListStepsRequest) Paginate(opts ...aws.Option) ListStepsPager { + return ListStepsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListStepsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStepsOutput), !p.HasNextPage()) - } - return p.Err() +// ListStepsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListStepsPager struct { + aws.Pager +} + +func (p *ListStepsPager) CurrentPage() *ListStepsOutput { + return p.Pager.CurrentPage().(*ListStepsOutput) } const opModifyInstanceFleet = "ModifyInstanceFleet" @@ -1306,6 +1300,7 @@ const opModifyInstanceFleet = "ModifyInstanceFleet" type ModifyInstanceFleetRequest struct { *aws.Request Input *ModifyInstanceFleetInput + Copy func(*ModifyInstanceFleetInput) ModifyInstanceFleetRequest } // Send marshals and sends the ModifyInstanceFleet API request. @@ -1353,7 +1348,7 @@ func (c *EMR) ModifyInstanceFleetRequest(input *ModifyInstanceFleetInput) Modify req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyInstanceFleetRequest{Request: req, Input: input} + return ModifyInstanceFleetRequest{Request: req, Input: input, Copy: c.ModifyInstanceFleetRequest} } const opModifyInstanceGroups = "ModifyInstanceGroups" @@ -1362,6 +1357,7 @@ const opModifyInstanceGroups = "ModifyInstanceGroups" type ModifyInstanceGroupsRequest struct { *aws.Request Input *ModifyInstanceGroupsInput + Copy func(*ModifyInstanceGroupsInput) ModifyInstanceGroupsRequest } // Send marshals and sends the ModifyInstanceGroups API request. @@ -1407,7 +1403,7 @@ func (c *EMR) ModifyInstanceGroupsRequest(input *ModifyInstanceGroupsInput) Modi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ModifyInstanceGroupsRequest{Request: req, Input: input} + return ModifyInstanceGroupsRequest{Request: req, Input: input, Copy: c.ModifyInstanceGroupsRequest} } const opPutAutoScalingPolicy = "PutAutoScalingPolicy" @@ -1416,6 +1412,7 @@ const opPutAutoScalingPolicy = "PutAutoScalingPolicy" type PutAutoScalingPolicyRequest struct { *aws.Request Input *PutAutoScalingPolicyInput + Copy func(*PutAutoScalingPolicyInput) PutAutoScalingPolicyRequest } // Send marshals and sends the PutAutoScalingPolicy API request. @@ -1459,7 +1456,7 @@ func (c *EMR) PutAutoScalingPolicyRequest(input *PutAutoScalingPolicyInput) PutA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutAutoScalingPolicyRequest{Request: req, Input: input} + return PutAutoScalingPolicyRequest{Request: req, Input: input, Copy: c.PutAutoScalingPolicyRequest} } const opRemoveAutoScalingPolicy = "RemoveAutoScalingPolicy" @@ -1468,6 +1465,7 @@ const opRemoveAutoScalingPolicy = "RemoveAutoScalingPolicy" type RemoveAutoScalingPolicyRequest struct { *aws.Request Input *RemoveAutoScalingPolicyInput + Copy func(*RemoveAutoScalingPolicyInput) RemoveAutoScalingPolicyRequest } // Send marshals and sends the RemoveAutoScalingPolicy API request. @@ -1509,7 +1507,7 @@ func (c *EMR) RemoveAutoScalingPolicyRequest(input *RemoveAutoScalingPolicyInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveAutoScalingPolicyRequest{Request: req, Input: input} + return RemoveAutoScalingPolicyRequest{Request: req, Input: input, Copy: c.RemoveAutoScalingPolicyRequest} } const opRemoveTags = "RemoveTags" @@ -1518,6 +1516,7 @@ const opRemoveTags = "RemoveTags" type RemoveTagsRequest struct { *aws.Request Input *RemoveTagsInput + Copy func(*RemoveTagsInput) RemoveTagsRequest } // Send marshals and sends the RemoveTags API request. @@ -1562,7 +1561,7 @@ func (c *EMR) RemoveTagsRequest(input *RemoveTagsInput) RemoveTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsRequest{Request: req, Input: input} + return RemoveTagsRequest{Request: req, Input: input, Copy: c.RemoveTagsRequest} } const opRunJobFlow = "RunJobFlow" @@ -1571,6 +1570,7 @@ const opRunJobFlow = "RunJobFlow" type RunJobFlowRequest struct { *aws.Request Input *RunJobFlowInput + Copy func(*RunJobFlowInput) RunJobFlowRequest } // Send marshals and sends the RunJobFlow API request. @@ -1637,7 +1637,7 @@ func (c *EMR) RunJobFlowRequest(input *RunJobFlowInput) RunJobFlowRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RunJobFlowRequest{Request: req, Input: input} + return RunJobFlowRequest{Request: req, Input: input, Copy: c.RunJobFlowRequest} } const opSetTerminationProtection = "SetTerminationProtection" @@ -1646,6 +1646,7 @@ const opSetTerminationProtection = "SetTerminationProtection" type SetTerminationProtectionRequest struct { *aws.Request Input *SetTerminationProtectionInput + Copy func(*SetTerminationProtectionInput) SetTerminationProtectionRequest } // Send marshals and sends the SetTerminationProtection API request. @@ -1704,7 +1705,7 @@ func (c *EMR) SetTerminationProtectionRequest(input *SetTerminationProtectionInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetTerminationProtectionRequest{Request: req, Input: input} + return SetTerminationProtectionRequest{Request: req, Input: input, Copy: c.SetTerminationProtectionRequest} } const opSetVisibleToAllUsers = "SetVisibleToAllUsers" @@ -1713,6 +1714,7 @@ const opSetVisibleToAllUsers = "SetVisibleToAllUsers" type SetVisibleToAllUsersRequest struct { *aws.Request Input *SetVisibleToAllUsersInput + Copy func(*SetVisibleToAllUsersInput) SetVisibleToAllUsersRequest } // Send marshals and sends the SetVisibleToAllUsers API request. @@ -1760,7 +1762,7 @@ func (c *EMR) SetVisibleToAllUsersRequest(input *SetVisibleToAllUsersInput) SetV req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetVisibleToAllUsersRequest{Request: req, Input: input} + return SetVisibleToAllUsersRequest{Request: req, Input: input, Copy: c.SetVisibleToAllUsersRequest} } const opTerminateJobFlows = "TerminateJobFlows" @@ -1769,6 +1771,7 @@ const opTerminateJobFlows = "TerminateJobFlows" type TerminateJobFlowsRequest struct { *aws.Request Input *TerminateJobFlowsInput + Copy func(*TerminateJobFlowsInput) TerminateJobFlowsRequest } // Send marshals and sends the TerminateJobFlows API request. @@ -1820,7 +1823,7 @@ func (c *EMR) TerminateJobFlowsRequest(input *TerminateJobFlowsInput) TerminateJ req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TerminateJobFlowsRequest{Request: req, Input: input} + return TerminateJobFlowsRequest{Request: req, Input: input, Copy: c.TerminateJobFlowsRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceFleetInput diff --git a/service/emr/emriface/interface.go b/service/emr/emriface/interface.go index afab6dcadb6..270ee32c782 100644 --- a/service/emr/emriface/interface.go +++ b/service/emr/emriface/interface.go @@ -87,36 +87,18 @@ type EMRAPI interface { ListBootstrapActionsRequest(*emr.ListBootstrapActionsInput) emr.ListBootstrapActionsRequest - ListBootstrapActionsPages(*emr.ListBootstrapActionsInput, func(*emr.ListBootstrapActionsOutput, bool) bool) error - ListBootstrapActionsPagesWithContext(aws.Context, *emr.ListBootstrapActionsInput, func(*emr.ListBootstrapActionsOutput, bool) bool, ...aws.Option) error - ListClustersRequest(*emr.ListClustersInput) emr.ListClustersRequest - ListClustersPages(*emr.ListClustersInput, func(*emr.ListClustersOutput, bool) bool) error - ListClustersPagesWithContext(aws.Context, *emr.ListClustersInput, func(*emr.ListClustersOutput, bool) bool, ...aws.Option) error - ListInstanceFleetsRequest(*emr.ListInstanceFleetsInput) emr.ListInstanceFleetsRequest - ListInstanceFleetsPages(*emr.ListInstanceFleetsInput, func(*emr.ListInstanceFleetsOutput, bool) bool) error - ListInstanceFleetsPagesWithContext(aws.Context, *emr.ListInstanceFleetsInput, func(*emr.ListInstanceFleetsOutput, bool) bool, ...aws.Option) error - ListInstanceGroupsRequest(*emr.ListInstanceGroupsInput) emr.ListInstanceGroupsRequest - ListInstanceGroupsPages(*emr.ListInstanceGroupsInput, func(*emr.ListInstanceGroupsOutput, bool) bool) error - ListInstanceGroupsPagesWithContext(aws.Context, *emr.ListInstanceGroupsInput, func(*emr.ListInstanceGroupsOutput, bool) bool, ...aws.Option) error - ListInstancesRequest(*emr.ListInstancesInput) emr.ListInstancesRequest - ListInstancesPages(*emr.ListInstancesInput, func(*emr.ListInstancesOutput, bool) bool) error - ListInstancesPagesWithContext(aws.Context, *emr.ListInstancesInput, func(*emr.ListInstancesOutput, bool) bool, ...aws.Option) error - ListSecurityConfigurationsRequest(*emr.ListSecurityConfigurationsInput) emr.ListSecurityConfigurationsRequest ListStepsRequest(*emr.ListStepsInput) emr.ListStepsRequest - ListStepsPages(*emr.ListStepsInput, func(*emr.ListStepsOutput, bool) bool) error - ListStepsPagesWithContext(aws.Context, *emr.ListStepsInput, func(*emr.ListStepsOutput, bool) bool, ...aws.Option) error - ModifyInstanceFleetRequest(*emr.ModifyInstanceFleetInput) emr.ModifyInstanceFleetRequest ModifyInstanceGroupsRequest(*emr.ModifyInstanceGroupsInput) emr.ModifyInstanceGroupsRequest diff --git a/service/firehose/api.go b/service/firehose/api.go index dd7babf82c6..544ec360c32 100644 --- a/service/firehose/api.go +++ b/service/firehose/api.go @@ -16,6 +16,7 @@ const opCreateDeliveryStream = "CreateDeliveryStream" type CreateDeliveryStreamRequest struct { *aws.Request Input *CreateDeliveryStreamInput + Copy func(*CreateDeliveryStreamInput) CreateDeliveryStreamRequest } // Send marshals and sends the CreateDeliveryStream API request. @@ -107,7 +108,7 @@ func (c *Firehose) CreateDeliveryStreamRequest(input *CreateDeliveryStreamInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDeliveryStreamRequest{Request: req, Input: input} + return CreateDeliveryStreamRequest{Request: req, Input: input, Copy: c.CreateDeliveryStreamRequest} } const opDeleteDeliveryStream = "DeleteDeliveryStream" @@ -116,6 +117,7 @@ const opDeleteDeliveryStream = "DeleteDeliveryStream" type DeleteDeliveryStreamRequest struct { *aws.Request Input *DeleteDeliveryStreamInput + Copy func(*DeleteDeliveryStreamInput) DeleteDeliveryStreamRequest } // Send marshals and sends the DeleteDeliveryStream API request. @@ -167,7 +169,7 @@ func (c *Firehose) DeleteDeliveryStreamRequest(input *DeleteDeliveryStreamInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDeliveryStreamRequest{Request: req, Input: input} + return DeleteDeliveryStreamRequest{Request: req, Input: input, Copy: c.DeleteDeliveryStreamRequest} } const opDescribeDeliveryStream = "DescribeDeliveryStream" @@ -176,6 +178,7 @@ const opDescribeDeliveryStream = "DescribeDeliveryStream" type DescribeDeliveryStreamRequest struct { *aws.Request Input *DescribeDeliveryStreamInput + Copy func(*DescribeDeliveryStreamInput) DescribeDeliveryStreamRequest } // Send marshals and sends the DescribeDeliveryStream API request. @@ -219,7 +222,7 @@ func (c *Firehose) DescribeDeliveryStreamRequest(input *DescribeDeliveryStreamIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDeliveryStreamRequest{Request: req, Input: input} + return DescribeDeliveryStreamRequest{Request: req, Input: input, Copy: c.DescribeDeliveryStreamRequest} } const opListDeliveryStreams = "ListDeliveryStreams" @@ -228,6 +231,7 @@ const opListDeliveryStreams = "ListDeliveryStreams" type ListDeliveryStreamsRequest struct { *aws.Request Input *ListDeliveryStreamsInput + Copy func(*ListDeliveryStreamsInput) ListDeliveryStreamsRequest } // Send marshals and sends the ListDeliveryStreams API request. @@ -276,7 +280,7 @@ func (c *Firehose) ListDeliveryStreamsRequest(input *ListDeliveryStreamsInput) L req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDeliveryStreamsRequest{Request: req, Input: input} + return ListDeliveryStreamsRequest{Request: req, Input: input, Copy: c.ListDeliveryStreamsRequest} } const opPutRecord = "PutRecord" @@ -285,6 +289,7 @@ const opPutRecord = "PutRecord" type PutRecordRequest struct { *aws.Request Input *PutRecordInput + Copy func(*PutRecordInput) PutRecordRequest } // Send marshals and sends the PutRecord API request. @@ -357,7 +362,7 @@ func (c *Firehose) PutRecordRequest(input *PutRecordInput) PutRecordRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutRecordRequest{Request: req, Input: input} + return PutRecordRequest{Request: req, Input: input, Copy: c.PutRecordRequest} } const opPutRecordBatch = "PutRecordBatch" @@ -366,6 +371,7 @@ const opPutRecordBatch = "PutRecordBatch" type PutRecordBatchRequest struct { *aws.Request Input *PutRecordBatchInput + Copy func(*PutRecordBatchInput) PutRecordBatchRequest } // Send marshals and sends the PutRecordBatch API request. @@ -463,7 +469,7 @@ func (c *Firehose) PutRecordBatchRequest(input *PutRecordBatchInput) PutRecordBa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutRecordBatchRequest{Request: req, Input: input} + return PutRecordBatchRequest{Request: req, Input: input, Copy: c.PutRecordBatchRequest} } const opUpdateDestination = "UpdateDestination" @@ -472,6 +478,7 @@ const opUpdateDestination = "UpdateDestination" type UpdateDestinationRequest struct { *aws.Request Input *UpdateDestinationInput + Copy func(*UpdateDestinationInput) UpdateDestinationRequest } // Send marshals and sends the UpdateDestination API request. @@ -541,7 +548,7 @@ func (c *Firehose) UpdateDestinationRequest(input *UpdateDestinationInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDestinationRequest{Request: req, Input: input} + return UpdateDestinationRequest{Request: req, Input: input, Copy: c.UpdateDestinationRequest} } // Describes hints for the buffering to perform before delivering data to the diff --git a/service/gamelift/api.go b/service/gamelift/api.go index 159586cef7a..e5f296e6982 100644 --- a/service/gamelift/api.go +++ b/service/gamelift/api.go @@ -18,6 +18,7 @@ const opAcceptMatch = "AcceptMatch" type AcceptMatchRequest struct { *aws.Request Input *AcceptMatchInput + Copy func(*AcceptMatchInput) AcceptMatchRequest } // Send marshals and sends the AcceptMatch API request. @@ -89,7 +90,7 @@ func (c *GameLift) AcceptMatchRequest(input *AcceptMatchInput) AcceptMatchReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcceptMatchRequest{Request: req, Input: input} + return AcceptMatchRequest{Request: req, Input: input, Copy: c.AcceptMatchRequest} } const opCreateAlias = "CreateAlias" @@ -98,6 +99,7 @@ const opCreateAlias = "CreateAlias" type CreateAliasRequest struct { *aws.Request Input *CreateAliasInput + Copy func(*CreateAliasInput) CreateAliasRequest } // Send marshals and sends the CreateAlias API request. @@ -170,7 +172,7 @@ func (c *GameLift) CreateAliasRequest(input *CreateAliasInput) CreateAliasReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAliasRequest{Request: req, Input: input} + return CreateAliasRequest{Request: req, Input: input, Copy: c.CreateAliasRequest} } const opCreateBuild = "CreateBuild" @@ -179,6 +181,7 @@ const opCreateBuild = "CreateBuild" type CreateBuildRequest struct { *aws.Request Input *CreateBuildInput + Copy func(*CreateBuildInput) CreateBuildRequest } // Send marshals and sends the CreateBuild API request. @@ -248,7 +251,7 @@ func (c *GameLift) CreateBuildRequest(input *CreateBuildInput) CreateBuildReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBuildRequest{Request: req, Input: input} + return CreateBuildRequest{Request: req, Input: input, Copy: c.CreateBuildRequest} } const opCreateFleet = "CreateFleet" @@ -257,6 +260,7 @@ const opCreateFleet = "CreateFleet" type CreateFleetRequest struct { *aws.Request Input *CreateFleetInput + Copy func(*CreateFleetInput) CreateFleetRequest } // Send marshals and sends the CreateFleet API request. @@ -390,7 +394,7 @@ func (c *GameLift) CreateFleetRequest(input *CreateFleetInput) CreateFleetReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFleetRequest{Request: req, Input: input} + return CreateFleetRequest{Request: req, Input: input, Copy: c.CreateFleetRequest} } const opCreateGameSession = "CreateGameSession" @@ -399,6 +403,7 @@ const opCreateGameSession = "CreateGameSession" type CreateGameSessionRequest struct { *aws.Request Input *CreateGameSessionInput + Copy func(*CreateGameSessionInput) CreateGameSessionRequest } // Send marshals and sends the CreateGameSession API request. @@ -490,7 +495,7 @@ func (c *GameLift) CreateGameSessionRequest(input *CreateGameSessionInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGameSessionRequest{Request: req, Input: input} + return CreateGameSessionRequest{Request: req, Input: input, Copy: c.CreateGameSessionRequest} } const opCreateGameSessionQueue = "CreateGameSessionQueue" @@ -499,6 +504,7 @@ const opCreateGameSessionQueue = "CreateGameSessionQueue" type CreateGameSessionQueueRequest struct { *aws.Request Input *CreateGameSessionQueueInput + Copy func(*CreateGameSessionQueueInput) CreateGameSessionQueueRequest } // Send marshals and sends the CreateGameSessionQueue API request. @@ -578,7 +584,7 @@ func (c *GameLift) CreateGameSessionQueueRequest(input *CreateGameSessionQueueIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGameSessionQueueRequest{Request: req, Input: input} + return CreateGameSessionQueueRequest{Request: req, Input: input, Copy: c.CreateGameSessionQueueRequest} } const opCreateMatchmakingConfiguration = "CreateMatchmakingConfiguration" @@ -587,6 +593,7 @@ const opCreateMatchmakingConfiguration = "CreateMatchmakingConfiguration" type CreateMatchmakingConfigurationRequest struct { *aws.Request Input *CreateMatchmakingConfigurationInput + Copy func(*CreateMatchmakingConfigurationInput) CreateMatchmakingConfigurationRequest } // Send marshals and sends the CreateMatchmakingConfiguration API request. @@ -670,7 +677,7 @@ func (c *GameLift) CreateMatchmakingConfigurationRequest(input *CreateMatchmakin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateMatchmakingConfigurationRequest{Request: req, Input: input} + return CreateMatchmakingConfigurationRequest{Request: req, Input: input, Copy: c.CreateMatchmakingConfigurationRequest} } const opCreateMatchmakingRuleSet = "CreateMatchmakingRuleSet" @@ -679,6 +686,7 @@ const opCreateMatchmakingRuleSet = "CreateMatchmakingRuleSet" type CreateMatchmakingRuleSetRequest struct { *aws.Request Input *CreateMatchmakingRuleSetInput + Copy func(*CreateMatchmakingRuleSetInput) CreateMatchmakingRuleSetRequest } // Send marshals and sends the CreateMatchmakingRuleSet API request. @@ -755,7 +763,7 @@ func (c *GameLift) CreateMatchmakingRuleSetRequest(input *CreateMatchmakingRuleS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateMatchmakingRuleSetRequest{Request: req, Input: input} + return CreateMatchmakingRuleSetRequest{Request: req, Input: input, Copy: c.CreateMatchmakingRuleSetRequest} } const opCreatePlayerSession = "CreatePlayerSession" @@ -764,6 +772,7 @@ const opCreatePlayerSession = "CreatePlayerSession" type CreatePlayerSessionRequest struct { *aws.Request Input *CreatePlayerSessionInput + Copy func(*CreatePlayerSessionInput) CreatePlayerSessionRequest } // Send marshals and sends the CreatePlayerSession API request. @@ -829,7 +838,7 @@ func (c *GameLift) CreatePlayerSessionRequest(input *CreatePlayerSessionInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePlayerSessionRequest{Request: req, Input: input} + return CreatePlayerSessionRequest{Request: req, Input: input, Copy: c.CreatePlayerSessionRequest} } const opCreatePlayerSessions = "CreatePlayerSessions" @@ -838,6 +847,7 @@ const opCreatePlayerSessions = "CreatePlayerSessions" type CreatePlayerSessionsRequest struct { *aws.Request Input *CreatePlayerSessionsInput + Copy func(*CreatePlayerSessionsInput) CreatePlayerSessionsRequest } // Send marshals and sends the CreatePlayerSessions API request. @@ -904,7 +914,7 @@ func (c *GameLift) CreatePlayerSessionsRequest(input *CreatePlayerSessionsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePlayerSessionsRequest{Request: req, Input: input} + return CreatePlayerSessionsRequest{Request: req, Input: input, Copy: c.CreatePlayerSessionsRequest} } const opCreateVpcPeeringAuthorization = "CreateVpcPeeringAuthorization" @@ -913,6 +923,7 @@ const opCreateVpcPeeringAuthorization = "CreateVpcPeeringAuthorization" type CreateVpcPeeringAuthorizationRequest struct { *aws.Request Input *CreateVpcPeeringAuthorizationInput + Copy func(*CreateVpcPeeringAuthorizationInput) CreateVpcPeeringAuthorizationRequest } // Send marshals and sends the CreateVpcPeeringAuthorization API request. @@ -994,7 +1005,7 @@ func (c *GameLift) CreateVpcPeeringAuthorizationRequest(input *CreateVpcPeeringA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpcPeeringAuthorizationRequest{Request: req, Input: input} + return CreateVpcPeeringAuthorizationRequest{Request: req, Input: input, Copy: c.CreateVpcPeeringAuthorizationRequest} } const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection" @@ -1003,6 +1014,7 @@ const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection" type CreateVpcPeeringConnectionRequest struct { *aws.Request Input *CreateVpcPeeringConnectionInput + Copy func(*CreateVpcPeeringConnectionInput) CreateVpcPeeringConnectionRequest } // Send marshals and sends the CreateVpcPeeringConnection API request. @@ -1079,7 +1091,7 @@ func (c *GameLift) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVpcPeeringConnectionRequest{Request: req, Input: input} + return CreateVpcPeeringConnectionRequest{Request: req, Input: input, Copy: c.CreateVpcPeeringConnectionRequest} } const opDeleteAlias = "DeleteAlias" @@ -1088,6 +1100,7 @@ const opDeleteAlias = "DeleteAlias" type DeleteAliasRequest struct { *aws.Request Input *DeleteAliasInput + Copy func(*DeleteAliasInput) DeleteAliasRequest } // Send marshals and sends the DeleteAlias API request. @@ -1146,7 +1159,7 @@ func (c *GameLift) DeleteAliasRequest(input *DeleteAliasInput) DeleteAliasReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAliasRequest{Request: req, Input: input} + return DeleteAliasRequest{Request: req, Input: input, Copy: c.DeleteAliasRequest} } const opDeleteBuild = "DeleteBuild" @@ -1155,6 +1168,7 @@ const opDeleteBuild = "DeleteBuild" type DeleteBuildRequest struct { *aws.Request Input *DeleteBuildInput + Copy func(*DeleteBuildInput) DeleteBuildRequest } // Send marshals and sends the DeleteBuild API request. @@ -1214,7 +1228,7 @@ func (c *GameLift) DeleteBuildRequest(input *DeleteBuildInput) DeleteBuildReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBuildRequest{Request: req, Input: input} + return DeleteBuildRequest{Request: req, Input: input, Copy: c.DeleteBuildRequest} } const opDeleteFleet = "DeleteFleet" @@ -1223,6 +1237,7 @@ const opDeleteFleet = "DeleteFleet" type DeleteFleetRequest struct { *aws.Request Input *DeleteFleetInput + Copy func(*DeleteFleetInput) DeleteFleetRequest } // Send marshals and sends the DeleteFleet API request. @@ -1313,7 +1328,7 @@ func (c *GameLift) DeleteFleetRequest(input *DeleteFleetInput) DeleteFleetReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteFleetRequest{Request: req, Input: input} + return DeleteFleetRequest{Request: req, Input: input, Copy: c.DeleteFleetRequest} } const opDeleteGameSessionQueue = "DeleteGameSessionQueue" @@ -1322,6 +1337,7 @@ const opDeleteGameSessionQueue = "DeleteGameSessionQueue" type DeleteGameSessionQueueRequest struct { *aws.Request Input *DeleteGameSessionQueueInput + Copy func(*DeleteGameSessionQueueInput) DeleteGameSessionQueueRequest } // Send marshals and sends the DeleteGameSessionQueue API request. @@ -1374,7 +1390,7 @@ func (c *GameLift) DeleteGameSessionQueueRequest(input *DeleteGameSessionQueueIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGameSessionQueueRequest{Request: req, Input: input} + return DeleteGameSessionQueueRequest{Request: req, Input: input, Copy: c.DeleteGameSessionQueueRequest} } const opDeleteMatchmakingConfiguration = "DeleteMatchmakingConfiguration" @@ -1383,6 +1399,7 @@ const opDeleteMatchmakingConfiguration = "DeleteMatchmakingConfiguration" type DeleteMatchmakingConfigurationRequest struct { *aws.Request Input *DeleteMatchmakingConfigurationInput + Copy func(*DeleteMatchmakingConfigurationInput) DeleteMatchmakingConfigurationRequest } // Send marshals and sends the DeleteMatchmakingConfiguration API request. @@ -1441,7 +1458,7 @@ func (c *GameLift) DeleteMatchmakingConfigurationRequest(input *DeleteMatchmakin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteMatchmakingConfigurationRequest{Request: req, Input: input} + return DeleteMatchmakingConfigurationRequest{Request: req, Input: input, Copy: c.DeleteMatchmakingConfigurationRequest} } const opDeleteScalingPolicy = "DeleteScalingPolicy" @@ -1450,6 +1467,7 @@ const opDeleteScalingPolicy = "DeleteScalingPolicy" type DeleteScalingPolicyRequest struct { *aws.Request Input *DeleteScalingPolicyInput + Copy func(*DeleteScalingPolicyInput) DeleteScalingPolicyRequest } // Send marshals and sends the DeleteScalingPolicy API request. @@ -1538,7 +1556,7 @@ func (c *GameLift) DeleteScalingPolicyRequest(input *DeleteScalingPolicyInput) D req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteScalingPolicyRequest{Request: req, Input: input} + return DeleteScalingPolicyRequest{Request: req, Input: input, Copy: c.DeleteScalingPolicyRequest} } const opDeleteVpcPeeringAuthorization = "DeleteVpcPeeringAuthorization" @@ -1547,6 +1565,7 @@ const opDeleteVpcPeeringAuthorization = "DeleteVpcPeeringAuthorization" type DeleteVpcPeeringAuthorizationRequest struct { *aws.Request Input *DeleteVpcPeeringAuthorizationInput + Copy func(*DeleteVpcPeeringAuthorizationInput) DeleteVpcPeeringAuthorizationRequest } // Send marshals and sends the DeleteVpcPeeringAuthorization API request. @@ -1603,7 +1622,7 @@ func (c *GameLift) DeleteVpcPeeringAuthorizationRequest(input *DeleteVpcPeeringA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteVpcPeeringAuthorizationRequest{Request: req, Input: input} + return DeleteVpcPeeringAuthorizationRequest{Request: req, Input: input, Copy: c.DeleteVpcPeeringAuthorizationRequest} } const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection" @@ -1612,6 +1631,7 @@ const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection" type DeleteVpcPeeringConnectionRequest struct { *aws.Request Input *DeleteVpcPeeringConnectionInput + Copy func(*DeleteVpcPeeringConnectionInput) DeleteVpcPeeringConnectionRequest } // Send marshals and sends the DeleteVpcPeeringConnection API request. @@ -1674,7 +1694,7 @@ func (c *GameLift) DeleteVpcPeeringConnectionRequest(input *DeleteVpcPeeringConn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteVpcPeeringConnectionRequest{Request: req, Input: input} + return DeleteVpcPeeringConnectionRequest{Request: req, Input: input, Copy: c.DeleteVpcPeeringConnectionRequest} } const opDescribeAlias = "DescribeAlias" @@ -1683,6 +1703,7 @@ const opDescribeAlias = "DescribeAlias" type DescribeAliasRequest struct { *aws.Request Input *DescribeAliasInput + Copy func(*DescribeAliasInput) DescribeAliasRequest } // Send marshals and sends the DescribeAlias API request. @@ -1741,7 +1762,7 @@ func (c *GameLift) DescribeAliasRequest(input *DescribeAliasInput) DescribeAlias req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAliasRequest{Request: req, Input: input} + return DescribeAliasRequest{Request: req, Input: input, Copy: c.DescribeAliasRequest} } const opDescribeBuild = "DescribeBuild" @@ -1750,6 +1771,7 @@ const opDescribeBuild = "DescribeBuild" type DescribeBuildRequest struct { *aws.Request Input *DescribeBuildInput + Copy func(*DescribeBuildInput) DescribeBuildRequest } // Send marshals and sends the DescribeBuild API request. @@ -1803,7 +1825,7 @@ func (c *GameLift) DescribeBuildRequest(input *DescribeBuildInput) DescribeBuild req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBuildRequest{Request: req, Input: input} + return DescribeBuildRequest{Request: req, Input: input, Copy: c.DescribeBuildRequest} } const opDescribeEC2InstanceLimits = "DescribeEC2InstanceLimits" @@ -1812,6 +1834,7 @@ const opDescribeEC2InstanceLimits = "DescribeEC2InstanceLimits" type DescribeEC2InstanceLimitsRequest struct { *aws.Request Input *DescribeEC2InstanceLimitsInput + Copy func(*DescribeEC2InstanceLimitsInput) DescribeEC2InstanceLimitsRequest } // Send marshals and sends the DescribeEC2InstanceLimits API request. @@ -1904,7 +1927,7 @@ func (c *GameLift) DescribeEC2InstanceLimitsRequest(input *DescribeEC2InstanceLi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEC2InstanceLimitsRequest{Request: req, Input: input} + return DescribeEC2InstanceLimitsRequest{Request: req, Input: input, Copy: c.DescribeEC2InstanceLimitsRequest} } const opDescribeFleetAttributes = "DescribeFleetAttributes" @@ -1913,6 +1936,7 @@ const opDescribeFleetAttributes = "DescribeFleetAttributes" type DescribeFleetAttributesRequest struct { *aws.Request Input *DescribeFleetAttributesInput + Copy func(*DescribeFleetAttributesInput) DescribeFleetAttributesRequest } // Send marshals and sends the DescribeFleetAttributes API request. @@ -2007,7 +2031,7 @@ func (c *GameLift) DescribeFleetAttributesRequest(input *DescribeFleetAttributes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFleetAttributesRequest{Request: req, Input: input} + return DescribeFleetAttributesRequest{Request: req, Input: input, Copy: c.DescribeFleetAttributesRequest} } const opDescribeFleetCapacity = "DescribeFleetCapacity" @@ -2016,6 +2040,7 @@ const opDescribeFleetCapacity = "DescribeFleetCapacity" type DescribeFleetCapacityRequest struct { *aws.Request Input *DescribeFleetCapacityInput + Copy func(*DescribeFleetCapacityInput) DescribeFleetCapacityRequest } // Send marshals and sends the DescribeFleetCapacity API request. @@ -2111,7 +2136,7 @@ func (c *GameLift) DescribeFleetCapacityRequest(input *DescribeFleetCapacityInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFleetCapacityRequest{Request: req, Input: input} + return DescribeFleetCapacityRequest{Request: req, Input: input, Copy: c.DescribeFleetCapacityRequest} } const opDescribeFleetEvents = "DescribeFleetEvents" @@ -2120,6 +2145,7 @@ const opDescribeFleetEvents = "DescribeFleetEvents" type DescribeFleetEventsRequest struct { *aws.Request Input *DescribeFleetEventsInput + Copy func(*DescribeFleetEventsInput) DescribeFleetEventsRequest } // Send marshals and sends the DescribeFleetEvents API request. @@ -2207,7 +2233,7 @@ func (c *GameLift) DescribeFleetEventsRequest(input *DescribeFleetEventsInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFleetEventsRequest{Request: req, Input: input} + return DescribeFleetEventsRequest{Request: req, Input: input, Copy: c.DescribeFleetEventsRequest} } const opDescribeFleetPortSettings = "DescribeFleetPortSettings" @@ -2216,6 +2242,7 @@ const opDescribeFleetPortSettings = "DescribeFleetPortSettings" type DescribeFleetPortSettingsRequest struct { *aws.Request Input *DescribeFleetPortSettingsInput + Copy func(*DescribeFleetPortSettingsInput) DescribeFleetPortSettingsRequest } // Send marshals and sends the DescribeFleetPortSettings API request. @@ -2305,7 +2332,7 @@ func (c *GameLift) DescribeFleetPortSettingsRequest(input *DescribeFleetPortSett req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFleetPortSettingsRequest{Request: req, Input: input} + return DescribeFleetPortSettingsRequest{Request: req, Input: input, Copy: c.DescribeFleetPortSettingsRequest} } const opDescribeFleetUtilization = "DescribeFleetUtilization" @@ -2314,6 +2341,7 @@ const opDescribeFleetUtilization = "DescribeFleetUtilization" type DescribeFleetUtilizationRequest struct { *aws.Request Input *DescribeFleetUtilizationInput + Copy func(*DescribeFleetUtilizationInput) DescribeFleetUtilizationRequest } // Send marshals and sends the DescribeFleetUtilization API request. @@ -2407,7 +2435,7 @@ func (c *GameLift) DescribeFleetUtilizationRequest(input *DescribeFleetUtilizati req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFleetUtilizationRequest{Request: req, Input: input} + return DescribeFleetUtilizationRequest{Request: req, Input: input, Copy: c.DescribeFleetUtilizationRequest} } const opDescribeGameSessionDetails = "DescribeGameSessionDetails" @@ -2416,6 +2444,7 @@ const opDescribeGameSessionDetails = "DescribeGameSessionDetails" type DescribeGameSessionDetailsRequest struct { *aws.Request Input *DescribeGameSessionDetailsInput + Copy func(*DescribeGameSessionDetailsInput) DescribeGameSessionDetailsRequest } // Send marshals and sends the DescribeGameSessionDetails API request. @@ -2488,7 +2517,7 @@ func (c *GameLift) DescribeGameSessionDetailsRequest(input *DescribeGameSessionD req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeGameSessionDetailsRequest{Request: req, Input: input} + return DescribeGameSessionDetailsRequest{Request: req, Input: input, Copy: c.DescribeGameSessionDetailsRequest} } const opDescribeGameSessionPlacement = "DescribeGameSessionPlacement" @@ -2497,6 +2526,7 @@ const opDescribeGameSessionPlacement = "DescribeGameSessionPlacement" type DescribeGameSessionPlacementRequest struct { *aws.Request Input *DescribeGameSessionPlacementInput + Copy func(*DescribeGameSessionPlacementInput) DescribeGameSessionPlacementRequest } // Send marshals and sends the DescribeGameSessionPlacement API request. @@ -2561,7 +2591,7 @@ func (c *GameLift) DescribeGameSessionPlacementRequest(input *DescribeGameSessio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeGameSessionPlacementRequest{Request: req, Input: input} + return DescribeGameSessionPlacementRequest{Request: req, Input: input, Copy: c.DescribeGameSessionPlacementRequest} } const opDescribeGameSessionQueues = "DescribeGameSessionQueues" @@ -2570,6 +2600,7 @@ const opDescribeGameSessionQueues = "DescribeGameSessionQueues" type DescribeGameSessionQueuesRequest struct { *aws.Request Input *DescribeGameSessionQueuesInput + Copy func(*DescribeGameSessionQueuesInput) DescribeGameSessionQueuesRequest } // Send marshals and sends the DescribeGameSessionQueues API request. @@ -2624,7 +2655,7 @@ func (c *GameLift) DescribeGameSessionQueuesRequest(input *DescribeGameSessionQu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeGameSessionQueuesRequest{Request: req, Input: input} + return DescribeGameSessionQueuesRequest{Request: req, Input: input, Copy: c.DescribeGameSessionQueuesRequest} } const opDescribeGameSessions = "DescribeGameSessions" @@ -2633,6 +2664,7 @@ const opDescribeGameSessions = "DescribeGameSessions" type DescribeGameSessionsRequest struct { *aws.Request Input *DescribeGameSessionsInput + Copy func(*DescribeGameSessionsInput) DescribeGameSessionsRequest } // Send marshals and sends the DescribeGameSessions API request. @@ -2706,7 +2738,7 @@ func (c *GameLift) DescribeGameSessionsRequest(input *DescribeGameSessionsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeGameSessionsRequest{Request: req, Input: input} + return DescribeGameSessionsRequest{Request: req, Input: input, Copy: c.DescribeGameSessionsRequest} } const opDescribeInstances = "DescribeInstances" @@ -2715,6 +2747,7 @@ const opDescribeInstances = "DescribeInstances" type DescribeInstancesRequest struct { *aws.Request Input *DescribeInstancesInput + Copy func(*DescribeInstancesInput) DescribeInstancesRequest } // Send marshals and sends the DescribeInstances API request. @@ -2762,7 +2795,7 @@ func (c *GameLift) DescribeInstancesRequest(input *DescribeInstancesInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstancesRequest{Request: req, Input: input} + return DescribeInstancesRequest{Request: req, Input: input, Copy: c.DescribeInstancesRequest} } const opDescribeMatchmaking = "DescribeMatchmaking" @@ -2771,6 +2804,7 @@ const opDescribeMatchmaking = "DescribeMatchmaking" type DescribeMatchmakingRequest struct { *aws.Request Input *DescribeMatchmakingInput + Copy func(*DescribeMatchmakingInput) DescribeMatchmakingRequest } // Send marshals and sends the DescribeMatchmaking API request. @@ -2833,7 +2867,7 @@ func (c *GameLift) DescribeMatchmakingRequest(input *DescribeMatchmakingInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMatchmakingRequest{Request: req, Input: input} + return DescribeMatchmakingRequest{Request: req, Input: input, Copy: c.DescribeMatchmakingRequest} } const opDescribeMatchmakingConfigurations = "DescribeMatchmakingConfigurations" @@ -2842,6 +2876,7 @@ const opDescribeMatchmakingConfigurations = "DescribeMatchmakingConfigurations" type DescribeMatchmakingConfigurationsRequest struct { *aws.Request Input *DescribeMatchmakingConfigurationsInput + Copy func(*DescribeMatchmakingConfigurationsInput) DescribeMatchmakingConfigurationsRequest } // Send marshals and sends the DescribeMatchmakingConfigurations API request. @@ -2905,7 +2940,7 @@ func (c *GameLift) DescribeMatchmakingConfigurationsRequest(input *DescribeMatch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMatchmakingConfigurationsRequest{Request: req, Input: input} + return DescribeMatchmakingConfigurationsRequest{Request: req, Input: input, Copy: c.DescribeMatchmakingConfigurationsRequest} } const opDescribeMatchmakingRuleSets = "DescribeMatchmakingRuleSets" @@ -2914,6 +2949,7 @@ const opDescribeMatchmakingRuleSets = "DescribeMatchmakingRuleSets" type DescribeMatchmakingRuleSetsRequest struct { *aws.Request Input *DescribeMatchmakingRuleSetsInput + Copy func(*DescribeMatchmakingRuleSetsInput) DescribeMatchmakingRuleSetsRequest } // Send marshals and sends the DescribeMatchmakingRuleSets API request. @@ -2974,7 +3010,7 @@ func (c *GameLift) DescribeMatchmakingRuleSetsRequest(input *DescribeMatchmaking req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMatchmakingRuleSetsRequest{Request: req, Input: input} + return DescribeMatchmakingRuleSetsRequest{Request: req, Input: input, Copy: c.DescribeMatchmakingRuleSetsRequest} } const opDescribePlayerSessions = "DescribePlayerSessions" @@ -2983,6 +3019,7 @@ const opDescribePlayerSessions = "DescribePlayerSessions" type DescribePlayerSessionsRequest struct { *aws.Request Input *DescribePlayerSessionsInput + Copy func(*DescribePlayerSessionsInput) DescribePlayerSessionsRequest } // Send marshals and sends the DescribePlayerSessions API request. @@ -3051,7 +3088,7 @@ func (c *GameLift) DescribePlayerSessionsRequest(input *DescribePlayerSessionsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePlayerSessionsRequest{Request: req, Input: input} + return DescribePlayerSessionsRequest{Request: req, Input: input, Copy: c.DescribePlayerSessionsRequest} } const opDescribeRuntimeConfiguration = "DescribeRuntimeConfiguration" @@ -3060,6 +3097,7 @@ const opDescribeRuntimeConfiguration = "DescribeRuntimeConfiguration" type DescribeRuntimeConfigurationRequest struct { *aws.Request Input *DescribeRuntimeConfigurationInput + Copy func(*DescribeRuntimeConfigurationInput) DescribeRuntimeConfigurationRequest } // Send marshals and sends the DescribeRuntimeConfiguration API request. @@ -3146,7 +3184,7 @@ func (c *GameLift) DescribeRuntimeConfigurationRequest(input *DescribeRuntimeCon req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRuntimeConfigurationRequest{Request: req, Input: input} + return DescribeRuntimeConfigurationRequest{Request: req, Input: input, Copy: c.DescribeRuntimeConfigurationRequest} } const opDescribeScalingPolicies = "DescribeScalingPolicies" @@ -3155,6 +3193,7 @@ const opDescribeScalingPolicies = "DescribeScalingPolicies" type DescribeScalingPoliciesRequest struct { *aws.Request Input *DescribeScalingPoliciesInput + Copy func(*DescribeScalingPoliciesInput) DescribeScalingPoliciesRequest } // Send marshals and sends the DescribeScalingPolicies API request. @@ -3244,7 +3283,7 @@ func (c *GameLift) DescribeScalingPoliciesRequest(input *DescribeScalingPolicies req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeScalingPoliciesRequest{Request: req, Input: input} + return DescribeScalingPoliciesRequest{Request: req, Input: input, Copy: c.DescribeScalingPoliciesRequest} } const opDescribeVpcPeeringAuthorizations = "DescribeVpcPeeringAuthorizations" @@ -3253,6 +3292,7 @@ const opDescribeVpcPeeringAuthorizations = "DescribeVpcPeeringAuthorizations" type DescribeVpcPeeringAuthorizationsRequest struct { *aws.Request Input *DescribeVpcPeeringAuthorizationsInput + Copy func(*DescribeVpcPeeringAuthorizationsInput) DescribeVpcPeeringAuthorizationsRequest } // Send marshals and sends the DescribeVpcPeeringAuthorizations API request. @@ -3309,7 +3349,7 @@ func (c *GameLift) DescribeVpcPeeringAuthorizationsRequest(input *DescribeVpcPee req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcPeeringAuthorizationsRequest{Request: req, Input: input} + return DescribeVpcPeeringAuthorizationsRequest{Request: req, Input: input, Copy: c.DescribeVpcPeeringAuthorizationsRequest} } const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" @@ -3318,6 +3358,7 @@ const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" type DescribeVpcPeeringConnectionsRequest struct { *aws.Request Input *DescribeVpcPeeringConnectionsInput + Copy func(*DescribeVpcPeeringConnectionsInput) DescribeVpcPeeringConnectionsRequest } // Send marshals and sends the DescribeVpcPeeringConnections API request. @@ -3379,7 +3420,7 @@ func (c *GameLift) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeerin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVpcPeeringConnectionsRequest{Request: req, Input: input} + return DescribeVpcPeeringConnectionsRequest{Request: req, Input: input, Copy: c.DescribeVpcPeeringConnectionsRequest} } const opGetGameSessionLogUrl = "GetGameSessionLogUrl" @@ -3388,6 +3429,7 @@ const opGetGameSessionLogUrl = "GetGameSessionLogUrl" type GetGameSessionLogUrlRequest struct { *aws.Request Input *GetGameSessionLogUrlInput + Copy func(*GetGameSessionLogUrlInput) GetGameSessionLogUrlRequest } // Send marshals and sends the GetGameSessionLogUrl API request. @@ -3457,7 +3499,7 @@ func (c *GameLift) GetGameSessionLogUrlRequest(input *GetGameSessionLogUrlInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGameSessionLogUrlRequest{Request: req, Input: input} + return GetGameSessionLogUrlRequest{Request: req, Input: input, Copy: c.GetGameSessionLogUrlRequest} } const opGetInstanceAccess = "GetInstanceAccess" @@ -3466,6 +3508,7 @@ const opGetInstanceAccess = "GetInstanceAccess" type GetInstanceAccessRequest struct { *aws.Request Input *GetInstanceAccessInput + Copy func(*GetInstanceAccessInput) GetInstanceAccessRequest } // Send marshals and sends the GetInstanceAccess API request. @@ -3521,7 +3564,7 @@ func (c *GameLift) GetInstanceAccessRequest(input *GetInstanceAccessInput) GetIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstanceAccessRequest{Request: req, Input: input} + return GetInstanceAccessRequest{Request: req, Input: input, Copy: c.GetInstanceAccessRequest} } const opListAliases = "ListAliases" @@ -3530,6 +3573,7 @@ const opListAliases = "ListAliases" type ListAliasesRequest struct { *aws.Request Input *ListAliasesInput + Copy func(*ListAliasesInput) ListAliasesRequest } // Send marshals and sends the ListAliases API request. @@ -3588,7 +3632,7 @@ func (c *GameLift) ListAliasesRequest(input *ListAliasesInput) ListAliasesReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAliasesRequest{Request: req, Input: input} + return ListAliasesRequest{Request: req, Input: input, Copy: c.ListAliasesRequest} } const opListBuilds = "ListBuilds" @@ -3597,6 +3641,7 @@ const opListBuilds = "ListBuilds" type ListBuildsRequest struct { *aws.Request Input *ListBuildsInput + Copy func(*ListBuildsInput) ListBuildsRequest } // Send marshals and sends the ListBuilds API request. @@ -3654,7 +3699,7 @@ func (c *GameLift) ListBuildsRequest(input *ListBuildsInput) ListBuildsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBuildsRequest{Request: req, Input: input} + return ListBuildsRequest{Request: req, Input: input, Copy: c.ListBuildsRequest} } const opListFleets = "ListFleets" @@ -3663,6 +3708,7 @@ const opListFleets = "ListFleets" type ListFleetsRequest struct { *aws.Request Input *ListFleetsInput + Copy func(*ListFleetsInput) ListFleetsRequest } // Send marshals and sends the ListFleets API request. @@ -3751,7 +3797,7 @@ func (c *GameLift) ListFleetsRequest(input *ListFleetsInput) ListFleetsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFleetsRequest{Request: req, Input: input} + return ListFleetsRequest{Request: req, Input: input, Copy: c.ListFleetsRequest} } const opPutScalingPolicy = "PutScalingPolicy" @@ -3760,6 +3806,7 @@ const opPutScalingPolicy = "PutScalingPolicy" type PutScalingPolicyRequest struct { *aws.Request Input *PutScalingPolicyInput + Copy func(*PutScalingPolicyInput) PutScalingPolicyRequest } // Send marshals and sends the PutScalingPolicy API request. @@ -3865,7 +3912,7 @@ func (c *GameLift) PutScalingPolicyRequest(input *PutScalingPolicyInput) PutScal req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutScalingPolicyRequest{Request: req, Input: input} + return PutScalingPolicyRequest{Request: req, Input: input, Copy: c.PutScalingPolicyRequest} } const opRequestUploadCredentials = "RequestUploadCredentials" @@ -3874,6 +3921,7 @@ const opRequestUploadCredentials = "RequestUploadCredentials" type RequestUploadCredentialsRequest struct { *aws.Request Input *RequestUploadCredentialsInput + Copy func(*RequestUploadCredentialsInput) RequestUploadCredentialsRequest } // Send marshals and sends the RequestUploadCredentials API request. @@ -3916,7 +3964,7 @@ func (c *GameLift) RequestUploadCredentialsRequest(input *RequestUploadCredentia req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RequestUploadCredentialsRequest{Request: req, Input: input} + return RequestUploadCredentialsRequest{Request: req, Input: input, Copy: c.RequestUploadCredentialsRequest} } const opResolveAlias = "ResolveAlias" @@ -3925,6 +3973,7 @@ const opResolveAlias = "ResolveAlias" type ResolveAliasRequest struct { *aws.Request Input *ResolveAliasInput + Copy func(*ResolveAliasInput) ResolveAliasRequest } // Send marshals and sends the ResolveAlias API request. @@ -3979,7 +4028,7 @@ func (c *GameLift) ResolveAliasRequest(input *ResolveAliasInput) ResolveAliasReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResolveAliasRequest{Request: req, Input: input} + return ResolveAliasRequest{Request: req, Input: input, Copy: c.ResolveAliasRequest} } const opSearchGameSessions = "SearchGameSessions" @@ -3988,6 +4037,7 @@ const opSearchGameSessions = "SearchGameSessions" type SearchGameSessionsRequest struct { *aws.Request Input *SearchGameSessionsInput + Copy func(*SearchGameSessionsInput) SearchGameSessionsRequest } // Send marshals and sends the SearchGameSessions API request. @@ -4092,7 +4142,7 @@ func (c *GameLift) SearchGameSessionsRequest(input *SearchGameSessionsInput) Sea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchGameSessionsRequest{Request: req, Input: input} + return SearchGameSessionsRequest{Request: req, Input: input, Copy: c.SearchGameSessionsRequest} } const opStartGameSessionPlacement = "StartGameSessionPlacement" @@ -4101,6 +4151,7 @@ const opStartGameSessionPlacement = "StartGameSessionPlacement" type StartGameSessionPlacementRequest struct { *aws.Request Input *StartGameSessionPlacementInput + Copy func(*StartGameSessionPlacementInput) StartGameSessionPlacementRequest } // Send marshals and sends the StartGameSessionPlacement API request. @@ -4203,7 +4254,7 @@ func (c *GameLift) StartGameSessionPlacementRequest(input *StartGameSessionPlace req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartGameSessionPlacementRequest{Request: req, Input: input} + return StartGameSessionPlacementRequest{Request: req, Input: input, Copy: c.StartGameSessionPlacementRequest} } const opStartMatchmaking = "StartMatchmaking" @@ -4212,6 +4263,7 @@ const opStartMatchmaking = "StartMatchmaking" type StartMatchmakingRequest struct { *aws.Request Input *StartMatchmakingInput + Copy func(*StartMatchmakingInput) StartMatchmakingRequest } // Send marshals and sends the StartMatchmaking API request. @@ -4322,7 +4374,7 @@ func (c *GameLift) StartMatchmakingRequest(input *StartMatchmakingInput) StartMa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartMatchmakingRequest{Request: req, Input: input} + return StartMatchmakingRequest{Request: req, Input: input, Copy: c.StartMatchmakingRequest} } const opStopGameSessionPlacement = "StopGameSessionPlacement" @@ -4331,6 +4383,7 @@ const opStopGameSessionPlacement = "StopGameSessionPlacement" type StopGameSessionPlacementRequest struct { *aws.Request Input *StopGameSessionPlacementInput + Copy func(*StopGameSessionPlacementInput) StopGameSessionPlacementRequest } // Send marshals and sends the StopGameSessionPlacement API request. @@ -4395,7 +4448,7 @@ func (c *GameLift) StopGameSessionPlacementRequest(input *StopGameSessionPlaceme req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopGameSessionPlacementRequest{Request: req, Input: input} + return StopGameSessionPlacementRequest{Request: req, Input: input, Copy: c.StopGameSessionPlacementRequest} } const opStopMatchmaking = "StopMatchmaking" @@ -4404,6 +4457,7 @@ const opStopMatchmaking = "StopMatchmaking" type StopMatchmakingRequest struct { *aws.Request Input *StopMatchmakingInput + Copy func(*StopMatchmakingInput) StopMatchmakingRequest } // Send marshals and sends the StopMatchmaking API request. @@ -4456,7 +4510,7 @@ func (c *GameLift) StopMatchmakingRequest(input *StopMatchmakingInput) StopMatch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopMatchmakingRequest{Request: req, Input: input} + return StopMatchmakingRequest{Request: req, Input: input, Copy: c.StopMatchmakingRequest} } const opUpdateAlias = "UpdateAlias" @@ -4465,6 +4519,7 @@ const opUpdateAlias = "UpdateAlias" type UpdateAliasRequest struct { *aws.Request Input *UpdateAliasInput + Copy func(*UpdateAliasInput) UpdateAliasRequest } // Send marshals and sends the UpdateAlias API request. @@ -4522,7 +4577,7 @@ func (c *GameLift) UpdateAliasRequest(input *UpdateAliasInput) UpdateAliasReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAliasRequest{Request: req, Input: input} + return UpdateAliasRequest{Request: req, Input: input, Copy: c.UpdateAliasRequest} } const opUpdateBuild = "UpdateBuild" @@ -4531,6 +4586,7 @@ const opUpdateBuild = "UpdateBuild" type UpdateBuildRequest struct { *aws.Request Input *UpdateBuildInput + Copy func(*UpdateBuildInput) UpdateBuildRequest } // Send marshals and sends the UpdateBuild API request. @@ -4586,7 +4642,7 @@ func (c *GameLift) UpdateBuildRequest(input *UpdateBuildInput) UpdateBuildReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateBuildRequest{Request: req, Input: input} + return UpdateBuildRequest{Request: req, Input: input, Copy: c.UpdateBuildRequest} } const opUpdateFleetAttributes = "UpdateFleetAttributes" @@ -4595,6 +4651,7 @@ const opUpdateFleetAttributes = "UpdateFleetAttributes" type UpdateFleetAttributesRequest struct { *aws.Request Input *UpdateFleetAttributesInput + Copy func(*UpdateFleetAttributesInput) UpdateFleetAttributesRequest } // Send marshals and sends the UpdateFleetAttributes API request. @@ -4681,7 +4738,7 @@ func (c *GameLift) UpdateFleetAttributesRequest(input *UpdateFleetAttributesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateFleetAttributesRequest{Request: req, Input: input} + return UpdateFleetAttributesRequest{Request: req, Input: input, Copy: c.UpdateFleetAttributesRequest} } const opUpdateFleetCapacity = "UpdateFleetCapacity" @@ -4690,6 +4747,7 @@ const opUpdateFleetCapacity = "UpdateFleetCapacity" type UpdateFleetCapacityRequest struct { *aws.Request Input *UpdateFleetCapacityInput + Copy func(*UpdateFleetCapacityInput) UpdateFleetCapacityRequest } // Send marshals and sends the UpdateFleetCapacity API request. @@ -4788,7 +4846,7 @@ func (c *GameLift) UpdateFleetCapacityRequest(input *UpdateFleetCapacityInput) U req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateFleetCapacityRequest{Request: req, Input: input} + return UpdateFleetCapacityRequest{Request: req, Input: input, Copy: c.UpdateFleetCapacityRequest} } const opUpdateFleetPortSettings = "UpdateFleetPortSettings" @@ -4797,6 +4855,7 @@ const opUpdateFleetPortSettings = "UpdateFleetPortSettings" type UpdateFleetPortSettingsRequest struct { *aws.Request Input *UpdateFleetPortSettingsInput + Copy func(*UpdateFleetPortSettingsInput) UpdateFleetPortSettingsRequest } // Send marshals and sends the UpdateFleetPortSettings API request. @@ -4886,7 +4945,7 @@ func (c *GameLift) UpdateFleetPortSettingsRequest(input *UpdateFleetPortSettings req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateFleetPortSettingsRequest{Request: req, Input: input} + return UpdateFleetPortSettingsRequest{Request: req, Input: input, Copy: c.UpdateFleetPortSettingsRequest} } const opUpdateGameSession = "UpdateGameSession" @@ -4895,6 +4954,7 @@ const opUpdateGameSession = "UpdateGameSession" type UpdateGameSessionRequest struct { *aws.Request Input *UpdateGameSessionInput + Copy func(*UpdateGameSessionInput) UpdateGameSessionRequest } // Send marshals and sends the UpdateGameSession API request. @@ -4963,7 +5023,7 @@ func (c *GameLift) UpdateGameSessionRequest(input *UpdateGameSessionInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGameSessionRequest{Request: req, Input: input} + return UpdateGameSessionRequest{Request: req, Input: input, Copy: c.UpdateGameSessionRequest} } const opUpdateGameSessionQueue = "UpdateGameSessionQueue" @@ -4972,6 +5032,7 @@ const opUpdateGameSessionQueue = "UpdateGameSessionQueue" type UpdateGameSessionQueueRequest struct { *aws.Request Input *UpdateGameSessionQueueInput + Copy func(*UpdateGameSessionQueueInput) UpdateGameSessionQueueRequest } // Send marshals and sends the UpdateGameSessionQueue API request. @@ -5025,7 +5086,7 @@ func (c *GameLift) UpdateGameSessionQueueRequest(input *UpdateGameSessionQueueIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGameSessionQueueRequest{Request: req, Input: input} + return UpdateGameSessionQueueRequest{Request: req, Input: input, Copy: c.UpdateGameSessionQueueRequest} } const opUpdateMatchmakingConfiguration = "UpdateMatchmakingConfiguration" @@ -5034,6 +5095,7 @@ const opUpdateMatchmakingConfiguration = "UpdateMatchmakingConfiguration" type UpdateMatchmakingConfigurationRequest struct { *aws.Request Input *UpdateMatchmakingConfigurationInput + Copy func(*UpdateMatchmakingConfigurationInput) UpdateMatchmakingConfigurationRequest } // Send marshals and sends the UpdateMatchmakingConfiguration API request. @@ -5091,7 +5153,7 @@ func (c *GameLift) UpdateMatchmakingConfigurationRequest(input *UpdateMatchmakin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateMatchmakingConfigurationRequest{Request: req, Input: input} + return UpdateMatchmakingConfigurationRequest{Request: req, Input: input, Copy: c.UpdateMatchmakingConfigurationRequest} } const opUpdateRuntimeConfiguration = "UpdateRuntimeConfiguration" @@ -5100,6 +5162,7 @@ const opUpdateRuntimeConfiguration = "UpdateRuntimeConfiguration" type UpdateRuntimeConfigurationRequest struct { *aws.Request Input *UpdateRuntimeConfigurationInput + Copy func(*UpdateRuntimeConfigurationInput) UpdateRuntimeConfigurationRequest } // Send marshals and sends the UpdateRuntimeConfiguration API request. @@ -5199,7 +5262,7 @@ func (c *GameLift) UpdateRuntimeConfigurationRequest(input *UpdateRuntimeConfigu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRuntimeConfigurationRequest{Request: req, Input: input} + return UpdateRuntimeConfigurationRequest{Request: req, Input: input, Copy: c.UpdateRuntimeConfigurationRequest} } const opValidateMatchmakingRuleSet = "ValidateMatchmakingRuleSet" @@ -5208,6 +5271,7 @@ const opValidateMatchmakingRuleSet = "ValidateMatchmakingRuleSet" type ValidateMatchmakingRuleSetRequest struct { *aws.Request Input *ValidateMatchmakingRuleSetInput + Copy func(*ValidateMatchmakingRuleSetInput) ValidateMatchmakingRuleSetRequest } // Send marshals and sends the ValidateMatchmakingRuleSet API request. @@ -5266,7 +5330,7 @@ func (c *GameLift) ValidateMatchmakingRuleSetRequest(input *ValidateMatchmakingR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ValidateMatchmakingRuleSetRequest{Request: req, Input: input} + return ValidateMatchmakingRuleSetRequest{Request: req, Input: input, Copy: c.ValidateMatchmakingRuleSetRequest} } // Represents the input for a request action. diff --git a/service/glacier/api.go b/service/glacier/api.go index a452e56c83d..40101d394bb 100644 --- a/service/glacier/api.go +++ b/service/glacier/api.go @@ -18,6 +18,7 @@ const opAbortMultipartUpload = "AbortMultipartUpload" type AbortMultipartUploadRequest struct { *aws.Request Input *AbortMultipartUploadInput + Copy func(*AbortMultipartUploadInput) AbortMultipartUploadRequest } // Send marshals and sends the AbortMultipartUpload API request. @@ -77,7 +78,7 @@ func (c *Glacier) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AbortMultipartUploadRequest{Request: req, Input: input} + return AbortMultipartUploadRequest{Request: req, Input: input, Copy: c.AbortMultipartUploadRequest} } const opAbortVaultLock = "AbortVaultLock" @@ -86,6 +87,7 @@ const opAbortVaultLock = "AbortVaultLock" type AbortVaultLockRequest struct { *aws.Request Input *AbortVaultLockInput + Copy func(*AbortVaultLockInput) AbortVaultLockRequest } // Send marshals and sends the AbortVaultLock API request. @@ -141,7 +143,7 @@ func (c *Glacier) AbortVaultLockRequest(input *AbortVaultLockInput) AbortVaultLo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AbortVaultLockRequest{Request: req, Input: input} + return AbortVaultLockRequest{Request: req, Input: input, Copy: c.AbortVaultLockRequest} } const opAddTagsToVault = "AddTagsToVault" @@ -150,6 +152,7 @@ const opAddTagsToVault = "AddTagsToVault" type AddTagsToVaultRequest struct { *aws.Request Input *AddTagsToVaultInput + Copy func(*AddTagsToVaultInput) AddTagsToVaultRequest } // Send marshals and sends the AddTagsToVault API request. @@ -195,7 +198,7 @@ func (c *Glacier) AddTagsToVaultRequest(input *AddTagsToVaultInput) AddTagsToVau req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddTagsToVaultRequest{Request: req, Input: input} + return AddTagsToVaultRequest{Request: req, Input: input, Copy: c.AddTagsToVaultRequest} } const opCompleteMultipartUpload = "CompleteMultipartUpload" @@ -204,6 +207,7 @@ const opCompleteMultipartUpload = "CompleteMultipartUpload" type CompleteMultipartUploadRequest struct { *aws.Request Input *CompleteMultipartUploadInput + Copy func(*CompleteMultipartUploadInput) CompleteMultipartUploadRequest } // Send marshals and sends the CompleteMultipartUpload API request. @@ -285,7 +289,7 @@ func (c *Glacier) CompleteMultipartUploadRequest(input *CompleteMultipartUploadI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CompleteMultipartUploadRequest{Request: req, Input: input} + return CompleteMultipartUploadRequest{Request: req, Input: input, Copy: c.CompleteMultipartUploadRequest} } const opCompleteVaultLock = "CompleteVaultLock" @@ -294,6 +298,7 @@ const opCompleteVaultLock = "CompleteVaultLock" type CompleteVaultLockRequest struct { *aws.Request Input *CompleteVaultLockInput + Copy func(*CompleteVaultLockInput) CompleteVaultLockRequest } // Send marshals and sends the CompleteVaultLock API request. @@ -348,7 +353,7 @@ func (c *Glacier) CompleteVaultLockRequest(input *CompleteVaultLockInput) Comple req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CompleteVaultLockRequest{Request: req, Input: input} + return CompleteVaultLockRequest{Request: req, Input: input, Copy: c.CompleteVaultLockRequest} } const opCreateVault = "CreateVault" @@ -357,6 +362,7 @@ const opCreateVault = "CreateVault" type CreateVaultRequest struct { *aws.Request Input *CreateVaultInput + Copy func(*CreateVaultInput) CreateVaultRequest } // Send marshals and sends the CreateVault API request. @@ -418,7 +424,7 @@ func (c *Glacier) CreateVaultRequest(input *CreateVaultInput) CreateVaultRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVaultRequest{Request: req, Input: input} + return CreateVaultRequest{Request: req, Input: input, Copy: c.CreateVaultRequest} } const opDeleteArchive = "DeleteArchive" @@ -427,6 +433,7 @@ const opDeleteArchive = "DeleteArchive" type DeleteArchiveRequest struct { *aws.Request Input *DeleteArchiveInput + Copy func(*DeleteArchiveInput) DeleteArchiveRequest } // Send marshals and sends the DeleteArchive API request. @@ -491,7 +498,7 @@ func (c *Glacier) DeleteArchiveRequest(input *DeleteArchiveInput) DeleteArchiveR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteArchiveRequest{Request: req, Input: input} + return DeleteArchiveRequest{Request: req, Input: input, Copy: c.DeleteArchiveRequest} } const opDeleteVault = "DeleteVault" @@ -500,6 +507,7 @@ const opDeleteVault = "DeleteVault" type DeleteVaultRequest struct { *aws.Request Input *DeleteVaultInput + Copy func(*DeleteVaultInput) DeleteVaultRequest } // Send marshals and sends the DeleteVault API request. @@ -562,7 +570,7 @@ func (c *Glacier) DeleteVaultRequest(input *DeleteVaultInput) DeleteVaultRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVaultRequest{Request: req, Input: input} + return DeleteVaultRequest{Request: req, Input: input, Copy: c.DeleteVaultRequest} } const opDeleteVaultAccessPolicy = "DeleteVaultAccessPolicy" @@ -571,6 +579,7 @@ const opDeleteVaultAccessPolicy = "DeleteVaultAccessPolicy" type DeleteVaultAccessPolicyRequest struct { *aws.Request Input *DeleteVaultAccessPolicyInput + Copy func(*DeleteVaultAccessPolicyInput) DeleteVaultAccessPolicyRequest } // Send marshals and sends the DeleteVaultAccessPolicy API request. @@ -620,7 +629,7 @@ func (c *Glacier) DeleteVaultAccessPolicyRequest(input *DeleteVaultAccessPolicyI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVaultAccessPolicyRequest{Request: req, Input: input} + return DeleteVaultAccessPolicyRequest{Request: req, Input: input, Copy: c.DeleteVaultAccessPolicyRequest} } const opDeleteVaultNotifications = "DeleteVaultNotifications" @@ -629,6 +638,7 @@ const opDeleteVaultNotifications = "DeleteVaultNotifications" type DeleteVaultNotificationsRequest struct { *aws.Request Input *DeleteVaultNotificationsInput + Copy func(*DeleteVaultNotificationsInput) DeleteVaultNotificationsRequest } // Send marshals and sends the DeleteVaultNotifications API request. @@ -683,7 +693,7 @@ func (c *Glacier) DeleteVaultNotificationsRequest(input *DeleteVaultNotification req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVaultNotificationsRequest{Request: req, Input: input} + return DeleteVaultNotificationsRequest{Request: req, Input: input, Copy: c.DeleteVaultNotificationsRequest} } const opDescribeJob = "DescribeJob" @@ -692,6 +702,7 @@ const opDescribeJob = "DescribeJob" type DescribeJobRequest struct { *aws.Request Input *DescribeJobInput + Copy func(*DescribeJobInput) DescribeJobRequest } // Send marshals and sends the DescribeJob API request. @@ -751,7 +762,7 @@ func (c *Glacier) DescribeJobRequest(input *DescribeJobInput) DescribeJobRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeJobRequest{Request: req, Input: input} + return DescribeJobRequest{Request: req, Input: input, Copy: c.DescribeJobRequest} } const opDescribeVault = "DescribeVault" @@ -760,6 +771,7 @@ const opDescribeVault = "DescribeVault" type DescribeVaultRequest struct { *aws.Request Input *DescribeVaultInput + Copy func(*DescribeVaultInput) DescribeVaultRequest } // Send marshals and sends the DescribeVault API request. @@ -817,7 +829,7 @@ func (c *Glacier) DescribeVaultRequest(input *DescribeVaultInput) DescribeVaultR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVaultRequest{Request: req, Input: input} + return DescribeVaultRequest{Request: req, Input: input, Copy: c.DescribeVaultRequest} } const opGetDataRetrievalPolicy = "GetDataRetrievalPolicy" @@ -826,6 +838,7 @@ const opGetDataRetrievalPolicy = "GetDataRetrievalPolicy" type GetDataRetrievalPolicyRequest struct { *aws.Request Input *GetDataRetrievalPolicyInput + Copy func(*GetDataRetrievalPolicyInput) GetDataRetrievalPolicyRequest } // Send marshals and sends the GetDataRetrievalPolicy API request. @@ -866,7 +879,7 @@ func (c *Glacier) GetDataRetrievalPolicyRequest(input *GetDataRetrievalPolicyInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDataRetrievalPolicyRequest{Request: req, Input: input} + return GetDataRetrievalPolicyRequest{Request: req, Input: input, Copy: c.GetDataRetrievalPolicyRequest} } const opGetJobOutput = "GetJobOutput" @@ -875,6 +888,7 @@ const opGetJobOutput = "GetJobOutput" type GetJobOutputRequest struct { *aws.Request Input *GetJobOutputInput + Copy func(*GetJobOutputInput) GetJobOutputRequest } // Send marshals and sends the GetJobOutput API request. @@ -956,7 +970,7 @@ func (c *Glacier) GetJobOutputRequest(input *GetJobOutputInput) GetJobOutputRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobOutputRequest{Request: req, Input: input} + return GetJobOutputRequest{Request: req, Input: input, Copy: c.GetJobOutputRequest} } const opGetVaultAccessPolicy = "GetVaultAccessPolicy" @@ -965,6 +979,7 @@ const opGetVaultAccessPolicy = "GetVaultAccessPolicy" type GetVaultAccessPolicyRequest struct { *aws.Request Input *GetVaultAccessPolicyInput + Copy func(*GetVaultAccessPolicyInput) GetVaultAccessPolicyRequest } // Send marshals and sends the GetVaultAccessPolicy API request. @@ -1008,7 +1023,7 @@ func (c *Glacier) GetVaultAccessPolicyRequest(input *GetVaultAccessPolicyInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetVaultAccessPolicyRequest{Request: req, Input: input} + return GetVaultAccessPolicyRequest{Request: req, Input: input, Copy: c.GetVaultAccessPolicyRequest} } const opGetVaultLock = "GetVaultLock" @@ -1017,6 +1032,7 @@ const opGetVaultLock = "GetVaultLock" type GetVaultLockRequest struct { *aws.Request Input *GetVaultLockInput + Copy func(*GetVaultLockInput) GetVaultLockRequest } // Send marshals and sends the GetVaultLock API request. @@ -1074,7 +1090,7 @@ func (c *Glacier) GetVaultLockRequest(input *GetVaultLockInput) GetVaultLockRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetVaultLockRequest{Request: req, Input: input} + return GetVaultLockRequest{Request: req, Input: input, Copy: c.GetVaultLockRequest} } const opGetVaultNotifications = "GetVaultNotifications" @@ -1083,6 +1099,7 @@ const opGetVaultNotifications = "GetVaultNotifications" type GetVaultNotificationsRequest struct { *aws.Request Input *GetVaultNotificationsInput + Copy func(*GetVaultNotificationsInput) GetVaultNotificationsRequest } // Send marshals and sends the GetVaultNotifications API request. @@ -1139,7 +1156,7 @@ func (c *Glacier) GetVaultNotificationsRequest(input *GetVaultNotificationsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetVaultNotificationsRequest{Request: req, Input: input} + return GetVaultNotificationsRequest{Request: req, Input: input, Copy: c.GetVaultNotificationsRequest} } const opInitiateJob = "InitiateJob" @@ -1148,6 +1165,7 @@ const opInitiateJob = "InitiateJob" type InitiateJobRequest struct { *aws.Request Input *InitiateJobInput + Copy func(*InitiateJobInput) InitiateJobRequest } // Send marshals and sends the InitiateJob API request. @@ -1189,7 +1207,7 @@ func (c *Glacier) InitiateJobRequest(input *InitiateJobInput) InitiateJobRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InitiateJobRequest{Request: req, Input: input} + return InitiateJobRequest{Request: req, Input: input, Copy: c.InitiateJobRequest} } const opInitiateMultipartUpload = "InitiateMultipartUpload" @@ -1198,6 +1216,7 @@ const opInitiateMultipartUpload = "InitiateMultipartUpload" type InitiateMultipartUploadRequest struct { *aws.Request Input *InitiateMultipartUploadInput + Copy func(*InitiateMultipartUploadInput) InitiateMultipartUploadRequest } // Send marshals and sends the InitiateMultipartUpload API request. @@ -1270,7 +1289,7 @@ func (c *Glacier) InitiateMultipartUploadRequest(input *InitiateMultipartUploadI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InitiateMultipartUploadRequest{Request: req, Input: input} + return InitiateMultipartUploadRequest{Request: req, Input: input, Copy: c.InitiateMultipartUploadRequest} } const opInitiateVaultLock = "InitiateVaultLock" @@ -1279,6 +1298,7 @@ const opInitiateVaultLock = "InitiateVaultLock" type InitiateVaultLockRequest struct { *aws.Request Input *InitiateVaultLockInput + Copy func(*InitiateVaultLockInput) InitiateVaultLockRequest } // Send marshals and sends the InitiateVaultLock API request. @@ -1345,7 +1365,7 @@ func (c *Glacier) InitiateVaultLockRequest(input *InitiateVaultLockInput) Initia req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InitiateVaultLockRequest{Request: req, Input: input} + return InitiateVaultLockRequest{Request: req, Input: input, Copy: c.InitiateVaultLockRequest} } const opListJobs = "ListJobs" @@ -1354,6 +1374,7 @@ const opListJobs = "ListJobs" type ListJobsRequest struct { *aws.Request Input *ListJobsInput + Copy func(*ListJobsInput) ListJobsRequest } // Send marshals and sends the ListJobs API request. @@ -1433,57 +1454,53 @@ func (c *Glacier) ListJobsRequest(input *ListJobsInput) ListJobsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobsRequest{Request: req, Input: input} + return ListJobsRequest{Request: req, Input: input, Copy: c.ListJobsRequest} } -// ListJobsPages iterates over the pages of a ListJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListJobs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListJobsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListJobs operation. -// pageNum := 0 -// err := client.ListJobsPages(params, -// func(page *ListJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glacier) ListJobsPages(input *ListJobsInput, fn func(*ListJobsOutput, bool) bool) error { - return c.ListJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListJobsPagesWithContext same as ListJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glacier) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsInput, fn func(*ListJobsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListJobsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListJobsRequest) Paginate(opts ...aws.Option) ListJobsPager { + return ListJobsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListJobsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) - } - return p.Err() +// ListJobsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListJobsPager struct { + aws.Pager +} + +func (p *ListJobsPager) CurrentPage() *ListJobsOutput { + return p.Pager.CurrentPage().(*ListJobsOutput) } const opListMultipartUploads = "ListMultipartUploads" @@ -1492,6 +1509,7 @@ const opListMultipartUploads = "ListMultipartUploads" type ListMultipartUploadsRequest struct { *aws.Request Input *ListMultipartUploadsInput + Copy func(*ListMultipartUploadsInput) ListMultipartUploadsRequest } // Send marshals and sends the ListMultipartUploads API request. @@ -1565,57 +1583,53 @@ func (c *Glacier) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListMultipartUploadsRequest{Request: req, Input: input} + return ListMultipartUploadsRequest{Request: req, Input: input, Copy: c.ListMultipartUploadsRequest} } -// ListMultipartUploadsPages iterates over the pages of a ListMultipartUploads operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMultipartUploads method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListMultipartUploadsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListMultipartUploads operation. -// pageNum := 0 -// err := client.ListMultipartUploadsPages(params, -// func(page *ListMultipartUploadsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glacier) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool) error { - return c.ListMultipartUploadsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMultipartUploadsPagesWithContext same as ListMultipartUploadsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glacier) ListMultipartUploadsPagesWithContext(ctx aws.Context, input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListMultipartUploadsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListMultipartUploadsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListMultipartUploadsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListMultipartUploadsRequest) Paginate(opts ...aws.Option) ListMultipartUploadsPager { + return ListMultipartUploadsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListMultipartUploadsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) - } - return p.Err() +// ListMultipartUploadsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListMultipartUploadsPager struct { + aws.Pager +} + +func (p *ListMultipartUploadsPager) CurrentPage() *ListMultipartUploadsOutput { + return p.Pager.CurrentPage().(*ListMultipartUploadsOutput) } const opListParts = "ListParts" @@ -1624,6 +1638,7 @@ const opListParts = "ListParts" type ListPartsRequest struct { *aws.Request Input *ListPartsInput + Copy func(*ListPartsInput) ListPartsRequest } // Send marshals and sends the ListParts API request. @@ -1691,57 +1706,53 @@ func (c *Glacier) ListPartsRequest(input *ListPartsInput) ListPartsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPartsRequest{Request: req, Input: input} + return ListPartsRequest{Request: req, Input: input, Copy: c.ListPartsRequest} } -// ListPartsPages iterates over the pages of a ListParts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListParts method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPartsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListParts operation. -// pageNum := 0 -// err := client.ListPartsPages(params, -// func(page *ListPartsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glacier) ListPartsPages(input *ListPartsInput, fn func(*ListPartsOutput, bool) bool) error { - return c.ListPartsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPartsPagesWithContext same as ListPartsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glacier) ListPartsPagesWithContext(ctx aws.Context, input *ListPartsInput, fn func(*ListPartsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPartsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPartsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPartsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPartsRequest) Paginate(opts ...aws.Option) ListPartsPager { + return ListPartsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPartsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) - } - return p.Err() +// ListPartsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPartsPager struct { + aws.Pager +} + +func (p *ListPartsPager) CurrentPage() *ListPartsOutput { + return p.Pager.CurrentPage().(*ListPartsOutput) } const opListProvisionedCapacity = "ListProvisionedCapacity" @@ -1750,6 +1761,7 @@ const opListProvisionedCapacity = "ListProvisionedCapacity" type ListProvisionedCapacityRequest struct { *aws.Request Input *ListProvisionedCapacityInput + Copy func(*ListProvisionedCapacityInput) ListProvisionedCapacityRequest } // Send marshals and sends the ListProvisionedCapacity API request. @@ -1789,7 +1801,7 @@ func (c *Glacier) ListProvisionedCapacityRequest(input *ListProvisionedCapacityI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListProvisionedCapacityRequest{Request: req, Input: input} + return ListProvisionedCapacityRequest{Request: req, Input: input, Copy: c.ListProvisionedCapacityRequest} } const opListTagsForVault = "ListTagsForVault" @@ -1798,6 +1810,7 @@ const opListTagsForVault = "ListTagsForVault" type ListTagsForVaultRequest struct { *aws.Request Input *ListTagsForVaultInput + Copy func(*ListTagsForVaultInput) ListTagsForVaultRequest } // Send marshals and sends the ListTagsForVault API request. @@ -1838,7 +1851,7 @@ func (c *Glacier) ListTagsForVaultRequest(input *ListTagsForVaultInput) ListTags req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForVaultRequest{Request: req, Input: input} + return ListTagsForVaultRequest{Request: req, Input: input, Copy: c.ListTagsForVaultRequest} } const opListVaults = "ListVaults" @@ -1847,6 +1860,7 @@ const opListVaults = "ListVaults" type ListVaultsRequest struct { *aws.Request Input *ListVaultsInput + Copy func(*ListVaultsInput) ListVaultsRequest } // Send marshals and sends the ListVaults API request. @@ -1911,57 +1925,53 @@ func (c *Glacier) ListVaultsRequest(input *ListVaultsInput) ListVaultsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListVaultsRequest{Request: req, Input: input} + return ListVaultsRequest{Request: req, Input: input, Copy: c.ListVaultsRequest} } -// ListVaultsPages iterates over the pages of a ListVaults operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVaults method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListVaultsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListVaults operation. -// pageNum := 0 -// err := client.ListVaultsPages(params, -// func(page *ListVaultsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glacier) ListVaultsPages(input *ListVaultsInput, fn func(*ListVaultsOutput, bool) bool) error { - return c.ListVaultsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVaultsPagesWithContext same as ListVaultsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glacier) ListVaultsPagesWithContext(ctx aws.Context, input *ListVaultsInput, fn func(*ListVaultsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListVaultsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListVaultsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListVaultsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListVaultsRequest) Paginate(opts ...aws.Option) ListVaultsPager { + return ListVaultsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListVaultsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVaultsOutput), !p.HasNextPage()) - } - return p.Err() +// ListVaultsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListVaultsPager struct { + aws.Pager +} + +func (p *ListVaultsPager) CurrentPage() *ListVaultsOutput { + return p.Pager.CurrentPage().(*ListVaultsOutput) } const opPurchaseProvisionedCapacity = "PurchaseProvisionedCapacity" @@ -1970,6 +1980,7 @@ const opPurchaseProvisionedCapacity = "PurchaseProvisionedCapacity" type PurchaseProvisionedCapacityRequest struct { *aws.Request Input *PurchaseProvisionedCapacityInput + Copy func(*PurchaseProvisionedCapacityInput) PurchaseProvisionedCapacityRequest } // Send marshals and sends the PurchaseProvisionedCapacity API request. @@ -2008,7 +2019,7 @@ func (c *Glacier) PurchaseProvisionedCapacityRequest(input *PurchaseProvisionedC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PurchaseProvisionedCapacityRequest{Request: req, Input: input} + return PurchaseProvisionedCapacityRequest{Request: req, Input: input, Copy: c.PurchaseProvisionedCapacityRequest} } const opRemoveTagsFromVault = "RemoveTagsFromVault" @@ -2017,6 +2028,7 @@ const opRemoveTagsFromVault = "RemoveTagsFromVault" type RemoveTagsFromVaultRequest struct { *aws.Request Input *RemoveTagsFromVaultInput + Copy func(*RemoveTagsFromVaultInput) RemoveTagsFromVaultRequest } // Send marshals and sends the RemoveTagsFromVault API request. @@ -2061,7 +2073,7 @@ func (c *Glacier) RemoveTagsFromVaultRequest(input *RemoveTagsFromVaultInput) Re req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromVaultRequest{Request: req, Input: input} + return RemoveTagsFromVaultRequest{Request: req, Input: input, Copy: c.RemoveTagsFromVaultRequest} } const opSetDataRetrievalPolicy = "SetDataRetrievalPolicy" @@ -2070,6 +2082,7 @@ const opSetDataRetrievalPolicy = "SetDataRetrievalPolicy" type SetDataRetrievalPolicyRequest struct { *aws.Request Input *SetDataRetrievalPolicyInput + Copy func(*SetDataRetrievalPolicyInput) SetDataRetrievalPolicyRequest } // Send marshals and sends the SetDataRetrievalPolicy API request. @@ -2116,7 +2129,7 @@ func (c *Glacier) SetDataRetrievalPolicyRequest(input *SetDataRetrievalPolicyInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetDataRetrievalPolicyRequest{Request: req, Input: input} + return SetDataRetrievalPolicyRequest{Request: req, Input: input, Copy: c.SetDataRetrievalPolicyRequest} } const opSetVaultAccessPolicy = "SetVaultAccessPolicy" @@ -2125,6 +2138,7 @@ const opSetVaultAccessPolicy = "SetVaultAccessPolicy" type SetVaultAccessPolicyRequest struct { *aws.Request Input *SetVaultAccessPolicyInput + Copy func(*SetVaultAccessPolicyInput) SetVaultAccessPolicyRequest } // Send marshals and sends the SetVaultAccessPolicy API request. @@ -2171,7 +2185,7 @@ func (c *Glacier) SetVaultAccessPolicyRequest(input *SetVaultAccessPolicyInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetVaultAccessPolicyRequest{Request: req, Input: input} + return SetVaultAccessPolicyRequest{Request: req, Input: input, Copy: c.SetVaultAccessPolicyRequest} } const opSetVaultNotifications = "SetVaultNotifications" @@ -2180,6 +2194,7 @@ const opSetVaultNotifications = "SetVaultNotifications" type SetVaultNotificationsRequest struct { *aws.Request Input *SetVaultNotificationsInput + Copy func(*SetVaultNotificationsInput) SetVaultNotificationsRequest } // Send marshals and sends the SetVaultNotifications API request. @@ -2251,7 +2266,7 @@ func (c *Glacier) SetVaultNotificationsRequest(input *SetVaultNotificationsInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetVaultNotificationsRequest{Request: req, Input: input} + return SetVaultNotificationsRequest{Request: req, Input: input, Copy: c.SetVaultNotificationsRequest} } const opUploadArchive = "UploadArchive" @@ -2260,6 +2275,7 @@ const opUploadArchive = "UploadArchive" type UploadArchiveRequest struct { *aws.Request Input *UploadArchiveInput + Copy func(*UploadArchiveInput) UploadArchiveRequest } // Send marshals and sends the UploadArchive API request. @@ -2333,7 +2349,7 @@ func (c *Glacier) UploadArchiveRequest(input *UploadArchiveInput) UploadArchiveR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UploadArchiveRequest{Request: req, Input: input} + return UploadArchiveRequest{Request: req, Input: input, Copy: c.UploadArchiveRequest} } const opUploadMultipartPart = "UploadMultipartPart" @@ -2342,6 +2358,7 @@ const opUploadMultipartPart = "UploadMultipartPart" type UploadMultipartPartRequest struct { *aws.Request Input *UploadMultipartPartInput + Copy func(*UploadMultipartPartInput) UploadMultipartPartRequest } // Send marshals and sends the UploadMultipartPart API request. @@ -2425,7 +2442,7 @@ func (c *Glacier) UploadMultipartPartRequest(input *UploadMultipartPartInput) Up req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UploadMultipartPartRequest{Request: req, Input: input} + return UploadMultipartPartRequest{Request: req, Input: input, Copy: c.UploadMultipartPartRequest} } // Provides options to abort a multipart upload identified by the upload ID. diff --git a/service/glacier/glacieriface/interface.go b/service/glacier/glacieriface/interface.go index e6b7a74a8d1..8da62f5f7de 100644 --- a/service/glacier/glacieriface/interface.go +++ b/service/glacier/glacieriface/interface.go @@ -105,28 +105,16 @@ type GlacierAPI interface { ListJobsRequest(*glacier.ListJobsInput) glacier.ListJobsRequest - ListJobsPages(*glacier.ListJobsInput, func(*glacier.ListJobsOutput, bool) bool) error - ListJobsPagesWithContext(aws.Context, *glacier.ListJobsInput, func(*glacier.ListJobsOutput, bool) bool, ...aws.Option) error - ListMultipartUploadsRequest(*glacier.ListMultipartUploadsInput) glacier.ListMultipartUploadsRequest - ListMultipartUploadsPages(*glacier.ListMultipartUploadsInput, func(*glacier.ListMultipartUploadsOutput, bool) bool) error - ListMultipartUploadsPagesWithContext(aws.Context, *glacier.ListMultipartUploadsInput, func(*glacier.ListMultipartUploadsOutput, bool) bool, ...aws.Option) error - ListPartsRequest(*glacier.ListPartsInput) glacier.ListPartsRequest - ListPartsPages(*glacier.ListPartsInput, func(*glacier.ListPartsOutput, bool) bool) error - ListPartsPagesWithContext(aws.Context, *glacier.ListPartsInput, func(*glacier.ListPartsOutput, bool) bool, ...aws.Option) error - ListProvisionedCapacityRequest(*glacier.ListProvisionedCapacityInput) glacier.ListProvisionedCapacityRequest ListTagsForVaultRequest(*glacier.ListTagsForVaultInput) glacier.ListTagsForVaultRequest ListVaultsRequest(*glacier.ListVaultsInput) glacier.ListVaultsRequest - ListVaultsPages(*glacier.ListVaultsInput, func(*glacier.ListVaultsOutput, bool) bool) error - ListVaultsPagesWithContext(aws.Context, *glacier.ListVaultsInput, func(*glacier.ListVaultsOutput, bool) bool, ...aws.Option) error - PurchaseProvisionedCapacityRequest(*glacier.PurchaseProvisionedCapacityInput) glacier.PurchaseProvisionedCapacityRequest RemoveTagsFromVaultRequest(*glacier.RemoveTagsFromVaultInput) glacier.RemoveTagsFromVaultRequest diff --git a/service/glue/api.go b/service/glue/api.go index 0e1573b3e78..c723393c4d3 100644 --- a/service/glue/api.go +++ b/service/glue/api.go @@ -16,6 +16,7 @@ const opBatchCreatePartition = "BatchCreatePartition" type BatchCreatePartitionRequest struct { *aws.Request Input *BatchCreatePartitionInput + Copy func(*BatchCreatePartitionInput) BatchCreatePartitionRequest } // Send marshals and sends the BatchCreatePartition API request. @@ -56,7 +57,7 @@ func (c *Glue) BatchCreatePartitionRequest(input *BatchCreatePartitionInput) Bat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchCreatePartitionRequest{Request: req, Input: input} + return BatchCreatePartitionRequest{Request: req, Input: input, Copy: c.BatchCreatePartitionRequest} } const opBatchDeleteConnection = "BatchDeleteConnection" @@ -65,6 +66,7 @@ const opBatchDeleteConnection = "BatchDeleteConnection" type BatchDeleteConnectionRequest struct { *aws.Request Input *BatchDeleteConnectionInput + Copy func(*BatchDeleteConnectionInput) BatchDeleteConnectionRequest } // Send marshals and sends the BatchDeleteConnection API request. @@ -105,7 +107,7 @@ func (c *Glue) BatchDeleteConnectionRequest(input *BatchDeleteConnectionInput) B req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchDeleteConnectionRequest{Request: req, Input: input} + return BatchDeleteConnectionRequest{Request: req, Input: input, Copy: c.BatchDeleteConnectionRequest} } const opBatchDeletePartition = "BatchDeletePartition" @@ -114,6 +116,7 @@ const opBatchDeletePartition = "BatchDeletePartition" type BatchDeletePartitionRequest struct { *aws.Request Input *BatchDeletePartitionInput + Copy func(*BatchDeletePartitionInput) BatchDeletePartitionRequest } // Send marshals and sends the BatchDeletePartition API request. @@ -154,7 +157,7 @@ func (c *Glue) BatchDeletePartitionRequest(input *BatchDeletePartitionInput) Bat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchDeletePartitionRequest{Request: req, Input: input} + return BatchDeletePartitionRequest{Request: req, Input: input, Copy: c.BatchDeletePartitionRequest} } const opBatchDeleteTable = "BatchDeleteTable" @@ -163,6 +166,7 @@ const opBatchDeleteTable = "BatchDeleteTable" type BatchDeleteTableRequest struct { *aws.Request Input *BatchDeleteTableInput + Copy func(*BatchDeleteTableInput) BatchDeleteTableRequest } // Send marshals and sends the BatchDeleteTable API request. @@ -203,7 +207,7 @@ func (c *Glue) BatchDeleteTableRequest(input *BatchDeleteTableInput) BatchDelete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchDeleteTableRequest{Request: req, Input: input} + return BatchDeleteTableRequest{Request: req, Input: input, Copy: c.BatchDeleteTableRequest} } const opBatchGetPartition = "BatchGetPartition" @@ -212,6 +216,7 @@ const opBatchGetPartition = "BatchGetPartition" type BatchGetPartitionRequest struct { *aws.Request Input *BatchGetPartitionInput + Copy func(*BatchGetPartitionInput) BatchGetPartitionRequest } // Send marshals and sends the BatchGetPartition API request. @@ -252,7 +257,7 @@ func (c *Glue) BatchGetPartitionRequest(input *BatchGetPartitionInput) BatchGetP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetPartitionRequest{Request: req, Input: input} + return BatchGetPartitionRequest{Request: req, Input: input, Copy: c.BatchGetPartitionRequest} } const opBatchStopJobRun = "BatchStopJobRun" @@ -261,6 +266,7 @@ const opBatchStopJobRun = "BatchStopJobRun" type BatchStopJobRunRequest struct { *aws.Request Input *BatchStopJobRunInput + Copy func(*BatchStopJobRunInput) BatchStopJobRunRequest } // Send marshals and sends the BatchStopJobRun API request. @@ -301,7 +307,7 @@ func (c *Glue) BatchStopJobRunRequest(input *BatchStopJobRunInput) BatchStopJobR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchStopJobRunRequest{Request: req, Input: input} + return BatchStopJobRunRequest{Request: req, Input: input, Copy: c.BatchStopJobRunRequest} } const opCreateClassifier = "CreateClassifier" @@ -310,6 +316,7 @@ const opCreateClassifier = "CreateClassifier" type CreateClassifierRequest struct { *aws.Request Input *CreateClassifierInput + Copy func(*CreateClassifierInput) CreateClassifierRequest } // Send marshals and sends the CreateClassifier API request. @@ -351,7 +358,7 @@ func (c *Glue) CreateClassifierRequest(input *CreateClassifierInput) CreateClass req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClassifierRequest{Request: req, Input: input} + return CreateClassifierRequest{Request: req, Input: input, Copy: c.CreateClassifierRequest} } const opCreateConnection = "CreateConnection" @@ -360,6 +367,7 @@ const opCreateConnection = "CreateConnection" type CreateConnectionRequest struct { *aws.Request Input *CreateConnectionInput + Copy func(*CreateConnectionInput) CreateConnectionRequest } // Send marshals and sends the CreateConnection API request. @@ -400,7 +408,7 @@ func (c *Glue) CreateConnectionRequest(input *CreateConnectionInput) CreateConne req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateConnectionRequest{Request: req, Input: input} + return CreateConnectionRequest{Request: req, Input: input, Copy: c.CreateConnectionRequest} } const opCreateCrawler = "CreateCrawler" @@ -409,6 +417,7 @@ const opCreateCrawler = "CreateCrawler" type CreateCrawlerRequest struct { *aws.Request Input *CreateCrawlerInput + Copy func(*CreateCrawlerInput) CreateCrawlerRequest } // Send marshals and sends the CreateCrawler API request. @@ -451,7 +460,7 @@ func (c *Glue) CreateCrawlerRequest(input *CreateCrawlerInput) CreateCrawlerRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCrawlerRequest{Request: req, Input: input} + return CreateCrawlerRequest{Request: req, Input: input, Copy: c.CreateCrawlerRequest} } const opCreateDatabase = "CreateDatabase" @@ -460,6 +469,7 @@ const opCreateDatabase = "CreateDatabase" type CreateDatabaseRequest struct { *aws.Request Input *CreateDatabaseInput + Copy func(*CreateDatabaseInput) CreateDatabaseRequest } // Send marshals and sends the CreateDatabase API request. @@ -500,7 +510,7 @@ func (c *Glue) CreateDatabaseRequest(input *CreateDatabaseInput) CreateDatabaseR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDatabaseRequest{Request: req, Input: input} + return CreateDatabaseRequest{Request: req, Input: input, Copy: c.CreateDatabaseRequest} } const opCreateDevEndpoint = "CreateDevEndpoint" @@ -509,6 +519,7 @@ const opCreateDevEndpoint = "CreateDevEndpoint" type CreateDevEndpointRequest struct { *aws.Request Input *CreateDevEndpointInput + Copy func(*CreateDevEndpointInput) CreateDevEndpointRequest } // Send marshals and sends the CreateDevEndpoint API request. @@ -549,7 +560,7 @@ func (c *Glue) CreateDevEndpointRequest(input *CreateDevEndpointInput) CreateDev req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDevEndpointRequest{Request: req, Input: input} + return CreateDevEndpointRequest{Request: req, Input: input, Copy: c.CreateDevEndpointRequest} } const opCreateJob = "CreateJob" @@ -558,6 +569,7 @@ const opCreateJob = "CreateJob" type CreateJobRequest struct { *aws.Request Input *CreateJobInput + Copy func(*CreateJobInput) CreateJobRequest } // Send marshals and sends the CreateJob API request. @@ -598,7 +610,7 @@ func (c *Glue) CreateJobRequest(input *CreateJobInput) CreateJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateJobRequest{Request: req, Input: input} + return CreateJobRequest{Request: req, Input: input, Copy: c.CreateJobRequest} } const opCreatePartition = "CreatePartition" @@ -607,6 +619,7 @@ const opCreatePartition = "CreatePartition" type CreatePartitionRequest struct { *aws.Request Input *CreatePartitionInput + Copy func(*CreatePartitionInput) CreatePartitionRequest } // Send marshals and sends the CreatePartition API request. @@ -647,7 +660,7 @@ func (c *Glue) CreatePartitionRequest(input *CreatePartitionInput) CreatePartiti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePartitionRequest{Request: req, Input: input} + return CreatePartitionRequest{Request: req, Input: input, Copy: c.CreatePartitionRequest} } const opCreateScript = "CreateScript" @@ -656,6 +669,7 @@ const opCreateScript = "CreateScript" type CreateScriptRequest struct { *aws.Request Input *CreateScriptInput + Copy func(*CreateScriptInput) CreateScriptRequest } // Send marshals and sends the CreateScript API request. @@ -696,7 +710,7 @@ func (c *Glue) CreateScriptRequest(input *CreateScriptInput) CreateScriptRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateScriptRequest{Request: req, Input: input} + return CreateScriptRequest{Request: req, Input: input, Copy: c.CreateScriptRequest} } const opCreateTable = "CreateTable" @@ -705,6 +719,7 @@ const opCreateTable = "CreateTable" type CreateTableRequest struct { *aws.Request Input *CreateTableInput + Copy func(*CreateTableInput) CreateTableRequest } // Send marshals and sends the CreateTable API request. @@ -745,7 +760,7 @@ func (c *Glue) CreateTableRequest(input *CreateTableInput) CreateTableRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTableRequest{Request: req, Input: input} + return CreateTableRequest{Request: req, Input: input, Copy: c.CreateTableRequest} } const opCreateTrigger = "CreateTrigger" @@ -754,6 +769,7 @@ const opCreateTrigger = "CreateTrigger" type CreateTriggerRequest struct { *aws.Request Input *CreateTriggerInput + Copy func(*CreateTriggerInput) CreateTriggerRequest } // Send marshals and sends the CreateTrigger API request. @@ -794,7 +810,7 @@ func (c *Glue) CreateTriggerRequest(input *CreateTriggerInput) CreateTriggerRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTriggerRequest{Request: req, Input: input} + return CreateTriggerRequest{Request: req, Input: input, Copy: c.CreateTriggerRequest} } const opCreateUserDefinedFunction = "CreateUserDefinedFunction" @@ -803,6 +819,7 @@ const opCreateUserDefinedFunction = "CreateUserDefinedFunction" type CreateUserDefinedFunctionRequest struct { *aws.Request Input *CreateUserDefinedFunctionInput + Copy func(*CreateUserDefinedFunctionInput) CreateUserDefinedFunctionRequest } // Send marshals and sends the CreateUserDefinedFunction API request. @@ -843,7 +860,7 @@ func (c *Glue) CreateUserDefinedFunctionRequest(input *CreateUserDefinedFunction req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserDefinedFunctionRequest{Request: req, Input: input} + return CreateUserDefinedFunctionRequest{Request: req, Input: input, Copy: c.CreateUserDefinedFunctionRequest} } const opDeleteClassifier = "DeleteClassifier" @@ -852,6 +869,7 @@ const opDeleteClassifier = "DeleteClassifier" type DeleteClassifierRequest struct { *aws.Request Input *DeleteClassifierInput + Copy func(*DeleteClassifierInput) DeleteClassifierRequest } // Send marshals and sends the DeleteClassifier API request. @@ -892,7 +910,7 @@ func (c *Glue) DeleteClassifierRequest(input *DeleteClassifierInput) DeleteClass req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteClassifierRequest{Request: req, Input: input} + return DeleteClassifierRequest{Request: req, Input: input, Copy: c.DeleteClassifierRequest} } const opDeleteConnection = "DeleteConnection" @@ -901,6 +919,7 @@ const opDeleteConnection = "DeleteConnection" type DeleteConnectionRequest struct { *aws.Request Input *DeleteConnectionInput + Copy func(*DeleteConnectionInput) DeleteConnectionRequest } // Send marshals and sends the DeleteConnection API request. @@ -941,7 +960,7 @@ func (c *Glue) DeleteConnectionRequest(input *DeleteConnectionInput) DeleteConne req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteConnectionRequest{Request: req, Input: input} + return DeleteConnectionRequest{Request: req, Input: input, Copy: c.DeleteConnectionRequest} } const opDeleteCrawler = "DeleteCrawler" @@ -950,6 +969,7 @@ const opDeleteCrawler = "DeleteCrawler" type DeleteCrawlerRequest struct { *aws.Request Input *DeleteCrawlerInput + Copy func(*DeleteCrawlerInput) DeleteCrawlerRequest } // Send marshals and sends the DeleteCrawler API request. @@ -991,7 +1011,7 @@ func (c *Glue) DeleteCrawlerRequest(input *DeleteCrawlerInput) DeleteCrawlerRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteCrawlerRequest{Request: req, Input: input} + return DeleteCrawlerRequest{Request: req, Input: input, Copy: c.DeleteCrawlerRequest} } const opDeleteDatabase = "DeleteDatabase" @@ -1000,6 +1020,7 @@ const opDeleteDatabase = "DeleteDatabase" type DeleteDatabaseRequest struct { *aws.Request Input *DeleteDatabaseInput + Copy func(*DeleteDatabaseInput) DeleteDatabaseRequest } // Send marshals and sends the DeleteDatabase API request. @@ -1040,7 +1061,7 @@ func (c *Glue) DeleteDatabaseRequest(input *DeleteDatabaseInput) DeleteDatabaseR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDatabaseRequest{Request: req, Input: input} + return DeleteDatabaseRequest{Request: req, Input: input, Copy: c.DeleteDatabaseRequest} } const opDeleteDevEndpoint = "DeleteDevEndpoint" @@ -1049,6 +1070,7 @@ const opDeleteDevEndpoint = "DeleteDevEndpoint" type DeleteDevEndpointRequest struct { *aws.Request Input *DeleteDevEndpointInput + Copy func(*DeleteDevEndpointInput) DeleteDevEndpointRequest } // Send marshals and sends the DeleteDevEndpoint API request. @@ -1089,7 +1111,7 @@ func (c *Glue) DeleteDevEndpointRequest(input *DeleteDevEndpointInput) DeleteDev req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDevEndpointRequest{Request: req, Input: input} + return DeleteDevEndpointRequest{Request: req, Input: input, Copy: c.DeleteDevEndpointRequest} } const opDeleteJob = "DeleteJob" @@ -1098,6 +1120,7 @@ const opDeleteJob = "DeleteJob" type DeleteJobRequest struct { *aws.Request Input *DeleteJobInput + Copy func(*DeleteJobInput) DeleteJobRequest } // Send marshals and sends the DeleteJob API request. @@ -1138,7 +1161,7 @@ func (c *Glue) DeleteJobRequest(input *DeleteJobInput) DeleteJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteJobRequest{Request: req, Input: input} + return DeleteJobRequest{Request: req, Input: input, Copy: c.DeleteJobRequest} } const opDeletePartition = "DeletePartition" @@ -1147,6 +1170,7 @@ const opDeletePartition = "DeletePartition" type DeletePartitionRequest struct { *aws.Request Input *DeletePartitionInput + Copy func(*DeletePartitionInput) DeletePartitionRequest } // Send marshals and sends the DeletePartition API request. @@ -1187,7 +1211,7 @@ func (c *Glue) DeletePartitionRequest(input *DeletePartitionInput) DeletePartiti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeletePartitionRequest{Request: req, Input: input} + return DeletePartitionRequest{Request: req, Input: input, Copy: c.DeletePartitionRequest} } const opDeleteTable = "DeleteTable" @@ -1196,6 +1220,7 @@ const opDeleteTable = "DeleteTable" type DeleteTableRequest struct { *aws.Request Input *DeleteTableInput + Copy func(*DeleteTableInput) DeleteTableRequest } // Send marshals and sends the DeleteTable API request. @@ -1236,7 +1261,7 @@ func (c *Glue) DeleteTableRequest(input *DeleteTableInput) DeleteTableRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTableRequest{Request: req, Input: input} + return DeleteTableRequest{Request: req, Input: input, Copy: c.DeleteTableRequest} } const opDeleteTrigger = "DeleteTrigger" @@ -1245,6 +1270,7 @@ const opDeleteTrigger = "DeleteTrigger" type DeleteTriggerRequest struct { *aws.Request Input *DeleteTriggerInput + Copy func(*DeleteTriggerInput) DeleteTriggerRequest } // Send marshals and sends the DeleteTrigger API request. @@ -1286,7 +1312,7 @@ func (c *Glue) DeleteTriggerRequest(input *DeleteTriggerInput) DeleteTriggerRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTriggerRequest{Request: req, Input: input} + return DeleteTriggerRequest{Request: req, Input: input, Copy: c.DeleteTriggerRequest} } const opDeleteUserDefinedFunction = "DeleteUserDefinedFunction" @@ -1295,6 +1321,7 @@ const opDeleteUserDefinedFunction = "DeleteUserDefinedFunction" type DeleteUserDefinedFunctionRequest struct { *aws.Request Input *DeleteUserDefinedFunctionInput + Copy func(*DeleteUserDefinedFunctionInput) DeleteUserDefinedFunctionRequest } // Send marshals and sends the DeleteUserDefinedFunction API request. @@ -1335,7 +1362,7 @@ func (c *Glue) DeleteUserDefinedFunctionRequest(input *DeleteUserDefinedFunction req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteUserDefinedFunctionRequest{Request: req, Input: input} + return DeleteUserDefinedFunctionRequest{Request: req, Input: input, Copy: c.DeleteUserDefinedFunctionRequest} } const opGetCatalogImportStatus = "GetCatalogImportStatus" @@ -1344,6 +1371,7 @@ const opGetCatalogImportStatus = "GetCatalogImportStatus" type GetCatalogImportStatusRequest struct { *aws.Request Input *GetCatalogImportStatusInput + Copy func(*GetCatalogImportStatusInput) GetCatalogImportStatusRequest } // Send marshals and sends the GetCatalogImportStatus API request. @@ -1384,7 +1412,7 @@ func (c *Glue) GetCatalogImportStatusRequest(input *GetCatalogImportStatusInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCatalogImportStatusRequest{Request: req, Input: input} + return GetCatalogImportStatusRequest{Request: req, Input: input, Copy: c.GetCatalogImportStatusRequest} } const opGetClassifier = "GetClassifier" @@ -1393,6 +1421,7 @@ const opGetClassifier = "GetClassifier" type GetClassifierRequest struct { *aws.Request Input *GetClassifierInput + Copy func(*GetClassifierInput) GetClassifierRequest } // Send marshals and sends the GetClassifier API request. @@ -1433,7 +1462,7 @@ func (c *Glue) GetClassifierRequest(input *GetClassifierInput) GetClassifierRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetClassifierRequest{Request: req, Input: input} + return GetClassifierRequest{Request: req, Input: input, Copy: c.GetClassifierRequest} } const opGetClassifiers = "GetClassifiers" @@ -1442,6 +1471,7 @@ const opGetClassifiers = "GetClassifiers" type GetClassifiersRequest struct { *aws.Request Input *GetClassifiersInput + Copy func(*GetClassifiersInput) GetClassifiersRequest } // Send marshals and sends the GetClassifiers API request. @@ -1488,57 +1518,53 @@ func (c *Glue) GetClassifiersRequest(input *GetClassifiersInput) GetClassifiersR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetClassifiersRequest{Request: req, Input: input} + return GetClassifiersRequest{Request: req, Input: input, Copy: c.GetClassifiersRequest} } -// GetClassifiersPages iterates over the pages of a GetClassifiers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetClassifiers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetClassifiersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetClassifiers operation. -// pageNum := 0 -// err := client.GetClassifiersPages(params, -// func(page *GetClassifiersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetClassifiersPages(input *GetClassifiersInput, fn func(*GetClassifiersOutput, bool) bool) error { - return c.GetClassifiersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetClassifiersPagesWithContext same as GetClassifiersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetClassifiersPagesWithContext(ctx aws.Context, input *GetClassifiersInput, fn func(*GetClassifiersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetClassifiersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetClassifiersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetClassifiersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetClassifiersRequest) Paginate(opts ...aws.Option) GetClassifiersPager { + return GetClassifiersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetClassifiersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetClassifiersOutput), !p.HasNextPage()) - } - return p.Err() +// GetClassifiersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetClassifiersPager struct { + aws.Pager +} + +func (p *GetClassifiersPager) CurrentPage() *GetClassifiersOutput { + return p.Pager.CurrentPage().(*GetClassifiersOutput) } const opGetConnection = "GetConnection" @@ -1547,6 +1573,7 @@ const opGetConnection = "GetConnection" type GetConnectionRequest struct { *aws.Request Input *GetConnectionInput + Copy func(*GetConnectionInput) GetConnectionRequest } // Send marshals and sends the GetConnection API request. @@ -1587,7 +1614,7 @@ func (c *Glue) GetConnectionRequest(input *GetConnectionInput) GetConnectionRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetConnectionRequest{Request: req, Input: input} + return GetConnectionRequest{Request: req, Input: input, Copy: c.GetConnectionRequest} } const opGetConnections = "GetConnections" @@ -1596,6 +1623,7 @@ const opGetConnections = "GetConnections" type GetConnectionsRequest struct { *aws.Request Input *GetConnectionsInput + Copy func(*GetConnectionsInput) GetConnectionsRequest } // Send marshals and sends the GetConnections API request. @@ -1642,57 +1670,53 @@ func (c *Glue) GetConnectionsRequest(input *GetConnectionsInput) GetConnectionsR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetConnectionsRequest{Request: req, Input: input} + return GetConnectionsRequest{Request: req, Input: input, Copy: c.GetConnectionsRequest} } -// GetConnectionsPages iterates over the pages of a GetConnections operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetConnections method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetConnectionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetConnections operation. -// pageNum := 0 -// err := client.GetConnectionsPages(params, -// func(page *GetConnectionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetConnectionsPages(input *GetConnectionsInput, fn func(*GetConnectionsOutput, bool) bool) error { - return c.GetConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetConnectionsPagesWithContext same as GetConnectionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetConnectionsPagesWithContext(ctx aws.Context, input *GetConnectionsInput, fn func(*GetConnectionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetConnectionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetConnectionsRequest) Paginate(opts ...aws.Option) GetConnectionsPager { + return GetConnectionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetConnectionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetConnectionsOutput), !p.HasNextPage()) - } - return p.Err() +// GetConnectionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetConnectionsPager struct { + aws.Pager +} + +func (p *GetConnectionsPager) CurrentPage() *GetConnectionsOutput { + return p.Pager.CurrentPage().(*GetConnectionsOutput) } const opGetCrawler = "GetCrawler" @@ -1701,6 +1725,7 @@ const opGetCrawler = "GetCrawler" type GetCrawlerRequest struct { *aws.Request Input *GetCrawlerInput + Copy func(*GetCrawlerInput) GetCrawlerRequest } // Send marshals and sends the GetCrawler API request. @@ -1741,7 +1766,7 @@ func (c *Glue) GetCrawlerRequest(input *GetCrawlerInput) GetCrawlerRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCrawlerRequest{Request: req, Input: input} + return GetCrawlerRequest{Request: req, Input: input, Copy: c.GetCrawlerRequest} } const opGetCrawlerMetrics = "GetCrawlerMetrics" @@ -1750,6 +1775,7 @@ const opGetCrawlerMetrics = "GetCrawlerMetrics" type GetCrawlerMetricsRequest struct { *aws.Request Input *GetCrawlerMetricsInput + Copy func(*GetCrawlerMetricsInput) GetCrawlerMetricsRequest } // Send marshals and sends the GetCrawlerMetrics API request. @@ -1796,57 +1822,53 @@ func (c *Glue) GetCrawlerMetricsRequest(input *GetCrawlerMetricsInput) GetCrawle req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCrawlerMetricsRequest{Request: req, Input: input} + return GetCrawlerMetricsRequest{Request: req, Input: input, Copy: c.GetCrawlerMetricsRequest} } -// GetCrawlerMetricsPages iterates over the pages of a GetCrawlerMetrics operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetCrawlerMetrics method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetCrawlerMetricsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetCrawlerMetrics operation. -// pageNum := 0 -// err := client.GetCrawlerMetricsPages(params, -// func(page *GetCrawlerMetricsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetCrawlerMetricsPages(input *GetCrawlerMetricsInput, fn func(*GetCrawlerMetricsOutput, bool) bool) error { - return c.GetCrawlerMetricsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetCrawlerMetricsPagesWithContext same as GetCrawlerMetricsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetCrawlerMetricsPagesWithContext(ctx aws.Context, input *GetCrawlerMetricsInput, fn func(*GetCrawlerMetricsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetCrawlerMetricsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetCrawlerMetricsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetCrawlerMetricsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetCrawlerMetricsRequest) Paginate(opts ...aws.Option) GetCrawlerMetricsPager { + return GetCrawlerMetricsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetCrawlerMetricsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetCrawlerMetricsOutput), !p.HasNextPage()) - } - return p.Err() +// GetCrawlerMetricsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetCrawlerMetricsPager struct { + aws.Pager +} + +func (p *GetCrawlerMetricsPager) CurrentPage() *GetCrawlerMetricsOutput { + return p.Pager.CurrentPage().(*GetCrawlerMetricsOutput) } const opGetCrawlers = "GetCrawlers" @@ -1855,6 +1877,7 @@ const opGetCrawlers = "GetCrawlers" type GetCrawlersRequest struct { *aws.Request Input *GetCrawlersInput + Copy func(*GetCrawlersInput) GetCrawlersRequest } // Send marshals and sends the GetCrawlers API request. @@ -1901,57 +1924,53 @@ func (c *Glue) GetCrawlersRequest(input *GetCrawlersInput) GetCrawlersRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCrawlersRequest{Request: req, Input: input} + return GetCrawlersRequest{Request: req, Input: input, Copy: c.GetCrawlersRequest} } -// GetCrawlersPages iterates over the pages of a GetCrawlers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetCrawlers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetCrawlersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetCrawlers operation. -// pageNum := 0 -// err := client.GetCrawlersPages(params, -// func(page *GetCrawlersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetCrawlersPages(input *GetCrawlersInput, fn func(*GetCrawlersOutput, bool) bool) error { - return c.GetCrawlersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetCrawlersPagesWithContext same as GetCrawlersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetCrawlersPagesWithContext(ctx aws.Context, input *GetCrawlersInput, fn func(*GetCrawlersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetCrawlersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetCrawlersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetCrawlersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetCrawlersRequest) Paginate(opts ...aws.Option) GetCrawlersPager { + return GetCrawlersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetCrawlersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetCrawlersOutput), !p.HasNextPage()) - } - return p.Err() +// GetCrawlersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetCrawlersPager struct { + aws.Pager +} + +func (p *GetCrawlersPager) CurrentPage() *GetCrawlersOutput { + return p.Pager.CurrentPage().(*GetCrawlersOutput) } const opGetDatabase = "GetDatabase" @@ -1960,6 +1979,7 @@ const opGetDatabase = "GetDatabase" type GetDatabaseRequest struct { *aws.Request Input *GetDatabaseInput + Copy func(*GetDatabaseInput) GetDatabaseRequest } // Send marshals and sends the GetDatabase API request. @@ -2000,7 +2020,7 @@ func (c *Glue) GetDatabaseRequest(input *GetDatabaseInput) GetDatabaseRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDatabaseRequest{Request: req, Input: input} + return GetDatabaseRequest{Request: req, Input: input, Copy: c.GetDatabaseRequest} } const opGetDatabases = "GetDatabases" @@ -2009,6 +2029,7 @@ const opGetDatabases = "GetDatabases" type GetDatabasesRequest struct { *aws.Request Input *GetDatabasesInput + Copy func(*GetDatabasesInput) GetDatabasesRequest } // Send marshals and sends the GetDatabases API request. @@ -2055,57 +2076,53 @@ func (c *Glue) GetDatabasesRequest(input *GetDatabasesInput) GetDatabasesRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDatabasesRequest{Request: req, Input: input} + return GetDatabasesRequest{Request: req, Input: input, Copy: c.GetDatabasesRequest} } -// GetDatabasesPages iterates over the pages of a GetDatabases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetDatabases method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetDatabasesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetDatabases operation. -// pageNum := 0 -// err := client.GetDatabasesPages(params, -// func(page *GetDatabasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetDatabasesPages(input *GetDatabasesInput, fn func(*GetDatabasesOutput, bool) bool) error { - return c.GetDatabasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetDatabasesPagesWithContext same as GetDatabasesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetDatabasesPagesWithContext(ctx aws.Context, input *GetDatabasesInput, fn func(*GetDatabasesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetDatabasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetDatabasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetDatabasesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetDatabasesRequest) Paginate(opts ...aws.Option) GetDatabasesPager { + return GetDatabasesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetDatabasesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDatabasesOutput), !p.HasNextPage()) - } - return p.Err() +// GetDatabasesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetDatabasesPager struct { + aws.Pager +} + +func (p *GetDatabasesPager) CurrentPage() *GetDatabasesOutput { + return p.Pager.CurrentPage().(*GetDatabasesOutput) } const opGetDataflowGraph = "GetDataflowGraph" @@ -2114,6 +2131,7 @@ const opGetDataflowGraph = "GetDataflowGraph" type GetDataflowGraphRequest struct { *aws.Request Input *GetDataflowGraphInput + Copy func(*GetDataflowGraphInput) GetDataflowGraphRequest } // Send marshals and sends the GetDataflowGraph API request. @@ -2154,7 +2172,7 @@ func (c *Glue) GetDataflowGraphRequest(input *GetDataflowGraphInput) GetDataflow req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDataflowGraphRequest{Request: req, Input: input} + return GetDataflowGraphRequest{Request: req, Input: input, Copy: c.GetDataflowGraphRequest} } const opGetDevEndpoint = "GetDevEndpoint" @@ -2163,6 +2181,7 @@ const opGetDevEndpoint = "GetDevEndpoint" type GetDevEndpointRequest struct { *aws.Request Input *GetDevEndpointInput + Copy func(*GetDevEndpointInput) GetDevEndpointRequest } // Send marshals and sends the GetDevEndpoint API request. @@ -2203,7 +2222,7 @@ func (c *Glue) GetDevEndpointRequest(input *GetDevEndpointInput) GetDevEndpointR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDevEndpointRequest{Request: req, Input: input} + return GetDevEndpointRequest{Request: req, Input: input, Copy: c.GetDevEndpointRequest} } const opGetDevEndpoints = "GetDevEndpoints" @@ -2212,6 +2231,7 @@ const opGetDevEndpoints = "GetDevEndpoints" type GetDevEndpointsRequest struct { *aws.Request Input *GetDevEndpointsInput + Copy func(*GetDevEndpointsInput) GetDevEndpointsRequest } // Send marshals and sends the GetDevEndpoints API request. @@ -2258,57 +2278,53 @@ func (c *Glue) GetDevEndpointsRequest(input *GetDevEndpointsInput) GetDevEndpoin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDevEndpointsRequest{Request: req, Input: input} + return GetDevEndpointsRequest{Request: req, Input: input, Copy: c.GetDevEndpointsRequest} } -// GetDevEndpointsPages iterates over the pages of a GetDevEndpoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetDevEndpoints method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetDevEndpointsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetDevEndpoints operation. -// pageNum := 0 -// err := client.GetDevEndpointsPages(params, -// func(page *GetDevEndpointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetDevEndpointsPages(input *GetDevEndpointsInput, fn func(*GetDevEndpointsOutput, bool) bool) error { - return c.GetDevEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetDevEndpointsPagesWithContext same as GetDevEndpointsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetDevEndpointsPagesWithContext(ctx aws.Context, input *GetDevEndpointsInput, fn func(*GetDevEndpointsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetDevEndpointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetDevEndpointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetDevEndpointsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetDevEndpointsRequest) Paginate(opts ...aws.Option) GetDevEndpointsPager { + return GetDevEndpointsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetDevEndpointsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDevEndpointsOutput), !p.HasNextPage()) - } - return p.Err() +// GetDevEndpointsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetDevEndpointsPager struct { + aws.Pager +} + +func (p *GetDevEndpointsPager) CurrentPage() *GetDevEndpointsOutput { + return p.Pager.CurrentPage().(*GetDevEndpointsOutput) } const opGetJob = "GetJob" @@ -2317,6 +2333,7 @@ const opGetJob = "GetJob" type GetJobRequest struct { *aws.Request Input *GetJobInput + Copy func(*GetJobInput) GetJobRequest } // Send marshals and sends the GetJob API request. @@ -2357,7 +2374,7 @@ func (c *Glue) GetJobRequest(input *GetJobInput) GetJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobRequest{Request: req, Input: input} + return GetJobRequest{Request: req, Input: input, Copy: c.GetJobRequest} } const opGetJobRun = "GetJobRun" @@ -2366,6 +2383,7 @@ const opGetJobRun = "GetJobRun" type GetJobRunRequest struct { *aws.Request Input *GetJobRunInput + Copy func(*GetJobRunInput) GetJobRunRequest } // Send marshals and sends the GetJobRun API request. @@ -2406,7 +2424,7 @@ func (c *Glue) GetJobRunRequest(input *GetJobRunInput) GetJobRunRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobRunRequest{Request: req, Input: input} + return GetJobRunRequest{Request: req, Input: input, Copy: c.GetJobRunRequest} } const opGetJobRuns = "GetJobRuns" @@ -2415,6 +2433,7 @@ const opGetJobRuns = "GetJobRuns" type GetJobRunsRequest struct { *aws.Request Input *GetJobRunsInput + Copy func(*GetJobRunsInput) GetJobRunsRequest } // Send marshals and sends the GetJobRuns API request. @@ -2461,57 +2480,53 @@ func (c *Glue) GetJobRunsRequest(input *GetJobRunsInput) GetJobRunsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobRunsRequest{Request: req, Input: input} + return GetJobRunsRequest{Request: req, Input: input, Copy: c.GetJobRunsRequest} } -// GetJobRunsPages iterates over the pages of a GetJobRuns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetJobRuns method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetJobRunsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetJobRuns operation. -// pageNum := 0 -// err := client.GetJobRunsPages(params, -// func(page *GetJobRunsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetJobRunsPages(input *GetJobRunsInput, fn func(*GetJobRunsOutput, bool) bool) error { - return c.GetJobRunsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetJobRunsPagesWithContext same as GetJobRunsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetJobRunsPagesWithContext(ctx aws.Context, input *GetJobRunsInput, fn func(*GetJobRunsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetJobRunsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetJobRunsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetJobRunsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetJobRunsRequest) Paginate(opts ...aws.Option) GetJobRunsPager { + return GetJobRunsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetJobRunsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetJobRunsOutput), !p.HasNextPage()) - } - return p.Err() +// GetJobRunsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetJobRunsPager struct { + aws.Pager +} + +func (p *GetJobRunsPager) CurrentPage() *GetJobRunsOutput { + return p.Pager.CurrentPage().(*GetJobRunsOutput) } const opGetJobs = "GetJobs" @@ -2520,6 +2535,7 @@ const opGetJobs = "GetJobs" type GetJobsRequest struct { *aws.Request Input *GetJobsInput + Copy func(*GetJobsInput) GetJobsRequest } // Send marshals and sends the GetJobs API request. @@ -2566,57 +2582,53 @@ func (c *Glue) GetJobsRequest(input *GetJobsInput) GetJobsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobsRequest{Request: req, Input: input} + return GetJobsRequest{Request: req, Input: input, Copy: c.GetJobsRequest} } -// GetJobsPages iterates over the pages of a GetJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetJobs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetJobsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetJobs operation. -// pageNum := 0 -// err := client.GetJobsPages(params, -// func(page *GetJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetJobsPages(input *GetJobsInput, fn func(*GetJobsOutput, bool) bool) error { - return c.GetJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetJobsPagesWithContext same as GetJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetJobsPagesWithContext(ctx aws.Context, input *GetJobsInput, fn func(*GetJobsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetJobsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetJobsRequest) Paginate(opts ...aws.Option) GetJobsPager { + return GetJobsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetJobsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetJobsOutput), !p.HasNextPage()) - } - return p.Err() +// GetJobsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetJobsPager struct { + aws.Pager +} + +func (p *GetJobsPager) CurrentPage() *GetJobsOutput { + return p.Pager.CurrentPage().(*GetJobsOutput) } const opGetMapping = "GetMapping" @@ -2625,6 +2637,7 @@ const opGetMapping = "GetMapping" type GetMappingRequest struct { *aws.Request Input *GetMappingInput + Copy func(*GetMappingInput) GetMappingRequest } // Send marshals and sends the GetMapping API request. @@ -2665,7 +2678,7 @@ func (c *Glue) GetMappingRequest(input *GetMappingInput) GetMappingRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMappingRequest{Request: req, Input: input} + return GetMappingRequest{Request: req, Input: input, Copy: c.GetMappingRequest} } const opGetPartition = "GetPartition" @@ -2674,6 +2687,7 @@ const opGetPartition = "GetPartition" type GetPartitionRequest struct { *aws.Request Input *GetPartitionInput + Copy func(*GetPartitionInput) GetPartitionRequest } // Send marshals and sends the GetPartition API request. @@ -2714,7 +2728,7 @@ func (c *Glue) GetPartitionRequest(input *GetPartitionInput) GetPartitionRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPartitionRequest{Request: req, Input: input} + return GetPartitionRequest{Request: req, Input: input, Copy: c.GetPartitionRequest} } const opGetPartitions = "GetPartitions" @@ -2723,6 +2737,7 @@ const opGetPartitions = "GetPartitions" type GetPartitionsRequest struct { *aws.Request Input *GetPartitionsInput + Copy func(*GetPartitionsInput) GetPartitionsRequest } // Send marshals and sends the GetPartitions API request. @@ -2769,57 +2784,53 @@ func (c *Glue) GetPartitionsRequest(input *GetPartitionsInput) GetPartitionsRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPartitionsRequest{Request: req, Input: input} + return GetPartitionsRequest{Request: req, Input: input, Copy: c.GetPartitionsRequest} } -// GetPartitionsPages iterates over the pages of a GetPartitions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetPartitions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetPartitionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetPartitions operation. -// pageNum := 0 -// err := client.GetPartitionsPages(params, -// func(page *GetPartitionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetPartitionsPages(input *GetPartitionsInput, fn func(*GetPartitionsOutput, bool) bool) error { - return c.GetPartitionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetPartitionsPagesWithContext same as GetPartitionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetPartitionsPagesWithContext(ctx aws.Context, input *GetPartitionsInput, fn func(*GetPartitionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetPartitionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetPartitionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetPartitionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetPartitionsRequest) Paginate(opts ...aws.Option) GetPartitionsPager { + return GetPartitionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetPartitionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetPartitionsOutput), !p.HasNextPage()) - } - return p.Err() +// GetPartitionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetPartitionsPager struct { + aws.Pager +} + +func (p *GetPartitionsPager) CurrentPage() *GetPartitionsOutput { + return p.Pager.CurrentPage().(*GetPartitionsOutput) } const opGetPlan = "GetPlan" @@ -2828,6 +2839,7 @@ const opGetPlan = "GetPlan" type GetPlanRequest struct { *aws.Request Input *GetPlanInput + Copy func(*GetPlanInput) GetPlanRequest } // Send marshals and sends the GetPlan API request. @@ -2868,7 +2880,7 @@ func (c *Glue) GetPlanRequest(input *GetPlanInput) GetPlanRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPlanRequest{Request: req, Input: input} + return GetPlanRequest{Request: req, Input: input, Copy: c.GetPlanRequest} } const opGetTable = "GetTable" @@ -2877,6 +2889,7 @@ const opGetTable = "GetTable" type GetTableRequest struct { *aws.Request Input *GetTableInput + Copy func(*GetTableInput) GetTableRequest } // Send marshals and sends the GetTable API request. @@ -2917,7 +2930,7 @@ func (c *Glue) GetTableRequest(input *GetTableInput) GetTableRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTableRequest{Request: req, Input: input} + return GetTableRequest{Request: req, Input: input, Copy: c.GetTableRequest} } const opGetTableVersions = "GetTableVersions" @@ -2926,6 +2939,7 @@ const opGetTableVersions = "GetTableVersions" type GetTableVersionsRequest struct { *aws.Request Input *GetTableVersionsInput + Copy func(*GetTableVersionsInput) GetTableVersionsRequest } // Send marshals and sends the GetTableVersions API request. @@ -2973,57 +2987,53 @@ func (c *Glue) GetTableVersionsRequest(input *GetTableVersionsInput) GetTableVer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTableVersionsRequest{Request: req, Input: input} + return GetTableVersionsRequest{Request: req, Input: input, Copy: c.GetTableVersionsRequest} } -// GetTableVersionsPages iterates over the pages of a GetTableVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTableVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetTableVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetTableVersions operation. -// pageNum := 0 -// err := client.GetTableVersionsPages(params, -// func(page *GetTableVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetTableVersionsPages(input *GetTableVersionsInput, fn func(*GetTableVersionsOutput, bool) bool) error { - return c.GetTableVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTableVersionsPagesWithContext same as GetTableVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetTableVersionsPagesWithContext(ctx aws.Context, input *GetTableVersionsInput, fn func(*GetTableVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetTableVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetTableVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetTableVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetTableVersionsRequest) Paginate(opts ...aws.Option) GetTableVersionsPager { + return GetTableVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetTableVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTableVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// GetTableVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetTableVersionsPager struct { + aws.Pager +} + +func (p *GetTableVersionsPager) CurrentPage() *GetTableVersionsOutput { + return p.Pager.CurrentPage().(*GetTableVersionsOutput) } const opGetTables = "GetTables" @@ -3032,6 +3042,7 @@ const opGetTables = "GetTables" type GetTablesRequest struct { *aws.Request Input *GetTablesInput + Copy func(*GetTablesInput) GetTablesRequest } // Send marshals and sends the GetTables API request. @@ -3078,57 +3089,53 @@ func (c *Glue) GetTablesRequest(input *GetTablesInput) GetTablesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTablesRequest{Request: req, Input: input} + return GetTablesRequest{Request: req, Input: input, Copy: c.GetTablesRequest} } -// GetTablesPages iterates over the pages of a GetTables operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTables method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetTablesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetTables operation. -// pageNum := 0 -// err := client.GetTablesPages(params, -// func(page *GetTablesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetTablesPages(input *GetTablesInput, fn func(*GetTablesOutput, bool) bool) error { - return c.GetTablesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTablesPagesWithContext same as GetTablesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetTablesPagesWithContext(ctx aws.Context, input *GetTablesInput, fn func(*GetTablesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetTablesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetTablesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetTablesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetTablesRequest) Paginate(opts ...aws.Option) GetTablesPager { + return GetTablesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetTablesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTablesOutput), !p.HasNextPage()) - } - return p.Err() +// GetTablesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetTablesPager struct { + aws.Pager +} + +func (p *GetTablesPager) CurrentPage() *GetTablesOutput { + return p.Pager.CurrentPage().(*GetTablesOutput) } const opGetTrigger = "GetTrigger" @@ -3137,6 +3144,7 @@ const opGetTrigger = "GetTrigger" type GetTriggerRequest struct { *aws.Request Input *GetTriggerInput + Copy func(*GetTriggerInput) GetTriggerRequest } // Send marshals and sends the GetTrigger API request. @@ -3177,7 +3185,7 @@ func (c *Glue) GetTriggerRequest(input *GetTriggerInput) GetTriggerRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTriggerRequest{Request: req, Input: input} + return GetTriggerRequest{Request: req, Input: input, Copy: c.GetTriggerRequest} } const opGetTriggers = "GetTriggers" @@ -3186,6 +3194,7 @@ const opGetTriggers = "GetTriggers" type GetTriggersRequest struct { *aws.Request Input *GetTriggersInput + Copy func(*GetTriggersInput) GetTriggersRequest } // Send marshals and sends the GetTriggers API request. @@ -3232,57 +3241,53 @@ func (c *Glue) GetTriggersRequest(input *GetTriggersInput) GetTriggersRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTriggersRequest{Request: req, Input: input} + return GetTriggersRequest{Request: req, Input: input, Copy: c.GetTriggersRequest} } -// GetTriggersPages iterates over the pages of a GetTriggers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTriggers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetTriggersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetTriggers operation. -// pageNum := 0 -// err := client.GetTriggersPages(params, -// func(page *GetTriggersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetTriggersPages(input *GetTriggersInput, fn func(*GetTriggersOutput, bool) bool) error { - return c.GetTriggersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTriggersPagesWithContext same as GetTriggersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetTriggersPagesWithContext(ctx aws.Context, input *GetTriggersInput, fn func(*GetTriggersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetTriggersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetTriggersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetTriggersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetTriggersRequest) Paginate(opts ...aws.Option) GetTriggersPager { + return GetTriggersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetTriggersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTriggersOutput), !p.HasNextPage()) - } - return p.Err() +// GetTriggersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetTriggersPager struct { + aws.Pager +} + +func (p *GetTriggersPager) CurrentPage() *GetTriggersOutput { + return p.Pager.CurrentPage().(*GetTriggersOutput) } const opGetUserDefinedFunction = "GetUserDefinedFunction" @@ -3291,6 +3296,7 @@ const opGetUserDefinedFunction = "GetUserDefinedFunction" type GetUserDefinedFunctionRequest struct { *aws.Request Input *GetUserDefinedFunctionInput + Copy func(*GetUserDefinedFunctionInput) GetUserDefinedFunctionRequest } // Send marshals and sends the GetUserDefinedFunction API request. @@ -3331,7 +3337,7 @@ func (c *Glue) GetUserDefinedFunctionRequest(input *GetUserDefinedFunctionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUserDefinedFunctionRequest{Request: req, Input: input} + return GetUserDefinedFunctionRequest{Request: req, Input: input, Copy: c.GetUserDefinedFunctionRequest} } const opGetUserDefinedFunctions = "GetUserDefinedFunctions" @@ -3340,6 +3346,7 @@ const opGetUserDefinedFunctions = "GetUserDefinedFunctions" type GetUserDefinedFunctionsRequest struct { *aws.Request Input *GetUserDefinedFunctionsInput + Copy func(*GetUserDefinedFunctionsInput) GetUserDefinedFunctionsRequest } // Send marshals and sends the GetUserDefinedFunctions API request. @@ -3386,57 +3393,53 @@ func (c *Glue) GetUserDefinedFunctionsRequest(input *GetUserDefinedFunctionsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUserDefinedFunctionsRequest{Request: req, Input: input} + return GetUserDefinedFunctionsRequest{Request: req, Input: input, Copy: c.GetUserDefinedFunctionsRequest} } -// GetUserDefinedFunctionsPages iterates over the pages of a GetUserDefinedFunctions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetUserDefinedFunctions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetUserDefinedFunctionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetUserDefinedFunctions operation. -// pageNum := 0 -// err := client.GetUserDefinedFunctionsPages(params, -// func(page *GetUserDefinedFunctionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glue) GetUserDefinedFunctionsPages(input *GetUserDefinedFunctionsInput, fn func(*GetUserDefinedFunctionsOutput, bool) bool) error { - return c.GetUserDefinedFunctionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetUserDefinedFunctionsPagesWithContext same as GetUserDefinedFunctionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Glue) GetUserDefinedFunctionsPagesWithContext(ctx aws.Context, input *GetUserDefinedFunctionsInput, fn func(*GetUserDefinedFunctionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetUserDefinedFunctionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetUserDefinedFunctionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetUserDefinedFunctionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetUserDefinedFunctionsRequest) Paginate(opts ...aws.Option) GetUserDefinedFunctionsPager { + return GetUserDefinedFunctionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetUserDefinedFunctionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetUserDefinedFunctionsOutput), !p.HasNextPage()) - } - return p.Err() +// GetUserDefinedFunctionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetUserDefinedFunctionsPager struct { + aws.Pager +} + +func (p *GetUserDefinedFunctionsPager) CurrentPage() *GetUserDefinedFunctionsOutput { + return p.Pager.CurrentPage().(*GetUserDefinedFunctionsOutput) } const opImportCatalogToGlue = "ImportCatalogToGlue" @@ -3445,6 +3448,7 @@ const opImportCatalogToGlue = "ImportCatalogToGlue" type ImportCatalogToGlueRequest struct { *aws.Request Input *ImportCatalogToGlueInput + Copy func(*ImportCatalogToGlueInput) ImportCatalogToGlueRequest } // Send marshals and sends the ImportCatalogToGlue API request. @@ -3485,7 +3489,7 @@ func (c *Glue) ImportCatalogToGlueRequest(input *ImportCatalogToGlueInput) Impor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportCatalogToGlueRequest{Request: req, Input: input} + return ImportCatalogToGlueRequest{Request: req, Input: input, Copy: c.ImportCatalogToGlueRequest} } const opResetJobBookmark = "ResetJobBookmark" @@ -3494,6 +3498,7 @@ const opResetJobBookmark = "ResetJobBookmark" type ResetJobBookmarkRequest struct { *aws.Request Input *ResetJobBookmarkInput + Copy func(*ResetJobBookmarkInput) ResetJobBookmarkRequest } // Send marshals and sends the ResetJobBookmark API request. @@ -3534,7 +3539,7 @@ func (c *Glue) ResetJobBookmarkRequest(input *ResetJobBookmarkInput) ResetJobBoo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetJobBookmarkRequest{Request: req, Input: input} + return ResetJobBookmarkRequest{Request: req, Input: input, Copy: c.ResetJobBookmarkRequest} } const opStartCrawler = "StartCrawler" @@ -3543,6 +3548,7 @@ const opStartCrawler = "StartCrawler" type StartCrawlerRequest struct { *aws.Request Input *StartCrawlerInput + Copy func(*StartCrawlerInput) StartCrawlerRequest } // Send marshals and sends the StartCrawler API request. @@ -3584,7 +3590,7 @@ func (c *Glue) StartCrawlerRequest(input *StartCrawlerInput) StartCrawlerRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartCrawlerRequest{Request: req, Input: input} + return StartCrawlerRequest{Request: req, Input: input, Copy: c.StartCrawlerRequest} } const opStartCrawlerSchedule = "StartCrawlerSchedule" @@ -3593,6 +3599,7 @@ const opStartCrawlerSchedule = "StartCrawlerSchedule" type StartCrawlerScheduleRequest struct { *aws.Request Input *StartCrawlerScheduleInput + Copy func(*StartCrawlerScheduleInput) StartCrawlerScheduleRequest } // Send marshals and sends the StartCrawlerSchedule API request. @@ -3634,7 +3641,7 @@ func (c *Glue) StartCrawlerScheduleRequest(input *StartCrawlerScheduleInput) Sta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartCrawlerScheduleRequest{Request: req, Input: input} + return StartCrawlerScheduleRequest{Request: req, Input: input, Copy: c.StartCrawlerScheduleRequest} } const opStartJobRun = "StartJobRun" @@ -3643,6 +3650,7 @@ const opStartJobRun = "StartJobRun" type StartJobRunRequest struct { *aws.Request Input *StartJobRunInput + Copy func(*StartJobRunInput) StartJobRunRequest } // Send marshals and sends the StartJobRun API request. @@ -3683,7 +3691,7 @@ func (c *Glue) StartJobRunRequest(input *StartJobRunInput) StartJobRunRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartJobRunRequest{Request: req, Input: input} + return StartJobRunRequest{Request: req, Input: input, Copy: c.StartJobRunRequest} } const opStartTrigger = "StartTrigger" @@ -3692,6 +3700,7 @@ const opStartTrigger = "StartTrigger" type StartTriggerRequest struct { *aws.Request Input *StartTriggerInput + Copy func(*StartTriggerInput) StartTriggerRequest } // Send marshals and sends the StartTrigger API request. @@ -3733,7 +3742,7 @@ func (c *Glue) StartTriggerRequest(input *StartTriggerInput) StartTriggerRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartTriggerRequest{Request: req, Input: input} + return StartTriggerRequest{Request: req, Input: input, Copy: c.StartTriggerRequest} } const opStopCrawler = "StopCrawler" @@ -3742,6 +3751,7 @@ const opStopCrawler = "StopCrawler" type StopCrawlerRequest struct { *aws.Request Input *StopCrawlerInput + Copy func(*StopCrawlerInput) StopCrawlerRequest } // Send marshals and sends the StopCrawler API request. @@ -3782,7 +3792,7 @@ func (c *Glue) StopCrawlerRequest(input *StopCrawlerInput) StopCrawlerRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopCrawlerRequest{Request: req, Input: input} + return StopCrawlerRequest{Request: req, Input: input, Copy: c.StopCrawlerRequest} } const opStopCrawlerSchedule = "StopCrawlerSchedule" @@ -3791,6 +3801,7 @@ const opStopCrawlerSchedule = "StopCrawlerSchedule" type StopCrawlerScheduleRequest struct { *aws.Request Input *StopCrawlerScheduleInput + Copy func(*StopCrawlerScheduleInput) StopCrawlerScheduleRequest } // Send marshals and sends the StopCrawlerSchedule API request. @@ -3832,7 +3843,7 @@ func (c *Glue) StopCrawlerScheduleRequest(input *StopCrawlerScheduleInput) StopC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopCrawlerScheduleRequest{Request: req, Input: input} + return StopCrawlerScheduleRequest{Request: req, Input: input, Copy: c.StopCrawlerScheduleRequest} } const opStopTrigger = "StopTrigger" @@ -3841,6 +3852,7 @@ const opStopTrigger = "StopTrigger" type StopTriggerRequest struct { *aws.Request Input *StopTriggerInput + Copy func(*StopTriggerInput) StopTriggerRequest } // Send marshals and sends the StopTrigger API request. @@ -3881,7 +3893,7 @@ func (c *Glue) StopTriggerRequest(input *StopTriggerInput) StopTriggerRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopTriggerRequest{Request: req, Input: input} + return StopTriggerRequest{Request: req, Input: input, Copy: c.StopTriggerRequest} } const opUpdateClassifier = "UpdateClassifier" @@ -3890,6 +3902,7 @@ const opUpdateClassifier = "UpdateClassifier" type UpdateClassifierRequest struct { *aws.Request Input *UpdateClassifierInput + Copy func(*UpdateClassifierInput) UpdateClassifierRequest } // Send marshals and sends the UpdateClassifier API request. @@ -3930,7 +3943,7 @@ func (c *Glue) UpdateClassifierRequest(input *UpdateClassifierInput) UpdateClass req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateClassifierRequest{Request: req, Input: input} + return UpdateClassifierRequest{Request: req, Input: input, Copy: c.UpdateClassifierRequest} } const opUpdateConnection = "UpdateConnection" @@ -3939,6 +3952,7 @@ const opUpdateConnection = "UpdateConnection" type UpdateConnectionRequest struct { *aws.Request Input *UpdateConnectionInput + Copy func(*UpdateConnectionInput) UpdateConnectionRequest } // Send marshals and sends the UpdateConnection API request. @@ -3979,7 +3993,7 @@ func (c *Glue) UpdateConnectionRequest(input *UpdateConnectionInput) UpdateConne req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateConnectionRequest{Request: req, Input: input} + return UpdateConnectionRequest{Request: req, Input: input, Copy: c.UpdateConnectionRequest} } const opUpdateCrawler = "UpdateCrawler" @@ -3988,6 +4002,7 @@ const opUpdateCrawler = "UpdateCrawler" type UpdateCrawlerRequest struct { *aws.Request Input *UpdateCrawlerInput + Copy func(*UpdateCrawlerInput) UpdateCrawlerRequest } // Send marshals and sends the UpdateCrawler API request. @@ -4029,7 +4044,7 @@ func (c *Glue) UpdateCrawlerRequest(input *UpdateCrawlerInput) UpdateCrawlerRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateCrawlerRequest{Request: req, Input: input} + return UpdateCrawlerRequest{Request: req, Input: input, Copy: c.UpdateCrawlerRequest} } const opUpdateCrawlerSchedule = "UpdateCrawlerSchedule" @@ -4038,6 +4053,7 @@ const opUpdateCrawlerSchedule = "UpdateCrawlerSchedule" type UpdateCrawlerScheduleRequest struct { *aws.Request Input *UpdateCrawlerScheduleInput + Copy func(*UpdateCrawlerScheduleInput) UpdateCrawlerScheduleRequest } // Send marshals and sends the UpdateCrawlerSchedule API request. @@ -4078,7 +4094,7 @@ func (c *Glue) UpdateCrawlerScheduleRequest(input *UpdateCrawlerScheduleInput) U req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateCrawlerScheduleRequest{Request: req, Input: input} + return UpdateCrawlerScheduleRequest{Request: req, Input: input, Copy: c.UpdateCrawlerScheduleRequest} } const opUpdateDatabase = "UpdateDatabase" @@ -4087,6 +4103,7 @@ const opUpdateDatabase = "UpdateDatabase" type UpdateDatabaseRequest struct { *aws.Request Input *UpdateDatabaseInput + Copy func(*UpdateDatabaseInput) UpdateDatabaseRequest } // Send marshals and sends the UpdateDatabase API request. @@ -4127,7 +4144,7 @@ func (c *Glue) UpdateDatabaseRequest(input *UpdateDatabaseInput) UpdateDatabaseR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDatabaseRequest{Request: req, Input: input} + return UpdateDatabaseRequest{Request: req, Input: input, Copy: c.UpdateDatabaseRequest} } const opUpdateDevEndpoint = "UpdateDevEndpoint" @@ -4136,6 +4153,7 @@ const opUpdateDevEndpoint = "UpdateDevEndpoint" type UpdateDevEndpointRequest struct { *aws.Request Input *UpdateDevEndpointInput + Copy func(*UpdateDevEndpointInput) UpdateDevEndpointRequest } // Send marshals and sends the UpdateDevEndpoint API request. @@ -4176,7 +4194,7 @@ func (c *Glue) UpdateDevEndpointRequest(input *UpdateDevEndpointInput) UpdateDev req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDevEndpointRequest{Request: req, Input: input} + return UpdateDevEndpointRequest{Request: req, Input: input, Copy: c.UpdateDevEndpointRequest} } const opUpdateJob = "UpdateJob" @@ -4185,6 +4203,7 @@ const opUpdateJob = "UpdateJob" type UpdateJobRequest struct { *aws.Request Input *UpdateJobInput + Copy func(*UpdateJobInput) UpdateJobRequest } // Send marshals and sends the UpdateJob API request. @@ -4225,7 +4244,7 @@ func (c *Glue) UpdateJobRequest(input *UpdateJobInput) UpdateJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateJobRequest{Request: req, Input: input} + return UpdateJobRequest{Request: req, Input: input, Copy: c.UpdateJobRequest} } const opUpdatePartition = "UpdatePartition" @@ -4234,6 +4253,7 @@ const opUpdatePartition = "UpdatePartition" type UpdatePartitionRequest struct { *aws.Request Input *UpdatePartitionInput + Copy func(*UpdatePartitionInput) UpdatePartitionRequest } // Send marshals and sends the UpdatePartition API request. @@ -4274,7 +4294,7 @@ func (c *Glue) UpdatePartitionRequest(input *UpdatePartitionInput) UpdatePartiti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePartitionRequest{Request: req, Input: input} + return UpdatePartitionRequest{Request: req, Input: input, Copy: c.UpdatePartitionRequest} } const opUpdateTable = "UpdateTable" @@ -4283,6 +4303,7 @@ const opUpdateTable = "UpdateTable" type UpdateTableRequest struct { *aws.Request Input *UpdateTableInput + Copy func(*UpdateTableInput) UpdateTableRequest } // Send marshals and sends the UpdateTable API request. @@ -4323,7 +4344,7 @@ func (c *Glue) UpdateTableRequest(input *UpdateTableInput) UpdateTableRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTableRequest{Request: req, Input: input} + return UpdateTableRequest{Request: req, Input: input, Copy: c.UpdateTableRequest} } const opUpdateTrigger = "UpdateTrigger" @@ -4332,6 +4353,7 @@ const opUpdateTrigger = "UpdateTrigger" type UpdateTriggerRequest struct { *aws.Request Input *UpdateTriggerInput + Copy func(*UpdateTriggerInput) UpdateTriggerRequest } // Send marshals and sends the UpdateTrigger API request. @@ -4372,7 +4394,7 @@ func (c *Glue) UpdateTriggerRequest(input *UpdateTriggerInput) UpdateTriggerRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTriggerRequest{Request: req, Input: input} + return UpdateTriggerRequest{Request: req, Input: input, Copy: c.UpdateTriggerRequest} } const opUpdateUserDefinedFunction = "UpdateUserDefinedFunction" @@ -4381,6 +4403,7 @@ const opUpdateUserDefinedFunction = "UpdateUserDefinedFunction" type UpdateUserDefinedFunctionRequest struct { *aws.Request Input *UpdateUserDefinedFunctionInput + Copy func(*UpdateUserDefinedFunctionInput) UpdateUserDefinedFunctionRequest } // Send marshals and sends the UpdateUserDefinedFunction API request. @@ -4421,7 +4444,7 @@ func (c *Glue) UpdateUserDefinedFunctionRequest(input *UpdateUserDefinedFunction req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateUserDefinedFunctionRequest{Request: req, Input: input} + return UpdateUserDefinedFunctionRequest{Request: req, Input: input, Copy: c.UpdateUserDefinedFunctionRequest} } // Defines an action to be initiated by a trigger. diff --git a/service/glue/glueiface/interface.go b/service/glue/glueiface/interface.go index 636ba72d2af..513dc85f443 100644 --- a/service/glue/glueiface/interface.go +++ b/service/glue/glueiface/interface.go @@ -9,7 +9,6 @@ package glueiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/glue" ) @@ -123,95 +122,56 @@ type GlueAPI interface { GetClassifiersRequest(*glue.GetClassifiersInput) glue.GetClassifiersRequest - GetClassifiersPages(*glue.GetClassifiersInput, func(*glue.GetClassifiersOutput, bool) bool) error - GetClassifiersPagesWithContext(aws.Context, *glue.GetClassifiersInput, func(*glue.GetClassifiersOutput, bool) bool, ...aws.Option) error - GetConnectionRequest(*glue.GetConnectionInput) glue.GetConnectionRequest GetConnectionsRequest(*glue.GetConnectionsInput) glue.GetConnectionsRequest - GetConnectionsPages(*glue.GetConnectionsInput, func(*glue.GetConnectionsOutput, bool) bool) error - GetConnectionsPagesWithContext(aws.Context, *glue.GetConnectionsInput, func(*glue.GetConnectionsOutput, bool) bool, ...aws.Option) error - GetCrawlerRequest(*glue.GetCrawlerInput) glue.GetCrawlerRequest GetCrawlerMetricsRequest(*glue.GetCrawlerMetricsInput) glue.GetCrawlerMetricsRequest - GetCrawlerMetricsPages(*glue.GetCrawlerMetricsInput, func(*glue.GetCrawlerMetricsOutput, bool) bool) error - GetCrawlerMetricsPagesWithContext(aws.Context, *glue.GetCrawlerMetricsInput, func(*glue.GetCrawlerMetricsOutput, bool) bool, ...aws.Option) error - GetCrawlersRequest(*glue.GetCrawlersInput) glue.GetCrawlersRequest - GetCrawlersPages(*glue.GetCrawlersInput, func(*glue.GetCrawlersOutput, bool) bool) error - GetCrawlersPagesWithContext(aws.Context, *glue.GetCrawlersInput, func(*glue.GetCrawlersOutput, bool) bool, ...aws.Option) error - GetDatabaseRequest(*glue.GetDatabaseInput) glue.GetDatabaseRequest GetDatabasesRequest(*glue.GetDatabasesInput) glue.GetDatabasesRequest - GetDatabasesPages(*glue.GetDatabasesInput, func(*glue.GetDatabasesOutput, bool) bool) error - GetDatabasesPagesWithContext(aws.Context, *glue.GetDatabasesInput, func(*glue.GetDatabasesOutput, bool) bool, ...aws.Option) error - GetDataflowGraphRequest(*glue.GetDataflowGraphInput) glue.GetDataflowGraphRequest GetDevEndpointRequest(*glue.GetDevEndpointInput) glue.GetDevEndpointRequest GetDevEndpointsRequest(*glue.GetDevEndpointsInput) glue.GetDevEndpointsRequest - GetDevEndpointsPages(*glue.GetDevEndpointsInput, func(*glue.GetDevEndpointsOutput, bool) bool) error - GetDevEndpointsPagesWithContext(aws.Context, *glue.GetDevEndpointsInput, func(*glue.GetDevEndpointsOutput, bool) bool, ...aws.Option) error - GetJobRequest(*glue.GetJobInput) glue.GetJobRequest GetJobRunRequest(*glue.GetJobRunInput) glue.GetJobRunRequest GetJobRunsRequest(*glue.GetJobRunsInput) glue.GetJobRunsRequest - GetJobRunsPages(*glue.GetJobRunsInput, func(*glue.GetJobRunsOutput, bool) bool) error - GetJobRunsPagesWithContext(aws.Context, *glue.GetJobRunsInput, func(*glue.GetJobRunsOutput, bool) bool, ...aws.Option) error - GetJobsRequest(*glue.GetJobsInput) glue.GetJobsRequest - GetJobsPages(*glue.GetJobsInput, func(*glue.GetJobsOutput, bool) bool) error - GetJobsPagesWithContext(aws.Context, *glue.GetJobsInput, func(*glue.GetJobsOutput, bool) bool, ...aws.Option) error - GetMappingRequest(*glue.GetMappingInput) glue.GetMappingRequest GetPartitionRequest(*glue.GetPartitionInput) glue.GetPartitionRequest GetPartitionsRequest(*glue.GetPartitionsInput) glue.GetPartitionsRequest - GetPartitionsPages(*glue.GetPartitionsInput, func(*glue.GetPartitionsOutput, bool) bool) error - GetPartitionsPagesWithContext(aws.Context, *glue.GetPartitionsInput, func(*glue.GetPartitionsOutput, bool) bool, ...aws.Option) error - GetPlanRequest(*glue.GetPlanInput) glue.GetPlanRequest GetTableRequest(*glue.GetTableInput) glue.GetTableRequest GetTableVersionsRequest(*glue.GetTableVersionsInput) glue.GetTableVersionsRequest - GetTableVersionsPages(*glue.GetTableVersionsInput, func(*glue.GetTableVersionsOutput, bool) bool) error - GetTableVersionsPagesWithContext(aws.Context, *glue.GetTableVersionsInput, func(*glue.GetTableVersionsOutput, bool) bool, ...aws.Option) error - GetTablesRequest(*glue.GetTablesInput) glue.GetTablesRequest - GetTablesPages(*glue.GetTablesInput, func(*glue.GetTablesOutput, bool) bool) error - GetTablesPagesWithContext(aws.Context, *glue.GetTablesInput, func(*glue.GetTablesOutput, bool) bool, ...aws.Option) error - GetTriggerRequest(*glue.GetTriggerInput) glue.GetTriggerRequest GetTriggersRequest(*glue.GetTriggersInput) glue.GetTriggersRequest - GetTriggersPages(*glue.GetTriggersInput, func(*glue.GetTriggersOutput, bool) bool) error - GetTriggersPagesWithContext(aws.Context, *glue.GetTriggersInput, func(*glue.GetTriggersOutput, bool) bool, ...aws.Option) error - GetUserDefinedFunctionRequest(*glue.GetUserDefinedFunctionInput) glue.GetUserDefinedFunctionRequest GetUserDefinedFunctionsRequest(*glue.GetUserDefinedFunctionsInput) glue.GetUserDefinedFunctionsRequest - GetUserDefinedFunctionsPages(*glue.GetUserDefinedFunctionsInput, func(*glue.GetUserDefinedFunctionsOutput, bool) bool) error - GetUserDefinedFunctionsPagesWithContext(aws.Context, *glue.GetUserDefinedFunctionsInput, func(*glue.GetUserDefinedFunctionsOutput, bool) bool, ...aws.Option) error - ImportCatalogToGlueRequest(*glue.ImportCatalogToGlueInput) glue.ImportCatalogToGlueRequest ResetJobBookmarkRequest(*glue.ResetJobBookmarkInput) glue.ResetJobBookmarkRequest diff --git a/service/greengrass/api.go b/service/greengrass/api.go index 78951690147..8109bb5d73f 100644 --- a/service/greengrass/api.go +++ b/service/greengrass/api.go @@ -14,6 +14,7 @@ const opAssociateRoleToGroup = "AssociateRoleToGroup" type AssociateRoleToGroupRequest struct { *aws.Request Input *AssociateRoleToGroupInput + Copy func(*AssociateRoleToGroupInput) AssociateRoleToGroupRequest } // Send marshals and sends the AssociateRoleToGroup API request. @@ -56,7 +57,7 @@ func (c *Greengrass) AssociateRoleToGroupRequest(input *AssociateRoleToGroupInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateRoleToGroupRequest{Request: req, Input: input} + return AssociateRoleToGroupRequest{Request: req, Input: input, Copy: c.AssociateRoleToGroupRequest} } const opAssociateServiceRoleToAccount = "AssociateServiceRoleToAccount" @@ -65,6 +66,7 @@ const opAssociateServiceRoleToAccount = "AssociateServiceRoleToAccount" type AssociateServiceRoleToAccountRequest struct { *aws.Request Input *AssociateServiceRoleToAccountInput + Copy func(*AssociateServiceRoleToAccountInput) AssociateServiceRoleToAccountRequest } // Send marshals and sends the AssociateServiceRoleToAccount API request. @@ -108,7 +110,7 @@ func (c *Greengrass) AssociateServiceRoleToAccountRequest(input *AssociateServic req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateServiceRoleToAccountRequest{Request: req, Input: input} + return AssociateServiceRoleToAccountRequest{Request: req, Input: input, Copy: c.AssociateServiceRoleToAccountRequest} } const opCreateCoreDefinition = "CreateCoreDefinition" @@ -117,6 +119,7 @@ const opCreateCoreDefinition = "CreateCoreDefinition" type CreateCoreDefinitionRequest struct { *aws.Request Input *CreateCoreDefinitionInput + Copy func(*CreateCoreDefinitionInput) CreateCoreDefinitionRequest } // Send marshals and sends the CreateCoreDefinition API request. @@ -159,7 +162,7 @@ func (c *Greengrass) CreateCoreDefinitionRequest(input *CreateCoreDefinitionInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCoreDefinitionRequest{Request: req, Input: input} + return CreateCoreDefinitionRequest{Request: req, Input: input, Copy: c.CreateCoreDefinitionRequest} } const opCreateCoreDefinitionVersion = "CreateCoreDefinitionVersion" @@ -168,6 +171,7 @@ const opCreateCoreDefinitionVersion = "CreateCoreDefinitionVersion" type CreateCoreDefinitionVersionRequest struct { *aws.Request Input *CreateCoreDefinitionVersionInput + Copy func(*CreateCoreDefinitionVersionInput) CreateCoreDefinitionVersionRequest } // Send marshals and sends the CreateCoreDefinitionVersion API request. @@ -209,7 +213,7 @@ func (c *Greengrass) CreateCoreDefinitionVersionRequest(input *CreateCoreDefinit req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCoreDefinitionVersionRequest{Request: req, Input: input} + return CreateCoreDefinitionVersionRequest{Request: req, Input: input, Copy: c.CreateCoreDefinitionVersionRequest} } const opCreateDeployment = "CreateDeployment" @@ -218,6 +222,7 @@ const opCreateDeployment = "CreateDeployment" type CreateDeploymentRequest struct { *aws.Request Input *CreateDeploymentInput + Copy func(*CreateDeploymentInput) CreateDeploymentRequest } // Send marshals and sends the CreateDeployment API request. @@ -258,7 +263,7 @@ func (c *Greengrass) CreateDeploymentRequest(input *CreateDeploymentInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDeploymentRequest{Request: req, Input: input} + return CreateDeploymentRequest{Request: req, Input: input, Copy: c.CreateDeploymentRequest} } const opCreateDeviceDefinition = "CreateDeviceDefinition" @@ -267,6 +272,7 @@ const opCreateDeviceDefinition = "CreateDeviceDefinition" type CreateDeviceDefinitionRequest struct { *aws.Request Input *CreateDeviceDefinitionInput + Copy func(*CreateDeviceDefinitionInput) CreateDeviceDefinitionRequest } // Send marshals and sends the CreateDeviceDefinition API request. @@ -309,7 +315,7 @@ func (c *Greengrass) CreateDeviceDefinitionRequest(input *CreateDeviceDefinition req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDeviceDefinitionRequest{Request: req, Input: input} + return CreateDeviceDefinitionRequest{Request: req, Input: input, Copy: c.CreateDeviceDefinitionRequest} } const opCreateDeviceDefinitionVersion = "CreateDeviceDefinitionVersion" @@ -318,6 +324,7 @@ const opCreateDeviceDefinitionVersion = "CreateDeviceDefinitionVersion" type CreateDeviceDefinitionVersionRequest struct { *aws.Request Input *CreateDeviceDefinitionVersionInput + Copy func(*CreateDeviceDefinitionVersionInput) CreateDeviceDefinitionVersionRequest } // Send marshals and sends the CreateDeviceDefinitionVersion API request. @@ -358,7 +365,7 @@ func (c *Greengrass) CreateDeviceDefinitionVersionRequest(input *CreateDeviceDef req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDeviceDefinitionVersionRequest{Request: req, Input: input} + return CreateDeviceDefinitionVersionRequest{Request: req, Input: input, Copy: c.CreateDeviceDefinitionVersionRequest} } const opCreateFunctionDefinition = "CreateFunctionDefinition" @@ -367,6 +374,7 @@ const opCreateFunctionDefinition = "CreateFunctionDefinition" type CreateFunctionDefinitionRequest struct { *aws.Request Input *CreateFunctionDefinitionInput + Copy func(*CreateFunctionDefinitionInput) CreateFunctionDefinitionRequest } // Send marshals and sends the CreateFunctionDefinition API request. @@ -410,7 +418,7 @@ func (c *Greengrass) CreateFunctionDefinitionRequest(input *CreateFunctionDefini req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFunctionDefinitionRequest{Request: req, Input: input} + return CreateFunctionDefinitionRequest{Request: req, Input: input, Copy: c.CreateFunctionDefinitionRequest} } const opCreateFunctionDefinitionVersion = "CreateFunctionDefinitionVersion" @@ -419,6 +427,7 @@ const opCreateFunctionDefinitionVersion = "CreateFunctionDefinitionVersion" type CreateFunctionDefinitionVersionRequest struct { *aws.Request Input *CreateFunctionDefinitionVersionInput + Copy func(*CreateFunctionDefinitionVersionInput) CreateFunctionDefinitionVersionRequest } // Send marshals and sends the CreateFunctionDefinitionVersion API request. @@ -459,7 +468,7 @@ func (c *Greengrass) CreateFunctionDefinitionVersionRequest(input *CreateFunctio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFunctionDefinitionVersionRequest{Request: req, Input: input} + return CreateFunctionDefinitionVersionRequest{Request: req, Input: input, Copy: c.CreateFunctionDefinitionVersionRequest} } const opCreateGroup = "CreateGroup" @@ -468,6 +477,7 @@ const opCreateGroup = "CreateGroup" type CreateGroupRequest struct { *aws.Request Input *CreateGroupInput + Copy func(*CreateGroupInput) CreateGroupRequest } // Send marshals and sends the CreateGroup API request. @@ -509,7 +519,7 @@ func (c *Greengrass) CreateGroupRequest(input *CreateGroupInput) CreateGroupRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGroupRequest{Request: req, Input: input} + return CreateGroupRequest{Request: req, Input: input, Copy: c.CreateGroupRequest} } const opCreateGroupCertificateAuthority = "CreateGroupCertificateAuthority" @@ -518,6 +528,7 @@ const opCreateGroupCertificateAuthority = "CreateGroupCertificateAuthority" type CreateGroupCertificateAuthorityRequest struct { *aws.Request Input *CreateGroupCertificateAuthorityInput + Copy func(*CreateGroupCertificateAuthorityInput) CreateGroupCertificateAuthorityRequest } // Send marshals and sends the CreateGroupCertificateAuthority API request. @@ -559,7 +570,7 @@ func (c *Greengrass) CreateGroupCertificateAuthorityRequest(input *CreateGroupCe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGroupCertificateAuthorityRequest{Request: req, Input: input} + return CreateGroupCertificateAuthorityRequest{Request: req, Input: input, Copy: c.CreateGroupCertificateAuthorityRequest} } const opCreateGroupVersion = "CreateGroupVersion" @@ -568,6 +579,7 @@ const opCreateGroupVersion = "CreateGroupVersion" type CreateGroupVersionRequest struct { *aws.Request Input *CreateGroupVersionInput + Copy func(*CreateGroupVersionInput) CreateGroupVersionRequest } // Send marshals and sends the CreateGroupVersion API request. @@ -608,7 +620,7 @@ func (c *Greengrass) CreateGroupVersionRequest(input *CreateGroupVersionInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGroupVersionRequest{Request: req, Input: input} + return CreateGroupVersionRequest{Request: req, Input: input, Copy: c.CreateGroupVersionRequest} } const opCreateLoggerDefinition = "CreateLoggerDefinition" @@ -617,6 +629,7 @@ const opCreateLoggerDefinition = "CreateLoggerDefinition" type CreateLoggerDefinitionRequest struct { *aws.Request Input *CreateLoggerDefinitionInput + Copy func(*CreateLoggerDefinitionInput) CreateLoggerDefinitionRequest } // Send marshals and sends the CreateLoggerDefinition API request. @@ -659,7 +672,7 @@ func (c *Greengrass) CreateLoggerDefinitionRequest(input *CreateLoggerDefinition req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLoggerDefinitionRequest{Request: req, Input: input} + return CreateLoggerDefinitionRequest{Request: req, Input: input, Copy: c.CreateLoggerDefinitionRequest} } const opCreateLoggerDefinitionVersion = "CreateLoggerDefinitionVersion" @@ -668,6 +681,7 @@ const opCreateLoggerDefinitionVersion = "CreateLoggerDefinitionVersion" type CreateLoggerDefinitionVersionRequest struct { *aws.Request Input *CreateLoggerDefinitionVersionInput + Copy func(*CreateLoggerDefinitionVersionInput) CreateLoggerDefinitionVersionRequest } // Send marshals and sends the CreateLoggerDefinitionVersion API request. @@ -708,7 +722,7 @@ func (c *Greengrass) CreateLoggerDefinitionVersionRequest(input *CreateLoggerDef req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLoggerDefinitionVersionRequest{Request: req, Input: input} + return CreateLoggerDefinitionVersionRequest{Request: req, Input: input, Copy: c.CreateLoggerDefinitionVersionRequest} } const opCreateResourceDefinition = "CreateResourceDefinition" @@ -717,6 +731,7 @@ const opCreateResourceDefinition = "CreateResourceDefinition" type CreateResourceDefinitionRequest struct { *aws.Request Input *CreateResourceDefinitionInput + Copy func(*CreateResourceDefinitionInput) CreateResourceDefinitionRequest } // Send marshals and sends the CreateResourceDefinition API request. @@ -759,7 +774,7 @@ func (c *Greengrass) CreateResourceDefinitionRequest(input *CreateResourceDefini req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateResourceDefinitionRequest{Request: req, Input: input} + return CreateResourceDefinitionRequest{Request: req, Input: input, Copy: c.CreateResourceDefinitionRequest} } const opCreateResourceDefinitionVersion = "CreateResourceDefinitionVersion" @@ -768,6 +783,7 @@ const opCreateResourceDefinitionVersion = "CreateResourceDefinitionVersion" type CreateResourceDefinitionVersionRequest struct { *aws.Request Input *CreateResourceDefinitionVersionInput + Copy func(*CreateResourceDefinitionVersionInput) CreateResourceDefinitionVersionRequest } // Send marshals and sends the CreateResourceDefinitionVersion API request. @@ -808,7 +824,7 @@ func (c *Greengrass) CreateResourceDefinitionVersionRequest(input *CreateResourc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateResourceDefinitionVersionRequest{Request: req, Input: input} + return CreateResourceDefinitionVersionRequest{Request: req, Input: input, Copy: c.CreateResourceDefinitionVersionRequest} } const opCreateSoftwareUpdateJob = "CreateSoftwareUpdateJob" @@ -817,6 +833,7 @@ const opCreateSoftwareUpdateJob = "CreateSoftwareUpdateJob" type CreateSoftwareUpdateJobRequest struct { *aws.Request Input *CreateSoftwareUpdateJobInput + Copy func(*CreateSoftwareUpdateJobInput) CreateSoftwareUpdateJobRequest } // Send marshals and sends the CreateSoftwareUpdateJob API request. @@ -858,7 +875,7 @@ func (c *Greengrass) CreateSoftwareUpdateJobRequest(input *CreateSoftwareUpdateJ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSoftwareUpdateJobRequest{Request: req, Input: input} + return CreateSoftwareUpdateJobRequest{Request: req, Input: input, Copy: c.CreateSoftwareUpdateJobRequest} } const opCreateSubscriptionDefinition = "CreateSubscriptionDefinition" @@ -867,6 +884,7 @@ const opCreateSubscriptionDefinition = "CreateSubscriptionDefinition" type CreateSubscriptionDefinitionRequest struct { *aws.Request Input *CreateSubscriptionDefinitionInput + Copy func(*CreateSubscriptionDefinitionInput) CreateSubscriptionDefinitionRequest } // Send marshals and sends the CreateSubscriptionDefinition API request. @@ -909,7 +927,7 @@ func (c *Greengrass) CreateSubscriptionDefinitionRequest(input *CreateSubscripti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSubscriptionDefinitionRequest{Request: req, Input: input} + return CreateSubscriptionDefinitionRequest{Request: req, Input: input, Copy: c.CreateSubscriptionDefinitionRequest} } const opCreateSubscriptionDefinitionVersion = "CreateSubscriptionDefinitionVersion" @@ -918,6 +936,7 @@ const opCreateSubscriptionDefinitionVersion = "CreateSubscriptionDefinitionVersi type CreateSubscriptionDefinitionVersionRequest struct { *aws.Request Input *CreateSubscriptionDefinitionVersionInput + Copy func(*CreateSubscriptionDefinitionVersionInput) CreateSubscriptionDefinitionVersionRequest } // Send marshals and sends the CreateSubscriptionDefinitionVersion API request. @@ -958,7 +977,7 @@ func (c *Greengrass) CreateSubscriptionDefinitionVersionRequest(input *CreateSub req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSubscriptionDefinitionVersionRequest{Request: req, Input: input} + return CreateSubscriptionDefinitionVersionRequest{Request: req, Input: input, Copy: c.CreateSubscriptionDefinitionVersionRequest} } const opDeleteCoreDefinition = "DeleteCoreDefinition" @@ -967,6 +986,7 @@ const opDeleteCoreDefinition = "DeleteCoreDefinition" type DeleteCoreDefinitionRequest struct { *aws.Request Input *DeleteCoreDefinitionInput + Copy func(*DeleteCoreDefinitionInput) DeleteCoreDefinitionRequest } // Send marshals and sends the DeleteCoreDefinition API request. @@ -1008,7 +1028,7 @@ func (c *Greengrass) DeleteCoreDefinitionRequest(input *DeleteCoreDefinitionInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteCoreDefinitionRequest{Request: req, Input: input} + return DeleteCoreDefinitionRequest{Request: req, Input: input, Copy: c.DeleteCoreDefinitionRequest} } const opDeleteDeviceDefinition = "DeleteDeviceDefinition" @@ -1017,6 +1037,7 @@ const opDeleteDeviceDefinition = "DeleteDeviceDefinition" type DeleteDeviceDefinitionRequest struct { *aws.Request Input *DeleteDeviceDefinitionInput + Copy func(*DeleteDeviceDefinitionInput) DeleteDeviceDefinitionRequest } // Send marshals and sends the DeleteDeviceDefinition API request. @@ -1058,7 +1079,7 @@ func (c *Greengrass) DeleteDeviceDefinitionRequest(input *DeleteDeviceDefinition req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDeviceDefinitionRequest{Request: req, Input: input} + return DeleteDeviceDefinitionRequest{Request: req, Input: input, Copy: c.DeleteDeviceDefinitionRequest} } const opDeleteFunctionDefinition = "DeleteFunctionDefinition" @@ -1067,6 +1088,7 @@ const opDeleteFunctionDefinition = "DeleteFunctionDefinition" type DeleteFunctionDefinitionRequest struct { *aws.Request Input *DeleteFunctionDefinitionInput + Copy func(*DeleteFunctionDefinitionInput) DeleteFunctionDefinitionRequest } // Send marshals and sends the DeleteFunctionDefinition API request. @@ -1108,7 +1130,7 @@ func (c *Greengrass) DeleteFunctionDefinitionRequest(input *DeleteFunctionDefini req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteFunctionDefinitionRequest{Request: req, Input: input} + return DeleteFunctionDefinitionRequest{Request: req, Input: input, Copy: c.DeleteFunctionDefinitionRequest} } const opDeleteGroup = "DeleteGroup" @@ -1117,6 +1139,7 @@ const opDeleteGroup = "DeleteGroup" type DeleteGroupRequest struct { *aws.Request Input *DeleteGroupInput + Copy func(*DeleteGroupInput) DeleteGroupRequest } // Send marshals and sends the DeleteGroup API request. @@ -1157,7 +1180,7 @@ func (c *Greengrass) DeleteGroupRequest(input *DeleteGroupInput) DeleteGroupRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGroupRequest{Request: req, Input: input} + return DeleteGroupRequest{Request: req, Input: input, Copy: c.DeleteGroupRequest} } const opDeleteLoggerDefinition = "DeleteLoggerDefinition" @@ -1166,6 +1189,7 @@ const opDeleteLoggerDefinition = "DeleteLoggerDefinition" type DeleteLoggerDefinitionRequest struct { *aws.Request Input *DeleteLoggerDefinitionInput + Copy func(*DeleteLoggerDefinitionInput) DeleteLoggerDefinitionRequest } // Send marshals and sends the DeleteLoggerDefinition API request. @@ -1207,7 +1231,7 @@ func (c *Greengrass) DeleteLoggerDefinitionRequest(input *DeleteLoggerDefinition req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLoggerDefinitionRequest{Request: req, Input: input} + return DeleteLoggerDefinitionRequest{Request: req, Input: input, Copy: c.DeleteLoggerDefinitionRequest} } const opDeleteResourceDefinition = "DeleteResourceDefinition" @@ -1216,6 +1240,7 @@ const opDeleteResourceDefinition = "DeleteResourceDefinition" type DeleteResourceDefinitionRequest struct { *aws.Request Input *DeleteResourceDefinitionInput + Copy func(*DeleteResourceDefinitionInput) DeleteResourceDefinitionRequest } // Send marshals and sends the DeleteResourceDefinition API request. @@ -1256,7 +1281,7 @@ func (c *Greengrass) DeleteResourceDefinitionRequest(input *DeleteResourceDefini req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteResourceDefinitionRequest{Request: req, Input: input} + return DeleteResourceDefinitionRequest{Request: req, Input: input, Copy: c.DeleteResourceDefinitionRequest} } const opDeleteSubscriptionDefinition = "DeleteSubscriptionDefinition" @@ -1265,6 +1290,7 @@ const opDeleteSubscriptionDefinition = "DeleteSubscriptionDefinition" type DeleteSubscriptionDefinitionRequest struct { *aws.Request Input *DeleteSubscriptionDefinitionInput + Copy func(*DeleteSubscriptionDefinitionInput) DeleteSubscriptionDefinitionRequest } // Send marshals and sends the DeleteSubscriptionDefinition API request. @@ -1306,7 +1332,7 @@ func (c *Greengrass) DeleteSubscriptionDefinitionRequest(input *DeleteSubscripti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSubscriptionDefinitionRequest{Request: req, Input: input} + return DeleteSubscriptionDefinitionRequest{Request: req, Input: input, Copy: c.DeleteSubscriptionDefinitionRequest} } const opDisassociateRoleFromGroup = "DisassociateRoleFromGroup" @@ -1315,6 +1341,7 @@ const opDisassociateRoleFromGroup = "DisassociateRoleFromGroup" type DisassociateRoleFromGroupRequest struct { *aws.Request Input *DisassociateRoleFromGroupInput + Copy func(*DisassociateRoleFromGroupInput) DisassociateRoleFromGroupRequest } // Send marshals and sends the DisassociateRoleFromGroup API request. @@ -1355,7 +1382,7 @@ func (c *Greengrass) DisassociateRoleFromGroupRequest(input *DisassociateRoleFro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateRoleFromGroupRequest{Request: req, Input: input} + return DisassociateRoleFromGroupRequest{Request: req, Input: input, Copy: c.DisassociateRoleFromGroupRequest} } const opDisassociateServiceRoleFromAccount = "DisassociateServiceRoleFromAccount" @@ -1364,6 +1391,7 @@ const opDisassociateServiceRoleFromAccount = "DisassociateServiceRoleFromAccount type DisassociateServiceRoleFromAccountRequest struct { *aws.Request Input *DisassociateServiceRoleFromAccountInput + Copy func(*DisassociateServiceRoleFromAccountInput) DisassociateServiceRoleFromAccountRequest } // Send marshals and sends the DisassociateServiceRoleFromAccount API request. @@ -1405,7 +1433,7 @@ func (c *Greengrass) DisassociateServiceRoleFromAccountRequest(input *Disassocia req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateServiceRoleFromAccountRequest{Request: req, Input: input} + return DisassociateServiceRoleFromAccountRequest{Request: req, Input: input, Copy: c.DisassociateServiceRoleFromAccountRequest} } const opGetAssociatedRole = "GetAssociatedRole" @@ -1414,6 +1442,7 @@ const opGetAssociatedRole = "GetAssociatedRole" type GetAssociatedRoleRequest struct { *aws.Request Input *GetAssociatedRoleInput + Copy func(*GetAssociatedRoleInput) GetAssociatedRoleRequest } // Send marshals and sends the GetAssociatedRole API request. @@ -1454,7 +1483,7 @@ func (c *Greengrass) GetAssociatedRoleRequest(input *GetAssociatedRoleInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAssociatedRoleRequest{Request: req, Input: input} + return GetAssociatedRoleRequest{Request: req, Input: input, Copy: c.GetAssociatedRoleRequest} } const opGetConnectivityInfo = "GetConnectivityInfo" @@ -1463,6 +1492,7 @@ const opGetConnectivityInfo = "GetConnectivityInfo" type GetConnectivityInfoRequest struct { *aws.Request Input *GetConnectivityInfoInput + Copy func(*GetConnectivityInfoInput) GetConnectivityInfoRequest } // Send marshals and sends the GetConnectivityInfo API request. @@ -1503,7 +1533,7 @@ func (c *Greengrass) GetConnectivityInfoRequest(input *GetConnectivityInfoInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetConnectivityInfoRequest{Request: req, Input: input} + return GetConnectivityInfoRequest{Request: req, Input: input, Copy: c.GetConnectivityInfoRequest} } const opGetCoreDefinition = "GetCoreDefinition" @@ -1512,6 +1542,7 @@ const opGetCoreDefinition = "GetCoreDefinition" type GetCoreDefinitionRequest struct { *aws.Request Input *GetCoreDefinitionInput + Copy func(*GetCoreDefinitionInput) GetCoreDefinitionRequest } // Send marshals and sends the GetCoreDefinition API request. @@ -1552,7 +1583,7 @@ func (c *Greengrass) GetCoreDefinitionRequest(input *GetCoreDefinitionInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCoreDefinitionRequest{Request: req, Input: input} + return GetCoreDefinitionRequest{Request: req, Input: input, Copy: c.GetCoreDefinitionRequest} } const opGetCoreDefinitionVersion = "GetCoreDefinitionVersion" @@ -1561,6 +1592,7 @@ const opGetCoreDefinitionVersion = "GetCoreDefinitionVersion" type GetCoreDefinitionVersionRequest struct { *aws.Request Input *GetCoreDefinitionVersionInput + Copy func(*GetCoreDefinitionVersionInput) GetCoreDefinitionVersionRequest } // Send marshals and sends the GetCoreDefinitionVersion API request. @@ -1601,7 +1633,7 @@ func (c *Greengrass) GetCoreDefinitionVersionRequest(input *GetCoreDefinitionVer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCoreDefinitionVersionRequest{Request: req, Input: input} + return GetCoreDefinitionVersionRequest{Request: req, Input: input, Copy: c.GetCoreDefinitionVersionRequest} } const opGetDeploymentStatus = "GetDeploymentStatus" @@ -1610,6 +1642,7 @@ const opGetDeploymentStatus = "GetDeploymentStatus" type GetDeploymentStatusRequest struct { *aws.Request Input *GetDeploymentStatusInput + Copy func(*GetDeploymentStatusInput) GetDeploymentStatusRequest } // Send marshals and sends the GetDeploymentStatus API request. @@ -1650,7 +1683,7 @@ func (c *Greengrass) GetDeploymentStatusRequest(input *GetDeploymentStatusInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeploymentStatusRequest{Request: req, Input: input} + return GetDeploymentStatusRequest{Request: req, Input: input, Copy: c.GetDeploymentStatusRequest} } const opGetDeviceDefinition = "GetDeviceDefinition" @@ -1659,6 +1692,7 @@ const opGetDeviceDefinition = "GetDeviceDefinition" type GetDeviceDefinitionRequest struct { *aws.Request Input *GetDeviceDefinitionInput + Copy func(*GetDeviceDefinitionInput) GetDeviceDefinitionRequest } // Send marshals and sends the GetDeviceDefinition API request. @@ -1699,7 +1733,7 @@ func (c *Greengrass) GetDeviceDefinitionRequest(input *GetDeviceDefinitionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeviceDefinitionRequest{Request: req, Input: input} + return GetDeviceDefinitionRequest{Request: req, Input: input, Copy: c.GetDeviceDefinitionRequest} } const opGetDeviceDefinitionVersion = "GetDeviceDefinitionVersion" @@ -1708,6 +1742,7 @@ const opGetDeviceDefinitionVersion = "GetDeviceDefinitionVersion" type GetDeviceDefinitionVersionRequest struct { *aws.Request Input *GetDeviceDefinitionVersionInput + Copy func(*GetDeviceDefinitionVersionInput) GetDeviceDefinitionVersionRequest } // Send marshals and sends the GetDeviceDefinitionVersion API request. @@ -1748,7 +1783,7 @@ func (c *Greengrass) GetDeviceDefinitionVersionRequest(input *GetDeviceDefinitio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeviceDefinitionVersionRequest{Request: req, Input: input} + return GetDeviceDefinitionVersionRequest{Request: req, Input: input, Copy: c.GetDeviceDefinitionVersionRequest} } const opGetFunctionDefinition = "GetFunctionDefinition" @@ -1757,6 +1792,7 @@ const opGetFunctionDefinition = "GetFunctionDefinition" type GetFunctionDefinitionRequest struct { *aws.Request Input *GetFunctionDefinitionInput + Copy func(*GetFunctionDefinitionInput) GetFunctionDefinitionRequest } // Send marshals and sends the GetFunctionDefinition API request. @@ -1798,7 +1834,7 @@ func (c *Greengrass) GetFunctionDefinitionRequest(input *GetFunctionDefinitionIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFunctionDefinitionRequest{Request: req, Input: input} + return GetFunctionDefinitionRequest{Request: req, Input: input, Copy: c.GetFunctionDefinitionRequest} } const opGetFunctionDefinitionVersion = "GetFunctionDefinitionVersion" @@ -1807,6 +1843,7 @@ const opGetFunctionDefinitionVersion = "GetFunctionDefinitionVersion" type GetFunctionDefinitionVersionRequest struct { *aws.Request Input *GetFunctionDefinitionVersionInput + Copy func(*GetFunctionDefinitionVersionInput) GetFunctionDefinitionVersionRequest } // Send marshals and sends the GetFunctionDefinitionVersion API request. @@ -1848,7 +1885,7 @@ func (c *Greengrass) GetFunctionDefinitionVersionRequest(input *GetFunctionDefin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFunctionDefinitionVersionRequest{Request: req, Input: input} + return GetFunctionDefinitionVersionRequest{Request: req, Input: input, Copy: c.GetFunctionDefinitionVersionRequest} } const opGetGroup = "GetGroup" @@ -1857,6 +1894,7 @@ const opGetGroup = "GetGroup" type GetGroupRequest struct { *aws.Request Input *GetGroupInput + Copy func(*GetGroupInput) GetGroupRequest } // Send marshals and sends the GetGroup API request. @@ -1897,7 +1935,7 @@ func (c *Greengrass) GetGroupRequest(input *GetGroupInput) GetGroupRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGroupRequest{Request: req, Input: input} + return GetGroupRequest{Request: req, Input: input, Copy: c.GetGroupRequest} } const opGetGroupCertificateAuthority = "GetGroupCertificateAuthority" @@ -1906,6 +1944,7 @@ const opGetGroupCertificateAuthority = "GetGroupCertificateAuthority" type GetGroupCertificateAuthorityRequest struct { *aws.Request Input *GetGroupCertificateAuthorityInput + Copy func(*GetGroupCertificateAuthorityInput) GetGroupCertificateAuthorityRequest } // Send marshals and sends the GetGroupCertificateAuthority API request. @@ -1946,7 +1985,7 @@ func (c *Greengrass) GetGroupCertificateAuthorityRequest(input *GetGroupCertific req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGroupCertificateAuthorityRequest{Request: req, Input: input} + return GetGroupCertificateAuthorityRequest{Request: req, Input: input, Copy: c.GetGroupCertificateAuthorityRequest} } const opGetGroupCertificateConfiguration = "GetGroupCertificateConfiguration" @@ -1955,6 +1994,7 @@ const opGetGroupCertificateConfiguration = "GetGroupCertificateConfiguration" type GetGroupCertificateConfigurationRequest struct { *aws.Request Input *GetGroupCertificateConfigurationInput + Copy func(*GetGroupCertificateConfigurationInput) GetGroupCertificateConfigurationRequest } // Send marshals and sends the GetGroupCertificateConfiguration API request. @@ -1995,7 +2035,7 @@ func (c *Greengrass) GetGroupCertificateConfigurationRequest(input *GetGroupCert req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGroupCertificateConfigurationRequest{Request: req, Input: input} + return GetGroupCertificateConfigurationRequest{Request: req, Input: input, Copy: c.GetGroupCertificateConfigurationRequest} } const opGetGroupVersion = "GetGroupVersion" @@ -2004,6 +2044,7 @@ const opGetGroupVersion = "GetGroupVersion" type GetGroupVersionRequest struct { *aws.Request Input *GetGroupVersionInput + Copy func(*GetGroupVersionInput) GetGroupVersionRequest } // Send marshals and sends the GetGroupVersion API request. @@ -2044,7 +2085,7 @@ func (c *Greengrass) GetGroupVersionRequest(input *GetGroupVersionInput) GetGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGroupVersionRequest{Request: req, Input: input} + return GetGroupVersionRequest{Request: req, Input: input, Copy: c.GetGroupVersionRequest} } const opGetLoggerDefinition = "GetLoggerDefinition" @@ -2053,6 +2094,7 @@ const opGetLoggerDefinition = "GetLoggerDefinition" type GetLoggerDefinitionRequest struct { *aws.Request Input *GetLoggerDefinitionInput + Copy func(*GetLoggerDefinitionInput) GetLoggerDefinitionRequest } // Send marshals and sends the GetLoggerDefinition API request. @@ -2093,7 +2135,7 @@ func (c *Greengrass) GetLoggerDefinitionRequest(input *GetLoggerDefinitionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLoggerDefinitionRequest{Request: req, Input: input} + return GetLoggerDefinitionRequest{Request: req, Input: input, Copy: c.GetLoggerDefinitionRequest} } const opGetLoggerDefinitionVersion = "GetLoggerDefinitionVersion" @@ -2102,6 +2144,7 @@ const opGetLoggerDefinitionVersion = "GetLoggerDefinitionVersion" type GetLoggerDefinitionVersionRequest struct { *aws.Request Input *GetLoggerDefinitionVersionInput + Copy func(*GetLoggerDefinitionVersionInput) GetLoggerDefinitionVersionRequest } // Send marshals and sends the GetLoggerDefinitionVersion API request. @@ -2142,7 +2185,7 @@ func (c *Greengrass) GetLoggerDefinitionVersionRequest(input *GetLoggerDefinitio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLoggerDefinitionVersionRequest{Request: req, Input: input} + return GetLoggerDefinitionVersionRequest{Request: req, Input: input, Copy: c.GetLoggerDefinitionVersionRequest} } const opGetResourceDefinition = "GetResourceDefinition" @@ -2151,6 +2194,7 @@ const opGetResourceDefinition = "GetResourceDefinition" type GetResourceDefinitionRequest struct { *aws.Request Input *GetResourceDefinitionInput + Copy func(*GetResourceDefinitionInput) GetResourceDefinitionRequest } // Send marshals and sends the GetResourceDefinition API request. @@ -2192,7 +2236,7 @@ func (c *Greengrass) GetResourceDefinitionRequest(input *GetResourceDefinitionIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetResourceDefinitionRequest{Request: req, Input: input} + return GetResourceDefinitionRequest{Request: req, Input: input, Copy: c.GetResourceDefinitionRequest} } const opGetResourceDefinitionVersion = "GetResourceDefinitionVersion" @@ -2201,6 +2245,7 @@ const opGetResourceDefinitionVersion = "GetResourceDefinitionVersion" type GetResourceDefinitionVersionRequest struct { *aws.Request Input *GetResourceDefinitionVersionInput + Copy func(*GetResourceDefinitionVersionInput) GetResourceDefinitionVersionRequest } // Send marshals and sends the GetResourceDefinitionVersion API request. @@ -2242,7 +2287,7 @@ func (c *Greengrass) GetResourceDefinitionVersionRequest(input *GetResourceDefin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetResourceDefinitionVersionRequest{Request: req, Input: input} + return GetResourceDefinitionVersionRequest{Request: req, Input: input, Copy: c.GetResourceDefinitionVersionRequest} } const opGetServiceRoleForAccount = "GetServiceRoleForAccount" @@ -2251,6 +2296,7 @@ const opGetServiceRoleForAccount = "GetServiceRoleForAccount" type GetServiceRoleForAccountRequest struct { *aws.Request Input *GetServiceRoleForAccountInput + Copy func(*GetServiceRoleForAccountInput) GetServiceRoleForAccountRequest } // Send marshals and sends the GetServiceRoleForAccount API request. @@ -2291,7 +2337,7 @@ func (c *Greengrass) GetServiceRoleForAccountRequest(input *GetServiceRoleForAcc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetServiceRoleForAccountRequest{Request: req, Input: input} + return GetServiceRoleForAccountRequest{Request: req, Input: input, Copy: c.GetServiceRoleForAccountRequest} } const opGetSubscriptionDefinition = "GetSubscriptionDefinition" @@ -2300,6 +2346,7 @@ const opGetSubscriptionDefinition = "GetSubscriptionDefinition" type GetSubscriptionDefinitionRequest struct { *aws.Request Input *GetSubscriptionDefinitionInput + Copy func(*GetSubscriptionDefinitionInput) GetSubscriptionDefinitionRequest } // Send marshals and sends the GetSubscriptionDefinition API request. @@ -2340,7 +2387,7 @@ func (c *Greengrass) GetSubscriptionDefinitionRequest(input *GetSubscriptionDefi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSubscriptionDefinitionRequest{Request: req, Input: input} + return GetSubscriptionDefinitionRequest{Request: req, Input: input, Copy: c.GetSubscriptionDefinitionRequest} } const opGetSubscriptionDefinitionVersion = "GetSubscriptionDefinitionVersion" @@ -2349,6 +2396,7 @@ const opGetSubscriptionDefinitionVersion = "GetSubscriptionDefinitionVersion" type GetSubscriptionDefinitionVersionRequest struct { *aws.Request Input *GetSubscriptionDefinitionVersionInput + Copy func(*GetSubscriptionDefinitionVersionInput) GetSubscriptionDefinitionVersionRequest } // Send marshals and sends the GetSubscriptionDefinitionVersion API request. @@ -2389,7 +2437,7 @@ func (c *Greengrass) GetSubscriptionDefinitionVersionRequest(input *GetSubscript req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSubscriptionDefinitionVersionRequest{Request: req, Input: input} + return GetSubscriptionDefinitionVersionRequest{Request: req, Input: input, Copy: c.GetSubscriptionDefinitionVersionRequest} } const opListCoreDefinitionVersions = "ListCoreDefinitionVersions" @@ -2398,6 +2446,7 @@ const opListCoreDefinitionVersions = "ListCoreDefinitionVersions" type ListCoreDefinitionVersionsRequest struct { *aws.Request Input *ListCoreDefinitionVersionsInput + Copy func(*ListCoreDefinitionVersionsInput) ListCoreDefinitionVersionsRequest } // Send marshals and sends the ListCoreDefinitionVersions API request. @@ -2438,7 +2487,7 @@ func (c *Greengrass) ListCoreDefinitionVersionsRequest(input *ListCoreDefinition req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCoreDefinitionVersionsRequest{Request: req, Input: input} + return ListCoreDefinitionVersionsRequest{Request: req, Input: input, Copy: c.ListCoreDefinitionVersionsRequest} } const opListCoreDefinitions = "ListCoreDefinitions" @@ -2447,6 +2496,7 @@ const opListCoreDefinitions = "ListCoreDefinitions" type ListCoreDefinitionsRequest struct { *aws.Request Input *ListCoreDefinitionsInput + Copy func(*ListCoreDefinitionsInput) ListCoreDefinitionsRequest } // Send marshals and sends the ListCoreDefinitions API request. @@ -2487,7 +2537,7 @@ func (c *Greengrass) ListCoreDefinitionsRequest(input *ListCoreDefinitionsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCoreDefinitionsRequest{Request: req, Input: input} + return ListCoreDefinitionsRequest{Request: req, Input: input, Copy: c.ListCoreDefinitionsRequest} } const opListDeployments = "ListDeployments" @@ -2496,6 +2546,7 @@ const opListDeployments = "ListDeployments" type ListDeploymentsRequest struct { *aws.Request Input *ListDeploymentsInput + Copy func(*ListDeploymentsInput) ListDeploymentsRequest } // Send marshals and sends the ListDeployments API request. @@ -2536,7 +2587,7 @@ func (c *Greengrass) ListDeploymentsRequest(input *ListDeploymentsInput) ListDep req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDeploymentsRequest{Request: req, Input: input} + return ListDeploymentsRequest{Request: req, Input: input, Copy: c.ListDeploymentsRequest} } const opListDeviceDefinitionVersions = "ListDeviceDefinitionVersions" @@ -2545,6 +2596,7 @@ const opListDeviceDefinitionVersions = "ListDeviceDefinitionVersions" type ListDeviceDefinitionVersionsRequest struct { *aws.Request Input *ListDeviceDefinitionVersionsInput + Copy func(*ListDeviceDefinitionVersionsInput) ListDeviceDefinitionVersionsRequest } // Send marshals and sends the ListDeviceDefinitionVersions API request. @@ -2585,7 +2637,7 @@ func (c *Greengrass) ListDeviceDefinitionVersionsRequest(input *ListDeviceDefini req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDeviceDefinitionVersionsRequest{Request: req, Input: input} + return ListDeviceDefinitionVersionsRequest{Request: req, Input: input, Copy: c.ListDeviceDefinitionVersionsRequest} } const opListDeviceDefinitions = "ListDeviceDefinitions" @@ -2594,6 +2646,7 @@ const opListDeviceDefinitions = "ListDeviceDefinitions" type ListDeviceDefinitionsRequest struct { *aws.Request Input *ListDeviceDefinitionsInput + Copy func(*ListDeviceDefinitionsInput) ListDeviceDefinitionsRequest } // Send marshals and sends the ListDeviceDefinitions API request. @@ -2634,7 +2687,7 @@ func (c *Greengrass) ListDeviceDefinitionsRequest(input *ListDeviceDefinitionsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDeviceDefinitionsRequest{Request: req, Input: input} + return ListDeviceDefinitionsRequest{Request: req, Input: input, Copy: c.ListDeviceDefinitionsRequest} } const opListFunctionDefinitionVersions = "ListFunctionDefinitionVersions" @@ -2643,6 +2696,7 @@ const opListFunctionDefinitionVersions = "ListFunctionDefinitionVersions" type ListFunctionDefinitionVersionsRequest struct { *aws.Request Input *ListFunctionDefinitionVersionsInput + Copy func(*ListFunctionDefinitionVersionsInput) ListFunctionDefinitionVersionsRequest } // Send marshals and sends the ListFunctionDefinitionVersions API request. @@ -2683,7 +2737,7 @@ func (c *Greengrass) ListFunctionDefinitionVersionsRequest(input *ListFunctionDe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFunctionDefinitionVersionsRequest{Request: req, Input: input} + return ListFunctionDefinitionVersionsRequest{Request: req, Input: input, Copy: c.ListFunctionDefinitionVersionsRequest} } const opListFunctionDefinitions = "ListFunctionDefinitions" @@ -2692,6 +2746,7 @@ const opListFunctionDefinitions = "ListFunctionDefinitions" type ListFunctionDefinitionsRequest struct { *aws.Request Input *ListFunctionDefinitionsInput + Copy func(*ListFunctionDefinitionsInput) ListFunctionDefinitionsRequest } // Send marshals and sends the ListFunctionDefinitions API request. @@ -2732,7 +2787,7 @@ func (c *Greengrass) ListFunctionDefinitionsRequest(input *ListFunctionDefinitio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFunctionDefinitionsRequest{Request: req, Input: input} + return ListFunctionDefinitionsRequest{Request: req, Input: input, Copy: c.ListFunctionDefinitionsRequest} } const opListGroupCertificateAuthorities = "ListGroupCertificateAuthorities" @@ -2741,6 +2796,7 @@ const opListGroupCertificateAuthorities = "ListGroupCertificateAuthorities" type ListGroupCertificateAuthoritiesRequest struct { *aws.Request Input *ListGroupCertificateAuthoritiesInput + Copy func(*ListGroupCertificateAuthoritiesInput) ListGroupCertificateAuthoritiesRequest } // Send marshals and sends the ListGroupCertificateAuthorities API request. @@ -2781,7 +2837,7 @@ func (c *Greengrass) ListGroupCertificateAuthoritiesRequest(input *ListGroupCert req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupCertificateAuthoritiesRequest{Request: req, Input: input} + return ListGroupCertificateAuthoritiesRequest{Request: req, Input: input, Copy: c.ListGroupCertificateAuthoritiesRequest} } const opListGroupVersions = "ListGroupVersions" @@ -2790,6 +2846,7 @@ const opListGroupVersions = "ListGroupVersions" type ListGroupVersionsRequest struct { *aws.Request Input *ListGroupVersionsInput + Copy func(*ListGroupVersionsInput) ListGroupVersionsRequest } // Send marshals and sends the ListGroupVersions API request. @@ -2830,7 +2887,7 @@ func (c *Greengrass) ListGroupVersionsRequest(input *ListGroupVersionsInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupVersionsRequest{Request: req, Input: input} + return ListGroupVersionsRequest{Request: req, Input: input, Copy: c.ListGroupVersionsRequest} } const opListGroups = "ListGroups" @@ -2839,6 +2896,7 @@ const opListGroups = "ListGroups" type ListGroupsRequest struct { *aws.Request Input *ListGroupsInput + Copy func(*ListGroupsInput) ListGroupsRequest } // Send marshals and sends the ListGroups API request. @@ -2879,7 +2937,7 @@ func (c *Greengrass) ListGroupsRequest(input *ListGroupsInput) ListGroupsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupsRequest{Request: req, Input: input} + return ListGroupsRequest{Request: req, Input: input, Copy: c.ListGroupsRequest} } const opListLoggerDefinitionVersions = "ListLoggerDefinitionVersions" @@ -2888,6 +2946,7 @@ const opListLoggerDefinitionVersions = "ListLoggerDefinitionVersions" type ListLoggerDefinitionVersionsRequest struct { *aws.Request Input *ListLoggerDefinitionVersionsInput + Copy func(*ListLoggerDefinitionVersionsInput) ListLoggerDefinitionVersionsRequest } // Send marshals and sends the ListLoggerDefinitionVersions API request. @@ -2928,7 +2987,7 @@ func (c *Greengrass) ListLoggerDefinitionVersionsRequest(input *ListLoggerDefini req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListLoggerDefinitionVersionsRequest{Request: req, Input: input} + return ListLoggerDefinitionVersionsRequest{Request: req, Input: input, Copy: c.ListLoggerDefinitionVersionsRequest} } const opListLoggerDefinitions = "ListLoggerDefinitions" @@ -2937,6 +2996,7 @@ const opListLoggerDefinitions = "ListLoggerDefinitions" type ListLoggerDefinitionsRequest struct { *aws.Request Input *ListLoggerDefinitionsInput + Copy func(*ListLoggerDefinitionsInput) ListLoggerDefinitionsRequest } // Send marshals and sends the ListLoggerDefinitions API request. @@ -2977,7 +3037,7 @@ func (c *Greengrass) ListLoggerDefinitionsRequest(input *ListLoggerDefinitionsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListLoggerDefinitionsRequest{Request: req, Input: input} + return ListLoggerDefinitionsRequest{Request: req, Input: input, Copy: c.ListLoggerDefinitionsRequest} } const opListResourceDefinitionVersions = "ListResourceDefinitionVersions" @@ -2986,6 +3046,7 @@ const opListResourceDefinitionVersions = "ListResourceDefinitionVersions" type ListResourceDefinitionVersionsRequest struct { *aws.Request Input *ListResourceDefinitionVersionsInput + Copy func(*ListResourceDefinitionVersionsInput) ListResourceDefinitionVersionsRequest } // Send marshals and sends the ListResourceDefinitionVersions API request. @@ -3026,7 +3087,7 @@ func (c *Greengrass) ListResourceDefinitionVersionsRequest(input *ListResourceDe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourceDefinitionVersionsRequest{Request: req, Input: input} + return ListResourceDefinitionVersionsRequest{Request: req, Input: input, Copy: c.ListResourceDefinitionVersionsRequest} } const opListResourceDefinitions = "ListResourceDefinitions" @@ -3035,6 +3096,7 @@ const opListResourceDefinitions = "ListResourceDefinitions" type ListResourceDefinitionsRequest struct { *aws.Request Input *ListResourceDefinitionsInput + Copy func(*ListResourceDefinitionsInput) ListResourceDefinitionsRequest } // Send marshals and sends the ListResourceDefinitions API request. @@ -3075,7 +3137,7 @@ func (c *Greengrass) ListResourceDefinitionsRequest(input *ListResourceDefinitio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourceDefinitionsRequest{Request: req, Input: input} + return ListResourceDefinitionsRequest{Request: req, Input: input, Copy: c.ListResourceDefinitionsRequest} } const opListSubscriptionDefinitionVersions = "ListSubscriptionDefinitionVersions" @@ -3084,6 +3146,7 @@ const opListSubscriptionDefinitionVersions = "ListSubscriptionDefinitionVersions type ListSubscriptionDefinitionVersionsRequest struct { *aws.Request Input *ListSubscriptionDefinitionVersionsInput + Copy func(*ListSubscriptionDefinitionVersionsInput) ListSubscriptionDefinitionVersionsRequest } // Send marshals and sends the ListSubscriptionDefinitionVersions API request. @@ -3124,7 +3187,7 @@ func (c *Greengrass) ListSubscriptionDefinitionVersionsRequest(input *ListSubscr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSubscriptionDefinitionVersionsRequest{Request: req, Input: input} + return ListSubscriptionDefinitionVersionsRequest{Request: req, Input: input, Copy: c.ListSubscriptionDefinitionVersionsRequest} } const opListSubscriptionDefinitions = "ListSubscriptionDefinitions" @@ -3133,6 +3196,7 @@ const opListSubscriptionDefinitions = "ListSubscriptionDefinitions" type ListSubscriptionDefinitionsRequest struct { *aws.Request Input *ListSubscriptionDefinitionsInput + Copy func(*ListSubscriptionDefinitionsInput) ListSubscriptionDefinitionsRequest } // Send marshals and sends the ListSubscriptionDefinitions API request. @@ -3173,7 +3237,7 @@ func (c *Greengrass) ListSubscriptionDefinitionsRequest(input *ListSubscriptionD req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSubscriptionDefinitionsRequest{Request: req, Input: input} + return ListSubscriptionDefinitionsRequest{Request: req, Input: input, Copy: c.ListSubscriptionDefinitionsRequest} } const opResetDeployments = "ResetDeployments" @@ -3182,6 +3246,7 @@ const opResetDeployments = "ResetDeployments" type ResetDeploymentsRequest struct { *aws.Request Input *ResetDeploymentsInput + Copy func(*ResetDeploymentsInput) ResetDeploymentsRequest } // Send marshals and sends the ResetDeployments API request. @@ -3222,7 +3287,7 @@ func (c *Greengrass) ResetDeploymentsRequest(input *ResetDeploymentsInput) Reset req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetDeploymentsRequest{Request: req, Input: input} + return ResetDeploymentsRequest{Request: req, Input: input, Copy: c.ResetDeploymentsRequest} } const opUpdateConnectivityInfo = "UpdateConnectivityInfo" @@ -3231,6 +3296,7 @@ const opUpdateConnectivityInfo = "UpdateConnectivityInfo" type UpdateConnectivityInfoRequest struct { *aws.Request Input *UpdateConnectivityInfoInput + Copy func(*UpdateConnectivityInfoInput) UpdateConnectivityInfoRequest } // Send marshals and sends the UpdateConnectivityInfo API request. @@ -3273,7 +3339,7 @@ func (c *Greengrass) UpdateConnectivityInfoRequest(input *UpdateConnectivityInfo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateConnectivityInfoRequest{Request: req, Input: input} + return UpdateConnectivityInfoRequest{Request: req, Input: input, Copy: c.UpdateConnectivityInfoRequest} } const opUpdateCoreDefinition = "UpdateCoreDefinition" @@ -3282,6 +3348,7 @@ const opUpdateCoreDefinition = "UpdateCoreDefinition" type UpdateCoreDefinitionRequest struct { *aws.Request Input *UpdateCoreDefinitionInput + Copy func(*UpdateCoreDefinitionInput) UpdateCoreDefinitionRequest } // Send marshals and sends the UpdateCoreDefinition API request. @@ -3322,7 +3389,7 @@ func (c *Greengrass) UpdateCoreDefinitionRequest(input *UpdateCoreDefinitionInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateCoreDefinitionRequest{Request: req, Input: input} + return UpdateCoreDefinitionRequest{Request: req, Input: input, Copy: c.UpdateCoreDefinitionRequest} } const opUpdateDeviceDefinition = "UpdateDeviceDefinition" @@ -3331,6 +3398,7 @@ const opUpdateDeviceDefinition = "UpdateDeviceDefinition" type UpdateDeviceDefinitionRequest struct { *aws.Request Input *UpdateDeviceDefinitionInput + Copy func(*UpdateDeviceDefinitionInput) UpdateDeviceDefinitionRequest } // Send marshals and sends the UpdateDeviceDefinition API request. @@ -3371,7 +3439,7 @@ func (c *Greengrass) UpdateDeviceDefinitionRequest(input *UpdateDeviceDefinition req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDeviceDefinitionRequest{Request: req, Input: input} + return UpdateDeviceDefinitionRequest{Request: req, Input: input, Copy: c.UpdateDeviceDefinitionRequest} } const opUpdateFunctionDefinition = "UpdateFunctionDefinition" @@ -3380,6 +3448,7 @@ const opUpdateFunctionDefinition = "UpdateFunctionDefinition" type UpdateFunctionDefinitionRequest struct { *aws.Request Input *UpdateFunctionDefinitionInput + Copy func(*UpdateFunctionDefinitionInput) UpdateFunctionDefinitionRequest } // Send marshals and sends the UpdateFunctionDefinition API request. @@ -3420,7 +3489,7 @@ func (c *Greengrass) UpdateFunctionDefinitionRequest(input *UpdateFunctionDefini req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateFunctionDefinitionRequest{Request: req, Input: input} + return UpdateFunctionDefinitionRequest{Request: req, Input: input, Copy: c.UpdateFunctionDefinitionRequest} } const opUpdateGroup = "UpdateGroup" @@ -3429,6 +3498,7 @@ const opUpdateGroup = "UpdateGroup" type UpdateGroupRequest struct { *aws.Request Input *UpdateGroupInput + Copy func(*UpdateGroupInput) UpdateGroupRequest } // Send marshals and sends the UpdateGroup API request. @@ -3469,7 +3539,7 @@ func (c *Greengrass) UpdateGroupRequest(input *UpdateGroupInput) UpdateGroupRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGroupRequest{Request: req, Input: input} + return UpdateGroupRequest{Request: req, Input: input, Copy: c.UpdateGroupRequest} } const opUpdateGroupCertificateConfiguration = "UpdateGroupCertificateConfiguration" @@ -3478,6 +3548,7 @@ const opUpdateGroupCertificateConfiguration = "UpdateGroupCertificateConfigurati type UpdateGroupCertificateConfigurationRequest struct { *aws.Request Input *UpdateGroupCertificateConfigurationInput + Copy func(*UpdateGroupCertificateConfigurationInput) UpdateGroupCertificateConfigurationRequest } // Send marshals and sends the UpdateGroupCertificateConfiguration API request. @@ -3518,7 +3589,7 @@ func (c *Greengrass) UpdateGroupCertificateConfigurationRequest(input *UpdateGro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGroupCertificateConfigurationRequest{Request: req, Input: input} + return UpdateGroupCertificateConfigurationRequest{Request: req, Input: input, Copy: c.UpdateGroupCertificateConfigurationRequest} } const opUpdateLoggerDefinition = "UpdateLoggerDefinition" @@ -3527,6 +3598,7 @@ const opUpdateLoggerDefinition = "UpdateLoggerDefinition" type UpdateLoggerDefinitionRequest struct { *aws.Request Input *UpdateLoggerDefinitionInput + Copy func(*UpdateLoggerDefinitionInput) UpdateLoggerDefinitionRequest } // Send marshals and sends the UpdateLoggerDefinition API request. @@ -3567,7 +3639,7 @@ func (c *Greengrass) UpdateLoggerDefinitionRequest(input *UpdateLoggerDefinition req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateLoggerDefinitionRequest{Request: req, Input: input} + return UpdateLoggerDefinitionRequest{Request: req, Input: input, Copy: c.UpdateLoggerDefinitionRequest} } const opUpdateResourceDefinition = "UpdateResourceDefinition" @@ -3576,6 +3648,7 @@ const opUpdateResourceDefinition = "UpdateResourceDefinition" type UpdateResourceDefinitionRequest struct { *aws.Request Input *UpdateResourceDefinitionInput + Copy func(*UpdateResourceDefinitionInput) UpdateResourceDefinitionRequest } // Send marshals and sends the UpdateResourceDefinition API request. @@ -3616,7 +3689,7 @@ func (c *Greengrass) UpdateResourceDefinitionRequest(input *UpdateResourceDefini req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateResourceDefinitionRequest{Request: req, Input: input} + return UpdateResourceDefinitionRequest{Request: req, Input: input, Copy: c.UpdateResourceDefinitionRequest} } const opUpdateSubscriptionDefinition = "UpdateSubscriptionDefinition" @@ -3625,6 +3698,7 @@ const opUpdateSubscriptionDefinition = "UpdateSubscriptionDefinition" type UpdateSubscriptionDefinitionRequest struct { *aws.Request Input *UpdateSubscriptionDefinitionInput + Copy func(*UpdateSubscriptionDefinitionInput) UpdateSubscriptionDefinitionRequest } // Send marshals and sends the UpdateSubscriptionDefinition API request. @@ -3665,7 +3739,7 @@ func (c *Greengrass) UpdateSubscriptionDefinitionRequest(input *UpdateSubscripti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSubscriptionDefinitionRequest{Request: req, Input: input} + return UpdateSubscriptionDefinitionRequest{Request: req, Input: input, Copy: c.UpdateSubscriptionDefinitionRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/AssociateRoleToGroupRequest diff --git a/service/guardduty/api.go b/service/guardduty/api.go index 7aec76d5054..eb6deb7df27 100644 --- a/service/guardduty/api.go +++ b/service/guardduty/api.go @@ -14,6 +14,7 @@ const opAcceptInvitation = "AcceptInvitation" type AcceptInvitationRequest struct { *aws.Request Input *AcceptInvitationInput + Copy func(*AcceptInvitationInput) AcceptInvitationRequest } // Send marshals and sends the AcceptInvitation API request. @@ -54,7 +55,7 @@ func (c *GuardDuty) AcceptInvitationRequest(input *AcceptInvitationInput) Accept req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcceptInvitationRequest{Request: req, Input: input} + return AcceptInvitationRequest{Request: req, Input: input, Copy: c.AcceptInvitationRequest} } const opArchiveFindings = "ArchiveFindings" @@ -63,6 +64,7 @@ const opArchiveFindings = "ArchiveFindings" type ArchiveFindingsRequest struct { *aws.Request Input *ArchiveFindingsInput + Copy func(*ArchiveFindingsInput) ArchiveFindingsRequest } // Send marshals and sends the ArchiveFindings API request. @@ -103,7 +105,7 @@ func (c *GuardDuty) ArchiveFindingsRequest(input *ArchiveFindingsInput) ArchiveF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ArchiveFindingsRequest{Request: req, Input: input} + return ArchiveFindingsRequest{Request: req, Input: input, Copy: c.ArchiveFindingsRequest} } const opCreateDetector = "CreateDetector" @@ -112,6 +114,7 @@ const opCreateDetector = "CreateDetector" type CreateDetectorRequest struct { *aws.Request Input *CreateDetectorInput + Copy func(*CreateDetectorInput) CreateDetectorRequest } // Send marshals and sends the CreateDetector API request. @@ -154,7 +157,7 @@ func (c *GuardDuty) CreateDetectorRequest(input *CreateDetectorInput) CreateDete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDetectorRequest{Request: req, Input: input} + return CreateDetectorRequest{Request: req, Input: input, Copy: c.CreateDetectorRequest} } const opCreateIPSet = "CreateIPSet" @@ -163,6 +166,7 @@ const opCreateIPSet = "CreateIPSet" type CreateIPSetRequest struct { *aws.Request Input *CreateIPSetInput + Copy func(*CreateIPSetInput) CreateIPSetRequest } // Send marshals and sends the CreateIPSet API request. @@ -204,7 +208,7 @@ func (c *GuardDuty) CreateIPSetRequest(input *CreateIPSetInput) CreateIPSetReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateIPSetRequest{Request: req, Input: input} + return CreateIPSetRequest{Request: req, Input: input, Copy: c.CreateIPSetRequest} } const opCreateMembers = "CreateMembers" @@ -213,6 +217,7 @@ const opCreateMembers = "CreateMembers" type CreateMembersRequest struct { *aws.Request Input *CreateMembersInput + Copy func(*CreateMembersInput) CreateMembersRequest } // Send marshals and sends the CreateMembers API request. @@ -255,7 +260,7 @@ func (c *GuardDuty) CreateMembersRequest(input *CreateMembersInput) CreateMember req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateMembersRequest{Request: req, Input: input} + return CreateMembersRequest{Request: req, Input: input, Copy: c.CreateMembersRequest} } const opCreateSampleFindings = "CreateSampleFindings" @@ -264,6 +269,7 @@ const opCreateSampleFindings = "CreateSampleFindings" type CreateSampleFindingsRequest struct { *aws.Request Input *CreateSampleFindingsInput + Copy func(*CreateSampleFindingsInput) CreateSampleFindingsRequest } // Send marshals and sends the CreateSampleFindings API request. @@ -306,7 +312,7 @@ func (c *GuardDuty) CreateSampleFindingsRequest(input *CreateSampleFindingsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSampleFindingsRequest{Request: req, Input: input} + return CreateSampleFindingsRequest{Request: req, Input: input, Copy: c.CreateSampleFindingsRequest} } const opCreateThreatIntelSet = "CreateThreatIntelSet" @@ -315,6 +321,7 @@ const opCreateThreatIntelSet = "CreateThreatIntelSet" type CreateThreatIntelSetRequest struct { *aws.Request Input *CreateThreatIntelSetInput + Copy func(*CreateThreatIntelSetInput) CreateThreatIntelSetRequest } // Send marshals and sends the CreateThreatIntelSet API request. @@ -356,7 +363,7 @@ func (c *GuardDuty) CreateThreatIntelSetRequest(input *CreateThreatIntelSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateThreatIntelSetRequest{Request: req, Input: input} + return CreateThreatIntelSetRequest{Request: req, Input: input, Copy: c.CreateThreatIntelSetRequest} } const opDeclineInvitations = "DeclineInvitations" @@ -365,6 +372,7 @@ const opDeclineInvitations = "DeclineInvitations" type DeclineInvitationsRequest struct { *aws.Request Input *DeclineInvitationsInput + Copy func(*DeclineInvitationsInput) DeclineInvitationsRequest } // Send marshals and sends the DeclineInvitations API request. @@ -406,7 +414,7 @@ func (c *GuardDuty) DeclineInvitationsRequest(input *DeclineInvitationsInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeclineInvitationsRequest{Request: req, Input: input} + return DeclineInvitationsRequest{Request: req, Input: input, Copy: c.DeclineInvitationsRequest} } const opDeleteDetector = "DeleteDetector" @@ -415,6 +423,7 @@ const opDeleteDetector = "DeleteDetector" type DeleteDetectorRequest struct { *aws.Request Input *DeleteDetectorInput + Copy func(*DeleteDetectorInput) DeleteDetectorRequest } // Send marshals and sends the DeleteDetector API request. @@ -455,7 +464,7 @@ func (c *GuardDuty) DeleteDetectorRequest(input *DeleteDetectorInput) DeleteDete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDetectorRequest{Request: req, Input: input} + return DeleteDetectorRequest{Request: req, Input: input, Copy: c.DeleteDetectorRequest} } const opDeleteIPSet = "DeleteIPSet" @@ -464,6 +473,7 @@ const opDeleteIPSet = "DeleteIPSet" type DeleteIPSetRequest struct { *aws.Request Input *DeleteIPSetInput + Copy func(*DeleteIPSetInput) DeleteIPSetRequest } // Send marshals and sends the DeleteIPSet API request. @@ -504,7 +514,7 @@ func (c *GuardDuty) DeleteIPSetRequest(input *DeleteIPSetInput) DeleteIPSetReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteIPSetRequest{Request: req, Input: input} + return DeleteIPSetRequest{Request: req, Input: input, Copy: c.DeleteIPSetRequest} } const opDeleteInvitations = "DeleteInvitations" @@ -513,6 +523,7 @@ const opDeleteInvitations = "DeleteInvitations" type DeleteInvitationsRequest struct { *aws.Request Input *DeleteInvitationsInput + Copy func(*DeleteInvitationsInput) DeleteInvitationsRequest } // Send marshals and sends the DeleteInvitations API request. @@ -554,7 +565,7 @@ func (c *GuardDuty) DeleteInvitationsRequest(input *DeleteInvitationsInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteInvitationsRequest{Request: req, Input: input} + return DeleteInvitationsRequest{Request: req, Input: input, Copy: c.DeleteInvitationsRequest} } const opDeleteMembers = "DeleteMembers" @@ -563,6 +574,7 @@ const opDeleteMembers = "DeleteMembers" type DeleteMembersRequest struct { *aws.Request Input *DeleteMembersInput + Copy func(*DeleteMembersInput) DeleteMembersRequest } // Send marshals and sends the DeleteMembers API request. @@ -604,7 +616,7 @@ func (c *GuardDuty) DeleteMembersRequest(input *DeleteMembersInput) DeleteMember req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteMembersRequest{Request: req, Input: input} + return DeleteMembersRequest{Request: req, Input: input, Copy: c.DeleteMembersRequest} } const opDeleteThreatIntelSet = "DeleteThreatIntelSet" @@ -613,6 +625,7 @@ const opDeleteThreatIntelSet = "DeleteThreatIntelSet" type DeleteThreatIntelSetRequest struct { *aws.Request Input *DeleteThreatIntelSetInput + Copy func(*DeleteThreatIntelSetInput) DeleteThreatIntelSetRequest } // Send marshals and sends the DeleteThreatIntelSet API request. @@ -653,7 +666,7 @@ func (c *GuardDuty) DeleteThreatIntelSetRequest(input *DeleteThreatIntelSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteThreatIntelSetRequest{Request: req, Input: input} + return DeleteThreatIntelSetRequest{Request: req, Input: input, Copy: c.DeleteThreatIntelSetRequest} } const opDisassociateFromMasterAccount = "DisassociateFromMasterAccount" @@ -662,6 +675,7 @@ const opDisassociateFromMasterAccount = "DisassociateFromMasterAccount" type DisassociateFromMasterAccountRequest struct { *aws.Request Input *DisassociateFromMasterAccountInput + Copy func(*DisassociateFromMasterAccountInput) DisassociateFromMasterAccountRequest } // Send marshals and sends the DisassociateFromMasterAccount API request. @@ -702,7 +716,7 @@ func (c *GuardDuty) DisassociateFromMasterAccountRequest(input *DisassociateFrom req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateFromMasterAccountRequest{Request: req, Input: input} + return DisassociateFromMasterAccountRequest{Request: req, Input: input, Copy: c.DisassociateFromMasterAccountRequest} } const opDisassociateMembers = "DisassociateMembers" @@ -711,6 +725,7 @@ const opDisassociateMembers = "DisassociateMembers" type DisassociateMembersRequest struct { *aws.Request Input *DisassociateMembersInput + Copy func(*DisassociateMembersInput) DisassociateMembersRequest } // Send marshals and sends the DisassociateMembers API request. @@ -752,7 +767,7 @@ func (c *GuardDuty) DisassociateMembersRequest(input *DisassociateMembersInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateMembersRequest{Request: req, Input: input} + return DisassociateMembersRequest{Request: req, Input: input, Copy: c.DisassociateMembersRequest} } const opGetDetector = "GetDetector" @@ -761,6 +776,7 @@ const opGetDetector = "GetDetector" type GetDetectorRequest struct { *aws.Request Input *GetDetectorInput + Copy func(*GetDetectorInput) GetDetectorRequest } // Send marshals and sends the GetDetector API request. @@ -801,7 +817,7 @@ func (c *GuardDuty) GetDetectorRequest(input *GetDetectorInput) GetDetectorReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDetectorRequest{Request: req, Input: input} + return GetDetectorRequest{Request: req, Input: input, Copy: c.GetDetectorRequest} } const opGetFindings = "GetFindings" @@ -810,6 +826,7 @@ const opGetFindings = "GetFindings" type GetFindingsRequest struct { *aws.Request Input *GetFindingsInput + Copy func(*GetFindingsInput) GetFindingsRequest } // Send marshals and sends the GetFindings API request. @@ -850,7 +867,7 @@ func (c *GuardDuty) GetFindingsRequest(input *GetFindingsInput) GetFindingsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFindingsRequest{Request: req, Input: input} + return GetFindingsRequest{Request: req, Input: input, Copy: c.GetFindingsRequest} } const opGetFindingsStatistics = "GetFindingsStatistics" @@ -859,6 +876,7 @@ const opGetFindingsStatistics = "GetFindingsStatistics" type GetFindingsStatisticsRequest struct { *aws.Request Input *GetFindingsStatisticsInput + Copy func(*GetFindingsStatisticsInput) GetFindingsStatisticsRequest } // Send marshals and sends the GetFindingsStatistics API request. @@ -899,7 +917,7 @@ func (c *GuardDuty) GetFindingsStatisticsRequest(input *GetFindingsStatisticsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFindingsStatisticsRequest{Request: req, Input: input} + return GetFindingsStatisticsRequest{Request: req, Input: input, Copy: c.GetFindingsStatisticsRequest} } const opGetIPSet = "GetIPSet" @@ -908,6 +926,7 @@ const opGetIPSet = "GetIPSet" type GetIPSetRequest struct { *aws.Request Input *GetIPSetInput + Copy func(*GetIPSetInput) GetIPSetRequest } // Send marshals and sends the GetIPSet API request. @@ -948,7 +967,7 @@ func (c *GuardDuty) GetIPSetRequest(input *GetIPSetInput) GetIPSetRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIPSetRequest{Request: req, Input: input} + return GetIPSetRequest{Request: req, Input: input, Copy: c.GetIPSetRequest} } const opGetInvitationsCount = "GetInvitationsCount" @@ -957,6 +976,7 @@ const opGetInvitationsCount = "GetInvitationsCount" type GetInvitationsCountRequest struct { *aws.Request Input *GetInvitationsCountInput + Copy func(*GetInvitationsCountInput) GetInvitationsCountRequest } // Send marshals and sends the GetInvitationsCount API request. @@ -998,7 +1018,7 @@ func (c *GuardDuty) GetInvitationsCountRequest(input *GetInvitationsCountInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInvitationsCountRequest{Request: req, Input: input} + return GetInvitationsCountRequest{Request: req, Input: input, Copy: c.GetInvitationsCountRequest} } const opGetMasterAccount = "GetMasterAccount" @@ -1007,6 +1027,7 @@ const opGetMasterAccount = "GetMasterAccount" type GetMasterAccountRequest struct { *aws.Request Input *GetMasterAccountInput + Copy func(*GetMasterAccountInput) GetMasterAccountRequest } // Send marshals and sends the GetMasterAccount API request. @@ -1048,7 +1069,7 @@ func (c *GuardDuty) GetMasterAccountRequest(input *GetMasterAccountInput) GetMas req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMasterAccountRequest{Request: req, Input: input} + return GetMasterAccountRequest{Request: req, Input: input, Copy: c.GetMasterAccountRequest} } const opGetMembers = "GetMembers" @@ -1057,6 +1078,7 @@ const opGetMembers = "GetMembers" type GetMembersRequest struct { *aws.Request Input *GetMembersInput + Copy func(*GetMembersInput) GetMembersRequest } // Send marshals and sends the GetMembers API request. @@ -1098,7 +1120,7 @@ func (c *GuardDuty) GetMembersRequest(input *GetMembersInput) GetMembersRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMembersRequest{Request: req, Input: input} + return GetMembersRequest{Request: req, Input: input, Copy: c.GetMembersRequest} } const opGetThreatIntelSet = "GetThreatIntelSet" @@ -1107,6 +1129,7 @@ const opGetThreatIntelSet = "GetThreatIntelSet" type GetThreatIntelSetRequest struct { *aws.Request Input *GetThreatIntelSetInput + Copy func(*GetThreatIntelSetInput) GetThreatIntelSetRequest } // Send marshals and sends the GetThreatIntelSet API request. @@ -1147,7 +1170,7 @@ func (c *GuardDuty) GetThreatIntelSetRequest(input *GetThreatIntelSetInput) GetT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetThreatIntelSetRequest{Request: req, Input: input} + return GetThreatIntelSetRequest{Request: req, Input: input, Copy: c.GetThreatIntelSetRequest} } const opInviteMembers = "InviteMembers" @@ -1156,6 +1179,7 @@ const opInviteMembers = "InviteMembers" type InviteMembersRequest struct { *aws.Request Input *InviteMembersInput + Copy func(*InviteMembersInput) InviteMembersRequest } // Send marshals and sends the InviteMembers API request. @@ -1199,7 +1223,7 @@ func (c *GuardDuty) InviteMembersRequest(input *InviteMembersInput) InviteMember req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InviteMembersRequest{Request: req, Input: input} + return InviteMembersRequest{Request: req, Input: input, Copy: c.InviteMembersRequest} } const opListDetectors = "ListDetectors" @@ -1208,6 +1232,7 @@ const opListDetectors = "ListDetectors" type ListDetectorsRequest struct { *aws.Request Input *ListDetectorsInput + Copy func(*ListDetectorsInput) ListDetectorsRequest } // Send marshals and sends the ListDetectors API request. @@ -1254,57 +1279,53 @@ func (c *GuardDuty) ListDetectorsRequest(input *ListDetectorsInput) ListDetector req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDetectorsRequest{Request: req, Input: input} + return ListDetectorsRequest{Request: req, Input: input, Copy: c.ListDetectorsRequest} } -// ListDetectorsPages iterates over the pages of a ListDetectors operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDetectors method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDetectorsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDetectors operation. -// pageNum := 0 -// err := client.ListDetectorsPages(params, -// func(page *ListDetectorsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *GuardDuty) ListDetectorsPages(input *ListDetectorsInput, fn func(*ListDetectorsOutput, bool) bool) error { - return c.ListDetectorsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDetectorsPagesWithContext same as ListDetectorsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *GuardDuty) ListDetectorsPagesWithContext(ctx aws.Context, input *ListDetectorsInput, fn func(*ListDetectorsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDetectorsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDetectorsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDetectorsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDetectorsRequest) Paginate(opts ...aws.Option) ListDetectorsPager { + return ListDetectorsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDetectorsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDetectorsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDetectorsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDetectorsPager struct { + aws.Pager +} + +func (p *ListDetectorsPager) CurrentPage() *ListDetectorsOutput { + return p.Pager.CurrentPage().(*ListDetectorsOutput) } const opListFindings = "ListFindings" @@ -1313,6 +1334,7 @@ const opListFindings = "ListFindings" type ListFindingsRequest struct { *aws.Request Input *ListFindingsInput + Copy func(*ListFindingsInput) ListFindingsRequest } // Send marshals and sends the ListFindings API request. @@ -1359,57 +1381,53 @@ func (c *GuardDuty) ListFindingsRequest(input *ListFindingsInput) ListFindingsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFindingsRequest{Request: req, Input: input} + return ListFindingsRequest{Request: req, Input: input, Copy: c.ListFindingsRequest} } -// ListFindingsPages iterates over the pages of a ListFindings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFindings method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListFindingsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListFindings operation. -// pageNum := 0 -// err := client.ListFindingsPages(params, -// func(page *ListFindingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *GuardDuty) ListFindingsPages(input *ListFindingsInput, fn func(*ListFindingsOutput, bool) bool) error { - return c.ListFindingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFindingsPagesWithContext same as ListFindingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *GuardDuty) ListFindingsPagesWithContext(ctx aws.Context, input *ListFindingsInput, fn func(*ListFindingsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListFindingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListFindingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListFindingsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListFindingsRequest) Paginate(opts ...aws.Option) ListFindingsPager { + return ListFindingsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListFindingsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFindingsOutput), !p.HasNextPage()) - } - return p.Err() +// ListFindingsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListFindingsPager struct { + aws.Pager +} + +func (p *ListFindingsPager) CurrentPage() *ListFindingsOutput { + return p.Pager.CurrentPage().(*ListFindingsOutput) } const opListIPSets = "ListIPSets" @@ -1418,6 +1436,7 @@ const opListIPSets = "ListIPSets" type ListIPSetsRequest struct { *aws.Request Input *ListIPSetsInput + Copy func(*ListIPSetsInput) ListIPSetsRequest } // Send marshals and sends the ListIPSets API request. @@ -1464,57 +1483,53 @@ func (c *GuardDuty) ListIPSetsRequest(input *ListIPSetsInput) ListIPSetsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIPSetsRequest{Request: req, Input: input} + return ListIPSetsRequest{Request: req, Input: input, Copy: c.ListIPSetsRequest} } -// ListIPSetsPages iterates over the pages of a ListIPSets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIPSets method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListIPSetsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListIPSets operation. -// pageNum := 0 -// err := client.ListIPSetsPages(params, -// func(page *ListIPSetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *GuardDuty) ListIPSetsPages(input *ListIPSetsInput, fn func(*ListIPSetsOutput, bool) bool) error { - return c.ListIPSetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIPSetsPagesWithContext same as ListIPSetsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *GuardDuty) ListIPSetsPagesWithContext(ctx aws.Context, input *ListIPSetsInput, fn func(*ListIPSetsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListIPSetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListIPSetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListIPSetsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListIPSetsRequest) Paginate(opts ...aws.Option) ListIPSetsPager { + return ListIPSetsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListIPSetsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListIPSetsOutput), !p.HasNextPage()) - } - return p.Err() +// ListIPSetsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListIPSetsPager struct { + aws.Pager +} + +func (p *ListIPSetsPager) CurrentPage() *ListIPSetsOutput { + return p.Pager.CurrentPage().(*ListIPSetsOutput) } const opListInvitations = "ListInvitations" @@ -1523,6 +1538,7 @@ const opListInvitations = "ListInvitations" type ListInvitationsRequest struct { *aws.Request Input *ListInvitationsInput + Copy func(*ListInvitationsInput) ListInvitationsRequest } // Send marshals and sends the ListInvitations API request. @@ -1570,57 +1586,53 @@ func (c *GuardDuty) ListInvitationsRequest(input *ListInvitationsInput) ListInvi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInvitationsRequest{Request: req, Input: input} + return ListInvitationsRequest{Request: req, Input: input, Copy: c.ListInvitationsRequest} } -// ListInvitationsPages iterates over the pages of a ListInvitations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInvitations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInvitationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInvitations operation. -// pageNum := 0 -// err := client.ListInvitationsPages(params, -// func(page *ListInvitationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *GuardDuty) ListInvitationsPages(input *ListInvitationsInput, fn func(*ListInvitationsOutput, bool) bool) error { - return c.ListInvitationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInvitationsPagesWithContext same as ListInvitationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *GuardDuty) ListInvitationsPagesWithContext(ctx aws.Context, input *ListInvitationsInput, fn func(*ListInvitationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInvitationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInvitationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListInvitationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListInvitationsRequest) Paginate(opts ...aws.Option) ListInvitationsPager { + return ListInvitationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInvitationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInvitationsOutput), !p.HasNextPage()) - } - return p.Err() +// ListInvitationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInvitationsPager struct { + aws.Pager +} + +func (p *ListInvitationsPager) CurrentPage() *ListInvitationsOutput { + return p.Pager.CurrentPage().(*ListInvitationsOutput) } const opListMembers = "ListMembers" @@ -1629,6 +1641,7 @@ const opListMembers = "ListMembers" type ListMembersRequest struct { *aws.Request Input *ListMembersInput + Copy func(*ListMembersInput) ListMembersRequest } // Send marshals and sends the ListMembers API request. @@ -1676,57 +1689,53 @@ func (c *GuardDuty) ListMembersRequest(input *ListMembersInput) ListMembersReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListMembersRequest{Request: req, Input: input} + return ListMembersRequest{Request: req, Input: input, Copy: c.ListMembersRequest} } -// ListMembersPages iterates over the pages of a ListMembers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMembers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListMembersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListMembers operation. -// pageNum := 0 -// err := client.ListMembersPages(params, -// func(page *ListMembersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *GuardDuty) ListMembersPages(input *ListMembersInput, fn func(*ListMembersOutput, bool) bool) error { - return c.ListMembersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMembersPagesWithContext same as ListMembersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *GuardDuty) ListMembersPagesWithContext(ctx aws.Context, input *ListMembersInput, fn func(*ListMembersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListMembersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListMembersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListMembersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListMembersRequest) Paginate(opts ...aws.Option) ListMembersPager { + return ListMembersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListMembersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMembersOutput), !p.HasNextPage()) - } - return p.Err() +// ListMembersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListMembersPager struct { + aws.Pager +} + +func (p *ListMembersPager) CurrentPage() *ListMembersOutput { + return p.Pager.CurrentPage().(*ListMembersOutput) } const opListThreatIntelSets = "ListThreatIntelSets" @@ -1735,6 +1744,7 @@ const opListThreatIntelSets = "ListThreatIntelSets" type ListThreatIntelSetsRequest struct { *aws.Request Input *ListThreatIntelSetsInput + Copy func(*ListThreatIntelSetsInput) ListThreatIntelSetsRequest } // Send marshals and sends the ListThreatIntelSets API request. @@ -1782,57 +1792,53 @@ func (c *GuardDuty) ListThreatIntelSetsRequest(input *ListThreatIntelSetsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListThreatIntelSetsRequest{Request: req, Input: input} + return ListThreatIntelSetsRequest{Request: req, Input: input, Copy: c.ListThreatIntelSetsRequest} } -// ListThreatIntelSetsPages iterates over the pages of a ListThreatIntelSets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListThreatIntelSets method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListThreatIntelSetsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListThreatIntelSets operation. -// pageNum := 0 -// err := client.ListThreatIntelSetsPages(params, -// func(page *ListThreatIntelSetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *GuardDuty) ListThreatIntelSetsPages(input *ListThreatIntelSetsInput, fn func(*ListThreatIntelSetsOutput, bool) bool) error { - return c.ListThreatIntelSetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListThreatIntelSetsPagesWithContext same as ListThreatIntelSetsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *GuardDuty) ListThreatIntelSetsPagesWithContext(ctx aws.Context, input *ListThreatIntelSetsInput, fn func(*ListThreatIntelSetsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListThreatIntelSetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListThreatIntelSetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListThreatIntelSetsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListThreatIntelSetsRequest) Paginate(opts ...aws.Option) ListThreatIntelSetsPager { + return ListThreatIntelSetsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListThreatIntelSetsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListThreatIntelSetsOutput), !p.HasNextPage()) - } - return p.Err() +// ListThreatIntelSetsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListThreatIntelSetsPager struct { + aws.Pager +} + +func (p *ListThreatIntelSetsPager) CurrentPage() *ListThreatIntelSetsOutput { + return p.Pager.CurrentPage().(*ListThreatIntelSetsOutput) } const opStartMonitoringMembers = "StartMonitoringMembers" @@ -1841,6 +1847,7 @@ const opStartMonitoringMembers = "StartMonitoringMembers" type StartMonitoringMembersRequest struct { *aws.Request Input *StartMonitoringMembersInput + Copy func(*StartMonitoringMembersInput) StartMonitoringMembersRequest } // Send marshals and sends the StartMonitoringMembers API request. @@ -1883,7 +1890,7 @@ func (c *GuardDuty) StartMonitoringMembersRequest(input *StartMonitoringMembersI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartMonitoringMembersRequest{Request: req, Input: input} + return StartMonitoringMembersRequest{Request: req, Input: input, Copy: c.StartMonitoringMembersRequest} } const opStopMonitoringMembers = "StopMonitoringMembers" @@ -1892,6 +1899,7 @@ const opStopMonitoringMembers = "StopMonitoringMembers" type StopMonitoringMembersRequest struct { *aws.Request Input *StopMonitoringMembersInput + Copy func(*StopMonitoringMembersInput) StopMonitoringMembersRequest } // Send marshals and sends the StopMonitoringMembers API request. @@ -1935,7 +1943,7 @@ func (c *GuardDuty) StopMonitoringMembersRequest(input *StopMonitoringMembersInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopMonitoringMembersRequest{Request: req, Input: input} + return StopMonitoringMembersRequest{Request: req, Input: input, Copy: c.StopMonitoringMembersRequest} } const opUnarchiveFindings = "UnarchiveFindings" @@ -1944,6 +1952,7 @@ const opUnarchiveFindings = "UnarchiveFindings" type UnarchiveFindingsRequest struct { *aws.Request Input *UnarchiveFindingsInput + Copy func(*UnarchiveFindingsInput) UnarchiveFindingsRequest } // Send marshals and sends the UnarchiveFindings API request. @@ -1984,7 +1993,7 @@ func (c *GuardDuty) UnarchiveFindingsRequest(input *UnarchiveFindingsInput) Unar req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UnarchiveFindingsRequest{Request: req, Input: input} + return UnarchiveFindingsRequest{Request: req, Input: input, Copy: c.UnarchiveFindingsRequest} } const opUpdateDetector = "UpdateDetector" @@ -1993,6 +2002,7 @@ const opUpdateDetector = "UpdateDetector" type UpdateDetectorRequest struct { *aws.Request Input *UpdateDetectorInput + Copy func(*UpdateDetectorInput) UpdateDetectorRequest } // Send marshals and sends the UpdateDetector API request. @@ -2033,7 +2043,7 @@ func (c *GuardDuty) UpdateDetectorRequest(input *UpdateDetectorInput) UpdateDete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDetectorRequest{Request: req, Input: input} + return UpdateDetectorRequest{Request: req, Input: input, Copy: c.UpdateDetectorRequest} } const opUpdateFindingsFeedback = "UpdateFindingsFeedback" @@ -2042,6 +2052,7 @@ const opUpdateFindingsFeedback = "UpdateFindingsFeedback" type UpdateFindingsFeedbackRequest struct { *aws.Request Input *UpdateFindingsFeedbackInput + Copy func(*UpdateFindingsFeedbackInput) UpdateFindingsFeedbackRequest } // Send marshals and sends the UpdateFindingsFeedback API request. @@ -2082,7 +2093,7 @@ func (c *GuardDuty) UpdateFindingsFeedbackRequest(input *UpdateFindingsFeedbackI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateFindingsFeedbackRequest{Request: req, Input: input} + return UpdateFindingsFeedbackRequest{Request: req, Input: input, Copy: c.UpdateFindingsFeedbackRequest} } const opUpdateIPSet = "UpdateIPSet" @@ -2091,6 +2102,7 @@ const opUpdateIPSet = "UpdateIPSet" type UpdateIPSetRequest struct { *aws.Request Input *UpdateIPSetInput + Copy func(*UpdateIPSetInput) UpdateIPSetRequest } // Send marshals and sends the UpdateIPSet API request. @@ -2131,7 +2143,7 @@ func (c *GuardDuty) UpdateIPSetRequest(input *UpdateIPSetInput) UpdateIPSetReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateIPSetRequest{Request: req, Input: input} + return UpdateIPSetRequest{Request: req, Input: input, Copy: c.UpdateIPSetRequest} } const opUpdateThreatIntelSet = "UpdateThreatIntelSet" @@ -2140,6 +2152,7 @@ const opUpdateThreatIntelSet = "UpdateThreatIntelSet" type UpdateThreatIntelSetRequest struct { *aws.Request Input *UpdateThreatIntelSetInput + Copy func(*UpdateThreatIntelSetInput) UpdateThreatIntelSetRequest } // Send marshals and sends the UpdateThreatIntelSet API request. @@ -2180,7 +2193,7 @@ func (c *GuardDuty) UpdateThreatIntelSetRequest(input *UpdateThreatIntelSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateThreatIntelSetRequest{Request: req, Input: input} + return UpdateThreatIntelSetRequest{Request: req, Input: input, Copy: c.UpdateThreatIntelSetRequest} } // AcceptInvitation request body. diff --git a/service/guardduty/guarddutyiface/interface.go b/service/guardduty/guarddutyiface/interface.go index 25594d9e863..a5aeaeda4b0 100644 --- a/service/guardduty/guarddutyiface/interface.go +++ b/service/guardduty/guarddutyiface/interface.go @@ -9,7 +9,6 @@ package guarddutyiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/guardduty" ) @@ -113,34 +112,16 @@ type GuardDutyAPI interface { ListDetectorsRequest(*guardduty.ListDetectorsInput) guardduty.ListDetectorsRequest - ListDetectorsPages(*guardduty.ListDetectorsInput, func(*guardduty.ListDetectorsOutput, bool) bool) error - ListDetectorsPagesWithContext(aws.Context, *guardduty.ListDetectorsInput, func(*guardduty.ListDetectorsOutput, bool) bool, ...aws.Option) error - ListFindingsRequest(*guardduty.ListFindingsInput) guardduty.ListFindingsRequest - ListFindingsPages(*guardduty.ListFindingsInput, func(*guardduty.ListFindingsOutput, bool) bool) error - ListFindingsPagesWithContext(aws.Context, *guardduty.ListFindingsInput, func(*guardduty.ListFindingsOutput, bool) bool, ...aws.Option) error - ListIPSetsRequest(*guardduty.ListIPSetsInput) guardduty.ListIPSetsRequest - ListIPSetsPages(*guardduty.ListIPSetsInput, func(*guardduty.ListIPSetsOutput, bool) bool) error - ListIPSetsPagesWithContext(aws.Context, *guardduty.ListIPSetsInput, func(*guardduty.ListIPSetsOutput, bool) bool, ...aws.Option) error - ListInvitationsRequest(*guardduty.ListInvitationsInput) guardduty.ListInvitationsRequest - ListInvitationsPages(*guardduty.ListInvitationsInput, func(*guardduty.ListInvitationsOutput, bool) bool) error - ListInvitationsPagesWithContext(aws.Context, *guardduty.ListInvitationsInput, func(*guardduty.ListInvitationsOutput, bool) bool, ...aws.Option) error - ListMembersRequest(*guardduty.ListMembersInput) guardduty.ListMembersRequest - ListMembersPages(*guardduty.ListMembersInput, func(*guardduty.ListMembersOutput, bool) bool) error - ListMembersPagesWithContext(aws.Context, *guardduty.ListMembersInput, func(*guardduty.ListMembersOutput, bool) bool, ...aws.Option) error - ListThreatIntelSetsRequest(*guardduty.ListThreatIntelSetsInput) guardduty.ListThreatIntelSetsRequest - ListThreatIntelSetsPages(*guardduty.ListThreatIntelSetsInput, func(*guardduty.ListThreatIntelSetsOutput, bool) bool) error - ListThreatIntelSetsPagesWithContext(aws.Context, *guardduty.ListThreatIntelSetsInput, func(*guardduty.ListThreatIntelSetsOutput, bool) bool, ...aws.Option) error - StartMonitoringMembersRequest(*guardduty.StartMonitoringMembersInput) guardduty.StartMonitoringMembersRequest StopMonitoringMembersRequest(*guardduty.StopMonitoringMembersInput) guardduty.StopMonitoringMembersRequest diff --git a/service/health/api.go b/service/health/api.go index 1bbefe210e9..a5826797e98 100644 --- a/service/health/api.go +++ b/service/health/api.go @@ -15,6 +15,7 @@ const opDescribeAffectedEntities = "DescribeAffectedEntities" type DescribeAffectedEntitiesRequest struct { *aws.Request Input *DescribeAffectedEntitiesInput + Copy func(*DescribeAffectedEntitiesInput) DescribeAffectedEntitiesRequest } // Send marshals and sends the DescribeAffectedEntities API request. @@ -69,57 +70,53 @@ func (c *Health) DescribeAffectedEntitiesRequest(input *DescribeAffectedEntities req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAffectedEntitiesRequest{Request: req, Input: input} + return DescribeAffectedEntitiesRequest{Request: req, Input: input, Copy: c.DescribeAffectedEntitiesRequest} } -// DescribeAffectedEntitiesPages iterates over the pages of a DescribeAffectedEntities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAffectedEntities method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeAffectedEntitiesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeAffectedEntities operation. -// pageNum := 0 -// err := client.DescribeAffectedEntitiesPages(params, -// func(page *DescribeAffectedEntitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.DescribeAffectedEntitiesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Health) DescribeAffectedEntitiesPages(input *DescribeAffectedEntitiesInput, fn func(*DescribeAffectedEntitiesOutput, bool) bool) error { - return c.DescribeAffectedEntitiesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeAffectedEntitiesPagesWithContext same as DescribeAffectedEntitiesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Health) DescribeAffectedEntitiesPagesWithContext(ctx aws.Context, input *DescribeAffectedEntitiesInput, fn func(*DescribeAffectedEntitiesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeAffectedEntitiesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeAffectedEntitiesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *DescribeAffectedEntitiesRequest) Paginate(opts ...aws.Option) DescribeAffectedEntitiesPager { + return DescribeAffectedEntitiesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeAffectedEntitiesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAffectedEntitiesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeAffectedEntitiesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeAffectedEntitiesPager struct { + aws.Pager +} + +func (p *DescribeAffectedEntitiesPager) CurrentPage() *DescribeAffectedEntitiesOutput { + return p.Pager.CurrentPage().(*DescribeAffectedEntitiesOutput) } const opDescribeEntityAggregates = "DescribeEntityAggregates" @@ -128,6 +125,7 @@ const opDescribeEntityAggregates = "DescribeEntityAggregates" type DescribeEntityAggregatesRequest struct { *aws.Request Input *DescribeEntityAggregatesInput + Copy func(*DescribeEntityAggregatesInput) DescribeEntityAggregatesRequest } // Send marshals and sends the DescribeEntityAggregates API request. @@ -170,7 +168,7 @@ func (c *Health) DescribeEntityAggregatesRequest(input *DescribeEntityAggregates req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEntityAggregatesRequest{Request: req, Input: input} + return DescribeEntityAggregatesRequest{Request: req, Input: input, Copy: c.DescribeEntityAggregatesRequest} } const opDescribeEventAggregates = "DescribeEventAggregates" @@ -179,6 +177,7 @@ const opDescribeEventAggregates = "DescribeEventAggregates" type DescribeEventAggregatesRequest struct { *aws.Request Input *DescribeEventAggregatesInput + Copy func(*DescribeEventAggregatesInput) DescribeEventAggregatesRequest } // Send marshals and sends the DescribeEventAggregates API request. @@ -227,57 +226,53 @@ func (c *Health) DescribeEventAggregatesRequest(input *DescribeEventAggregatesIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventAggregatesRequest{Request: req, Input: input} + return DescribeEventAggregatesRequest{Request: req, Input: input, Copy: c.DescribeEventAggregatesRequest} } -// DescribeEventAggregatesPages iterates over the pages of a DescribeEventAggregates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEventAggregates method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventAggregatesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEventAggregates operation. -// pageNum := 0 -// err := client.DescribeEventAggregatesPages(params, -// func(page *DescribeEventAggregatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.DescribeEventAggregatesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Health) DescribeEventAggregatesPages(input *DescribeEventAggregatesInput, fn func(*DescribeEventAggregatesOutput, bool) bool) error { - return c.DescribeEventAggregatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventAggregatesPagesWithContext same as DescribeEventAggregatesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Health) DescribeEventAggregatesPagesWithContext(ctx aws.Context, input *DescribeEventAggregatesInput, fn func(*DescribeEventAggregatesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventAggregatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventAggregatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *DescribeEventAggregatesRequest) Paginate(opts ...aws.Option) DescribeEventAggregatesPager { + return DescribeEventAggregatesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventAggregatesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventAggregatesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventAggregatesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventAggregatesPager struct { + aws.Pager +} + +func (p *DescribeEventAggregatesPager) CurrentPage() *DescribeEventAggregatesOutput { + return p.Pager.CurrentPage().(*DescribeEventAggregatesOutput) } const opDescribeEventDetails = "DescribeEventDetails" @@ -286,6 +281,7 @@ const opDescribeEventDetails = "DescribeEventDetails" type DescribeEventDetailsRequest struct { *aws.Request Input *DescribeEventDetailsInput + Copy func(*DescribeEventDetailsInput) DescribeEventDetailsRequest } // Send marshals and sends the DescribeEventDetails API request. @@ -333,7 +329,7 @@ func (c *Health) DescribeEventDetailsRequest(input *DescribeEventDetailsInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventDetailsRequest{Request: req, Input: input} + return DescribeEventDetailsRequest{Request: req, Input: input, Copy: c.DescribeEventDetailsRequest} } const opDescribeEventTypes = "DescribeEventTypes" @@ -342,6 +338,7 @@ const opDescribeEventTypes = "DescribeEventTypes" type DescribeEventTypesRequest struct { *aws.Request Input *DescribeEventTypesInput + Copy func(*DescribeEventTypesInput) DescribeEventTypesRequest } // Send marshals and sends the DescribeEventTypes API request. @@ -389,57 +386,53 @@ func (c *Health) DescribeEventTypesRequest(input *DescribeEventTypesInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventTypesRequest{Request: req, Input: input} + return DescribeEventTypesRequest{Request: req, Input: input, Copy: c.DescribeEventTypesRequest} } -// DescribeEventTypesPages iterates over the pages of a DescribeEventTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEventTypes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventTypesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEventTypes operation. -// pageNum := 0 -// err := client.DescribeEventTypesPages(params, -// func(page *DescribeEventTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.DescribeEventTypesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Health) DescribeEventTypesPages(input *DescribeEventTypesInput, fn func(*DescribeEventTypesOutput, bool) bool) error { - return c.DescribeEventTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventTypesPagesWithContext same as DescribeEventTypesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Health) DescribeEventTypesPagesWithContext(ctx aws.Context, input *DescribeEventTypesInput, fn func(*DescribeEventTypesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *DescribeEventTypesRequest) Paginate(opts ...aws.Option) DescribeEventTypesPager { + return DescribeEventTypesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventTypesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventTypesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventTypesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventTypesPager struct { + aws.Pager +} + +func (p *DescribeEventTypesPager) CurrentPage() *DescribeEventTypesOutput { + return p.Pager.CurrentPage().(*DescribeEventTypesOutput) } const opDescribeEvents = "DescribeEvents" @@ -448,6 +441,7 @@ const opDescribeEvents = "DescribeEvents" type DescribeEventsRequest struct { *aws.Request Input *DescribeEventsInput + Copy func(*DescribeEventsInput) DescribeEventsRequest } // Send marshals and sends the DescribeEvents API request. @@ -501,57 +495,53 @@ func (c *Health) DescribeEventsRequest(input *DescribeEventsInput) DescribeEvent req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventsRequest{Request: req, Input: input} + return DescribeEventsRequest{Request: req, Input: input, Copy: c.DescribeEventsRequest} } -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.DescribeEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Health) DescribeEventsPages(input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool) error { - return c.DescribeEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventsPagesWithContext same as DescribeEventsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Health) DescribeEventsPagesWithContext(ctx aws.Context, input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *DescribeEventsRequest) Paginate(opts ...aws.Option) DescribeEventsPager { + return DescribeEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventsPager struct { + aws.Pager +} + +func (p *DescribeEventsPager) CurrentPage() *DescribeEventsOutput { + return p.Pager.CurrentPage().(*DescribeEventsOutput) } // Information about an entity that is affected by a Health event. diff --git a/service/health/healthiface/interface.go b/service/health/healthiface/interface.go index 0870f9c948f..fd8848de4b6 100644 --- a/service/health/healthiface/interface.go +++ b/service/health/healthiface/interface.go @@ -9,7 +9,6 @@ package healthiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/health" ) @@ -65,27 +64,15 @@ import ( type HealthAPI interface { DescribeAffectedEntitiesRequest(*health.DescribeAffectedEntitiesInput) health.DescribeAffectedEntitiesRequest - DescribeAffectedEntitiesPages(*health.DescribeAffectedEntitiesInput, func(*health.DescribeAffectedEntitiesOutput, bool) bool) error - DescribeAffectedEntitiesPagesWithContext(aws.Context, *health.DescribeAffectedEntitiesInput, func(*health.DescribeAffectedEntitiesOutput, bool) bool, ...aws.Option) error - DescribeEntityAggregatesRequest(*health.DescribeEntityAggregatesInput) health.DescribeEntityAggregatesRequest DescribeEventAggregatesRequest(*health.DescribeEventAggregatesInput) health.DescribeEventAggregatesRequest - DescribeEventAggregatesPages(*health.DescribeEventAggregatesInput, func(*health.DescribeEventAggregatesOutput, bool) bool) error - DescribeEventAggregatesPagesWithContext(aws.Context, *health.DescribeEventAggregatesInput, func(*health.DescribeEventAggregatesOutput, bool) bool, ...aws.Option) error - DescribeEventDetailsRequest(*health.DescribeEventDetailsInput) health.DescribeEventDetailsRequest DescribeEventTypesRequest(*health.DescribeEventTypesInput) health.DescribeEventTypesRequest - DescribeEventTypesPages(*health.DescribeEventTypesInput, func(*health.DescribeEventTypesOutput, bool) bool) error - DescribeEventTypesPagesWithContext(aws.Context, *health.DescribeEventTypesInput, func(*health.DescribeEventTypesOutput, bool) bool, ...aws.Option) error - DescribeEventsRequest(*health.DescribeEventsInput) health.DescribeEventsRequest - - DescribeEventsPages(*health.DescribeEventsInput, func(*health.DescribeEventsOutput, bool) bool) error - DescribeEventsPagesWithContext(aws.Context, *health.DescribeEventsInput, func(*health.DescribeEventsOutput, bool) bool, ...aws.Option) error } var _ HealthAPI = (*health.Health)(nil) diff --git a/service/iam/api.go b/service/iam/api.go index b62c8ea3ee2..c0c2ab79d97 100644 --- a/service/iam/api.go +++ b/service/iam/api.go @@ -18,6 +18,7 @@ const opAddClientIDToOpenIDConnectProvider = "AddClientIDToOpenIDConnectProvider type AddClientIDToOpenIDConnectProviderRequest struct { *aws.Request Input *AddClientIDToOpenIDConnectProviderInput + Copy func(*AddClientIDToOpenIDConnectProviderInput) AddClientIDToOpenIDConnectProviderRequest } // Send marshals and sends the AddClientIDToOpenIDConnectProvider API request. @@ -64,7 +65,7 @@ func (c *IAM) AddClientIDToOpenIDConnectProviderRequest(input *AddClientIDToOpen req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddClientIDToOpenIDConnectProviderRequest{Request: req, Input: input} + return AddClientIDToOpenIDConnectProviderRequest{Request: req, Input: input, Copy: c.AddClientIDToOpenIDConnectProviderRequest} } const opAddRoleToInstanceProfile = "AddRoleToInstanceProfile" @@ -73,6 +74,7 @@ const opAddRoleToInstanceProfile = "AddRoleToInstanceProfile" type AddRoleToInstanceProfileRequest struct { *aws.Request Input *AddRoleToInstanceProfileInput + Copy func(*AddRoleToInstanceProfileInput) AddRoleToInstanceProfileRequest } // Send marshals and sends the AddRoleToInstanceProfile API request. @@ -123,7 +125,7 @@ func (c *IAM) AddRoleToInstanceProfileRequest(input *AddRoleToInstanceProfileInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddRoleToInstanceProfileRequest{Request: req, Input: input} + return AddRoleToInstanceProfileRequest{Request: req, Input: input, Copy: c.AddRoleToInstanceProfileRequest} } const opAddUserToGroup = "AddUserToGroup" @@ -132,6 +134,7 @@ const opAddUserToGroup = "AddUserToGroup" type AddUserToGroupRequest struct { *aws.Request Input *AddUserToGroupInput + Copy func(*AddUserToGroupInput) AddUserToGroupRequest } // Send marshals and sends the AddUserToGroup API request. @@ -174,7 +177,7 @@ func (c *IAM) AddUserToGroupRequest(input *AddUserToGroupInput) AddUserToGroupRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddUserToGroupRequest{Request: req, Input: input} + return AddUserToGroupRequest{Request: req, Input: input, Copy: c.AddUserToGroupRequest} } const opAttachGroupPolicy = "AttachGroupPolicy" @@ -183,6 +186,7 @@ const opAttachGroupPolicy = "AttachGroupPolicy" type AttachGroupPolicyRequest struct { *aws.Request Input *AttachGroupPolicyInput + Copy func(*AttachGroupPolicyInput) AttachGroupPolicyRequest } // Send marshals and sends the AttachGroupPolicy API request. @@ -232,7 +236,7 @@ func (c *IAM) AttachGroupPolicyRequest(input *AttachGroupPolicyInput) AttachGrou req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AttachGroupPolicyRequest{Request: req, Input: input} + return AttachGroupPolicyRequest{Request: req, Input: input, Copy: c.AttachGroupPolicyRequest} } const opAttachRolePolicy = "AttachRolePolicy" @@ -241,6 +245,7 @@ const opAttachRolePolicy = "AttachRolePolicy" type AttachRolePolicyRequest struct { *aws.Request Input *AttachRolePolicyInput + Copy func(*AttachRolePolicyInput) AttachRolePolicyRequest } // Send marshals and sends the AttachRolePolicy API request. @@ -294,7 +299,7 @@ func (c *IAM) AttachRolePolicyRequest(input *AttachRolePolicyInput) AttachRolePo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AttachRolePolicyRequest{Request: req, Input: input} + return AttachRolePolicyRequest{Request: req, Input: input, Copy: c.AttachRolePolicyRequest} } const opAttachUserPolicy = "AttachUserPolicy" @@ -303,6 +308,7 @@ const opAttachUserPolicy = "AttachUserPolicy" type AttachUserPolicyRequest struct { *aws.Request Input *AttachUserPolicyInput + Copy func(*AttachUserPolicyInput) AttachUserPolicyRequest } // Send marshals and sends the AttachUserPolicy API request. @@ -352,7 +358,7 @@ func (c *IAM) AttachUserPolicyRequest(input *AttachUserPolicyInput) AttachUserPo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AttachUserPolicyRequest{Request: req, Input: input} + return AttachUserPolicyRequest{Request: req, Input: input, Copy: c.AttachUserPolicyRequest} } const opChangePassword = "ChangePassword" @@ -361,6 +367,7 @@ const opChangePassword = "ChangePassword" type ChangePasswordRequest struct { *aws.Request Input *ChangePasswordInput + Copy func(*ChangePasswordInput) ChangePasswordRequest } // Send marshals and sends the ChangePassword API request. @@ -408,7 +415,7 @@ func (c *IAM) ChangePasswordRequest(input *ChangePasswordInput) ChangePasswordRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ChangePasswordRequest{Request: req, Input: input} + return ChangePasswordRequest{Request: req, Input: input, Copy: c.ChangePasswordRequest} } const opCreateAccessKey = "CreateAccessKey" @@ -417,6 +424,7 @@ const opCreateAccessKey = "CreateAccessKey" type CreateAccessKeyRequest struct { *aws.Request Input *CreateAccessKeyInput + Copy func(*CreateAccessKeyInput) CreateAccessKeyRequest } // Send marshals and sends the CreateAccessKey API request. @@ -473,7 +481,7 @@ func (c *IAM) CreateAccessKeyRequest(input *CreateAccessKeyInput) CreateAccessKe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAccessKeyRequest{Request: req, Input: input} + return CreateAccessKeyRequest{Request: req, Input: input, Copy: c.CreateAccessKeyRequest} } const opCreateAccountAlias = "CreateAccountAlias" @@ -482,6 +490,7 @@ const opCreateAccountAlias = "CreateAccountAlias" type CreateAccountAliasRequest struct { *aws.Request Input *CreateAccountAliasInput + Copy func(*CreateAccountAliasInput) CreateAccountAliasRequest } // Send marshals and sends the CreateAccountAlias API request. @@ -526,7 +535,7 @@ func (c *IAM) CreateAccountAliasRequest(input *CreateAccountAliasInput) CreateAc req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateAccountAliasRequest{Request: req, Input: input} + return CreateAccountAliasRequest{Request: req, Input: input, Copy: c.CreateAccountAliasRequest} } const opCreateGroup = "CreateGroup" @@ -535,6 +544,7 @@ const opCreateGroup = "CreateGroup" type CreateGroupRequest struct { *aws.Request Input *CreateGroupInput + Copy func(*CreateGroupInput) CreateGroupRequest } // Send marshals and sends the CreateGroup API request. @@ -579,7 +589,7 @@ func (c *IAM) CreateGroupRequest(input *CreateGroupInput) CreateGroupRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGroupRequest{Request: req, Input: input} + return CreateGroupRequest{Request: req, Input: input, Copy: c.CreateGroupRequest} } const opCreateInstanceProfile = "CreateInstanceProfile" @@ -588,6 +598,7 @@ const opCreateInstanceProfile = "CreateInstanceProfile" type CreateInstanceProfileRequest struct { *aws.Request Input *CreateInstanceProfileInput + Copy func(*CreateInstanceProfileInput) CreateInstanceProfileRequest } // Send marshals and sends the CreateInstanceProfile API request. @@ -633,7 +644,7 @@ func (c *IAM) CreateInstanceProfileRequest(input *CreateInstanceProfileInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInstanceProfileRequest{Request: req, Input: input} + return CreateInstanceProfileRequest{Request: req, Input: input, Copy: c.CreateInstanceProfileRequest} } const opCreateLoginProfile = "CreateLoginProfile" @@ -642,6 +653,7 @@ const opCreateLoginProfile = "CreateLoginProfile" type CreateLoginProfileRequest struct { *aws.Request Input *CreateLoginProfileInput + Copy func(*CreateLoginProfileInput) CreateLoginProfileRequest } // Send marshals and sends the CreateLoginProfile API request. @@ -685,7 +697,7 @@ func (c *IAM) CreateLoginProfileRequest(input *CreateLoginProfileInput) CreateLo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLoginProfileRequest{Request: req, Input: input} + return CreateLoginProfileRequest{Request: req, Input: input, Copy: c.CreateLoginProfileRequest} } const opCreateOpenIDConnectProvider = "CreateOpenIDConnectProvider" @@ -694,6 +706,7 @@ const opCreateOpenIDConnectProvider = "CreateOpenIDConnectProvider" type CreateOpenIDConnectProviderRequest struct { *aws.Request Input *CreateOpenIDConnectProviderInput + Copy func(*CreateOpenIDConnectProviderInput) CreateOpenIDConnectProviderRequest } // Send marshals and sends the CreateOpenIDConnectProvider API request. @@ -750,7 +763,7 @@ func (c *IAM) CreateOpenIDConnectProviderRequest(input *CreateOpenIDConnectProvi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateOpenIDConnectProviderRequest{Request: req, Input: input} + return CreateOpenIDConnectProviderRequest{Request: req, Input: input, Copy: c.CreateOpenIDConnectProviderRequest} } const opCreatePolicy = "CreatePolicy" @@ -759,6 +772,7 @@ const opCreatePolicy = "CreatePolicy" type CreatePolicyRequest struct { *aws.Request Input *CreatePolicyInput + Copy func(*CreatePolicyInput) CreatePolicyRequest } // Send marshals and sends the CreatePolicy API request. @@ -808,7 +822,7 @@ func (c *IAM) CreatePolicyRequest(input *CreatePolicyInput) CreatePolicyRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePolicyRequest{Request: req, Input: input} + return CreatePolicyRequest{Request: req, Input: input, Copy: c.CreatePolicyRequest} } const opCreatePolicyVersion = "CreatePolicyVersion" @@ -817,6 +831,7 @@ const opCreatePolicyVersion = "CreatePolicyVersion" type CreatePolicyVersionRequest struct { *aws.Request Input *CreatePolicyVersionInput + Copy func(*CreatePolicyVersionInput) CreatePolicyVersionRequest } // Send marshals and sends the CreatePolicyVersion API request. @@ -868,7 +883,7 @@ func (c *IAM) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePolicyVersionRequest{Request: req, Input: input} + return CreatePolicyVersionRequest{Request: req, Input: input, Copy: c.CreatePolicyVersionRequest} } const opCreateRole = "CreateRole" @@ -877,6 +892,7 @@ const opCreateRole = "CreateRole" type CreateRoleRequest struct { *aws.Request Input *CreateRoleInput + Copy func(*CreateRoleInput) CreateRoleRequest } // Send marshals and sends the CreateRole API request. @@ -921,7 +937,7 @@ func (c *IAM) CreateRoleRequest(input *CreateRoleInput) CreateRoleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRoleRequest{Request: req, Input: input} + return CreateRoleRequest{Request: req, Input: input, Copy: c.CreateRoleRequest} } const opCreateSAMLProvider = "CreateSAMLProvider" @@ -930,6 +946,7 @@ const opCreateSAMLProvider = "CreateSAMLProvider" type CreateSAMLProviderRequest struct { *aws.Request Input *CreateSAMLProviderInput + Copy func(*CreateSAMLProviderInput) CreateSAMLProviderRequest } // Send marshals and sends the CreateSAMLProvider API request. @@ -991,7 +1008,7 @@ func (c *IAM) CreateSAMLProviderRequest(input *CreateSAMLProviderInput) CreateSA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSAMLProviderRequest{Request: req, Input: input} + return CreateSAMLProviderRequest{Request: req, Input: input, Copy: c.CreateSAMLProviderRequest} } const opCreateServiceLinkedRole = "CreateServiceLinkedRole" @@ -1000,6 +1017,7 @@ const opCreateServiceLinkedRole = "CreateServiceLinkedRole" type CreateServiceLinkedRoleRequest struct { *aws.Request Input *CreateServiceLinkedRoleInput + Copy func(*CreateServiceLinkedRoleInput) CreateServiceLinkedRoleRequest } // Send marshals and sends the CreateServiceLinkedRole API request. @@ -1053,7 +1071,7 @@ func (c *IAM) CreateServiceLinkedRoleRequest(input *CreateServiceLinkedRoleInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateServiceLinkedRoleRequest{Request: req, Input: input} + return CreateServiceLinkedRoleRequest{Request: req, Input: input, Copy: c.CreateServiceLinkedRoleRequest} } const opCreateServiceSpecificCredential = "CreateServiceSpecificCredential" @@ -1062,6 +1080,7 @@ const opCreateServiceSpecificCredential = "CreateServiceSpecificCredential" type CreateServiceSpecificCredentialRequest struct { *aws.Request Input *CreateServiceSpecificCredentialInput + Copy func(*CreateServiceSpecificCredentialInput) CreateServiceSpecificCredentialRequest } // Send marshals and sends the CreateServiceSpecificCredential API request. @@ -1115,7 +1134,7 @@ func (c *IAM) CreateServiceSpecificCredentialRequest(input *CreateServiceSpecifi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateServiceSpecificCredentialRequest{Request: req, Input: input} + return CreateServiceSpecificCredentialRequest{Request: req, Input: input, Copy: c.CreateServiceSpecificCredentialRequest} } const opCreateUser = "CreateUser" @@ -1124,6 +1143,7 @@ const opCreateUser = "CreateUser" type CreateUserRequest struct { *aws.Request Input *CreateUserInput + Copy func(*CreateUserInput) CreateUserRequest } // Send marshals and sends the CreateUser API request. @@ -1168,7 +1188,7 @@ func (c *IAM) CreateUserRequest(input *CreateUserInput) CreateUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserRequest{Request: req, Input: input} + return CreateUserRequest{Request: req, Input: input, Copy: c.CreateUserRequest} } const opCreateVirtualMFADevice = "CreateVirtualMFADevice" @@ -1177,6 +1197,7 @@ const opCreateVirtualMFADevice = "CreateVirtualMFADevice" type CreateVirtualMFADeviceRequest struct { *aws.Request Input *CreateVirtualMFADeviceInput + Copy func(*CreateVirtualMFADeviceInput) CreateVirtualMFADeviceRequest } // Send marshals and sends the CreateVirtualMFADevice API request. @@ -1230,7 +1251,7 @@ func (c *IAM) CreateVirtualMFADeviceRequest(input *CreateVirtualMFADeviceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVirtualMFADeviceRequest{Request: req, Input: input} + return CreateVirtualMFADeviceRequest{Request: req, Input: input, Copy: c.CreateVirtualMFADeviceRequest} } const opDeactivateMFADevice = "DeactivateMFADevice" @@ -1239,6 +1260,7 @@ const opDeactivateMFADevice = "DeactivateMFADevice" type DeactivateMFADeviceRequest struct { *aws.Request Input *DeactivateMFADeviceInput + Copy func(*DeactivateMFADeviceInput) DeactivateMFADeviceRequest } // Send marshals and sends the DeactivateMFADevice API request. @@ -1286,7 +1308,7 @@ func (c *IAM) DeactivateMFADeviceRequest(input *DeactivateMFADeviceInput) Deacti req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeactivateMFADeviceRequest{Request: req, Input: input} + return DeactivateMFADeviceRequest{Request: req, Input: input, Copy: c.DeactivateMFADeviceRequest} } const opDeleteAccessKey = "DeleteAccessKey" @@ -1295,6 +1317,7 @@ const opDeleteAccessKey = "DeleteAccessKey" type DeleteAccessKeyRequest struct { *aws.Request Input *DeleteAccessKeyInput + Copy func(*DeleteAccessKeyInput) DeleteAccessKeyRequest } // Send marshals and sends the DeleteAccessKey API request. @@ -1342,7 +1365,7 @@ func (c *IAM) DeleteAccessKeyRequest(input *DeleteAccessKeyInput) DeleteAccessKe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAccessKeyRequest{Request: req, Input: input} + return DeleteAccessKeyRequest{Request: req, Input: input, Copy: c.DeleteAccessKeyRequest} } const opDeleteAccountAlias = "DeleteAccountAlias" @@ -1351,6 +1374,7 @@ const opDeleteAccountAlias = "DeleteAccountAlias" type DeleteAccountAliasRequest struct { *aws.Request Input *DeleteAccountAliasInput + Copy func(*DeleteAccountAliasInput) DeleteAccountAliasRequest } // Send marshals and sends the DeleteAccountAlias API request. @@ -1395,7 +1419,7 @@ func (c *IAM) DeleteAccountAliasRequest(input *DeleteAccountAliasInput) DeleteAc req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAccountAliasRequest{Request: req, Input: input} + return DeleteAccountAliasRequest{Request: req, Input: input, Copy: c.DeleteAccountAliasRequest} } const opDeleteAccountPasswordPolicy = "DeleteAccountPasswordPolicy" @@ -1404,6 +1428,7 @@ const opDeleteAccountPasswordPolicy = "DeleteAccountPasswordPolicy" type DeleteAccountPasswordPolicyRequest struct { *aws.Request Input *DeleteAccountPasswordPolicyInput + Copy func(*DeleteAccountPasswordPolicyInput) DeleteAccountPasswordPolicyRequest } // Send marshals and sends the DeleteAccountPasswordPolicy API request. @@ -1446,7 +1471,7 @@ func (c *IAM) DeleteAccountPasswordPolicyRequest(input *DeleteAccountPasswordPol req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAccountPasswordPolicyRequest{Request: req, Input: input} + return DeleteAccountPasswordPolicyRequest{Request: req, Input: input, Copy: c.DeleteAccountPasswordPolicyRequest} } const opDeleteGroup = "DeleteGroup" @@ -1455,6 +1480,7 @@ const opDeleteGroup = "DeleteGroup" type DeleteGroupRequest struct { *aws.Request Input *DeleteGroupInput + Copy func(*DeleteGroupInput) DeleteGroupRequest } // Send marshals and sends the DeleteGroup API request. @@ -1498,7 +1524,7 @@ func (c *IAM) DeleteGroupRequest(input *DeleteGroupInput) DeleteGroupRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteGroupRequest{Request: req, Input: input} + return DeleteGroupRequest{Request: req, Input: input, Copy: c.DeleteGroupRequest} } const opDeleteGroupPolicy = "DeleteGroupPolicy" @@ -1507,6 +1533,7 @@ const opDeleteGroupPolicy = "DeleteGroupPolicy" type DeleteGroupPolicyRequest struct { *aws.Request Input *DeleteGroupPolicyInput + Copy func(*DeleteGroupPolicyInput) DeleteGroupPolicyRequest } // Send marshals and sends the DeleteGroupPolicy API request. @@ -1555,7 +1582,7 @@ func (c *IAM) DeleteGroupPolicyRequest(input *DeleteGroupPolicyInput) DeleteGrou req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteGroupPolicyRequest{Request: req, Input: input} + return DeleteGroupPolicyRequest{Request: req, Input: input, Copy: c.DeleteGroupPolicyRequest} } const opDeleteInstanceProfile = "DeleteInstanceProfile" @@ -1564,6 +1591,7 @@ const opDeleteInstanceProfile = "DeleteInstanceProfile" type DeleteInstanceProfileRequest struct { *aws.Request Input *DeleteInstanceProfileInput + Copy func(*DeleteInstanceProfileInput) DeleteInstanceProfileRequest } // Send marshals and sends the DeleteInstanceProfile API request. @@ -1615,7 +1643,7 @@ func (c *IAM) DeleteInstanceProfileRequest(input *DeleteInstanceProfileInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteInstanceProfileRequest{Request: req, Input: input} + return DeleteInstanceProfileRequest{Request: req, Input: input, Copy: c.DeleteInstanceProfileRequest} } const opDeleteLoginProfile = "DeleteLoginProfile" @@ -1624,6 +1652,7 @@ const opDeleteLoginProfile = "DeleteLoginProfile" type DeleteLoginProfileRequest struct { *aws.Request Input *DeleteLoginProfileInput + Copy func(*DeleteLoginProfileInput) DeleteLoginProfileRequest } // Send marshals and sends the DeleteLoginProfile API request. @@ -1672,7 +1701,7 @@ func (c *IAM) DeleteLoginProfileRequest(input *DeleteLoginProfileInput) DeleteLo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteLoginProfileRequest{Request: req, Input: input} + return DeleteLoginProfileRequest{Request: req, Input: input, Copy: c.DeleteLoginProfileRequest} } const opDeleteOpenIDConnectProvider = "DeleteOpenIDConnectProvider" @@ -1681,6 +1710,7 @@ const opDeleteOpenIDConnectProvider = "DeleteOpenIDConnectProvider" type DeleteOpenIDConnectProviderRequest struct { *aws.Request Input *DeleteOpenIDConnectProviderInput + Copy func(*DeleteOpenIDConnectProviderInput) DeleteOpenIDConnectProviderRequest } // Send marshals and sends the DeleteOpenIDConnectProvider API request. @@ -1730,7 +1760,7 @@ func (c *IAM) DeleteOpenIDConnectProviderRequest(input *DeleteOpenIDConnectProvi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteOpenIDConnectProviderRequest{Request: req, Input: input} + return DeleteOpenIDConnectProviderRequest{Request: req, Input: input, Copy: c.DeleteOpenIDConnectProviderRequest} } const opDeletePolicy = "DeletePolicy" @@ -1739,6 +1769,7 @@ const opDeletePolicy = "DeletePolicy" type DeletePolicyRequest struct { *aws.Request Input *DeletePolicyInput + Copy func(*DeletePolicyInput) DeletePolicyRequest } // Send marshals and sends the DeletePolicy API request. @@ -1803,7 +1834,7 @@ func (c *IAM) DeletePolicyRequest(input *DeletePolicyInput) DeletePolicyRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePolicyRequest{Request: req, Input: input} + return DeletePolicyRequest{Request: req, Input: input, Copy: c.DeletePolicyRequest} } const opDeletePolicyVersion = "DeletePolicyVersion" @@ -1812,6 +1843,7 @@ const opDeletePolicyVersion = "DeletePolicyVersion" type DeletePolicyVersionRequest struct { *aws.Request Input *DeletePolicyVersionInput + Copy func(*DeletePolicyVersionInput) DeletePolicyVersionRequest } // Send marshals and sends the DeletePolicyVersion API request. @@ -1862,7 +1894,7 @@ func (c *IAM) DeletePolicyVersionRequest(input *DeletePolicyVersionInput) Delete req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePolicyVersionRequest{Request: req, Input: input} + return DeletePolicyVersionRequest{Request: req, Input: input, Copy: c.DeletePolicyVersionRequest} } const opDeleteRole = "DeleteRole" @@ -1871,6 +1903,7 @@ const opDeleteRole = "DeleteRole" type DeleteRoleRequest struct { *aws.Request Input *DeleteRoleInput + Copy func(*DeleteRoleInput) DeleteRoleRequest } // Send marshals and sends the DeleteRole API request. @@ -1918,7 +1951,7 @@ func (c *IAM) DeleteRoleRequest(input *DeleteRoleInput) DeleteRoleRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteRoleRequest{Request: req, Input: input} + return DeleteRoleRequest{Request: req, Input: input, Copy: c.DeleteRoleRequest} } const opDeleteRolePolicy = "DeleteRolePolicy" @@ -1927,6 +1960,7 @@ const opDeleteRolePolicy = "DeleteRolePolicy" type DeleteRolePolicyRequest struct { *aws.Request Input *DeleteRolePolicyInput + Copy func(*DeleteRolePolicyInput) DeleteRolePolicyRequest } // Send marshals and sends the DeleteRolePolicy API request. @@ -1975,7 +2009,7 @@ func (c *IAM) DeleteRolePolicyRequest(input *DeleteRolePolicyInput) DeleteRolePo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteRolePolicyRequest{Request: req, Input: input} + return DeleteRolePolicyRequest{Request: req, Input: input, Copy: c.DeleteRolePolicyRequest} } const opDeleteSAMLProvider = "DeleteSAMLProvider" @@ -1984,6 +2018,7 @@ const opDeleteSAMLProvider = "DeleteSAMLProvider" type DeleteSAMLProviderRequest struct { *aws.Request Input *DeleteSAMLProviderInput + Copy func(*DeleteSAMLProviderInput) DeleteSAMLProviderRequest } // Send marshals and sends the DeleteSAMLProvider API request. @@ -2033,7 +2068,7 @@ func (c *IAM) DeleteSAMLProviderRequest(input *DeleteSAMLProviderInput) DeleteSA req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSAMLProviderRequest{Request: req, Input: input} + return DeleteSAMLProviderRequest{Request: req, Input: input, Copy: c.DeleteSAMLProviderRequest} } const opDeleteSSHPublicKey = "DeleteSSHPublicKey" @@ -2042,6 +2077,7 @@ const opDeleteSSHPublicKey = "DeleteSSHPublicKey" type DeleteSSHPublicKeyRequest struct { *aws.Request Input *DeleteSSHPublicKeyInput + Copy func(*DeleteSSHPublicKeyInput) DeleteSSHPublicKeyRequest } // Send marshals and sends the DeleteSSHPublicKey API request. @@ -2090,7 +2126,7 @@ func (c *IAM) DeleteSSHPublicKeyRequest(input *DeleteSSHPublicKeyInput) DeleteSS req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSSHPublicKeyRequest{Request: req, Input: input} + return DeleteSSHPublicKeyRequest{Request: req, Input: input, Copy: c.DeleteSSHPublicKeyRequest} } const opDeleteServerCertificate = "DeleteServerCertificate" @@ -2099,6 +2135,7 @@ const opDeleteServerCertificate = "DeleteServerCertificate" type DeleteServerCertificateRequest struct { *aws.Request Input *DeleteServerCertificateInput + Copy func(*DeleteServerCertificateInput) DeleteServerCertificateRequest } // Send marshals and sends the DeleteServerCertificate API request. @@ -2156,7 +2193,7 @@ func (c *IAM) DeleteServerCertificateRequest(input *DeleteServerCertificateInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteServerCertificateRequest{Request: req, Input: input} + return DeleteServerCertificateRequest{Request: req, Input: input, Copy: c.DeleteServerCertificateRequest} } const opDeleteServiceLinkedRole = "DeleteServiceLinkedRole" @@ -2165,6 +2202,7 @@ const opDeleteServiceLinkedRole = "DeleteServiceLinkedRole" type DeleteServiceLinkedRoleRequest struct { *aws.Request Input *DeleteServiceLinkedRoleInput + Copy func(*DeleteServiceLinkedRoleInput) DeleteServiceLinkedRoleRequest } // Send marshals and sends the DeleteServiceLinkedRole API request. @@ -2224,7 +2262,7 @@ func (c *IAM) DeleteServiceLinkedRoleRequest(input *DeleteServiceLinkedRoleInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteServiceLinkedRoleRequest{Request: req, Input: input} + return DeleteServiceLinkedRoleRequest{Request: req, Input: input, Copy: c.DeleteServiceLinkedRoleRequest} } const opDeleteServiceSpecificCredential = "DeleteServiceSpecificCredential" @@ -2233,6 +2271,7 @@ const opDeleteServiceSpecificCredential = "DeleteServiceSpecificCredential" type DeleteServiceSpecificCredentialRequest struct { *aws.Request Input *DeleteServiceSpecificCredentialInput + Copy func(*DeleteServiceSpecificCredentialInput) DeleteServiceSpecificCredentialRequest } // Send marshals and sends the DeleteServiceSpecificCredential API request. @@ -2275,7 +2314,7 @@ func (c *IAM) DeleteServiceSpecificCredentialRequest(input *DeleteServiceSpecifi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteServiceSpecificCredentialRequest{Request: req, Input: input} + return DeleteServiceSpecificCredentialRequest{Request: req, Input: input, Copy: c.DeleteServiceSpecificCredentialRequest} } const opDeleteSigningCertificate = "DeleteSigningCertificate" @@ -2284,6 +2323,7 @@ const opDeleteSigningCertificate = "DeleteSigningCertificate" type DeleteSigningCertificateRequest struct { *aws.Request Input *DeleteSigningCertificateInput + Copy func(*DeleteSigningCertificateInput) DeleteSigningCertificateRequest } // Send marshals and sends the DeleteSigningCertificate API request. @@ -2331,7 +2371,7 @@ func (c *IAM) DeleteSigningCertificateRequest(input *DeleteSigningCertificateInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSigningCertificateRequest{Request: req, Input: input} + return DeleteSigningCertificateRequest{Request: req, Input: input, Copy: c.DeleteSigningCertificateRequest} } const opDeleteUser = "DeleteUser" @@ -2340,6 +2380,7 @@ const opDeleteUser = "DeleteUser" type DeleteUserRequest struct { *aws.Request Input *DeleteUserInput + Copy func(*DeleteUserInput) DeleteUserRequest } // Send marshals and sends the DeleteUser API request. @@ -2383,7 +2424,7 @@ func (c *IAM) DeleteUserRequest(input *DeleteUserInput) DeleteUserRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteUserRequest{Request: req, Input: input} + return DeleteUserRequest{Request: req, Input: input, Copy: c.DeleteUserRequest} } const opDeleteUserPolicy = "DeleteUserPolicy" @@ -2392,6 +2433,7 @@ const opDeleteUserPolicy = "DeleteUserPolicy" type DeleteUserPolicyRequest struct { *aws.Request Input *DeleteUserPolicyInput + Copy func(*DeleteUserPolicyInput) DeleteUserPolicyRequest } // Send marshals and sends the DeleteUserPolicy API request. @@ -2440,7 +2482,7 @@ func (c *IAM) DeleteUserPolicyRequest(input *DeleteUserPolicyInput) DeleteUserPo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteUserPolicyRequest{Request: req, Input: input} + return DeleteUserPolicyRequest{Request: req, Input: input, Copy: c.DeleteUserPolicyRequest} } const opDeleteVirtualMFADevice = "DeleteVirtualMFADevice" @@ -2449,6 +2491,7 @@ const opDeleteVirtualMFADevice = "DeleteVirtualMFADevice" type DeleteVirtualMFADeviceRequest struct { *aws.Request Input *DeleteVirtualMFADeviceInput + Copy func(*DeleteVirtualMFADeviceInput) DeleteVirtualMFADeviceRequest } // Send marshals and sends the DeleteVirtualMFADevice API request. @@ -2494,7 +2537,7 @@ func (c *IAM) DeleteVirtualMFADeviceRequest(input *DeleteVirtualMFADeviceInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVirtualMFADeviceRequest{Request: req, Input: input} + return DeleteVirtualMFADeviceRequest{Request: req, Input: input, Copy: c.DeleteVirtualMFADeviceRequest} } const opDetachGroupPolicy = "DetachGroupPolicy" @@ -2503,6 +2546,7 @@ const opDetachGroupPolicy = "DetachGroupPolicy" type DetachGroupPolicyRequest struct { *aws.Request Input *DetachGroupPolicyInput + Copy func(*DetachGroupPolicyInput) DetachGroupPolicyRequest } // Send marshals and sends the DetachGroupPolicy API request. @@ -2550,7 +2594,7 @@ func (c *IAM) DetachGroupPolicyRequest(input *DetachGroupPolicyInput) DetachGrou req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachGroupPolicyRequest{Request: req, Input: input} + return DetachGroupPolicyRequest{Request: req, Input: input, Copy: c.DetachGroupPolicyRequest} } const opDetachRolePolicy = "DetachRolePolicy" @@ -2559,6 +2603,7 @@ const opDetachRolePolicy = "DetachRolePolicy" type DetachRolePolicyRequest struct { *aws.Request Input *DetachRolePolicyInput + Copy func(*DetachRolePolicyInput) DetachRolePolicyRequest } // Send marshals and sends the DetachRolePolicy API request. @@ -2606,7 +2651,7 @@ func (c *IAM) DetachRolePolicyRequest(input *DetachRolePolicyInput) DetachRolePo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachRolePolicyRequest{Request: req, Input: input} + return DetachRolePolicyRequest{Request: req, Input: input, Copy: c.DetachRolePolicyRequest} } const opDetachUserPolicy = "DetachUserPolicy" @@ -2615,6 +2660,7 @@ const opDetachUserPolicy = "DetachUserPolicy" type DetachUserPolicyRequest struct { *aws.Request Input *DetachUserPolicyInput + Copy func(*DetachUserPolicyInput) DetachUserPolicyRequest } // Send marshals and sends the DetachUserPolicy API request. @@ -2662,7 +2708,7 @@ func (c *IAM) DetachUserPolicyRequest(input *DetachUserPolicyInput) DetachUserPo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachUserPolicyRequest{Request: req, Input: input} + return DetachUserPolicyRequest{Request: req, Input: input, Copy: c.DetachUserPolicyRequest} } const opEnableMFADevice = "EnableMFADevice" @@ -2671,6 +2717,7 @@ const opEnableMFADevice = "EnableMFADevice" type EnableMFADeviceRequest struct { *aws.Request Input *EnableMFADeviceInput + Copy func(*EnableMFADeviceInput) EnableMFADeviceRequest } // Send marshals and sends the EnableMFADevice API request. @@ -2715,7 +2762,7 @@ func (c *IAM) EnableMFADeviceRequest(input *EnableMFADeviceInput) EnableMFADevic req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableMFADeviceRequest{Request: req, Input: input} + return EnableMFADeviceRequest{Request: req, Input: input, Copy: c.EnableMFADeviceRequest} } const opGenerateCredentialReport = "GenerateCredentialReport" @@ -2724,6 +2771,7 @@ const opGenerateCredentialReport = "GenerateCredentialReport" type GenerateCredentialReportRequest struct { *aws.Request Input *GenerateCredentialReportInput + Copy func(*GenerateCredentialReportInput) GenerateCredentialReportRequest } // Send marshals and sends the GenerateCredentialReport API request. @@ -2766,7 +2814,7 @@ func (c *IAM) GenerateCredentialReportRequest(input *GenerateCredentialReportInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GenerateCredentialReportRequest{Request: req, Input: input} + return GenerateCredentialReportRequest{Request: req, Input: input, Copy: c.GenerateCredentialReportRequest} } const opGetAccessKeyLastUsed = "GetAccessKeyLastUsed" @@ -2775,6 +2823,7 @@ const opGetAccessKeyLastUsed = "GetAccessKeyLastUsed" type GetAccessKeyLastUsedRequest struct { *aws.Request Input *GetAccessKeyLastUsedInput + Copy func(*GetAccessKeyLastUsedInput) GetAccessKeyLastUsedRequest } // Send marshals and sends the GetAccessKeyLastUsed API request. @@ -2818,7 +2867,7 @@ func (c *IAM) GetAccessKeyLastUsedRequest(input *GetAccessKeyLastUsedInput) GetA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccessKeyLastUsedRequest{Request: req, Input: input} + return GetAccessKeyLastUsedRequest{Request: req, Input: input, Copy: c.GetAccessKeyLastUsedRequest} } const opGetAccountAuthorizationDetails = "GetAccountAuthorizationDetails" @@ -2827,6 +2876,7 @@ const opGetAccountAuthorizationDetails = "GetAccountAuthorizationDetails" type GetAccountAuthorizationDetailsRequest struct { *aws.Request Input *GetAccountAuthorizationDetailsInput + Copy func(*GetAccountAuthorizationDetailsInput) GetAccountAuthorizationDetailsRequest } // Send marshals and sends the GetAccountAuthorizationDetails API request. @@ -2879,57 +2929,53 @@ func (c *IAM) GetAccountAuthorizationDetailsRequest(input *GetAccountAuthorizati req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccountAuthorizationDetailsRequest{Request: req, Input: input} + return GetAccountAuthorizationDetailsRequest{Request: req, Input: input, Copy: c.GetAccountAuthorizationDetailsRequest} } -// GetAccountAuthorizationDetailsPages iterates over the pages of a GetAccountAuthorizationDetails operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetAccountAuthorizationDetails method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetAccountAuthorizationDetailsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetAccountAuthorizationDetails operation. -// pageNum := 0 -// err := client.GetAccountAuthorizationDetailsPages(params, -// func(page *GetAccountAuthorizationDetailsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) GetAccountAuthorizationDetailsPages(input *GetAccountAuthorizationDetailsInput, fn func(*GetAccountAuthorizationDetailsOutput, bool) bool) error { - return c.GetAccountAuthorizationDetailsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetAccountAuthorizationDetailsPagesWithContext same as GetAccountAuthorizationDetailsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) GetAccountAuthorizationDetailsPagesWithContext(ctx aws.Context, input *GetAccountAuthorizationDetailsInput, fn func(*GetAccountAuthorizationDetailsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetAccountAuthorizationDetailsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetAccountAuthorizationDetailsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetAccountAuthorizationDetailsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetAccountAuthorizationDetailsRequest) Paginate(opts ...aws.Option) GetAccountAuthorizationDetailsPager { + return GetAccountAuthorizationDetailsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetAccountAuthorizationDetailsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetAccountAuthorizationDetailsOutput), !p.HasNextPage()) - } - return p.Err() +// GetAccountAuthorizationDetailsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetAccountAuthorizationDetailsPager struct { + aws.Pager +} + +func (p *GetAccountAuthorizationDetailsPager) CurrentPage() *GetAccountAuthorizationDetailsOutput { + return p.Pager.CurrentPage().(*GetAccountAuthorizationDetailsOutput) } const opGetAccountPasswordPolicy = "GetAccountPasswordPolicy" @@ -2938,6 +2984,7 @@ const opGetAccountPasswordPolicy = "GetAccountPasswordPolicy" type GetAccountPasswordPolicyRequest struct { *aws.Request Input *GetAccountPasswordPolicyInput + Copy func(*GetAccountPasswordPolicyInput) GetAccountPasswordPolicyRequest } // Send marshals and sends the GetAccountPasswordPolicy API request. @@ -2979,7 +3026,7 @@ func (c *IAM) GetAccountPasswordPolicyRequest(input *GetAccountPasswordPolicyInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccountPasswordPolicyRequest{Request: req, Input: input} + return GetAccountPasswordPolicyRequest{Request: req, Input: input, Copy: c.GetAccountPasswordPolicyRequest} } const opGetAccountSummary = "GetAccountSummary" @@ -2988,6 +3035,7 @@ const opGetAccountSummary = "GetAccountSummary" type GetAccountSummaryRequest struct { *aws.Request Input *GetAccountSummaryInput + Copy func(*GetAccountSummaryInput) GetAccountSummaryRequest } // Send marshals and sends the GetAccountSummary API request. @@ -3032,7 +3080,7 @@ func (c *IAM) GetAccountSummaryRequest(input *GetAccountSummaryInput) GetAccount req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccountSummaryRequest{Request: req, Input: input} + return GetAccountSummaryRequest{Request: req, Input: input, Copy: c.GetAccountSummaryRequest} } const opGetContextKeysForCustomPolicy = "GetContextKeysForCustomPolicy" @@ -3041,6 +3089,7 @@ const opGetContextKeysForCustomPolicy = "GetContextKeysForCustomPolicy" type GetContextKeysForCustomPolicyRequest struct { *aws.Request Input *GetContextKeysForCustomPolicyInput + Copy func(*GetContextKeysForCustomPolicyInput) GetContextKeysForCustomPolicyRequest } // Send marshals and sends the GetContextKeysForCustomPolicy API request. @@ -3090,7 +3139,7 @@ func (c *IAM) GetContextKeysForCustomPolicyRequest(input *GetContextKeysForCusto req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetContextKeysForCustomPolicyRequest{Request: req, Input: input} + return GetContextKeysForCustomPolicyRequest{Request: req, Input: input, Copy: c.GetContextKeysForCustomPolicyRequest} } const opGetContextKeysForPrincipalPolicy = "GetContextKeysForPrincipalPolicy" @@ -3099,6 +3148,7 @@ const opGetContextKeysForPrincipalPolicy = "GetContextKeysForPrincipalPolicy" type GetContextKeysForPrincipalPolicyRequest struct { *aws.Request Input *GetContextKeysForPrincipalPolicyInput + Copy func(*GetContextKeysForPrincipalPolicyInput) GetContextKeysForPrincipalPolicyRequest } // Send marshals and sends the GetContextKeysForPrincipalPolicy API request. @@ -3155,7 +3205,7 @@ func (c *IAM) GetContextKeysForPrincipalPolicyRequest(input *GetContextKeysForPr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetContextKeysForPrincipalPolicyRequest{Request: req, Input: input} + return GetContextKeysForPrincipalPolicyRequest{Request: req, Input: input, Copy: c.GetContextKeysForPrincipalPolicyRequest} } const opGetCredentialReport = "GetCredentialReport" @@ -3164,6 +3214,7 @@ const opGetCredentialReport = "GetCredentialReport" type GetCredentialReportRequest struct { *aws.Request Input *GetCredentialReportInput + Copy func(*GetCredentialReportInput) GetCredentialReportRequest } // Send marshals and sends the GetCredentialReport API request. @@ -3206,7 +3257,7 @@ func (c *IAM) GetCredentialReportRequest(input *GetCredentialReportInput) GetCre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCredentialReportRequest{Request: req, Input: input} + return GetCredentialReportRequest{Request: req, Input: input, Copy: c.GetCredentialReportRequest} } const opGetGroup = "GetGroup" @@ -3215,6 +3266,7 @@ const opGetGroup = "GetGroup" type GetGroupRequest struct { *aws.Request Input *GetGroupInput + Copy func(*GetGroupInput) GetGroupRequest } // Send marshals and sends the GetGroup API request. @@ -3262,57 +3314,53 @@ func (c *IAM) GetGroupRequest(input *GetGroupInput) GetGroupRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGroupRequest{Request: req, Input: input} + return GetGroupRequest{Request: req, Input: input, Copy: c.GetGroupRequest} } -// GetGroupPages iterates over the pages of a GetGroup operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetGroup method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetGroupRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetGroup operation. -// pageNum := 0 -// err := client.GetGroupPages(params, -// func(page *GetGroupOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) GetGroupPages(input *GetGroupInput, fn func(*GetGroupOutput, bool) bool) error { - return c.GetGroupPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetGroupPagesWithContext same as GetGroupPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) GetGroupPagesWithContext(ctx aws.Context, input *GetGroupInput, fn func(*GetGroupOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetGroupInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetGroupRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetGroupRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetGroupRequest) Paginate(opts ...aws.Option) GetGroupPager { + return GetGroupPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetGroupInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetGroupOutput), !p.HasNextPage()) - } - return p.Err() +// GetGroupPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetGroupPager struct { + aws.Pager +} + +func (p *GetGroupPager) CurrentPage() *GetGroupOutput { + return p.Pager.CurrentPage().(*GetGroupOutput) } const opGetGroupPolicy = "GetGroupPolicy" @@ -3321,6 +3369,7 @@ const opGetGroupPolicy = "GetGroupPolicy" type GetGroupPolicyRequest struct { *aws.Request Input *GetGroupPolicyInput + Copy func(*GetGroupPolicyInput) GetGroupPolicyRequest } // Send marshals and sends the GetGroupPolicy API request. @@ -3377,7 +3426,7 @@ func (c *IAM) GetGroupPolicyRequest(input *GetGroupPolicyInput) GetGroupPolicyRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGroupPolicyRequest{Request: req, Input: input} + return GetGroupPolicyRequest{Request: req, Input: input, Copy: c.GetGroupPolicyRequest} } const opGetInstanceProfile = "GetInstanceProfile" @@ -3386,6 +3435,7 @@ const opGetInstanceProfile = "GetInstanceProfile" type GetInstanceProfileRequest struct { *aws.Request Input *GetInstanceProfileInput + Copy func(*GetInstanceProfileInput) GetInstanceProfileRequest } // Send marshals and sends the GetInstanceProfile API request. @@ -3429,7 +3479,7 @@ func (c *IAM) GetInstanceProfileRequest(input *GetInstanceProfileInput) GetInsta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstanceProfileRequest{Request: req, Input: input} + return GetInstanceProfileRequest{Request: req, Input: input, Copy: c.GetInstanceProfileRequest} } const opGetLoginProfile = "GetLoginProfile" @@ -3438,6 +3488,7 @@ const opGetLoginProfile = "GetLoginProfile" type GetLoginProfileRequest struct { *aws.Request Input *GetLoginProfileInput + Copy func(*GetLoginProfileInput) GetLoginProfileRequest } // Send marshals and sends the GetLoginProfile API request. @@ -3480,7 +3531,7 @@ func (c *IAM) GetLoginProfileRequest(input *GetLoginProfileInput) GetLoginProfil req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLoginProfileRequest{Request: req, Input: input} + return GetLoginProfileRequest{Request: req, Input: input, Copy: c.GetLoginProfileRequest} } const opGetOpenIDConnectProvider = "GetOpenIDConnectProvider" @@ -3489,6 +3540,7 @@ const opGetOpenIDConnectProvider = "GetOpenIDConnectProvider" type GetOpenIDConnectProviderRequest struct { *aws.Request Input *GetOpenIDConnectProviderInput + Copy func(*GetOpenIDConnectProviderInput) GetOpenIDConnectProviderRequest } // Send marshals and sends the GetOpenIDConnectProvider API request. @@ -3530,7 +3582,7 @@ func (c *IAM) GetOpenIDConnectProviderRequest(input *GetOpenIDConnectProviderInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOpenIDConnectProviderRequest{Request: req, Input: input} + return GetOpenIDConnectProviderRequest{Request: req, Input: input, Copy: c.GetOpenIDConnectProviderRequest} } const opGetPolicy = "GetPolicy" @@ -3539,6 +3591,7 @@ const opGetPolicy = "GetPolicy" type GetPolicyRequest struct { *aws.Request Input *GetPolicyInput + Copy func(*GetPolicyInput) GetPolicyRequest } // Send marshals and sends the GetPolicy API request. @@ -3592,7 +3645,7 @@ func (c *IAM) GetPolicyRequest(input *GetPolicyInput) GetPolicyRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPolicyRequest{Request: req, Input: input} + return GetPolicyRequest{Request: req, Input: input, Copy: c.GetPolicyRequest} } const opGetPolicyVersion = "GetPolicyVersion" @@ -3601,6 +3654,7 @@ const opGetPolicyVersion = "GetPolicyVersion" type GetPolicyVersionRequest struct { *aws.Request Input *GetPolicyVersionInput + Copy func(*GetPolicyVersionInput) GetPolicyVersionRequest } // Send marshals and sends the GetPolicyVersion API request. @@ -3662,7 +3716,7 @@ func (c *IAM) GetPolicyVersionRequest(input *GetPolicyVersionInput) GetPolicyVer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPolicyVersionRequest{Request: req, Input: input} + return GetPolicyVersionRequest{Request: req, Input: input, Copy: c.GetPolicyVersionRequest} } const opGetRole = "GetRole" @@ -3671,6 +3725,7 @@ const opGetRole = "GetRole" type GetRoleRequest struct { *aws.Request Input *GetRoleInput + Copy func(*GetRoleInput) GetRoleRequest } // Send marshals and sends the GetRole API request. @@ -3719,7 +3774,7 @@ func (c *IAM) GetRoleRequest(input *GetRoleInput) GetRoleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRoleRequest{Request: req, Input: input} + return GetRoleRequest{Request: req, Input: input, Copy: c.GetRoleRequest} } const opGetRolePolicy = "GetRolePolicy" @@ -3728,6 +3783,7 @@ const opGetRolePolicy = "GetRolePolicy" type GetRolePolicyRequest struct { *aws.Request Input *GetRolePolicyInput + Copy func(*GetRolePolicyInput) GetRolePolicyRequest } // Send marshals and sends the GetRolePolicy API request. @@ -3787,7 +3843,7 @@ func (c *IAM) GetRolePolicyRequest(input *GetRolePolicyInput) GetRolePolicyReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRolePolicyRequest{Request: req, Input: input} + return GetRolePolicyRequest{Request: req, Input: input, Copy: c.GetRolePolicyRequest} } const opGetSAMLProvider = "GetSAMLProvider" @@ -3796,6 +3852,7 @@ const opGetSAMLProvider = "GetSAMLProvider" type GetSAMLProviderRequest struct { *aws.Request Input *GetSAMLProviderInput + Copy func(*GetSAMLProviderInput) GetSAMLProviderRequest } // Send marshals and sends the GetSAMLProvider API request. @@ -3839,7 +3896,7 @@ func (c *IAM) GetSAMLProviderRequest(input *GetSAMLProviderInput) GetSAMLProvide req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSAMLProviderRequest{Request: req, Input: input} + return GetSAMLProviderRequest{Request: req, Input: input, Copy: c.GetSAMLProviderRequest} } const opGetSSHPublicKey = "GetSSHPublicKey" @@ -3848,6 +3905,7 @@ const opGetSSHPublicKey = "GetSSHPublicKey" type GetSSHPublicKeyRequest struct { *aws.Request Input *GetSSHPublicKeyInput + Copy func(*GetSSHPublicKeyInput) GetSSHPublicKeyRequest } // Send marshals and sends the GetSSHPublicKey API request. @@ -3894,7 +3952,7 @@ func (c *IAM) GetSSHPublicKeyRequest(input *GetSSHPublicKeyInput) GetSSHPublicKe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSSHPublicKeyRequest{Request: req, Input: input} + return GetSSHPublicKeyRequest{Request: req, Input: input, Copy: c.GetSSHPublicKeyRequest} } const opGetServerCertificate = "GetServerCertificate" @@ -3903,6 +3961,7 @@ const opGetServerCertificate = "GetServerCertificate" type GetServerCertificateRequest struct { *aws.Request Input *GetServerCertificateInput + Copy func(*GetServerCertificateInput) GetServerCertificateRequest } // Send marshals and sends the GetServerCertificate API request. @@ -3948,7 +4007,7 @@ func (c *IAM) GetServerCertificateRequest(input *GetServerCertificateInput) GetS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetServerCertificateRequest{Request: req, Input: input} + return GetServerCertificateRequest{Request: req, Input: input, Copy: c.GetServerCertificateRequest} } const opGetServiceLinkedRoleDeletionStatus = "GetServiceLinkedRoleDeletionStatus" @@ -3957,6 +4016,7 @@ const opGetServiceLinkedRoleDeletionStatus = "GetServiceLinkedRoleDeletionStatus type GetServiceLinkedRoleDeletionStatusRequest struct { *aws.Request Input *GetServiceLinkedRoleDeletionStatusInput + Copy func(*GetServiceLinkedRoleDeletionStatusInput) GetServiceLinkedRoleDeletionStatusRequest } // Send marshals and sends the GetServiceLinkedRoleDeletionStatus API request. @@ -4001,7 +4061,7 @@ func (c *IAM) GetServiceLinkedRoleDeletionStatusRequest(input *GetServiceLinkedR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetServiceLinkedRoleDeletionStatusRequest{Request: req, Input: input} + return GetServiceLinkedRoleDeletionStatusRequest{Request: req, Input: input, Copy: c.GetServiceLinkedRoleDeletionStatusRequest} } const opGetUser = "GetUser" @@ -4010,6 +4070,7 @@ const opGetUser = "GetUser" type GetUserRequest struct { *aws.Request Input *GetUserInput + Copy func(*GetUserInput) GetUserRequest } // Send marshals and sends the GetUser API request. @@ -4054,7 +4115,7 @@ func (c *IAM) GetUserRequest(input *GetUserInput) GetUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUserRequest{Request: req, Input: input} + return GetUserRequest{Request: req, Input: input, Copy: c.GetUserRequest} } const opGetUserPolicy = "GetUserPolicy" @@ -4063,6 +4124,7 @@ const opGetUserPolicy = "GetUserPolicy" type GetUserPolicyRequest struct { *aws.Request Input *GetUserPolicyInput + Copy func(*GetUserPolicyInput) GetUserPolicyRequest } // Send marshals and sends the GetUserPolicy API request. @@ -4119,7 +4181,7 @@ func (c *IAM) GetUserPolicyRequest(input *GetUserPolicyInput) GetUserPolicyReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUserPolicyRequest{Request: req, Input: input} + return GetUserPolicyRequest{Request: req, Input: input, Copy: c.GetUserPolicyRequest} } const opListAccessKeys = "ListAccessKeys" @@ -4128,6 +4190,7 @@ const opListAccessKeys = "ListAccessKeys" type ListAccessKeysRequest struct { *aws.Request Input *ListAccessKeysInput + Copy func(*ListAccessKeysInput) ListAccessKeysRequest } // Send marshals and sends the ListAccessKeys API request. @@ -4186,57 +4249,53 @@ func (c *IAM) ListAccessKeysRequest(input *ListAccessKeysInput) ListAccessKeysRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAccessKeysRequest{Request: req, Input: input} + return ListAccessKeysRequest{Request: req, Input: input, Copy: c.ListAccessKeysRequest} } -// ListAccessKeysPages iterates over the pages of a ListAccessKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccessKeys method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAccessKeysRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAccessKeys operation. -// pageNum := 0 -// err := client.ListAccessKeysPages(params, -// func(page *ListAccessKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAccessKeysPages(input *ListAccessKeysInput, fn func(*ListAccessKeysOutput, bool) bool) error { - return c.ListAccessKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAccessKeysPagesWithContext same as ListAccessKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListAccessKeysPagesWithContext(ctx aws.Context, input *ListAccessKeysInput, fn func(*ListAccessKeysOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAccessKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAccessKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAccessKeysRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAccessKeysRequest) Paginate(opts ...aws.Option) ListAccessKeysPager { + return ListAccessKeysPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAccessKeysInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAccessKeysOutput), !p.HasNextPage()) - } - return p.Err() +// ListAccessKeysPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAccessKeysPager struct { + aws.Pager +} + +func (p *ListAccessKeysPager) CurrentPage() *ListAccessKeysOutput { + return p.Pager.CurrentPage().(*ListAccessKeysOutput) } const opListAccountAliases = "ListAccountAliases" @@ -4245,6 +4304,7 @@ const opListAccountAliases = "ListAccountAliases" type ListAccountAliasesRequest struct { *aws.Request Input *ListAccountAliasesInput + Copy func(*ListAccountAliasesInput) ListAccountAliasesRequest } // Send marshals and sends the ListAccountAliases API request. @@ -4294,57 +4354,53 @@ func (c *IAM) ListAccountAliasesRequest(input *ListAccountAliasesInput) ListAcco req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAccountAliasesRequest{Request: req, Input: input} + return ListAccountAliasesRequest{Request: req, Input: input, Copy: c.ListAccountAliasesRequest} } -// ListAccountAliasesPages iterates over the pages of a ListAccountAliases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccountAliases method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAccountAliasesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAccountAliases operation. -// pageNum := 0 -// err := client.ListAccountAliasesPages(params, -// func(page *ListAccountAliasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAccountAliasesPages(input *ListAccountAliasesInput, fn func(*ListAccountAliasesOutput, bool) bool) error { - return c.ListAccountAliasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAccountAliasesPagesWithContext same as ListAccountAliasesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListAccountAliasesPagesWithContext(ctx aws.Context, input *ListAccountAliasesInput, fn func(*ListAccountAliasesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAccountAliasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAccountAliasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAccountAliasesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAccountAliasesRequest) Paginate(opts ...aws.Option) ListAccountAliasesPager { + return ListAccountAliasesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAccountAliasesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAccountAliasesOutput), !p.HasNextPage()) - } - return p.Err() +// ListAccountAliasesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAccountAliasesPager struct { + aws.Pager +} + +func (p *ListAccountAliasesPager) CurrentPage() *ListAccountAliasesOutput { + return p.Pager.CurrentPage().(*ListAccountAliasesOutput) } const opListAttachedGroupPolicies = "ListAttachedGroupPolicies" @@ -4353,6 +4409,7 @@ const opListAttachedGroupPolicies = "ListAttachedGroupPolicies" type ListAttachedGroupPoliciesRequest struct { *aws.Request Input *ListAttachedGroupPoliciesInput + Copy func(*ListAttachedGroupPoliciesInput) ListAttachedGroupPoliciesRequest } // Send marshals and sends the ListAttachedGroupPolicies API request. @@ -4410,57 +4467,53 @@ func (c *IAM) ListAttachedGroupPoliciesRequest(input *ListAttachedGroupPoliciesI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAttachedGroupPoliciesRequest{Request: req, Input: input} + return ListAttachedGroupPoliciesRequest{Request: req, Input: input, Copy: c.ListAttachedGroupPoliciesRequest} } -// ListAttachedGroupPoliciesPages iterates over the pages of a ListAttachedGroupPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAttachedGroupPolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAttachedGroupPoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAttachedGroupPolicies operation. -// pageNum := 0 -// err := client.ListAttachedGroupPoliciesPages(params, -// func(page *ListAttachedGroupPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAttachedGroupPoliciesPages(input *ListAttachedGroupPoliciesInput, fn func(*ListAttachedGroupPoliciesOutput, bool) bool) error { - return c.ListAttachedGroupPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAttachedGroupPoliciesPagesWithContext same as ListAttachedGroupPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListAttachedGroupPoliciesPagesWithContext(ctx aws.Context, input *ListAttachedGroupPoliciesInput, fn func(*ListAttachedGroupPoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAttachedGroupPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAttachedGroupPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAttachedGroupPoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAttachedGroupPoliciesRequest) Paginate(opts ...aws.Option) ListAttachedGroupPoliciesPager { + return ListAttachedGroupPoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAttachedGroupPoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAttachedGroupPoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListAttachedGroupPoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAttachedGroupPoliciesPager struct { + aws.Pager +} + +func (p *ListAttachedGroupPoliciesPager) CurrentPage() *ListAttachedGroupPoliciesOutput { + return p.Pager.CurrentPage().(*ListAttachedGroupPoliciesOutput) } const opListAttachedRolePolicies = "ListAttachedRolePolicies" @@ -4469,6 +4522,7 @@ const opListAttachedRolePolicies = "ListAttachedRolePolicies" type ListAttachedRolePoliciesRequest struct { *aws.Request Input *ListAttachedRolePoliciesInput + Copy func(*ListAttachedRolePoliciesInput) ListAttachedRolePoliciesRequest } // Send marshals and sends the ListAttachedRolePolicies API request. @@ -4526,57 +4580,53 @@ func (c *IAM) ListAttachedRolePoliciesRequest(input *ListAttachedRolePoliciesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAttachedRolePoliciesRequest{Request: req, Input: input} + return ListAttachedRolePoliciesRequest{Request: req, Input: input, Copy: c.ListAttachedRolePoliciesRequest} } -// ListAttachedRolePoliciesPages iterates over the pages of a ListAttachedRolePolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAttachedRolePolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAttachedRolePoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAttachedRolePolicies operation. -// pageNum := 0 -// err := client.ListAttachedRolePoliciesPages(params, -// func(page *ListAttachedRolePoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAttachedRolePoliciesPages(input *ListAttachedRolePoliciesInput, fn func(*ListAttachedRolePoliciesOutput, bool) bool) error { - return c.ListAttachedRolePoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAttachedRolePoliciesPagesWithContext same as ListAttachedRolePoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListAttachedRolePoliciesPagesWithContext(ctx aws.Context, input *ListAttachedRolePoliciesInput, fn func(*ListAttachedRolePoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAttachedRolePoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAttachedRolePoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAttachedRolePoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAttachedRolePoliciesRequest) Paginate(opts ...aws.Option) ListAttachedRolePoliciesPager { + return ListAttachedRolePoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAttachedRolePoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAttachedRolePoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListAttachedRolePoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAttachedRolePoliciesPager struct { + aws.Pager +} + +func (p *ListAttachedRolePoliciesPager) CurrentPage() *ListAttachedRolePoliciesOutput { + return p.Pager.CurrentPage().(*ListAttachedRolePoliciesOutput) } const opListAttachedUserPolicies = "ListAttachedUserPolicies" @@ -4585,6 +4635,7 @@ const opListAttachedUserPolicies = "ListAttachedUserPolicies" type ListAttachedUserPoliciesRequest struct { *aws.Request Input *ListAttachedUserPoliciesInput + Copy func(*ListAttachedUserPoliciesInput) ListAttachedUserPoliciesRequest } // Send marshals and sends the ListAttachedUserPolicies API request. @@ -4642,57 +4693,53 @@ func (c *IAM) ListAttachedUserPoliciesRequest(input *ListAttachedUserPoliciesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAttachedUserPoliciesRequest{Request: req, Input: input} + return ListAttachedUserPoliciesRequest{Request: req, Input: input, Copy: c.ListAttachedUserPoliciesRequest} } -// ListAttachedUserPoliciesPages iterates over the pages of a ListAttachedUserPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAttachedUserPolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAttachedUserPoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAttachedUserPolicies operation. -// pageNum := 0 -// err := client.ListAttachedUserPoliciesPages(params, -// func(page *ListAttachedUserPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAttachedUserPoliciesPages(input *ListAttachedUserPoliciesInput, fn func(*ListAttachedUserPoliciesOutput, bool) bool) error { - return c.ListAttachedUserPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAttachedUserPoliciesPagesWithContext same as ListAttachedUserPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListAttachedUserPoliciesPagesWithContext(ctx aws.Context, input *ListAttachedUserPoliciesInput, fn func(*ListAttachedUserPoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAttachedUserPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAttachedUserPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAttachedUserPoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAttachedUserPoliciesRequest) Paginate(opts ...aws.Option) ListAttachedUserPoliciesPager { + return ListAttachedUserPoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAttachedUserPoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAttachedUserPoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListAttachedUserPoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAttachedUserPoliciesPager struct { + aws.Pager +} + +func (p *ListAttachedUserPoliciesPager) CurrentPage() *ListAttachedUserPoliciesOutput { + return p.Pager.CurrentPage().(*ListAttachedUserPoliciesOutput) } const opListEntitiesForPolicy = "ListEntitiesForPolicy" @@ -4701,6 +4748,7 @@ const opListEntitiesForPolicy = "ListEntitiesForPolicy" type ListEntitiesForPolicyRequest struct { *aws.Request Input *ListEntitiesForPolicyInput + Copy func(*ListEntitiesForPolicyInput) ListEntitiesForPolicyRequest } // Send marshals and sends the ListEntitiesForPolicy API request. @@ -4755,57 +4803,53 @@ func (c *IAM) ListEntitiesForPolicyRequest(input *ListEntitiesForPolicyInput) Li req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListEntitiesForPolicyRequest{Request: req, Input: input} + return ListEntitiesForPolicyRequest{Request: req, Input: input, Copy: c.ListEntitiesForPolicyRequest} } -// ListEntitiesForPolicyPages iterates over the pages of a ListEntitiesForPolicy operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEntitiesForPolicy method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListEntitiesForPolicyRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListEntitiesForPolicy operation. -// pageNum := 0 -// err := client.ListEntitiesForPolicyPages(params, -// func(page *ListEntitiesForPolicyOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListEntitiesForPolicyPages(input *ListEntitiesForPolicyInput, fn func(*ListEntitiesForPolicyOutput, bool) bool) error { - return c.ListEntitiesForPolicyPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEntitiesForPolicyPagesWithContext same as ListEntitiesForPolicyPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListEntitiesForPolicyPagesWithContext(ctx aws.Context, input *ListEntitiesForPolicyInput, fn func(*ListEntitiesForPolicyOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListEntitiesForPolicyInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListEntitiesForPolicyRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListEntitiesForPolicyRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListEntitiesForPolicyRequest) Paginate(opts ...aws.Option) ListEntitiesForPolicyPager { + return ListEntitiesForPolicyPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListEntitiesForPolicyInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEntitiesForPolicyOutput), !p.HasNextPage()) - } - return p.Err() +// ListEntitiesForPolicyPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListEntitiesForPolicyPager struct { + aws.Pager +} + +func (p *ListEntitiesForPolicyPager) CurrentPage() *ListEntitiesForPolicyOutput { + return p.Pager.CurrentPage().(*ListEntitiesForPolicyOutput) } const opListGroupPolicies = "ListGroupPolicies" @@ -4814,6 +4858,7 @@ const opListGroupPolicies = "ListGroupPolicies" type ListGroupPoliciesRequest struct { *aws.Request Input *ListGroupPoliciesInput + Copy func(*ListGroupPoliciesInput) ListGroupPoliciesRequest } // Send marshals and sends the ListGroupPolicies API request. @@ -4871,57 +4916,53 @@ func (c *IAM) ListGroupPoliciesRequest(input *ListGroupPoliciesInput) ListGroupP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupPoliciesRequest{Request: req, Input: input} + return ListGroupPoliciesRequest{Request: req, Input: input, Copy: c.ListGroupPoliciesRequest} } -// ListGroupPoliciesPages iterates over the pages of a ListGroupPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroupPolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListGroupPoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGroupPolicies operation. -// pageNum := 0 -// err := client.ListGroupPoliciesPages(params, -// func(page *ListGroupPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListGroupPoliciesPages(input *ListGroupPoliciesInput, fn func(*ListGroupPoliciesOutput, bool) bool) error { - return c.ListGroupPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGroupPoliciesPagesWithContext same as ListGroupPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListGroupPoliciesPagesWithContext(ctx aws.Context, input *ListGroupPoliciesInput, fn func(*ListGroupPoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListGroupPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListGroupPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListGroupPoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListGroupPoliciesRequest) Paginate(opts ...aws.Option) ListGroupPoliciesPager { + return ListGroupPoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListGroupPoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupPoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListGroupPoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListGroupPoliciesPager struct { + aws.Pager +} + +func (p *ListGroupPoliciesPager) CurrentPage() *ListGroupPoliciesOutput { + return p.Pager.CurrentPage().(*ListGroupPoliciesOutput) } const opListGroups = "ListGroups" @@ -4930,6 +4971,7 @@ const opListGroups = "ListGroups" type ListGroupsRequest struct { *aws.Request Input *ListGroupsInput + Copy func(*ListGroupsInput) ListGroupsRequest } // Send marshals and sends the ListGroups API request. @@ -4978,57 +5020,53 @@ func (c *IAM) ListGroupsRequest(input *ListGroupsInput) ListGroupsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupsRequest{Request: req, Input: input} + return ListGroupsRequest{Request: req, Input: input, Copy: c.ListGroupsRequest} } -// ListGroupsPages iterates over the pages of a ListGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGroups operation. -// pageNum := 0 -// err := client.ListGroupsPages(params, -// func(page *ListGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListGroupsPages(input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool) error { - return c.ListGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGroupsPagesWithContext same as ListGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListGroupsPagesWithContext(ctx aws.Context, input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListGroupsRequest) Paginate(opts ...aws.Option) ListGroupsPager { + return ListGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// ListGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListGroupsPager struct { + aws.Pager +} + +func (p *ListGroupsPager) CurrentPage() *ListGroupsOutput { + return p.Pager.CurrentPage().(*ListGroupsOutput) } const opListGroupsForUser = "ListGroupsForUser" @@ -5037,6 +5075,7 @@ const opListGroupsForUser = "ListGroupsForUser" type ListGroupsForUserRequest struct { *aws.Request Input *ListGroupsForUserInput + Copy func(*ListGroupsForUserInput) ListGroupsForUserRequest } // Send marshals and sends the ListGroupsForUser API request. @@ -5085,57 +5124,53 @@ func (c *IAM) ListGroupsForUserRequest(input *ListGroupsForUserInput) ListGroups req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupsForUserRequest{Request: req, Input: input} + return ListGroupsForUserRequest{Request: req, Input: input, Copy: c.ListGroupsForUserRequest} } -// ListGroupsForUserPages iterates over the pages of a ListGroupsForUser operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroupsForUser method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListGroupsForUserRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGroupsForUser operation. -// pageNum := 0 -// err := client.ListGroupsForUserPages(params, -// func(page *ListGroupsForUserOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListGroupsForUserPages(input *ListGroupsForUserInput, fn func(*ListGroupsForUserOutput, bool) bool) error { - return c.ListGroupsForUserPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGroupsForUserPagesWithContext same as ListGroupsForUserPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListGroupsForUserPagesWithContext(ctx aws.Context, input *ListGroupsForUserInput, fn func(*ListGroupsForUserOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListGroupsForUserInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListGroupsForUserRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListGroupsForUserRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListGroupsForUserRequest) Paginate(opts ...aws.Option) ListGroupsForUserPager { + return ListGroupsForUserPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListGroupsForUserInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupsForUserOutput), !p.HasNextPage()) - } - return p.Err() +// ListGroupsForUserPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListGroupsForUserPager struct { + aws.Pager +} + +func (p *ListGroupsForUserPager) CurrentPage() *ListGroupsForUserOutput { + return p.Pager.CurrentPage().(*ListGroupsForUserOutput) } const opListInstanceProfiles = "ListInstanceProfiles" @@ -5144,6 +5179,7 @@ const opListInstanceProfiles = "ListInstanceProfiles" type ListInstanceProfilesRequest struct { *aws.Request Input *ListInstanceProfilesInput + Copy func(*ListInstanceProfilesInput) ListInstanceProfilesRequest } // Send marshals and sends the ListInstanceProfiles API request. @@ -5194,57 +5230,53 @@ func (c *IAM) ListInstanceProfilesRequest(input *ListInstanceProfilesInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInstanceProfilesRequest{Request: req, Input: input} + return ListInstanceProfilesRequest{Request: req, Input: input, Copy: c.ListInstanceProfilesRequest} } -// ListInstanceProfilesPages iterates over the pages of a ListInstanceProfiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstanceProfiles method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInstanceProfilesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInstanceProfiles operation. -// pageNum := 0 -// err := client.ListInstanceProfilesPages(params, -// func(page *ListInstanceProfilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListInstanceProfilesPages(input *ListInstanceProfilesInput, fn func(*ListInstanceProfilesOutput, bool) bool) error { - return c.ListInstanceProfilesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInstanceProfilesPagesWithContext same as ListInstanceProfilesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListInstanceProfilesPagesWithContext(ctx aws.Context, input *ListInstanceProfilesInput, fn func(*ListInstanceProfilesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInstanceProfilesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInstanceProfilesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListInstanceProfilesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListInstanceProfilesRequest) Paginate(opts ...aws.Option) ListInstanceProfilesPager { + return ListInstanceProfilesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInstanceProfilesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstanceProfilesOutput), !p.HasNextPage()) - } - return p.Err() +// ListInstanceProfilesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInstanceProfilesPager struct { + aws.Pager +} + +func (p *ListInstanceProfilesPager) CurrentPage() *ListInstanceProfilesOutput { + return p.Pager.CurrentPage().(*ListInstanceProfilesOutput) } const opListInstanceProfilesForRole = "ListInstanceProfilesForRole" @@ -5253,6 +5285,7 @@ const opListInstanceProfilesForRole = "ListInstanceProfilesForRole" type ListInstanceProfilesForRoleRequest struct { *aws.Request Input *ListInstanceProfilesForRoleInput + Copy func(*ListInstanceProfilesForRoleInput) ListInstanceProfilesForRoleRequest } // Send marshals and sends the ListInstanceProfilesForRole API request. @@ -5303,57 +5336,53 @@ func (c *IAM) ListInstanceProfilesForRoleRequest(input *ListInstanceProfilesForR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInstanceProfilesForRoleRequest{Request: req, Input: input} + return ListInstanceProfilesForRoleRequest{Request: req, Input: input, Copy: c.ListInstanceProfilesForRoleRequest} } -// ListInstanceProfilesForRolePages iterates over the pages of a ListInstanceProfilesForRole operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstanceProfilesForRole method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInstanceProfilesForRoleRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInstanceProfilesForRole operation. -// pageNum := 0 -// err := client.ListInstanceProfilesForRolePages(params, -// func(page *ListInstanceProfilesForRoleOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListInstanceProfilesForRolePages(input *ListInstanceProfilesForRoleInput, fn func(*ListInstanceProfilesForRoleOutput, bool) bool) error { - return c.ListInstanceProfilesForRolePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInstanceProfilesForRolePagesWithContext same as ListInstanceProfilesForRolePages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListInstanceProfilesForRolePagesWithContext(ctx aws.Context, input *ListInstanceProfilesForRoleInput, fn func(*ListInstanceProfilesForRoleOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInstanceProfilesForRoleInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInstanceProfilesForRoleRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListInstanceProfilesForRoleRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListInstanceProfilesForRoleRequest) Paginate(opts ...aws.Option) ListInstanceProfilesForRolePager { + return ListInstanceProfilesForRolePager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInstanceProfilesForRoleInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstanceProfilesForRoleOutput), !p.HasNextPage()) - } - return p.Err() +// ListInstanceProfilesForRolePager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInstanceProfilesForRolePager struct { + aws.Pager +} + +func (p *ListInstanceProfilesForRolePager) CurrentPage() *ListInstanceProfilesForRoleOutput { + return p.Pager.CurrentPage().(*ListInstanceProfilesForRoleOutput) } const opListMFADevices = "ListMFADevices" @@ -5362,6 +5391,7 @@ const opListMFADevices = "ListMFADevices" type ListMFADevicesRequest struct { *aws.Request Input *ListMFADevicesInput + Copy func(*ListMFADevicesInput) ListMFADevicesRequest } // Send marshals and sends the ListMFADevices API request. @@ -5413,57 +5443,53 @@ func (c *IAM) ListMFADevicesRequest(input *ListMFADevicesInput) ListMFADevicesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListMFADevicesRequest{Request: req, Input: input} + return ListMFADevicesRequest{Request: req, Input: input, Copy: c.ListMFADevicesRequest} } -// ListMFADevicesPages iterates over the pages of a ListMFADevices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMFADevices method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListMFADevicesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListMFADevices operation. -// pageNum := 0 -// err := client.ListMFADevicesPages(params, -// func(page *ListMFADevicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListMFADevicesPages(input *ListMFADevicesInput, fn func(*ListMFADevicesOutput, bool) bool) error { - return c.ListMFADevicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMFADevicesPagesWithContext same as ListMFADevicesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListMFADevicesPagesWithContext(ctx aws.Context, input *ListMFADevicesInput, fn func(*ListMFADevicesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListMFADevicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListMFADevicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListMFADevicesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListMFADevicesRequest) Paginate(opts ...aws.Option) ListMFADevicesPager { + return ListMFADevicesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListMFADevicesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMFADevicesOutput), !p.HasNextPage()) - } - return p.Err() +// ListMFADevicesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListMFADevicesPager struct { + aws.Pager +} + +func (p *ListMFADevicesPager) CurrentPage() *ListMFADevicesOutput { + return p.Pager.CurrentPage().(*ListMFADevicesOutput) } const opListOpenIDConnectProviders = "ListOpenIDConnectProviders" @@ -5472,6 +5498,7 @@ const opListOpenIDConnectProviders = "ListOpenIDConnectProviders" type ListOpenIDConnectProvidersRequest struct { *aws.Request Input *ListOpenIDConnectProvidersInput + Copy func(*ListOpenIDConnectProvidersInput) ListOpenIDConnectProvidersRequest } // Send marshals and sends the ListOpenIDConnectProviders API request. @@ -5513,7 +5540,7 @@ func (c *IAM) ListOpenIDConnectProvidersRequest(input *ListOpenIDConnectProvider req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOpenIDConnectProvidersRequest{Request: req, Input: input} + return ListOpenIDConnectProvidersRequest{Request: req, Input: input, Copy: c.ListOpenIDConnectProvidersRequest} } const opListPolicies = "ListPolicies" @@ -5522,6 +5549,7 @@ const opListPolicies = "ListPolicies" type ListPoliciesRequest struct { *aws.Request Input *ListPoliciesInput + Copy func(*ListPoliciesInput) ListPoliciesRequest } // Send marshals and sends the ListPolicies API request. @@ -5580,57 +5608,53 @@ func (c *IAM) ListPoliciesRequest(input *ListPoliciesInput) ListPoliciesRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPoliciesRequest{Request: req, Input: input} + return ListPoliciesRequest{Request: req, Input: input, Copy: c.ListPoliciesRequest} } -// ListPoliciesPages iterates over the pages of a ListPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPolicies operation. -// pageNum := 0 -// err := client.ListPoliciesPages(params, -// func(page *ListPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListPoliciesPages(input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool) error { - return c.ListPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPoliciesPagesWithContext same as ListPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListPoliciesPagesWithContext(ctx aws.Context, input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPoliciesRequest) Paginate(opts ...aws.Option) ListPoliciesPager { + return ListPoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListPoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPoliciesPager struct { + aws.Pager +} + +func (p *ListPoliciesPager) CurrentPage() *ListPoliciesOutput { + return p.Pager.CurrentPage().(*ListPoliciesOutput) } const opListPolicyVersions = "ListPolicyVersions" @@ -5639,6 +5663,7 @@ const opListPolicyVersions = "ListPolicyVersions" type ListPolicyVersionsRequest struct { *aws.Request Input *ListPolicyVersionsInput + Copy func(*ListPolicyVersionsInput) ListPolicyVersionsRequest } // Send marshals and sends the ListPolicyVersions API request. @@ -5690,57 +5715,53 @@ func (c *IAM) ListPolicyVersionsRequest(input *ListPolicyVersionsInput) ListPoli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPolicyVersionsRequest{Request: req, Input: input} + return ListPolicyVersionsRequest{Request: req, Input: input, Copy: c.ListPolicyVersionsRequest} } -// ListPolicyVersionsPages iterates over the pages of a ListPolicyVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicyVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPolicyVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPolicyVersions operation. -// pageNum := 0 -// err := client.ListPolicyVersionsPages(params, -// func(page *ListPolicyVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListPolicyVersionsPages(input *ListPolicyVersionsInput, fn func(*ListPolicyVersionsOutput, bool) bool) error { - return c.ListPolicyVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPolicyVersionsPagesWithContext same as ListPolicyVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListPolicyVersionsPagesWithContext(ctx aws.Context, input *ListPolicyVersionsInput, fn func(*ListPolicyVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPolicyVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPolicyVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPolicyVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPolicyVersionsRequest) Paginate(opts ...aws.Option) ListPolicyVersionsPager { + return ListPolicyVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPolicyVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPolicyVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListPolicyVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPolicyVersionsPager struct { + aws.Pager +} + +func (p *ListPolicyVersionsPager) CurrentPage() *ListPolicyVersionsOutput { + return p.Pager.CurrentPage().(*ListPolicyVersionsOutput) } const opListRolePolicies = "ListRolePolicies" @@ -5749,6 +5770,7 @@ const opListRolePolicies = "ListRolePolicies" type ListRolePoliciesRequest struct { *aws.Request Input *ListRolePoliciesInput + Copy func(*ListRolePoliciesInput) ListRolePoliciesRequest } // Send marshals and sends the ListRolePolicies API request. @@ -5805,57 +5827,53 @@ func (c *IAM) ListRolePoliciesRequest(input *ListRolePoliciesInput) ListRolePoli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRolePoliciesRequest{Request: req, Input: input} + return ListRolePoliciesRequest{Request: req, Input: input, Copy: c.ListRolePoliciesRequest} } -// ListRolePoliciesPages iterates over the pages of a ListRolePolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRolePolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListRolePoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListRolePolicies operation. -// pageNum := 0 -// err := client.ListRolePoliciesPages(params, -// func(page *ListRolePoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListRolePoliciesPages(input *ListRolePoliciesInput, fn func(*ListRolePoliciesOutput, bool) bool) error { - return c.ListRolePoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRolePoliciesPagesWithContext same as ListRolePoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListRolePoliciesPagesWithContext(ctx aws.Context, input *ListRolePoliciesInput, fn func(*ListRolePoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListRolePoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListRolePoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListRolePoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListRolePoliciesRequest) Paginate(opts ...aws.Option) ListRolePoliciesPager { + return ListRolePoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListRolePoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRolePoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListRolePoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListRolePoliciesPager struct { + aws.Pager +} + +func (p *ListRolePoliciesPager) CurrentPage() *ListRolePoliciesOutput { + return p.Pager.CurrentPage().(*ListRolePoliciesOutput) } const opListRoles = "ListRoles" @@ -5864,6 +5882,7 @@ const opListRoles = "ListRoles" type ListRolesRequest struct { *aws.Request Input *ListRolesInput + Copy func(*ListRolesInput) ListRolesRequest } // Send marshals and sends the ListRoles API request. @@ -5914,57 +5933,53 @@ func (c *IAM) ListRolesRequest(input *ListRolesInput) ListRolesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRolesRequest{Request: req, Input: input} + return ListRolesRequest{Request: req, Input: input, Copy: c.ListRolesRequest} } -// ListRolesPages iterates over the pages of a ListRoles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRoles method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListRolesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListRoles operation. -// pageNum := 0 -// err := client.ListRolesPages(params, -// func(page *ListRolesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListRolesPages(input *ListRolesInput, fn func(*ListRolesOutput, bool) bool) error { - return c.ListRolesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRolesPagesWithContext same as ListRolesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListRolesPagesWithContext(ctx aws.Context, input *ListRolesInput, fn func(*ListRolesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListRolesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListRolesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListRolesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListRolesRequest) Paginate(opts ...aws.Option) ListRolesPager { + return ListRolesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListRolesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRolesOutput), !p.HasNextPage()) - } - return p.Err() +// ListRolesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListRolesPager struct { + aws.Pager +} + +func (p *ListRolesPager) CurrentPage() *ListRolesOutput { + return p.Pager.CurrentPage().(*ListRolesOutput) } const opListSAMLProviders = "ListSAMLProviders" @@ -5973,6 +5988,7 @@ const opListSAMLProviders = "ListSAMLProviders" type ListSAMLProvidersRequest struct { *aws.Request Input *ListSAMLProvidersInput + Copy func(*ListSAMLProvidersInput) ListSAMLProvidersRequest } // Send marshals and sends the ListSAMLProviders API request. @@ -6015,7 +6031,7 @@ func (c *IAM) ListSAMLProvidersRequest(input *ListSAMLProvidersInput) ListSAMLPr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSAMLProvidersRequest{Request: req, Input: input} + return ListSAMLProvidersRequest{Request: req, Input: input, Copy: c.ListSAMLProvidersRequest} } const opListSSHPublicKeys = "ListSSHPublicKeys" @@ -6024,6 +6040,7 @@ const opListSSHPublicKeys = "ListSSHPublicKeys" type ListSSHPublicKeysRequest struct { *aws.Request Input *ListSSHPublicKeysInput + Copy func(*ListSSHPublicKeysInput) ListSSHPublicKeysRequest } // Send marshals and sends the ListSSHPublicKeys API request. @@ -6080,57 +6097,53 @@ func (c *IAM) ListSSHPublicKeysRequest(input *ListSSHPublicKeysInput) ListSSHPub req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSSHPublicKeysRequest{Request: req, Input: input} + return ListSSHPublicKeysRequest{Request: req, Input: input, Copy: c.ListSSHPublicKeysRequest} } -// ListSSHPublicKeysPages iterates over the pages of a ListSSHPublicKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSSHPublicKeys method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListSSHPublicKeysRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListSSHPublicKeys operation. -// pageNum := 0 -// err := client.ListSSHPublicKeysPages(params, -// func(page *ListSSHPublicKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListSSHPublicKeysPages(input *ListSSHPublicKeysInput, fn func(*ListSSHPublicKeysOutput, bool) bool) error { - return c.ListSSHPublicKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSSHPublicKeysPagesWithContext same as ListSSHPublicKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListSSHPublicKeysPagesWithContext(ctx aws.Context, input *ListSSHPublicKeysInput, fn func(*ListSSHPublicKeysOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListSSHPublicKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListSSHPublicKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListSSHPublicKeysRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListSSHPublicKeysRequest) Paginate(opts ...aws.Option) ListSSHPublicKeysPager { + return ListSSHPublicKeysPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListSSHPublicKeysInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSSHPublicKeysOutput), !p.HasNextPage()) - } - return p.Err() +// ListSSHPublicKeysPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListSSHPublicKeysPager struct { + aws.Pager +} + +func (p *ListSSHPublicKeysPager) CurrentPage() *ListSSHPublicKeysOutput { + return p.Pager.CurrentPage().(*ListSSHPublicKeysOutput) } const opListServerCertificates = "ListServerCertificates" @@ -6139,6 +6152,7 @@ const opListServerCertificates = "ListServerCertificates" type ListServerCertificatesRequest struct { *aws.Request Input *ListServerCertificatesInput + Copy func(*ListServerCertificatesInput) ListServerCertificatesRequest } // Send marshals and sends the ListServerCertificates API request. @@ -6193,57 +6207,53 @@ func (c *IAM) ListServerCertificatesRequest(input *ListServerCertificatesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListServerCertificatesRequest{Request: req, Input: input} + return ListServerCertificatesRequest{Request: req, Input: input, Copy: c.ListServerCertificatesRequest} } -// ListServerCertificatesPages iterates over the pages of a ListServerCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServerCertificates method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListServerCertificatesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListServerCertificates operation. -// pageNum := 0 -// err := client.ListServerCertificatesPages(params, -// func(page *ListServerCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListServerCertificatesPages(input *ListServerCertificatesInput, fn func(*ListServerCertificatesOutput, bool) bool) error { - return c.ListServerCertificatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListServerCertificatesPagesWithContext same as ListServerCertificatesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListServerCertificatesPagesWithContext(ctx aws.Context, input *ListServerCertificatesInput, fn func(*ListServerCertificatesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListServerCertificatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListServerCertificatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListServerCertificatesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListServerCertificatesRequest) Paginate(opts ...aws.Option) ListServerCertificatesPager { + return ListServerCertificatesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListServerCertificatesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServerCertificatesOutput), !p.HasNextPage()) - } - return p.Err() +// ListServerCertificatesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListServerCertificatesPager struct { + aws.Pager +} + +func (p *ListServerCertificatesPager) CurrentPage() *ListServerCertificatesOutput { + return p.Pager.CurrentPage().(*ListServerCertificatesOutput) } const opListServiceSpecificCredentials = "ListServiceSpecificCredentials" @@ -6252,6 +6262,7 @@ const opListServiceSpecificCredentials = "ListServiceSpecificCredentials" type ListServiceSpecificCredentialsRequest struct { *aws.Request Input *ListServiceSpecificCredentialsInput + Copy func(*ListServiceSpecificCredentialsInput) ListServiceSpecificCredentialsRequest } // Send marshals and sends the ListServiceSpecificCredentials API request. @@ -6298,7 +6309,7 @@ func (c *IAM) ListServiceSpecificCredentialsRequest(input *ListServiceSpecificCr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListServiceSpecificCredentialsRequest{Request: req, Input: input} + return ListServiceSpecificCredentialsRequest{Request: req, Input: input, Copy: c.ListServiceSpecificCredentialsRequest} } const opListSigningCertificates = "ListSigningCertificates" @@ -6307,6 +6318,7 @@ const opListSigningCertificates = "ListSigningCertificates" type ListSigningCertificatesRequest struct { *aws.Request Input *ListSigningCertificatesInput + Copy func(*ListSigningCertificatesInput) ListSigningCertificatesRequest } // Send marshals and sends the ListSigningCertificates API request. @@ -6363,57 +6375,53 @@ func (c *IAM) ListSigningCertificatesRequest(input *ListSigningCertificatesInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSigningCertificatesRequest{Request: req, Input: input} + return ListSigningCertificatesRequest{Request: req, Input: input, Copy: c.ListSigningCertificatesRequest} } -// ListSigningCertificatesPages iterates over the pages of a ListSigningCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSigningCertificates method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListSigningCertificatesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListSigningCertificates operation. -// pageNum := 0 -// err := client.ListSigningCertificatesPages(params, -// func(page *ListSigningCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListSigningCertificatesPages(input *ListSigningCertificatesInput, fn func(*ListSigningCertificatesOutput, bool) bool) error { - return c.ListSigningCertificatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSigningCertificatesPagesWithContext same as ListSigningCertificatesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListSigningCertificatesPagesWithContext(ctx aws.Context, input *ListSigningCertificatesInput, fn func(*ListSigningCertificatesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListSigningCertificatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListSigningCertificatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListSigningCertificatesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListSigningCertificatesRequest) Paginate(opts ...aws.Option) ListSigningCertificatesPager { + return ListSigningCertificatesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListSigningCertificatesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSigningCertificatesOutput), !p.HasNextPage()) - } - return p.Err() +// ListSigningCertificatesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListSigningCertificatesPager struct { + aws.Pager +} + +func (p *ListSigningCertificatesPager) CurrentPage() *ListSigningCertificatesOutput { + return p.Pager.CurrentPage().(*ListSigningCertificatesOutput) } const opListUserPolicies = "ListUserPolicies" @@ -6422,6 +6430,7 @@ const opListUserPolicies = "ListUserPolicies" type ListUserPoliciesRequest struct { *aws.Request Input *ListUserPoliciesInput + Copy func(*ListUserPoliciesInput) ListUserPoliciesRequest } // Send marshals and sends the ListUserPolicies API request. @@ -6477,57 +6486,53 @@ func (c *IAM) ListUserPoliciesRequest(input *ListUserPoliciesInput) ListUserPoli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUserPoliciesRequest{Request: req, Input: input} + return ListUserPoliciesRequest{Request: req, Input: input, Copy: c.ListUserPoliciesRequest} } -// ListUserPoliciesPages iterates over the pages of a ListUserPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUserPolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListUserPoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListUserPolicies operation. -// pageNum := 0 -// err := client.ListUserPoliciesPages(params, -// func(page *ListUserPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListUserPoliciesPages(input *ListUserPoliciesInput, fn func(*ListUserPoliciesOutput, bool) bool) error { - return c.ListUserPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListUserPoliciesPagesWithContext same as ListUserPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListUserPoliciesPagesWithContext(ctx aws.Context, input *ListUserPoliciesInput, fn func(*ListUserPoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListUserPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListUserPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListUserPoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListUserPoliciesRequest) Paginate(opts ...aws.Option) ListUserPoliciesPager { + return ListUserPoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListUserPoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUserPoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListUserPoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListUserPoliciesPager struct { + aws.Pager +} + +func (p *ListUserPoliciesPager) CurrentPage() *ListUserPoliciesOutput { + return p.Pager.CurrentPage().(*ListUserPoliciesOutput) } const opListUsers = "ListUsers" @@ -6536,6 +6541,7 @@ const opListUsers = "ListUsers" type ListUsersRequest struct { *aws.Request Input *ListUsersInput + Copy func(*ListUsersInput) ListUsersRequest } // Send marshals and sends the ListUsers API request. @@ -6586,57 +6592,53 @@ func (c *IAM) ListUsersRequest(input *ListUsersInput) ListUsersRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUsersRequest{Request: req, Input: input} + return ListUsersRequest{Request: req, Input: input, Copy: c.ListUsersRequest} } -// ListUsersPages iterates over the pages of a ListUsers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUsers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListUsersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListUsers operation. -// pageNum := 0 -// err := client.ListUsersPages(params, -// func(page *ListUsersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListUsersPages(input *ListUsersInput, fn func(*ListUsersOutput, bool) bool) error { - return c.ListUsersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListUsersPagesWithContext same as ListUsersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListUsersPagesWithContext(ctx aws.Context, input *ListUsersInput, fn func(*ListUsersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListUsersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListUsersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListUsersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListUsersRequest) Paginate(opts ...aws.Option) ListUsersPager { + return ListUsersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListUsersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) - } - return p.Err() +// ListUsersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListUsersPager struct { + aws.Pager +} + +func (p *ListUsersPager) CurrentPage() *ListUsersOutput { + return p.Pager.CurrentPage().(*ListUsersOutput) } const opListVirtualMFADevices = "ListVirtualMFADevices" @@ -6645,6 +6647,7 @@ const opListVirtualMFADevices = "ListVirtualMFADevices" type ListVirtualMFADevicesRequest struct { *aws.Request Input *ListVirtualMFADevicesInput + Copy func(*ListVirtualMFADevicesInput) ListVirtualMFADevicesRequest } // Send marshals and sends the ListVirtualMFADevices API request. @@ -6696,57 +6699,53 @@ func (c *IAM) ListVirtualMFADevicesRequest(input *ListVirtualMFADevicesInput) Li req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListVirtualMFADevicesRequest{Request: req, Input: input} + return ListVirtualMFADevicesRequest{Request: req, Input: input, Copy: c.ListVirtualMFADevicesRequest} } -// ListVirtualMFADevicesPages iterates over the pages of a ListVirtualMFADevices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVirtualMFADevices method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListVirtualMFADevicesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListVirtualMFADevices operation. -// pageNum := 0 -// err := client.ListVirtualMFADevicesPages(params, -// func(page *ListVirtualMFADevicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListVirtualMFADevicesPages(input *ListVirtualMFADevicesInput, fn func(*ListVirtualMFADevicesOutput, bool) bool) error { - return c.ListVirtualMFADevicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVirtualMFADevicesPagesWithContext same as ListVirtualMFADevicesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) ListVirtualMFADevicesPagesWithContext(ctx aws.Context, input *ListVirtualMFADevicesInput, fn func(*ListVirtualMFADevicesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListVirtualMFADevicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListVirtualMFADevicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListVirtualMFADevicesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListVirtualMFADevicesRequest) Paginate(opts ...aws.Option) ListVirtualMFADevicesPager { + return ListVirtualMFADevicesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListVirtualMFADevicesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVirtualMFADevicesOutput), !p.HasNextPage()) - } - return p.Err() +// ListVirtualMFADevicesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListVirtualMFADevicesPager struct { + aws.Pager +} + +func (p *ListVirtualMFADevicesPager) CurrentPage() *ListVirtualMFADevicesOutput { + return p.Pager.CurrentPage().(*ListVirtualMFADevicesOutput) } const opPutGroupPolicy = "PutGroupPolicy" @@ -6755,6 +6754,7 @@ const opPutGroupPolicy = "PutGroupPolicy" type PutGroupPolicyRequest struct { *aws.Request Input *PutGroupPolicyInput + Copy func(*PutGroupPolicyInput) PutGroupPolicyRequest } // Send marshals and sends the PutGroupPolicy API request. @@ -6813,7 +6813,7 @@ func (c *IAM) PutGroupPolicyRequest(input *PutGroupPolicyInput) PutGroupPolicyRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutGroupPolicyRequest{Request: req, Input: input} + return PutGroupPolicyRequest{Request: req, Input: input, Copy: c.PutGroupPolicyRequest} } const opPutRolePolicy = "PutRolePolicy" @@ -6822,6 +6822,7 @@ const opPutRolePolicy = "PutRolePolicy" type PutRolePolicyRequest struct { *aws.Request Input *PutRolePolicyInput + Copy func(*PutRolePolicyInput) PutRolePolicyRequest } // Send marshals and sends the PutRolePolicy API request. @@ -6886,7 +6887,7 @@ func (c *IAM) PutRolePolicyRequest(input *PutRolePolicyInput) PutRolePolicyReque req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutRolePolicyRequest{Request: req, Input: input} + return PutRolePolicyRequest{Request: req, Input: input, Copy: c.PutRolePolicyRequest} } const opPutUserPolicy = "PutUserPolicy" @@ -6895,6 +6896,7 @@ const opPutUserPolicy = "PutUserPolicy" type PutUserPolicyRequest struct { *aws.Request Input *PutUserPolicyInput + Copy func(*PutUserPolicyInput) PutUserPolicyRequest } // Send marshals and sends the PutUserPolicy API request. @@ -6953,7 +6955,7 @@ func (c *IAM) PutUserPolicyRequest(input *PutUserPolicyInput) PutUserPolicyReque req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutUserPolicyRequest{Request: req, Input: input} + return PutUserPolicyRequest{Request: req, Input: input, Copy: c.PutUserPolicyRequest} } const opRemoveClientIDFromOpenIDConnectProvider = "RemoveClientIDFromOpenIDConnectProvider" @@ -6962,6 +6964,7 @@ const opRemoveClientIDFromOpenIDConnectProvider = "RemoveClientIDFromOpenIDConne type RemoveClientIDFromOpenIDConnectProviderRequest struct { *aws.Request Input *RemoveClientIDFromOpenIDConnectProviderInput + Copy func(*RemoveClientIDFromOpenIDConnectProviderInput) RemoveClientIDFromOpenIDConnectProviderRequest } // Send marshals and sends the RemoveClientIDFromOpenIDConnectProvider API request. @@ -7009,7 +7012,7 @@ func (c *IAM) RemoveClientIDFromOpenIDConnectProviderRequest(input *RemoveClient req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveClientIDFromOpenIDConnectProviderRequest{Request: req, Input: input} + return RemoveClientIDFromOpenIDConnectProviderRequest{Request: req, Input: input, Copy: c.RemoveClientIDFromOpenIDConnectProviderRequest} } const opRemoveRoleFromInstanceProfile = "RemoveRoleFromInstanceProfile" @@ -7018,6 +7021,7 @@ const opRemoveRoleFromInstanceProfile = "RemoveRoleFromInstanceProfile" type RemoveRoleFromInstanceProfileRequest struct { *aws.Request Input *RemoveRoleFromInstanceProfileInput + Copy func(*RemoveRoleFromInstanceProfileInput) RemoveRoleFromInstanceProfileRequest } // Send marshals and sends the RemoveRoleFromInstanceProfile API request. @@ -7069,7 +7073,7 @@ func (c *IAM) RemoveRoleFromInstanceProfileRequest(input *RemoveRoleFromInstance req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveRoleFromInstanceProfileRequest{Request: req, Input: input} + return RemoveRoleFromInstanceProfileRequest{Request: req, Input: input, Copy: c.RemoveRoleFromInstanceProfileRequest} } const opRemoveUserFromGroup = "RemoveUserFromGroup" @@ -7078,6 +7082,7 @@ const opRemoveUserFromGroup = "RemoveUserFromGroup" type RemoveUserFromGroupRequest struct { *aws.Request Input *RemoveUserFromGroupInput + Copy func(*RemoveUserFromGroupInput) RemoveUserFromGroupRequest } // Send marshals and sends the RemoveUserFromGroup API request. @@ -7120,7 +7125,7 @@ func (c *IAM) RemoveUserFromGroupRequest(input *RemoveUserFromGroupInput) Remove req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveUserFromGroupRequest{Request: req, Input: input} + return RemoveUserFromGroupRequest{Request: req, Input: input, Copy: c.RemoveUserFromGroupRequest} } const opResetServiceSpecificCredential = "ResetServiceSpecificCredential" @@ -7129,6 +7134,7 @@ const opResetServiceSpecificCredential = "ResetServiceSpecificCredential" type ResetServiceSpecificCredentialRequest struct { *aws.Request Input *ResetServiceSpecificCredentialInput + Copy func(*ResetServiceSpecificCredentialInput) ResetServiceSpecificCredentialRequest } // Send marshals and sends the ResetServiceSpecificCredential API request. @@ -7172,7 +7178,7 @@ func (c *IAM) ResetServiceSpecificCredentialRequest(input *ResetServiceSpecificC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetServiceSpecificCredentialRequest{Request: req, Input: input} + return ResetServiceSpecificCredentialRequest{Request: req, Input: input, Copy: c.ResetServiceSpecificCredentialRequest} } const opResyncMFADevice = "ResyncMFADevice" @@ -7181,6 +7187,7 @@ const opResyncMFADevice = "ResyncMFADevice" type ResyncMFADeviceRequest struct { *aws.Request Input *ResyncMFADeviceInput + Copy func(*ResyncMFADeviceInput) ResyncMFADeviceRequest } // Send marshals and sends the ResyncMFADevice API request. @@ -7228,7 +7235,7 @@ func (c *IAM) ResyncMFADeviceRequest(input *ResyncMFADeviceInput) ResyncMFADevic req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ResyncMFADeviceRequest{Request: req, Input: input} + return ResyncMFADeviceRequest{Request: req, Input: input, Copy: c.ResyncMFADeviceRequest} } const opSetDefaultPolicyVersion = "SetDefaultPolicyVersion" @@ -7237,6 +7244,7 @@ const opSetDefaultPolicyVersion = "SetDefaultPolicyVersion" type SetDefaultPolicyVersionRequest struct { *aws.Request Input *SetDefaultPolicyVersionInput + Copy func(*SetDefaultPolicyVersionInput) SetDefaultPolicyVersionRequest } // Send marshals and sends the SetDefaultPolicyVersion API request. @@ -7288,7 +7296,7 @@ func (c *IAM) SetDefaultPolicyVersionRequest(input *SetDefaultPolicyVersionInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetDefaultPolicyVersionRequest{Request: req, Input: input} + return SetDefaultPolicyVersionRequest{Request: req, Input: input, Copy: c.SetDefaultPolicyVersionRequest} } const opSimulateCustomPolicy = "SimulateCustomPolicy" @@ -7297,6 +7305,7 @@ const opSimulateCustomPolicy = "SimulateCustomPolicy" type SimulateCustomPolicyRequest struct { *aws.Request Input *SimulateCustomPolicyInput + Copy func(*SimulateCustomPolicyInput) SimulateCustomPolicyRequest } // Send marshals and sends the SimulateCustomPolicy API request. @@ -7359,57 +7368,53 @@ func (c *IAM) SimulateCustomPolicyRequest(input *SimulateCustomPolicyInput) Simu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SimulateCustomPolicyRequest{Request: req, Input: input} + return SimulateCustomPolicyRequest{Request: req, Input: input, Copy: c.SimulateCustomPolicyRequest} } -// SimulateCustomPolicyPages iterates over the pages of a SimulateCustomPolicy operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SimulateCustomPolicy method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SimulateCustomPolicyRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SimulateCustomPolicy operation. -// pageNum := 0 -// err := client.SimulateCustomPolicyPages(params, -// func(page *SimulatePrincipalPolicyOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) SimulateCustomPolicyPages(input *SimulateCustomPolicyInput, fn func(*SimulatePrincipalPolicyOutput, bool) bool) error { - return c.SimulateCustomPolicyPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SimulateCustomPolicyPagesWithContext same as SimulateCustomPolicyPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) SimulateCustomPolicyPagesWithContext(ctx aws.Context, input *SimulateCustomPolicyInput, fn func(*SimulatePrincipalPolicyOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SimulateCustomPolicyInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SimulateCustomPolicyRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.SimulateCustomPolicyRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *SimulateCustomPolicyRequest) Paginate(opts ...aws.Option) SimulateCustomPolicyPager { + return SimulateCustomPolicyPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SimulateCustomPolicyInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SimulatePrincipalPolicyOutput), !p.HasNextPage()) - } - return p.Err() +// SimulateCustomPolicyPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SimulateCustomPolicyPager struct { + aws.Pager +} + +func (p *SimulateCustomPolicyPager) CurrentPage() *SimulatePrincipalPolicyOutput { + return p.Pager.CurrentPage().(*SimulatePrincipalPolicyOutput) } const opSimulatePrincipalPolicy = "SimulatePrincipalPolicy" @@ -7418,6 +7423,7 @@ const opSimulatePrincipalPolicy = "SimulatePrincipalPolicy" type SimulatePrincipalPolicyRequest struct { *aws.Request Input *SimulatePrincipalPolicyInput + Copy func(*SimulatePrincipalPolicyInput) SimulatePrincipalPolicyRequest } // Send marshals and sends the SimulatePrincipalPolicy API request. @@ -7490,57 +7496,53 @@ func (c *IAM) SimulatePrincipalPolicyRequest(input *SimulatePrincipalPolicyInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SimulatePrincipalPolicyRequest{Request: req, Input: input} + return SimulatePrincipalPolicyRequest{Request: req, Input: input, Copy: c.SimulatePrincipalPolicyRequest} } -// SimulatePrincipalPolicyPages iterates over the pages of a SimulatePrincipalPolicy operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SimulatePrincipalPolicy method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SimulatePrincipalPolicyRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SimulatePrincipalPolicy operation. -// pageNum := 0 -// err := client.SimulatePrincipalPolicyPages(params, -// func(page *SimulatePrincipalPolicyOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) SimulatePrincipalPolicyPages(input *SimulatePrincipalPolicyInput, fn func(*SimulatePrincipalPolicyOutput, bool) bool) error { - return c.SimulatePrincipalPolicyPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SimulatePrincipalPolicyPagesWithContext same as SimulatePrincipalPolicyPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *IAM) SimulatePrincipalPolicyPagesWithContext(ctx aws.Context, input *SimulatePrincipalPolicyInput, fn func(*SimulatePrincipalPolicyOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SimulatePrincipalPolicyInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SimulatePrincipalPolicyRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.SimulatePrincipalPolicyRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *SimulatePrincipalPolicyRequest) Paginate(opts ...aws.Option) SimulatePrincipalPolicyPager { + return SimulatePrincipalPolicyPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SimulatePrincipalPolicyInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SimulatePrincipalPolicyOutput), !p.HasNextPage()) - } - return p.Err() +// SimulatePrincipalPolicyPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SimulatePrincipalPolicyPager struct { + aws.Pager +} + +func (p *SimulatePrincipalPolicyPager) CurrentPage() *SimulatePrincipalPolicyOutput { + return p.Pager.CurrentPage().(*SimulatePrincipalPolicyOutput) } const opUpdateAccessKey = "UpdateAccessKey" @@ -7549,6 +7551,7 @@ const opUpdateAccessKey = "UpdateAccessKey" type UpdateAccessKeyRequest struct { *aws.Request Input *UpdateAccessKeyInput + Copy func(*UpdateAccessKeyInput) UpdateAccessKeyRequest } // Send marshals and sends the UpdateAccessKey API request. @@ -7601,7 +7604,7 @@ func (c *IAM) UpdateAccessKeyRequest(input *UpdateAccessKeyInput) UpdateAccessKe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateAccessKeyRequest{Request: req, Input: input} + return UpdateAccessKeyRequest{Request: req, Input: input, Copy: c.UpdateAccessKeyRequest} } const opUpdateAccountPasswordPolicy = "UpdateAccountPasswordPolicy" @@ -7610,6 +7613,7 @@ const opUpdateAccountPasswordPolicy = "UpdateAccountPasswordPolicy" type UpdateAccountPasswordPolicyRequest struct { *aws.Request Input *UpdateAccountPasswordPolicyInput + Copy func(*UpdateAccountPasswordPolicyInput) UpdateAccountPasswordPolicyRequest } // Send marshals and sends the UpdateAccountPasswordPolicy API request. @@ -7661,7 +7665,7 @@ func (c *IAM) UpdateAccountPasswordPolicyRequest(input *UpdateAccountPasswordPol req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateAccountPasswordPolicyRequest{Request: req, Input: input} + return UpdateAccountPasswordPolicyRequest{Request: req, Input: input, Copy: c.UpdateAccountPasswordPolicyRequest} } const opUpdateAssumeRolePolicy = "UpdateAssumeRolePolicy" @@ -7670,6 +7674,7 @@ const opUpdateAssumeRolePolicy = "UpdateAssumeRolePolicy" type UpdateAssumeRolePolicyRequest struct { *aws.Request Input *UpdateAssumeRolePolicyInput + Copy func(*UpdateAssumeRolePolicyInput) UpdateAssumeRolePolicyRequest } // Send marshals and sends the UpdateAssumeRolePolicy API request. @@ -7715,7 +7720,7 @@ func (c *IAM) UpdateAssumeRolePolicyRequest(input *UpdateAssumeRolePolicyInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateAssumeRolePolicyRequest{Request: req, Input: input} + return UpdateAssumeRolePolicyRequest{Request: req, Input: input, Copy: c.UpdateAssumeRolePolicyRequest} } const opUpdateGroup = "UpdateGroup" @@ -7724,6 +7729,7 @@ const opUpdateGroup = "UpdateGroup" type UpdateGroupRequest struct { *aws.Request Input *UpdateGroupInput + Copy func(*UpdateGroupInput) UpdateGroupRequest } // Send marshals and sends the UpdateGroup API request. @@ -7776,7 +7782,7 @@ func (c *IAM) UpdateGroupRequest(input *UpdateGroupInput) UpdateGroupRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateGroupRequest{Request: req, Input: input} + return UpdateGroupRequest{Request: req, Input: input, Copy: c.UpdateGroupRequest} } const opUpdateLoginProfile = "UpdateLoginProfile" @@ -7785,6 +7791,7 @@ const opUpdateLoginProfile = "UpdateLoginProfile" type UpdateLoginProfileRequest struct { *aws.Request Input *UpdateLoginProfileInput + Copy func(*UpdateLoginProfileInput) UpdateLoginProfileRequest } // Send marshals and sends the UpdateLoginProfile API request. @@ -7831,7 +7838,7 @@ func (c *IAM) UpdateLoginProfileRequest(input *UpdateLoginProfileInput) UpdateLo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateLoginProfileRequest{Request: req, Input: input} + return UpdateLoginProfileRequest{Request: req, Input: input, Copy: c.UpdateLoginProfileRequest} } const opUpdateOpenIDConnectProviderThumbprint = "UpdateOpenIDConnectProviderThumbprint" @@ -7840,6 +7847,7 @@ const opUpdateOpenIDConnectProviderThumbprint = "UpdateOpenIDConnectProviderThum type UpdateOpenIDConnectProviderThumbprintRequest struct { *aws.Request Input *UpdateOpenIDConnectProviderThumbprintInput + Copy func(*UpdateOpenIDConnectProviderThumbprintInput) UpdateOpenIDConnectProviderThumbprintRequest } // Send marshals and sends the UpdateOpenIDConnectProviderThumbprint API request. @@ -7896,7 +7904,7 @@ func (c *IAM) UpdateOpenIDConnectProviderThumbprintRequest(input *UpdateOpenIDCo req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateOpenIDConnectProviderThumbprintRequest{Request: req, Input: input} + return UpdateOpenIDConnectProviderThumbprintRequest{Request: req, Input: input, Copy: c.UpdateOpenIDConnectProviderThumbprintRequest} } const opUpdateRoleDescription = "UpdateRoleDescription" @@ -7905,6 +7913,7 @@ const opUpdateRoleDescription = "UpdateRoleDescription" type UpdateRoleDescriptionRequest struct { *aws.Request Input *UpdateRoleDescriptionInput + Copy func(*UpdateRoleDescriptionInput) UpdateRoleDescriptionRequest } // Send marshals and sends the UpdateRoleDescription API request. @@ -7945,7 +7954,7 @@ func (c *IAM) UpdateRoleDescriptionRequest(input *UpdateRoleDescriptionInput) Up req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRoleDescriptionRequest{Request: req, Input: input} + return UpdateRoleDescriptionRequest{Request: req, Input: input, Copy: c.UpdateRoleDescriptionRequest} } const opUpdateSAMLProvider = "UpdateSAMLProvider" @@ -7954,6 +7963,7 @@ const opUpdateSAMLProvider = "UpdateSAMLProvider" type UpdateSAMLProviderRequest struct { *aws.Request Input *UpdateSAMLProviderInput + Copy func(*UpdateSAMLProviderInput) UpdateSAMLProviderRequest } // Send marshals and sends the UpdateSAMLProvider API request. @@ -7996,7 +8006,7 @@ func (c *IAM) UpdateSAMLProviderRequest(input *UpdateSAMLProviderInput) UpdateSA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSAMLProviderRequest{Request: req, Input: input} + return UpdateSAMLProviderRequest{Request: req, Input: input, Copy: c.UpdateSAMLProviderRequest} } const opUpdateSSHPublicKey = "UpdateSSHPublicKey" @@ -8005,6 +8015,7 @@ const opUpdateSSHPublicKey = "UpdateSSHPublicKey" type UpdateSSHPublicKeyRequest struct { *aws.Request Input *UpdateSSHPublicKeyInput + Copy func(*UpdateSSHPublicKeyInput) UpdateSSHPublicKeyRequest } // Send marshals and sends the UpdateSSHPublicKey API request. @@ -8056,7 +8067,7 @@ func (c *IAM) UpdateSSHPublicKeyRequest(input *UpdateSSHPublicKeyInput) UpdateSS req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateSSHPublicKeyRequest{Request: req, Input: input} + return UpdateSSHPublicKeyRequest{Request: req, Input: input, Copy: c.UpdateSSHPublicKeyRequest} } const opUpdateServerCertificate = "UpdateServerCertificate" @@ -8065,6 +8076,7 @@ const opUpdateServerCertificate = "UpdateServerCertificate" type UpdateServerCertificateRequest struct { *aws.Request Input *UpdateServerCertificateInput + Copy func(*UpdateServerCertificateInput) UpdateServerCertificateRequest } // Send marshals and sends the UpdateServerCertificate API request. @@ -8125,7 +8137,7 @@ func (c *IAM) UpdateServerCertificateRequest(input *UpdateServerCertificateInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateServerCertificateRequest{Request: req, Input: input} + return UpdateServerCertificateRequest{Request: req, Input: input, Copy: c.UpdateServerCertificateRequest} } const opUpdateServiceSpecificCredential = "UpdateServiceSpecificCredential" @@ -8134,6 +8146,7 @@ const opUpdateServiceSpecificCredential = "UpdateServiceSpecificCredential" type UpdateServiceSpecificCredentialRequest struct { *aws.Request Input *UpdateServiceSpecificCredentialInput + Copy func(*UpdateServiceSpecificCredentialInput) UpdateServiceSpecificCredentialRequest } // Send marshals and sends the UpdateServiceSpecificCredential API request. @@ -8179,7 +8192,7 @@ func (c *IAM) UpdateServiceSpecificCredentialRequest(input *UpdateServiceSpecifi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateServiceSpecificCredentialRequest{Request: req, Input: input} + return UpdateServiceSpecificCredentialRequest{Request: req, Input: input, Copy: c.UpdateServiceSpecificCredentialRequest} } const opUpdateSigningCertificate = "UpdateSigningCertificate" @@ -8188,6 +8201,7 @@ const opUpdateSigningCertificate = "UpdateSigningCertificate" type UpdateSigningCertificateRequest struct { *aws.Request Input *UpdateSigningCertificateInput + Copy func(*UpdateSigningCertificateInput) UpdateSigningCertificateRequest } // Send marshals and sends the UpdateSigningCertificate API request. @@ -8237,7 +8251,7 @@ func (c *IAM) UpdateSigningCertificateRequest(input *UpdateSigningCertificateInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateSigningCertificateRequest{Request: req, Input: input} + return UpdateSigningCertificateRequest{Request: req, Input: input, Copy: c.UpdateSigningCertificateRequest} } const opUpdateUser = "UpdateUser" @@ -8246,6 +8260,7 @@ const opUpdateUser = "UpdateUser" type UpdateUserRequest struct { *aws.Request Input *UpdateUserInput + Copy func(*UpdateUserInput) UpdateUserRequest } // Send marshals and sends the UpdateUser API request. @@ -8299,7 +8314,7 @@ func (c *IAM) UpdateUserRequest(input *UpdateUserInput) UpdateUserRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateUserRequest{Request: req, Input: input} + return UpdateUserRequest{Request: req, Input: input, Copy: c.UpdateUserRequest} } const opUploadSSHPublicKey = "UploadSSHPublicKey" @@ -8308,6 +8323,7 @@ const opUploadSSHPublicKey = "UploadSSHPublicKey" type UploadSSHPublicKeyRequest struct { *aws.Request Input *UploadSSHPublicKeyInput + Copy func(*UploadSSHPublicKeyInput) UploadSSHPublicKeyRequest } // Send marshals and sends the UploadSSHPublicKey API request. @@ -8354,7 +8370,7 @@ func (c *IAM) UploadSSHPublicKeyRequest(input *UploadSSHPublicKeyInput) UploadSS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UploadSSHPublicKeyRequest{Request: req, Input: input} + return UploadSSHPublicKeyRequest{Request: req, Input: input, Copy: c.UploadSSHPublicKeyRequest} } const opUploadServerCertificate = "UploadServerCertificate" @@ -8363,6 +8379,7 @@ const opUploadServerCertificate = "UploadServerCertificate" type UploadServerCertificateRequest struct { *aws.Request Input *UploadServerCertificateInput + Copy func(*UploadServerCertificateInput) UploadServerCertificateRequest } // Send marshals and sends the UploadServerCertificate API request. @@ -8428,7 +8445,7 @@ func (c *IAM) UploadServerCertificateRequest(input *UploadServerCertificateInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UploadServerCertificateRequest{Request: req, Input: input} + return UploadServerCertificateRequest{Request: req, Input: input, Copy: c.UploadServerCertificateRequest} } const opUploadSigningCertificate = "UploadSigningCertificate" @@ -8437,6 +8454,7 @@ const opUploadSigningCertificate = "UploadSigningCertificate" type UploadSigningCertificateRequest struct { *aws.Request Input *UploadSigningCertificateInput + Copy func(*UploadSigningCertificateInput) UploadSigningCertificateRequest } // Send marshals and sends the UploadSigningCertificate API request. @@ -8493,7 +8511,7 @@ func (c *IAM) UploadSigningCertificateRequest(input *UploadSigningCertificateInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UploadSigningCertificateRequest{Request: req, Input: input} + return UploadSigningCertificateRequest{Request: req, Input: input, Copy: c.UploadSigningCertificateRequest} } // Contains information about an AWS access key. diff --git a/service/iam/iamiface/interface.go b/service/iam/iamiface/interface.go index dc8d3b9273c..ce35cd99895 100644 --- a/service/iam/iamiface/interface.go +++ b/service/iam/iamiface/interface.go @@ -163,9 +163,6 @@ type IAMAPI interface { GetAccountAuthorizationDetailsRequest(*iam.GetAccountAuthorizationDetailsInput) iam.GetAccountAuthorizationDetailsRequest - GetAccountAuthorizationDetailsPages(*iam.GetAccountAuthorizationDetailsInput, func(*iam.GetAccountAuthorizationDetailsOutput, bool) bool) error - GetAccountAuthorizationDetailsPagesWithContext(aws.Context, *iam.GetAccountAuthorizationDetailsInput, func(*iam.GetAccountAuthorizationDetailsOutput, bool) bool, ...aws.Option) error - GetAccountPasswordPolicyRequest(*iam.GetAccountPasswordPolicyInput) iam.GetAccountPasswordPolicyRequest GetAccountSummaryRequest(*iam.GetAccountSummaryInput) iam.GetAccountSummaryRequest @@ -178,9 +175,6 @@ type IAMAPI interface { GetGroupRequest(*iam.GetGroupInput) iam.GetGroupRequest - GetGroupPages(*iam.GetGroupInput, func(*iam.GetGroupOutput, bool) bool) error - GetGroupPagesWithContext(aws.Context, *iam.GetGroupInput, func(*iam.GetGroupOutput, bool) bool, ...aws.Option) error - GetGroupPolicyRequest(*iam.GetGroupPolicyInput) iam.GetGroupPolicyRequest GetInstanceProfileRequest(*iam.GetInstanceProfileInput) iam.GetInstanceProfileRequest @@ -211,120 +205,54 @@ type IAMAPI interface { ListAccessKeysRequest(*iam.ListAccessKeysInput) iam.ListAccessKeysRequest - ListAccessKeysPages(*iam.ListAccessKeysInput, func(*iam.ListAccessKeysOutput, bool) bool) error - ListAccessKeysPagesWithContext(aws.Context, *iam.ListAccessKeysInput, func(*iam.ListAccessKeysOutput, bool) bool, ...aws.Option) error - ListAccountAliasesRequest(*iam.ListAccountAliasesInput) iam.ListAccountAliasesRequest - ListAccountAliasesPages(*iam.ListAccountAliasesInput, func(*iam.ListAccountAliasesOutput, bool) bool) error - ListAccountAliasesPagesWithContext(aws.Context, *iam.ListAccountAliasesInput, func(*iam.ListAccountAliasesOutput, bool) bool, ...aws.Option) error - ListAttachedGroupPoliciesRequest(*iam.ListAttachedGroupPoliciesInput) iam.ListAttachedGroupPoliciesRequest - ListAttachedGroupPoliciesPages(*iam.ListAttachedGroupPoliciesInput, func(*iam.ListAttachedGroupPoliciesOutput, bool) bool) error - ListAttachedGroupPoliciesPagesWithContext(aws.Context, *iam.ListAttachedGroupPoliciesInput, func(*iam.ListAttachedGroupPoliciesOutput, bool) bool, ...aws.Option) error - ListAttachedRolePoliciesRequest(*iam.ListAttachedRolePoliciesInput) iam.ListAttachedRolePoliciesRequest - ListAttachedRolePoliciesPages(*iam.ListAttachedRolePoliciesInput, func(*iam.ListAttachedRolePoliciesOutput, bool) bool) error - ListAttachedRolePoliciesPagesWithContext(aws.Context, *iam.ListAttachedRolePoliciesInput, func(*iam.ListAttachedRolePoliciesOutput, bool) bool, ...aws.Option) error - ListAttachedUserPoliciesRequest(*iam.ListAttachedUserPoliciesInput) iam.ListAttachedUserPoliciesRequest - ListAttachedUserPoliciesPages(*iam.ListAttachedUserPoliciesInput, func(*iam.ListAttachedUserPoliciesOutput, bool) bool) error - ListAttachedUserPoliciesPagesWithContext(aws.Context, *iam.ListAttachedUserPoliciesInput, func(*iam.ListAttachedUserPoliciesOutput, bool) bool, ...aws.Option) error - ListEntitiesForPolicyRequest(*iam.ListEntitiesForPolicyInput) iam.ListEntitiesForPolicyRequest - ListEntitiesForPolicyPages(*iam.ListEntitiesForPolicyInput, func(*iam.ListEntitiesForPolicyOutput, bool) bool) error - ListEntitiesForPolicyPagesWithContext(aws.Context, *iam.ListEntitiesForPolicyInput, func(*iam.ListEntitiesForPolicyOutput, bool) bool, ...aws.Option) error - ListGroupPoliciesRequest(*iam.ListGroupPoliciesInput) iam.ListGroupPoliciesRequest - ListGroupPoliciesPages(*iam.ListGroupPoliciesInput, func(*iam.ListGroupPoliciesOutput, bool) bool) error - ListGroupPoliciesPagesWithContext(aws.Context, *iam.ListGroupPoliciesInput, func(*iam.ListGroupPoliciesOutput, bool) bool, ...aws.Option) error - ListGroupsRequest(*iam.ListGroupsInput) iam.ListGroupsRequest - ListGroupsPages(*iam.ListGroupsInput, func(*iam.ListGroupsOutput, bool) bool) error - ListGroupsPagesWithContext(aws.Context, *iam.ListGroupsInput, func(*iam.ListGroupsOutput, bool) bool, ...aws.Option) error - ListGroupsForUserRequest(*iam.ListGroupsForUserInput) iam.ListGroupsForUserRequest - ListGroupsForUserPages(*iam.ListGroupsForUserInput, func(*iam.ListGroupsForUserOutput, bool) bool) error - ListGroupsForUserPagesWithContext(aws.Context, *iam.ListGroupsForUserInput, func(*iam.ListGroupsForUserOutput, bool) bool, ...aws.Option) error - ListInstanceProfilesRequest(*iam.ListInstanceProfilesInput) iam.ListInstanceProfilesRequest - ListInstanceProfilesPages(*iam.ListInstanceProfilesInput, func(*iam.ListInstanceProfilesOutput, bool) bool) error - ListInstanceProfilesPagesWithContext(aws.Context, *iam.ListInstanceProfilesInput, func(*iam.ListInstanceProfilesOutput, bool) bool, ...aws.Option) error - ListInstanceProfilesForRoleRequest(*iam.ListInstanceProfilesForRoleInput) iam.ListInstanceProfilesForRoleRequest - ListInstanceProfilesForRolePages(*iam.ListInstanceProfilesForRoleInput, func(*iam.ListInstanceProfilesForRoleOutput, bool) bool) error - ListInstanceProfilesForRolePagesWithContext(aws.Context, *iam.ListInstanceProfilesForRoleInput, func(*iam.ListInstanceProfilesForRoleOutput, bool) bool, ...aws.Option) error - ListMFADevicesRequest(*iam.ListMFADevicesInput) iam.ListMFADevicesRequest - ListMFADevicesPages(*iam.ListMFADevicesInput, func(*iam.ListMFADevicesOutput, bool) bool) error - ListMFADevicesPagesWithContext(aws.Context, *iam.ListMFADevicesInput, func(*iam.ListMFADevicesOutput, bool) bool, ...aws.Option) error - ListOpenIDConnectProvidersRequest(*iam.ListOpenIDConnectProvidersInput) iam.ListOpenIDConnectProvidersRequest ListPoliciesRequest(*iam.ListPoliciesInput) iam.ListPoliciesRequest - ListPoliciesPages(*iam.ListPoliciesInput, func(*iam.ListPoliciesOutput, bool) bool) error - ListPoliciesPagesWithContext(aws.Context, *iam.ListPoliciesInput, func(*iam.ListPoliciesOutput, bool) bool, ...aws.Option) error - ListPolicyVersionsRequest(*iam.ListPolicyVersionsInput) iam.ListPolicyVersionsRequest - ListPolicyVersionsPages(*iam.ListPolicyVersionsInput, func(*iam.ListPolicyVersionsOutput, bool) bool) error - ListPolicyVersionsPagesWithContext(aws.Context, *iam.ListPolicyVersionsInput, func(*iam.ListPolicyVersionsOutput, bool) bool, ...aws.Option) error - ListRolePoliciesRequest(*iam.ListRolePoliciesInput) iam.ListRolePoliciesRequest - ListRolePoliciesPages(*iam.ListRolePoliciesInput, func(*iam.ListRolePoliciesOutput, bool) bool) error - ListRolePoliciesPagesWithContext(aws.Context, *iam.ListRolePoliciesInput, func(*iam.ListRolePoliciesOutput, bool) bool, ...aws.Option) error - ListRolesRequest(*iam.ListRolesInput) iam.ListRolesRequest - ListRolesPages(*iam.ListRolesInput, func(*iam.ListRolesOutput, bool) bool) error - ListRolesPagesWithContext(aws.Context, *iam.ListRolesInput, func(*iam.ListRolesOutput, bool) bool, ...aws.Option) error - ListSAMLProvidersRequest(*iam.ListSAMLProvidersInput) iam.ListSAMLProvidersRequest ListSSHPublicKeysRequest(*iam.ListSSHPublicKeysInput) iam.ListSSHPublicKeysRequest - ListSSHPublicKeysPages(*iam.ListSSHPublicKeysInput, func(*iam.ListSSHPublicKeysOutput, bool) bool) error - ListSSHPublicKeysPagesWithContext(aws.Context, *iam.ListSSHPublicKeysInput, func(*iam.ListSSHPublicKeysOutput, bool) bool, ...aws.Option) error - ListServerCertificatesRequest(*iam.ListServerCertificatesInput) iam.ListServerCertificatesRequest - ListServerCertificatesPages(*iam.ListServerCertificatesInput, func(*iam.ListServerCertificatesOutput, bool) bool) error - ListServerCertificatesPagesWithContext(aws.Context, *iam.ListServerCertificatesInput, func(*iam.ListServerCertificatesOutput, bool) bool, ...aws.Option) error - ListServiceSpecificCredentialsRequest(*iam.ListServiceSpecificCredentialsInput) iam.ListServiceSpecificCredentialsRequest ListSigningCertificatesRequest(*iam.ListSigningCertificatesInput) iam.ListSigningCertificatesRequest - ListSigningCertificatesPages(*iam.ListSigningCertificatesInput, func(*iam.ListSigningCertificatesOutput, bool) bool) error - ListSigningCertificatesPagesWithContext(aws.Context, *iam.ListSigningCertificatesInput, func(*iam.ListSigningCertificatesOutput, bool) bool, ...aws.Option) error - ListUserPoliciesRequest(*iam.ListUserPoliciesInput) iam.ListUserPoliciesRequest - ListUserPoliciesPages(*iam.ListUserPoliciesInput, func(*iam.ListUserPoliciesOutput, bool) bool) error - ListUserPoliciesPagesWithContext(aws.Context, *iam.ListUserPoliciesInput, func(*iam.ListUserPoliciesOutput, bool) bool, ...aws.Option) error - ListUsersRequest(*iam.ListUsersInput) iam.ListUsersRequest - ListUsersPages(*iam.ListUsersInput, func(*iam.ListUsersOutput, bool) bool) error - ListUsersPagesWithContext(aws.Context, *iam.ListUsersInput, func(*iam.ListUsersOutput, bool) bool, ...aws.Option) error - ListVirtualMFADevicesRequest(*iam.ListVirtualMFADevicesInput) iam.ListVirtualMFADevicesRequest - ListVirtualMFADevicesPages(*iam.ListVirtualMFADevicesInput, func(*iam.ListVirtualMFADevicesOutput, bool) bool) error - ListVirtualMFADevicesPagesWithContext(aws.Context, *iam.ListVirtualMFADevicesInput, func(*iam.ListVirtualMFADevicesOutput, bool) bool, ...aws.Option) error - PutGroupPolicyRequest(*iam.PutGroupPolicyInput) iam.PutGroupPolicyRequest PutRolePolicyRequest(*iam.PutRolePolicyInput) iam.PutRolePolicyRequest @@ -345,14 +273,8 @@ type IAMAPI interface { SimulateCustomPolicyRequest(*iam.SimulateCustomPolicyInput) iam.SimulateCustomPolicyRequest - SimulateCustomPolicyPages(*iam.SimulateCustomPolicyInput, func(*iam.SimulatePrincipalPolicyOutput, bool) bool) error - SimulateCustomPolicyPagesWithContext(aws.Context, *iam.SimulateCustomPolicyInput, func(*iam.SimulatePrincipalPolicyOutput, bool) bool, ...aws.Option) error - SimulatePrincipalPolicyRequest(*iam.SimulatePrincipalPolicyInput) iam.SimulatePrincipalPolicyRequest - SimulatePrincipalPolicyPages(*iam.SimulatePrincipalPolicyInput, func(*iam.SimulatePrincipalPolicyOutput, bool) bool) error - SimulatePrincipalPolicyPagesWithContext(aws.Context, *iam.SimulatePrincipalPolicyInput, func(*iam.SimulatePrincipalPolicyOutput, bool) bool, ...aws.Option) error - UpdateAccessKeyRequest(*iam.UpdateAccessKeyInput) iam.UpdateAccessKeyRequest UpdateAccountPasswordPolicyRequest(*iam.UpdateAccountPasswordPolicyInput) iam.UpdateAccountPasswordPolicyRequest diff --git a/service/inspector/api.go b/service/inspector/api.go index 1ebe53d811c..0dc135a7b62 100644 --- a/service/inspector/api.go +++ b/service/inspector/api.go @@ -18,6 +18,7 @@ const opAddAttributesToFindings = "AddAttributesToFindings" type AddAttributesToFindingsRequest struct { *aws.Request Input *AddAttributesToFindingsInput + Copy func(*AddAttributesToFindingsInput) AddAttributesToFindingsRequest } // Send marshals and sends the AddAttributesToFindings API request. @@ -59,7 +60,7 @@ func (c *Inspector) AddAttributesToFindingsRequest(input *AddAttributesToFinding req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddAttributesToFindingsRequest{Request: req, Input: input} + return AddAttributesToFindingsRequest{Request: req, Input: input, Copy: c.AddAttributesToFindingsRequest} } const opCreateAssessmentTarget = "CreateAssessmentTarget" @@ -68,6 +69,7 @@ const opCreateAssessmentTarget = "CreateAssessmentTarget" type CreateAssessmentTargetRequest struct { *aws.Request Input *CreateAssessmentTargetInput + Copy func(*CreateAssessmentTargetInput) CreateAssessmentTargetRequest } // Send marshals and sends the CreateAssessmentTarget API request. @@ -114,7 +116,7 @@ func (c *Inspector) CreateAssessmentTargetRequest(input *CreateAssessmentTargetI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAssessmentTargetRequest{Request: req, Input: input} + return CreateAssessmentTargetRequest{Request: req, Input: input, Copy: c.CreateAssessmentTargetRequest} } const opCreateAssessmentTemplate = "CreateAssessmentTemplate" @@ -123,6 +125,7 @@ const opCreateAssessmentTemplate = "CreateAssessmentTemplate" type CreateAssessmentTemplateRequest struct { *aws.Request Input *CreateAssessmentTemplateInput + Copy func(*CreateAssessmentTemplateInput) CreateAssessmentTemplateRequest } // Send marshals and sends the CreateAssessmentTemplate API request. @@ -167,7 +170,7 @@ func (c *Inspector) CreateAssessmentTemplateRequest(input *CreateAssessmentTempl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAssessmentTemplateRequest{Request: req, Input: input} + return CreateAssessmentTemplateRequest{Request: req, Input: input, Copy: c.CreateAssessmentTemplateRequest} } const opCreateResourceGroup = "CreateResourceGroup" @@ -176,6 +179,7 @@ const opCreateResourceGroup = "CreateResourceGroup" type CreateResourceGroupRequest struct { *aws.Request Input *CreateResourceGroupInput + Copy func(*CreateResourceGroupInput) CreateResourceGroupRequest } // Send marshals and sends the CreateResourceGroup API request. @@ -219,7 +223,7 @@ func (c *Inspector) CreateResourceGroupRequest(input *CreateResourceGroupInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateResourceGroupRequest{Request: req, Input: input} + return CreateResourceGroupRequest{Request: req, Input: input, Copy: c.CreateResourceGroupRequest} } const opDeleteAssessmentRun = "DeleteAssessmentRun" @@ -228,6 +232,7 @@ const opDeleteAssessmentRun = "DeleteAssessmentRun" type DeleteAssessmentRunRequest struct { *aws.Request Input *DeleteAssessmentRunInput + Copy func(*DeleteAssessmentRunInput) DeleteAssessmentRunRequest } // Send marshals and sends the DeleteAssessmentRun API request. @@ -271,7 +276,7 @@ func (c *Inspector) DeleteAssessmentRunRequest(input *DeleteAssessmentRunInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAssessmentRunRequest{Request: req, Input: input} + return DeleteAssessmentRunRequest{Request: req, Input: input, Copy: c.DeleteAssessmentRunRequest} } const opDeleteAssessmentTarget = "DeleteAssessmentTarget" @@ -280,6 +285,7 @@ const opDeleteAssessmentTarget = "DeleteAssessmentTarget" type DeleteAssessmentTargetRequest struct { *aws.Request Input *DeleteAssessmentTargetInput + Copy func(*DeleteAssessmentTargetInput) DeleteAssessmentTargetRequest } // Send marshals and sends the DeleteAssessmentTarget API request. @@ -323,7 +329,7 @@ func (c *Inspector) DeleteAssessmentTargetRequest(input *DeleteAssessmentTargetI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAssessmentTargetRequest{Request: req, Input: input} + return DeleteAssessmentTargetRequest{Request: req, Input: input, Copy: c.DeleteAssessmentTargetRequest} } const opDeleteAssessmentTemplate = "DeleteAssessmentTemplate" @@ -332,6 +338,7 @@ const opDeleteAssessmentTemplate = "DeleteAssessmentTemplate" type DeleteAssessmentTemplateRequest struct { *aws.Request Input *DeleteAssessmentTemplateInput + Copy func(*DeleteAssessmentTemplateInput) DeleteAssessmentTemplateRequest } // Send marshals and sends the DeleteAssessmentTemplate API request. @@ -375,7 +382,7 @@ func (c *Inspector) DeleteAssessmentTemplateRequest(input *DeleteAssessmentTempl req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAssessmentTemplateRequest{Request: req, Input: input} + return DeleteAssessmentTemplateRequest{Request: req, Input: input, Copy: c.DeleteAssessmentTemplateRequest} } const opDescribeAssessmentRuns = "DescribeAssessmentRuns" @@ -384,6 +391,7 @@ const opDescribeAssessmentRuns = "DescribeAssessmentRuns" type DescribeAssessmentRunsRequest struct { *aws.Request Input *DescribeAssessmentRunsInput + Copy func(*DescribeAssessmentRunsInput) DescribeAssessmentRunsRequest } // Send marshals and sends the DescribeAssessmentRuns API request. @@ -425,7 +433,7 @@ func (c *Inspector) DescribeAssessmentRunsRequest(input *DescribeAssessmentRunsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAssessmentRunsRequest{Request: req, Input: input} + return DescribeAssessmentRunsRequest{Request: req, Input: input, Copy: c.DescribeAssessmentRunsRequest} } const opDescribeAssessmentTargets = "DescribeAssessmentTargets" @@ -434,6 +442,7 @@ const opDescribeAssessmentTargets = "DescribeAssessmentTargets" type DescribeAssessmentTargetsRequest struct { *aws.Request Input *DescribeAssessmentTargetsInput + Copy func(*DescribeAssessmentTargetsInput) DescribeAssessmentTargetsRequest } // Send marshals and sends the DescribeAssessmentTargets API request. @@ -475,7 +484,7 @@ func (c *Inspector) DescribeAssessmentTargetsRequest(input *DescribeAssessmentTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAssessmentTargetsRequest{Request: req, Input: input} + return DescribeAssessmentTargetsRequest{Request: req, Input: input, Copy: c.DescribeAssessmentTargetsRequest} } const opDescribeAssessmentTemplates = "DescribeAssessmentTemplates" @@ -484,6 +493,7 @@ const opDescribeAssessmentTemplates = "DescribeAssessmentTemplates" type DescribeAssessmentTemplatesRequest struct { *aws.Request Input *DescribeAssessmentTemplatesInput + Copy func(*DescribeAssessmentTemplatesInput) DescribeAssessmentTemplatesRequest } // Send marshals and sends the DescribeAssessmentTemplates API request. @@ -525,7 +535,7 @@ func (c *Inspector) DescribeAssessmentTemplatesRequest(input *DescribeAssessment req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAssessmentTemplatesRequest{Request: req, Input: input} + return DescribeAssessmentTemplatesRequest{Request: req, Input: input, Copy: c.DescribeAssessmentTemplatesRequest} } const opDescribeCrossAccountAccessRole = "DescribeCrossAccountAccessRole" @@ -534,6 +544,7 @@ const opDescribeCrossAccountAccessRole = "DescribeCrossAccountAccessRole" type DescribeCrossAccountAccessRoleRequest struct { *aws.Request Input *DescribeCrossAccountAccessRoleInput + Copy func(*DescribeCrossAccountAccessRoleInput) DescribeCrossAccountAccessRoleRequest } // Send marshals and sends the DescribeCrossAccountAccessRole API request. @@ -574,7 +585,7 @@ func (c *Inspector) DescribeCrossAccountAccessRoleRequest(input *DescribeCrossAc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCrossAccountAccessRoleRequest{Request: req, Input: input} + return DescribeCrossAccountAccessRoleRequest{Request: req, Input: input, Copy: c.DescribeCrossAccountAccessRoleRequest} } const opDescribeFindings = "DescribeFindings" @@ -583,6 +594,7 @@ const opDescribeFindings = "DescribeFindings" type DescribeFindingsRequest struct { *aws.Request Input *DescribeFindingsInput + Copy func(*DescribeFindingsInput) DescribeFindingsRequest } // Send marshals and sends the DescribeFindings API request. @@ -623,7 +635,7 @@ func (c *Inspector) DescribeFindingsRequest(input *DescribeFindingsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFindingsRequest{Request: req, Input: input} + return DescribeFindingsRequest{Request: req, Input: input, Copy: c.DescribeFindingsRequest} } const opDescribeResourceGroups = "DescribeResourceGroups" @@ -632,6 +644,7 @@ const opDescribeResourceGroups = "DescribeResourceGroups" type DescribeResourceGroupsRequest struct { *aws.Request Input *DescribeResourceGroupsInput + Copy func(*DescribeResourceGroupsInput) DescribeResourceGroupsRequest } // Send marshals and sends the DescribeResourceGroups API request. @@ -673,7 +686,7 @@ func (c *Inspector) DescribeResourceGroupsRequest(input *DescribeResourceGroupsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeResourceGroupsRequest{Request: req, Input: input} + return DescribeResourceGroupsRequest{Request: req, Input: input, Copy: c.DescribeResourceGroupsRequest} } const opDescribeRulesPackages = "DescribeRulesPackages" @@ -682,6 +695,7 @@ const opDescribeRulesPackages = "DescribeRulesPackages" type DescribeRulesPackagesRequest struct { *aws.Request Input *DescribeRulesPackagesInput + Copy func(*DescribeRulesPackagesInput) DescribeRulesPackagesRequest } // Send marshals and sends the DescribeRulesPackages API request. @@ -723,7 +737,7 @@ func (c *Inspector) DescribeRulesPackagesRequest(input *DescribeRulesPackagesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRulesPackagesRequest{Request: req, Input: input} + return DescribeRulesPackagesRequest{Request: req, Input: input, Copy: c.DescribeRulesPackagesRequest} } const opGetAssessmentReport = "GetAssessmentReport" @@ -732,6 +746,7 @@ const opGetAssessmentReport = "GetAssessmentReport" type GetAssessmentReportRequest struct { *aws.Request Input *GetAssessmentReportInput + Copy func(*GetAssessmentReportInput) GetAssessmentReportRequest } // Send marshals and sends the GetAssessmentReport API request. @@ -773,7 +788,7 @@ func (c *Inspector) GetAssessmentReportRequest(input *GetAssessmentReportInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAssessmentReportRequest{Request: req, Input: input} + return GetAssessmentReportRequest{Request: req, Input: input, Copy: c.GetAssessmentReportRequest} } const opGetTelemetryMetadata = "GetTelemetryMetadata" @@ -782,6 +797,7 @@ const opGetTelemetryMetadata = "GetTelemetryMetadata" type GetTelemetryMetadataRequest struct { *aws.Request Input *GetTelemetryMetadataInput + Copy func(*GetTelemetryMetadataInput) GetTelemetryMetadataRequest } // Send marshals and sends the GetTelemetryMetadata API request. @@ -823,7 +839,7 @@ func (c *Inspector) GetTelemetryMetadataRequest(input *GetTelemetryMetadataInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTelemetryMetadataRequest{Request: req, Input: input} + return GetTelemetryMetadataRequest{Request: req, Input: input, Copy: c.GetTelemetryMetadataRequest} } const opListAssessmentRunAgents = "ListAssessmentRunAgents" @@ -832,6 +848,7 @@ const opListAssessmentRunAgents = "ListAssessmentRunAgents" type ListAssessmentRunAgentsRequest struct { *aws.Request Input *ListAssessmentRunAgentsInput + Copy func(*ListAssessmentRunAgentsInput) ListAssessmentRunAgentsRequest } // Send marshals and sends the ListAssessmentRunAgents API request. @@ -879,57 +896,53 @@ func (c *Inspector) ListAssessmentRunAgentsRequest(input *ListAssessmentRunAgent req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAssessmentRunAgentsRequest{Request: req, Input: input} + return ListAssessmentRunAgentsRequest{Request: req, Input: input, Copy: c.ListAssessmentRunAgentsRequest} } -// ListAssessmentRunAgentsPages iterates over the pages of a ListAssessmentRunAgents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssessmentRunAgents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAssessmentRunAgentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAssessmentRunAgents operation. -// pageNum := 0 -// err := client.ListAssessmentRunAgentsPages(params, -// func(page *ListAssessmentRunAgentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Inspector) ListAssessmentRunAgentsPages(input *ListAssessmentRunAgentsInput, fn func(*ListAssessmentRunAgentsOutput, bool) bool) error { - return c.ListAssessmentRunAgentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssessmentRunAgentsPagesWithContext same as ListAssessmentRunAgentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Inspector) ListAssessmentRunAgentsPagesWithContext(ctx aws.Context, input *ListAssessmentRunAgentsInput, fn func(*ListAssessmentRunAgentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAssessmentRunAgentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAssessmentRunAgentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAssessmentRunAgentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAssessmentRunAgentsRequest) Paginate(opts ...aws.Option) ListAssessmentRunAgentsPager { + return ListAssessmentRunAgentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAssessmentRunAgentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssessmentRunAgentsOutput), !p.HasNextPage()) - } - return p.Err() +// ListAssessmentRunAgentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAssessmentRunAgentsPager struct { + aws.Pager +} + +func (p *ListAssessmentRunAgentsPager) CurrentPage() *ListAssessmentRunAgentsOutput { + return p.Pager.CurrentPage().(*ListAssessmentRunAgentsOutput) } const opListAssessmentRuns = "ListAssessmentRuns" @@ -938,6 +951,7 @@ const opListAssessmentRuns = "ListAssessmentRuns" type ListAssessmentRunsRequest struct { *aws.Request Input *ListAssessmentRunsInput + Copy func(*ListAssessmentRunsInput) ListAssessmentRunsRequest } // Send marshals and sends the ListAssessmentRuns API request. @@ -985,57 +999,53 @@ func (c *Inspector) ListAssessmentRunsRequest(input *ListAssessmentRunsInput) Li req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAssessmentRunsRequest{Request: req, Input: input} + return ListAssessmentRunsRequest{Request: req, Input: input, Copy: c.ListAssessmentRunsRequest} } -// ListAssessmentRunsPages iterates over the pages of a ListAssessmentRuns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssessmentRuns method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAssessmentRunsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAssessmentRuns operation. -// pageNum := 0 -// err := client.ListAssessmentRunsPages(params, -// func(page *ListAssessmentRunsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Inspector) ListAssessmentRunsPages(input *ListAssessmentRunsInput, fn func(*ListAssessmentRunsOutput, bool) bool) error { - return c.ListAssessmentRunsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssessmentRunsPagesWithContext same as ListAssessmentRunsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Inspector) ListAssessmentRunsPagesWithContext(ctx aws.Context, input *ListAssessmentRunsInput, fn func(*ListAssessmentRunsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAssessmentRunsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAssessmentRunsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAssessmentRunsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAssessmentRunsRequest) Paginate(opts ...aws.Option) ListAssessmentRunsPager { + return ListAssessmentRunsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAssessmentRunsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssessmentRunsOutput), !p.HasNextPage()) - } - return p.Err() +// ListAssessmentRunsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAssessmentRunsPager struct { + aws.Pager +} + +func (p *ListAssessmentRunsPager) CurrentPage() *ListAssessmentRunsOutput { + return p.Pager.CurrentPage().(*ListAssessmentRunsOutput) } const opListAssessmentTargets = "ListAssessmentTargets" @@ -1044,6 +1054,7 @@ const opListAssessmentTargets = "ListAssessmentTargets" type ListAssessmentTargetsRequest struct { *aws.Request Input *ListAssessmentTargetsInput + Copy func(*ListAssessmentTargetsInput) ListAssessmentTargetsRequest } // Send marshals and sends the ListAssessmentTargets API request. @@ -1092,57 +1103,53 @@ func (c *Inspector) ListAssessmentTargetsRequest(input *ListAssessmentTargetsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAssessmentTargetsRequest{Request: req, Input: input} + return ListAssessmentTargetsRequest{Request: req, Input: input, Copy: c.ListAssessmentTargetsRequest} } -// ListAssessmentTargetsPages iterates over the pages of a ListAssessmentTargets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssessmentTargets method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAssessmentTargetsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAssessmentTargets operation. -// pageNum := 0 -// err := client.ListAssessmentTargetsPages(params, -// func(page *ListAssessmentTargetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Inspector) ListAssessmentTargetsPages(input *ListAssessmentTargetsInput, fn func(*ListAssessmentTargetsOutput, bool) bool) error { - return c.ListAssessmentTargetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssessmentTargetsPagesWithContext same as ListAssessmentTargetsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Inspector) ListAssessmentTargetsPagesWithContext(ctx aws.Context, input *ListAssessmentTargetsInput, fn func(*ListAssessmentTargetsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAssessmentTargetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAssessmentTargetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAssessmentTargetsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAssessmentTargetsRequest) Paginate(opts ...aws.Option) ListAssessmentTargetsPager { + return ListAssessmentTargetsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAssessmentTargetsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssessmentTargetsOutput), !p.HasNextPage()) - } - return p.Err() +// ListAssessmentTargetsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAssessmentTargetsPager struct { + aws.Pager +} + +func (p *ListAssessmentTargetsPager) CurrentPage() *ListAssessmentTargetsOutput { + return p.Pager.CurrentPage().(*ListAssessmentTargetsOutput) } const opListAssessmentTemplates = "ListAssessmentTemplates" @@ -1151,6 +1158,7 @@ const opListAssessmentTemplates = "ListAssessmentTemplates" type ListAssessmentTemplatesRequest struct { *aws.Request Input *ListAssessmentTemplatesInput + Copy func(*ListAssessmentTemplatesInput) ListAssessmentTemplatesRequest } // Send marshals and sends the ListAssessmentTemplates API request. @@ -1198,57 +1206,53 @@ func (c *Inspector) ListAssessmentTemplatesRequest(input *ListAssessmentTemplate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAssessmentTemplatesRequest{Request: req, Input: input} + return ListAssessmentTemplatesRequest{Request: req, Input: input, Copy: c.ListAssessmentTemplatesRequest} } -// ListAssessmentTemplatesPages iterates over the pages of a ListAssessmentTemplates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssessmentTemplates method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAssessmentTemplatesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAssessmentTemplates operation. -// pageNum := 0 -// err := client.ListAssessmentTemplatesPages(params, -// func(page *ListAssessmentTemplatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Inspector) ListAssessmentTemplatesPages(input *ListAssessmentTemplatesInput, fn func(*ListAssessmentTemplatesOutput, bool) bool) error { - return c.ListAssessmentTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssessmentTemplatesPagesWithContext same as ListAssessmentTemplatesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Inspector) ListAssessmentTemplatesPagesWithContext(ctx aws.Context, input *ListAssessmentTemplatesInput, fn func(*ListAssessmentTemplatesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAssessmentTemplatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAssessmentTemplatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAssessmentTemplatesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAssessmentTemplatesRequest) Paginate(opts ...aws.Option) ListAssessmentTemplatesPager { + return ListAssessmentTemplatesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAssessmentTemplatesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssessmentTemplatesOutput), !p.HasNextPage()) - } - return p.Err() +// ListAssessmentTemplatesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAssessmentTemplatesPager struct { + aws.Pager +} + +func (p *ListAssessmentTemplatesPager) CurrentPage() *ListAssessmentTemplatesOutput { + return p.Pager.CurrentPage().(*ListAssessmentTemplatesOutput) } const opListEventSubscriptions = "ListEventSubscriptions" @@ -1257,6 +1261,7 @@ const opListEventSubscriptions = "ListEventSubscriptions" type ListEventSubscriptionsRequest struct { *aws.Request Input *ListEventSubscriptionsInput + Copy func(*ListEventSubscriptionsInput) ListEventSubscriptionsRequest } // Send marshals and sends the ListEventSubscriptions API request. @@ -1305,57 +1310,53 @@ func (c *Inspector) ListEventSubscriptionsRequest(input *ListEventSubscriptionsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListEventSubscriptionsRequest{Request: req, Input: input} + return ListEventSubscriptionsRequest{Request: req, Input: input, Copy: c.ListEventSubscriptionsRequest} } -// ListEventSubscriptionsPages iterates over the pages of a ListEventSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEventSubscriptions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListEventSubscriptionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListEventSubscriptions operation. -// pageNum := 0 -// err := client.ListEventSubscriptionsPages(params, -// func(page *ListEventSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Inspector) ListEventSubscriptionsPages(input *ListEventSubscriptionsInput, fn func(*ListEventSubscriptionsOutput, bool) bool) error { - return c.ListEventSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEventSubscriptionsPagesWithContext same as ListEventSubscriptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Inspector) ListEventSubscriptionsPagesWithContext(ctx aws.Context, input *ListEventSubscriptionsInput, fn func(*ListEventSubscriptionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListEventSubscriptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListEventSubscriptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListEventSubscriptionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListEventSubscriptionsRequest) Paginate(opts ...aws.Option) ListEventSubscriptionsPager { + return ListEventSubscriptionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListEventSubscriptionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEventSubscriptionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListEventSubscriptionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListEventSubscriptionsPager struct { + aws.Pager +} + +func (p *ListEventSubscriptionsPager) CurrentPage() *ListEventSubscriptionsOutput { + return p.Pager.CurrentPage().(*ListEventSubscriptionsOutput) } const opListFindings = "ListFindings" @@ -1364,6 +1365,7 @@ const opListFindings = "ListFindings" type ListFindingsRequest struct { *aws.Request Input *ListFindingsInput + Copy func(*ListFindingsInput) ListFindingsRequest } // Send marshals and sends the ListFindings API request. @@ -1411,57 +1413,53 @@ func (c *Inspector) ListFindingsRequest(input *ListFindingsInput) ListFindingsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFindingsRequest{Request: req, Input: input} + return ListFindingsRequest{Request: req, Input: input, Copy: c.ListFindingsRequest} } -// ListFindingsPages iterates over the pages of a ListFindings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFindings method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListFindingsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListFindings operation. -// pageNum := 0 -// err := client.ListFindingsPages(params, -// func(page *ListFindingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Inspector) ListFindingsPages(input *ListFindingsInput, fn func(*ListFindingsOutput, bool) bool) error { - return c.ListFindingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFindingsPagesWithContext same as ListFindingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Inspector) ListFindingsPagesWithContext(ctx aws.Context, input *ListFindingsInput, fn func(*ListFindingsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListFindingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListFindingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListFindingsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListFindingsRequest) Paginate(opts ...aws.Option) ListFindingsPager { + return ListFindingsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListFindingsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFindingsOutput), !p.HasNextPage()) - } - return p.Err() +// ListFindingsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListFindingsPager struct { + aws.Pager +} + +func (p *ListFindingsPager) CurrentPage() *ListFindingsOutput { + return p.Pager.CurrentPage().(*ListFindingsOutput) } const opListRulesPackages = "ListRulesPackages" @@ -1470,6 +1468,7 @@ const opListRulesPackages = "ListRulesPackages" type ListRulesPackagesRequest struct { *aws.Request Input *ListRulesPackagesInput + Copy func(*ListRulesPackagesInput) ListRulesPackagesRequest } // Send marshals and sends the ListRulesPackages API request. @@ -1516,57 +1515,53 @@ func (c *Inspector) ListRulesPackagesRequest(input *ListRulesPackagesInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRulesPackagesRequest{Request: req, Input: input} + return ListRulesPackagesRequest{Request: req, Input: input, Copy: c.ListRulesPackagesRequest} } -// ListRulesPackagesPages iterates over the pages of a ListRulesPackages operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRulesPackages method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListRulesPackagesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListRulesPackages operation. -// pageNum := 0 -// err := client.ListRulesPackagesPages(params, -// func(page *ListRulesPackagesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Inspector) ListRulesPackagesPages(input *ListRulesPackagesInput, fn func(*ListRulesPackagesOutput, bool) bool) error { - return c.ListRulesPackagesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRulesPackagesPagesWithContext same as ListRulesPackagesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Inspector) ListRulesPackagesPagesWithContext(ctx aws.Context, input *ListRulesPackagesInput, fn func(*ListRulesPackagesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListRulesPackagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListRulesPackagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListRulesPackagesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListRulesPackagesRequest) Paginate(opts ...aws.Option) ListRulesPackagesPager { + return ListRulesPackagesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListRulesPackagesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRulesPackagesOutput), !p.HasNextPage()) - } - return p.Err() +// ListRulesPackagesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListRulesPackagesPager struct { + aws.Pager +} + +func (p *ListRulesPackagesPager) CurrentPage() *ListRulesPackagesOutput { + return p.Pager.CurrentPage().(*ListRulesPackagesOutput) } const opListTagsForResource = "ListTagsForResource" @@ -1575,6 +1570,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -1615,7 +1611,7 @@ func (c *Inspector) ListTagsForResourceRequest(input *ListTagsForResourceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opPreviewAgents = "PreviewAgents" @@ -1624,6 +1620,7 @@ const opPreviewAgents = "PreviewAgents" type PreviewAgentsRequest struct { *aws.Request Input *PreviewAgentsInput + Copy func(*PreviewAgentsInput) PreviewAgentsRequest } // Send marshals and sends the PreviewAgents API request. @@ -1671,57 +1668,53 @@ func (c *Inspector) PreviewAgentsRequest(input *PreviewAgentsInput) PreviewAgent req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PreviewAgentsRequest{Request: req, Input: input} + return PreviewAgentsRequest{Request: req, Input: input, Copy: c.PreviewAgentsRequest} } -// PreviewAgentsPages iterates over the pages of a PreviewAgents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See PreviewAgents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a PreviewAgentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a PreviewAgents operation. -// pageNum := 0 -// err := client.PreviewAgentsPages(params, -// func(page *PreviewAgentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Inspector) PreviewAgentsPages(input *PreviewAgentsInput, fn func(*PreviewAgentsOutput, bool) bool) error { - return c.PreviewAgentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// PreviewAgentsPagesWithContext same as PreviewAgentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Inspector) PreviewAgentsPagesWithContext(ctx aws.Context, input *PreviewAgentsInput, fn func(*PreviewAgentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *PreviewAgentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.PreviewAgentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.PreviewAgentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *PreviewAgentsRequest) Paginate(opts ...aws.Option) PreviewAgentsPager { + return PreviewAgentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *PreviewAgentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*PreviewAgentsOutput), !p.HasNextPage()) - } - return p.Err() +// PreviewAgentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type PreviewAgentsPager struct { + aws.Pager +} + +func (p *PreviewAgentsPager) CurrentPage() *PreviewAgentsOutput { + return p.Pager.CurrentPage().(*PreviewAgentsOutput) } const opRegisterCrossAccountAccessRole = "RegisterCrossAccountAccessRole" @@ -1730,6 +1723,7 @@ const opRegisterCrossAccountAccessRole = "RegisterCrossAccountAccessRole" type RegisterCrossAccountAccessRoleRequest struct { *aws.Request Input *RegisterCrossAccountAccessRoleInput + Copy func(*RegisterCrossAccountAccessRoleInput) RegisterCrossAccountAccessRoleRequest } // Send marshals and sends the RegisterCrossAccountAccessRole API request. @@ -1773,7 +1767,7 @@ func (c *Inspector) RegisterCrossAccountAccessRoleRequest(input *RegisterCrossAc req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RegisterCrossAccountAccessRoleRequest{Request: req, Input: input} + return RegisterCrossAccountAccessRoleRequest{Request: req, Input: input, Copy: c.RegisterCrossAccountAccessRoleRequest} } const opRemoveAttributesFromFindings = "RemoveAttributesFromFindings" @@ -1782,6 +1776,7 @@ const opRemoveAttributesFromFindings = "RemoveAttributesFromFindings" type RemoveAttributesFromFindingsRequest struct { *aws.Request Input *RemoveAttributesFromFindingsInput + Copy func(*RemoveAttributesFromFindingsInput) RemoveAttributesFromFindingsRequest } // Send marshals and sends the RemoveAttributesFromFindings API request. @@ -1824,7 +1819,7 @@ func (c *Inspector) RemoveAttributesFromFindingsRequest(input *RemoveAttributesF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveAttributesFromFindingsRequest{Request: req, Input: input} + return RemoveAttributesFromFindingsRequest{Request: req, Input: input, Copy: c.RemoveAttributesFromFindingsRequest} } const opSetTagsForResource = "SetTagsForResource" @@ -1833,6 +1828,7 @@ const opSetTagsForResource = "SetTagsForResource" type SetTagsForResourceRequest struct { *aws.Request Input *SetTagsForResourceInput + Copy func(*SetTagsForResourceInput) SetTagsForResourceRequest } // Send marshals and sends the SetTagsForResource API request. @@ -1876,7 +1872,7 @@ func (c *Inspector) SetTagsForResourceRequest(input *SetTagsForResourceInput) Se req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetTagsForResourceRequest{Request: req, Input: input} + return SetTagsForResourceRequest{Request: req, Input: input, Copy: c.SetTagsForResourceRequest} } const opStartAssessmentRun = "StartAssessmentRun" @@ -1885,6 +1881,7 @@ const opStartAssessmentRun = "StartAssessmentRun" type StartAssessmentRunRequest struct { *aws.Request Input *StartAssessmentRunInput + Copy func(*StartAssessmentRunInput) StartAssessmentRunRequest } // Send marshals and sends the StartAssessmentRun API request. @@ -1927,7 +1924,7 @@ func (c *Inspector) StartAssessmentRunRequest(input *StartAssessmentRunInput) St req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartAssessmentRunRequest{Request: req, Input: input} + return StartAssessmentRunRequest{Request: req, Input: input, Copy: c.StartAssessmentRunRequest} } const opStopAssessmentRun = "StopAssessmentRun" @@ -1936,6 +1933,7 @@ const opStopAssessmentRun = "StopAssessmentRun" type StopAssessmentRunRequest struct { *aws.Request Input *StopAssessmentRunInput + Copy func(*StopAssessmentRunInput) StopAssessmentRunRequest } // Send marshals and sends the StopAssessmentRun API request. @@ -1978,7 +1976,7 @@ func (c *Inspector) StopAssessmentRunRequest(input *StopAssessmentRunInput) Stop req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StopAssessmentRunRequest{Request: req, Input: input} + return StopAssessmentRunRequest{Request: req, Input: input, Copy: c.StopAssessmentRunRequest} } const opSubscribeToEvent = "SubscribeToEvent" @@ -1987,6 +1985,7 @@ const opSubscribeToEvent = "SubscribeToEvent" type SubscribeToEventRequest struct { *aws.Request Input *SubscribeToEventInput + Copy func(*SubscribeToEventInput) SubscribeToEventRequest } // Send marshals and sends the SubscribeToEvent API request. @@ -2030,7 +2029,7 @@ func (c *Inspector) SubscribeToEventRequest(input *SubscribeToEventInput) Subscr req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SubscribeToEventRequest{Request: req, Input: input} + return SubscribeToEventRequest{Request: req, Input: input, Copy: c.SubscribeToEventRequest} } const opUnsubscribeFromEvent = "UnsubscribeFromEvent" @@ -2039,6 +2038,7 @@ const opUnsubscribeFromEvent = "UnsubscribeFromEvent" type UnsubscribeFromEventRequest struct { *aws.Request Input *UnsubscribeFromEventInput + Copy func(*UnsubscribeFromEventInput) UnsubscribeFromEventRequest } // Send marshals and sends the UnsubscribeFromEvent API request. @@ -2082,7 +2082,7 @@ func (c *Inspector) UnsubscribeFromEventRequest(input *UnsubscribeFromEventInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UnsubscribeFromEventRequest{Request: req, Input: input} + return UnsubscribeFromEventRequest{Request: req, Input: input, Copy: c.UnsubscribeFromEventRequest} } const opUpdateAssessmentTarget = "UpdateAssessmentTarget" @@ -2091,6 +2091,7 @@ const opUpdateAssessmentTarget = "UpdateAssessmentTarget" type UpdateAssessmentTargetRequest struct { *aws.Request Input *UpdateAssessmentTargetInput + Copy func(*UpdateAssessmentTargetInput) UpdateAssessmentTargetRequest } // Send marshals and sends the UpdateAssessmentTarget API request. @@ -2134,7 +2135,7 @@ func (c *Inspector) UpdateAssessmentTargetRequest(input *UpdateAssessmentTargetI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateAssessmentTargetRequest{Request: req, Input: input} + return UpdateAssessmentTargetRequest{Request: req, Input: input, Copy: c.UpdateAssessmentTargetRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindingsRequest diff --git a/service/inspector/inspectoriface/interface.go b/service/inspector/inspectoriface/interface.go index 4fd5907e700..7bbd231eac4 100644 --- a/service/inspector/inspectoriface/interface.go +++ b/service/inspector/inspectoriface/interface.go @@ -9,7 +9,6 @@ package inspectoriface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/inspector" ) @@ -97,46 +96,22 @@ type InspectorAPI interface { ListAssessmentRunAgentsRequest(*inspector.ListAssessmentRunAgentsInput) inspector.ListAssessmentRunAgentsRequest - ListAssessmentRunAgentsPages(*inspector.ListAssessmentRunAgentsInput, func(*inspector.ListAssessmentRunAgentsOutput, bool) bool) error - ListAssessmentRunAgentsPagesWithContext(aws.Context, *inspector.ListAssessmentRunAgentsInput, func(*inspector.ListAssessmentRunAgentsOutput, bool) bool, ...aws.Option) error - ListAssessmentRunsRequest(*inspector.ListAssessmentRunsInput) inspector.ListAssessmentRunsRequest - ListAssessmentRunsPages(*inspector.ListAssessmentRunsInput, func(*inspector.ListAssessmentRunsOutput, bool) bool) error - ListAssessmentRunsPagesWithContext(aws.Context, *inspector.ListAssessmentRunsInput, func(*inspector.ListAssessmentRunsOutput, bool) bool, ...aws.Option) error - ListAssessmentTargetsRequest(*inspector.ListAssessmentTargetsInput) inspector.ListAssessmentTargetsRequest - ListAssessmentTargetsPages(*inspector.ListAssessmentTargetsInput, func(*inspector.ListAssessmentTargetsOutput, bool) bool) error - ListAssessmentTargetsPagesWithContext(aws.Context, *inspector.ListAssessmentTargetsInput, func(*inspector.ListAssessmentTargetsOutput, bool) bool, ...aws.Option) error - ListAssessmentTemplatesRequest(*inspector.ListAssessmentTemplatesInput) inspector.ListAssessmentTemplatesRequest - ListAssessmentTemplatesPages(*inspector.ListAssessmentTemplatesInput, func(*inspector.ListAssessmentTemplatesOutput, bool) bool) error - ListAssessmentTemplatesPagesWithContext(aws.Context, *inspector.ListAssessmentTemplatesInput, func(*inspector.ListAssessmentTemplatesOutput, bool) bool, ...aws.Option) error - ListEventSubscriptionsRequest(*inspector.ListEventSubscriptionsInput) inspector.ListEventSubscriptionsRequest - ListEventSubscriptionsPages(*inspector.ListEventSubscriptionsInput, func(*inspector.ListEventSubscriptionsOutput, bool) bool) error - ListEventSubscriptionsPagesWithContext(aws.Context, *inspector.ListEventSubscriptionsInput, func(*inspector.ListEventSubscriptionsOutput, bool) bool, ...aws.Option) error - ListFindingsRequest(*inspector.ListFindingsInput) inspector.ListFindingsRequest - ListFindingsPages(*inspector.ListFindingsInput, func(*inspector.ListFindingsOutput, bool) bool) error - ListFindingsPagesWithContext(aws.Context, *inspector.ListFindingsInput, func(*inspector.ListFindingsOutput, bool) bool, ...aws.Option) error - ListRulesPackagesRequest(*inspector.ListRulesPackagesInput) inspector.ListRulesPackagesRequest - ListRulesPackagesPages(*inspector.ListRulesPackagesInput, func(*inspector.ListRulesPackagesOutput, bool) bool) error - ListRulesPackagesPagesWithContext(aws.Context, *inspector.ListRulesPackagesInput, func(*inspector.ListRulesPackagesOutput, bool) bool, ...aws.Option) error - ListTagsForResourceRequest(*inspector.ListTagsForResourceInput) inspector.ListTagsForResourceRequest PreviewAgentsRequest(*inspector.PreviewAgentsInput) inspector.PreviewAgentsRequest - PreviewAgentsPages(*inspector.PreviewAgentsInput, func(*inspector.PreviewAgentsOutput, bool) bool) error - PreviewAgentsPagesWithContext(aws.Context, *inspector.PreviewAgentsInput, func(*inspector.PreviewAgentsOutput, bool) bool, ...aws.Option) error - RegisterCrossAccountAccessRoleRequest(*inspector.RegisterCrossAccountAccessRoleInput) inspector.RegisterCrossAccountAccessRoleRequest RemoveAttributesFromFindingsRequest(*inspector.RemoveAttributesFromFindingsInput) inspector.RemoveAttributesFromFindingsRequest diff --git a/service/iot/api.go b/service/iot/api.go index 6b2b2cb83cd..878175da248 100644 --- a/service/iot/api.go +++ b/service/iot/api.go @@ -18,6 +18,7 @@ const opAcceptCertificateTransfer = "AcceptCertificateTransfer" type AcceptCertificateTransferRequest struct { *aws.Request Input *AcceptCertificateTransferInput + Copy func(*AcceptCertificateTransferInput) AcceptCertificateTransferRequest } // Send marshals and sends the AcceptCertificateTransfer API request. @@ -62,7 +63,7 @@ func (c *IoT) AcceptCertificateTransferRequest(input *AcceptCertificateTransferI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AcceptCertificateTransferRequest{Request: req, Input: input} + return AcceptCertificateTransferRequest{Request: req, Input: input, Copy: c.AcceptCertificateTransferRequest} } const opAddThingToThingGroup = "AddThingToThingGroup" @@ -71,6 +72,7 @@ const opAddThingToThingGroup = "AddThingToThingGroup" type AddThingToThingGroupRequest struct { *aws.Request Input *AddThingToThingGroupInput + Copy func(*AddThingToThingGroupInput) AddThingToThingGroupRequest } // Send marshals and sends the AddThingToThingGroup API request. @@ -109,7 +111,7 @@ func (c *IoT) AddThingToThingGroupRequest(input *AddThingToThingGroupInput) AddT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddThingToThingGroupRequest{Request: req, Input: input} + return AddThingToThingGroupRequest{Request: req, Input: input, Copy: c.AddThingToThingGroupRequest} } const opAssociateTargetsWithJob = "AssociateTargetsWithJob" @@ -118,6 +120,7 @@ const opAssociateTargetsWithJob = "AssociateTargetsWithJob" type AssociateTargetsWithJobRequest struct { *aws.Request Input *AssociateTargetsWithJobInput + Copy func(*AssociateTargetsWithJobInput) AssociateTargetsWithJobRequest } // Send marshals and sends the AssociateTargetsWithJob API request. @@ -164,7 +167,7 @@ func (c *IoT) AssociateTargetsWithJobRequest(input *AssociateTargetsWithJobInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateTargetsWithJobRequest{Request: req, Input: input} + return AssociateTargetsWithJobRequest{Request: req, Input: input, Copy: c.AssociateTargetsWithJobRequest} } const opAttachPolicy = "AttachPolicy" @@ -173,6 +176,7 @@ const opAttachPolicy = "AttachPolicy" type AttachPolicyRequest struct { *aws.Request Input *AttachPolicyInput + Copy func(*AttachPolicyInput) AttachPolicyRequest } // Send marshals and sends the AttachPolicy API request. @@ -213,7 +217,7 @@ func (c *IoT) AttachPolicyRequest(input *AttachPolicyInput) AttachPolicyRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AttachPolicyRequest{Request: req, Input: input} + return AttachPolicyRequest{Request: req, Input: input, Copy: c.AttachPolicyRequest} } const opAttachPrincipalPolicy = "AttachPrincipalPolicy" @@ -222,6 +226,7 @@ const opAttachPrincipalPolicy = "AttachPrincipalPolicy" type AttachPrincipalPolicyRequest struct { *aws.Request Input *AttachPrincipalPolicyInput + Copy func(*AttachPrincipalPolicyInput) AttachPrincipalPolicyRequest } // Send marshals and sends the AttachPrincipalPolicy API request. @@ -268,7 +273,7 @@ func (c *IoT) AttachPrincipalPolicyRequest(input *AttachPrincipalPolicyInput) At req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AttachPrincipalPolicyRequest{Request: req, Input: input} + return AttachPrincipalPolicyRequest{Request: req, Input: input, Copy: c.AttachPrincipalPolicyRequest} } const opAttachThingPrincipal = "AttachThingPrincipal" @@ -277,6 +282,7 @@ const opAttachThingPrincipal = "AttachThingPrincipal" type AttachThingPrincipalRequest struct { *aws.Request Input *AttachThingPrincipalInput + Copy func(*AttachThingPrincipalInput) AttachThingPrincipalRequest } // Send marshals and sends the AttachThingPrincipal API request. @@ -315,7 +321,7 @@ func (c *IoT) AttachThingPrincipalRequest(input *AttachThingPrincipalInput) Atta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachThingPrincipalRequest{Request: req, Input: input} + return AttachThingPrincipalRequest{Request: req, Input: input, Copy: c.AttachThingPrincipalRequest} } const opCancelCertificateTransfer = "CancelCertificateTransfer" @@ -324,6 +330,7 @@ const opCancelCertificateTransfer = "CancelCertificateTransfer" type CancelCertificateTransferRequest struct { *aws.Request Input *CancelCertificateTransferInput + Copy func(*CancelCertificateTransferInput) CancelCertificateTransferRequest } // Send marshals and sends the CancelCertificateTransfer API request. @@ -373,7 +380,7 @@ func (c *IoT) CancelCertificateTransferRequest(input *CancelCertificateTransferI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CancelCertificateTransferRequest{Request: req, Input: input} + return CancelCertificateTransferRequest{Request: req, Input: input, Copy: c.CancelCertificateTransferRequest} } const opCancelJob = "CancelJob" @@ -382,6 +389,7 @@ const opCancelJob = "CancelJob" type CancelJobRequest struct { *aws.Request Input *CancelJobInput + Copy func(*CancelJobInput) CancelJobRequest } // Send marshals and sends the CancelJob API request. @@ -420,7 +428,7 @@ func (c *IoT) CancelJobRequest(input *CancelJobInput) CancelJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelJobRequest{Request: req, Input: input} + return CancelJobRequest{Request: req, Input: input, Copy: c.CancelJobRequest} } const opClearDefaultAuthorizer = "ClearDefaultAuthorizer" @@ -429,6 +437,7 @@ const opClearDefaultAuthorizer = "ClearDefaultAuthorizer" type ClearDefaultAuthorizerRequest struct { *aws.Request Input *ClearDefaultAuthorizerInput + Copy func(*ClearDefaultAuthorizerInput) ClearDefaultAuthorizerRequest } // Send marshals and sends the ClearDefaultAuthorizer API request. @@ -467,7 +476,7 @@ func (c *IoT) ClearDefaultAuthorizerRequest(input *ClearDefaultAuthorizerInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ClearDefaultAuthorizerRequest{Request: req, Input: input} + return ClearDefaultAuthorizerRequest{Request: req, Input: input, Copy: c.ClearDefaultAuthorizerRequest} } const opCreateAuthorizer = "CreateAuthorizer" @@ -476,6 +485,7 @@ const opCreateAuthorizer = "CreateAuthorizer" type CreateAuthorizerRequest struct { *aws.Request Input *CreateAuthorizerInput + Copy func(*CreateAuthorizerInput) CreateAuthorizerRequest } // Send marshals and sends the CreateAuthorizer API request. @@ -514,7 +524,7 @@ func (c *IoT) CreateAuthorizerRequest(input *CreateAuthorizerInput) CreateAuthor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAuthorizerRequest{Request: req, Input: input} + return CreateAuthorizerRequest{Request: req, Input: input, Copy: c.CreateAuthorizerRequest} } const opCreateCertificateFromCsr = "CreateCertificateFromCsr" @@ -523,6 +533,7 @@ const opCreateCertificateFromCsr = "CreateCertificateFromCsr" type CreateCertificateFromCsrRequest struct { *aws.Request Input *CreateCertificateFromCsrInput + Copy func(*CreateCertificateFromCsrInput) CreateCertificateFromCsrRequest } // Send marshals and sends the CreateCertificateFromCsr API request. @@ -602,7 +613,7 @@ func (c *IoT) CreateCertificateFromCsrRequest(input *CreateCertificateFromCsrInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCertificateFromCsrRequest{Request: req, Input: input} + return CreateCertificateFromCsrRequest{Request: req, Input: input, Copy: c.CreateCertificateFromCsrRequest} } const opCreateJob = "CreateJob" @@ -611,6 +622,7 @@ const opCreateJob = "CreateJob" type CreateJobRequest struct { *aws.Request Input *CreateJobInput + Copy func(*CreateJobInput) CreateJobRequest } // Send marshals and sends the CreateJob API request. @@ -649,7 +661,7 @@ func (c *IoT) CreateJobRequest(input *CreateJobInput) CreateJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateJobRequest{Request: req, Input: input} + return CreateJobRequest{Request: req, Input: input, Copy: c.CreateJobRequest} } const opCreateKeysAndCertificate = "CreateKeysAndCertificate" @@ -658,6 +670,7 @@ const opCreateKeysAndCertificate = "CreateKeysAndCertificate" type CreateKeysAndCertificateRequest struct { *aws.Request Input *CreateKeysAndCertificateInput + Copy func(*CreateKeysAndCertificateInput) CreateKeysAndCertificateRequest } // Send marshals and sends the CreateKeysAndCertificate API request. @@ -700,7 +713,7 @@ func (c *IoT) CreateKeysAndCertificateRequest(input *CreateKeysAndCertificateInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateKeysAndCertificateRequest{Request: req, Input: input} + return CreateKeysAndCertificateRequest{Request: req, Input: input, Copy: c.CreateKeysAndCertificateRequest} } const opCreateOTAUpdate = "CreateOTAUpdate" @@ -709,6 +722,7 @@ const opCreateOTAUpdate = "CreateOTAUpdate" type CreateOTAUpdateRequest struct { *aws.Request Input *CreateOTAUpdateInput + Copy func(*CreateOTAUpdateInput) CreateOTAUpdateRequest } // Send marshals and sends the CreateOTAUpdate API request. @@ -747,7 +761,7 @@ func (c *IoT) CreateOTAUpdateRequest(input *CreateOTAUpdateInput) CreateOTAUpdat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateOTAUpdateRequest{Request: req, Input: input} + return CreateOTAUpdateRequest{Request: req, Input: input, Copy: c.CreateOTAUpdateRequest} } const opCreatePolicy = "CreatePolicy" @@ -756,6 +770,7 @@ const opCreatePolicy = "CreatePolicy" type CreatePolicyRequest struct { *aws.Request Input *CreatePolicyInput + Copy func(*CreatePolicyInput) CreatePolicyRequest } // Send marshals and sends the CreatePolicy API request. @@ -798,7 +813,7 @@ func (c *IoT) CreatePolicyRequest(input *CreatePolicyInput) CreatePolicyRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePolicyRequest{Request: req, Input: input} + return CreatePolicyRequest{Request: req, Input: input, Copy: c.CreatePolicyRequest} } const opCreatePolicyVersion = "CreatePolicyVersion" @@ -807,6 +822,7 @@ const opCreatePolicyVersion = "CreatePolicyVersion" type CreatePolicyVersionRequest struct { *aws.Request Input *CreatePolicyVersionInput + Copy func(*CreatePolicyVersionInput) CreatePolicyVersionRequest } // Send marshals and sends the CreatePolicyVersion API request. @@ -852,7 +868,7 @@ func (c *IoT) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePolicyVersionRequest{Request: req, Input: input} + return CreatePolicyVersionRequest{Request: req, Input: input, Copy: c.CreatePolicyVersionRequest} } const opCreateRoleAlias = "CreateRoleAlias" @@ -861,6 +877,7 @@ const opCreateRoleAlias = "CreateRoleAlias" type CreateRoleAliasRequest struct { *aws.Request Input *CreateRoleAliasInput + Copy func(*CreateRoleAliasInput) CreateRoleAliasRequest } // Send marshals and sends the CreateRoleAlias API request. @@ -899,7 +916,7 @@ func (c *IoT) CreateRoleAliasRequest(input *CreateRoleAliasInput) CreateRoleAlia req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRoleAliasRequest{Request: req, Input: input} + return CreateRoleAliasRequest{Request: req, Input: input, Copy: c.CreateRoleAliasRequest} } const opCreateStream = "CreateStream" @@ -908,6 +925,7 @@ const opCreateStream = "CreateStream" type CreateStreamRequest struct { *aws.Request Input *CreateStreamInput + Copy func(*CreateStreamInput) CreateStreamRequest } // Send marshals and sends the CreateStream API request. @@ -952,7 +970,7 @@ func (c *IoT) CreateStreamRequest(input *CreateStreamInput) CreateStreamRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStreamRequest{Request: req, Input: input} + return CreateStreamRequest{Request: req, Input: input, Copy: c.CreateStreamRequest} } const opCreateThing = "CreateThing" @@ -961,6 +979,7 @@ const opCreateThing = "CreateThing" type CreateThingRequest struct { *aws.Request Input *CreateThingInput + Copy func(*CreateThingInput) CreateThingRequest } // Send marshals and sends the CreateThing API request. @@ -999,7 +1018,7 @@ func (c *IoT) CreateThingRequest(input *CreateThingInput) CreateThingRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateThingRequest{Request: req, Input: input} + return CreateThingRequest{Request: req, Input: input, Copy: c.CreateThingRequest} } const opCreateThingGroup = "CreateThingGroup" @@ -1008,6 +1027,7 @@ const opCreateThingGroup = "CreateThingGroup" type CreateThingGroupRequest struct { *aws.Request Input *CreateThingGroupInput + Copy func(*CreateThingGroupInput) CreateThingGroupRequest } // Send marshals and sends the CreateThingGroup API request. @@ -1046,7 +1066,7 @@ func (c *IoT) CreateThingGroupRequest(input *CreateThingGroupInput) CreateThingG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateThingGroupRequest{Request: req, Input: input} + return CreateThingGroupRequest{Request: req, Input: input, Copy: c.CreateThingGroupRequest} } const opCreateThingType = "CreateThingType" @@ -1055,6 +1075,7 @@ const opCreateThingType = "CreateThingType" type CreateThingTypeRequest struct { *aws.Request Input *CreateThingTypeInput + Copy func(*CreateThingTypeInput) CreateThingTypeRequest } // Send marshals and sends the CreateThingType API request. @@ -1093,7 +1114,7 @@ func (c *IoT) CreateThingTypeRequest(input *CreateThingTypeInput) CreateThingTyp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateThingTypeRequest{Request: req, Input: input} + return CreateThingTypeRequest{Request: req, Input: input, Copy: c.CreateThingTypeRequest} } const opCreateTopicRule = "CreateTopicRule" @@ -1102,6 +1123,7 @@ const opCreateTopicRule = "CreateTopicRule" type CreateTopicRuleRequest struct { *aws.Request Input *CreateTopicRuleInput + Copy func(*CreateTopicRuleInput) CreateTopicRuleRequest } // Send marshals and sends the CreateTopicRule API request. @@ -1144,7 +1166,7 @@ func (c *IoT) CreateTopicRuleRequest(input *CreateTopicRuleInput) CreateTopicRul req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateTopicRuleRequest{Request: req, Input: input} + return CreateTopicRuleRequest{Request: req, Input: input, Copy: c.CreateTopicRuleRequest} } const opDeleteAuthorizer = "DeleteAuthorizer" @@ -1153,6 +1175,7 @@ const opDeleteAuthorizer = "DeleteAuthorizer" type DeleteAuthorizerRequest struct { *aws.Request Input *DeleteAuthorizerInput + Copy func(*DeleteAuthorizerInput) DeleteAuthorizerRequest } // Send marshals and sends the DeleteAuthorizer API request. @@ -1191,7 +1214,7 @@ func (c *IoT) DeleteAuthorizerRequest(input *DeleteAuthorizerInput) DeleteAuthor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteAuthorizerRequest{Request: req, Input: input} + return DeleteAuthorizerRequest{Request: req, Input: input, Copy: c.DeleteAuthorizerRequest} } const opDeleteCACertificate = "DeleteCACertificate" @@ -1200,6 +1223,7 @@ const opDeleteCACertificate = "DeleteCACertificate" type DeleteCACertificateRequest struct { *aws.Request Input *DeleteCACertificateInput + Copy func(*DeleteCACertificateInput) DeleteCACertificateRequest } // Send marshals and sends the DeleteCACertificate API request. @@ -1238,7 +1262,7 @@ func (c *IoT) DeleteCACertificateRequest(input *DeleteCACertificateInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteCACertificateRequest{Request: req, Input: input} + return DeleteCACertificateRequest{Request: req, Input: input, Copy: c.DeleteCACertificateRequest} } const opDeleteCertificate = "DeleteCertificate" @@ -1247,6 +1271,7 @@ const opDeleteCertificate = "DeleteCertificate" type DeleteCertificateRequest struct { *aws.Request Input *DeleteCertificateInput + Copy func(*DeleteCertificateInput) DeleteCertificateRequest } // Send marshals and sends the DeleteCertificate API request. @@ -1292,7 +1317,7 @@ func (c *IoT) DeleteCertificateRequest(input *DeleteCertificateInput) DeleteCert req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCertificateRequest{Request: req, Input: input} + return DeleteCertificateRequest{Request: req, Input: input, Copy: c.DeleteCertificateRequest} } const opDeleteOTAUpdate = "DeleteOTAUpdate" @@ -1301,6 +1326,7 @@ const opDeleteOTAUpdate = "DeleteOTAUpdate" type DeleteOTAUpdateRequest struct { *aws.Request Input *DeleteOTAUpdateInput + Copy func(*DeleteOTAUpdateInput) DeleteOTAUpdateRequest } // Send marshals and sends the DeleteOTAUpdate API request. @@ -1339,7 +1365,7 @@ func (c *IoT) DeleteOTAUpdateRequest(input *DeleteOTAUpdateInput) DeleteOTAUpdat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteOTAUpdateRequest{Request: req, Input: input} + return DeleteOTAUpdateRequest{Request: req, Input: input, Copy: c.DeleteOTAUpdateRequest} } const opDeletePolicy = "DeletePolicy" @@ -1348,6 +1374,7 @@ const opDeletePolicy = "DeletePolicy" type DeletePolicyRequest struct { *aws.Request Input *DeletePolicyInput + Copy func(*DeletePolicyInput) DeletePolicyRequest } // Send marshals and sends the DeletePolicy API request. @@ -1398,7 +1425,7 @@ func (c *IoT) DeletePolicyRequest(input *DeletePolicyInput) DeletePolicyRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePolicyRequest{Request: req, Input: input} + return DeletePolicyRequest{Request: req, Input: input, Copy: c.DeletePolicyRequest} } const opDeletePolicyVersion = "DeletePolicyVersion" @@ -1407,6 +1434,7 @@ const opDeletePolicyVersion = "DeletePolicyVersion" type DeletePolicyVersionRequest struct { *aws.Request Input *DeletePolicyVersionInput + Copy func(*DeletePolicyVersionInput) DeletePolicyVersionRequest } // Send marshals and sends the DeletePolicyVersion API request. @@ -1450,7 +1478,7 @@ func (c *IoT) DeletePolicyVersionRequest(input *DeletePolicyVersionInput) Delete req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePolicyVersionRequest{Request: req, Input: input} + return DeletePolicyVersionRequest{Request: req, Input: input, Copy: c.DeletePolicyVersionRequest} } const opDeleteRegistrationCode = "DeleteRegistrationCode" @@ -1459,6 +1487,7 @@ const opDeleteRegistrationCode = "DeleteRegistrationCode" type DeleteRegistrationCodeRequest struct { *aws.Request Input *DeleteRegistrationCodeInput + Copy func(*DeleteRegistrationCodeInput) DeleteRegistrationCodeRequest } // Send marshals and sends the DeleteRegistrationCode API request. @@ -1497,7 +1526,7 @@ func (c *IoT) DeleteRegistrationCodeRequest(input *DeleteRegistrationCodeInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRegistrationCodeRequest{Request: req, Input: input} + return DeleteRegistrationCodeRequest{Request: req, Input: input, Copy: c.DeleteRegistrationCodeRequest} } const opDeleteRoleAlias = "DeleteRoleAlias" @@ -1506,6 +1535,7 @@ const opDeleteRoleAlias = "DeleteRoleAlias" type DeleteRoleAliasRequest struct { *aws.Request Input *DeleteRoleAliasInput + Copy func(*DeleteRoleAliasInput) DeleteRoleAliasRequest } // Send marshals and sends the DeleteRoleAlias API request. @@ -1544,7 +1574,7 @@ func (c *IoT) DeleteRoleAliasRequest(input *DeleteRoleAliasInput) DeleteRoleAlia req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRoleAliasRequest{Request: req, Input: input} + return DeleteRoleAliasRequest{Request: req, Input: input, Copy: c.DeleteRoleAliasRequest} } const opDeleteStream = "DeleteStream" @@ -1553,6 +1583,7 @@ const opDeleteStream = "DeleteStream" type DeleteStreamRequest struct { *aws.Request Input *DeleteStreamInput + Copy func(*DeleteStreamInput) DeleteStreamRequest } // Send marshals and sends the DeleteStream API request. @@ -1591,7 +1622,7 @@ func (c *IoT) DeleteStreamRequest(input *DeleteStreamInput) DeleteStreamRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteStreamRequest{Request: req, Input: input} + return DeleteStreamRequest{Request: req, Input: input, Copy: c.DeleteStreamRequest} } const opDeleteThing = "DeleteThing" @@ -1600,6 +1631,7 @@ const opDeleteThing = "DeleteThing" type DeleteThingRequest struct { *aws.Request Input *DeleteThingInput + Copy func(*DeleteThingInput) DeleteThingRequest } // Send marshals and sends the DeleteThing API request. @@ -1638,7 +1670,7 @@ func (c *IoT) DeleteThingRequest(input *DeleteThingInput) DeleteThingRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteThingRequest{Request: req, Input: input} + return DeleteThingRequest{Request: req, Input: input, Copy: c.DeleteThingRequest} } const opDeleteThingGroup = "DeleteThingGroup" @@ -1647,6 +1679,7 @@ const opDeleteThingGroup = "DeleteThingGroup" type DeleteThingGroupRequest struct { *aws.Request Input *DeleteThingGroupInput + Copy func(*DeleteThingGroupInput) DeleteThingGroupRequest } // Send marshals and sends the DeleteThingGroup API request. @@ -1685,7 +1718,7 @@ func (c *IoT) DeleteThingGroupRequest(input *DeleteThingGroupInput) DeleteThingG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteThingGroupRequest{Request: req, Input: input} + return DeleteThingGroupRequest{Request: req, Input: input, Copy: c.DeleteThingGroupRequest} } const opDeleteThingType = "DeleteThingType" @@ -1694,6 +1727,7 @@ const opDeleteThingType = "DeleteThingType" type DeleteThingTypeRequest struct { *aws.Request Input *DeleteThingTypeInput + Copy func(*DeleteThingTypeInput) DeleteThingTypeRequest } // Send marshals and sends the DeleteThingType API request. @@ -1736,7 +1770,7 @@ func (c *IoT) DeleteThingTypeRequest(input *DeleteThingTypeInput) DeleteThingTyp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteThingTypeRequest{Request: req, Input: input} + return DeleteThingTypeRequest{Request: req, Input: input, Copy: c.DeleteThingTypeRequest} } const opDeleteTopicRule = "DeleteTopicRule" @@ -1745,6 +1779,7 @@ const opDeleteTopicRule = "DeleteTopicRule" type DeleteTopicRuleRequest struct { *aws.Request Input *DeleteTopicRuleInput + Copy func(*DeleteTopicRuleInput) DeleteTopicRuleRequest } // Send marshals and sends the DeleteTopicRule API request. @@ -1785,7 +1820,7 @@ func (c *IoT) DeleteTopicRuleRequest(input *DeleteTopicRuleInput) DeleteTopicRul req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteTopicRuleRequest{Request: req, Input: input} + return DeleteTopicRuleRequest{Request: req, Input: input, Copy: c.DeleteTopicRuleRequest} } const opDeleteV2LoggingLevel = "DeleteV2LoggingLevel" @@ -1794,6 +1829,7 @@ const opDeleteV2LoggingLevel = "DeleteV2LoggingLevel" type DeleteV2LoggingLevelRequest struct { *aws.Request Input *DeleteV2LoggingLevelInput + Copy func(*DeleteV2LoggingLevelInput) DeleteV2LoggingLevelRequest } // Send marshals and sends the DeleteV2LoggingLevel API request. @@ -1834,7 +1870,7 @@ func (c *IoT) DeleteV2LoggingLevelRequest(input *DeleteV2LoggingLevelInput) Dele req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteV2LoggingLevelRequest{Request: req, Input: input} + return DeleteV2LoggingLevelRequest{Request: req, Input: input, Copy: c.DeleteV2LoggingLevelRequest} } const opDeprecateThingType = "DeprecateThingType" @@ -1843,6 +1879,7 @@ const opDeprecateThingType = "DeprecateThingType" type DeprecateThingTypeRequest struct { *aws.Request Input *DeprecateThingTypeInput + Copy func(*DeprecateThingTypeInput) DeprecateThingTypeRequest } // Send marshals and sends the DeprecateThingType API request. @@ -1882,7 +1919,7 @@ func (c *IoT) DeprecateThingTypeRequest(input *DeprecateThingTypeInput) Deprecat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeprecateThingTypeRequest{Request: req, Input: input} + return DeprecateThingTypeRequest{Request: req, Input: input, Copy: c.DeprecateThingTypeRequest} } const opDescribeAuthorizer = "DescribeAuthorizer" @@ -1891,6 +1928,7 @@ const opDescribeAuthorizer = "DescribeAuthorizer" type DescribeAuthorizerRequest struct { *aws.Request Input *DescribeAuthorizerInput + Copy func(*DescribeAuthorizerInput) DescribeAuthorizerRequest } // Send marshals and sends the DescribeAuthorizer API request. @@ -1929,7 +1967,7 @@ func (c *IoT) DescribeAuthorizerRequest(input *DescribeAuthorizerInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAuthorizerRequest{Request: req, Input: input} + return DescribeAuthorizerRequest{Request: req, Input: input, Copy: c.DescribeAuthorizerRequest} } const opDescribeCACertificate = "DescribeCACertificate" @@ -1938,6 +1976,7 @@ const opDescribeCACertificate = "DescribeCACertificate" type DescribeCACertificateRequest struct { *aws.Request Input *DescribeCACertificateInput + Copy func(*DescribeCACertificateInput) DescribeCACertificateRequest } // Send marshals and sends the DescribeCACertificate API request. @@ -1976,7 +2015,7 @@ func (c *IoT) DescribeCACertificateRequest(input *DescribeCACertificateInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCACertificateRequest{Request: req, Input: input} + return DescribeCACertificateRequest{Request: req, Input: input, Copy: c.DescribeCACertificateRequest} } const opDescribeCertificate = "DescribeCertificate" @@ -1985,6 +2024,7 @@ const opDescribeCertificate = "DescribeCertificate" type DescribeCertificateRequest struct { *aws.Request Input *DescribeCertificateInput + Copy func(*DescribeCertificateInput) DescribeCertificateRequest } // Send marshals and sends the DescribeCertificate API request. @@ -2023,7 +2063,7 @@ func (c *IoT) DescribeCertificateRequest(input *DescribeCertificateInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCertificateRequest{Request: req, Input: input} + return DescribeCertificateRequest{Request: req, Input: input, Copy: c.DescribeCertificateRequest} } const opDescribeDefaultAuthorizer = "DescribeDefaultAuthorizer" @@ -2032,6 +2072,7 @@ const opDescribeDefaultAuthorizer = "DescribeDefaultAuthorizer" type DescribeDefaultAuthorizerRequest struct { *aws.Request Input *DescribeDefaultAuthorizerInput + Copy func(*DescribeDefaultAuthorizerInput) DescribeDefaultAuthorizerRequest } // Send marshals and sends the DescribeDefaultAuthorizer API request. @@ -2070,7 +2111,7 @@ func (c *IoT) DescribeDefaultAuthorizerRequest(input *DescribeDefaultAuthorizerI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDefaultAuthorizerRequest{Request: req, Input: input} + return DescribeDefaultAuthorizerRequest{Request: req, Input: input, Copy: c.DescribeDefaultAuthorizerRequest} } const opDescribeEndpoint = "DescribeEndpoint" @@ -2079,6 +2120,7 @@ const opDescribeEndpoint = "DescribeEndpoint" type DescribeEndpointRequest struct { *aws.Request Input *DescribeEndpointInput + Copy func(*DescribeEndpointInput) DescribeEndpointRequest } // Send marshals and sends the DescribeEndpoint API request. @@ -2117,7 +2159,7 @@ func (c *IoT) DescribeEndpointRequest(input *DescribeEndpointInput) DescribeEndp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEndpointRequest{Request: req, Input: input} + return DescribeEndpointRequest{Request: req, Input: input, Copy: c.DescribeEndpointRequest} } const opDescribeEventConfigurations = "DescribeEventConfigurations" @@ -2126,6 +2168,7 @@ const opDescribeEventConfigurations = "DescribeEventConfigurations" type DescribeEventConfigurationsRequest struct { *aws.Request Input *DescribeEventConfigurationsInput + Copy func(*DescribeEventConfigurationsInput) DescribeEventConfigurationsRequest } // Send marshals and sends the DescribeEventConfigurations API request. @@ -2164,7 +2207,7 @@ func (c *IoT) DescribeEventConfigurationsRequest(input *DescribeEventConfigurati req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventConfigurationsRequest{Request: req, Input: input} + return DescribeEventConfigurationsRequest{Request: req, Input: input, Copy: c.DescribeEventConfigurationsRequest} } const opDescribeIndex = "DescribeIndex" @@ -2173,6 +2216,7 @@ const opDescribeIndex = "DescribeIndex" type DescribeIndexRequest struct { *aws.Request Input *DescribeIndexInput + Copy func(*DescribeIndexInput) DescribeIndexRequest } // Send marshals and sends the DescribeIndex API request. @@ -2211,7 +2255,7 @@ func (c *IoT) DescribeIndexRequest(input *DescribeIndexInput) DescribeIndexReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeIndexRequest{Request: req, Input: input} + return DescribeIndexRequest{Request: req, Input: input, Copy: c.DescribeIndexRequest} } const opDescribeJob = "DescribeJob" @@ -2220,6 +2264,7 @@ const opDescribeJob = "DescribeJob" type DescribeJobRequest struct { *aws.Request Input *DescribeJobInput + Copy func(*DescribeJobInput) DescribeJobRequest } // Send marshals and sends the DescribeJob API request. @@ -2258,7 +2303,7 @@ func (c *IoT) DescribeJobRequest(input *DescribeJobInput) DescribeJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeJobRequest{Request: req, Input: input} + return DescribeJobRequest{Request: req, Input: input, Copy: c.DescribeJobRequest} } const opDescribeJobExecution = "DescribeJobExecution" @@ -2267,6 +2312,7 @@ const opDescribeJobExecution = "DescribeJobExecution" type DescribeJobExecutionRequest struct { *aws.Request Input *DescribeJobExecutionInput + Copy func(*DescribeJobExecutionInput) DescribeJobExecutionRequest } // Send marshals and sends the DescribeJobExecution API request. @@ -2305,7 +2351,7 @@ func (c *IoT) DescribeJobExecutionRequest(input *DescribeJobExecutionInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeJobExecutionRequest{Request: req, Input: input} + return DescribeJobExecutionRequest{Request: req, Input: input, Copy: c.DescribeJobExecutionRequest} } const opDescribeRoleAlias = "DescribeRoleAlias" @@ -2314,6 +2360,7 @@ const opDescribeRoleAlias = "DescribeRoleAlias" type DescribeRoleAliasRequest struct { *aws.Request Input *DescribeRoleAliasInput + Copy func(*DescribeRoleAliasInput) DescribeRoleAliasRequest } // Send marshals and sends the DescribeRoleAlias API request. @@ -2352,7 +2399,7 @@ func (c *IoT) DescribeRoleAliasRequest(input *DescribeRoleAliasInput) DescribeRo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRoleAliasRequest{Request: req, Input: input} + return DescribeRoleAliasRequest{Request: req, Input: input, Copy: c.DescribeRoleAliasRequest} } const opDescribeStream = "DescribeStream" @@ -2361,6 +2408,7 @@ const opDescribeStream = "DescribeStream" type DescribeStreamRequest struct { *aws.Request Input *DescribeStreamInput + Copy func(*DescribeStreamInput) DescribeStreamRequest } // Send marshals and sends the DescribeStream API request. @@ -2399,7 +2447,7 @@ func (c *IoT) DescribeStreamRequest(input *DescribeStreamInput) DescribeStreamRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStreamRequest{Request: req, Input: input} + return DescribeStreamRequest{Request: req, Input: input, Copy: c.DescribeStreamRequest} } const opDescribeThing = "DescribeThing" @@ -2408,6 +2456,7 @@ const opDescribeThing = "DescribeThing" type DescribeThingRequest struct { *aws.Request Input *DescribeThingInput + Copy func(*DescribeThingInput) DescribeThingRequest } // Send marshals and sends the DescribeThing API request. @@ -2446,7 +2495,7 @@ func (c *IoT) DescribeThingRequest(input *DescribeThingInput) DescribeThingReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeThingRequest{Request: req, Input: input} + return DescribeThingRequest{Request: req, Input: input, Copy: c.DescribeThingRequest} } const opDescribeThingGroup = "DescribeThingGroup" @@ -2455,6 +2504,7 @@ const opDescribeThingGroup = "DescribeThingGroup" type DescribeThingGroupRequest struct { *aws.Request Input *DescribeThingGroupInput + Copy func(*DescribeThingGroupInput) DescribeThingGroupRequest } // Send marshals and sends the DescribeThingGroup API request. @@ -2493,7 +2543,7 @@ func (c *IoT) DescribeThingGroupRequest(input *DescribeThingGroupInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeThingGroupRequest{Request: req, Input: input} + return DescribeThingGroupRequest{Request: req, Input: input, Copy: c.DescribeThingGroupRequest} } const opDescribeThingRegistrationTask = "DescribeThingRegistrationTask" @@ -2502,6 +2552,7 @@ const opDescribeThingRegistrationTask = "DescribeThingRegistrationTask" type DescribeThingRegistrationTaskRequest struct { *aws.Request Input *DescribeThingRegistrationTaskInput + Copy func(*DescribeThingRegistrationTaskInput) DescribeThingRegistrationTaskRequest } // Send marshals and sends the DescribeThingRegistrationTask API request. @@ -2540,7 +2591,7 @@ func (c *IoT) DescribeThingRegistrationTaskRequest(input *DescribeThingRegistrat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeThingRegistrationTaskRequest{Request: req, Input: input} + return DescribeThingRegistrationTaskRequest{Request: req, Input: input, Copy: c.DescribeThingRegistrationTaskRequest} } const opDescribeThingType = "DescribeThingType" @@ -2549,6 +2600,7 @@ const opDescribeThingType = "DescribeThingType" type DescribeThingTypeRequest struct { *aws.Request Input *DescribeThingTypeInput + Copy func(*DescribeThingTypeInput) DescribeThingTypeRequest } // Send marshals and sends the DescribeThingType API request. @@ -2587,7 +2639,7 @@ func (c *IoT) DescribeThingTypeRequest(input *DescribeThingTypeInput) DescribeTh req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeThingTypeRequest{Request: req, Input: input} + return DescribeThingTypeRequest{Request: req, Input: input, Copy: c.DescribeThingTypeRequest} } const opDetachPolicy = "DetachPolicy" @@ -2596,6 +2648,7 @@ const opDetachPolicy = "DetachPolicy" type DetachPolicyRequest struct { *aws.Request Input *DetachPolicyInput + Copy func(*DetachPolicyInput) DetachPolicyRequest } // Send marshals and sends the DetachPolicy API request. @@ -2636,7 +2689,7 @@ func (c *IoT) DetachPolicyRequest(input *DetachPolicyInput) DetachPolicyRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachPolicyRequest{Request: req, Input: input} + return DetachPolicyRequest{Request: req, Input: input, Copy: c.DetachPolicyRequest} } const opDetachPrincipalPolicy = "DetachPrincipalPolicy" @@ -2645,6 +2698,7 @@ const opDetachPrincipalPolicy = "DetachPrincipalPolicy" type DetachPrincipalPolicyRequest struct { *aws.Request Input *DetachPrincipalPolicyInput + Copy func(*DetachPrincipalPolicyInput) DetachPrincipalPolicyRequest } // Send marshals and sends the DetachPrincipalPolicy API request. @@ -2690,7 +2744,7 @@ func (c *IoT) DetachPrincipalPolicyRequest(input *DetachPrincipalPolicyInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachPrincipalPolicyRequest{Request: req, Input: input} + return DetachPrincipalPolicyRequest{Request: req, Input: input, Copy: c.DetachPrincipalPolicyRequest} } const opDetachThingPrincipal = "DetachThingPrincipal" @@ -2699,6 +2753,7 @@ const opDetachThingPrincipal = "DetachThingPrincipal" type DetachThingPrincipalRequest struct { *aws.Request Input *DetachThingPrincipalInput + Copy func(*DetachThingPrincipalInput) DetachThingPrincipalRequest } // Send marshals and sends the DetachThingPrincipal API request. @@ -2737,7 +2792,7 @@ func (c *IoT) DetachThingPrincipalRequest(input *DetachThingPrincipalInput) Deta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachThingPrincipalRequest{Request: req, Input: input} + return DetachThingPrincipalRequest{Request: req, Input: input, Copy: c.DetachThingPrincipalRequest} } const opDisableTopicRule = "DisableTopicRule" @@ -2746,6 +2801,7 @@ const opDisableTopicRule = "DisableTopicRule" type DisableTopicRuleRequest struct { *aws.Request Input *DisableTopicRuleInput + Copy func(*DisableTopicRuleInput) DisableTopicRuleRequest } // Send marshals and sends the DisableTopicRule API request. @@ -2786,7 +2842,7 @@ func (c *IoT) DisableTopicRuleRequest(input *DisableTopicRuleInput) DisableTopic req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisableTopicRuleRequest{Request: req, Input: input} + return DisableTopicRuleRequest{Request: req, Input: input, Copy: c.DisableTopicRuleRequest} } const opEnableTopicRule = "EnableTopicRule" @@ -2795,6 +2851,7 @@ const opEnableTopicRule = "EnableTopicRule" type EnableTopicRuleRequest struct { *aws.Request Input *EnableTopicRuleInput + Copy func(*EnableTopicRuleInput) EnableTopicRuleRequest } // Send marshals and sends the EnableTopicRule API request. @@ -2835,7 +2892,7 @@ func (c *IoT) EnableTopicRuleRequest(input *EnableTopicRuleInput) EnableTopicRul req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableTopicRuleRequest{Request: req, Input: input} + return EnableTopicRuleRequest{Request: req, Input: input, Copy: c.EnableTopicRuleRequest} } const opGetEffectivePolicies = "GetEffectivePolicies" @@ -2844,6 +2901,7 @@ const opGetEffectivePolicies = "GetEffectivePolicies" type GetEffectivePoliciesRequest struct { *aws.Request Input *GetEffectivePoliciesInput + Copy func(*GetEffectivePoliciesInput) GetEffectivePoliciesRequest } // Send marshals and sends the GetEffectivePolicies API request. @@ -2882,7 +2940,7 @@ func (c *IoT) GetEffectivePoliciesRequest(input *GetEffectivePoliciesInput) GetE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetEffectivePoliciesRequest{Request: req, Input: input} + return GetEffectivePoliciesRequest{Request: req, Input: input, Copy: c.GetEffectivePoliciesRequest} } const opGetIndexingConfiguration = "GetIndexingConfiguration" @@ -2891,6 +2949,7 @@ const opGetIndexingConfiguration = "GetIndexingConfiguration" type GetIndexingConfigurationRequest struct { *aws.Request Input *GetIndexingConfigurationInput + Copy func(*GetIndexingConfigurationInput) GetIndexingConfigurationRequest } // Send marshals and sends the GetIndexingConfiguration API request. @@ -2929,7 +2988,7 @@ func (c *IoT) GetIndexingConfigurationRequest(input *GetIndexingConfigurationInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIndexingConfigurationRequest{Request: req, Input: input} + return GetIndexingConfigurationRequest{Request: req, Input: input, Copy: c.GetIndexingConfigurationRequest} } const opGetJobDocument = "GetJobDocument" @@ -2938,6 +2997,7 @@ const opGetJobDocument = "GetJobDocument" type GetJobDocumentRequest struct { *aws.Request Input *GetJobDocumentInput + Copy func(*GetJobDocumentInput) GetJobDocumentRequest } // Send marshals and sends the GetJobDocument API request. @@ -2976,7 +3036,7 @@ func (c *IoT) GetJobDocumentRequest(input *GetJobDocumentInput) GetJobDocumentRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobDocumentRequest{Request: req, Input: input} + return GetJobDocumentRequest{Request: req, Input: input, Copy: c.GetJobDocumentRequest} } const opGetLoggingOptions = "GetLoggingOptions" @@ -2985,6 +3045,7 @@ const opGetLoggingOptions = "GetLoggingOptions" type GetLoggingOptionsRequest struct { *aws.Request Input *GetLoggingOptionsInput + Copy func(*GetLoggingOptionsInput) GetLoggingOptionsRequest } // Send marshals and sends the GetLoggingOptions API request. @@ -3023,7 +3084,7 @@ func (c *IoT) GetLoggingOptionsRequest(input *GetLoggingOptionsInput) GetLogging req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLoggingOptionsRequest{Request: req, Input: input} + return GetLoggingOptionsRequest{Request: req, Input: input, Copy: c.GetLoggingOptionsRequest} } const opGetOTAUpdate = "GetOTAUpdate" @@ -3032,6 +3093,7 @@ const opGetOTAUpdate = "GetOTAUpdate" type GetOTAUpdateRequest struct { *aws.Request Input *GetOTAUpdateInput + Copy func(*GetOTAUpdateInput) GetOTAUpdateRequest } // Send marshals and sends the GetOTAUpdate API request. @@ -3070,7 +3132,7 @@ func (c *IoT) GetOTAUpdateRequest(input *GetOTAUpdateInput) GetOTAUpdateRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOTAUpdateRequest{Request: req, Input: input} + return GetOTAUpdateRequest{Request: req, Input: input, Copy: c.GetOTAUpdateRequest} } const opGetPolicy = "GetPolicy" @@ -3079,6 +3141,7 @@ const opGetPolicy = "GetPolicy" type GetPolicyRequest struct { *aws.Request Input *GetPolicyInput + Copy func(*GetPolicyInput) GetPolicyRequest } // Send marshals and sends the GetPolicy API request. @@ -3118,7 +3181,7 @@ func (c *IoT) GetPolicyRequest(input *GetPolicyInput) GetPolicyRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPolicyRequest{Request: req, Input: input} + return GetPolicyRequest{Request: req, Input: input, Copy: c.GetPolicyRequest} } const opGetPolicyVersion = "GetPolicyVersion" @@ -3127,6 +3190,7 @@ const opGetPolicyVersion = "GetPolicyVersion" type GetPolicyVersionRequest struct { *aws.Request Input *GetPolicyVersionInput + Copy func(*GetPolicyVersionInput) GetPolicyVersionRequest } // Send marshals and sends the GetPolicyVersion API request. @@ -3165,7 +3229,7 @@ func (c *IoT) GetPolicyVersionRequest(input *GetPolicyVersionInput) GetPolicyVer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPolicyVersionRequest{Request: req, Input: input} + return GetPolicyVersionRequest{Request: req, Input: input, Copy: c.GetPolicyVersionRequest} } const opGetRegistrationCode = "GetRegistrationCode" @@ -3174,6 +3238,7 @@ const opGetRegistrationCode = "GetRegistrationCode" type GetRegistrationCodeRequest struct { *aws.Request Input *GetRegistrationCodeInput + Copy func(*GetRegistrationCodeInput) GetRegistrationCodeRequest } // Send marshals and sends the GetRegistrationCode API request. @@ -3212,7 +3277,7 @@ func (c *IoT) GetRegistrationCodeRequest(input *GetRegistrationCodeInput) GetReg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRegistrationCodeRequest{Request: req, Input: input} + return GetRegistrationCodeRequest{Request: req, Input: input, Copy: c.GetRegistrationCodeRequest} } const opGetTopicRule = "GetTopicRule" @@ -3221,6 +3286,7 @@ const opGetTopicRule = "GetTopicRule" type GetTopicRuleRequest struct { *aws.Request Input *GetTopicRuleInput + Copy func(*GetTopicRuleInput) GetTopicRuleRequest } // Send marshals and sends the GetTopicRule API request. @@ -3259,7 +3325,7 @@ func (c *IoT) GetTopicRuleRequest(input *GetTopicRuleInput) GetTopicRuleRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTopicRuleRequest{Request: req, Input: input} + return GetTopicRuleRequest{Request: req, Input: input, Copy: c.GetTopicRuleRequest} } const opGetV2LoggingOptions = "GetV2LoggingOptions" @@ -3268,6 +3334,7 @@ const opGetV2LoggingOptions = "GetV2LoggingOptions" type GetV2LoggingOptionsRequest struct { *aws.Request Input *GetV2LoggingOptionsInput + Copy func(*GetV2LoggingOptionsInput) GetV2LoggingOptionsRequest } // Send marshals and sends the GetV2LoggingOptions API request. @@ -3306,7 +3373,7 @@ func (c *IoT) GetV2LoggingOptionsRequest(input *GetV2LoggingOptionsInput) GetV2L req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetV2LoggingOptionsRequest{Request: req, Input: input} + return GetV2LoggingOptionsRequest{Request: req, Input: input, Copy: c.GetV2LoggingOptionsRequest} } const opListAttachedPolicies = "ListAttachedPolicies" @@ -3315,6 +3382,7 @@ const opListAttachedPolicies = "ListAttachedPolicies" type ListAttachedPoliciesRequest struct { *aws.Request Input *ListAttachedPoliciesInput + Copy func(*ListAttachedPoliciesInput) ListAttachedPoliciesRequest } // Send marshals and sends the ListAttachedPolicies API request. @@ -3353,7 +3421,7 @@ func (c *IoT) ListAttachedPoliciesRequest(input *ListAttachedPoliciesInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAttachedPoliciesRequest{Request: req, Input: input} + return ListAttachedPoliciesRequest{Request: req, Input: input, Copy: c.ListAttachedPoliciesRequest} } const opListAuthorizers = "ListAuthorizers" @@ -3362,6 +3430,7 @@ const opListAuthorizers = "ListAuthorizers" type ListAuthorizersRequest struct { *aws.Request Input *ListAuthorizersInput + Copy func(*ListAuthorizersInput) ListAuthorizersRequest } // Send marshals and sends the ListAuthorizers API request. @@ -3400,7 +3469,7 @@ func (c *IoT) ListAuthorizersRequest(input *ListAuthorizersInput) ListAuthorizer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAuthorizersRequest{Request: req, Input: input} + return ListAuthorizersRequest{Request: req, Input: input, Copy: c.ListAuthorizersRequest} } const opListCACertificates = "ListCACertificates" @@ -3409,6 +3478,7 @@ const opListCACertificates = "ListCACertificates" type ListCACertificatesRequest struct { *aws.Request Input *ListCACertificatesInput + Copy func(*ListCACertificatesInput) ListCACertificatesRequest } // Send marshals and sends the ListCACertificates API request. @@ -3450,7 +3520,7 @@ func (c *IoT) ListCACertificatesRequest(input *ListCACertificatesInput) ListCACe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCACertificatesRequest{Request: req, Input: input} + return ListCACertificatesRequest{Request: req, Input: input, Copy: c.ListCACertificatesRequest} } const opListCertificates = "ListCertificates" @@ -3459,6 +3529,7 @@ const opListCertificates = "ListCertificates" type ListCertificatesRequest struct { *aws.Request Input *ListCertificatesInput + Copy func(*ListCertificatesInput) ListCertificatesRequest } // Send marshals and sends the ListCertificates API request. @@ -3500,7 +3571,7 @@ func (c *IoT) ListCertificatesRequest(input *ListCertificatesInput) ListCertific req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCertificatesRequest{Request: req, Input: input} + return ListCertificatesRequest{Request: req, Input: input, Copy: c.ListCertificatesRequest} } const opListCertificatesByCA = "ListCertificatesByCA" @@ -3509,6 +3580,7 @@ const opListCertificatesByCA = "ListCertificatesByCA" type ListCertificatesByCARequest struct { *aws.Request Input *ListCertificatesByCAInput + Copy func(*ListCertificatesByCAInput) ListCertificatesByCARequest } // Send marshals and sends the ListCertificatesByCA API request. @@ -3547,7 +3619,7 @@ func (c *IoT) ListCertificatesByCARequest(input *ListCertificatesByCAInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCertificatesByCARequest{Request: req, Input: input} + return ListCertificatesByCARequest{Request: req, Input: input, Copy: c.ListCertificatesByCARequest} } const opListIndices = "ListIndices" @@ -3556,6 +3628,7 @@ const opListIndices = "ListIndices" type ListIndicesRequest struct { *aws.Request Input *ListIndicesInput + Copy func(*ListIndicesInput) ListIndicesRequest } // Send marshals and sends the ListIndices API request. @@ -3594,7 +3667,7 @@ func (c *IoT) ListIndicesRequest(input *ListIndicesInput) ListIndicesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIndicesRequest{Request: req, Input: input} + return ListIndicesRequest{Request: req, Input: input, Copy: c.ListIndicesRequest} } const opListJobExecutionsForJob = "ListJobExecutionsForJob" @@ -3603,6 +3676,7 @@ const opListJobExecutionsForJob = "ListJobExecutionsForJob" type ListJobExecutionsForJobRequest struct { *aws.Request Input *ListJobExecutionsForJobInput + Copy func(*ListJobExecutionsForJobInput) ListJobExecutionsForJobRequest } // Send marshals and sends the ListJobExecutionsForJob API request. @@ -3641,7 +3715,7 @@ func (c *IoT) ListJobExecutionsForJobRequest(input *ListJobExecutionsForJobInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobExecutionsForJobRequest{Request: req, Input: input} + return ListJobExecutionsForJobRequest{Request: req, Input: input, Copy: c.ListJobExecutionsForJobRequest} } const opListJobExecutionsForThing = "ListJobExecutionsForThing" @@ -3650,6 +3724,7 @@ const opListJobExecutionsForThing = "ListJobExecutionsForThing" type ListJobExecutionsForThingRequest struct { *aws.Request Input *ListJobExecutionsForThingInput + Copy func(*ListJobExecutionsForThingInput) ListJobExecutionsForThingRequest } // Send marshals and sends the ListJobExecutionsForThing API request. @@ -3688,7 +3763,7 @@ func (c *IoT) ListJobExecutionsForThingRequest(input *ListJobExecutionsForThingI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobExecutionsForThingRequest{Request: req, Input: input} + return ListJobExecutionsForThingRequest{Request: req, Input: input, Copy: c.ListJobExecutionsForThingRequest} } const opListJobs = "ListJobs" @@ -3697,6 +3772,7 @@ const opListJobs = "ListJobs" type ListJobsRequest struct { *aws.Request Input *ListJobsInput + Copy func(*ListJobsInput) ListJobsRequest } // Send marshals and sends the ListJobs API request. @@ -3735,7 +3811,7 @@ func (c *IoT) ListJobsRequest(input *ListJobsInput) ListJobsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobsRequest{Request: req, Input: input} + return ListJobsRequest{Request: req, Input: input, Copy: c.ListJobsRequest} } const opListOTAUpdates = "ListOTAUpdates" @@ -3744,6 +3820,7 @@ const opListOTAUpdates = "ListOTAUpdates" type ListOTAUpdatesRequest struct { *aws.Request Input *ListOTAUpdatesInput + Copy func(*ListOTAUpdatesInput) ListOTAUpdatesRequest } // Send marshals and sends the ListOTAUpdates API request. @@ -3782,7 +3859,7 @@ func (c *IoT) ListOTAUpdatesRequest(input *ListOTAUpdatesInput) ListOTAUpdatesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOTAUpdatesRequest{Request: req, Input: input} + return ListOTAUpdatesRequest{Request: req, Input: input, Copy: c.ListOTAUpdatesRequest} } const opListOutgoingCertificates = "ListOutgoingCertificates" @@ -3791,6 +3868,7 @@ const opListOutgoingCertificates = "ListOutgoingCertificates" type ListOutgoingCertificatesRequest struct { *aws.Request Input *ListOutgoingCertificatesInput + Copy func(*ListOutgoingCertificatesInput) ListOutgoingCertificatesRequest } // Send marshals and sends the ListOutgoingCertificates API request. @@ -3829,7 +3907,7 @@ func (c *IoT) ListOutgoingCertificatesRequest(input *ListOutgoingCertificatesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOutgoingCertificatesRequest{Request: req, Input: input} + return ListOutgoingCertificatesRequest{Request: req, Input: input, Copy: c.ListOutgoingCertificatesRequest} } const opListPolicies = "ListPolicies" @@ -3838,6 +3916,7 @@ const opListPolicies = "ListPolicies" type ListPoliciesRequest struct { *aws.Request Input *ListPoliciesInput + Copy func(*ListPoliciesInput) ListPoliciesRequest } // Send marshals and sends the ListPolicies API request. @@ -3876,7 +3955,7 @@ func (c *IoT) ListPoliciesRequest(input *ListPoliciesInput) ListPoliciesRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPoliciesRequest{Request: req, Input: input} + return ListPoliciesRequest{Request: req, Input: input, Copy: c.ListPoliciesRequest} } const opListPolicyPrincipals = "ListPolicyPrincipals" @@ -3885,6 +3964,7 @@ const opListPolicyPrincipals = "ListPolicyPrincipals" type ListPolicyPrincipalsRequest struct { *aws.Request Input *ListPolicyPrincipalsInput + Copy func(*ListPolicyPrincipalsInput) ListPolicyPrincipalsRequest } // Send marshals and sends the ListPolicyPrincipals API request. @@ -3928,7 +4008,7 @@ func (c *IoT) ListPolicyPrincipalsRequest(input *ListPolicyPrincipalsInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPolicyPrincipalsRequest{Request: req, Input: input} + return ListPolicyPrincipalsRequest{Request: req, Input: input, Copy: c.ListPolicyPrincipalsRequest} } const opListPolicyVersions = "ListPolicyVersions" @@ -3937,6 +4017,7 @@ const opListPolicyVersions = "ListPolicyVersions" type ListPolicyVersionsRequest struct { *aws.Request Input *ListPolicyVersionsInput + Copy func(*ListPolicyVersionsInput) ListPolicyVersionsRequest } // Send marshals and sends the ListPolicyVersions API request. @@ -3975,7 +4056,7 @@ func (c *IoT) ListPolicyVersionsRequest(input *ListPolicyVersionsInput) ListPoli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPolicyVersionsRequest{Request: req, Input: input} + return ListPolicyVersionsRequest{Request: req, Input: input, Copy: c.ListPolicyVersionsRequest} } const opListPrincipalPolicies = "ListPrincipalPolicies" @@ -3984,6 +4065,7 @@ const opListPrincipalPolicies = "ListPrincipalPolicies" type ListPrincipalPoliciesRequest struct { *aws.Request Input *ListPrincipalPoliciesInput + Copy func(*ListPrincipalPoliciesInput) ListPrincipalPoliciesRequest } // Send marshals and sends the ListPrincipalPolicies API request. @@ -4028,7 +4110,7 @@ func (c *IoT) ListPrincipalPoliciesRequest(input *ListPrincipalPoliciesInput) Li req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPrincipalPoliciesRequest{Request: req, Input: input} + return ListPrincipalPoliciesRequest{Request: req, Input: input, Copy: c.ListPrincipalPoliciesRequest} } const opListPrincipalThings = "ListPrincipalThings" @@ -4037,6 +4119,7 @@ const opListPrincipalThings = "ListPrincipalThings" type ListPrincipalThingsRequest struct { *aws.Request Input *ListPrincipalThingsInput + Copy func(*ListPrincipalThingsInput) ListPrincipalThingsRequest } // Send marshals and sends the ListPrincipalThings API request. @@ -4075,7 +4158,7 @@ func (c *IoT) ListPrincipalThingsRequest(input *ListPrincipalThingsInput) ListPr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPrincipalThingsRequest{Request: req, Input: input} + return ListPrincipalThingsRequest{Request: req, Input: input, Copy: c.ListPrincipalThingsRequest} } const opListRoleAliases = "ListRoleAliases" @@ -4084,6 +4167,7 @@ const opListRoleAliases = "ListRoleAliases" type ListRoleAliasesRequest struct { *aws.Request Input *ListRoleAliasesInput + Copy func(*ListRoleAliasesInput) ListRoleAliasesRequest } // Send marshals and sends the ListRoleAliases API request. @@ -4122,7 +4206,7 @@ func (c *IoT) ListRoleAliasesRequest(input *ListRoleAliasesInput) ListRoleAliase req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRoleAliasesRequest{Request: req, Input: input} + return ListRoleAliasesRequest{Request: req, Input: input, Copy: c.ListRoleAliasesRequest} } const opListStreams = "ListStreams" @@ -4131,6 +4215,7 @@ const opListStreams = "ListStreams" type ListStreamsRequest struct { *aws.Request Input *ListStreamsInput + Copy func(*ListStreamsInput) ListStreamsRequest } // Send marshals and sends the ListStreams API request. @@ -4169,7 +4254,7 @@ func (c *IoT) ListStreamsRequest(input *ListStreamsInput) ListStreamsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStreamsRequest{Request: req, Input: input} + return ListStreamsRequest{Request: req, Input: input, Copy: c.ListStreamsRequest} } const opListTargetsForPolicy = "ListTargetsForPolicy" @@ -4178,6 +4263,7 @@ const opListTargetsForPolicy = "ListTargetsForPolicy" type ListTargetsForPolicyRequest struct { *aws.Request Input *ListTargetsForPolicyInput + Copy func(*ListTargetsForPolicyInput) ListTargetsForPolicyRequest } // Send marshals and sends the ListTargetsForPolicy API request. @@ -4216,7 +4302,7 @@ func (c *IoT) ListTargetsForPolicyRequest(input *ListTargetsForPolicyInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTargetsForPolicyRequest{Request: req, Input: input} + return ListTargetsForPolicyRequest{Request: req, Input: input, Copy: c.ListTargetsForPolicyRequest} } const opListThingGroups = "ListThingGroups" @@ -4225,6 +4311,7 @@ const opListThingGroups = "ListThingGroups" type ListThingGroupsRequest struct { *aws.Request Input *ListThingGroupsInput + Copy func(*ListThingGroupsInput) ListThingGroupsRequest } // Send marshals and sends the ListThingGroups API request. @@ -4263,7 +4350,7 @@ func (c *IoT) ListThingGroupsRequest(input *ListThingGroupsInput) ListThingGroup req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListThingGroupsRequest{Request: req, Input: input} + return ListThingGroupsRequest{Request: req, Input: input, Copy: c.ListThingGroupsRequest} } const opListThingGroupsForThing = "ListThingGroupsForThing" @@ -4272,6 +4359,7 @@ const opListThingGroupsForThing = "ListThingGroupsForThing" type ListThingGroupsForThingRequest struct { *aws.Request Input *ListThingGroupsForThingInput + Copy func(*ListThingGroupsForThingInput) ListThingGroupsForThingRequest } // Send marshals and sends the ListThingGroupsForThing API request. @@ -4310,7 +4398,7 @@ func (c *IoT) ListThingGroupsForThingRequest(input *ListThingGroupsForThingInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListThingGroupsForThingRequest{Request: req, Input: input} + return ListThingGroupsForThingRequest{Request: req, Input: input, Copy: c.ListThingGroupsForThingRequest} } const opListThingPrincipals = "ListThingPrincipals" @@ -4319,6 +4407,7 @@ const opListThingPrincipals = "ListThingPrincipals" type ListThingPrincipalsRequest struct { *aws.Request Input *ListThingPrincipalsInput + Copy func(*ListThingPrincipalsInput) ListThingPrincipalsRequest } // Send marshals and sends the ListThingPrincipals API request. @@ -4357,7 +4446,7 @@ func (c *IoT) ListThingPrincipalsRequest(input *ListThingPrincipalsInput) ListTh req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListThingPrincipalsRequest{Request: req, Input: input} + return ListThingPrincipalsRequest{Request: req, Input: input, Copy: c.ListThingPrincipalsRequest} } const opListThingRegistrationTaskReports = "ListThingRegistrationTaskReports" @@ -4366,6 +4455,7 @@ const opListThingRegistrationTaskReports = "ListThingRegistrationTaskReports" type ListThingRegistrationTaskReportsRequest struct { *aws.Request Input *ListThingRegistrationTaskReportsInput + Copy func(*ListThingRegistrationTaskReportsInput) ListThingRegistrationTaskReportsRequest } // Send marshals and sends the ListThingRegistrationTaskReports API request. @@ -4404,7 +4494,7 @@ func (c *IoT) ListThingRegistrationTaskReportsRequest(input *ListThingRegistrati req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListThingRegistrationTaskReportsRequest{Request: req, Input: input} + return ListThingRegistrationTaskReportsRequest{Request: req, Input: input, Copy: c.ListThingRegistrationTaskReportsRequest} } const opListThingRegistrationTasks = "ListThingRegistrationTasks" @@ -4413,6 +4503,7 @@ const opListThingRegistrationTasks = "ListThingRegistrationTasks" type ListThingRegistrationTasksRequest struct { *aws.Request Input *ListThingRegistrationTasksInput + Copy func(*ListThingRegistrationTasksInput) ListThingRegistrationTasksRequest } // Send marshals and sends the ListThingRegistrationTasks API request. @@ -4451,7 +4542,7 @@ func (c *IoT) ListThingRegistrationTasksRequest(input *ListThingRegistrationTask req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListThingRegistrationTasksRequest{Request: req, Input: input} + return ListThingRegistrationTasksRequest{Request: req, Input: input, Copy: c.ListThingRegistrationTasksRequest} } const opListThingTypes = "ListThingTypes" @@ -4460,6 +4551,7 @@ const opListThingTypes = "ListThingTypes" type ListThingTypesRequest struct { *aws.Request Input *ListThingTypesInput + Copy func(*ListThingTypesInput) ListThingTypesRequest } // Send marshals and sends the ListThingTypes API request. @@ -4498,7 +4590,7 @@ func (c *IoT) ListThingTypesRequest(input *ListThingTypesInput) ListThingTypesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListThingTypesRequest{Request: req, Input: input} + return ListThingTypesRequest{Request: req, Input: input, Copy: c.ListThingTypesRequest} } const opListThings = "ListThings" @@ -4507,6 +4599,7 @@ const opListThings = "ListThings" type ListThingsRequest struct { *aws.Request Input *ListThingsInput + Copy func(*ListThingsInput) ListThingsRequest } // Send marshals and sends the ListThings API request. @@ -4548,7 +4641,7 @@ func (c *IoT) ListThingsRequest(input *ListThingsInput) ListThingsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListThingsRequest{Request: req, Input: input} + return ListThingsRequest{Request: req, Input: input, Copy: c.ListThingsRequest} } const opListThingsInThingGroup = "ListThingsInThingGroup" @@ -4557,6 +4650,7 @@ const opListThingsInThingGroup = "ListThingsInThingGroup" type ListThingsInThingGroupRequest struct { *aws.Request Input *ListThingsInThingGroupInput + Copy func(*ListThingsInThingGroupInput) ListThingsInThingGroupRequest } // Send marshals and sends the ListThingsInThingGroup API request. @@ -4595,7 +4689,7 @@ func (c *IoT) ListThingsInThingGroupRequest(input *ListThingsInThingGroupInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListThingsInThingGroupRequest{Request: req, Input: input} + return ListThingsInThingGroupRequest{Request: req, Input: input, Copy: c.ListThingsInThingGroupRequest} } const opListTopicRules = "ListTopicRules" @@ -4604,6 +4698,7 @@ const opListTopicRules = "ListTopicRules" type ListTopicRulesRequest struct { *aws.Request Input *ListTopicRulesInput + Copy func(*ListTopicRulesInput) ListTopicRulesRequest } // Send marshals and sends the ListTopicRules API request. @@ -4642,7 +4737,7 @@ func (c *IoT) ListTopicRulesRequest(input *ListTopicRulesInput) ListTopicRulesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTopicRulesRequest{Request: req, Input: input} + return ListTopicRulesRequest{Request: req, Input: input, Copy: c.ListTopicRulesRequest} } const opListV2LoggingLevels = "ListV2LoggingLevels" @@ -4651,6 +4746,7 @@ const opListV2LoggingLevels = "ListV2LoggingLevels" type ListV2LoggingLevelsRequest struct { *aws.Request Input *ListV2LoggingLevelsInput + Copy func(*ListV2LoggingLevelsInput) ListV2LoggingLevelsRequest } // Send marshals and sends the ListV2LoggingLevels API request. @@ -4689,7 +4785,7 @@ func (c *IoT) ListV2LoggingLevelsRequest(input *ListV2LoggingLevelsInput) ListV2 req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListV2LoggingLevelsRequest{Request: req, Input: input} + return ListV2LoggingLevelsRequest{Request: req, Input: input, Copy: c.ListV2LoggingLevelsRequest} } const opRegisterCACertificate = "RegisterCACertificate" @@ -4698,6 +4794,7 @@ const opRegisterCACertificate = "RegisterCACertificate" type RegisterCACertificateRequest struct { *aws.Request Input *RegisterCACertificateInput + Copy func(*RegisterCACertificateInput) RegisterCACertificateRequest } // Send marshals and sends the RegisterCACertificate API request. @@ -4742,7 +4839,7 @@ func (c *IoT) RegisterCACertificateRequest(input *RegisterCACertificateInput) Re req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterCACertificateRequest{Request: req, Input: input} + return RegisterCACertificateRequest{Request: req, Input: input, Copy: c.RegisterCACertificateRequest} } const opRegisterCertificate = "RegisterCertificate" @@ -4751,6 +4848,7 @@ const opRegisterCertificate = "RegisterCertificate" type RegisterCertificateRequest struct { *aws.Request Input *RegisterCertificateInput + Copy func(*RegisterCertificateInput) RegisterCertificateRequest } // Send marshals and sends the RegisterCertificate API request. @@ -4791,7 +4889,7 @@ func (c *IoT) RegisterCertificateRequest(input *RegisterCertificateInput) Regist req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterCertificateRequest{Request: req, Input: input} + return RegisterCertificateRequest{Request: req, Input: input, Copy: c.RegisterCertificateRequest} } const opRegisterThing = "RegisterThing" @@ -4800,6 +4898,7 @@ const opRegisterThing = "RegisterThing" type RegisterThingRequest struct { *aws.Request Input *RegisterThingInput + Copy func(*RegisterThingInput) RegisterThingRequest } // Send marshals and sends the RegisterThing API request. @@ -4838,7 +4937,7 @@ func (c *IoT) RegisterThingRequest(input *RegisterThingInput) RegisterThingReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterThingRequest{Request: req, Input: input} + return RegisterThingRequest{Request: req, Input: input, Copy: c.RegisterThingRequest} } const opRejectCertificateTransfer = "RejectCertificateTransfer" @@ -4847,6 +4946,7 @@ const opRejectCertificateTransfer = "RejectCertificateTransfer" type RejectCertificateTransferRequest struct { *aws.Request Input *RejectCertificateTransferInput + Copy func(*RejectCertificateTransferInput) RejectCertificateTransferRequest } // Send marshals and sends the RejectCertificateTransfer API request. @@ -4895,7 +4995,7 @@ func (c *IoT) RejectCertificateTransferRequest(input *RejectCertificateTransferI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RejectCertificateTransferRequest{Request: req, Input: input} + return RejectCertificateTransferRequest{Request: req, Input: input, Copy: c.RejectCertificateTransferRequest} } const opRemoveThingFromThingGroup = "RemoveThingFromThingGroup" @@ -4904,6 +5004,7 @@ const opRemoveThingFromThingGroup = "RemoveThingFromThingGroup" type RemoveThingFromThingGroupRequest struct { *aws.Request Input *RemoveThingFromThingGroupInput + Copy func(*RemoveThingFromThingGroupInput) RemoveThingFromThingGroupRequest } // Send marshals and sends the RemoveThingFromThingGroup API request. @@ -4942,7 +5043,7 @@ func (c *IoT) RemoveThingFromThingGroupRequest(input *RemoveThingFromThingGroupI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveThingFromThingGroupRequest{Request: req, Input: input} + return RemoveThingFromThingGroupRequest{Request: req, Input: input, Copy: c.RemoveThingFromThingGroupRequest} } const opReplaceTopicRule = "ReplaceTopicRule" @@ -4951,6 +5052,7 @@ const opReplaceTopicRule = "ReplaceTopicRule" type ReplaceTopicRuleRequest struct { *aws.Request Input *ReplaceTopicRuleInput + Copy func(*ReplaceTopicRuleInput) ReplaceTopicRuleRequest } // Send marshals and sends the ReplaceTopicRule API request. @@ -4993,7 +5095,7 @@ func (c *IoT) ReplaceTopicRuleRequest(input *ReplaceTopicRuleInput) ReplaceTopic req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ReplaceTopicRuleRequest{Request: req, Input: input} + return ReplaceTopicRuleRequest{Request: req, Input: input, Copy: c.ReplaceTopicRuleRequest} } const opSearchIndex = "SearchIndex" @@ -5002,6 +5104,7 @@ const opSearchIndex = "SearchIndex" type SearchIndexRequest struct { *aws.Request Input *SearchIndexInput + Copy func(*SearchIndexInput) SearchIndexRequest } // Send marshals and sends the SearchIndex API request. @@ -5040,7 +5143,7 @@ func (c *IoT) SearchIndexRequest(input *SearchIndexInput) SearchIndexRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchIndexRequest{Request: req, Input: input} + return SearchIndexRequest{Request: req, Input: input, Copy: c.SearchIndexRequest} } const opSetDefaultAuthorizer = "SetDefaultAuthorizer" @@ -5049,6 +5152,7 @@ const opSetDefaultAuthorizer = "SetDefaultAuthorizer" type SetDefaultAuthorizerRequest struct { *aws.Request Input *SetDefaultAuthorizerInput + Copy func(*SetDefaultAuthorizerInput) SetDefaultAuthorizerRequest } // Send marshals and sends the SetDefaultAuthorizer API request. @@ -5088,7 +5192,7 @@ func (c *IoT) SetDefaultAuthorizerRequest(input *SetDefaultAuthorizerInput) SetD req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetDefaultAuthorizerRequest{Request: req, Input: input} + return SetDefaultAuthorizerRequest{Request: req, Input: input, Copy: c.SetDefaultAuthorizerRequest} } const opSetDefaultPolicyVersion = "SetDefaultPolicyVersion" @@ -5097,6 +5201,7 @@ const opSetDefaultPolicyVersion = "SetDefaultPolicyVersion" type SetDefaultPolicyVersionRequest struct { *aws.Request Input *SetDefaultPolicyVersionInput + Copy func(*SetDefaultPolicyVersionInput) SetDefaultPolicyVersionRequest } // Send marshals and sends the SetDefaultPolicyVersion API request. @@ -5140,7 +5245,7 @@ func (c *IoT) SetDefaultPolicyVersionRequest(input *SetDefaultPolicyVersionInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetDefaultPolicyVersionRequest{Request: req, Input: input} + return SetDefaultPolicyVersionRequest{Request: req, Input: input, Copy: c.SetDefaultPolicyVersionRequest} } const opSetLoggingOptions = "SetLoggingOptions" @@ -5149,6 +5254,7 @@ const opSetLoggingOptions = "SetLoggingOptions" type SetLoggingOptionsRequest struct { *aws.Request Input *SetLoggingOptionsInput + Copy func(*SetLoggingOptionsInput) SetLoggingOptionsRequest } // Send marshals and sends the SetLoggingOptions API request. @@ -5189,7 +5295,7 @@ func (c *IoT) SetLoggingOptionsRequest(input *SetLoggingOptionsInput) SetLogging req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetLoggingOptionsRequest{Request: req, Input: input} + return SetLoggingOptionsRequest{Request: req, Input: input, Copy: c.SetLoggingOptionsRequest} } const opSetV2LoggingLevel = "SetV2LoggingLevel" @@ -5198,6 +5304,7 @@ const opSetV2LoggingLevel = "SetV2LoggingLevel" type SetV2LoggingLevelRequest struct { *aws.Request Input *SetV2LoggingLevelInput + Copy func(*SetV2LoggingLevelInput) SetV2LoggingLevelRequest } // Send marshals and sends the SetV2LoggingLevel API request. @@ -5238,7 +5345,7 @@ func (c *IoT) SetV2LoggingLevelRequest(input *SetV2LoggingLevelInput) SetV2Loggi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetV2LoggingLevelRequest{Request: req, Input: input} + return SetV2LoggingLevelRequest{Request: req, Input: input, Copy: c.SetV2LoggingLevelRequest} } const opSetV2LoggingOptions = "SetV2LoggingOptions" @@ -5247,6 +5354,7 @@ const opSetV2LoggingOptions = "SetV2LoggingOptions" type SetV2LoggingOptionsRequest struct { *aws.Request Input *SetV2LoggingOptionsInput + Copy func(*SetV2LoggingOptionsInput) SetV2LoggingOptionsRequest } // Send marshals and sends the SetV2LoggingOptions API request. @@ -5287,7 +5395,7 @@ func (c *IoT) SetV2LoggingOptionsRequest(input *SetV2LoggingOptionsInput) SetV2L req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetV2LoggingOptionsRequest{Request: req, Input: input} + return SetV2LoggingOptionsRequest{Request: req, Input: input, Copy: c.SetV2LoggingOptionsRequest} } const opStartThingRegistrationTask = "StartThingRegistrationTask" @@ -5296,6 +5404,7 @@ const opStartThingRegistrationTask = "StartThingRegistrationTask" type StartThingRegistrationTaskRequest struct { *aws.Request Input *StartThingRegistrationTaskInput + Copy func(*StartThingRegistrationTaskInput) StartThingRegistrationTaskRequest } // Send marshals and sends the StartThingRegistrationTask API request. @@ -5334,7 +5443,7 @@ func (c *IoT) StartThingRegistrationTaskRequest(input *StartThingRegistrationTas req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartThingRegistrationTaskRequest{Request: req, Input: input} + return StartThingRegistrationTaskRequest{Request: req, Input: input, Copy: c.StartThingRegistrationTaskRequest} } const opStopThingRegistrationTask = "StopThingRegistrationTask" @@ -5343,6 +5452,7 @@ const opStopThingRegistrationTask = "StopThingRegistrationTask" type StopThingRegistrationTaskRequest struct { *aws.Request Input *StopThingRegistrationTaskInput + Copy func(*StopThingRegistrationTaskInput) StopThingRegistrationTaskRequest } // Send marshals and sends the StopThingRegistrationTask API request. @@ -5381,7 +5491,7 @@ func (c *IoT) StopThingRegistrationTaskRequest(input *StopThingRegistrationTaskI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopThingRegistrationTaskRequest{Request: req, Input: input} + return StopThingRegistrationTaskRequest{Request: req, Input: input, Copy: c.StopThingRegistrationTaskRequest} } const opTestAuthorization = "TestAuthorization" @@ -5390,6 +5500,7 @@ const opTestAuthorization = "TestAuthorization" type TestAuthorizationRequest struct { *aws.Request Input *TestAuthorizationInput + Copy func(*TestAuthorizationInput) TestAuthorizationRequest } // Send marshals and sends the TestAuthorization API request. @@ -5428,7 +5539,7 @@ func (c *IoT) TestAuthorizationRequest(input *TestAuthorizationInput) TestAuthor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestAuthorizationRequest{Request: req, Input: input} + return TestAuthorizationRequest{Request: req, Input: input, Copy: c.TestAuthorizationRequest} } const opTestInvokeAuthorizer = "TestInvokeAuthorizer" @@ -5437,6 +5548,7 @@ const opTestInvokeAuthorizer = "TestInvokeAuthorizer" type TestInvokeAuthorizerRequest struct { *aws.Request Input *TestInvokeAuthorizerInput + Copy func(*TestInvokeAuthorizerInput) TestInvokeAuthorizerRequest } // Send marshals and sends the TestInvokeAuthorizer API request. @@ -5475,7 +5587,7 @@ func (c *IoT) TestInvokeAuthorizerRequest(input *TestInvokeAuthorizerInput) Test req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestInvokeAuthorizerRequest{Request: req, Input: input} + return TestInvokeAuthorizerRequest{Request: req, Input: input, Copy: c.TestInvokeAuthorizerRequest} } const opTransferCertificate = "TransferCertificate" @@ -5484,6 +5596,7 @@ const opTransferCertificate = "TransferCertificate" type TransferCertificateRequest struct { *aws.Request Input *TransferCertificateInput + Copy func(*TransferCertificateInput) TransferCertificateRequest } // Send marshals and sends the TransferCertificate API request. @@ -5533,7 +5646,7 @@ func (c *IoT) TransferCertificateRequest(input *TransferCertificateInput) Transf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TransferCertificateRequest{Request: req, Input: input} + return TransferCertificateRequest{Request: req, Input: input, Copy: c.TransferCertificateRequest} } const opUpdateAuthorizer = "UpdateAuthorizer" @@ -5542,6 +5655,7 @@ const opUpdateAuthorizer = "UpdateAuthorizer" type UpdateAuthorizerRequest struct { *aws.Request Input *UpdateAuthorizerInput + Copy func(*UpdateAuthorizerInput) UpdateAuthorizerRequest } // Send marshals and sends the UpdateAuthorizer API request. @@ -5580,7 +5694,7 @@ func (c *IoT) UpdateAuthorizerRequest(input *UpdateAuthorizerInput) UpdateAuthor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAuthorizerRequest{Request: req, Input: input} + return UpdateAuthorizerRequest{Request: req, Input: input, Copy: c.UpdateAuthorizerRequest} } const opUpdateCACertificate = "UpdateCACertificate" @@ -5589,6 +5703,7 @@ const opUpdateCACertificate = "UpdateCACertificate" type UpdateCACertificateRequest struct { *aws.Request Input *UpdateCACertificateInput + Copy func(*UpdateCACertificateInput) UpdateCACertificateRequest } // Send marshals and sends the UpdateCACertificate API request. @@ -5629,7 +5744,7 @@ func (c *IoT) UpdateCACertificateRequest(input *UpdateCACertificateInput) Update req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateCACertificateRequest{Request: req, Input: input} + return UpdateCACertificateRequest{Request: req, Input: input, Copy: c.UpdateCACertificateRequest} } const opUpdateCertificate = "UpdateCertificate" @@ -5638,6 +5753,7 @@ const opUpdateCertificate = "UpdateCertificate" type UpdateCertificateRequest struct { *aws.Request Input *UpdateCertificateInput + Copy func(*UpdateCertificateInput) UpdateCertificateRequest } // Send marshals and sends the UpdateCertificate API request. @@ -5684,7 +5800,7 @@ func (c *IoT) UpdateCertificateRequest(input *UpdateCertificateInput) UpdateCert req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateCertificateRequest{Request: req, Input: input} + return UpdateCertificateRequest{Request: req, Input: input, Copy: c.UpdateCertificateRequest} } const opUpdateEventConfigurations = "UpdateEventConfigurations" @@ -5693,6 +5809,7 @@ const opUpdateEventConfigurations = "UpdateEventConfigurations" type UpdateEventConfigurationsRequest struct { *aws.Request Input *UpdateEventConfigurationsInput + Copy func(*UpdateEventConfigurationsInput) UpdateEventConfigurationsRequest } // Send marshals and sends the UpdateEventConfigurations API request. @@ -5731,7 +5848,7 @@ func (c *IoT) UpdateEventConfigurationsRequest(input *UpdateEventConfigurationsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEventConfigurationsRequest{Request: req, Input: input} + return UpdateEventConfigurationsRequest{Request: req, Input: input, Copy: c.UpdateEventConfigurationsRequest} } const opUpdateIndexingConfiguration = "UpdateIndexingConfiguration" @@ -5740,6 +5857,7 @@ const opUpdateIndexingConfiguration = "UpdateIndexingConfiguration" type UpdateIndexingConfigurationRequest struct { *aws.Request Input *UpdateIndexingConfigurationInput + Copy func(*UpdateIndexingConfigurationInput) UpdateIndexingConfigurationRequest } // Send marshals and sends the UpdateIndexingConfiguration API request. @@ -5778,7 +5896,7 @@ func (c *IoT) UpdateIndexingConfigurationRequest(input *UpdateIndexingConfigurat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateIndexingConfigurationRequest{Request: req, Input: input} + return UpdateIndexingConfigurationRequest{Request: req, Input: input, Copy: c.UpdateIndexingConfigurationRequest} } const opUpdateRoleAlias = "UpdateRoleAlias" @@ -5787,6 +5905,7 @@ const opUpdateRoleAlias = "UpdateRoleAlias" type UpdateRoleAliasRequest struct { *aws.Request Input *UpdateRoleAliasInput + Copy func(*UpdateRoleAliasInput) UpdateRoleAliasRequest } // Send marshals and sends the UpdateRoleAlias API request. @@ -5825,7 +5944,7 @@ func (c *IoT) UpdateRoleAliasRequest(input *UpdateRoleAliasInput) UpdateRoleAlia req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRoleAliasRequest{Request: req, Input: input} + return UpdateRoleAliasRequest{Request: req, Input: input, Copy: c.UpdateRoleAliasRequest} } const opUpdateStream = "UpdateStream" @@ -5834,6 +5953,7 @@ const opUpdateStream = "UpdateStream" type UpdateStreamRequest struct { *aws.Request Input *UpdateStreamInput + Copy func(*UpdateStreamInput) UpdateStreamRequest } // Send marshals and sends the UpdateStream API request. @@ -5872,7 +5992,7 @@ func (c *IoT) UpdateStreamRequest(input *UpdateStreamInput) UpdateStreamRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateStreamRequest{Request: req, Input: input} + return UpdateStreamRequest{Request: req, Input: input, Copy: c.UpdateStreamRequest} } const opUpdateThing = "UpdateThing" @@ -5881,6 +6001,7 @@ const opUpdateThing = "UpdateThing" type UpdateThingRequest struct { *aws.Request Input *UpdateThingInput + Copy func(*UpdateThingInput) UpdateThingRequest } // Send marshals and sends the UpdateThing API request. @@ -5919,7 +6040,7 @@ func (c *IoT) UpdateThingRequest(input *UpdateThingInput) UpdateThingRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateThingRequest{Request: req, Input: input} + return UpdateThingRequest{Request: req, Input: input, Copy: c.UpdateThingRequest} } const opUpdateThingGroup = "UpdateThingGroup" @@ -5928,6 +6049,7 @@ const opUpdateThingGroup = "UpdateThingGroup" type UpdateThingGroupRequest struct { *aws.Request Input *UpdateThingGroupInput + Copy func(*UpdateThingGroupInput) UpdateThingGroupRequest } // Send marshals and sends the UpdateThingGroup API request. @@ -5966,7 +6088,7 @@ func (c *IoT) UpdateThingGroupRequest(input *UpdateThingGroupInput) UpdateThingG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateThingGroupRequest{Request: req, Input: input} + return UpdateThingGroupRequest{Request: req, Input: input, Copy: c.UpdateThingGroupRequest} } const opUpdateThingGroupsForThing = "UpdateThingGroupsForThing" @@ -5975,6 +6097,7 @@ const opUpdateThingGroupsForThing = "UpdateThingGroupsForThing" type UpdateThingGroupsForThingRequest struct { *aws.Request Input *UpdateThingGroupsForThingInput + Copy func(*UpdateThingGroupsForThingInput) UpdateThingGroupsForThingRequest } // Send marshals and sends the UpdateThingGroupsForThing API request. @@ -6013,7 +6136,7 @@ func (c *IoT) UpdateThingGroupsForThingRequest(input *UpdateThingGroupsForThingI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateThingGroupsForThingRequest{Request: req, Input: input} + return UpdateThingGroupsForThingRequest{Request: req, Input: input, Copy: c.UpdateThingGroupsForThingRequest} } // The input for the AcceptCertificateTransfer operation. diff --git a/service/iotdataplane/api.go b/service/iotdataplane/api.go index a1d094ad14d..9df9049456b 100644 --- a/service/iotdataplane/api.go +++ b/service/iotdataplane/api.go @@ -15,6 +15,7 @@ const opDeleteThingShadow = "DeleteThingShadow" type DeleteThingShadowRequest struct { *aws.Request Input *DeleteThingShadowInput + Copy func(*DeleteThingShadowInput) DeleteThingShadowRequest } // Send marshals and sends the DeleteThingShadow API request. @@ -56,7 +57,7 @@ func (c *IoTDataPlane) DeleteThingShadowRequest(input *DeleteThingShadowInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteThingShadowRequest{Request: req, Input: input} + return DeleteThingShadowRequest{Request: req, Input: input, Copy: c.DeleteThingShadowRequest} } const opGetThingShadow = "GetThingShadow" @@ -65,6 +66,7 @@ const opGetThingShadow = "GetThingShadow" type GetThingShadowRequest struct { *aws.Request Input *GetThingShadowInput + Copy func(*GetThingShadowInput) GetThingShadowRequest } // Send marshals and sends the GetThingShadow API request. @@ -106,7 +108,7 @@ func (c *IoTDataPlane) GetThingShadowRequest(input *GetThingShadowInput) GetThin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetThingShadowRequest{Request: req, Input: input} + return GetThingShadowRequest{Request: req, Input: input, Copy: c.GetThingShadowRequest} } const opPublish = "Publish" @@ -115,6 +117,7 @@ const opPublish = "Publish" type PublishRequest struct { *aws.Request Input *PublishInput + Copy func(*PublishInput) PublishRequest } // Send marshals and sends the Publish API request. @@ -158,7 +161,7 @@ func (c *IoTDataPlane) PublishRequest(input *PublishInput) PublishRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PublishRequest{Request: req, Input: input} + return PublishRequest{Request: req, Input: input, Copy: c.PublishRequest} } const opUpdateThingShadow = "UpdateThingShadow" @@ -167,6 +170,7 @@ const opUpdateThingShadow = "UpdateThingShadow" type UpdateThingShadowRequest struct { *aws.Request Input *UpdateThingShadowInput + Copy func(*UpdateThingShadowInput) UpdateThingShadowRequest } // Send marshals and sends the UpdateThingShadow API request. @@ -208,7 +212,7 @@ func (c *IoTDataPlane) UpdateThingShadowRequest(input *UpdateThingShadowInput) U req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateThingShadowRequest{Request: req, Input: input} + return UpdateThingShadowRequest{Request: req, Input: input, Copy: c.UpdateThingShadowRequest} } // The input for the DeleteThingShadow operation. diff --git a/service/iotjobsdataplane/api.go b/service/iotjobsdataplane/api.go index 875efb760fc..432b2d58e22 100644 --- a/service/iotjobsdataplane/api.go +++ b/service/iotjobsdataplane/api.go @@ -14,6 +14,7 @@ const opDescribeJobExecution = "DescribeJobExecution" type DescribeJobExecutionRequest struct { *aws.Request Input *DescribeJobExecutionInput + Copy func(*DescribeJobExecutionInput) DescribeJobExecutionRequest } // Send marshals and sends the DescribeJobExecution API request. @@ -54,7 +55,7 @@ func (c *IoTJobsDataPlane) DescribeJobExecutionRequest(input *DescribeJobExecuti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeJobExecutionRequest{Request: req, Input: input} + return DescribeJobExecutionRequest{Request: req, Input: input, Copy: c.DescribeJobExecutionRequest} } const opGetPendingJobExecutions = "GetPendingJobExecutions" @@ -63,6 +64,7 @@ const opGetPendingJobExecutions = "GetPendingJobExecutions" type GetPendingJobExecutionsRequest struct { *aws.Request Input *GetPendingJobExecutionsInput + Copy func(*GetPendingJobExecutionsInput) GetPendingJobExecutionsRequest } // Send marshals and sends the GetPendingJobExecutions API request. @@ -103,7 +105,7 @@ func (c *IoTJobsDataPlane) GetPendingJobExecutionsRequest(input *GetPendingJobEx req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPendingJobExecutionsRequest{Request: req, Input: input} + return GetPendingJobExecutionsRequest{Request: req, Input: input, Copy: c.GetPendingJobExecutionsRequest} } const opStartNextPendingJobExecution = "StartNextPendingJobExecution" @@ -112,6 +114,7 @@ const opStartNextPendingJobExecution = "StartNextPendingJobExecution" type StartNextPendingJobExecutionRequest struct { *aws.Request Input *StartNextPendingJobExecutionInput + Copy func(*StartNextPendingJobExecutionInput) StartNextPendingJobExecutionRequest } // Send marshals and sends the StartNextPendingJobExecution API request. @@ -153,7 +156,7 @@ func (c *IoTJobsDataPlane) StartNextPendingJobExecutionRequest(input *StartNextP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartNextPendingJobExecutionRequest{Request: req, Input: input} + return StartNextPendingJobExecutionRequest{Request: req, Input: input, Copy: c.StartNextPendingJobExecutionRequest} } const opUpdateJobExecution = "UpdateJobExecution" @@ -162,6 +165,7 @@ const opUpdateJobExecution = "UpdateJobExecution" type UpdateJobExecutionRequest struct { *aws.Request Input *UpdateJobExecutionInput + Copy func(*UpdateJobExecutionInput) UpdateJobExecutionRequest } // Send marshals and sends the UpdateJobExecution API request. @@ -202,7 +206,7 @@ func (c *IoTJobsDataPlane) UpdateJobExecutionRequest(input *UpdateJobExecutionIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateJobExecutionRequest{Request: req, Input: input} + return UpdateJobExecutionRequest{Request: req, Input: input, Copy: c.UpdateJobExecutionRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/DescribeJobExecutionRequest diff --git a/service/kinesis/api.go b/service/kinesis/api.go index 891a723a5f6..b6ed6a415ee 100644 --- a/service/kinesis/api.go +++ b/service/kinesis/api.go @@ -18,6 +18,7 @@ const opAddTagsToStream = "AddTagsToStream" type AddTagsToStreamRequest struct { *aws.Request Input *AddTagsToStreamInput + Copy func(*AddTagsToStreamInput) AddTagsToStreamRequest } // Send marshals and sends the AddTagsToStream API request. @@ -64,7 +65,7 @@ func (c *Kinesis) AddTagsToStreamRequest(input *AddTagsToStreamInput) AddTagsToS req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddTagsToStreamRequest{Request: req, Input: input} + return AddTagsToStreamRequest{Request: req, Input: input, Copy: c.AddTagsToStreamRequest} } const opCreateStream = "CreateStream" @@ -73,6 +74,7 @@ const opCreateStream = "CreateStream" type CreateStreamRequest struct { *aws.Request Input *CreateStreamInput + Copy func(*CreateStreamInput) CreateStreamRequest } // Send marshals and sends the CreateStream API request. @@ -152,7 +154,7 @@ func (c *Kinesis) CreateStreamRequest(input *CreateStreamInput) CreateStreamRequ req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateStreamRequest{Request: req, Input: input} + return CreateStreamRequest{Request: req, Input: input, Copy: c.CreateStreamRequest} } const opDecreaseStreamRetentionPeriod = "DecreaseStreamRetentionPeriod" @@ -161,6 +163,7 @@ const opDecreaseStreamRetentionPeriod = "DecreaseStreamRetentionPeriod" type DecreaseStreamRetentionPeriodRequest struct { *aws.Request Input *DecreaseStreamRetentionPeriodInput + Copy func(*DecreaseStreamRetentionPeriodInput) DecreaseStreamRetentionPeriodRequest } // Send marshals and sends the DecreaseStreamRetentionPeriod API request. @@ -209,7 +212,7 @@ func (c *Kinesis) DecreaseStreamRetentionPeriodRequest(input *DecreaseStreamRete req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DecreaseStreamRetentionPeriodRequest{Request: req, Input: input} + return DecreaseStreamRetentionPeriodRequest{Request: req, Input: input, Copy: c.DecreaseStreamRetentionPeriodRequest} } const opDeleteStream = "DeleteStream" @@ -218,6 +221,7 @@ const opDeleteStream = "DeleteStream" type DeleteStreamRequest struct { *aws.Request Input *DeleteStreamInput + Copy func(*DeleteStreamInput) DeleteStreamRequest } // Send marshals and sends the DeleteStream API request. @@ -279,7 +283,7 @@ func (c *Kinesis) DeleteStreamRequest(input *DeleteStreamInput) DeleteStreamRequ req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteStreamRequest{Request: req, Input: input} + return DeleteStreamRequest{Request: req, Input: input, Copy: c.DeleteStreamRequest} } const opDescribeLimits = "DescribeLimits" @@ -288,6 +292,7 @@ const opDescribeLimits = "DescribeLimits" type DescribeLimitsRequest struct { *aws.Request Input *DescribeLimitsInput + Copy func(*DescribeLimitsInput) DescribeLimitsRequest } // Send marshals and sends the DescribeLimits API request. @@ -333,7 +338,7 @@ func (c *Kinesis) DescribeLimitsRequest(input *DescribeLimitsInput) DescribeLimi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLimitsRequest{Request: req, Input: input} + return DescribeLimitsRequest{Request: req, Input: input, Copy: c.DescribeLimitsRequest} } const opDescribeStream = "DescribeStream" @@ -342,6 +347,7 @@ const opDescribeStream = "DescribeStream" type DescribeStreamRequest struct { *aws.Request Input *DescribeStreamInput + Copy func(*DescribeStreamInput) DescribeStreamRequest } // Send marshals and sends the DescribeStream API request. @@ -406,57 +412,53 @@ func (c *Kinesis) DescribeStreamRequest(input *DescribeStreamInput) DescribeStre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStreamRequest{Request: req, Input: input} + return DescribeStreamRequest{Request: req, Input: input, Copy: c.DescribeStreamRequest} } -// DescribeStreamPages iterates over the pages of a DescribeStream operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeStream method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeStreamRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeStream operation. -// pageNum := 0 -// err := client.DescribeStreamPages(params, -// func(page *DescribeStreamOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Kinesis) DescribeStreamPages(input *DescribeStreamInput, fn func(*DescribeStreamOutput, bool) bool) error { - return c.DescribeStreamPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeStreamPagesWithContext same as DescribeStreamPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Kinesis) DescribeStreamPagesWithContext(ctx aws.Context, input *DescribeStreamInput, fn func(*DescribeStreamOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeStreamInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeStreamRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeStreamRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeStreamRequest) Paginate(opts ...aws.Option) DescribeStreamPager { + return DescribeStreamPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeStreamInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStreamOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeStreamPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeStreamPager struct { + aws.Pager +} + +func (p *DescribeStreamPager) CurrentPage() *DescribeStreamOutput { + return p.Pager.CurrentPage().(*DescribeStreamOutput) } const opDescribeStreamSummary = "DescribeStreamSummary" @@ -465,6 +467,7 @@ const opDescribeStreamSummary = "DescribeStreamSummary" type DescribeStreamSummaryRequest struct { *aws.Request Input *DescribeStreamSummaryInput + Copy func(*DescribeStreamSummaryInput) DescribeStreamSummaryRequest } // Send marshals and sends the DescribeStreamSummary API request. @@ -510,7 +513,7 @@ func (c *Kinesis) DescribeStreamSummaryRequest(input *DescribeStreamSummaryInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStreamSummaryRequest{Request: req, Input: input} + return DescribeStreamSummaryRequest{Request: req, Input: input, Copy: c.DescribeStreamSummaryRequest} } const opDisableEnhancedMonitoring = "DisableEnhancedMonitoring" @@ -519,6 +522,7 @@ const opDisableEnhancedMonitoring = "DisableEnhancedMonitoring" type DisableEnhancedMonitoringRequest struct { *aws.Request Input *DisableEnhancedMonitoringInput + Copy func(*DisableEnhancedMonitoringInput) DisableEnhancedMonitoringRequest } // Send marshals and sends the DisableEnhancedMonitoring API request. @@ -559,7 +563,7 @@ func (c *Kinesis) DisableEnhancedMonitoringRequest(input *DisableEnhancedMonitor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableEnhancedMonitoringRequest{Request: req, Input: input} + return DisableEnhancedMonitoringRequest{Request: req, Input: input, Copy: c.DisableEnhancedMonitoringRequest} } const opEnableEnhancedMonitoring = "EnableEnhancedMonitoring" @@ -568,6 +572,7 @@ const opEnableEnhancedMonitoring = "EnableEnhancedMonitoring" type EnableEnhancedMonitoringRequest struct { *aws.Request Input *EnableEnhancedMonitoringInput + Copy func(*EnableEnhancedMonitoringInput) EnableEnhancedMonitoringRequest } // Send marshals and sends the EnableEnhancedMonitoring API request. @@ -608,7 +613,7 @@ func (c *Kinesis) EnableEnhancedMonitoringRequest(input *EnableEnhancedMonitorin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableEnhancedMonitoringRequest{Request: req, Input: input} + return EnableEnhancedMonitoringRequest{Request: req, Input: input, Copy: c.EnableEnhancedMonitoringRequest} } const opGetRecords = "GetRecords" @@ -617,6 +622,7 @@ const opGetRecords = "GetRecords" type GetRecordsRequest struct { *aws.Request Input *GetRecordsInput + Copy func(*GetRecordsInput) GetRecordsRequest } // Send marshals and sends the GetRecords API request. @@ -708,7 +714,7 @@ func (c *Kinesis) GetRecordsRequest(input *GetRecordsInput) GetRecordsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRecordsRequest{Request: req, Input: input} + return GetRecordsRequest{Request: req, Input: input, Copy: c.GetRecordsRequest} } const opGetShardIterator = "GetShardIterator" @@ -717,6 +723,7 @@ const opGetShardIterator = "GetShardIterator" type GetShardIteratorRequest struct { *aws.Request Input *GetShardIteratorInput + Copy func(*GetShardIteratorInput) GetShardIteratorRequest } // Send marshals and sends the GetShardIterator API request. @@ -795,7 +802,7 @@ func (c *Kinesis) GetShardIteratorRequest(input *GetShardIteratorInput) GetShard req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetShardIteratorRequest{Request: req, Input: input} + return GetShardIteratorRequest{Request: req, Input: input, Copy: c.GetShardIteratorRequest} } const opIncreaseStreamRetentionPeriod = "IncreaseStreamRetentionPeriod" @@ -804,6 +811,7 @@ const opIncreaseStreamRetentionPeriod = "IncreaseStreamRetentionPeriod" type IncreaseStreamRetentionPeriodRequest struct { *aws.Request Input *IncreaseStreamRetentionPeriodInput + Copy func(*IncreaseStreamRetentionPeriodInput) IncreaseStreamRetentionPeriodRequest } // Send marshals and sends the IncreaseStreamRetentionPeriod API request. @@ -856,7 +864,7 @@ func (c *Kinesis) IncreaseStreamRetentionPeriodRequest(input *IncreaseStreamRete req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return IncreaseStreamRetentionPeriodRequest{Request: req, Input: input} + return IncreaseStreamRetentionPeriodRequest{Request: req, Input: input, Copy: c.IncreaseStreamRetentionPeriodRequest} } const opListStreams = "ListStreams" @@ -865,6 +873,7 @@ const opListStreams = "ListStreams" type ListStreamsRequest struct { *aws.Request Input *ListStreamsInput + Copy func(*ListStreamsInput) ListStreamsRequest } // Send marshals and sends the ListStreams API request. @@ -926,57 +935,53 @@ func (c *Kinesis) ListStreamsRequest(input *ListStreamsInput) ListStreamsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStreamsRequest{Request: req, Input: input} + return ListStreamsRequest{Request: req, Input: input, Copy: c.ListStreamsRequest} } -// ListStreamsPages iterates over the pages of a ListStreams operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStreams method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListStreamsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListStreams operation. -// pageNum := 0 -// err := client.ListStreamsPages(params, -// func(page *ListStreamsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Kinesis) ListStreamsPages(input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool) error { - return c.ListStreamsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStreamsPagesWithContext same as ListStreamsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Kinesis) ListStreamsPagesWithContext(ctx aws.Context, input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListStreamsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListStreamsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListStreamsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListStreamsRequest) Paginate(opts ...aws.Option) ListStreamsPager { + return ListStreamsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListStreamsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStreamsOutput), !p.HasNextPage()) - } - return p.Err() +// ListStreamsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListStreamsPager struct { + aws.Pager +} + +func (p *ListStreamsPager) CurrentPage() *ListStreamsOutput { + return p.Pager.CurrentPage().(*ListStreamsOutput) } const opListTagsForStream = "ListTagsForStream" @@ -985,6 +990,7 @@ const opListTagsForStream = "ListTagsForStream" type ListTagsForStreamRequest struct { *aws.Request Input *ListTagsForStreamInput + Copy func(*ListTagsForStreamInput) ListTagsForStreamRequest } // Send marshals and sends the ListTagsForStream API request. @@ -1025,7 +1031,7 @@ func (c *Kinesis) ListTagsForStreamRequest(input *ListTagsForStreamInput) ListTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForStreamRequest{Request: req, Input: input} + return ListTagsForStreamRequest{Request: req, Input: input, Copy: c.ListTagsForStreamRequest} } const opMergeShards = "MergeShards" @@ -1034,6 +1040,7 @@ const opMergeShards = "MergeShards" type MergeShardsRequest struct { *aws.Request Input *MergeShardsInput + Copy func(*MergeShardsInput) MergeShardsRequest } // Send marshals and sends the MergeShards API request. @@ -1110,7 +1117,7 @@ func (c *Kinesis) MergeShardsRequest(input *MergeShardsInput) MergeShardsRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return MergeShardsRequest{Request: req, Input: input} + return MergeShardsRequest{Request: req, Input: input, Copy: c.MergeShardsRequest} } const opPutRecord = "PutRecord" @@ -1119,6 +1126,7 @@ const opPutRecord = "PutRecord" type PutRecordRequest struct { *aws.Request Input *PutRecordInput + Copy func(*PutRecordInput) PutRecordRequest } // Send marshals and sends the PutRecord API request. @@ -1197,7 +1205,7 @@ func (c *Kinesis) PutRecordRequest(input *PutRecordInput) PutRecordRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutRecordRequest{Request: req, Input: input} + return PutRecordRequest{Request: req, Input: input, Copy: c.PutRecordRequest} } const opPutRecords = "PutRecords" @@ -1206,6 +1214,7 @@ const opPutRecords = "PutRecords" type PutRecordsRequest struct { *aws.Request Input *PutRecordsInput + Copy func(*PutRecordsInput) PutRecordsRequest } // Send marshals and sends the PutRecords API request. @@ -1304,7 +1313,7 @@ func (c *Kinesis) PutRecordsRequest(input *PutRecordsInput) PutRecordsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutRecordsRequest{Request: req, Input: input} + return PutRecordsRequest{Request: req, Input: input, Copy: c.PutRecordsRequest} } const opRemoveTagsFromStream = "RemoveTagsFromStream" @@ -1313,6 +1322,7 @@ const opRemoveTagsFromStream = "RemoveTagsFromStream" type RemoveTagsFromStreamRequest struct { *aws.Request Input *RemoveTagsFromStreamInput + Copy func(*RemoveTagsFromStreamInput) RemoveTagsFromStreamRequest } // Send marshals and sends the RemoveTagsFromStream API request. @@ -1358,7 +1368,7 @@ func (c *Kinesis) RemoveTagsFromStreamRequest(input *RemoveTagsFromStreamInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromStreamRequest{Request: req, Input: input} + return RemoveTagsFromStreamRequest{Request: req, Input: input, Copy: c.RemoveTagsFromStreamRequest} } const opSplitShard = "SplitShard" @@ -1367,6 +1377,7 @@ const opSplitShard = "SplitShard" type SplitShardRequest struct { *aws.Request Input *SplitShardInput + Copy func(*SplitShardInput) SplitShardRequest } // Send marshals and sends the SplitShard API request. @@ -1453,7 +1464,7 @@ func (c *Kinesis) SplitShardRequest(input *SplitShardInput) SplitShardRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SplitShardRequest{Request: req, Input: input} + return SplitShardRequest{Request: req, Input: input, Copy: c.SplitShardRequest} } const opStartStreamEncryption = "StartStreamEncryption" @@ -1462,6 +1473,7 @@ const opStartStreamEncryption = "StartStreamEncryption" type StartStreamEncryptionRequest struct { *aws.Request Input *StartStreamEncryptionInput + Copy func(*StartStreamEncryptionInput) StartStreamEncryptionRequest } // Send marshals and sends the StartStreamEncryption API request. @@ -1521,7 +1533,7 @@ func (c *Kinesis) StartStreamEncryptionRequest(input *StartStreamEncryptionInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StartStreamEncryptionRequest{Request: req, Input: input} + return StartStreamEncryptionRequest{Request: req, Input: input, Copy: c.StartStreamEncryptionRequest} } const opStopStreamEncryption = "StopStreamEncryption" @@ -1530,6 +1542,7 @@ const opStopStreamEncryption = "StopStreamEncryption" type StopStreamEncryptionRequest struct { *aws.Request Input *StopStreamEncryptionInput + Copy func(*StopStreamEncryptionInput) StopStreamEncryptionRequest } // Send marshals and sends the StopStreamEncryption API request. @@ -1589,7 +1602,7 @@ func (c *Kinesis) StopStreamEncryptionRequest(input *StopStreamEncryptionInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StopStreamEncryptionRequest{Request: req, Input: input} + return StopStreamEncryptionRequest{Request: req, Input: input, Copy: c.StopStreamEncryptionRequest} } const opUpdateShardCount = "UpdateShardCount" @@ -1598,6 +1611,7 @@ const opUpdateShardCount = "UpdateShardCount" type UpdateShardCountRequest struct { *aws.Request Input *UpdateShardCountInput + Copy func(*UpdateShardCountInput) UpdateShardCountRequest } // Send marshals and sends the UpdateShardCount API request. @@ -1671,7 +1685,7 @@ func (c *Kinesis) UpdateShardCountRequest(input *UpdateShardCountInput) UpdateSh req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateShardCountRequest{Request: req, Input: input} + return UpdateShardCountRequest{Request: req, Input: input, Copy: c.UpdateShardCountRequest} } // Represents the input for AddTagsToStream. diff --git a/service/kinesis/kinesisiface/interface.go b/service/kinesis/kinesisiface/interface.go index 9a350d9f44d..a5b57582e44 100644 --- a/service/kinesis/kinesisiface/interface.go +++ b/service/kinesis/kinesisiface/interface.go @@ -75,9 +75,6 @@ type KinesisAPI interface { DescribeStreamRequest(*kinesis.DescribeStreamInput) kinesis.DescribeStreamRequest - DescribeStreamPages(*kinesis.DescribeStreamInput, func(*kinesis.DescribeStreamOutput, bool) bool) error - DescribeStreamPagesWithContext(aws.Context, *kinesis.DescribeStreamInput, func(*kinesis.DescribeStreamOutput, bool) bool, ...aws.Option) error - DescribeStreamSummaryRequest(*kinesis.DescribeStreamSummaryInput) kinesis.DescribeStreamSummaryRequest DisableEnhancedMonitoringRequest(*kinesis.DisableEnhancedMonitoringInput) kinesis.DisableEnhancedMonitoringRequest @@ -92,9 +89,6 @@ type KinesisAPI interface { ListStreamsRequest(*kinesis.ListStreamsInput) kinesis.ListStreamsRequest - ListStreamsPages(*kinesis.ListStreamsInput, func(*kinesis.ListStreamsOutput, bool) bool) error - ListStreamsPagesWithContext(aws.Context, *kinesis.ListStreamsInput, func(*kinesis.ListStreamsOutput, bool) bool, ...aws.Option) error - ListTagsForStreamRequest(*kinesis.ListTagsForStreamInput) kinesis.ListTagsForStreamRequest MergeShardsRequest(*kinesis.MergeShardsInput) kinesis.MergeShardsRequest diff --git a/service/kinesisanalytics/api.go b/service/kinesisanalytics/api.go index 16f78e89632..99eea19d335 100644 --- a/service/kinesisanalytics/api.go +++ b/service/kinesisanalytics/api.go @@ -16,6 +16,7 @@ const opAddApplicationCloudWatchLoggingOption = "AddApplicationCloudWatchLogging type AddApplicationCloudWatchLoggingOptionRequest struct { *aws.Request Input *AddApplicationCloudWatchLoggingOptionInput + Copy func(*AddApplicationCloudWatchLoggingOptionInput) AddApplicationCloudWatchLoggingOptionRequest } // Send marshals and sends the AddApplicationCloudWatchLoggingOption API request. @@ -58,7 +59,7 @@ func (c *KinesisAnalytics) AddApplicationCloudWatchLoggingOptionRequest(input *A req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddApplicationCloudWatchLoggingOptionRequest{Request: req, Input: input} + return AddApplicationCloudWatchLoggingOptionRequest{Request: req, Input: input, Copy: c.AddApplicationCloudWatchLoggingOptionRequest} } const opAddApplicationInput = "AddApplicationInput" @@ -67,6 +68,7 @@ const opAddApplicationInput = "AddApplicationInput" type AddApplicationInputRequest struct { *aws.Request Input *AddApplicationInputInput + Copy func(*AddApplicationInputInput) AddApplicationInputRequest } // Send marshals and sends the AddApplicationInput API request. @@ -119,7 +121,7 @@ func (c *KinesisAnalytics) AddApplicationInputRequest(input *AddApplicationInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddApplicationInputRequest{Request: req, Input: input} + return AddApplicationInputRequest{Request: req, Input: input, Copy: c.AddApplicationInputRequest} } const opAddApplicationInputProcessingConfiguration = "AddApplicationInputProcessingConfiguration" @@ -128,6 +130,7 @@ const opAddApplicationInputProcessingConfiguration = "AddApplicationInputProcess type AddApplicationInputProcessingConfigurationRequest struct { *aws.Request Input *AddApplicationInputProcessingConfigurationInput + Copy func(*AddApplicationInputProcessingConfigurationInput) AddApplicationInputProcessingConfigurationRequest } // Send marshals and sends the AddApplicationInputProcessingConfiguration API request. @@ -170,7 +173,7 @@ func (c *KinesisAnalytics) AddApplicationInputProcessingConfigurationRequest(inp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddApplicationInputProcessingConfigurationRequest{Request: req, Input: input} + return AddApplicationInputProcessingConfigurationRequest{Request: req, Input: input, Copy: c.AddApplicationInputProcessingConfigurationRequest} } const opAddApplicationOutput = "AddApplicationOutput" @@ -179,6 +182,7 @@ const opAddApplicationOutput = "AddApplicationOutput" type AddApplicationOutputRequest struct { *aws.Request Input *AddApplicationOutputInput + Copy func(*AddApplicationOutputInput) AddApplicationOutputRequest } // Send marshals and sends the AddApplicationOutput API request. @@ -241,7 +245,7 @@ func (c *KinesisAnalytics) AddApplicationOutputRequest(input *AddApplicationOutp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddApplicationOutputRequest{Request: req, Input: input} + return AddApplicationOutputRequest{Request: req, Input: input, Copy: c.AddApplicationOutputRequest} } const opAddApplicationReferenceDataSource = "AddApplicationReferenceDataSource" @@ -250,6 +254,7 @@ const opAddApplicationReferenceDataSource = "AddApplicationReferenceDataSource" type AddApplicationReferenceDataSourceRequest struct { *aws.Request Input *AddApplicationReferenceDataSourceInput + Copy func(*AddApplicationReferenceDataSourceInput) AddApplicationReferenceDataSourceRequest } // Send marshals and sends the AddApplicationReferenceDataSource API request. @@ -304,7 +309,7 @@ func (c *KinesisAnalytics) AddApplicationReferenceDataSourceRequest(input *AddAp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddApplicationReferenceDataSourceRequest{Request: req, Input: input} + return AddApplicationReferenceDataSourceRequest{Request: req, Input: input, Copy: c.AddApplicationReferenceDataSourceRequest} } const opCreateApplication = "CreateApplication" @@ -313,6 +318,7 @@ const opCreateApplication = "CreateApplication" type CreateApplicationRequest struct { *aws.Request Input *CreateApplicationInput + Copy func(*CreateApplicationInput) CreateApplicationRequest } // Send marshals and sends the CreateApplication API request. @@ -377,7 +383,7 @@ func (c *KinesisAnalytics) CreateApplicationRequest(input *CreateApplicationInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateApplicationRequest{Request: req, Input: input} + return CreateApplicationRequest{Request: req, Input: input, Copy: c.CreateApplicationRequest} } const opDeleteApplication = "DeleteApplication" @@ -386,6 +392,7 @@ const opDeleteApplication = "DeleteApplication" type DeleteApplicationRequest struct { *aws.Request Input *DeleteApplicationInput + Copy func(*DeleteApplicationInput) DeleteApplicationRequest } // Send marshals and sends the DeleteApplication API request. @@ -431,7 +438,7 @@ func (c *KinesisAnalytics) DeleteApplicationRequest(input *DeleteApplicationInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApplicationRequest{Request: req, Input: input} + return DeleteApplicationRequest{Request: req, Input: input, Copy: c.DeleteApplicationRequest} } const opDeleteApplicationCloudWatchLoggingOption = "DeleteApplicationCloudWatchLoggingOption" @@ -440,6 +447,7 @@ const opDeleteApplicationCloudWatchLoggingOption = "DeleteApplicationCloudWatchL type DeleteApplicationCloudWatchLoggingOptionRequest struct { *aws.Request Input *DeleteApplicationCloudWatchLoggingOptionInput + Copy func(*DeleteApplicationCloudWatchLoggingOptionInput) DeleteApplicationCloudWatchLoggingOptionRequest } // Send marshals and sends the DeleteApplicationCloudWatchLoggingOption API request. @@ -482,7 +490,7 @@ func (c *KinesisAnalytics) DeleteApplicationCloudWatchLoggingOptionRequest(input req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApplicationCloudWatchLoggingOptionRequest{Request: req, Input: input} + return DeleteApplicationCloudWatchLoggingOptionRequest{Request: req, Input: input, Copy: c.DeleteApplicationCloudWatchLoggingOptionRequest} } const opDeleteApplicationInputProcessingConfiguration = "DeleteApplicationInputProcessingConfiguration" @@ -491,6 +499,7 @@ const opDeleteApplicationInputProcessingConfiguration = "DeleteApplicationInputP type DeleteApplicationInputProcessingConfigurationRequest struct { *aws.Request Input *DeleteApplicationInputProcessingConfigurationInput + Copy func(*DeleteApplicationInputProcessingConfigurationInput) DeleteApplicationInputProcessingConfigurationRequest } // Send marshals and sends the DeleteApplicationInputProcessingConfiguration API request. @@ -531,7 +540,7 @@ func (c *KinesisAnalytics) DeleteApplicationInputProcessingConfigurationRequest( req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApplicationInputProcessingConfigurationRequest{Request: req, Input: input} + return DeleteApplicationInputProcessingConfigurationRequest{Request: req, Input: input, Copy: c.DeleteApplicationInputProcessingConfigurationRequest} } const opDeleteApplicationOutput = "DeleteApplicationOutput" @@ -540,6 +549,7 @@ const opDeleteApplicationOutput = "DeleteApplicationOutput" type DeleteApplicationOutputRequest struct { *aws.Request Input *DeleteApplicationOutputInput + Copy func(*DeleteApplicationOutputInput) DeleteApplicationOutputRequest } // Send marshals and sends the DeleteApplicationOutput API request. @@ -585,7 +595,7 @@ func (c *KinesisAnalytics) DeleteApplicationOutputRequest(input *DeleteApplicati req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApplicationOutputRequest{Request: req, Input: input} + return DeleteApplicationOutputRequest{Request: req, Input: input, Copy: c.DeleteApplicationOutputRequest} } const opDeleteApplicationReferenceDataSource = "DeleteApplicationReferenceDataSource" @@ -594,6 +604,7 @@ const opDeleteApplicationReferenceDataSource = "DeleteApplicationReferenceDataSo type DeleteApplicationReferenceDataSourceRequest struct { *aws.Request Input *DeleteApplicationReferenceDataSourceInput + Copy func(*DeleteApplicationReferenceDataSourceInput) DeleteApplicationReferenceDataSourceRequest } // Send marshals and sends the DeleteApplicationReferenceDataSource API request. @@ -642,7 +653,7 @@ func (c *KinesisAnalytics) DeleteApplicationReferenceDataSourceRequest(input *De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApplicationReferenceDataSourceRequest{Request: req, Input: input} + return DeleteApplicationReferenceDataSourceRequest{Request: req, Input: input, Copy: c.DeleteApplicationReferenceDataSourceRequest} } const opDescribeApplication = "DescribeApplication" @@ -651,6 +662,7 @@ const opDescribeApplication = "DescribeApplication" type DescribeApplicationRequest struct { *aws.Request Input *DescribeApplicationInput + Copy func(*DescribeApplicationInput) DescribeApplicationRequest } // Send marshals and sends the DescribeApplication API request. @@ -698,7 +710,7 @@ func (c *KinesisAnalytics) DescribeApplicationRequest(input *DescribeApplication req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeApplicationRequest{Request: req, Input: input} + return DescribeApplicationRequest{Request: req, Input: input, Copy: c.DescribeApplicationRequest} } const opDiscoverInputSchema = "DiscoverInputSchema" @@ -707,6 +719,7 @@ const opDiscoverInputSchema = "DiscoverInputSchema" type DiscoverInputSchemaRequest struct { *aws.Request Input *DiscoverInputSchemaInput + Copy func(*DiscoverInputSchemaInput) DiscoverInputSchemaRequest } // Send marshals and sends the DiscoverInputSchema API request. @@ -760,7 +773,7 @@ func (c *KinesisAnalytics) DiscoverInputSchemaRequest(input *DiscoverInputSchema req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DiscoverInputSchemaRequest{Request: req, Input: input} + return DiscoverInputSchemaRequest{Request: req, Input: input, Copy: c.DiscoverInputSchemaRequest} } const opListApplications = "ListApplications" @@ -769,6 +782,7 @@ const opListApplications = "ListApplications" type ListApplicationsRequest struct { *aws.Request Input *ListApplicationsInput + Copy func(*ListApplicationsInput) ListApplicationsRequest } // Send marshals and sends the ListApplications API request. @@ -819,7 +833,7 @@ func (c *KinesisAnalytics) ListApplicationsRequest(input *ListApplicationsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListApplicationsRequest{Request: req, Input: input} + return ListApplicationsRequest{Request: req, Input: input, Copy: c.ListApplicationsRequest} } const opStartApplication = "StartApplication" @@ -828,6 +842,7 @@ const opStartApplication = "StartApplication" type StartApplicationRequest struct { *aws.Request Input *StartApplicationInput + Copy func(*StartApplicationInput) StartApplicationRequest } // Send marshals and sends the StartApplication API request. @@ -882,7 +897,7 @@ func (c *KinesisAnalytics) StartApplicationRequest(input *StartApplicationInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartApplicationRequest{Request: req, Input: input} + return StartApplicationRequest{Request: req, Input: input, Copy: c.StartApplicationRequest} } const opStopApplication = "StopApplication" @@ -891,6 +906,7 @@ const opStopApplication = "StopApplication" type StopApplicationRequest struct { *aws.Request Input *StopApplicationInput + Copy func(*StopApplicationInput) StopApplicationRequest } // Send marshals and sends the StopApplication API request. @@ -938,7 +954,7 @@ func (c *KinesisAnalytics) StopApplicationRequest(input *StopApplicationInput) S req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopApplicationRequest{Request: req, Input: input} + return StopApplicationRequest{Request: req, Input: input, Copy: c.StopApplicationRequest} } const opUpdateApplication = "UpdateApplication" @@ -947,6 +963,7 @@ const opUpdateApplication = "UpdateApplication" type UpdateApplicationRequest struct { *aws.Request Input *UpdateApplicationInput + Copy func(*UpdateApplicationInput) UpdateApplicationRequest } // Send marshals and sends the UpdateApplication API request. @@ -994,7 +1011,7 @@ func (c *KinesisAnalytics) UpdateApplicationRequest(input *UpdateApplicationInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApplicationRequest{Request: req, Input: input} + return UpdateApplicationRequest{Request: req, Input: input, Copy: c.UpdateApplicationRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/AddApplicationCloudWatchLoggingOptionRequest diff --git a/service/kinesisvideo/api.go b/service/kinesisvideo/api.go index 32965e2c2c0..c71c1227657 100644 --- a/service/kinesisvideo/api.go +++ b/service/kinesisvideo/api.go @@ -16,6 +16,7 @@ const opCreateStream = "CreateStream" type CreateStreamRequest struct { *aws.Request Input *CreateStreamInput + Copy func(*CreateStreamInput) CreateStreamRequest } // Send marshals and sends the CreateStream API request. @@ -66,7 +67,7 @@ func (c *KinesisVideo) CreateStreamRequest(input *CreateStreamInput) CreateStrea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStreamRequest{Request: req, Input: input} + return CreateStreamRequest{Request: req, Input: input, Copy: c.CreateStreamRequest} } const opDeleteStream = "DeleteStream" @@ -75,6 +76,7 @@ const opDeleteStream = "DeleteStream" type DeleteStreamRequest struct { *aws.Request Input *DeleteStreamInput + Copy func(*DeleteStreamInput) DeleteStreamRequest } // Send marshals and sends the DeleteStream API request. @@ -126,7 +128,7 @@ func (c *KinesisVideo) DeleteStreamRequest(input *DeleteStreamInput) DeleteStrea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteStreamRequest{Request: req, Input: input} + return DeleteStreamRequest{Request: req, Input: input, Copy: c.DeleteStreamRequest} } const opDescribeStream = "DescribeStream" @@ -135,6 +137,7 @@ const opDescribeStream = "DescribeStream" type DescribeStreamRequest struct { *aws.Request Input *DescribeStreamInput + Copy func(*DescribeStreamInput) DescribeStreamRequest } // Send marshals and sends the DescribeStream API request. @@ -176,7 +179,7 @@ func (c *KinesisVideo) DescribeStreamRequest(input *DescribeStreamInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStreamRequest{Request: req, Input: input} + return DescribeStreamRequest{Request: req, Input: input, Copy: c.DescribeStreamRequest} } const opGetDataEndpoint = "GetDataEndpoint" @@ -185,6 +188,7 @@ const opGetDataEndpoint = "GetDataEndpoint" type GetDataEndpointRequest struct { *aws.Request Input *GetDataEndpointInput + Copy func(*GetDataEndpointInput) GetDataEndpointRequest } // Send marshals and sends the GetDataEndpoint API request. @@ -233,7 +237,7 @@ func (c *KinesisVideo) GetDataEndpointRequest(input *GetDataEndpointInput) GetDa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDataEndpointRequest{Request: req, Input: input} + return GetDataEndpointRequest{Request: req, Input: input, Copy: c.GetDataEndpointRequest} } const opListStreams = "ListStreams" @@ -242,6 +246,7 @@ const opListStreams = "ListStreams" type ListStreamsRequest struct { *aws.Request Input *ListStreamsInput + Copy func(*ListStreamsInput) ListStreamsRequest } // Send marshals and sends the ListStreams API request. @@ -284,7 +289,7 @@ func (c *KinesisVideo) ListStreamsRequest(input *ListStreamsInput) ListStreamsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStreamsRequest{Request: req, Input: input} + return ListStreamsRequest{Request: req, Input: input, Copy: c.ListStreamsRequest} } const opListTagsForStream = "ListTagsForStream" @@ -293,6 +298,7 @@ const opListTagsForStream = "ListTagsForStream" type ListTagsForStreamRequest struct { *aws.Request Input *ListTagsForStreamInput + Copy func(*ListTagsForStreamInput) ListTagsForStreamRequest } // Send marshals and sends the ListTagsForStream API request. @@ -335,7 +341,7 @@ func (c *KinesisVideo) ListTagsForStreamRequest(input *ListTagsForStreamInput) L req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForStreamRequest{Request: req, Input: input} + return ListTagsForStreamRequest{Request: req, Input: input, Copy: c.ListTagsForStreamRequest} } const opTagStream = "TagStream" @@ -344,6 +350,7 @@ const opTagStream = "TagStream" type TagStreamRequest struct { *aws.Request Input *TagStreamInput + Copy func(*TagStreamInput) TagStreamRequest } // Send marshals and sends the TagStream API request. @@ -395,7 +402,7 @@ func (c *KinesisVideo) TagStreamRequest(input *TagStreamInput) TagStreamRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagStreamRequest{Request: req, Input: input} + return TagStreamRequest{Request: req, Input: input, Copy: c.TagStreamRequest} } const opUntagStream = "UntagStream" @@ -404,6 +411,7 @@ const opUntagStream = "UntagStream" type UntagStreamRequest struct { *aws.Request Input *UntagStreamInput + Copy func(*UntagStreamInput) UntagStreamRequest } // Send marshals and sends the UntagStream API request. @@ -448,7 +456,7 @@ func (c *KinesisVideo) UntagStreamRequest(input *UntagStreamInput) UntagStreamRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagStreamRequest{Request: req, Input: input} + return UntagStreamRequest{Request: req, Input: input, Copy: c.UntagStreamRequest} } const opUpdateDataRetention = "UpdateDataRetention" @@ -457,6 +465,7 @@ const opUpdateDataRetention = "UpdateDataRetention" type UpdateDataRetentionRequest struct { *aws.Request Input *UpdateDataRetentionInput + Copy func(*UpdateDataRetentionInput) UpdateDataRetentionRequest } // Send marshals and sends the UpdateDataRetention API request. @@ -517,7 +526,7 @@ func (c *KinesisVideo) UpdateDataRetentionRequest(input *UpdateDataRetentionInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDataRetentionRequest{Request: req, Input: input} + return UpdateDataRetentionRequest{Request: req, Input: input, Copy: c.UpdateDataRetentionRequest} } const opUpdateStream = "UpdateStream" @@ -526,6 +535,7 @@ const opUpdateStream = "UpdateStream" type UpdateStreamRequest struct { *aws.Request Input *UpdateStreamInput + Copy func(*UpdateStreamInput) UpdateStreamRequest } // Send marshals and sends the UpdateStream API request. @@ -577,7 +587,7 @@ func (c *KinesisVideo) UpdateStreamRequest(input *UpdateStreamInput) UpdateStrea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateStreamRequest{Request: req, Input: input} + return UpdateStreamRequest{Request: req, Input: input, Copy: c.UpdateStreamRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/CreateStreamInput diff --git a/service/kinesisvideoarchivedmedia/api.go b/service/kinesisvideoarchivedmedia/api.go index dc58ad94555..5caed8656b7 100644 --- a/service/kinesisvideoarchivedmedia/api.go +++ b/service/kinesisvideoarchivedmedia/api.go @@ -17,6 +17,7 @@ const opGetMediaForFragmentList = "GetMediaForFragmentList" type GetMediaForFragmentListRequest struct { *aws.Request Input *GetMediaForFragmentListInput + Copy func(*GetMediaForFragmentListInput) GetMediaForFragmentListRequest } // Send marshals and sends the GetMediaForFragmentList API request. @@ -70,7 +71,7 @@ func (c *KinesisVideoArchivedMedia) GetMediaForFragmentListRequest(input *GetMed req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMediaForFragmentListRequest{Request: req, Input: input} + return GetMediaForFragmentListRequest{Request: req, Input: input, Copy: c.GetMediaForFragmentListRequest} } const opListFragments = "ListFragments" @@ -79,6 +80,7 @@ const opListFragments = "ListFragments" type ListFragmentsRequest struct { *aws.Request Input *ListFragmentsInput + Copy func(*ListFragmentsInput) ListFragmentsRequest } // Send marshals and sends the ListFragments API request. @@ -120,7 +122,7 @@ func (c *KinesisVideoArchivedMedia) ListFragmentsRequest(input *ListFragmentsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFragmentsRequest{Request: req, Input: input} + return ListFragmentsRequest{Request: req, Input: input, Copy: c.ListFragmentsRequest} } // Represents a segment of video or other time-delimited data. diff --git a/service/kinesisvideomedia/api.go b/service/kinesisvideomedia/api.go index 2dcd1f6bbc3..0331222fa1b 100644 --- a/service/kinesisvideomedia/api.go +++ b/service/kinesisvideomedia/api.go @@ -17,6 +17,7 @@ const opGetMedia = "GetMedia" type GetMediaRequest struct { *aws.Request Input *GetMediaInput + Copy func(*GetMediaInput) GetMediaRequest } // Send marshals and sends the GetMedia API request. @@ -75,7 +76,7 @@ func (c *KinesisVideoMedia) GetMediaRequest(input *GetMediaInput) GetMediaReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMediaRequest{Request: req, Input: input} + return GetMediaRequest{Request: req, Input: input, Copy: c.GetMediaRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-media-2017-09-30/GetMediaInput diff --git a/service/kms/api.go b/service/kms/api.go index 9c556bbce0b..05d8c036d4a 100644 --- a/service/kms/api.go +++ b/service/kms/api.go @@ -18,6 +18,7 @@ const opCancelKeyDeletion = "CancelKeyDeletion" type CancelKeyDeletionRequest struct { *aws.Request Input *CancelKeyDeletionInput + Copy func(*CancelKeyDeletionInput) CancelKeyDeletionRequest } // Send marshals and sends the CancelKeyDeletion API request. @@ -65,7 +66,7 @@ func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) CancelKeyD req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelKeyDeletionRequest{Request: req, Input: input} + return CancelKeyDeletionRequest{Request: req, Input: input, Copy: c.CancelKeyDeletionRequest} } const opCreateAlias = "CreateAlias" @@ -74,6 +75,7 @@ const opCreateAlias = "CreateAlias" type CreateAliasRequest struct { *aws.Request Input *CreateAliasInput + Copy func(*CreateAliasInput) CreateAliasRequest } // Send marshals and sends the CreateAlias API request. @@ -138,7 +140,7 @@ func (c *KMS) CreateAliasRequest(input *CreateAliasInput) CreateAliasRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateAliasRequest{Request: req, Input: input} + return CreateAliasRequest{Request: req, Input: input, Copy: c.CreateAliasRequest} } const opCreateGrant = "CreateGrant" @@ -147,6 +149,7 @@ const opCreateGrant = "CreateGrant" type CreateGrantRequest struct { *aws.Request Input *CreateGrantInput + Copy func(*CreateGrantInput) CreateGrantRequest } // Send marshals and sends the CreateGrant API request. @@ -194,7 +197,7 @@ func (c *KMS) CreateGrantRequest(input *CreateGrantInput) CreateGrantRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGrantRequest{Request: req, Input: input} + return CreateGrantRequest{Request: req, Input: input, Copy: c.CreateGrantRequest} } const opCreateKey = "CreateKey" @@ -203,6 +206,7 @@ const opCreateKey = "CreateKey" type CreateKeyRequest struct { *aws.Request Input *CreateKeyInput + Copy func(*CreateKeyInput) CreateKeyRequest } // Send marshals and sends the CreateKey API request. @@ -255,7 +259,7 @@ func (c *KMS) CreateKeyRequest(input *CreateKeyInput) CreateKeyRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateKeyRequest{Request: req, Input: input} + return CreateKeyRequest{Request: req, Input: input, Copy: c.CreateKeyRequest} } const opDecrypt = "Decrypt" @@ -264,6 +268,7 @@ const opDecrypt = "Decrypt" type DecryptRequest struct { *aws.Request Input *DecryptInput + Copy func(*DecryptInput) DecryptRequest } // Send marshals and sends the Decrypt API request. @@ -320,7 +325,7 @@ func (c *KMS) DecryptRequest(input *DecryptInput) DecryptRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DecryptRequest{Request: req, Input: input} + return DecryptRequest{Request: req, Input: input, Copy: c.DecryptRequest} } const opDeleteAlias = "DeleteAlias" @@ -329,6 +334,7 @@ const opDeleteAlias = "DeleteAlias" type DeleteAliasRequest struct { *aws.Request Input *DeleteAliasInput + Copy func(*DeleteAliasInput) DeleteAliasRequest } // Send marshals and sends the DeleteAlias API request. @@ -381,7 +387,7 @@ func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) DeleteAliasRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAliasRequest{Request: req, Input: input} + return DeleteAliasRequest{Request: req, Input: input, Copy: c.DeleteAliasRequest} } const opDeleteImportedKeyMaterial = "DeleteImportedKeyMaterial" @@ -390,6 +396,7 @@ const opDeleteImportedKeyMaterial = "DeleteImportedKeyMaterial" type DeleteImportedKeyMaterialRequest struct { *aws.Request Input *DeleteImportedKeyMaterialInput + Copy func(*DeleteImportedKeyMaterialInput) DeleteImportedKeyMaterialRequest } // Send marshals and sends the DeleteImportedKeyMaterial API request. @@ -442,7 +449,7 @@ func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteImportedKeyMaterialRequest{Request: req, Input: input} + return DeleteImportedKeyMaterialRequest{Request: req, Input: input, Copy: c.DeleteImportedKeyMaterialRequest} } const opDescribeKey = "DescribeKey" @@ -451,6 +458,7 @@ const opDescribeKey = "DescribeKey" type DescribeKeyRequest struct { *aws.Request Input *DescribeKeyInput + Copy func(*DescribeKeyInput) DescribeKeyRequest } // Send marshals and sends the DescribeKey API request. @@ -494,7 +502,7 @@ func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) DescribeKeyRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeKeyRequest{Request: req, Input: input} + return DescribeKeyRequest{Request: req, Input: input, Copy: c.DescribeKeyRequest} } const opDisableKey = "DisableKey" @@ -503,6 +511,7 @@ const opDisableKey = "DisableKey" type DisableKeyRequest struct { *aws.Request Input *DisableKeyInput + Copy func(*DisableKeyInput) DisableKeyRequest } // Send marshals and sends the DisableKey API request. @@ -551,7 +560,7 @@ func (c *KMS) DisableKeyRequest(input *DisableKeyInput) DisableKeyRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisableKeyRequest{Request: req, Input: input} + return DisableKeyRequest{Request: req, Input: input, Copy: c.DisableKeyRequest} } const opDisableKeyRotation = "DisableKeyRotation" @@ -560,6 +569,7 @@ const opDisableKeyRotation = "DisableKeyRotation" type DisableKeyRotationRequest struct { *aws.Request Input *DisableKeyRotationInput + Copy func(*DisableKeyRotationInput) DisableKeyRotationRequest } // Send marshals and sends the DisableKeyRotation API request. @@ -604,7 +614,7 @@ func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) DisableK req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisableKeyRotationRequest{Request: req, Input: input} + return DisableKeyRotationRequest{Request: req, Input: input, Copy: c.DisableKeyRotationRequest} } const opEnableKey = "EnableKey" @@ -613,6 +623,7 @@ const opEnableKey = "EnableKey" type EnableKeyRequest struct { *aws.Request Input *EnableKeyInput + Copy func(*EnableKeyInput) EnableKeyRequest } // Send marshals and sends the EnableKey API request. @@ -657,7 +668,7 @@ func (c *KMS) EnableKeyRequest(input *EnableKeyInput) EnableKeyRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableKeyRequest{Request: req, Input: input} + return EnableKeyRequest{Request: req, Input: input, Copy: c.EnableKeyRequest} } const opEnableKeyRotation = "EnableKeyRotation" @@ -666,6 +677,7 @@ const opEnableKeyRotation = "EnableKeyRotation" type EnableKeyRotationRequest struct { *aws.Request Input *EnableKeyRotationInput + Copy func(*EnableKeyRotationInput) EnableKeyRotationRequest } // Send marshals and sends the EnableKeyRotation API request. @@ -710,7 +722,7 @@ func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) EnableKeyR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableKeyRotationRequest{Request: req, Input: input} + return EnableKeyRotationRequest{Request: req, Input: input, Copy: c.EnableKeyRotationRequest} } const opEncrypt = "Encrypt" @@ -719,6 +731,7 @@ const opEncrypt = "Encrypt" type EncryptRequest struct { *aws.Request Input *EncryptInput + Copy func(*EncryptInput) EncryptRequest } // Send marshals and sends the Encrypt API request. @@ -781,7 +794,7 @@ func (c *KMS) EncryptRequest(input *EncryptInput) EncryptRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EncryptRequest{Request: req, Input: input} + return EncryptRequest{Request: req, Input: input, Copy: c.EncryptRequest} } const opGenerateDataKey = "GenerateDataKey" @@ -790,6 +803,7 @@ const opGenerateDataKey = "GenerateDataKey" type GenerateDataKeyRequest struct { *aws.Request Input *GenerateDataKeyInput + Copy func(*GenerateDataKeyInput) GenerateDataKeyRequest } // Send marshals and sends the GenerateDataKey API request. @@ -875,7 +889,7 @@ func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) GenerateDataKe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GenerateDataKeyRequest{Request: req, Input: input} + return GenerateDataKeyRequest{Request: req, Input: input, Copy: c.GenerateDataKeyRequest} } const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" @@ -884,6 +898,7 @@ const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" type GenerateDataKeyWithoutPlaintextRequest struct { *aws.Request Input *GenerateDataKeyWithoutPlaintextInput + Copy func(*GenerateDataKeyWithoutPlaintextInput) GenerateDataKeyWithoutPlaintextRequest } // Send marshals and sends the GenerateDataKeyWithoutPlaintext API request. @@ -941,7 +956,7 @@ func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWitho req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GenerateDataKeyWithoutPlaintextRequest{Request: req, Input: input} + return GenerateDataKeyWithoutPlaintextRequest{Request: req, Input: input, Copy: c.GenerateDataKeyWithoutPlaintextRequest} } const opGenerateRandom = "GenerateRandom" @@ -950,6 +965,7 @@ const opGenerateRandom = "GenerateRandom" type GenerateRandomRequest struct { *aws.Request Input *GenerateRandomInput + Copy func(*GenerateRandomInput) GenerateRandomRequest } // Send marshals and sends the GenerateRandom API request. @@ -994,7 +1010,7 @@ func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) GenerateRandomRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GenerateRandomRequest{Request: req, Input: input} + return GenerateRandomRequest{Request: req, Input: input, Copy: c.GenerateRandomRequest} } const opGetKeyPolicy = "GetKeyPolicy" @@ -1003,6 +1019,7 @@ const opGetKeyPolicy = "GetKeyPolicy" type GetKeyPolicyRequest struct { *aws.Request Input *GetKeyPolicyInput + Copy func(*GetKeyPolicyInput) GetKeyPolicyRequest } // Send marshals and sends the GetKeyPolicy API request. @@ -1044,7 +1061,7 @@ func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) GetKeyPolicyRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetKeyPolicyRequest{Request: req, Input: input} + return GetKeyPolicyRequest{Request: req, Input: input, Copy: c.GetKeyPolicyRequest} } const opGetKeyRotationStatus = "GetKeyRotationStatus" @@ -1053,6 +1070,7 @@ const opGetKeyRotationStatus = "GetKeyRotationStatus" type GetKeyRotationStatusRequest struct { *aws.Request Input *GetKeyRotationStatusInput + Copy func(*GetKeyRotationStatusInput) GetKeyRotationStatusRequest } // Send marshals and sends the GetKeyRotationStatus API request. @@ -1097,7 +1115,7 @@ func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) GetK req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetKeyRotationStatusRequest{Request: req, Input: input} + return GetKeyRotationStatusRequest{Request: req, Input: input, Copy: c.GetKeyRotationStatusRequest} } const opGetParametersForImport = "GetParametersForImport" @@ -1106,6 +1124,7 @@ const opGetParametersForImport = "GetParametersForImport" type GetParametersForImportRequest struct { *aws.Request Input *GetParametersForImportInput + Copy func(*GetParametersForImportInput) GetParametersForImportRequest } // Send marshals and sends the GetParametersForImport API request. @@ -1162,7 +1181,7 @@ func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetParametersForImportRequest{Request: req, Input: input} + return GetParametersForImportRequest{Request: req, Input: input, Copy: c.GetParametersForImportRequest} } const opImportKeyMaterial = "ImportKeyMaterial" @@ -1171,6 +1190,7 @@ const opImportKeyMaterial = "ImportKeyMaterial" type ImportKeyMaterialRequest struct { *aws.Request Input *ImportKeyMaterialInput + Copy func(*ImportKeyMaterialInput) ImportKeyMaterialRequest } // Send marshals and sends the ImportKeyMaterial API request. @@ -1246,7 +1266,7 @@ func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) ImportKeyM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportKeyMaterialRequest{Request: req, Input: input} + return ImportKeyMaterialRequest{Request: req, Input: input, Copy: c.ImportKeyMaterialRequest} } const opListAliases = "ListAliases" @@ -1255,6 +1275,7 @@ const opListAliases = "ListAliases" type ListAliasesRequest struct { *aws.Request Input *ListAliasesInput + Copy func(*ListAliasesInput) ListAliasesRequest } // Send marshals and sends the ListAliases API request. @@ -1308,57 +1329,53 @@ func (c *KMS) ListAliasesRequest(input *ListAliasesInput) ListAliasesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAliasesRequest{Request: req, Input: input} + return ListAliasesRequest{Request: req, Input: input, Copy: c.ListAliasesRequest} } -// ListAliasesPages iterates over the pages of a ListAliases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAliases method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAliasesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAliases operation. -// pageNum := 0 -// err := client.ListAliasesPages(params, -// func(page *ListAliasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *KMS) ListAliasesPages(input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool) error { - return c.ListAliasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAliasesPagesWithContext same as ListAliasesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *KMS) ListAliasesPagesWithContext(ctx aws.Context, input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAliasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAliasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAliasesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAliasesRequest) Paginate(opts ...aws.Option) ListAliasesPager { + return ListAliasesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAliasesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) - } - return p.Err() +// ListAliasesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAliasesPager struct { + aws.Pager +} + +func (p *ListAliasesPager) CurrentPage() *ListAliasesOutput { + return p.Pager.CurrentPage().(*ListAliasesOutput) } const opListGrants = "ListGrants" @@ -1367,6 +1384,7 @@ const opListGrants = "ListGrants" type ListGrantsRequest struct { *aws.Request Input *ListGrantsInput + Copy func(*ListGrantsInput) ListGrantsRequest } // Send marshals and sends the ListGrants API request. @@ -1416,57 +1434,53 @@ func (c *KMS) ListGrantsRequest(input *ListGrantsInput) ListGrantsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGrantsRequest{Request: req, Input: input} + return ListGrantsRequest{Request: req, Input: input, Copy: c.ListGrantsRequest} } -// ListGrantsPages iterates over the pages of a ListGrants operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGrants method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListGrantsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGrants operation. -// pageNum := 0 -// err := client.ListGrantsPages(params, -// func(page *ListRetirableGrantsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(*ListRetirableGrantsOutput, bool) bool) error { - return c.ListGrantsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGrantsPagesWithContext same as ListGrantsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *KMS) ListGrantsPagesWithContext(ctx aws.Context, input *ListGrantsInput, fn func(*ListRetirableGrantsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListGrantsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListGrantsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListGrantsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListGrantsRequest) Paginate(opts ...aws.Option) ListGrantsPager { + return ListGrantsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListGrantsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRetirableGrantsOutput), !p.HasNextPage()) - } - return p.Err() +// ListGrantsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListGrantsPager struct { + aws.Pager +} + +func (p *ListGrantsPager) CurrentPage() *ListRetirableGrantsOutput { + return p.Pager.CurrentPage().(*ListRetirableGrantsOutput) } const opListKeyPolicies = "ListKeyPolicies" @@ -1475,6 +1489,7 @@ const opListKeyPolicies = "ListKeyPolicies" type ListKeyPoliciesRequest struct { *aws.Request Input *ListKeyPoliciesInput + Copy func(*ListKeyPoliciesInput) ListKeyPoliciesRequest } // Send marshals and sends the ListKeyPolicies API request. @@ -1524,57 +1539,53 @@ func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) ListKeyPolicie req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListKeyPoliciesRequest{Request: req, Input: input} + return ListKeyPoliciesRequest{Request: req, Input: input, Copy: c.ListKeyPoliciesRequest} } -// ListKeyPoliciesPages iterates over the pages of a ListKeyPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListKeyPolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListKeyPoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListKeyPolicies operation. -// pageNum := 0 -// err := client.ListKeyPoliciesPages(params, -// func(page *ListKeyPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, fn func(*ListKeyPoliciesOutput, bool) bool) error { - return c.ListKeyPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListKeyPoliciesPagesWithContext same as ListKeyPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *KMS) ListKeyPoliciesPagesWithContext(ctx aws.Context, input *ListKeyPoliciesInput, fn func(*ListKeyPoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListKeyPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListKeyPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListKeyPoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListKeyPoliciesRequest) Paginate(opts ...aws.Option) ListKeyPoliciesPager { + return ListKeyPoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListKeyPoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListKeyPoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListKeyPoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListKeyPoliciesPager struct { + aws.Pager +} + +func (p *ListKeyPoliciesPager) CurrentPage() *ListKeyPoliciesOutput { + return p.Pager.CurrentPage().(*ListKeyPoliciesOutput) } const opListKeys = "ListKeys" @@ -1583,6 +1594,7 @@ const opListKeys = "ListKeys" type ListKeysRequest struct { *aws.Request Input *ListKeysInput + Copy func(*ListKeysInput) ListKeysRequest } // Send marshals and sends the ListKeys API request. @@ -1630,57 +1642,53 @@ func (c *KMS) ListKeysRequest(input *ListKeysInput) ListKeysRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListKeysRequest{Request: req, Input: input} + return ListKeysRequest{Request: req, Input: input, Copy: c.ListKeysRequest} } -// ListKeysPages iterates over the pages of a ListKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListKeys method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListKeysRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListKeys operation. -// pageNum := 0 -// err := client.ListKeysPages(params, -// func(page *ListKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *KMS) ListKeysPages(input *ListKeysInput, fn func(*ListKeysOutput, bool) bool) error { - return c.ListKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListKeysPagesWithContext same as ListKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *KMS) ListKeysPagesWithContext(ctx aws.Context, input *ListKeysInput, fn func(*ListKeysOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListKeysRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListKeysRequest) Paginate(opts ...aws.Option) ListKeysPager { + return ListKeysPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListKeysInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListKeysOutput), !p.HasNextPage()) - } - return p.Err() +// ListKeysPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListKeysPager struct { + aws.Pager +} + +func (p *ListKeysPager) CurrentPage() *ListKeysOutput { + return p.Pager.CurrentPage().(*ListKeysOutput) } const opListResourceTags = "ListResourceTags" @@ -1689,6 +1697,7 @@ const opListResourceTags = "ListResourceTags" type ListResourceTagsRequest struct { *aws.Request Input *ListResourceTagsInput + Copy func(*ListResourceTagsInput) ListResourceTagsRequest } // Send marshals and sends the ListResourceTags API request. @@ -1731,7 +1740,7 @@ func (c *KMS) ListResourceTagsRequest(input *ListResourceTagsInput) ListResource req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourceTagsRequest{Request: req, Input: input} + return ListResourceTagsRequest{Request: req, Input: input, Copy: c.ListResourceTagsRequest} } const opListRetirableGrants = "ListRetirableGrants" @@ -1740,6 +1749,7 @@ const opListRetirableGrants = "ListRetirableGrants" type ListRetirableGrantsRequest struct { *aws.Request Input *ListRetirableGrantsInput + Copy func(*ListRetirableGrantsInput) ListRetirableGrantsRequest } // Send marshals and sends the ListRetirableGrants API request. @@ -1784,7 +1794,7 @@ func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) ListRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRetirableGrantsRequest{Request: req, Input: input} + return ListRetirableGrantsRequest{Request: req, Input: input, Copy: c.ListRetirableGrantsRequest} } const opPutKeyPolicy = "PutKeyPolicy" @@ -1793,6 +1803,7 @@ const opPutKeyPolicy = "PutKeyPolicy" type PutKeyPolicyRequest struct { *aws.Request Input *PutKeyPolicyInput + Copy func(*PutKeyPolicyInput) PutKeyPolicyRequest } // Send marshals and sends the PutKeyPolicy API request. @@ -1839,7 +1850,7 @@ func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) PutKeyPolicyRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutKeyPolicyRequest{Request: req, Input: input} + return PutKeyPolicyRequest{Request: req, Input: input, Copy: c.PutKeyPolicyRequest} } const opReEncrypt = "ReEncrypt" @@ -1848,6 +1859,7 @@ const opReEncrypt = "ReEncrypt" type ReEncryptRequest struct { *aws.Request Input *ReEncryptInput + Copy func(*ReEncryptInput) ReEncryptRequest } // Send marshals and sends the ReEncrypt API request. @@ -1901,7 +1913,7 @@ func (c *KMS) ReEncryptRequest(input *ReEncryptInput) ReEncryptRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReEncryptRequest{Request: req, Input: input} + return ReEncryptRequest{Request: req, Input: input, Copy: c.ReEncryptRequest} } const opRetireGrant = "RetireGrant" @@ -1910,6 +1922,7 @@ const opRetireGrant = "RetireGrant" type RetireGrantRequest struct { *aws.Request Input *RetireGrantInput + Copy func(*RetireGrantInput) RetireGrantRequest } // Send marshals and sends the RetireGrant API request. @@ -1967,7 +1980,7 @@ func (c *KMS) RetireGrantRequest(input *RetireGrantInput) RetireGrantRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RetireGrantRequest{Request: req, Input: input} + return RetireGrantRequest{Request: req, Input: input, Copy: c.RetireGrantRequest} } const opRevokeGrant = "RevokeGrant" @@ -1976,6 +1989,7 @@ const opRevokeGrant = "RevokeGrant" type RevokeGrantRequest struct { *aws.Request Input *RevokeGrantInput + Copy func(*RevokeGrantInput) RevokeGrantRequest } // Send marshals and sends the RevokeGrant API request. @@ -2022,7 +2036,7 @@ func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) RevokeGrantRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RevokeGrantRequest{Request: req, Input: input} + return RevokeGrantRequest{Request: req, Input: input, Copy: c.RevokeGrantRequest} } const opScheduleKeyDeletion = "ScheduleKeyDeletion" @@ -2031,6 +2045,7 @@ const opScheduleKeyDeletion = "ScheduleKeyDeletion" type ScheduleKeyDeletionRequest struct { *aws.Request Input *ScheduleKeyDeletionInput + Copy func(*ScheduleKeyDeletionInput) ScheduleKeyDeletionRequest } // Send marshals and sends the ScheduleKeyDeletion API request. @@ -2088,7 +2103,7 @@ func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) Schedu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ScheduleKeyDeletionRequest{Request: req, Input: input} + return ScheduleKeyDeletionRequest{Request: req, Input: input, Copy: c.ScheduleKeyDeletionRequest} } const opTagResource = "TagResource" @@ -2097,6 +2112,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -2153,7 +2169,7 @@ func (c *KMS) TagResourceRequest(input *TagResourceInput) TagResourceRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource" @@ -2162,6 +2178,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -2209,7 +2226,7 @@ func (c *KMS) UntagResourceRequest(input *UntagResourceInput) UntagResourceReque req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateAlias = "UpdateAlias" @@ -2218,6 +2235,7 @@ const opUpdateAlias = "UpdateAlias" type UpdateAliasRequest struct { *aws.Request Input *UpdateAliasInput + Copy func(*UpdateAliasInput) UpdateAliasRequest } // Send marshals and sends the UpdateAlias API request. @@ -2279,7 +2297,7 @@ func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) UpdateAliasRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateAliasRequest{Request: req, Input: input} + return UpdateAliasRequest{Request: req, Input: input, Copy: c.UpdateAliasRequest} } const opUpdateKeyDescription = "UpdateKeyDescription" @@ -2288,6 +2306,7 @@ const opUpdateKeyDescription = "UpdateKeyDescription" type UpdateKeyDescriptionRequest struct { *aws.Request Input *UpdateKeyDescriptionInput + Copy func(*UpdateKeyDescriptionInput) UpdateKeyDescriptionRequest } // Send marshals and sends the UpdateKeyDescription API request. @@ -2333,7 +2352,7 @@ func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) Upda req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateKeyDescriptionRequest{Request: req, Input: input} + return UpdateKeyDescriptionRequest{Request: req, Input: input, Copy: c.UpdateKeyDescriptionRequest} } // Contains information about an alias. diff --git a/service/kms/kmsiface/interface.go b/service/kms/kmsiface/interface.go index 7fea3a966f6..83697aebbb7 100644 --- a/service/kms/kmsiface/interface.go +++ b/service/kms/kmsiface/interface.go @@ -9,7 +9,6 @@ package kmsiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/kms" ) @@ -105,24 +104,12 @@ type KMSAPI interface { ListAliasesRequest(*kms.ListAliasesInput) kms.ListAliasesRequest - ListAliasesPages(*kms.ListAliasesInput, func(*kms.ListAliasesOutput, bool) bool) error - ListAliasesPagesWithContext(aws.Context, *kms.ListAliasesInput, func(*kms.ListAliasesOutput, bool) bool, ...aws.Option) error - ListGrantsRequest(*kms.ListGrantsInput) kms.ListGrantsRequest - ListGrantsPages(*kms.ListGrantsInput, func(*kms.ListRetirableGrantsOutput, bool) bool) error - ListGrantsPagesWithContext(aws.Context, *kms.ListGrantsInput, func(*kms.ListRetirableGrantsOutput, bool) bool, ...aws.Option) error - ListKeyPoliciesRequest(*kms.ListKeyPoliciesInput) kms.ListKeyPoliciesRequest - ListKeyPoliciesPages(*kms.ListKeyPoliciesInput, func(*kms.ListKeyPoliciesOutput, bool) bool) error - ListKeyPoliciesPagesWithContext(aws.Context, *kms.ListKeyPoliciesInput, func(*kms.ListKeyPoliciesOutput, bool) bool, ...aws.Option) error - ListKeysRequest(*kms.ListKeysInput) kms.ListKeysRequest - ListKeysPages(*kms.ListKeysInput, func(*kms.ListKeysOutput, bool) bool) error - ListKeysPagesWithContext(aws.Context, *kms.ListKeysInput, func(*kms.ListKeysOutput, bool) bool, ...aws.Option) error - ListResourceTagsRequest(*kms.ListResourceTagsInput) kms.ListResourceTagsRequest ListRetirableGrantsRequest(*kms.ListRetirableGrantsInput) kms.ListRetirableGrantsRequest diff --git a/service/lambda/api.go b/service/lambda/api.go index 365bd217515..029f8a519c7 100644 --- a/service/lambda/api.go +++ b/service/lambda/api.go @@ -18,6 +18,7 @@ const opAddPermission = "AddPermission" type AddPermissionRequest struct { *aws.Request Input *AddPermissionInput + Copy func(*AddPermissionInput) AddPermissionRequest } // Send marshals and sends the AddPermission API request. @@ -72,7 +73,7 @@ func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) AddPermissionRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddPermissionRequest{Request: req, Input: input} + return AddPermissionRequest{Request: req, Input: input, Copy: c.AddPermissionRequest} } const opCreateAlias = "CreateAlias" @@ -81,6 +82,7 @@ const opCreateAlias = "CreateAlias" type CreateAliasRequest struct { *aws.Request Input *CreateAliasInput + Copy func(*CreateAliasInput) CreateAliasRequest } // Send marshals and sends the CreateAlias API request. @@ -125,7 +127,7 @@ func (c *Lambda) CreateAliasRequest(input *CreateAliasInput) CreateAliasRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAliasRequest{Request: req, Input: input} + return CreateAliasRequest{Request: req, Input: input, Copy: c.CreateAliasRequest} } const opCreateEventSourceMapping = "CreateEventSourceMapping" @@ -134,6 +136,7 @@ const opCreateEventSourceMapping = "CreateEventSourceMapping" type CreateEventSourceMappingRequest struct { *aws.Request Input *CreateEventSourceMappingInput + Copy func(*CreateEventSourceMappingInput) CreateEventSourceMappingRequest } // Send marshals and sends the CreateEventSourceMapping API request. @@ -198,7 +201,7 @@ func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMapping req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEventSourceMappingRequest{Request: req, Input: input} + return CreateEventSourceMappingRequest{Request: req, Input: input, Copy: c.CreateEventSourceMappingRequest} } const opCreateFunction = "CreateFunction" @@ -207,6 +210,7 @@ const opCreateFunction = "CreateFunction" type CreateFunctionRequest struct { *aws.Request Input *CreateFunctionInput + Copy func(*CreateFunctionInput) CreateFunctionRequest } // Send marshals and sends the CreateFunction API request. @@ -256,7 +260,7 @@ func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) CreateFunctio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFunctionRequest{Request: req, Input: input} + return CreateFunctionRequest{Request: req, Input: input, Copy: c.CreateFunctionRequest} } const opDeleteAlias = "DeleteAlias" @@ -265,6 +269,7 @@ const opDeleteAlias = "DeleteAlias" type DeleteAliasRequest struct { *aws.Request Input *DeleteAliasInput + Copy func(*DeleteAliasInput) DeleteAliasRequest } // Send marshals and sends the DeleteAlias API request. @@ -310,7 +315,7 @@ func (c *Lambda) DeleteAliasRequest(input *DeleteAliasInput) DeleteAliasRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAliasRequest{Request: req, Input: input} + return DeleteAliasRequest{Request: req, Input: input, Copy: c.DeleteAliasRequest} } const opDeleteEventSourceMapping = "DeleteEventSourceMapping" @@ -319,6 +324,7 @@ const opDeleteEventSourceMapping = "DeleteEventSourceMapping" type DeleteEventSourceMappingRequest struct { *aws.Request Input *DeleteEventSourceMappingInput + Copy func(*DeleteEventSourceMappingInput) DeleteEventSourceMappingRequest } // Send marshals and sends the DeleteEventSourceMapping API request. @@ -363,7 +369,7 @@ func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMapping req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEventSourceMappingRequest{Request: req, Input: input} + return DeleteEventSourceMappingRequest{Request: req, Input: input, Copy: c.DeleteEventSourceMappingRequest} } const opDeleteFunction = "DeleteFunction" @@ -372,6 +378,7 @@ const opDeleteFunction = "DeleteFunction" type DeleteFunctionRequest struct { *aws.Request Input *DeleteFunctionInput + Copy func(*DeleteFunctionInput) DeleteFunctionRequest } // Send marshals and sends the DeleteFunction API request. @@ -426,7 +433,7 @@ func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) DeleteFunctio req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteFunctionRequest{Request: req, Input: input} + return DeleteFunctionRequest{Request: req, Input: input, Copy: c.DeleteFunctionRequest} } const opDeleteFunctionConcurrency = "DeleteFunctionConcurrency" @@ -435,6 +442,7 @@ const opDeleteFunctionConcurrency = "DeleteFunctionConcurrency" type DeleteFunctionConcurrencyRequest struct { *aws.Request Input *DeleteFunctionConcurrencyInput + Copy func(*DeleteFunctionConcurrencyInput) DeleteFunctionConcurrencyRequest } // Send marshals and sends the DeleteFunctionConcurrency API request. @@ -477,7 +485,7 @@ func (c *Lambda) DeleteFunctionConcurrencyRequest(input *DeleteFunctionConcurren req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteFunctionConcurrencyRequest{Request: req, Input: input} + return DeleteFunctionConcurrencyRequest{Request: req, Input: input, Copy: c.DeleteFunctionConcurrencyRequest} } const opGetAccountSettings = "GetAccountSettings" @@ -486,6 +494,7 @@ const opGetAccountSettings = "GetAccountSettings" type GetAccountSettingsRequest struct { *aws.Request Input *GetAccountSettingsInput + Copy func(*GetAccountSettingsInput) GetAccountSettingsRequest } // Send marshals and sends the GetAccountSettings API request. @@ -532,7 +541,7 @@ func (c *Lambda) GetAccountSettingsRequest(input *GetAccountSettingsInput) GetAc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccountSettingsRequest{Request: req, Input: input} + return GetAccountSettingsRequest{Request: req, Input: input, Copy: c.GetAccountSettingsRequest} } const opGetAlias = "GetAlias" @@ -541,6 +550,7 @@ const opGetAlias = "GetAlias" type GetAliasRequest struct { *aws.Request Input *GetAliasInput + Copy func(*GetAliasInput) GetAliasRequest } // Send marshals and sends the GetAlias API request. @@ -585,7 +595,7 @@ func (c *Lambda) GetAliasRequest(input *GetAliasInput) GetAliasRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAliasRequest{Request: req, Input: input} + return GetAliasRequest{Request: req, Input: input, Copy: c.GetAliasRequest} } const opGetEventSourceMapping = "GetEventSourceMapping" @@ -594,6 +604,7 @@ const opGetEventSourceMapping = "GetEventSourceMapping" type GetEventSourceMappingRequest struct { *aws.Request Input *GetEventSourceMappingInput + Copy func(*GetEventSourceMappingInput) GetEventSourceMappingRequest } // Send marshals and sends the GetEventSourceMapping API request. @@ -637,7 +648,7 @@ func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetEventSourceMappingRequest{Request: req, Input: input} + return GetEventSourceMappingRequest{Request: req, Input: input, Copy: c.GetEventSourceMappingRequest} } const opGetFunction = "GetFunction" @@ -646,6 +657,7 @@ const opGetFunction = "GetFunction" type GetFunctionRequest struct { *aws.Request Input *GetFunctionInput + Copy func(*GetFunctionInput) GetFunctionRequest } // Send marshals and sends the GetFunction API request. @@ -698,7 +710,7 @@ func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) GetFunctionRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFunctionRequest{Request: req, Input: input} + return GetFunctionRequest{Request: req, Input: input, Copy: c.GetFunctionRequest} } const opGetFunctionConfiguration = "GetFunctionConfiguration" @@ -707,6 +719,7 @@ const opGetFunctionConfiguration = "GetFunctionConfiguration" type GetFunctionConfigurationRequest struct { *aws.Request Input *GetFunctionConfigurationInput + Copy func(*GetFunctionConfigurationInput) GetFunctionConfigurationRequest } // Send marshals and sends the GetFunctionConfiguration API request. @@ -759,7 +772,7 @@ func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfiguration req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFunctionConfigurationRequest{Request: req, Input: input} + return GetFunctionConfigurationRequest{Request: req, Input: input, Copy: c.GetFunctionConfigurationRequest} } const opGetPolicy = "GetPolicy" @@ -768,6 +781,7 @@ const opGetPolicy = "GetPolicy" type GetPolicyRequest struct { *aws.Request Input *GetPolicyInput + Copy func(*GetPolicyInput) GetPolicyRequest } // Send marshals and sends the GetPolicy API request. @@ -815,7 +829,7 @@ func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) GetPolicyRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPolicyRequest{Request: req, Input: input} + return GetPolicyRequest{Request: req, Input: input, Copy: c.GetPolicyRequest} } const opInvoke = "Invoke" @@ -824,6 +838,7 @@ const opInvoke = "Invoke" type InvokeRequest struct { *aws.Request Input *InvokeInput + Copy func(*InvokeInput) InvokeRequest } // Send marshals and sends the Invoke API request. @@ -875,7 +890,7 @@ func (c *Lambda) InvokeRequest(input *InvokeInput) InvokeRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InvokeRequest{Request: req, Input: input} + return InvokeRequest{Request: req, Input: input, Copy: c.InvokeRequest} } const opInvokeAsync = "InvokeAsync" @@ -884,6 +899,7 @@ const opInvokeAsync = "InvokeAsync" type InvokeAsyncRequest struct { *aws.Request Input *InvokeAsyncInput + Copy func(*InvokeAsyncInput) InvokeAsyncRequest } // Send marshals and sends the InvokeAsync API request. @@ -933,7 +949,7 @@ func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) InvokeAsyncRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InvokeAsyncRequest{Request: req, Input: input} + return InvokeAsyncRequest{Request: req, Input: input, Copy: c.InvokeAsyncRequest} } const opListAliases = "ListAliases" @@ -942,6 +958,7 @@ const opListAliases = "ListAliases" type ListAliasesRequest struct { *aws.Request Input *ListAliasesInput + Copy func(*ListAliasesInput) ListAliasesRequest } // Send marshals and sends the ListAliases API request. @@ -987,7 +1004,7 @@ func (c *Lambda) ListAliasesRequest(input *ListAliasesInput) ListAliasesRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAliasesRequest{Request: req, Input: input} + return ListAliasesRequest{Request: req, Input: input, Copy: c.ListAliasesRequest} } const opListEventSourceMappings = "ListEventSourceMappings" @@ -996,6 +1013,7 @@ const opListEventSourceMappings = "ListEventSourceMappings" type ListEventSourceMappingsRequest struct { *aws.Request Input *ListEventSourceMappingsInput + Copy func(*ListEventSourceMappingsInput) ListEventSourceMappingsRequest } // Send marshals and sends the ListEventSourceMappings API request. @@ -1054,57 +1072,53 @@ func (c *Lambda) ListEventSourceMappingsRequest(input *ListEventSourceMappingsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListEventSourceMappingsRequest{Request: req, Input: input} + return ListEventSourceMappingsRequest{Request: req, Input: input, Copy: c.ListEventSourceMappingsRequest} } -// ListEventSourceMappingsPages iterates over the pages of a ListEventSourceMappings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEventSourceMappings method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListEventSourceMappingsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListEventSourceMappings operation. -// pageNum := 0 -// err := client.ListEventSourceMappingsPages(params, -// func(page *ListEventSourceMappingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Lambda) ListEventSourceMappingsPages(input *ListEventSourceMappingsInput, fn func(*ListEventSourceMappingsOutput, bool) bool) error { - return c.ListEventSourceMappingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEventSourceMappingsPagesWithContext same as ListEventSourceMappingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Lambda) ListEventSourceMappingsPagesWithContext(ctx aws.Context, input *ListEventSourceMappingsInput, fn func(*ListEventSourceMappingsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListEventSourceMappingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListEventSourceMappingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListEventSourceMappingsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListEventSourceMappingsRequest) Paginate(opts ...aws.Option) ListEventSourceMappingsPager { + return ListEventSourceMappingsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListEventSourceMappingsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEventSourceMappingsOutput), !p.HasNextPage()) - } - return p.Err() +// ListEventSourceMappingsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListEventSourceMappingsPager struct { + aws.Pager +} + +func (p *ListEventSourceMappingsPager) CurrentPage() *ListEventSourceMappingsOutput { + return p.Pager.CurrentPage().(*ListEventSourceMappingsOutput) } const opListFunctions = "ListFunctions" @@ -1113,6 +1127,7 @@ const opListFunctions = "ListFunctions" type ListFunctionsRequest struct { *aws.Request Input *ListFunctionsInput + Copy func(*ListFunctionsInput) ListFunctionsRequest } // Send marshals and sends the ListFunctions API request. @@ -1167,57 +1182,53 @@ func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) ListFunctionsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFunctionsRequest{Request: req, Input: input} + return ListFunctionsRequest{Request: req, Input: input, Copy: c.ListFunctionsRequest} } -// ListFunctionsPages iterates over the pages of a ListFunctions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFunctions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListFunctionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListFunctions operation. -// pageNum := 0 -// err := client.ListFunctionsPages(params, -// func(page *ListFunctionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Lambda) ListFunctionsPages(input *ListFunctionsInput, fn func(*ListFunctionsOutput, bool) bool) error { - return c.ListFunctionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFunctionsPagesWithContext same as ListFunctionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Lambda) ListFunctionsPagesWithContext(ctx aws.Context, input *ListFunctionsInput, fn func(*ListFunctionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListFunctionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListFunctionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListFunctionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListFunctionsRequest) Paginate(opts ...aws.Option) ListFunctionsPager { + return ListFunctionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListFunctionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFunctionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListFunctionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListFunctionsPager struct { + aws.Pager +} + +func (p *ListFunctionsPager) CurrentPage() *ListFunctionsOutput { + return p.Pager.CurrentPage().(*ListFunctionsOutput) } const opListTags = "ListTags" @@ -1226,6 +1237,7 @@ const opListTags = "ListTags" type ListTagsRequest struct { *aws.Request Input *ListTagsInput + Copy func(*ListTagsInput) ListTagsRequest } // Send marshals and sends the ListTags API request. @@ -1267,7 +1279,7 @@ func (c *Lambda) ListTagsRequest(input *ListTagsInput) ListTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsRequest{Request: req, Input: input} + return ListTagsRequest{Request: req, Input: input, Copy: c.ListTagsRequest} } const opListVersionsByFunction = "ListVersionsByFunction" @@ -1276,6 +1288,7 @@ const opListVersionsByFunction = "ListVersionsByFunction" type ListVersionsByFunctionRequest struct { *aws.Request Input *ListVersionsByFunctionInput + Copy func(*ListVersionsByFunctionInput) ListVersionsByFunctionRequest } // Send marshals and sends the ListVersionsByFunction API request. @@ -1317,7 +1330,7 @@ func (c *Lambda) ListVersionsByFunctionRequest(input *ListVersionsByFunctionInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListVersionsByFunctionRequest{Request: req, Input: input} + return ListVersionsByFunctionRequest{Request: req, Input: input, Copy: c.ListVersionsByFunctionRequest} } const opPublishVersion = "PublishVersion" @@ -1326,6 +1339,7 @@ const opPublishVersion = "PublishVersion" type PublishVersionRequest struct { *aws.Request Input *PublishVersionInput + Copy func(*PublishVersionInput) PublishVersionRequest } // Send marshals and sends the PublishVersion API request. @@ -1370,7 +1384,7 @@ func (c *Lambda) PublishVersionRequest(input *PublishVersionInput) PublishVersio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PublishVersionRequest{Request: req, Input: input} + return PublishVersionRequest{Request: req, Input: input, Copy: c.PublishVersionRequest} } const opPutFunctionConcurrency = "PutFunctionConcurrency" @@ -1379,6 +1393,7 @@ const opPutFunctionConcurrency = "PutFunctionConcurrency" type PutFunctionConcurrencyRequest struct { *aws.Request Input *PutFunctionConcurrencyInput + Copy func(*PutFunctionConcurrencyInput) PutFunctionConcurrencyRequest } // Send marshals and sends the PutFunctionConcurrency API request. @@ -1424,7 +1439,7 @@ func (c *Lambda) PutFunctionConcurrencyRequest(input *PutFunctionConcurrencyInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutFunctionConcurrencyRequest{Request: req, Input: input} + return PutFunctionConcurrencyRequest{Request: req, Input: input, Copy: c.PutFunctionConcurrencyRequest} } const opRemovePermission = "RemovePermission" @@ -1433,6 +1448,7 @@ const opRemovePermission = "RemovePermission" type RemovePermissionRequest struct { *aws.Request Input *RemovePermissionInput + Copy func(*RemovePermissionInput) RemovePermissionRequest } // Send marshals and sends the RemovePermission API request. @@ -1487,7 +1503,7 @@ func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) RemovePer req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemovePermissionRequest{Request: req, Input: input} + return RemovePermissionRequest{Request: req, Input: input, Copy: c.RemovePermissionRequest} } const opTagResource = "TagResource" @@ -1496,6 +1512,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -1540,7 +1557,7 @@ func (c *Lambda) TagResourceRequest(input *TagResourceInput) TagResourceRequest req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUntagResource = "UntagResource" @@ -1549,6 +1566,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -1592,7 +1610,7 @@ func (c *Lambda) UntagResourceRequest(input *UntagResourceInput) UntagResourceRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateAlias = "UpdateAlias" @@ -1601,6 +1619,7 @@ const opUpdateAlias = "UpdateAlias" type UpdateAliasRequest struct { *aws.Request Input *UpdateAliasInput + Copy func(*UpdateAliasInput) UpdateAliasRequest } // Send marshals and sends the UpdateAlias API request. @@ -1645,7 +1664,7 @@ func (c *Lambda) UpdateAliasRequest(input *UpdateAliasInput) UpdateAliasRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAliasRequest{Request: req, Input: input} + return UpdateAliasRequest{Request: req, Input: input, Copy: c.UpdateAliasRequest} } const opUpdateEventSourceMapping = "UpdateEventSourceMapping" @@ -1654,6 +1673,7 @@ const opUpdateEventSourceMapping = "UpdateEventSourceMapping" type UpdateEventSourceMappingRequest struct { *aws.Request Input *UpdateEventSourceMappingInput + Copy func(*UpdateEventSourceMappingInput) UpdateEventSourceMappingRequest } // Send marshals and sends the UpdateEventSourceMapping API request. @@ -1710,7 +1730,7 @@ func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMapping req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEventSourceMappingRequest{Request: req, Input: input} + return UpdateEventSourceMappingRequest{Request: req, Input: input, Copy: c.UpdateEventSourceMappingRequest} } const opUpdateFunctionCode = "UpdateFunctionCode" @@ -1719,6 +1739,7 @@ const opUpdateFunctionCode = "UpdateFunctionCode" type UpdateFunctionCodeRequest struct { *aws.Request Input *UpdateFunctionCodeInput + Copy func(*UpdateFunctionCodeInput) UpdateFunctionCodeRequest } // Send marshals and sends the UpdateFunctionCode API request. @@ -1767,7 +1788,7 @@ func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateFunctionCodeRequest{Request: req, Input: input} + return UpdateFunctionCodeRequest{Request: req, Input: input, Copy: c.UpdateFunctionCodeRequest} } const opUpdateFunctionConfiguration = "UpdateFunctionConfiguration" @@ -1776,6 +1797,7 @@ const opUpdateFunctionConfiguration = "UpdateFunctionConfiguration" type UpdateFunctionConfigurationRequest struct { *aws.Request Input *UpdateFunctionConfigurationInput + Copy func(*UpdateFunctionConfigurationInput) UpdateFunctionConfigurationRequest } // Send marshals and sends the UpdateFunctionConfiguration API request. @@ -1826,7 +1848,7 @@ func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateFunctionConfigurationRequest{Request: req, Input: input} + return UpdateFunctionConfigurationRequest{Request: req, Input: input, Copy: c.UpdateFunctionConfigurationRequest} } // Provides limits of code size and concurrency associated with the current diff --git a/service/lambda/lambdaiface/interface.go b/service/lambda/lambdaiface/interface.go index 721c5e40048..6b29d8460ca 100644 --- a/service/lambda/lambdaiface/interface.go +++ b/service/lambda/lambdaiface/interface.go @@ -9,7 +9,6 @@ package lambdaiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/lambda" ) @@ -99,14 +98,8 @@ type LambdaAPI interface { ListEventSourceMappingsRequest(*lambda.ListEventSourceMappingsInput) lambda.ListEventSourceMappingsRequest - ListEventSourceMappingsPages(*lambda.ListEventSourceMappingsInput, func(*lambda.ListEventSourceMappingsOutput, bool) bool) error - ListEventSourceMappingsPagesWithContext(aws.Context, *lambda.ListEventSourceMappingsInput, func(*lambda.ListEventSourceMappingsOutput, bool) bool, ...aws.Option) error - ListFunctionsRequest(*lambda.ListFunctionsInput) lambda.ListFunctionsRequest - ListFunctionsPages(*lambda.ListFunctionsInput, func(*lambda.ListFunctionsOutput, bool) bool) error - ListFunctionsPagesWithContext(aws.Context, *lambda.ListFunctionsInput, func(*lambda.ListFunctionsOutput, bool) bool, ...aws.Option) error - ListTagsRequest(*lambda.ListTagsInput) lambda.ListTagsRequest ListVersionsByFunctionRequest(*lambda.ListVersionsByFunctionInput) lambda.ListVersionsByFunctionRequest diff --git a/service/lexmodelbuildingservice/api.go b/service/lexmodelbuildingservice/api.go index af7aae0f9c5..21f0f604114 100644 --- a/service/lexmodelbuildingservice/api.go +++ b/service/lexmodelbuildingservice/api.go @@ -18,6 +18,7 @@ const opCreateBotVersion = "CreateBotVersion" type CreateBotVersionRequest struct { *aws.Request Input *CreateBotVersionInput + Copy func(*CreateBotVersionInput) CreateBotVersionRequest } // Send marshals and sends the CreateBotVersion API request. @@ -68,7 +69,7 @@ func (c *LexModelBuildingService) CreateBotVersionRequest(input *CreateBotVersio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBotVersionRequest{Request: req, Input: input} + return CreateBotVersionRequest{Request: req, Input: input, Copy: c.CreateBotVersionRequest} } const opCreateIntentVersion = "CreateIntentVersion" @@ -77,6 +78,7 @@ const opCreateIntentVersion = "CreateIntentVersion" type CreateIntentVersionRequest struct { *aws.Request Input *CreateIntentVersionInput + Copy func(*CreateIntentVersionInput) CreateIntentVersionRequest } // Send marshals and sends the CreateIntentVersion API request. @@ -129,7 +131,7 @@ func (c *LexModelBuildingService) CreateIntentVersionRequest(input *CreateIntent req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateIntentVersionRequest{Request: req, Input: input} + return CreateIntentVersionRequest{Request: req, Input: input, Copy: c.CreateIntentVersionRequest} } const opCreateSlotTypeVersion = "CreateSlotTypeVersion" @@ -138,6 +140,7 @@ const opCreateSlotTypeVersion = "CreateSlotTypeVersion" type CreateSlotTypeVersionRequest struct { *aws.Request Input *CreateSlotTypeVersionInput + Copy func(*CreateSlotTypeVersionInput) CreateSlotTypeVersionRequest } // Send marshals and sends the CreateSlotTypeVersion API request. @@ -189,7 +192,7 @@ func (c *LexModelBuildingService) CreateSlotTypeVersionRequest(input *CreateSlot req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSlotTypeVersionRequest{Request: req, Input: input} + return CreateSlotTypeVersionRequest{Request: req, Input: input, Copy: c.CreateSlotTypeVersionRequest} } const opDeleteBot = "DeleteBot" @@ -198,6 +201,7 @@ const opDeleteBot = "DeleteBot" type DeleteBotRequest struct { *aws.Request Input *DeleteBotInput + Copy func(*DeleteBotInput) DeleteBotRequest } // Send marshals and sends the DeleteBot API request. @@ -249,7 +253,7 @@ func (c *LexModelBuildingService) DeleteBotRequest(input *DeleteBotInput) Delete req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBotRequest{Request: req, Input: input} + return DeleteBotRequest{Request: req, Input: input, Copy: c.DeleteBotRequest} } const opDeleteBotAlias = "DeleteBotAlias" @@ -258,6 +262,7 @@ const opDeleteBotAlias = "DeleteBotAlias" type DeleteBotAliasRequest struct { *aws.Request Input *DeleteBotAliasInput + Copy func(*DeleteBotAliasInput) DeleteBotAliasRequest } // Send marshals and sends the DeleteBotAlias API request. @@ -308,7 +313,7 @@ func (c *LexModelBuildingService) DeleteBotAliasRequest(input *DeleteBotAliasInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBotAliasRequest{Request: req, Input: input} + return DeleteBotAliasRequest{Request: req, Input: input, Copy: c.DeleteBotAliasRequest} } const opDeleteBotChannelAssociation = "DeleteBotChannelAssociation" @@ -317,6 +322,7 @@ const opDeleteBotChannelAssociation = "DeleteBotChannelAssociation" type DeleteBotChannelAssociationRequest struct { *aws.Request Input *DeleteBotChannelAssociationInput + Copy func(*DeleteBotChannelAssociationInput) DeleteBotChannelAssociationRequest } // Send marshals and sends the DeleteBotChannelAssociation API request. @@ -362,7 +368,7 @@ func (c *LexModelBuildingService) DeleteBotChannelAssociationRequest(input *Dele req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBotChannelAssociationRequest{Request: req, Input: input} + return DeleteBotChannelAssociationRequest{Request: req, Input: input, Copy: c.DeleteBotChannelAssociationRequest} } const opDeleteBotVersion = "DeleteBotVersion" @@ -371,6 +377,7 @@ const opDeleteBotVersion = "DeleteBotVersion" type DeleteBotVersionRequest struct { *aws.Request Input *DeleteBotVersionInput + Copy func(*DeleteBotVersionInput) DeleteBotVersionRequest } // Send marshals and sends the DeleteBotVersion API request. @@ -416,7 +423,7 @@ func (c *LexModelBuildingService) DeleteBotVersionRequest(input *DeleteBotVersio req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBotVersionRequest{Request: req, Input: input} + return DeleteBotVersionRequest{Request: req, Input: input, Copy: c.DeleteBotVersionRequest} } const opDeleteIntent = "DeleteIntent" @@ -425,6 +432,7 @@ const opDeleteIntent = "DeleteIntent" type DeleteIntentRequest struct { *aws.Request Input *DeleteIntentInput + Copy func(*DeleteIntentInput) DeleteIntentRequest } // Send marshals and sends the DeleteIntent API request. @@ -480,7 +488,7 @@ func (c *LexModelBuildingService) DeleteIntentRequest(input *DeleteIntentInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteIntentRequest{Request: req, Input: input} + return DeleteIntentRequest{Request: req, Input: input, Copy: c.DeleteIntentRequest} } const opDeleteIntentVersion = "DeleteIntentVersion" @@ -489,6 +497,7 @@ const opDeleteIntentVersion = "DeleteIntentVersion" type DeleteIntentVersionRequest struct { *aws.Request Input *DeleteIntentVersionInput + Copy func(*DeleteIntentVersionInput) DeleteIntentVersionRequest } // Send marshals and sends the DeleteIntentVersion API request. @@ -534,7 +543,7 @@ func (c *LexModelBuildingService) DeleteIntentVersionRequest(input *DeleteIntent req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteIntentVersionRequest{Request: req, Input: input} + return DeleteIntentVersionRequest{Request: req, Input: input, Copy: c.DeleteIntentVersionRequest} } const opDeleteSlotType = "DeleteSlotType" @@ -543,6 +552,7 @@ const opDeleteSlotType = "DeleteSlotType" type DeleteSlotTypeRequest struct { *aws.Request Input *DeleteSlotTypeInput + Copy func(*DeleteSlotTypeInput) DeleteSlotTypeRequest } // Send marshals and sends the DeleteSlotType API request. @@ -600,7 +610,7 @@ func (c *LexModelBuildingService) DeleteSlotTypeRequest(input *DeleteSlotTypeInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSlotTypeRequest{Request: req, Input: input} + return DeleteSlotTypeRequest{Request: req, Input: input, Copy: c.DeleteSlotTypeRequest} } const opDeleteSlotTypeVersion = "DeleteSlotTypeVersion" @@ -609,6 +619,7 @@ const opDeleteSlotTypeVersion = "DeleteSlotTypeVersion" type DeleteSlotTypeVersionRequest struct { *aws.Request Input *DeleteSlotTypeVersionInput + Copy func(*DeleteSlotTypeVersionInput) DeleteSlotTypeVersionRequest } // Send marshals and sends the DeleteSlotTypeVersion API request. @@ -654,7 +665,7 @@ func (c *LexModelBuildingService) DeleteSlotTypeVersionRequest(input *DeleteSlot req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSlotTypeVersionRequest{Request: req, Input: input} + return DeleteSlotTypeVersionRequest{Request: req, Input: input, Copy: c.DeleteSlotTypeVersionRequest} } const opDeleteUtterances = "DeleteUtterances" @@ -663,6 +674,7 @@ const opDeleteUtterances = "DeleteUtterances" type DeleteUtterancesRequest struct { *aws.Request Input *DeleteUtterancesInput + Copy func(*DeleteUtterancesInput) DeleteUtterancesRequest } // Send marshals and sends the DeleteUtterances API request. @@ -715,7 +727,7 @@ func (c *LexModelBuildingService) DeleteUtterancesRequest(input *DeleteUtterance req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteUtterancesRequest{Request: req, Input: input} + return DeleteUtterancesRequest{Request: req, Input: input, Copy: c.DeleteUtterancesRequest} } const opGetBot = "GetBot" @@ -724,6 +736,7 @@ const opGetBot = "GetBot" type GetBotRequest struct { *aws.Request Input *GetBotInput + Copy func(*GetBotInput) GetBotRequest } // Send marshals and sends the GetBot API request. @@ -767,7 +780,7 @@ func (c *LexModelBuildingService) GetBotRequest(input *GetBotInput) GetBotReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBotRequest{Request: req, Input: input} + return GetBotRequest{Request: req, Input: input, Copy: c.GetBotRequest} } const opGetBotAlias = "GetBotAlias" @@ -776,6 +789,7 @@ const opGetBotAlias = "GetBotAlias" type GetBotAliasRequest struct { *aws.Request Input *GetBotAliasInput + Copy func(*GetBotAliasInput) GetBotAliasRequest } // Send marshals and sends the GetBotAlias API request. @@ -819,7 +833,7 @@ func (c *LexModelBuildingService) GetBotAliasRequest(input *GetBotAliasInput) Ge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBotAliasRequest{Request: req, Input: input} + return GetBotAliasRequest{Request: req, Input: input, Copy: c.GetBotAliasRequest} } const opGetBotAliases = "GetBotAliases" @@ -828,6 +842,7 @@ const opGetBotAliases = "GetBotAliases" type GetBotAliasesRequest struct { *aws.Request Input *GetBotAliasesInput + Copy func(*GetBotAliasesInput) GetBotAliasesRequest } // Send marshals and sends the GetBotAliases API request. @@ -876,57 +891,53 @@ func (c *LexModelBuildingService) GetBotAliasesRequest(input *GetBotAliasesInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBotAliasesRequest{Request: req, Input: input} + return GetBotAliasesRequest{Request: req, Input: input, Copy: c.GetBotAliasesRequest} } -// GetBotAliasesPages iterates over the pages of a GetBotAliases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetBotAliases method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetBotAliasesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetBotAliases operation. -// pageNum := 0 -// err := client.GetBotAliasesPages(params, -// func(page *GetBotAliasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetBotAliasesPages(input *GetBotAliasesInput, fn func(*GetBotAliasesOutput, bool) bool) error { - return c.GetBotAliasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetBotAliasesPagesWithContext same as GetBotAliasesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetBotAliasesPagesWithContext(ctx aws.Context, input *GetBotAliasesInput, fn func(*GetBotAliasesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetBotAliasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetBotAliasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetBotAliasesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetBotAliasesRequest) Paginate(opts ...aws.Option) GetBotAliasesPager { + return GetBotAliasesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetBotAliasesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBotAliasesOutput), !p.HasNextPage()) - } - return p.Err() +// GetBotAliasesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetBotAliasesPager struct { + aws.Pager +} + +func (p *GetBotAliasesPager) CurrentPage() *GetBotAliasesOutput { + return p.Pager.CurrentPage().(*GetBotAliasesOutput) } const opGetBotChannelAssociation = "GetBotChannelAssociation" @@ -935,6 +946,7 @@ const opGetBotChannelAssociation = "GetBotChannelAssociation" type GetBotChannelAssociationRequest struct { *aws.Request Input *GetBotChannelAssociationInput + Copy func(*GetBotChannelAssociationInput) GetBotChannelAssociationRequest } // Send marshals and sends the GetBotChannelAssociation API request. @@ -979,7 +991,7 @@ func (c *LexModelBuildingService) GetBotChannelAssociationRequest(input *GetBotC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBotChannelAssociationRequest{Request: req, Input: input} + return GetBotChannelAssociationRequest{Request: req, Input: input, Copy: c.GetBotChannelAssociationRequest} } const opGetBotChannelAssociations = "GetBotChannelAssociations" @@ -988,6 +1000,7 @@ const opGetBotChannelAssociations = "GetBotChannelAssociations" type GetBotChannelAssociationsRequest struct { *aws.Request Input *GetBotChannelAssociationsInput + Copy func(*GetBotChannelAssociationsInput) GetBotChannelAssociationsRequest } // Send marshals and sends the GetBotChannelAssociations API request. @@ -1037,57 +1050,53 @@ func (c *LexModelBuildingService) GetBotChannelAssociationsRequest(input *GetBot req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBotChannelAssociationsRequest{Request: req, Input: input} + return GetBotChannelAssociationsRequest{Request: req, Input: input, Copy: c.GetBotChannelAssociationsRequest} } -// GetBotChannelAssociationsPages iterates over the pages of a GetBotChannelAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetBotChannelAssociations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetBotChannelAssociationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetBotChannelAssociations operation. -// pageNum := 0 -// err := client.GetBotChannelAssociationsPages(params, -// func(page *GetBotChannelAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetBotChannelAssociationsPages(input *GetBotChannelAssociationsInput, fn func(*GetBotChannelAssociationsOutput, bool) bool) error { - return c.GetBotChannelAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetBotChannelAssociationsPagesWithContext same as GetBotChannelAssociationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetBotChannelAssociationsPagesWithContext(ctx aws.Context, input *GetBotChannelAssociationsInput, fn func(*GetBotChannelAssociationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetBotChannelAssociationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetBotChannelAssociationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetBotChannelAssociationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetBotChannelAssociationsRequest) Paginate(opts ...aws.Option) GetBotChannelAssociationsPager { + return GetBotChannelAssociationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetBotChannelAssociationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBotChannelAssociationsOutput), !p.HasNextPage()) - } - return p.Err() +// GetBotChannelAssociationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetBotChannelAssociationsPager struct { + aws.Pager +} + +func (p *GetBotChannelAssociationsPager) CurrentPage() *GetBotChannelAssociationsOutput { + return p.Pager.CurrentPage().(*GetBotChannelAssociationsOutput) } const opGetBotVersions = "GetBotVersions" @@ -1096,6 +1105,7 @@ const opGetBotVersions = "GetBotVersions" type GetBotVersionsRequest struct { *aws.Request Input *GetBotVersionsInput + Copy func(*GetBotVersionsInput) GetBotVersionsRequest } // Send marshals and sends the GetBotVersions API request. @@ -1152,57 +1162,53 @@ func (c *LexModelBuildingService) GetBotVersionsRequest(input *GetBotVersionsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBotVersionsRequest{Request: req, Input: input} + return GetBotVersionsRequest{Request: req, Input: input, Copy: c.GetBotVersionsRequest} } -// GetBotVersionsPages iterates over the pages of a GetBotVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetBotVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetBotVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetBotVersions operation. -// pageNum := 0 -// err := client.GetBotVersionsPages(params, -// func(page *GetBotVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetBotVersionsPages(input *GetBotVersionsInput, fn func(*GetBotVersionsOutput, bool) bool) error { - return c.GetBotVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetBotVersionsPagesWithContext same as GetBotVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetBotVersionsPagesWithContext(ctx aws.Context, input *GetBotVersionsInput, fn func(*GetBotVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetBotVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetBotVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetBotVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetBotVersionsRequest) Paginate(opts ...aws.Option) GetBotVersionsPager { + return GetBotVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetBotVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBotVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// GetBotVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetBotVersionsPager struct { + aws.Pager +} + +func (p *GetBotVersionsPager) CurrentPage() *GetBotVersionsOutput { + return p.Pager.CurrentPage().(*GetBotVersionsOutput) } const opGetBots = "GetBots" @@ -1211,6 +1217,7 @@ const opGetBots = "GetBots" type GetBotsRequest struct { *aws.Request Input *GetBotsInput + Copy func(*GetBotsInput) GetBotsRequest } // Send marshals and sends the GetBots API request. @@ -1266,57 +1273,53 @@ func (c *LexModelBuildingService) GetBotsRequest(input *GetBotsInput) GetBotsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBotsRequest{Request: req, Input: input} + return GetBotsRequest{Request: req, Input: input, Copy: c.GetBotsRequest} } -// GetBotsPages iterates over the pages of a GetBots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetBots method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetBotsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetBots operation. -// pageNum := 0 -// err := client.GetBotsPages(params, -// func(page *GetBotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetBotsPages(input *GetBotsInput, fn func(*GetBotsOutput, bool) bool) error { - return c.GetBotsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetBotsPagesWithContext same as GetBotsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetBotsPagesWithContext(ctx aws.Context, input *GetBotsInput, fn func(*GetBotsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetBotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetBotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetBotsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetBotsRequest) Paginate(opts ...aws.Option) GetBotsPager { + return GetBotsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetBotsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBotsOutput), !p.HasNextPage()) - } - return p.Err() +// GetBotsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetBotsPager struct { + aws.Pager +} + +func (p *GetBotsPager) CurrentPage() *GetBotsOutput { + return p.Pager.CurrentPage().(*GetBotsOutput) } const opGetBuiltinIntent = "GetBuiltinIntent" @@ -1325,6 +1328,7 @@ const opGetBuiltinIntent = "GetBuiltinIntent" type GetBuiltinIntentRequest struct { *aws.Request Input *GetBuiltinIntentInput + Copy func(*GetBuiltinIntentInput) GetBuiltinIntentRequest } // Send marshals and sends the GetBuiltinIntent API request. @@ -1367,7 +1371,7 @@ func (c *LexModelBuildingService) GetBuiltinIntentRequest(input *GetBuiltinInten req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBuiltinIntentRequest{Request: req, Input: input} + return GetBuiltinIntentRequest{Request: req, Input: input, Copy: c.GetBuiltinIntentRequest} } const opGetBuiltinIntents = "GetBuiltinIntents" @@ -1376,6 +1380,7 @@ const opGetBuiltinIntents = "GetBuiltinIntents" type GetBuiltinIntentsRequest struct { *aws.Request Input *GetBuiltinIntentsInput + Copy func(*GetBuiltinIntentsInput) GetBuiltinIntentsRequest } // Send marshals and sends the GetBuiltinIntents API request. @@ -1424,57 +1429,53 @@ func (c *LexModelBuildingService) GetBuiltinIntentsRequest(input *GetBuiltinInte req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBuiltinIntentsRequest{Request: req, Input: input} + return GetBuiltinIntentsRequest{Request: req, Input: input, Copy: c.GetBuiltinIntentsRequest} } -// GetBuiltinIntentsPages iterates over the pages of a GetBuiltinIntents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetBuiltinIntents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetBuiltinIntentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetBuiltinIntents operation. -// pageNum := 0 -// err := client.GetBuiltinIntentsPages(params, -// func(page *GetBuiltinIntentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetBuiltinIntentsPages(input *GetBuiltinIntentsInput, fn func(*GetBuiltinIntentsOutput, bool) bool) error { - return c.GetBuiltinIntentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetBuiltinIntentsPagesWithContext same as GetBuiltinIntentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetBuiltinIntentsPagesWithContext(ctx aws.Context, input *GetBuiltinIntentsInput, fn func(*GetBuiltinIntentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetBuiltinIntentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetBuiltinIntentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetBuiltinIntentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetBuiltinIntentsRequest) Paginate(opts ...aws.Option) GetBuiltinIntentsPager { + return GetBuiltinIntentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetBuiltinIntentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBuiltinIntentsOutput), !p.HasNextPage()) - } - return p.Err() +// GetBuiltinIntentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetBuiltinIntentsPager struct { + aws.Pager +} + +func (p *GetBuiltinIntentsPager) CurrentPage() *GetBuiltinIntentsOutput { + return p.Pager.CurrentPage().(*GetBuiltinIntentsOutput) } const opGetBuiltinSlotTypes = "GetBuiltinSlotTypes" @@ -1483,6 +1484,7 @@ const opGetBuiltinSlotTypes = "GetBuiltinSlotTypes" type GetBuiltinSlotTypesRequest struct { *aws.Request Input *GetBuiltinSlotTypesInput + Copy func(*GetBuiltinSlotTypesInput) GetBuiltinSlotTypesRequest } // Send marshals and sends the GetBuiltinSlotTypes API request. @@ -1534,57 +1536,53 @@ func (c *LexModelBuildingService) GetBuiltinSlotTypesRequest(input *GetBuiltinSl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBuiltinSlotTypesRequest{Request: req, Input: input} + return GetBuiltinSlotTypesRequest{Request: req, Input: input, Copy: c.GetBuiltinSlotTypesRequest} } -// GetBuiltinSlotTypesPages iterates over the pages of a GetBuiltinSlotTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetBuiltinSlotTypes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetBuiltinSlotTypesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetBuiltinSlotTypes operation. -// pageNum := 0 -// err := client.GetBuiltinSlotTypesPages(params, -// func(page *GetBuiltinSlotTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetBuiltinSlotTypesPages(input *GetBuiltinSlotTypesInput, fn func(*GetBuiltinSlotTypesOutput, bool) bool) error { - return c.GetBuiltinSlotTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetBuiltinSlotTypesPagesWithContext same as GetBuiltinSlotTypesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetBuiltinSlotTypesPagesWithContext(ctx aws.Context, input *GetBuiltinSlotTypesInput, fn func(*GetBuiltinSlotTypesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetBuiltinSlotTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetBuiltinSlotTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetBuiltinSlotTypesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetBuiltinSlotTypesRequest) Paginate(opts ...aws.Option) GetBuiltinSlotTypesPager { + return GetBuiltinSlotTypesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetBuiltinSlotTypesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBuiltinSlotTypesOutput), !p.HasNextPage()) - } - return p.Err() +// GetBuiltinSlotTypesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetBuiltinSlotTypesPager struct { + aws.Pager +} + +func (p *GetBuiltinSlotTypesPager) CurrentPage() *GetBuiltinSlotTypesOutput { + return p.Pager.CurrentPage().(*GetBuiltinSlotTypesOutput) } const opGetExport = "GetExport" @@ -1593,6 +1591,7 @@ const opGetExport = "GetExport" type GetExportRequest struct { *aws.Request Input *GetExportInput + Copy func(*GetExportInput) GetExportRequest } // Send marshals and sends the GetExport API request. @@ -1633,7 +1632,7 @@ func (c *LexModelBuildingService) GetExportRequest(input *GetExportInput) GetExp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetExportRequest{Request: req, Input: input} + return GetExportRequest{Request: req, Input: input, Copy: c.GetExportRequest} } const opGetIntent = "GetIntent" @@ -1642,6 +1641,7 @@ const opGetIntent = "GetIntent" type GetIntentRequest struct { *aws.Request Input *GetIntentInput + Copy func(*GetIntentInput) GetIntentRequest } // Send marshals and sends the GetIntent API request. @@ -1685,7 +1685,7 @@ func (c *LexModelBuildingService) GetIntentRequest(input *GetIntentInput) GetInt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIntentRequest{Request: req, Input: input} + return GetIntentRequest{Request: req, Input: input, Copy: c.GetIntentRequest} } const opGetIntentVersions = "GetIntentVersions" @@ -1694,6 +1694,7 @@ const opGetIntentVersions = "GetIntentVersions" type GetIntentVersionsRequest struct { *aws.Request Input *GetIntentVersionsInput + Copy func(*GetIntentVersionsInput) GetIntentVersionsRequest } // Send marshals and sends the GetIntentVersions API request. @@ -1750,57 +1751,53 @@ func (c *LexModelBuildingService) GetIntentVersionsRequest(input *GetIntentVersi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIntentVersionsRequest{Request: req, Input: input} + return GetIntentVersionsRequest{Request: req, Input: input, Copy: c.GetIntentVersionsRequest} } -// GetIntentVersionsPages iterates over the pages of a GetIntentVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetIntentVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetIntentVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetIntentVersions operation. -// pageNum := 0 -// err := client.GetIntentVersionsPages(params, -// func(page *GetIntentVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetIntentVersionsPages(input *GetIntentVersionsInput, fn func(*GetIntentVersionsOutput, bool) bool) error { - return c.GetIntentVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetIntentVersionsPagesWithContext same as GetIntentVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetIntentVersionsPagesWithContext(ctx aws.Context, input *GetIntentVersionsInput, fn func(*GetIntentVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetIntentVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetIntentVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetIntentVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetIntentVersionsRequest) Paginate(opts ...aws.Option) GetIntentVersionsPager { + return GetIntentVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetIntentVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetIntentVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// GetIntentVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetIntentVersionsPager struct { + aws.Pager +} + +func (p *GetIntentVersionsPager) CurrentPage() *GetIntentVersionsOutput { + return p.Pager.CurrentPage().(*GetIntentVersionsOutput) } const opGetIntents = "GetIntents" @@ -1809,6 +1806,7 @@ const opGetIntents = "GetIntents" type GetIntentsRequest struct { *aws.Request Input *GetIntentsInput + Copy func(*GetIntentsInput) GetIntentsRequest } // Send marshals and sends the GetIntents API request. @@ -1863,57 +1861,53 @@ func (c *LexModelBuildingService) GetIntentsRequest(input *GetIntentsInput) GetI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIntentsRequest{Request: req, Input: input} + return GetIntentsRequest{Request: req, Input: input, Copy: c.GetIntentsRequest} } -// GetIntentsPages iterates over the pages of a GetIntents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetIntents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetIntentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetIntents operation. -// pageNum := 0 -// err := client.GetIntentsPages(params, -// func(page *GetIntentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetIntentsPages(input *GetIntentsInput, fn func(*GetIntentsOutput, bool) bool) error { - return c.GetIntentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetIntentsPagesWithContext same as GetIntentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetIntentsPagesWithContext(ctx aws.Context, input *GetIntentsInput, fn func(*GetIntentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetIntentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetIntentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetIntentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetIntentsRequest) Paginate(opts ...aws.Option) GetIntentsPager { + return GetIntentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetIntentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetIntentsOutput), !p.HasNextPage()) - } - return p.Err() +// GetIntentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetIntentsPager struct { + aws.Pager +} + +func (p *GetIntentsPager) CurrentPage() *GetIntentsOutput { + return p.Pager.CurrentPage().(*GetIntentsOutput) } const opGetSlotType = "GetSlotType" @@ -1922,6 +1916,7 @@ const opGetSlotType = "GetSlotType" type GetSlotTypeRequest struct { *aws.Request Input *GetSlotTypeInput + Copy func(*GetSlotTypeInput) GetSlotTypeRequest } // Send marshals and sends the GetSlotType API request. @@ -1965,7 +1960,7 @@ func (c *LexModelBuildingService) GetSlotTypeRequest(input *GetSlotTypeInput) Ge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSlotTypeRequest{Request: req, Input: input} + return GetSlotTypeRequest{Request: req, Input: input, Copy: c.GetSlotTypeRequest} } const opGetSlotTypeVersions = "GetSlotTypeVersions" @@ -1974,6 +1969,7 @@ const opGetSlotTypeVersions = "GetSlotTypeVersions" type GetSlotTypeVersionsRequest struct { *aws.Request Input *GetSlotTypeVersionsInput + Copy func(*GetSlotTypeVersionsInput) GetSlotTypeVersionsRequest } // Send marshals and sends the GetSlotTypeVersions API request. @@ -2030,57 +2026,53 @@ func (c *LexModelBuildingService) GetSlotTypeVersionsRequest(input *GetSlotTypeV req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSlotTypeVersionsRequest{Request: req, Input: input} + return GetSlotTypeVersionsRequest{Request: req, Input: input, Copy: c.GetSlotTypeVersionsRequest} } -// GetSlotTypeVersionsPages iterates over the pages of a GetSlotTypeVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetSlotTypeVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetSlotTypeVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetSlotTypeVersions operation. -// pageNum := 0 -// err := client.GetSlotTypeVersionsPages(params, -// func(page *GetSlotTypeVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetSlotTypeVersionsPages(input *GetSlotTypeVersionsInput, fn func(*GetSlotTypeVersionsOutput, bool) bool) error { - return c.GetSlotTypeVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetSlotTypeVersionsPagesWithContext same as GetSlotTypeVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetSlotTypeVersionsPagesWithContext(ctx aws.Context, input *GetSlotTypeVersionsInput, fn func(*GetSlotTypeVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetSlotTypeVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetSlotTypeVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetSlotTypeVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetSlotTypeVersionsRequest) Paginate(opts ...aws.Option) GetSlotTypeVersionsPager { + return GetSlotTypeVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetSlotTypeVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetSlotTypeVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// GetSlotTypeVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetSlotTypeVersionsPager struct { + aws.Pager +} + +func (p *GetSlotTypeVersionsPager) CurrentPage() *GetSlotTypeVersionsOutput { + return p.Pager.CurrentPage().(*GetSlotTypeVersionsOutput) } const opGetSlotTypes = "GetSlotTypes" @@ -2089,6 +2081,7 @@ const opGetSlotTypes = "GetSlotTypes" type GetSlotTypesRequest struct { *aws.Request Input *GetSlotTypesInput + Copy func(*GetSlotTypesInput) GetSlotTypesRequest } // Send marshals and sends the GetSlotTypes API request. @@ -2143,57 +2136,53 @@ func (c *LexModelBuildingService) GetSlotTypesRequest(input *GetSlotTypesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSlotTypesRequest{Request: req, Input: input} + return GetSlotTypesRequest{Request: req, Input: input, Copy: c.GetSlotTypesRequest} } -// GetSlotTypesPages iterates over the pages of a GetSlotTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetSlotTypes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetSlotTypesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetSlotTypes operation. -// pageNum := 0 -// err := client.GetSlotTypesPages(params, -// func(page *GetSlotTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *LexModelBuildingService) GetSlotTypesPages(input *GetSlotTypesInput, fn func(*GetSlotTypesOutput, bool) bool) error { - return c.GetSlotTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetSlotTypesPagesWithContext same as GetSlotTypesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *LexModelBuildingService) GetSlotTypesPagesWithContext(ctx aws.Context, input *GetSlotTypesInput, fn func(*GetSlotTypesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetSlotTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetSlotTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetSlotTypesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetSlotTypesRequest) Paginate(opts ...aws.Option) GetSlotTypesPager { + return GetSlotTypesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetSlotTypesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetSlotTypesOutput), !p.HasNextPage()) - } - return p.Err() +// GetSlotTypesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetSlotTypesPager struct { + aws.Pager +} + +func (p *GetSlotTypesPager) CurrentPage() *GetSlotTypesOutput { + return p.Pager.CurrentPage().(*GetSlotTypesOutput) } const opGetUtterancesView = "GetUtterancesView" @@ -2202,6 +2191,7 @@ const opGetUtterancesView = "GetUtterancesView" type GetUtterancesViewRequest struct { *aws.Request Input *GetUtterancesViewInput + Copy func(*GetUtterancesViewInput) GetUtterancesViewRequest } // Send marshals and sends the GetUtterancesView API request. @@ -2265,7 +2255,7 @@ func (c *LexModelBuildingService) GetUtterancesViewRequest(input *GetUtterancesV req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetUtterancesViewRequest{Request: req, Input: input} + return GetUtterancesViewRequest{Request: req, Input: input, Copy: c.GetUtterancesViewRequest} } const opPutBot = "PutBot" @@ -2274,6 +2264,7 @@ const opPutBot = "PutBot" type PutBotRequest struct { *aws.Request Input *PutBotInput + Copy func(*PutBotInput) PutBotRequest } // Send marshals and sends the PutBot API request. @@ -2326,7 +2317,7 @@ func (c *LexModelBuildingService) PutBotRequest(input *PutBotInput) PutBotReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutBotRequest{Request: req, Input: input} + return PutBotRequest{Request: req, Input: input, Copy: c.PutBotRequest} } const opPutBotAlias = "PutBotAlias" @@ -2335,6 +2326,7 @@ const opPutBotAlias = "PutBotAlias" type PutBotAliasRequest struct { *aws.Request Input *PutBotAliasInput + Copy func(*PutBotAliasInput) PutBotAliasRequest } // Send marshals and sends the PutBotAlias API request. @@ -2379,7 +2371,7 @@ func (c *LexModelBuildingService) PutBotAliasRequest(input *PutBotAliasInput) Pu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutBotAliasRequest{Request: req, Input: input} + return PutBotAliasRequest{Request: req, Input: input, Copy: c.PutBotAliasRequest} } const opPutIntent = "PutIntent" @@ -2388,6 +2380,7 @@ const opPutIntent = "PutIntent" type PutIntentRequest struct { *aws.Request Input *PutIntentInput + Copy func(*PutIntentInput) PutIntentRequest } // Send marshals and sends the PutIntent API request. @@ -2473,7 +2466,7 @@ func (c *LexModelBuildingService) PutIntentRequest(input *PutIntentInput) PutInt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutIntentRequest{Request: req, Input: input} + return PutIntentRequest{Request: req, Input: input, Copy: c.PutIntentRequest} } const opPutSlotType = "PutSlotType" @@ -2482,6 +2475,7 @@ const opPutSlotType = "PutSlotType" type PutSlotTypeRequest struct { *aws.Request Input *PutSlotTypeInput + Copy func(*PutSlotTypeInput) PutSlotTypeRequest } // Send marshals and sends the PutSlotType API request. @@ -2535,7 +2529,7 @@ func (c *LexModelBuildingService) PutSlotTypeRequest(input *PutSlotTypeInput) Pu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutSlotTypeRequest{Request: req, Input: input} + return PutSlotTypeRequest{Request: req, Input: input, Copy: c.PutSlotTypeRequest} } // Provides information about a bot alias. diff --git a/service/lexmodelbuildingservice/lexmodelbuildingserviceiface/interface.go b/service/lexmodelbuildingservice/lexmodelbuildingserviceiface/interface.go index d563a7fcaaf..03d2a5f282e 100644 --- a/service/lexmodelbuildingservice/lexmodelbuildingserviceiface/interface.go +++ b/service/lexmodelbuildingservice/lexmodelbuildingserviceiface/interface.go @@ -9,7 +9,6 @@ package lexmodelbuildingserviceiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice" ) @@ -93,64 +92,34 @@ type LexModelBuildingServiceAPI interface { GetBotAliasesRequest(*lexmodelbuildingservice.GetBotAliasesInput) lexmodelbuildingservice.GetBotAliasesRequest - GetBotAliasesPages(*lexmodelbuildingservice.GetBotAliasesInput, func(*lexmodelbuildingservice.GetBotAliasesOutput, bool) bool) error - GetBotAliasesPagesWithContext(aws.Context, *lexmodelbuildingservice.GetBotAliasesInput, func(*lexmodelbuildingservice.GetBotAliasesOutput, bool) bool, ...aws.Option) error - GetBotChannelAssociationRequest(*lexmodelbuildingservice.GetBotChannelAssociationInput) lexmodelbuildingservice.GetBotChannelAssociationRequest GetBotChannelAssociationsRequest(*lexmodelbuildingservice.GetBotChannelAssociationsInput) lexmodelbuildingservice.GetBotChannelAssociationsRequest - GetBotChannelAssociationsPages(*lexmodelbuildingservice.GetBotChannelAssociationsInput, func(*lexmodelbuildingservice.GetBotChannelAssociationsOutput, bool) bool) error - GetBotChannelAssociationsPagesWithContext(aws.Context, *lexmodelbuildingservice.GetBotChannelAssociationsInput, func(*lexmodelbuildingservice.GetBotChannelAssociationsOutput, bool) bool, ...aws.Option) error - GetBotVersionsRequest(*lexmodelbuildingservice.GetBotVersionsInput) lexmodelbuildingservice.GetBotVersionsRequest - GetBotVersionsPages(*lexmodelbuildingservice.GetBotVersionsInput, func(*lexmodelbuildingservice.GetBotVersionsOutput, bool) bool) error - GetBotVersionsPagesWithContext(aws.Context, *lexmodelbuildingservice.GetBotVersionsInput, func(*lexmodelbuildingservice.GetBotVersionsOutput, bool) bool, ...aws.Option) error - GetBotsRequest(*lexmodelbuildingservice.GetBotsInput) lexmodelbuildingservice.GetBotsRequest - GetBotsPages(*lexmodelbuildingservice.GetBotsInput, func(*lexmodelbuildingservice.GetBotsOutput, bool) bool) error - GetBotsPagesWithContext(aws.Context, *lexmodelbuildingservice.GetBotsInput, func(*lexmodelbuildingservice.GetBotsOutput, bool) bool, ...aws.Option) error - GetBuiltinIntentRequest(*lexmodelbuildingservice.GetBuiltinIntentInput) lexmodelbuildingservice.GetBuiltinIntentRequest GetBuiltinIntentsRequest(*lexmodelbuildingservice.GetBuiltinIntentsInput) lexmodelbuildingservice.GetBuiltinIntentsRequest - GetBuiltinIntentsPages(*lexmodelbuildingservice.GetBuiltinIntentsInput, func(*lexmodelbuildingservice.GetBuiltinIntentsOutput, bool) bool) error - GetBuiltinIntentsPagesWithContext(aws.Context, *lexmodelbuildingservice.GetBuiltinIntentsInput, func(*lexmodelbuildingservice.GetBuiltinIntentsOutput, bool) bool, ...aws.Option) error - GetBuiltinSlotTypesRequest(*lexmodelbuildingservice.GetBuiltinSlotTypesInput) lexmodelbuildingservice.GetBuiltinSlotTypesRequest - GetBuiltinSlotTypesPages(*lexmodelbuildingservice.GetBuiltinSlotTypesInput, func(*lexmodelbuildingservice.GetBuiltinSlotTypesOutput, bool) bool) error - GetBuiltinSlotTypesPagesWithContext(aws.Context, *lexmodelbuildingservice.GetBuiltinSlotTypesInput, func(*lexmodelbuildingservice.GetBuiltinSlotTypesOutput, bool) bool, ...aws.Option) error - GetExportRequest(*lexmodelbuildingservice.GetExportInput) lexmodelbuildingservice.GetExportRequest GetIntentRequest(*lexmodelbuildingservice.GetIntentInput) lexmodelbuildingservice.GetIntentRequest GetIntentVersionsRequest(*lexmodelbuildingservice.GetIntentVersionsInput) lexmodelbuildingservice.GetIntentVersionsRequest - GetIntentVersionsPages(*lexmodelbuildingservice.GetIntentVersionsInput, func(*lexmodelbuildingservice.GetIntentVersionsOutput, bool) bool) error - GetIntentVersionsPagesWithContext(aws.Context, *lexmodelbuildingservice.GetIntentVersionsInput, func(*lexmodelbuildingservice.GetIntentVersionsOutput, bool) bool, ...aws.Option) error - GetIntentsRequest(*lexmodelbuildingservice.GetIntentsInput) lexmodelbuildingservice.GetIntentsRequest - GetIntentsPages(*lexmodelbuildingservice.GetIntentsInput, func(*lexmodelbuildingservice.GetIntentsOutput, bool) bool) error - GetIntentsPagesWithContext(aws.Context, *lexmodelbuildingservice.GetIntentsInput, func(*lexmodelbuildingservice.GetIntentsOutput, bool) bool, ...aws.Option) error - GetSlotTypeRequest(*lexmodelbuildingservice.GetSlotTypeInput) lexmodelbuildingservice.GetSlotTypeRequest GetSlotTypeVersionsRequest(*lexmodelbuildingservice.GetSlotTypeVersionsInput) lexmodelbuildingservice.GetSlotTypeVersionsRequest - GetSlotTypeVersionsPages(*lexmodelbuildingservice.GetSlotTypeVersionsInput, func(*lexmodelbuildingservice.GetSlotTypeVersionsOutput, bool) bool) error - GetSlotTypeVersionsPagesWithContext(aws.Context, *lexmodelbuildingservice.GetSlotTypeVersionsInput, func(*lexmodelbuildingservice.GetSlotTypeVersionsOutput, bool) bool, ...aws.Option) error - GetSlotTypesRequest(*lexmodelbuildingservice.GetSlotTypesInput) lexmodelbuildingservice.GetSlotTypesRequest - GetSlotTypesPages(*lexmodelbuildingservice.GetSlotTypesInput, func(*lexmodelbuildingservice.GetSlotTypesOutput, bool) bool) error - GetSlotTypesPagesWithContext(aws.Context, *lexmodelbuildingservice.GetSlotTypesInput, func(*lexmodelbuildingservice.GetSlotTypesOutput, bool) bool, ...aws.Option) error - GetUtterancesViewRequest(*lexmodelbuildingservice.GetUtterancesViewInput) lexmodelbuildingservice.GetUtterancesViewRequest PutBotRequest(*lexmodelbuildingservice.PutBotInput) lexmodelbuildingservice.PutBotRequest diff --git a/service/lexruntimeservice/api.go b/service/lexruntimeservice/api.go index de5dc637b41..dda5cf96d29 100644 --- a/service/lexruntimeservice/api.go +++ b/service/lexruntimeservice/api.go @@ -17,6 +17,7 @@ const opPostContent = "PostContent" type PostContentRequest struct { *aws.Request Input *PostContentInput + Copy func(*PostContentInput) PostContentRequest } // Send marshals and sends the PostContent API request. @@ -114,7 +115,7 @@ func (c *LexRuntimeService) PostContentRequest(input *PostContentInput) PostCont req.Handlers.Sign.Remove(v4.SignRequestHandler) handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) req.Handlers.Sign.PushFrontNamed(handler) - return PostContentRequest{Request: req, Input: input} + return PostContentRequest{Request: req, Input: input, Copy: c.PostContentRequest} } const opPostText = "PostText" @@ -123,6 +124,7 @@ const opPostText = "PostText" type PostTextRequest struct { *aws.Request Input *PostTextInput + Copy func(*PostTextInput) PostTextRequest } // Send marshals and sends the PostText API request. @@ -211,7 +213,7 @@ func (c *LexRuntimeService) PostTextRequest(input *PostTextInput) PostTextReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PostTextRequest{Request: req, Input: input} + return PostTextRequest{Request: req, Input: input, Copy: c.PostTextRequest} } // Represents an option to be shown on the client platform (Facebook, Slack, diff --git a/service/lightsail/api.go b/service/lightsail/api.go index de635f33d0b..4e2f254bce8 100644 --- a/service/lightsail/api.go +++ b/service/lightsail/api.go @@ -15,6 +15,7 @@ const opAllocateStaticIp = "AllocateStaticIp" type AllocateStaticIpRequest struct { *aws.Request Input *AllocateStaticIpInput + Copy func(*AllocateStaticIpInput) AllocateStaticIpRequest } // Send marshals and sends the AllocateStaticIp API request. @@ -55,7 +56,7 @@ func (c *Lightsail) AllocateStaticIpRequest(input *AllocateStaticIpInput) Alloca req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AllocateStaticIpRequest{Request: req, Input: input} + return AllocateStaticIpRequest{Request: req, Input: input, Copy: c.AllocateStaticIpRequest} } const opAttachDisk = "AttachDisk" @@ -64,6 +65,7 @@ const opAttachDisk = "AttachDisk" type AttachDiskRequest struct { *aws.Request Input *AttachDiskInput + Copy func(*AttachDiskInput) AttachDiskRequest } // Send marshals and sends the AttachDisk API request. @@ -105,7 +107,7 @@ func (c *Lightsail) AttachDiskRequest(input *AttachDiskInput) AttachDiskRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachDiskRequest{Request: req, Input: input} + return AttachDiskRequest{Request: req, Input: input, Copy: c.AttachDiskRequest} } const opAttachInstancesToLoadBalancer = "AttachInstancesToLoadBalancer" @@ -114,6 +116,7 @@ const opAttachInstancesToLoadBalancer = "AttachInstancesToLoadBalancer" type AttachInstancesToLoadBalancerRequest struct { *aws.Request Input *AttachInstancesToLoadBalancerInput + Copy func(*AttachInstancesToLoadBalancerInput) AttachInstancesToLoadBalancerRequest } // Send marshals and sends the AttachInstancesToLoadBalancer API request. @@ -154,7 +157,7 @@ func (c *Lightsail) AttachInstancesToLoadBalancerRequest(input *AttachInstancesT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachInstancesToLoadBalancerRequest{Request: req, Input: input} + return AttachInstancesToLoadBalancerRequest{Request: req, Input: input, Copy: c.AttachInstancesToLoadBalancerRequest} } const opAttachLoadBalancerTlsCertificate = "AttachLoadBalancerTlsCertificate" @@ -163,6 +166,7 @@ const opAttachLoadBalancerTlsCertificate = "AttachLoadBalancerTlsCertificate" type AttachLoadBalancerTlsCertificateRequest struct { *aws.Request Input *AttachLoadBalancerTlsCertificateInput + Copy func(*AttachLoadBalancerTlsCertificateInput) AttachLoadBalancerTlsCertificateRequest } // Send marshals and sends the AttachLoadBalancerTlsCertificate API request. @@ -205,7 +209,7 @@ func (c *Lightsail) AttachLoadBalancerTlsCertificateRequest(input *AttachLoadBal req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachLoadBalancerTlsCertificateRequest{Request: req, Input: input} + return AttachLoadBalancerTlsCertificateRequest{Request: req, Input: input, Copy: c.AttachLoadBalancerTlsCertificateRequest} } const opAttachStaticIp = "AttachStaticIp" @@ -214,6 +218,7 @@ const opAttachStaticIp = "AttachStaticIp" type AttachStaticIpRequest struct { *aws.Request Input *AttachStaticIpInput + Copy func(*AttachStaticIpInput) AttachStaticIpRequest } // Send marshals and sends the AttachStaticIp API request. @@ -254,7 +259,7 @@ func (c *Lightsail) AttachStaticIpRequest(input *AttachStaticIpInput) AttachStat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AttachStaticIpRequest{Request: req, Input: input} + return AttachStaticIpRequest{Request: req, Input: input, Copy: c.AttachStaticIpRequest} } const opCloseInstancePublicPorts = "CloseInstancePublicPorts" @@ -263,6 +268,7 @@ const opCloseInstancePublicPorts = "CloseInstancePublicPorts" type CloseInstancePublicPortsRequest struct { *aws.Request Input *CloseInstancePublicPortsInput + Copy func(*CloseInstancePublicPortsInput) CloseInstancePublicPortsRequest } // Send marshals and sends the CloseInstancePublicPorts API request. @@ -303,7 +309,7 @@ func (c *Lightsail) CloseInstancePublicPortsRequest(input *CloseInstancePublicPo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CloseInstancePublicPortsRequest{Request: req, Input: input} + return CloseInstancePublicPortsRequest{Request: req, Input: input, Copy: c.CloseInstancePublicPortsRequest} } const opCreateDisk = "CreateDisk" @@ -312,6 +318,7 @@ const opCreateDisk = "CreateDisk" type CreateDiskRequest struct { *aws.Request Input *CreateDiskInput + Copy func(*CreateDiskInput) CreateDiskRequest } // Send marshals and sends the CreateDisk API request. @@ -355,7 +362,7 @@ func (c *Lightsail) CreateDiskRequest(input *CreateDiskInput) CreateDiskRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDiskRequest{Request: req, Input: input} + return CreateDiskRequest{Request: req, Input: input, Copy: c.CreateDiskRequest} } const opCreateDiskFromSnapshot = "CreateDiskFromSnapshot" @@ -364,6 +371,7 @@ const opCreateDiskFromSnapshot = "CreateDiskFromSnapshot" type CreateDiskFromSnapshotRequest struct { *aws.Request Input *CreateDiskFromSnapshotInput + Copy func(*CreateDiskFromSnapshotInput) CreateDiskFromSnapshotRequest } // Send marshals and sends the CreateDiskFromSnapshot API request. @@ -407,7 +415,7 @@ func (c *Lightsail) CreateDiskFromSnapshotRequest(input *CreateDiskFromSnapshotI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDiskFromSnapshotRequest{Request: req, Input: input} + return CreateDiskFromSnapshotRequest{Request: req, Input: input, Copy: c.CreateDiskFromSnapshotRequest} } const opCreateDiskSnapshot = "CreateDiskSnapshot" @@ -416,6 +424,7 @@ const opCreateDiskSnapshot = "CreateDiskSnapshot" type CreateDiskSnapshotRequest struct { *aws.Request Input *CreateDiskSnapshotInput + Copy func(*CreateDiskSnapshotInput) CreateDiskSnapshotRequest } // Send marshals and sends the CreateDiskSnapshot API request. @@ -469,7 +478,7 @@ func (c *Lightsail) CreateDiskSnapshotRequest(input *CreateDiskSnapshotInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDiskSnapshotRequest{Request: req, Input: input} + return CreateDiskSnapshotRequest{Request: req, Input: input, Copy: c.CreateDiskSnapshotRequest} } const opCreateDomain = "CreateDomain" @@ -478,6 +487,7 @@ const opCreateDomain = "CreateDomain" type CreateDomainRequest struct { *aws.Request Input *CreateDomainInput + Copy func(*CreateDomainInput) CreateDomainRequest } // Send marshals and sends the CreateDomain API request. @@ -518,7 +528,7 @@ func (c *Lightsail) CreateDomainRequest(input *CreateDomainInput) CreateDomainRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDomainRequest{Request: req, Input: input} + return CreateDomainRequest{Request: req, Input: input, Copy: c.CreateDomainRequest} } const opCreateDomainEntry = "CreateDomainEntry" @@ -527,6 +537,7 @@ const opCreateDomainEntry = "CreateDomainEntry" type CreateDomainEntryRequest struct { *aws.Request Input *CreateDomainEntryInput + Copy func(*CreateDomainEntryInput) CreateDomainEntryRequest } // Send marshals and sends the CreateDomainEntry API request. @@ -568,7 +579,7 @@ func (c *Lightsail) CreateDomainEntryRequest(input *CreateDomainEntryInput) Crea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDomainEntryRequest{Request: req, Input: input} + return CreateDomainEntryRequest{Request: req, Input: input, Copy: c.CreateDomainEntryRequest} } const opCreateInstanceSnapshot = "CreateInstanceSnapshot" @@ -577,6 +588,7 @@ const opCreateInstanceSnapshot = "CreateInstanceSnapshot" type CreateInstanceSnapshotRequest struct { *aws.Request Input *CreateInstanceSnapshotInput + Copy func(*CreateInstanceSnapshotInput) CreateInstanceSnapshotRequest } // Send marshals and sends the CreateInstanceSnapshot API request. @@ -618,7 +630,7 @@ func (c *Lightsail) CreateInstanceSnapshotRequest(input *CreateInstanceSnapshotI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInstanceSnapshotRequest{Request: req, Input: input} + return CreateInstanceSnapshotRequest{Request: req, Input: input, Copy: c.CreateInstanceSnapshotRequest} } const opCreateInstances = "CreateInstances" @@ -627,6 +639,7 @@ const opCreateInstances = "CreateInstances" type CreateInstancesRequest struct { *aws.Request Input *CreateInstancesInput + Copy func(*CreateInstancesInput) CreateInstancesRequest } // Send marshals and sends the CreateInstances API request. @@ -667,7 +680,7 @@ func (c *Lightsail) CreateInstancesRequest(input *CreateInstancesInput) CreateIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInstancesRequest{Request: req, Input: input} + return CreateInstancesRequest{Request: req, Input: input, Copy: c.CreateInstancesRequest} } const opCreateInstancesFromSnapshot = "CreateInstancesFromSnapshot" @@ -676,6 +689,7 @@ const opCreateInstancesFromSnapshot = "CreateInstancesFromSnapshot" type CreateInstancesFromSnapshotRequest struct { *aws.Request Input *CreateInstancesFromSnapshotInput + Copy func(*CreateInstancesFromSnapshotInput) CreateInstancesFromSnapshotRequest } // Send marshals and sends the CreateInstancesFromSnapshot API request. @@ -717,7 +731,7 @@ func (c *Lightsail) CreateInstancesFromSnapshotRequest(input *CreateInstancesFro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInstancesFromSnapshotRequest{Request: req, Input: input} + return CreateInstancesFromSnapshotRequest{Request: req, Input: input, Copy: c.CreateInstancesFromSnapshotRequest} } const opCreateKeyPair = "CreateKeyPair" @@ -726,6 +740,7 @@ const opCreateKeyPair = "CreateKeyPair" type CreateKeyPairRequest struct { *aws.Request Input *CreateKeyPairInput + Copy func(*CreateKeyPairInput) CreateKeyPairRequest } // Send marshals and sends the CreateKeyPair API request. @@ -766,7 +781,7 @@ func (c *Lightsail) CreateKeyPairRequest(input *CreateKeyPairInput) CreateKeyPai req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateKeyPairRequest{Request: req, Input: input} + return CreateKeyPairRequest{Request: req, Input: input, Copy: c.CreateKeyPairRequest} } const opCreateLoadBalancer = "CreateLoadBalancer" @@ -775,6 +790,7 @@ const opCreateLoadBalancer = "CreateLoadBalancer" type CreateLoadBalancerRequest struct { *aws.Request Input *CreateLoadBalancerInput + Copy func(*CreateLoadBalancerInput) CreateLoadBalancerRequest } // Send marshals and sends the CreateLoadBalancer API request. @@ -818,7 +834,7 @@ func (c *Lightsail) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLoadBalancerRequest{Request: req, Input: input} + return CreateLoadBalancerRequest{Request: req, Input: input, Copy: c.CreateLoadBalancerRequest} } const opCreateLoadBalancerTlsCertificate = "CreateLoadBalancerTlsCertificate" @@ -827,6 +843,7 @@ const opCreateLoadBalancerTlsCertificate = "CreateLoadBalancerTlsCertificate" type CreateLoadBalancerTlsCertificateRequest struct { *aws.Request Input *CreateLoadBalancerTlsCertificateInput + Copy func(*CreateLoadBalancerTlsCertificateInput) CreateLoadBalancerTlsCertificateRequest } // Send marshals and sends the CreateLoadBalancerTlsCertificate API request. @@ -869,7 +886,7 @@ func (c *Lightsail) CreateLoadBalancerTlsCertificateRequest(input *CreateLoadBal req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLoadBalancerTlsCertificateRequest{Request: req, Input: input} + return CreateLoadBalancerTlsCertificateRequest{Request: req, Input: input, Copy: c.CreateLoadBalancerTlsCertificateRequest} } const opDeleteDisk = "DeleteDisk" @@ -878,6 +895,7 @@ const opDeleteDisk = "DeleteDisk" type DeleteDiskRequest struct { *aws.Request Input *DeleteDiskInput + Copy func(*DeleteDiskInput) DeleteDiskRequest } // Send marshals and sends the DeleteDisk API request. @@ -921,7 +939,7 @@ func (c *Lightsail) DeleteDiskRequest(input *DeleteDiskInput) DeleteDiskRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDiskRequest{Request: req, Input: input} + return DeleteDiskRequest{Request: req, Input: input, Copy: c.DeleteDiskRequest} } const opDeleteDiskSnapshot = "DeleteDiskSnapshot" @@ -930,6 +948,7 @@ const opDeleteDiskSnapshot = "DeleteDiskSnapshot" type DeleteDiskSnapshotRequest struct { *aws.Request Input *DeleteDiskSnapshotInput + Copy func(*DeleteDiskSnapshotInput) DeleteDiskSnapshotRequest } // Send marshals and sends the DeleteDiskSnapshot API request. @@ -977,7 +996,7 @@ func (c *Lightsail) DeleteDiskSnapshotRequest(input *DeleteDiskSnapshotInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDiskSnapshotRequest{Request: req, Input: input} + return DeleteDiskSnapshotRequest{Request: req, Input: input, Copy: c.DeleteDiskSnapshotRequest} } const opDeleteDomain = "DeleteDomain" @@ -986,6 +1005,7 @@ const opDeleteDomain = "DeleteDomain" type DeleteDomainRequest struct { *aws.Request Input *DeleteDomainInput + Copy func(*DeleteDomainInput) DeleteDomainRequest } // Send marshals and sends the DeleteDomain API request. @@ -1026,7 +1046,7 @@ func (c *Lightsail) DeleteDomainRequest(input *DeleteDomainInput) DeleteDomainRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDomainRequest{Request: req, Input: input} + return DeleteDomainRequest{Request: req, Input: input, Copy: c.DeleteDomainRequest} } const opDeleteDomainEntry = "DeleteDomainEntry" @@ -1035,6 +1055,7 @@ const opDeleteDomainEntry = "DeleteDomainEntry" type DeleteDomainEntryRequest struct { *aws.Request Input *DeleteDomainEntryInput + Copy func(*DeleteDomainEntryInput) DeleteDomainEntryRequest } // Send marshals and sends the DeleteDomainEntry API request. @@ -1075,7 +1096,7 @@ func (c *Lightsail) DeleteDomainEntryRequest(input *DeleteDomainEntryInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDomainEntryRequest{Request: req, Input: input} + return DeleteDomainEntryRequest{Request: req, Input: input, Copy: c.DeleteDomainEntryRequest} } const opDeleteInstance = "DeleteInstance" @@ -1084,6 +1105,7 @@ const opDeleteInstance = "DeleteInstance" type DeleteInstanceRequest struct { *aws.Request Input *DeleteInstanceInput + Copy func(*DeleteInstanceInput) DeleteInstanceRequest } // Send marshals and sends the DeleteInstance API request. @@ -1124,7 +1146,7 @@ func (c *Lightsail) DeleteInstanceRequest(input *DeleteInstanceInput) DeleteInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteInstanceRequest{Request: req, Input: input} + return DeleteInstanceRequest{Request: req, Input: input, Copy: c.DeleteInstanceRequest} } const opDeleteInstanceSnapshot = "DeleteInstanceSnapshot" @@ -1133,6 +1155,7 @@ const opDeleteInstanceSnapshot = "DeleteInstanceSnapshot" type DeleteInstanceSnapshotRequest struct { *aws.Request Input *DeleteInstanceSnapshotInput + Copy func(*DeleteInstanceSnapshotInput) DeleteInstanceSnapshotRequest } // Send marshals and sends the DeleteInstanceSnapshot API request. @@ -1173,7 +1196,7 @@ func (c *Lightsail) DeleteInstanceSnapshotRequest(input *DeleteInstanceSnapshotI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteInstanceSnapshotRequest{Request: req, Input: input} + return DeleteInstanceSnapshotRequest{Request: req, Input: input, Copy: c.DeleteInstanceSnapshotRequest} } const opDeleteKeyPair = "DeleteKeyPair" @@ -1182,6 +1205,7 @@ const opDeleteKeyPair = "DeleteKeyPair" type DeleteKeyPairRequest struct { *aws.Request Input *DeleteKeyPairInput + Copy func(*DeleteKeyPairInput) DeleteKeyPairRequest } // Send marshals and sends the DeleteKeyPair API request. @@ -1222,7 +1246,7 @@ func (c *Lightsail) DeleteKeyPairRequest(input *DeleteKeyPairInput) DeleteKeyPai req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteKeyPairRequest{Request: req, Input: input} + return DeleteKeyPairRequest{Request: req, Input: input, Copy: c.DeleteKeyPairRequest} } const opDeleteLoadBalancer = "DeleteLoadBalancer" @@ -1231,6 +1255,7 @@ const opDeleteLoadBalancer = "DeleteLoadBalancer" type DeleteLoadBalancerRequest struct { *aws.Request Input *DeleteLoadBalancerInput + Copy func(*DeleteLoadBalancerInput) DeleteLoadBalancerRequest } // Send marshals and sends the DeleteLoadBalancer API request. @@ -1271,7 +1296,7 @@ func (c *Lightsail) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLoadBalancerRequest{Request: req, Input: input} + return DeleteLoadBalancerRequest{Request: req, Input: input, Copy: c.DeleteLoadBalancerRequest} } const opDeleteLoadBalancerTlsCertificate = "DeleteLoadBalancerTlsCertificate" @@ -1280,6 +1305,7 @@ const opDeleteLoadBalancerTlsCertificate = "DeleteLoadBalancerTlsCertificate" type DeleteLoadBalancerTlsCertificateRequest struct { *aws.Request Input *DeleteLoadBalancerTlsCertificateInput + Copy func(*DeleteLoadBalancerTlsCertificateInput) DeleteLoadBalancerTlsCertificateRequest } // Send marshals and sends the DeleteLoadBalancerTlsCertificate API request. @@ -1320,7 +1346,7 @@ func (c *Lightsail) DeleteLoadBalancerTlsCertificateRequest(input *DeleteLoadBal req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLoadBalancerTlsCertificateRequest{Request: req, Input: input} + return DeleteLoadBalancerTlsCertificateRequest{Request: req, Input: input, Copy: c.DeleteLoadBalancerTlsCertificateRequest} } const opDetachDisk = "DetachDisk" @@ -1329,6 +1355,7 @@ const opDetachDisk = "DetachDisk" type DetachDiskRequest struct { *aws.Request Input *DetachDiskInput + Copy func(*DetachDiskInput) DetachDiskRequest } // Send marshals and sends the DetachDisk API request. @@ -1371,7 +1398,7 @@ func (c *Lightsail) DetachDiskRequest(input *DetachDiskInput) DetachDiskRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachDiskRequest{Request: req, Input: input} + return DetachDiskRequest{Request: req, Input: input, Copy: c.DetachDiskRequest} } const opDetachInstancesFromLoadBalancer = "DetachInstancesFromLoadBalancer" @@ -1380,6 +1407,7 @@ const opDetachInstancesFromLoadBalancer = "DetachInstancesFromLoadBalancer" type DetachInstancesFromLoadBalancerRequest struct { *aws.Request Input *DetachInstancesFromLoadBalancerInput + Copy func(*DetachInstancesFromLoadBalancerInput) DetachInstancesFromLoadBalancerRequest } // Send marshals and sends the DetachInstancesFromLoadBalancer API request. @@ -1420,7 +1448,7 @@ func (c *Lightsail) DetachInstancesFromLoadBalancerRequest(input *DetachInstance req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachInstancesFromLoadBalancerRequest{Request: req, Input: input} + return DetachInstancesFromLoadBalancerRequest{Request: req, Input: input, Copy: c.DetachInstancesFromLoadBalancerRequest} } const opDetachStaticIp = "DetachStaticIp" @@ -1429,6 +1457,7 @@ const opDetachStaticIp = "DetachStaticIp" type DetachStaticIpRequest struct { *aws.Request Input *DetachStaticIpInput + Copy func(*DetachStaticIpInput) DetachStaticIpRequest } // Send marshals and sends the DetachStaticIp API request. @@ -1469,7 +1498,7 @@ func (c *Lightsail) DetachStaticIpRequest(input *DetachStaticIpInput) DetachStat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetachStaticIpRequest{Request: req, Input: input} + return DetachStaticIpRequest{Request: req, Input: input, Copy: c.DetachStaticIpRequest} } const opDownloadDefaultKeyPair = "DownloadDefaultKeyPair" @@ -1478,6 +1507,7 @@ const opDownloadDefaultKeyPair = "DownloadDefaultKeyPair" type DownloadDefaultKeyPairRequest struct { *aws.Request Input *DownloadDefaultKeyPairInput + Copy func(*DownloadDefaultKeyPairInput) DownloadDefaultKeyPairRequest } // Send marshals and sends the DownloadDefaultKeyPair API request. @@ -1518,7 +1548,7 @@ func (c *Lightsail) DownloadDefaultKeyPairRequest(input *DownloadDefaultKeyPairI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DownloadDefaultKeyPairRequest{Request: req, Input: input} + return DownloadDefaultKeyPairRequest{Request: req, Input: input, Copy: c.DownloadDefaultKeyPairRequest} } const opGetActiveNames = "GetActiveNames" @@ -1527,6 +1557,7 @@ const opGetActiveNames = "GetActiveNames" type GetActiveNamesRequest struct { *aws.Request Input *GetActiveNamesInput + Copy func(*GetActiveNamesInput) GetActiveNamesRequest } // Send marshals and sends the GetActiveNames API request. @@ -1567,7 +1598,7 @@ func (c *Lightsail) GetActiveNamesRequest(input *GetActiveNamesInput) GetActiveN req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetActiveNamesRequest{Request: req, Input: input} + return GetActiveNamesRequest{Request: req, Input: input, Copy: c.GetActiveNamesRequest} } const opGetBlueprints = "GetBlueprints" @@ -1576,6 +1607,7 @@ const opGetBlueprints = "GetBlueprints" type GetBlueprintsRequest struct { *aws.Request Input *GetBlueprintsInput + Copy func(*GetBlueprintsInput) GetBlueprintsRequest } // Send marshals and sends the GetBlueprints API request. @@ -1619,7 +1651,7 @@ func (c *Lightsail) GetBlueprintsRequest(input *GetBlueprintsInput) GetBlueprint req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBlueprintsRequest{Request: req, Input: input} + return GetBlueprintsRequest{Request: req, Input: input, Copy: c.GetBlueprintsRequest} } const opGetBundles = "GetBundles" @@ -1628,6 +1660,7 @@ const opGetBundles = "GetBundles" type GetBundlesRequest struct { *aws.Request Input *GetBundlesInput + Copy func(*GetBundlesInput) GetBundlesRequest } // Send marshals and sends the GetBundles API request. @@ -1669,7 +1702,7 @@ func (c *Lightsail) GetBundlesRequest(input *GetBundlesInput) GetBundlesRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBundlesRequest{Request: req, Input: input} + return GetBundlesRequest{Request: req, Input: input, Copy: c.GetBundlesRequest} } const opGetDisk = "GetDisk" @@ -1678,6 +1711,7 @@ const opGetDisk = "GetDisk" type GetDiskRequest struct { *aws.Request Input *GetDiskInput + Copy func(*GetDiskInput) GetDiskRequest } // Send marshals and sends the GetDisk API request. @@ -1718,7 +1752,7 @@ func (c *Lightsail) GetDiskRequest(input *GetDiskInput) GetDiskRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDiskRequest{Request: req, Input: input} + return GetDiskRequest{Request: req, Input: input, Copy: c.GetDiskRequest} } const opGetDiskSnapshot = "GetDiskSnapshot" @@ -1727,6 +1761,7 @@ const opGetDiskSnapshot = "GetDiskSnapshot" type GetDiskSnapshotRequest struct { *aws.Request Input *GetDiskSnapshotInput + Copy func(*GetDiskSnapshotInput) GetDiskSnapshotRequest } // Send marshals and sends the GetDiskSnapshot API request. @@ -1767,7 +1802,7 @@ func (c *Lightsail) GetDiskSnapshotRequest(input *GetDiskSnapshotInput) GetDiskS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDiskSnapshotRequest{Request: req, Input: input} + return GetDiskSnapshotRequest{Request: req, Input: input, Copy: c.GetDiskSnapshotRequest} } const opGetDiskSnapshots = "GetDiskSnapshots" @@ -1776,6 +1811,7 @@ const opGetDiskSnapshots = "GetDiskSnapshots" type GetDiskSnapshotsRequest struct { *aws.Request Input *GetDiskSnapshotsInput + Copy func(*GetDiskSnapshotsInput) GetDiskSnapshotsRequest } // Send marshals and sends the GetDiskSnapshots API request. @@ -1821,7 +1857,7 @@ func (c *Lightsail) GetDiskSnapshotsRequest(input *GetDiskSnapshotsInput) GetDis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDiskSnapshotsRequest{Request: req, Input: input} + return GetDiskSnapshotsRequest{Request: req, Input: input, Copy: c.GetDiskSnapshotsRequest} } const opGetDisks = "GetDisks" @@ -1830,6 +1866,7 @@ const opGetDisks = "GetDisks" type GetDisksRequest struct { *aws.Request Input *GetDisksInput + Copy func(*GetDisksInput) GetDisksRequest } // Send marshals and sends the GetDisks API request. @@ -1875,7 +1912,7 @@ func (c *Lightsail) GetDisksRequest(input *GetDisksInput) GetDisksRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDisksRequest{Request: req, Input: input} + return GetDisksRequest{Request: req, Input: input, Copy: c.GetDisksRequest} } const opGetDomain = "GetDomain" @@ -1884,6 +1921,7 @@ const opGetDomain = "GetDomain" type GetDomainRequest struct { *aws.Request Input *GetDomainInput + Copy func(*GetDomainInput) GetDomainRequest } // Send marshals and sends the GetDomain API request. @@ -1924,7 +1962,7 @@ func (c *Lightsail) GetDomainRequest(input *GetDomainInput) GetDomainRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDomainRequest{Request: req, Input: input} + return GetDomainRequest{Request: req, Input: input, Copy: c.GetDomainRequest} } const opGetDomains = "GetDomains" @@ -1933,6 +1971,7 @@ const opGetDomains = "GetDomains" type GetDomainsRequest struct { *aws.Request Input *GetDomainsInput + Copy func(*GetDomainsInput) GetDomainsRequest } // Send marshals and sends the GetDomains API request. @@ -1973,7 +2012,7 @@ func (c *Lightsail) GetDomainsRequest(input *GetDomainsInput) GetDomainsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDomainsRequest{Request: req, Input: input} + return GetDomainsRequest{Request: req, Input: input, Copy: c.GetDomainsRequest} } const opGetInstance = "GetInstance" @@ -1982,6 +2021,7 @@ const opGetInstance = "GetInstance" type GetInstanceRequest struct { *aws.Request Input *GetInstanceInput + Copy func(*GetInstanceInput) GetInstanceRequest } // Send marshals and sends the GetInstance API request. @@ -2023,7 +2063,7 @@ func (c *Lightsail) GetInstanceRequest(input *GetInstanceInput) GetInstanceReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstanceRequest{Request: req, Input: input} + return GetInstanceRequest{Request: req, Input: input, Copy: c.GetInstanceRequest} } const opGetInstanceAccessDetails = "GetInstanceAccessDetails" @@ -2032,6 +2072,7 @@ const opGetInstanceAccessDetails = "GetInstanceAccessDetails" type GetInstanceAccessDetailsRequest struct { *aws.Request Input *GetInstanceAccessDetailsInput + Copy func(*GetInstanceAccessDetailsInput) GetInstanceAccessDetailsRequest } // Send marshals and sends the GetInstanceAccessDetails API request. @@ -2073,7 +2114,7 @@ func (c *Lightsail) GetInstanceAccessDetailsRequest(input *GetInstanceAccessDeta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstanceAccessDetailsRequest{Request: req, Input: input} + return GetInstanceAccessDetailsRequest{Request: req, Input: input, Copy: c.GetInstanceAccessDetailsRequest} } const opGetInstanceMetricData = "GetInstanceMetricData" @@ -2082,6 +2123,7 @@ const opGetInstanceMetricData = "GetInstanceMetricData" type GetInstanceMetricDataRequest struct { *aws.Request Input *GetInstanceMetricDataInput + Copy func(*GetInstanceMetricDataInput) GetInstanceMetricDataRequest } // Send marshals and sends the GetInstanceMetricData API request. @@ -2123,7 +2165,7 @@ func (c *Lightsail) GetInstanceMetricDataRequest(input *GetInstanceMetricDataInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstanceMetricDataRequest{Request: req, Input: input} + return GetInstanceMetricDataRequest{Request: req, Input: input, Copy: c.GetInstanceMetricDataRequest} } const opGetInstancePortStates = "GetInstancePortStates" @@ -2132,6 +2174,7 @@ const opGetInstancePortStates = "GetInstancePortStates" type GetInstancePortStatesRequest struct { *aws.Request Input *GetInstancePortStatesInput + Copy func(*GetInstancePortStatesInput) GetInstancePortStatesRequest } // Send marshals and sends the GetInstancePortStates API request. @@ -2172,7 +2215,7 @@ func (c *Lightsail) GetInstancePortStatesRequest(input *GetInstancePortStatesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstancePortStatesRequest{Request: req, Input: input} + return GetInstancePortStatesRequest{Request: req, Input: input, Copy: c.GetInstancePortStatesRequest} } const opGetInstanceSnapshot = "GetInstanceSnapshot" @@ -2181,6 +2224,7 @@ const opGetInstanceSnapshot = "GetInstanceSnapshot" type GetInstanceSnapshotRequest struct { *aws.Request Input *GetInstanceSnapshotInput + Copy func(*GetInstanceSnapshotInput) GetInstanceSnapshotRequest } // Send marshals and sends the GetInstanceSnapshot API request. @@ -2221,7 +2265,7 @@ func (c *Lightsail) GetInstanceSnapshotRequest(input *GetInstanceSnapshotInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstanceSnapshotRequest{Request: req, Input: input} + return GetInstanceSnapshotRequest{Request: req, Input: input, Copy: c.GetInstanceSnapshotRequest} } const opGetInstanceSnapshots = "GetInstanceSnapshots" @@ -2230,6 +2274,7 @@ const opGetInstanceSnapshots = "GetInstanceSnapshots" type GetInstanceSnapshotsRequest struct { *aws.Request Input *GetInstanceSnapshotsInput + Copy func(*GetInstanceSnapshotsInput) GetInstanceSnapshotsRequest } // Send marshals and sends the GetInstanceSnapshots API request. @@ -2270,7 +2315,7 @@ func (c *Lightsail) GetInstanceSnapshotsRequest(input *GetInstanceSnapshotsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstanceSnapshotsRequest{Request: req, Input: input} + return GetInstanceSnapshotsRequest{Request: req, Input: input, Copy: c.GetInstanceSnapshotsRequest} } const opGetInstanceState = "GetInstanceState" @@ -2279,6 +2324,7 @@ const opGetInstanceState = "GetInstanceState" type GetInstanceStateRequest struct { *aws.Request Input *GetInstanceStateInput + Copy func(*GetInstanceStateInput) GetInstanceStateRequest } // Send marshals and sends the GetInstanceState API request. @@ -2319,7 +2365,7 @@ func (c *Lightsail) GetInstanceStateRequest(input *GetInstanceStateInput) GetIns req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstanceStateRequest{Request: req, Input: input} + return GetInstanceStateRequest{Request: req, Input: input, Copy: c.GetInstanceStateRequest} } const opGetInstances = "GetInstances" @@ -2328,6 +2374,7 @@ const opGetInstances = "GetInstances" type GetInstancesRequest struct { *aws.Request Input *GetInstancesInput + Copy func(*GetInstancesInput) GetInstancesRequest } // Send marshals and sends the GetInstances API request. @@ -2369,7 +2416,7 @@ func (c *Lightsail) GetInstancesRequest(input *GetInstancesInput) GetInstancesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstancesRequest{Request: req, Input: input} + return GetInstancesRequest{Request: req, Input: input, Copy: c.GetInstancesRequest} } const opGetKeyPair = "GetKeyPair" @@ -2378,6 +2425,7 @@ const opGetKeyPair = "GetKeyPair" type GetKeyPairRequest struct { *aws.Request Input *GetKeyPairInput + Copy func(*GetKeyPairInput) GetKeyPairRequest } // Send marshals and sends the GetKeyPair API request. @@ -2418,7 +2466,7 @@ func (c *Lightsail) GetKeyPairRequest(input *GetKeyPairInput) GetKeyPairRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetKeyPairRequest{Request: req, Input: input} + return GetKeyPairRequest{Request: req, Input: input, Copy: c.GetKeyPairRequest} } const opGetKeyPairs = "GetKeyPairs" @@ -2427,6 +2475,7 @@ const opGetKeyPairs = "GetKeyPairs" type GetKeyPairsRequest struct { *aws.Request Input *GetKeyPairsInput + Copy func(*GetKeyPairsInput) GetKeyPairsRequest } // Send marshals and sends the GetKeyPairs API request. @@ -2467,7 +2516,7 @@ func (c *Lightsail) GetKeyPairsRequest(input *GetKeyPairsInput) GetKeyPairsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetKeyPairsRequest{Request: req, Input: input} + return GetKeyPairsRequest{Request: req, Input: input, Copy: c.GetKeyPairsRequest} } const opGetLoadBalancer = "GetLoadBalancer" @@ -2476,6 +2525,7 @@ const opGetLoadBalancer = "GetLoadBalancer" type GetLoadBalancerRequest struct { *aws.Request Input *GetLoadBalancerInput + Copy func(*GetLoadBalancerInput) GetLoadBalancerRequest } // Send marshals and sends the GetLoadBalancer API request. @@ -2516,7 +2566,7 @@ func (c *Lightsail) GetLoadBalancerRequest(input *GetLoadBalancerInput) GetLoadB req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLoadBalancerRequest{Request: req, Input: input} + return GetLoadBalancerRequest{Request: req, Input: input, Copy: c.GetLoadBalancerRequest} } const opGetLoadBalancerMetricData = "GetLoadBalancerMetricData" @@ -2525,6 +2575,7 @@ const opGetLoadBalancerMetricData = "GetLoadBalancerMetricData" type GetLoadBalancerMetricDataRequest struct { *aws.Request Input *GetLoadBalancerMetricDataInput + Copy func(*GetLoadBalancerMetricDataInput) GetLoadBalancerMetricDataRequest } // Send marshals and sends the GetLoadBalancerMetricData API request. @@ -2565,7 +2616,7 @@ func (c *Lightsail) GetLoadBalancerMetricDataRequest(input *GetLoadBalancerMetri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLoadBalancerMetricDataRequest{Request: req, Input: input} + return GetLoadBalancerMetricDataRequest{Request: req, Input: input, Copy: c.GetLoadBalancerMetricDataRequest} } const opGetLoadBalancerTlsCertificates = "GetLoadBalancerTlsCertificates" @@ -2574,6 +2625,7 @@ const opGetLoadBalancerTlsCertificates = "GetLoadBalancerTlsCertificates" type GetLoadBalancerTlsCertificatesRequest struct { *aws.Request Input *GetLoadBalancerTlsCertificatesInput + Copy func(*GetLoadBalancerTlsCertificatesInput) GetLoadBalancerTlsCertificatesRequest } // Send marshals and sends the GetLoadBalancerTlsCertificates API request. @@ -2617,7 +2669,7 @@ func (c *Lightsail) GetLoadBalancerTlsCertificatesRequest(input *GetLoadBalancer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLoadBalancerTlsCertificatesRequest{Request: req, Input: input} + return GetLoadBalancerTlsCertificatesRequest{Request: req, Input: input, Copy: c.GetLoadBalancerTlsCertificatesRequest} } const opGetLoadBalancers = "GetLoadBalancers" @@ -2626,6 +2678,7 @@ const opGetLoadBalancers = "GetLoadBalancers" type GetLoadBalancersRequest struct { *aws.Request Input *GetLoadBalancersInput + Copy func(*GetLoadBalancersInput) GetLoadBalancersRequest } // Send marshals and sends the GetLoadBalancers API request. @@ -2670,7 +2723,7 @@ func (c *Lightsail) GetLoadBalancersRequest(input *GetLoadBalancersInput) GetLoa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLoadBalancersRequest{Request: req, Input: input} + return GetLoadBalancersRequest{Request: req, Input: input, Copy: c.GetLoadBalancersRequest} } const opGetOperation = "GetOperation" @@ -2679,6 +2732,7 @@ const opGetOperation = "GetOperation" type GetOperationRequest struct { *aws.Request Input *GetOperationInput + Copy func(*GetOperationInput) GetOperationRequest } // Send marshals and sends the GetOperation API request. @@ -2721,7 +2775,7 @@ func (c *Lightsail) GetOperationRequest(input *GetOperationInput) GetOperationRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOperationRequest{Request: req, Input: input} + return GetOperationRequest{Request: req, Input: input, Copy: c.GetOperationRequest} } const opGetOperations = "GetOperations" @@ -2730,6 +2784,7 @@ const opGetOperations = "GetOperations" type GetOperationsRequest struct { *aws.Request Input *GetOperationsInput + Copy func(*GetOperationsInput) GetOperationsRequest } // Send marshals and sends the GetOperations API request. @@ -2774,7 +2829,7 @@ func (c *Lightsail) GetOperationsRequest(input *GetOperationsInput) GetOperation req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOperationsRequest{Request: req, Input: input} + return GetOperationsRequest{Request: req, Input: input, Copy: c.GetOperationsRequest} } const opGetOperationsForResource = "GetOperationsForResource" @@ -2783,6 +2838,7 @@ const opGetOperationsForResource = "GetOperationsForResource" type GetOperationsForResourceRequest struct { *aws.Request Input *GetOperationsForResourceInput + Copy func(*GetOperationsForResourceInput) GetOperationsForResourceRequest } // Send marshals and sends the GetOperationsForResource API request. @@ -2823,7 +2879,7 @@ func (c *Lightsail) GetOperationsForResourceRequest(input *GetOperationsForResou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOperationsForResourceRequest{Request: req, Input: input} + return GetOperationsForResourceRequest{Request: req, Input: input, Copy: c.GetOperationsForResourceRequest} } const opGetRegions = "GetRegions" @@ -2832,6 +2888,7 @@ const opGetRegions = "GetRegions" type GetRegionsRequest struct { *aws.Request Input *GetRegionsInput + Copy func(*GetRegionsInput) GetRegionsRequest } // Send marshals and sends the GetRegions API request. @@ -2873,7 +2930,7 @@ func (c *Lightsail) GetRegionsRequest(input *GetRegionsInput) GetRegionsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRegionsRequest{Request: req, Input: input} + return GetRegionsRequest{Request: req, Input: input, Copy: c.GetRegionsRequest} } const opGetStaticIp = "GetStaticIp" @@ -2882,6 +2939,7 @@ const opGetStaticIp = "GetStaticIp" type GetStaticIpRequest struct { *aws.Request Input *GetStaticIpInput + Copy func(*GetStaticIpInput) GetStaticIpRequest } // Send marshals and sends the GetStaticIp API request. @@ -2922,7 +2980,7 @@ func (c *Lightsail) GetStaticIpRequest(input *GetStaticIpInput) GetStaticIpReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetStaticIpRequest{Request: req, Input: input} + return GetStaticIpRequest{Request: req, Input: input, Copy: c.GetStaticIpRequest} } const opGetStaticIps = "GetStaticIps" @@ -2931,6 +2989,7 @@ const opGetStaticIps = "GetStaticIps" type GetStaticIpsRequest struct { *aws.Request Input *GetStaticIpsInput + Copy func(*GetStaticIpsInput) GetStaticIpsRequest } // Send marshals and sends the GetStaticIps API request. @@ -2971,7 +3030,7 @@ func (c *Lightsail) GetStaticIpsRequest(input *GetStaticIpsInput) GetStaticIpsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetStaticIpsRequest{Request: req, Input: input} + return GetStaticIpsRequest{Request: req, Input: input, Copy: c.GetStaticIpsRequest} } const opImportKeyPair = "ImportKeyPair" @@ -2980,6 +3039,7 @@ const opImportKeyPair = "ImportKeyPair" type ImportKeyPairRequest struct { *aws.Request Input *ImportKeyPairInput + Copy func(*ImportKeyPairInput) ImportKeyPairRequest } // Send marshals and sends the ImportKeyPair API request. @@ -3020,7 +3080,7 @@ func (c *Lightsail) ImportKeyPairRequest(input *ImportKeyPairInput) ImportKeyPai req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportKeyPairRequest{Request: req, Input: input} + return ImportKeyPairRequest{Request: req, Input: input, Copy: c.ImportKeyPairRequest} } const opIsVpcPeered = "IsVpcPeered" @@ -3029,6 +3089,7 @@ const opIsVpcPeered = "IsVpcPeered" type IsVpcPeeredRequest struct { *aws.Request Input *IsVpcPeeredInput + Copy func(*IsVpcPeeredInput) IsVpcPeeredRequest } // Send marshals and sends the IsVpcPeered API request. @@ -3069,7 +3130,7 @@ func (c *Lightsail) IsVpcPeeredRequest(input *IsVpcPeeredInput) IsVpcPeeredReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return IsVpcPeeredRequest{Request: req, Input: input} + return IsVpcPeeredRequest{Request: req, Input: input, Copy: c.IsVpcPeeredRequest} } const opOpenInstancePublicPorts = "OpenInstancePublicPorts" @@ -3078,6 +3139,7 @@ const opOpenInstancePublicPorts = "OpenInstancePublicPorts" type OpenInstancePublicPortsRequest struct { *aws.Request Input *OpenInstancePublicPortsInput + Copy func(*OpenInstancePublicPortsInput) OpenInstancePublicPortsRequest } // Send marshals and sends the OpenInstancePublicPorts API request. @@ -3118,7 +3180,7 @@ func (c *Lightsail) OpenInstancePublicPortsRequest(input *OpenInstancePublicPort req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OpenInstancePublicPortsRequest{Request: req, Input: input} + return OpenInstancePublicPortsRequest{Request: req, Input: input, Copy: c.OpenInstancePublicPortsRequest} } const opPeerVpc = "PeerVpc" @@ -3127,6 +3189,7 @@ const opPeerVpc = "PeerVpc" type PeerVpcRequest struct { *aws.Request Input *PeerVpcInput + Copy func(*PeerVpcInput) PeerVpcRequest } // Send marshals and sends the PeerVpc API request. @@ -3167,7 +3230,7 @@ func (c *Lightsail) PeerVpcRequest(input *PeerVpcInput) PeerVpcRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PeerVpcRequest{Request: req, Input: input} + return PeerVpcRequest{Request: req, Input: input, Copy: c.PeerVpcRequest} } const opPutInstancePublicPorts = "PutInstancePublicPorts" @@ -3176,6 +3239,7 @@ const opPutInstancePublicPorts = "PutInstancePublicPorts" type PutInstancePublicPortsRequest struct { *aws.Request Input *PutInstancePublicPortsInput + Copy func(*PutInstancePublicPortsInput) PutInstancePublicPortsRequest } // Send marshals and sends the PutInstancePublicPorts API request. @@ -3217,7 +3281,7 @@ func (c *Lightsail) PutInstancePublicPortsRequest(input *PutInstancePublicPortsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutInstancePublicPortsRequest{Request: req, Input: input} + return PutInstancePublicPortsRequest{Request: req, Input: input, Copy: c.PutInstancePublicPortsRequest} } const opRebootInstance = "RebootInstance" @@ -3226,6 +3290,7 @@ const opRebootInstance = "RebootInstance" type RebootInstanceRequest struct { *aws.Request Input *RebootInstanceInput + Copy func(*RebootInstanceInput) RebootInstanceRequest } // Send marshals and sends the RebootInstance API request. @@ -3269,7 +3334,7 @@ func (c *Lightsail) RebootInstanceRequest(input *RebootInstanceInput) RebootInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RebootInstanceRequest{Request: req, Input: input} + return RebootInstanceRequest{Request: req, Input: input, Copy: c.RebootInstanceRequest} } const opReleaseStaticIp = "ReleaseStaticIp" @@ -3278,6 +3343,7 @@ const opReleaseStaticIp = "ReleaseStaticIp" type ReleaseStaticIpRequest struct { *aws.Request Input *ReleaseStaticIpInput + Copy func(*ReleaseStaticIpInput) ReleaseStaticIpRequest } // Send marshals and sends the ReleaseStaticIp API request. @@ -3318,7 +3384,7 @@ func (c *Lightsail) ReleaseStaticIpRequest(input *ReleaseStaticIpInput) ReleaseS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReleaseStaticIpRequest{Request: req, Input: input} + return ReleaseStaticIpRequest{Request: req, Input: input, Copy: c.ReleaseStaticIpRequest} } const opStartInstance = "StartInstance" @@ -3327,6 +3393,7 @@ const opStartInstance = "StartInstance" type StartInstanceRequest struct { *aws.Request Input *StartInstanceInput + Copy func(*StartInstanceInput) StartInstanceRequest } // Send marshals and sends the StartInstance API request. @@ -3368,7 +3435,7 @@ func (c *Lightsail) StartInstanceRequest(input *StartInstanceInput) StartInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartInstanceRequest{Request: req, Input: input} + return StartInstanceRequest{Request: req, Input: input, Copy: c.StartInstanceRequest} } const opStopInstance = "StopInstance" @@ -3377,6 +3444,7 @@ const opStopInstance = "StopInstance" type StopInstanceRequest struct { *aws.Request Input *StopInstanceInput + Copy func(*StopInstanceInput) StopInstanceRequest } // Send marshals and sends the StopInstance API request. @@ -3417,7 +3485,7 @@ func (c *Lightsail) StopInstanceRequest(input *StopInstanceInput) StopInstanceRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopInstanceRequest{Request: req, Input: input} + return StopInstanceRequest{Request: req, Input: input, Copy: c.StopInstanceRequest} } const opUnpeerVpc = "UnpeerVpc" @@ -3426,6 +3494,7 @@ const opUnpeerVpc = "UnpeerVpc" type UnpeerVpcRequest struct { *aws.Request Input *UnpeerVpcInput + Copy func(*UnpeerVpcInput) UnpeerVpcRequest } // Send marshals and sends the UnpeerVpc API request. @@ -3466,7 +3535,7 @@ func (c *Lightsail) UnpeerVpcRequest(input *UnpeerVpcInput) UnpeerVpcRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UnpeerVpcRequest{Request: req, Input: input} + return UnpeerVpcRequest{Request: req, Input: input, Copy: c.UnpeerVpcRequest} } const opUpdateDomainEntry = "UpdateDomainEntry" @@ -3475,6 +3544,7 @@ const opUpdateDomainEntry = "UpdateDomainEntry" type UpdateDomainEntryRequest struct { *aws.Request Input *UpdateDomainEntryInput + Copy func(*UpdateDomainEntryInput) UpdateDomainEntryRequest } // Send marshals and sends the UpdateDomainEntry API request. @@ -3515,7 +3585,7 @@ func (c *Lightsail) UpdateDomainEntryRequest(input *UpdateDomainEntryInput) Upda req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDomainEntryRequest{Request: req, Input: input} + return UpdateDomainEntryRequest{Request: req, Input: input, Copy: c.UpdateDomainEntryRequest} } const opUpdateLoadBalancerAttribute = "UpdateLoadBalancerAttribute" @@ -3524,6 +3594,7 @@ const opUpdateLoadBalancerAttribute = "UpdateLoadBalancerAttribute" type UpdateLoadBalancerAttributeRequest struct { *aws.Request Input *UpdateLoadBalancerAttributeInput + Copy func(*UpdateLoadBalancerAttributeInput) UpdateLoadBalancerAttributeRequest } // Send marshals and sends the UpdateLoadBalancerAttribute API request. @@ -3564,7 +3635,7 @@ func (c *Lightsail) UpdateLoadBalancerAttributeRequest(input *UpdateLoadBalancer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateLoadBalancerAttributeRequest{Request: req, Input: input} + return UpdateLoadBalancerAttributeRequest{Request: req, Input: input, Copy: c.UpdateLoadBalancerAttributeRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIpRequest diff --git a/service/machinelearning/api.go b/service/machinelearning/api.go index c174316b11e..9dc1daf0edc 100644 --- a/service/machinelearning/api.go +++ b/service/machinelearning/api.go @@ -16,6 +16,7 @@ const opAddTags = "AddTags" type AddTagsRequest struct { *aws.Request Input *AddTagsInput + Copy func(*AddTagsInput) AddTagsRequest } // Send marshals and sends the AddTags API request. @@ -56,7 +57,7 @@ func (c *MachineLearning) AddTagsRequest(input *AddTagsInput) AddTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsRequest{Request: req, Input: input} + return AddTagsRequest{Request: req, Input: input, Copy: c.AddTagsRequest} } const opCreateBatchPrediction = "CreateBatchPrediction" @@ -65,6 +66,7 @@ const opCreateBatchPrediction = "CreateBatchPrediction" type CreateBatchPredictionRequest struct { *aws.Request Input *CreateBatchPredictionInput + Copy func(*CreateBatchPredictionInput) CreateBatchPredictionRequest } // Send marshals and sends the CreateBatchPrediction API request. @@ -116,7 +118,7 @@ func (c *MachineLearning) CreateBatchPredictionRequest(input *CreateBatchPredict req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBatchPredictionRequest{Request: req, Input: input} + return CreateBatchPredictionRequest{Request: req, Input: input, Copy: c.CreateBatchPredictionRequest} } const opCreateDataSourceFromRDS = "CreateDataSourceFromRDS" @@ -125,6 +127,7 @@ const opCreateDataSourceFromRDS = "CreateDataSourceFromRDS" type CreateDataSourceFromRDSRequest struct { *aws.Request Input *CreateDataSourceFromRDSInput + Copy func(*CreateDataSourceFromRDSInput) CreateDataSourceFromRDSRequest } // Send marshals and sends the CreateDataSourceFromRDS API request. @@ -176,7 +179,7 @@ func (c *MachineLearning) CreateDataSourceFromRDSRequest(input *CreateDataSource req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDataSourceFromRDSRequest{Request: req, Input: input} + return CreateDataSourceFromRDSRequest{Request: req, Input: input, Copy: c.CreateDataSourceFromRDSRequest} } const opCreateDataSourceFromRedshift = "CreateDataSourceFromRedshift" @@ -185,6 +188,7 @@ const opCreateDataSourceFromRedshift = "CreateDataSourceFromRedshift" type CreateDataSourceFromRedshiftRequest struct { *aws.Request Input *CreateDataSourceFromRedshiftInput + Copy func(*CreateDataSourceFromRedshiftInput) CreateDataSourceFromRedshiftRequest } // Send marshals and sends the CreateDataSourceFromRedshift API request. @@ -255,7 +259,7 @@ func (c *MachineLearning) CreateDataSourceFromRedshiftRequest(input *CreateDataS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDataSourceFromRedshiftRequest{Request: req, Input: input} + return CreateDataSourceFromRedshiftRequest{Request: req, Input: input, Copy: c.CreateDataSourceFromRedshiftRequest} } const opCreateDataSourceFromS3 = "CreateDataSourceFromS3" @@ -264,6 +268,7 @@ const opCreateDataSourceFromS3 = "CreateDataSourceFromS3" type CreateDataSourceFromS3Request struct { *aws.Request Input *CreateDataSourceFromS3Input + Copy func(*CreateDataSourceFromS3Input) CreateDataSourceFromS3Request } // Send marshals and sends the CreateDataSourceFromS3 API request. @@ -329,7 +334,7 @@ func (c *MachineLearning) CreateDataSourceFromS3Request(input *CreateDataSourceF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDataSourceFromS3Request{Request: req, Input: input} + return CreateDataSourceFromS3Request{Request: req, Input: input, Copy: c.CreateDataSourceFromS3Request} } const opCreateEvaluation = "CreateEvaluation" @@ -338,6 +343,7 @@ const opCreateEvaluation = "CreateEvaluation" type CreateEvaluationRequest struct { *aws.Request Input *CreateEvaluationInput + Copy func(*CreateEvaluationInput) CreateEvaluationRequest } // Send marshals and sends the CreateEvaluation API request. @@ -391,7 +397,7 @@ func (c *MachineLearning) CreateEvaluationRequest(input *CreateEvaluationInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEvaluationRequest{Request: req, Input: input} + return CreateEvaluationRequest{Request: req, Input: input, Copy: c.CreateEvaluationRequest} } const opCreateMLModel = "CreateMLModel" @@ -400,6 +406,7 @@ const opCreateMLModel = "CreateMLModel" type CreateMLModelRequest struct { *aws.Request Input *CreateMLModelInput + Copy func(*CreateMLModelInput) CreateMLModelRequest } // Send marshals and sends the CreateMLModel API request. @@ -454,7 +461,7 @@ func (c *MachineLearning) CreateMLModelRequest(input *CreateMLModelInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateMLModelRequest{Request: req, Input: input} + return CreateMLModelRequest{Request: req, Input: input, Copy: c.CreateMLModelRequest} } const opCreateRealtimeEndpoint = "CreateRealtimeEndpoint" @@ -463,6 +470,7 @@ const opCreateRealtimeEndpoint = "CreateRealtimeEndpoint" type CreateRealtimeEndpointRequest struct { *aws.Request Input *CreateRealtimeEndpointInput + Copy func(*CreateRealtimeEndpointInput) CreateRealtimeEndpointRequest } // Send marshals and sends the CreateRealtimeEndpoint API request. @@ -503,7 +511,7 @@ func (c *MachineLearning) CreateRealtimeEndpointRequest(input *CreateRealtimeEnd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRealtimeEndpointRequest{Request: req, Input: input} + return CreateRealtimeEndpointRequest{Request: req, Input: input, Copy: c.CreateRealtimeEndpointRequest} } const opDeleteBatchPrediction = "DeleteBatchPrediction" @@ -512,6 +520,7 @@ const opDeleteBatchPrediction = "DeleteBatchPrediction" type DeleteBatchPredictionRequest struct { *aws.Request Input *DeleteBatchPredictionInput + Copy func(*DeleteBatchPredictionInput) DeleteBatchPredictionRequest } // Send marshals and sends the DeleteBatchPrediction API request. @@ -555,7 +564,7 @@ func (c *MachineLearning) DeleteBatchPredictionRequest(input *DeleteBatchPredict req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteBatchPredictionRequest{Request: req, Input: input} + return DeleteBatchPredictionRequest{Request: req, Input: input, Copy: c.DeleteBatchPredictionRequest} } const opDeleteDataSource = "DeleteDataSource" @@ -564,6 +573,7 @@ const opDeleteDataSource = "DeleteDataSource" type DeleteDataSourceRequest struct { *aws.Request Input *DeleteDataSourceInput + Copy func(*DeleteDataSourceInput) DeleteDataSourceRequest } // Send marshals and sends the DeleteDataSource API request. @@ -607,7 +617,7 @@ func (c *MachineLearning) DeleteDataSourceRequest(input *DeleteDataSourceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDataSourceRequest{Request: req, Input: input} + return DeleteDataSourceRequest{Request: req, Input: input, Copy: c.DeleteDataSourceRequest} } const opDeleteEvaluation = "DeleteEvaluation" @@ -616,6 +626,7 @@ const opDeleteEvaluation = "DeleteEvaluation" type DeleteEvaluationRequest struct { *aws.Request Input *DeleteEvaluationInput + Copy func(*DeleteEvaluationInput) DeleteEvaluationRequest } // Send marshals and sends the DeleteEvaluation API request. @@ -659,7 +670,7 @@ func (c *MachineLearning) DeleteEvaluationRequest(input *DeleteEvaluationInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEvaluationRequest{Request: req, Input: input} + return DeleteEvaluationRequest{Request: req, Input: input, Copy: c.DeleteEvaluationRequest} } const opDeleteMLModel = "DeleteMLModel" @@ -668,6 +679,7 @@ const opDeleteMLModel = "DeleteMLModel" type DeleteMLModelRequest struct { *aws.Request Input *DeleteMLModelInput + Copy func(*DeleteMLModelInput) DeleteMLModelRequest } // Send marshals and sends the DeleteMLModel API request. @@ -711,7 +723,7 @@ func (c *MachineLearning) DeleteMLModelRequest(input *DeleteMLModelInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteMLModelRequest{Request: req, Input: input} + return DeleteMLModelRequest{Request: req, Input: input, Copy: c.DeleteMLModelRequest} } const opDeleteRealtimeEndpoint = "DeleteRealtimeEndpoint" @@ -720,6 +732,7 @@ const opDeleteRealtimeEndpoint = "DeleteRealtimeEndpoint" type DeleteRealtimeEndpointRequest struct { *aws.Request Input *DeleteRealtimeEndpointInput + Copy func(*DeleteRealtimeEndpointInput) DeleteRealtimeEndpointRequest } // Send marshals and sends the DeleteRealtimeEndpoint API request. @@ -758,7 +771,7 @@ func (c *MachineLearning) DeleteRealtimeEndpointRequest(input *DeleteRealtimeEnd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRealtimeEndpointRequest{Request: req, Input: input} + return DeleteRealtimeEndpointRequest{Request: req, Input: input, Copy: c.DeleteRealtimeEndpointRequest} } const opDeleteTags = "DeleteTags" @@ -767,6 +780,7 @@ const opDeleteTags = "DeleteTags" type DeleteTagsRequest struct { *aws.Request Input *DeleteTagsInput + Copy func(*DeleteTagsInput) DeleteTagsRequest } // Send marshals and sends the DeleteTags API request. @@ -808,7 +822,7 @@ func (c *MachineLearning) DeleteTagsRequest(input *DeleteTagsInput) DeleteTagsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTagsRequest{Request: req, Input: input} + return DeleteTagsRequest{Request: req, Input: input, Copy: c.DeleteTagsRequest} } const opDescribeBatchPredictions = "DescribeBatchPredictions" @@ -817,6 +831,7 @@ const opDescribeBatchPredictions = "DescribeBatchPredictions" type DescribeBatchPredictionsRequest struct { *aws.Request Input *DescribeBatchPredictionsInput + Copy func(*DescribeBatchPredictionsInput) DescribeBatchPredictionsRequest } // Send marshals and sends the DescribeBatchPredictions API request. @@ -862,57 +877,53 @@ func (c *MachineLearning) DescribeBatchPredictionsRequest(input *DescribeBatchPr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBatchPredictionsRequest{Request: req, Input: input} + return DescribeBatchPredictionsRequest{Request: req, Input: input, Copy: c.DescribeBatchPredictionsRequest} } -// DescribeBatchPredictionsPages iterates over the pages of a DescribeBatchPredictions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeBatchPredictions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeBatchPredictionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeBatchPredictions operation. -// pageNum := 0 -// err := client.DescribeBatchPredictionsPages(params, -// func(page *DescribeBatchPredictionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MachineLearning) DescribeBatchPredictionsPages(input *DescribeBatchPredictionsInput, fn func(*DescribeBatchPredictionsOutput, bool) bool) error { - return c.DescribeBatchPredictionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeBatchPredictionsPagesWithContext same as DescribeBatchPredictionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MachineLearning) DescribeBatchPredictionsPagesWithContext(ctx aws.Context, input *DescribeBatchPredictionsInput, fn func(*DescribeBatchPredictionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeBatchPredictionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeBatchPredictionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeBatchPredictionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeBatchPredictionsRequest) Paginate(opts ...aws.Option) DescribeBatchPredictionsPager { + return DescribeBatchPredictionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeBatchPredictionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeBatchPredictionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeBatchPredictionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeBatchPredictionsPager struct { + aws.Pager +} + +func (p *DescribeBatchPredictionsPager) CurrentPage() *DescribeBatchPredictionsOutput { + return p.Pager.CurrentPage().(*DescribeBatchPredictionsOutput) } const opDescribeDataSources = "DescribeDataSources" @@ -921,6 +932,7 @@ const opDescribeDataSources = "DescribeDataSources" type DescribeDataSourcesRequest struct { *aws.Request Input *DescribeDataSourcesInput + Copy func(*DescribeDataSourcesInput) DescribeDataSourcesRequest } // Send marshals and sends the DescribeDataSources API request. @@ -965,57 +977,53 @@ func (c *MachineLearning) DescribeDataSourcesRequest(input *DescribeDataSourcesI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDataSourcesRequest{Request: req, Input: input} + return DescribeDataSourcesRequest{Request: req, Input: input, Copy: c.DescribeDataSourcesRequest} } -// DescribeDataSourcesPages iterates over the pages of a DescribeDataSources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDataSources method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDataSourcesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDataSources operation. -// pageNum := 0 -// err := client.DescribeDataSourcesPages(params, -// func(page *DescribeDataSourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MachineLearning) DescribeDataSourcesPages(input *DescribeDataSourcesInput, fn func(*DescribeDataSourcesOutput, bool) bool) error { - return c.DescribeDataSourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDataSourcesPagesWithContext same as DescribeDataSourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MachineLearning) DescribeDataSourcesPagesWithContext(ctx aws.Context, input *DescribeDataSourcesInput, fn func(*DescribeDataSourcesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDataSourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDataSourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDataSourcesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDataSourcesRequest) Paginate(opts ...aws.Option) DescribeDataSourcesPager { + return DescribeDataSourcesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDataSourcesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDataSourcesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDataSourcesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDataSourcesPager struct { + aws.Pager +} + +func (p *DescribeDataSourcesPager) CurrentPage() *DescribeDataSourcesOutput { + return p.Pager.CurrentPage().(*DescribeDataSourcesOutput) } const opDescribeEvaluations = "DescribeEvaluations" @@ -1024,6 +1032,7 @@ const opDescribeEvaluations = "DescribeEvaluations" type DescribeEvaluationsRequest struct { *aws.Request Input *DescribeEvaluationsInput + Copy func(*DescribeEvaluationsInput) DescribeEvaluationsRequest } // Send marshals and sends the DescribeEvaluations API request. @@ -1069,57 +1078,53 @@ func (c *MachineLearning) DescribeEvaluationsRequest(input *DescribeEvaluationsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEvaluationsRequest{Request: req, Input: input} + return DescribeEvaluationsRequest{Request: req, Input: input, Copy: c.DescribeEvaluationsRequest} } -// DescribeEvaluationsPages iterates over the pages of a DescribeEvaluations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvaluations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEvaluationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEvaluations operation. -// pageNum := 0 -// err := client.DescribeEvaluationsPages(params, -// func(page *DescribeEvaluationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MachineLearning) DescribeEvaluationsPages(input *DescribeEvaluationsInput, fn func(*DescribeEvaluationsOutput, bool) bool) error { - return c.DescribeEvaluationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEvaluationsPagesWithContext same as DescribeEvaluationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MachineLearning) DescribeEvaluationsPagesWithContext(ctx aws.Context, input *DescribeEvaluationsInput, fn func(*DescribeEvaluationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEvaluationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEvaluationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEvaluationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEvaluationsRequest) Paginate(opts ...aws.Option) DescribeEvaluationsPager { + return DescribeEvaluationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEvaluationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEvaluationsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEvaluationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEvaluationsPager struct { + aws.Pager +} + +func (p *DescribeEvaluationsPager) CurrentPage() *DescribeEvaluationsOutput { + return p.Pager.CurrentPage().(*DescribeEvaluationsOutput) } const opDescribeMLModels = "DescribeMLModels" @@ -1128,6 +1133,7 @@ const opDescribeMLModels = "DescribeMLModels" type DescribeMLModelsRequest struct { *aws.Request Input *DescribeMLModelsInput + Copy func(*DescribeMLModelsInput) DescribeMLModelsRequest } // Send marshals and sends the DescribeMLModels API request. @@ -1172,57 +1178,53 @@ func (c *MachineLearning) DescribeMLModelsRequest(input *DescribeMLModelsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMLModelsRequest{Request: req, Input: input} + return DescribeMLModelsRequest{Request: req, Input: input, Copy: c.DescribeMLModelsRequest} } -// DescribeMLModelsPages iterates over the pages of a DescribeMLModels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeMLModels method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeMLModelsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeMLModels operation. -// pageNum := 0 -// err := client.DescribeMLModelsPages(params, -// func(page *DescribeMLModelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MachineLearning) DescribeMLModelsPages(input *DescribeMLModelsInput, fn func(*DescribeMLModelsOutput, bool) bool) error { - return c.DescribeMLModelsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeMLModelsPagesWithContext same as DescribeMLModelsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MachineLearning) DescribeMLModelsPagesWithContext(ctx aws.Context, input *DescribeMLModelsInput, fn func(*DescribeMLModelsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeMLModelsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeMLModelsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeMLModelsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeMLModelsRequest) Paginate(opts ...aws.Option) DescribeMLModelsPager { + return DescribeMLModelsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeMLModelsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeMLModelsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeMLModelsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeMLModelsPager struct { + aws.Pager +} + +func (p *DescribeMLModelsPager) CurrentPage() *DescribeMLModelsOutput { + return p.Pager.CurrentPage().(*DescribeMLModelsOutput) } const opDescribeTags = "DescribeTags" @@ -1231,6 +1233,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -1269,7 +1272,7 @@ func (c *MachineLearning) DescribeTagsRequest(input *DescribeTagsInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } const opGetBatchPrediction = "GetBatchPrediction" @@ -1278,6 +1281,7 @@ const opGetBatchPrediction = "GetBatchPrediction" type GetBatchPredictionRequest struct { *aws.Request Input *GetBatchPredictionInput + Copy func(*GetBatchPredictionInput) GetBatchPredictionRequest } // Send marshals and sends the GetBatchPrediction API request. @@ -1317,7 +1321,7 @@ func (c *MachineLearning) GetBatchPredictionRequest(input *GetBatchPredictionInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBatchPredictionRequest{Request: req, Input: input} + return GetBatchPredictionRequest{Request: req, Input: input, Copy: c.GetBatchPredictionRequest} } const opGetDataSource = "GetDataSource" @@ -1326,6 +1330,7 @@ const opGetDataSource = "GetDataSource" type GetDataSourceRequest struct { *aws.Request Input *GetDataSourceInput + Copy func(*GetDataSourceInput) GetDataSourceRequest } // Send marshals and sends the GetDataSource API request. @@ -1369,7 +1374,7 @@ func (c *MachineLearning) GetDataSourceRequest(input *GetDataSourceInput) GetDat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDataSourceRequest{Request: req, Input: input} + return GetDataSourceRequest{Request: req, Input: input, Copy: c.GetDataSourceRequest} } const opGetEvaluation = "GetEvaluation" @@ -1378,6 +1383,7 @@ const opGetEvaluation = "GetEvaluation" type GetEvaluationRequest struct { *aws.Request Input *GetEvaluationInput + Copy func(*GetEvaluationInput) GetEvaluationRequest } // Send marshals and sends the GetEvaluation API request. @@ -1417,7 +1423,7 @@ func (c *MachineLearning) GetEvaluationRequest(input *GetEvaluationInput) GetEva req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetEvaluationRequest{Request: req, Input: input} + return GetEvaluationRequest{Request: req, Input: input, Copy: c.GetEvaluationRequest} } const opGetMLModel = "GetMLModel" @@ -1426,6 +1432,7 @@ const opGetMLModel = "GetMLModel" type GetMLModelRequest struct { *aws.Request Input *GetMLModelInput + Copy func(*GetMLModelInput) GetMLModelRequest } // Send marshals and sends the GetMLModel API request. @@ -1467,7 +1474,7 @@ func (c *MachineLearning) GetMLModelRequest(input *GetMLModelInput) GetMLModelRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMLModelRequest{Request: req, Input: input} + return GetMLModelRequest{Request: req, Input: input, Copy: c.GetMLModelRequest} } const opPredict = "Predict" @@ -1476,6 +1483,7 @@ const opPredict = "Predict" type PredictRequest struct { *aws.Request Input *PredictInput + Copy func(*PredictInput) PredictRequest } // Send marshals and sends the Predict API request. @@ -1517,7 +1525,7 @@ func (c *MachineLearning) PredictRequest(input *PredictInput) PredictRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PredictRequest{Request: req, Input: input} + return PredictRequest{Request: req, Input: input, Copy: c.PredictRequest} } const opUpdateBatchPrediction = "UpdateBatchPrediction" @@ -1526,6 +1534,7 @@ const opUpdateBatchPrediction = "UpdateBatchPrediction" type UpdateBatchPredictionRequest struct { *aws.Request Input *UpdateBatchPredictionInput + Copy func(*UpdateBatchPredictionInput) UpdateBatchPredictionRequest } // Send marshals and sends the UpdateBatchPrediction API request. @@ -1567,7 +1576,7 @@ func (c *MachineLearning) UpdateBatchPredictionRequest(input *UpdateBatchPredict req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateBatchPredictionRequest{Request: req, Input: input} + return UpdateBatchPredictionRequest{Request: req, Input: input, Copy: c.UpdateBatchPredictionRequest} } const opUpdateDataSource = "UpdateDataSource" @@ -1576,6 +1585,7 @@ const opUpdateDataSource = "UpdateDataSource" type UpdateDataSourceRequest struct { *aws.Request Input *UpdateDataSourceInput + Copy func(*UpdateDataSourceInput) UpdateDataSourceRequest } // Send marshals and sends the UpdateDataSource API request. @@ -1617,7 +1627,7 @@ func (c *MachineLearning) UpdateDataSourceRequest(input *UpdateDataSourceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDataSourceRequest{Request: req, Input: input} + return UpdateDataSourceRequest{Request: req, Input: input, Copy: c.UpdateDataSourceRequest} } const opUpdateEvaluation = "UpdateEvaluation" @@ -1626,6 +1636,7 @@ const opUpdateEvaluation = "UpdateEvaluation" type UpdateEvaluationRequest struct { *aws.Request Input *UpdateEvaluationInput + Copy func(*UpdateEvaluationInput) UpdateEvaluationRequest } // Send marshals and sends the UpdateEvaluation API request. @@ -1667,7 +1678,7 @@ func (c *MachineLearning) UpdateEvaluationRequest(input *UpdateEvaluationInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEvaluationRequest{Request: req, Input: input} + return UpdateEvaluationRequest{Request: req, Input: input, Copy: c.UpdateEvaluationRequest} } const opUpdateMLModel = "UpdateMLModel" @@ -1676,6 +1687,7 @@ const opUpdateMLModel = "UpdateMLModel" type UpdateMLModelRequest struct { *aws.Request Input *UpdateMLModelInput + Copy func(*UpdateMLModelInput) UpdateMLModelRequest } // Send marshals and sends the UpdateMLModel API request. @@ -1717,7 +1729,7 @@ func (c *MachineLearning) UpdateMLModelRequest(input *UpdateMLModelInput) Update req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateMLModelRequest{Request: req, Input: input} + return UpdateMLModelRequest{Request: req, Input: input, Copy: c.UpdateMLModelRequest} } type AddTagsInput struct { diff --git a/service/machinelearning/machinelearningiface/interface.go b/service/machinelearning/machinelearningiface/interface.go index 61e101300b2..751c66bb776 100644 --- a/service/machinelearning/machinelearningiface/interface.go +++ b/service/machinelearning/machinelearningiface/interface.go @@ -93,24 +93,12 @@ type MachineLearningAPI interface { DescribeBatchPredictionsRequest(*machinelearning.DescribeBatchPredictionsInput) machinelearning.DescribeBatchPredictionsRequest - DescribeBatchPredictionsPages(*machinelearning.DescribeBatchPredictionsInput, func(*machinelearning.DescribeBatchPredictionsOutput, bool) bool) error - DescribeBatchPredictionsPagesWithContext(aws.Context, *machinelearning.DescribeBatchPredictionsInput, func(*machinelearning.DescribeBatchPredictionsOutput, bool) bool, ...aws.Option) error - DescribeDataSourcesRequest(*machinelearning.DescribeDataSourcesInput) machinelearning.DescribeDataSourcesRequest - DescribeDataSourcesPages(*machinelearning.DescribeDataSourcesInput, func(*machinelearning.DescribeDataSourcesOutput, bool) bool) error - DescribeDataSourcesPagesWithContext(aws.Context, *machinelearning.DescribeDataSourcesInput, func(*machinelearning.DescribeDataSourcesOutput, bool) bool, ...aws.Option) error - DescribeEvaluationsRequest(*machinelearning.DescribeEvaluationsInput) machinelearning.DescribeEvaluationsRequest - DescribeEvaluationsPages(*machinelearning.DescribeEvaluationsInput, func(*machinelearning.DescribeEvaluationsOutput, bool) bool) error - DescribeEvaluationsPagesWithContext(aws.Context, *machinelearning.DescribeEvaluationsInput, func(*machinelearning.DescribeEvaluationsOutput, bool) bool, ...aws.Option) error - DescribeMLModelsRequest(*machinelearning.DescribeMLModelsInput) machinelearning.DescribeMLModelsRequest - DescribeMLModelsPages(*machinelearning.DescribeMLModelsInput, func(*machinelearning.DescribeMLModelsOutput, bool) bool) error - DescribeMLModelsPagesWithContext(aws.Context, *machinelearning.DescribeMLModelsInput, func(*machinelearning.DescribeMLModelsOutput, bool) bool, ...aws.Option) error - DescribeTagsRequest(*machinelearning.DescribeTagsInput) machinelearning.DescribeTagsRequest GetBatchPredictionRequest(*machinelearning.GetBatchPredictionInput) machinelearning.GetBatchPredictionRequest diff --git a/service/marketplacecommerceanalytics/api.go b/service/marketplacecommerceanalytics/api.go index 4bf74292ab5..718652e2606 100644 --- a/service/marketplacecommerceanalytics/api.go +++ b/service/marketplacecommerceanalytics/api.go @@ -15,6 +15,7 @@ const opGenerateDataSet = "GenerateDataSet" type GenerateDataSetRequest struct { *aws.Request Input *GenerateDataSetInput + Copy func(*GenerateDataSetInput) GenerateDataSetRequest } // Send marshals and sends the GenerateDataSet API request. @@ -64,7 +65,7 @@ func (c *MarketplaceCommerceAnalytics) GenerateDataSetRequest(input *GenerateDat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GenerateDataSetRequest{Request: req, Input: input} + return GenerateDataSetRequest{Request: req, Input: input, Copy: c.GenerateDataSetRequest} } const opStartSupportDataExport = "StartSupportDataExport" @@ -73,6 +74,7 @@ const opStartSupportDataExport = "StartSupportDataExport" type StartSupportDataExportRequest struct { *aws.Request Input *StartSupportDataExportInput + Copy func(*StartSupportDataExportInput) StartSupportDataExportRequest } // Send marshals and sends the StartSupportDataExport API request. @@ -123,7 +125,7 @@ func (c *MarketplaceCommerceAnalytics) StartSupportDataExportRequest(input *Star req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartSupportDataExportRequest{Request: req, Input: input} + return StartSupportDataExportRequest{Request: req, Input: input, Copy: c.StartSupportDataExportRequest} } // Container for the parameters to the GenerateDataSet operation. diff --git a/service/marketplaceentitlementservice/api.go b/service/marketplaceentitlementservice/api.go index 5ef789a1db5..80b34f88eda 100644 --- a/service/marketplaceentitlementservice/api.go +++ b/service/marketplaceentitlementservice/api.go @@ -15,6 +15,7 @@ const opGetEntitlements = "GetEntitlements" type GetEntitlementsRequest struct { *aws.Request Input *GetEntitlementsInput + Copy func(*GetEntitlementsInput) GetEntitlementsRequest } // Send marshals and sends the GetEntitlements API request. @@ -56,7 +57,7 @@ func (c *MarketplaceEntitlementService) GetEntitlementsRequest(input *GetEntitle req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetEntitlementsRequest{Request: req, Input: input} + return GetEntitlementsRequest{Request: req, Input: input, Copy: c.GetEntitlementsRequest} } // An entitlement represents capacity in a product owned by the customer. For diff --git a/service/marketplacemetering/api.go b/service/marketplacemetering/api.go index 84cf2c9562e..922581e5326 100644 --- a/service/marketplacemetering/api.go +++ b/service/marketplacemetering/api.go @@ -16,6 +16,7 @@ const opBatchMeterUsage = "BatchMeterUsage" type BatchMeterUsageRequest struct { *aws.Request Input *BatchMeterUsageInput + Copy func(*BatchMeterUsageInput) BatchMeterUsageRequest } // Send marshals and sends the BatchMeterUsage API request. @@ -65,7 +66,7 @@ func (c *MarketplaceMetering) BatchMeterUsageRequest(input *BatchMeterUsageInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchMeterUsageRequest{Request: req, Input: input} + return BatchMeterUsageRequest{Request: req, Input: input, Copy: c.BatchMeterUsageRequest} } const opMeterUsage = "MeterUsage" @@ -74,6 +75,7 @@ const opMeterUsage = "MeterUsage" type MeterUsageRequest struct { *aws.Request Input *MeterUsageInput + Copy func(*MeterUsageInput) MeterUsageRequest } // Send marshals and sends the MeterUsage API request. @@ -118,7 +120,7 @@ func (c *MarketplaceMetering) MeterUsageRequest(input *MeterUsageInput) MeterUsa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return MeterUsageRequest{Request: req, Input: input} + return MeterUsageRequest{Request: req, Input: input, Copy: c.MeterUsageRequest} } const opResolveCustomer = "ResolveCustomer" @@ -127,6 +129,7 @@ const opResolveCustomer = "ResolveCustomer" type ResolveCustomerRequest struct { *aws.Request Input *ResolveCustomerInput + Copy func(*ResolveCustomerInput) ResolveCustomerRequest } // Send marshals and sends the ResolveCustomer API request. @@ -170,7 +173,7 @@ func (c *MarketplaceMetering) ResolveCustomerRequest(input *ResolveCustomerInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResolveCustomerRequest{Request: req, Input: input} + return ResolveCustomerRequest{Request: req, Input: input, Copy: c.ResolveCustomerRequest} } // A BatchMeterUsageRequest contains UsageRecords, which indicate quantities diff --git a/service/mediaconvert/api.go b/service/mediaconvert/api.go index c9412ccbc2f..54b0762fc74 100644 --- a/service/mediaconvert/api.go +++ b/service/mediaconvert/api.go @@ -16,6 +16,7 @@ const opCancelJob = "CancelJob" type CancelJobRequest struct { *aws.Request Input *CancelJobInput + Copy func(*CancelJobInput) CancelJobRequest } // Send marshals and sends the CancelJob API request. @@ -57,7 +58,7 @@ func (c *MediaConvert) CancelJobRequest(input *CancelJobInput) CancelJobRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelJobRequest{Request: req, Input: input} + return CancelJobRequest{Request: req, Input: input, Copy: c.CancelJobRequest} } const opCreateJob = "CreateJob" @@ -66,6 +67,7 @@ const opCreateJob = "CreateJob" type CreateJobRequest struct { *aws.Request Input *CreateJobInput + Copy func(*CreateJobInput) CreateJobRequest } // Send marshals and sends the CreateJob API request. @@ -107,7 +109,7 @@ func (c *MediaConvert) CreateJobRequest(input *CreateJobInput) CreateJobRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateJobRequest{Request: req, Input: input} + return CreateJobRequest{Request: req, Input: input, Copy: c.CreateJobRequest} } const opCreateJobTemplate = "CreateJobTemplate" @@ -116,6 +118,7 @@ const opCreateJobTemplate = "CreateJobTemplate" type CreateJobTemplateRequest struct { *aws.Request Input *CreateJobTemplateInput + Copy func(*CreateJobTemplateInput) CreateJobTemplateRequest } // Send marshals and sends the CreateJobTemplate API request. @@ -157,7 +160,7 @@ func (c *MediaConvert) CreateJobTemplateRequest(input *CreateJobTemplateInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateJobTemplateRequest{Request: req, Input: input} + return CreateJobTemplateRequest{Request: req, Input: input, Copy: c.CreateJobTemplateRequest} } const opCreatePreset = "CreatePreset" @@ -166,6 +169,7 @@ const opCreatePreset = "CreatePreset" type CreatePresetRequest struct { *aws.Request Input *CreatePresetInput + Copy func(*CreatePresetInput) CreatePresetRequest } // Send marshals and sends the CreatePreset API request. @@ -207,7 +211,7 @@ func (c *MediaConvert) CreatePresetRequest(input *CreatePresetInput) CreatePrese req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePresetRequest{Request: req, Input: input} + return CreatePresetRequest{Request: req, Input: input, Copy: c.CreatePresetRequest} } const opCreateQueue = "CreateQueue" @@ -216,6 +220,7 @@ const opCreateQueue = "CreateQueue" type CreateQueueRequest struct { *aws.Request Input *CreateQueueInput + Copy func(*CreateQueueInput) CreateQueueRequest } // Send marshals and sends the CreateQueue API request. @@ -257,7 +262,7 @@ func (c *MediaConvert) CreateQueueRequest(input *CreateQueueInput) CreateQueueRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateQueueRequest{Request: req, Input: input} + return CreateQueueRequest{Request: req, Input: input, Copy: c.CreateQueueRequest} } const opDeleteJobTemplate = "DeleteJobTemplate" @@ -266,6 +271,7 @@ const opDeleteJobTemplate = "DeleteJobTemplate" type DeleteJobTemplateRequest struct { *aws.Request Input *DeleteJobTemplateInput + Copy func(*DeleteJobTemplateInput) DeleteJobTemplateRequest } // Send marshals and sends the DeleteJobTemplate API request. @@ -306,7 +312,7 @@ func (c *MediaConvert) DeleteJobTemplateRequest(input *DeleteJobTemplateInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteJobTemplateRequest{Request: req, Input: input} + return DeleteJobTemplateRequest{Request: req, Input: input, Copy: c.DeleteJobTemplateRequest} } const opDeletePreset = "DeletePreset" @@ -315,6 +321,7 @@ const opDeletePreset = "DeletePreset" type DeletePresetRequest struct { *aws.Request Input *DeletePresetInput + Copy func(*DeletePresetInput) DeletePresetRequest } // Send marshals and sends the DeletePreset API request. @@ -355,7 +362,7 @@ func (c *MediaConvert) DeletePresetRequest(input *DeletePresetInput) DeletePrese req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeletePresetRequest{Request: req, Input: input} + return DeletePresetRequest{Request: req, Input: input, Copy: c.DeletePresetRequest} } const opDeleteQueue = "DeleteQueue" @@ -364,6 +371,7 @@ const opDeleteQueue = "DeleteQueue" type DeleteQueueRequest struct { *aws.Request Input *DeleteQueueInput + Copy func(*DeleteQueueInput) DeleteQueueRequest } // Send marshals and sends the DeleteQueue API request. @@ -404,7 +412,7 @@ func (c *MediaConvert) DeleteQueueRequest(input *DeleteQueueInput) DeleteQueueRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteQueueRequest{Request: req, Input: input} + return DeleteQueueRequest{Request: req, Input: input, Copy: c.DeleteQueueRequest} } const opDescribeEndpoints = "DescribeEndpoints" @@ -413,6 +421,7 @@ const opDescribeEndpoints = "DescribeEndpoints" type DescribeEndpointsRequest struct { *aws.Request Input *DescribeEndpointsInput + Copy func(*DescribeEndpointsInput) DescribeEndpointsRequest } // Send marshals and sends the DescribeEndpoints API request. @@ -454,7 +463,7 @@ func (c *MediaConvert) DescribeEndpointsRequest(input *DescribeEndpointsInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEndpointsRequest{Request: req, Input: input} + return DescribeEndpointsRequest{Request: req, Input: input, Copy: c.DescribeEndpointsRequest} } const opGetJob = "GetJob" @@ -463,6 +472,7 @@ const opGetJob = "GetJob" type GetJobRequest struct { *aws.Request Input *GetJobInput + Copy func(*GetJobInput) GetJobRequest } // Send marshals and sends the GetJob API request. @@ -503,7 +513,7 @@ func (c *MediaConvert) GetJobRequest(input *GetJobInput) GetJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobRequest{Request: req, Input: input} + return GetJobRequest{Request: req, Input: input, Copy: c.GetJobRequest} } const opGetJobTemplate = "GetJobTemplate" @@ -512,6 +522,7 @@ const opGetJobTemplate = "GetJobTemplate" type GetJobTemplateRequest struct { *aws.Request Input *GetJobTemplateInput + Copy func(*GetJobTemplateInput) GetJobTemplateRequest } // Send marshals and sends the GetJobTemplate API request. @@ -552,7 +563,7 @@ func (c *MediaConvert) GetJobTemplateRequest(input *GetJobTemplateInput) GetJobT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobTemplateRequest{Request: req, Input: input} + return GetJobTemplateRequest{Request: req, Input: input, Copy: c.GetJobTemplateRequest} } const opGetPreset = "GetPreset" @@ -561,6 +572,7 @@ const opGetPreset = "GetPreset" type GetPresetRequest struct { *aws.Request Input *GetPresetInput + Copy func(*GetPresetInput) GetPresetRequest } // Send marshals and sends the GetPreset API request. @@ -601,7 +613,7 @@ func (c *MediaConvert) GetPresetRequest(input *GetPresetInput) GetPresetRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPresetRequest{Request: req, Input: input} + return GetPresetRequest{Request: req, Input: input, Copy: c.GetPresetRequest} } const opGetQueue = "GetQueue" @@ -610,6 +622,7 @@ const opGetQueue = "GetQueue" type GetQueueRequest struct { *aws.Request Input *GetQueueInput + Copy func(*GetQueueInput) GetQueueRequest } // Send marshals and sends the GetQueue API request. @@ -650,7 +663,7 @@ func (c *MediaConvert) GetQueueRequest(input *GetQueueInput) GetQueueRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetQueueRequest{Request: req, Input: input} + return GetQueueRequest{Request: req, Input: input, Copy: c.GetQueueRequest} } const opListJobTemplates = "ListJobTemplates" @@ -659,6 +672,7 @@ const opListJobTemplates = "ListJobTemplates" type ListJobTemplatesRequest struct { *aws.Request Input *ListJobTemplatesInput + Copy func(*ListJobTemplatesInput) ListJobTemplatesRequest } // Send marshals and sends the ListJobTemplates API request. @@ -701,7 +715,7 @@ func (c *MediaConvert) ListJobTemplatesRequest(input *ListJobTemplatesInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobTemplatesRequest{Request: req, Input: input} + return ListJobTemplatesRequest{Request: req, Input: input, Copy: c.ListJobTemplatesRequest} } const opListJobs = "ListJobs" @@ -710,6 +724,7 @@ const opListJobs = "ListJobs" type ListJobsRequest struct { *aws.Request Input *ListJobsInput + Copy func(*ListJobsInput) ListJobsRequest } // Send marshals and sends the ListJobs API request. @@ -753,7 +768,7 @@ func (c *MediaConvert) ListJobsRequest(input *ListJobsInput) ListJobsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobsRequest{Request: req, Input: input} + return ListJobsRequest{Request: req, Input: input, Copy: c.ListJobsRequest} } const opListPresets = "ListPresets" @@ -762,6 +777,7 @@ const opListPresets = "ListPresets" type ListPresetsRequest struct { *aws.Request Input *ListPresetsInput + Copy func(*ListPresetsInput) ListPresetsRequest } // Send marshals and sends the ListPresets API request. @@ -804,7 +820,7 @@ func (c *MediaConvert) ListPresetsRequest(input *ListPresetsInput) ListPresetsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPresetsRequest{Request: req, Input: input} + return ListPresetsRequest{Request: req, Input: input, Copy: c.ListPresetsRequest} } const opListQueues = "ListQueues" @@ -813,6 +829,7 @@ const opListQueues = "ListQueues" type ListQueuesRequest struct { *aws.Request Input *ListQueuesInput + Copy func(*ListQueuesInput) ListQueuesRequest } // Send marshals and sends the ListQueues API request. @@ -855,7 +872,7 @@ func (c *MediaConvert) ListQueuesRequest(input *ListQueuesInput) ListQueuesReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListQueuesRequest{Request: req, Input: input} + return ListQueuesRequest{Request: req, Input: input, Copy: c.ListQueuesRequest} } const opUpdateJobTemplate = "UpdateJobTemplate" @@ -864,6 +881,7 @@ const opUpdateJobTemplate = "UpdateJobTemplate" type UpdateJobTemplateRequest struct { *aws.Request Input *UpdateJobTemplateInput + Copy func(*UpdateJobTemplateInput) UpdateJobTemplateRequest } // Send marshals and sends the UpdateJobTemplate API request. @@ -904,7 +922,7 @@ func (c *MediaConvert) UpdateJobTemplateRequest(input *UpdateJobTemplateInput) U req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateJobTemplateRequest{Request: req, Input: input} + return UpdateJobTemplateRequest{Request: req, Input: input, Copy: c.UpdateJobTemplateRequest} } const opUpdatePreset = "UpdatePreset" @@ -913,6 +931,7 @@ const opUpdatePreset = "UpdatePreset" type UpdatePresetRequest struct { *aws.Request Input *UpdatePresetInput + Copy func(*UpdatePresetInput) UpdatePresetRequest } // Send marshals and sends the UpdatePreset API request. @@ -953,7 +972,7 @@ func (c *MediaConvert) UpdatePresetRequest(input *UpdatePresetInput) UpdatePrese req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePresetRequest{Request: req, Input: input} + return UpdatePresetRequest{Request: req, Input: input, Copy: c.UpdatePresetRequest} } const opUpdateQueue = "UpdateQueue" @@ -962,6 +981,7 @@ const opUpdateQueue = "UpdateQueue" type UpdateQueueRequest struct { *aws.Request Input *UpdateQueueInput + Copy func(*UpdateQueueInput) UpdateQueueRequest } // Send marshals and sends the UpdateQueue API request. @@ -1002,7 +1022,7 @@ func (c *MediaConvert) UpdateQueueRequest(input *UpdateQueueInput) UpdateQueueRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateQueueRequest{Request: req, Input: input} + return UpdateQueueRequest{Request: req, Input: input, Copy: c.UpdateQueueRequest} } // Required when you set (Codec) under (AudioDescriptions)>(CodecSettings) to diff --git a/service/medialive/api.go b/service/medialive/api.go index 11ed30f7c5a..deb9ca2b7db 100644 --- a/service/medialive/api.go +++ b/service/medialive/api.go @@ -14,6 +14,7 @@ const opCreateChannel = "CreateChannel" type CreateChannelRequest struct { *aws.Request Input *CreateChannelInput + Copy func(*CreateChannelInput) CreateChannelRequest } // Send marshals and sends the CreateChannel API request. @@ -54,7 +55,7 @@ func (c *MediaLive) CreateChannelRequest(input *CreateChannelInput) CreateChanne req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateChannelRequest{Request: req, Input: input} + return CreateChannelRequest{Request: req, Input: input, Copy: c.CreateChannelRequest} } const opCreateInput = "CreateInput" @@ -63,6 +64,7 @@ const opCreateInput = "CreateInput" type CreateInputRequest struct { *aws.Request Input *CreateInputInput + Copy func(*CreateInputInput) CreateInputRequest } // Send marshals and sends the CreateInput API request. @@ -103,7 +105,7 @@ func (c *MediaLive) CreateInputRequest(input *CreateInputInput) CreateInputReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInputRequest{Request: req, Input: input} + return CreateInputRequest{Request: req, Input: input, Copy: c.CreateInputRequest} } const opCreateInputSecurityGroup = "CreateInputSecurityGroup" @@ -112,6 +114,7 @@ const opCreateInputSecurityGroup = "CreateInputSecurityGroup" type CreateInputSecurityGroupRequest struct { *aws.Request Input *CreateInputSecurityGroupInput + Copy func(*CreateInputSecurityGroupInput) CreateInputSecurityGroupRequest } // Send marshals and sends the CreateInputSecurityGroup API request. @@ -152,7 +155,7 @@ func (c *MediaLive) CreateInputSecurityGroupRequest(input *CreateInputSecurityGr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInputSecurityGroupRequest{Request: req, Input: input} + return CreateInputSecurityGroupRequest{Request: req, Input: input, Copy: c.CreateInputSecurityGroupRequest} } const opDeleteChannel = "DeleteChannel" @@ -161,6 +164,7 @@ const opDeleteChannel = "DeleteChannel" type DeleteChannelRequest struct { *aws.Request Input *DeleteChannelInput + Copy func(*DeleteChannelInput) DeleteChannelRequest } // Send marshals and sends the DeleteChannel API request. @@ -201,7 +205,7 @@ func (c *MediaLive) DeleteChannelRequest(input *DeleteChannelInput) DeleteChanne req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteChannelRequest{Request: req, Input: input} + return DeleteChannelRequest{Request: req, Input: input, Copy: c.DeleteChannelRequest} } const opDeleteInput = "DeleteInput" @@ -210,6 +214,7 @@ const opDeleteInput = "DeleteInput" type DeleteInputRequest struct { *aws.Request Input *DeleteInputInput + Copy func(*DeleteInputInput) DeleteInputRequest } // Send marshals and sends the DeleteInput API request. @@ -250,7 +255,7 @@ func (c *MediaLive) DeleteInputRequest(input *DeleteInputInput) DeleteInputReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteInputRequest{Request: req, Input: input} + return DeleteInputRequest{Request: req, Input: input, Copy: c.DeleteInputRequest} } const opDeleteInputSecurityGroup = "DeleteInputSecurityGroup" @@ -259,6 +264,7 @@ const opDeleteInputSecurityGroup = "DeleteInputSecurityGroup" type DeleteInputSecurityGroupRequest struct { *aws.Request Input *DeleteInputSecurityGroupInput + Copy func(*DeleteInputSecurityGroupInput) DeleteInputSecurityGroupRequest } // Send marshals and sends the DeleteInputSecurityGroup API request. @@ -299,7 +305,7 @@ func (c *MediaLive) DeleteInputSecurityGroupRequest(input *DeleteInputSecurityGr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteInputSecurityGroupRequest{Request: req, Input: input} + return DeleteInputSecurityGroupRequest{Request: req, Input: input, Copy: c.DeleteInputSecurityGroupRequest} } const opDescribeChannel = "DescribeChannel" @@ -308,6 +314,7 @@ const opDescribeChannel = "DescribeChannel" type DescribeChannelRequest struct { *aws.Request Input *DescribeChannelInput + Copy func(*DescribeChannelInput) DescribeChannelRequest } // Send marshals and sends the DescribeChannel API request. @@ -348,7 +355,7 @@ func (c *MediaLive) DescribeChannelRequest(input *DescribeChannelInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeChannelRequest{Request: req, Input: input} + return DescribeChannelRequest{Request: req, Input: input, Copy: c.DescribeChannelRequest} } const opDescribeInput = "DescribeInput" @@ -357,6 +364,7 @@ const opDescribeInput = "DescribeInput" type DescribeInputRequest struct { *aws.Request Input *DescribeInputInput + Copy func(*DescribeInputInput) DescribeInputRequest } // Send marshals and sends the DescribeInput API request. @@ -397,7 +405,7 @@ func (c *MediaLive) DescribeInputRequest(input *DescribeInputInput) DescribeInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInputRequest{Request: req, Input: input} + return DescribeInputRequest{Request: req, Input: input, Copy: c.DescribeInputRequest} } const opDescribeInputSecurityGroup = "DescribeInputSecurityGroup" @@ -406,6 +414,7 @@ const opDescribeInputSecurityGroup = "DescribeInputSecurityGroup" type DescribeInputSecurityGroupRequest struct { *aws.Request Input *DescribeInputSecurityGroupInput + Copy func(*DescribeInputSecurityGroupInput) DescribeInputSecurityGroupRequest } // Send marshals and sends the DescribeInputSecurityGroup API request. @@ -446,7 +455,7 @@ func (c *MediaLive) DescribeInputSecurityGroupRequest(input *DescribeInputSecuri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInputSecurityGroupRequest{Request: req, Input: input} + return DescribeInputSecurityGroupRequest{Request: req, Input: input, Copy: c.DescribeInputSecurityGroupRequest} } const opListChannels = "ListChannels" @@ -455,6 +464,7 @@ const opListChannels = "ListChannels" type ListChannelsRequest struct { *aws.Request Input *ListChannelsInput + Copy func(*ListChannelsInput) ListChannelsRequest } // Send marshals and sends the ListChannels API request. @@ -501,57 +511,53 @@ func (c *MediaLive) ListChannelsRequest(input *ListChannelsInput) ListChannelsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListChannelsRequest{Request: req, Input: input} + return ListChannelsRequest{Request: req, Input: input, Copy: c.ListChannelsRequest} } -// ListChannelsPages iterates over the pages of a ListChannels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListChannels method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListChannelsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListChannels operation. -// pageNum := 0 -// err := client.ListChannelsPages(params, -// func(page *ListChannelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListChannelsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *MediaLive) ListChannelsPages(input *ListChannelsInput, fn func(*ListChannelsOutput, bool) bool) error { - return c.ListChannelsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListChannelsPagesWithContext same as ListChannelsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MediaLive) ListChannelsPagesWithContext(ctx aws.Context, input *ListChannelsInput, fn func(*ListChannelsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListChannelsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListChannelsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListChannelsRequest) Paginate(opts ...aws.Option) ListChannelsPager { + return ListChannelsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListChannelsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) - } - return p.Err() +// ListChannelsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListChannelsPager struct { + aws.Pager +} + +func (p *ListChannelsPager) CurrentPage() *ListChannelsOutput { + return p.Pager.CurrentPage().(*ListChannelsOutput) } const opListInputSecurityGroups = "ListInputSecurityGroups" @@ -560,6 +566,7 @@ const opListInputSecurityGroups = "ListInputSecurityGroups" type ListInputSecurityGroupsRequest struct { *aws.Request Input *ListInputSecurityGroupsInput + Copy func(*ListInputSecurityGroupsInput) ListInputSecurityGroupsRequest } // Send marshals and sends the ListInputSecurityGroups API request. @@ -606,57 +613,53 @@ func (c *MediaLive) ListInputSecurityGroupsRequest(input *ListInputSecurityGroup req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInputSecurityGroupsRequest{Request: req, Input: input} + return ListInputSecurityGroupsRequest{Request: req, Input: input, Copy: c.ListInputSecurityGroupsRequest} } -// ListInputSecurityGroupsPages iterates over the pages of a ListInputSecurityGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInputSecurityGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInputSecurityGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInputSecurityGroups operation. -// pageNum := 0 -// err := client.ListInputSecurityGroupsPages(params, -// func(page *ListInputSecurityGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListInputSecurityGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *MediaLive) ListInputSecurityGroupsPages(input *ListInputSecurityGroupsInput, fn func(*ListInputSecurityGroupsOutput, bool) bool) error { - return c.ListInputSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInputSecurityGroupsPagesWithContext same as ListInputSecurityGroupsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MediaLive) ListInputSecurityGroupsPagesWithContext(ctx aws.Context, input *ListInputSecurityGroupsInput, fn func(*ListInputSecurityGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInputSecurityGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInputSecurityGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListInputSecurityGroupsRequest) Paginate(opts ...aws.Option) ListInputSecurityGroupsPager { + return ListInputSecurityGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInputSecurityGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInputSecurityGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// ListInputSecurityGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInputSecurityGroupsPager struct { + aws.Pager +} + +func (p *ListInputSecurityGroupsPager) CurrentPage() *ListInputSecurityGroupsOutput { + return p.Pager.CurrentPage().(*ListInputSecurityGroupsOutput) } const opListInputs = "ListInputs" @@ -665,6 +668,7 @@ const opListInputs = "ListInputs" type ListInputsRequest struct { *aws.Request Input *ListInputsInput + Copy func(*ListInputsInput) ListInputsRequest } // Send marshals and sends the ListInputs API request. @@ -711,57 +715,53 @@ func (c *MediaLive) ListInputsRequest(input *ListInputsInput) ListInputsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInputsRequest{Request: req, Input: input} + return ListInputsRequest{Request: req, Input: input, Copy: c.ListInputsRequest} } -// ListInputsPages iterates over the pages of a ListInputs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInputs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInputsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInputs operation. -// pageNum := 0 -// err := client.ListInputsPages(params, -// func(page *ListInputsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListInputsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *MediaLive) ListInputsPages(input *ListInputsInput, fn func(*ListInputsOutput, bool) bool) error { - return c.ListInputsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInputsPagesWithContext same as ListInputsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MediaLive) ListInputsPagesWithContext(ctx aws.Context, input *ListInputsInput, fn func(*ListInputsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInputsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInputsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListInputsRequest) Paginate(opts ...aws.Option) ListInputsPager { + return ListInputsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInputsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInputsOutput), !p.HasNextPage()) - } - return p.Err() +// ListInputsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInputsPager struct { + aws.Pager +} + +func (p *ListInputsPager) CurrentPage() *ListInputsOutput { + return p.Pager.CurrentPage().(*ListInputsOutput) } const opStartChannel = "StartChannel" @@ -770,6 +770,7 @@ const opStartChannel = "StartChannel" type StartChannelRequest struct { *aws.Request Input *StartChannelInput + Copy func(*StartChannelInput) StartChannelRequest } // Send marshals and sends the StartChannel API request. @@ -810,7 +811,7 @@ func (c *MediaLive) StartChannelRequest(input *StartChannelInput) StartChannelRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartChannelRequest{Request: req, Input: input} + return StartChannelRequest{Request: req, Input: input, Copy: c.StartChannelRequest} } const opStopChannel = "StopChannel" @@ -819,6 +820,7 @@ const opStopChannel = "StopChannel" type StopChannelRequest struct { *aws.Request Input *StopChannelInput + Copy func(*StopChannelInput) StopChannelRequest } // Send marshals and sends the StopChannel API request. @@ -859,7 +861,7 @@ func (c *MediaLive) StopChannelRequest(input *StopChannelInput) StopChannelReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopChannelRequest{Request: req, Input: input} + return StopChannelRequest{Request: req, Input: input, Copy: c.StopChannelRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/AacSettings diff --git a/service/medialive/medialiveiface/interface.go b/service/medialive/medialiveiface/interface.go index 367755bb29f..d20257e1fdd 100644 --- a/service/medialive/medialiveiface/interface.go +++ b/service/medialive/medialiveiface/interface.go @@ -9,7 +9,6 @@ package medialiveiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/medialive" ) @@ -83,19 +82,10 @@ type MediaLiveAPI interface { ListChannelsRequest(*medialive.ListChannelsInput) medialive.ListChannelsRequest - ListChannelsPages(*medialive.ListChannelsInput, func(*medialive.ListChannelsOutput, bool) bool) error - ListChannelsPagesWithContext(aws.Context, *medialive.ListChannelsInput, func(*medialive.ListChannelsOutput, bool) bool, ...aws.Option) error - ListInputSecurityGroupsRequest(*medialive.ListInputSecurityGroupsInput) medialive.ListInputSecurityGroupsRequest - ListInputSecurityGroupsPages(*medialive.ListInputSecurityGroupsInput, func(*medialive.ListInputSecurityGroupsOutput, bool) bool) error - ListInputSecurityGroupsPagesWithContext(aws.Context, *medialive.ListInputSecurityGroupsInput, func(*medialive.ListInputSecurityGroupsOutput, bool) bool, ...aws.Option) error - ListInputsRequest(*medialive.ListInputsInput) medialive.ListInputsRequest - ListInputsPages(*medialive.ListInputsInput, func(*medialive.ListInputsOutput, bool) bool) error - ListInputsPagesWithContext(aws.Context, *medialive.ListInputsInput, func(*medialive.ListInputsOutput, bool) bool, ...aws.Option) error - StartChannelRequest(*medialive.StartChannelInput) medialive.StartChannelRequest StopChannelRequest(*medialive.StopChannelInput) medialive.StopChannelRequest diff --git a/service/mediapackage/api.go b/service/mediapackage/api.go index 9d5006442fe..06dc7c6786f 100644 --- a/service/mediapackage/api.go +++ b/service/mediapackage/api.go @@ -14,6 +14,7 @@ const opCreateChannel = "CreateChannel" type CreateChannelRequest struct { *aws.Request Input *CreateChannelInput + Copy func(*CreateChannelInput) CreateChannelRequest } // Send marshals and sends the CreateChannel API request. @@ -54,7 +55,7 @@ func (c *MediaPackage) CreateChannelRequest(input *CreateChannelInput) CreateCha req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateChannelRequest{Request: req, Input: input} + return CreateChannelRequest{Request: req, Input: input, Copy: c.CreateChannelRequest} } const opCreateOriginEndpoint = "CreateOriginEndpoint" @@ -63,6 +64,7 @@ const opCreateOriginEndpoint = "CreateOriginEndpoint" type CreateOriginEndpointRequest struct { *aws.Request Input *CreateOriginEndpointInput + Copy func(*CreateOriginEndpointInput) CreateOriginEndpointRequest } // Send marshals and sends the CreateOriginEndpoint API request. @@ -103,7 +105,7 @@ func (c *MediaPackage) CreateOriginEndpointRequest(input *CreateOriginEndpointIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateOriginEndpointRequest{Request: req, Input: input} + return CreateOriginEndpointRequest{Request: req, Input: input, Copy: c.CreateOriginEndpointRequest} } const opDeleteChannel = "DeleteChannel" @@ -112,6 +114,7 @@ const opDeleteChannel = "DeleteChannel" type DeleteChannelRequest struct { *aws.Request Input *DeleteChannelInput + Copy func(*DeleteChannelInput) DeleteChannelRequest } // Send marshals and sends the DeleteChannel API request. @@ -152,7 +155,7 @@ func (c *MediaPackage) DeleteChannelRequest(input *DeleteChannelInput) DeleteCha req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteChannelRequest{Request: req, Input: input} + return DeleteChannelRequest{Request: req, Input: input, Copy: c.DeleteChannelRequest} } const opDeleteOriginEndpoint = "DeleteOriginEndpoint" @@ -161,6 +164,7 @@ const opDeleteOriginEndpoint = "DeleteOriginEndpoint" type DeleteOriginEndpointRequest struct { *aws.Request Input *DeleteOriginEndpointInput + Copy func(*DeleteOriginEndpointInput) DeleteOriginEndpointRequest } // Send marshals and sends the DeleteOriginEndpoint API request. @@ -201,7 +205,7 @@ func (c *MediaPackage) DeleteOriginEndpointRequest(input *DeleteOriginEndpointIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteOriginEndpointRequest{Request: req, Input: input} + return DeleteOriginEndpointRequest{Request: req, Input: input, Copy: c.DeleteOriginEndpointRequest} } const opDescribeChannel = "DescribeChannel" @@ -210,6 +214,7 @@ const opDescribeChannel = "DescribeChannel" type DescribeChannelRequest struct { *aws.Request Input *DescribeChannelInput + Copy func(*DescribeChannelInput) DescribeChannelRequest } // Send marshals and sends the DescribeChannel API request. @@ -250,7 +255,7 @@ func (c *MediaPackage) DescribeChannelRequest(input *DescribeChannelInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeChannelRequest{Request: req, Input: input} + return DescribeChannelRequest{Request: req, Input: input, Copy: c.DescribeChannelRequest} } const opDescribeOriginEndpoint = "DescribeOriginEndpoint" @@ -259,6 +264,7 @@ const opDescribeOriginEndpoint = "DescribeOriginEndpoint" type DescribeOriginEndpointRequest struct { *aws.Request Input *DescribeOriginEndpointInput + Copy func(*DescribeOriginEndpointInput) DescribeOriginEndpointRequest } // Send marshals and sends the DescribeOriginEndpoint API request. @@ -299,7 +305,7 @@ func (c *MediaPackage) DescribeOriginEndpointRequest(input *DescribeOriginEndpoi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeOriginEndpointRequest{Request: req, Input: input} + return DescribeOriginEndpointRequest{Request: req, Input: input, Copy: c.DescribeOriginEndpointRequest} } const opListChannels = "ListChannels" @@ -308,6 +314,7 @@ const opListChannels = "ListChannels" type ListChannelsRequest struct { *aws.Request Input *ListChannelsInput + Copy func(*ListChannelsInput) ListChannelsRequest } // Send marshals and sends the ListChannels API request. @@ -354,57 +361,53 @@ func (c *MediaPackage) ListChannelsRequest(input *ListChannelsInput) ListChannel req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListChannelsRequest{Request: req, Input: input} + return ListChannelsRequest{Request: req, Input: input, Copy: c.ListChannelsRequest} } -// ListChannelsPages iterates over the pages of a ListChannels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListChannels method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListChannelsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListChannels operation. -// pageNum := 0 -// err := client.ListChannelsPages(params, -// func(page *ListChannelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListChannelsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *MediaPackage) ListChannelsPages(input *ListChannelsInput, fn func(*ListChannelsOutput, bool) bool) error { - return c.ListChannelsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListChannelsPagesWithContext same as ListChannelsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MediaPackage) ListChannelsPagesWithContext(ctx aws.Context, input *ListChannelsInput, fn func(*ListChannelsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListChannelsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListChannelsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListChannelsRequest) Paginate(opts ...aws.Option) ListChannelsPager { + return ListChannelsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListChannelsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) - } - return p.Err() +// ListChannelsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListChannelsPager struct { + aws.Pager +} + +func (p *ListChannelsPager) CurrentPage() *ListChannelsOutput { + return p.Pager.CurrentPage().(*ListChannelsOutput) } const opListOriginEndpoints = "ListOriginEndpoints" @@ -413,6 +416,7 @@ const opListOriginEndpoints = "ListOriginEndpoints" type ListOriginEndpointsRequest struct { *aws.Request Input *ListOriginEndpointsInput + Copy func(*ListOriginEndpointsInput) ListOriginEndpointsRequest } // Send marshals and sends the ListOriginEndpoints API request. @@ -459,57 +463,53 @@ func (c *MediaPackage) ListOriginEndpointsRequest(input *ListOriginEndpointsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOriginEndpointsRequest{Request: req, Input: input} + return ListOriginEndpointsRequest{Request: req, Input: input, Copy: c.ListOriginEndpointsRequest} } -// ListOriginEndpointsPages iterates over the pages of a ListOriginEndpoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOriginEndpoints method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListOriginEndpointsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListOriginEndpoints operation. -// pageNum := 0 -// err := client.ListOriginEndpointsPages(params, -// func(page *ListOriginEndpointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListOriginEndpointsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *MediaPackage) ListOriginEndpointsPages(input *ListOriginEndpointsInput, fn func(*ListOriginEndpointsOutput, bool) bool) error { - return c.ListOriginEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOriginEndpointsPagesWithContext same as ListOriginEndpointsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MediaPackage) ListOriginEndpointsPagesWithContext(ctx aws.Context, input *ListOriginEndpointsInput, fn func(*ListOriginEndpointsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListOriginEndpointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListOriginEndpointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListOriginEndpointsRequest) Paginate(opts ...aws.Option) ListOriginEndpointsPager { + return ListOriginEndpointsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListOriginEndpointsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOriginEndpointsOutput), !p.HasNextPage()) - } - return p.Err() +// ListOriginEndpointsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListOriginEndpointsPager struct { + aws.Pager +} + +func (p *ListOriginEndpointsPager) CurrentPage() *ListOriginEndpointsOutput { + return p.Pager.CurrentPage().(*ListOriginEndpointsOutput) } const opRotateChannelCredentials = "RotateChannelCredentials" @@ -518,6 +518,7 @@ const opRotateChannelCredentials = "RotateChannelCredentials" type RotateChannelCredentialsRequest struct { *aws.Request Input *RotateChannelCredentialsInput + Copy func(*RotateChannelCredentialsInput) RotateChannelCredentialsRequest } // Send marshals and sends the RotateChannelCredentials API request. @@ -558,7 +559,7 @@ func (c *MediaPackage) RotateChannelCredentialsRequest(input *RotateChannelCrede req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RotateChannelCredentialsRequest{Request: req, Input: input} + return RotateChannelCredentialsRequest{Request: req, Input: input, Copy: c.RotateChannelCredentialsRequest} } const opUpdateChannel = "UpdateChannel" @@ -567,6 +568,7 @@ const opUpdateChannel = "UpdateChannel" type UpdateChannelRequest struct { *aws.Request Input *UpdateChannelInput + Copy func(*UpdateChannelInput) UpdateChannelRequest } // Send marshals and sends the UpdateChannel API request. @@ -607,7 +609,7 @@ func (c *MediaPackage) UpdateChannelRequest(input *UpdateChannelInput) UpdateCha req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateChannelRequest{Request: req, Input: input} + return UpdateChannelRequest{Request: req, Input: input, Copy: c.UpdateChannelRequest} } const opUpdateOriginEndpoint = "UpdateOriginEndpoint" @@ -616,6 +618,7 @@ const opUpdateOriginEndpoint = "UpdateOriginEndpoint" type UpdateOriginEndpointRequest struct { *aws.Request Input *UpdateOriginEndpointInput + Copy func(*UpdateOriginEndpointInput) UpdateOriginEndpointRequest } // Send marshals and sends the UpdateOriginEndpoint API request. @@ -656,7 +659,7 @@ func (c *MediaPackage) UpdateOriginEndpointRequest(input *UpdateOriginEndpointIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateOriginEndpointRequest{Request: req, Input: input} + return UpdateOriginEndpointRequest{Request: req, Input: input, Copy: c.UpdateOriginEndpointRequest} } // A Channel resource configuration. diff --git a/service/mediapackage/mediapackageiface/interface.go b/service/mediapackage/mediapackageiface/interface.go index 0917d59bb99..2ef89600a66 100644 --- a/service/mediapackage/mediapackageiface/interface.go +++ b/service/mediapackage/mediapackageiface/interface.go @@ -9,7 +9,6 @@ package mediapackageiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mediapackage" ) @@ -77,14 +76,8 @@ type MediaPackageAPI interface { ListChannelsRequest(*mediapackage.ListChannelsInput) mediapackage.ListChannelsRequest - ListChannelsPages(*mediapackage.ListChannelsInput, func(*mediapackage.ListChannelsOutput, bool) bool) error - ListChannelsPagesWithContext(aws.Context, *mediapackage.ListChannelsInput, func(*mediapackage.ListChannelsOutput, bool) bool, ...aws.Option) error - ListOriginEndpointsRequest(*mediapackage.ListOriginEndpointsInput) mediapackage.ListOriginEndpointsRequest - ListOriginEndpointsPages(*mediapackage.ListOriginEndpointsInput, func(*mediapackage.ListOriginEndpointsOutput, bool) bool) error - ListOriginEndpointsPagesWithContext(aws.Context, *mediapackage.ListOriginEndpointsInput, func(*mediapackage.ListOriginEndpointsOutput, bool) bool, ...aws.Option) error - RotateChannelCredentialsRequest(*mediapackage.RotateChannelCredentialsInput) mediapackage.RotateChannelCredentialsRequest UpdateChannelRequest(*mediapackage.UpdateChannelInput) mediapackage.UpdateChannelRequest diff --git a/service/mediastore/api.go b/service/mediastore/api.go index ceda67fe501..611fcbeb4ca 100644 --- a/service/mediastore/api.go +++ b/service/mediastore/api.go @@ -15,6 +15,7 @@ const opCreateContainer = "CreateContainer" type CreateContainerRequest struct { *aws.Request Input *CreateContainerInput + Copy func(*CreateContainerInput) CreateContainerRequest } // Send marshals and sends the CreateContainer API request. @@ -56,7 +57,7 @@ func (c *MediaStore) CreateContainerRequest(input *CreateContainerInput) CreateC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateContainerRequest{Request: req, Input: input} + return CreateContainerRequest{Request: req, Input: input, Copy: c.CreateContainerRequest} } const opDeleteContainer = "DeleteContainer" @@ -65,6 +66,7 @@ const opDeleteContainer = "DeleteContainer" type DeleteContainerRequest struct { *aws.Request Input *DeleteContainerInput + Copy func(*DeleteContainerInput) DeleteContainerRequest } // Send marshals and sends the DeleteContainer API request. @@ -107,7 +109,7 @@ func (c *MediaStore) DeleteContainerRequest(input *DeleteContainerInput) DeleteC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteContainerRequest{Request: req, Input: input} + return DeleteContainerRequest{Request: req, Input: input, Copy: c.DeleteContainerRequest} } const opDeleteContainerPolicy = "DeleteContainerPolicy" @@ -116,6 +118,7 @@ const opDeleteContainerPolicy = "DeleteContainerPolicy" type DeleteContainerPolicyRequest struct { *aws.Request Input *DeleteContainerPolicyInput + Copy func(*DeleteContainerPolicyInput) DeleteContainerPolicyRequest } // Send marshals and sends the DeleteContainerPolicy API request. @@ -156,7 +159,7 @@ func (c *MediaStore) DeleteContainerPolicyRequest(input *DeleteContainerPolicyIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteContainerPolicyRequest{Request: req, Input: input} + return DeleteContainerPolicyRequest{Request: req, Input: input, Copy: c.DeleteContainerPolicyRequest} } const opDescribeContainer = "DescribeContainer" @@ -165,6 +168,7 @@ const opDescribeContainer = "DescribeContainer" type DescribeContainerRequest struct { *aws.Request Input *DescribeContainerInput + Copy func(*DescribeContainerInput) DescribeContainerRequest } // Send marshals and sends the DescribeContainer API request. @@ -207,7 +211,7 @@ func (c *MediaStore) DescribeContainerRequest(input *DescribeContainerInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeContainerRequest{Request: req, Input: input} + return DescribeContainerRequest{Request: req, Input: input, Copy: c.DescribeContainerRequest} } const opGetContainerPolicy = "GetContainerPolicy" @@ -216,6 +220,7 @@ const opGetContainerPolicy = "GetContainerPolicy" type GetContainerPolicyRequest struct { *aws.Request Input *GetContainerPolicyInput + Copy func(*GetContainerPolicyInput) GetContainerPolicyRequest } // Send marshals and sends the GetContainerPolicy API request. @@ -258,7 +263,7 @@ func (c *MediaStore) GetContainerPolicyRequest(input *GetContainerPolicyInput) G req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetContainerPolicyRequest{Request: req, Input: input} + return GetContainerPolicyRequest{Request: req, Input: input, Copy: c.GetContainerPolicyRequest} } const opListContainers = "ListContainers" @@ -267,6 +272,7 @@ const opListContainers = "ListContainers" type ListContainersRequest struct { *aws.Request Input *ListContainersInput + Copy func(*ListContainersInput) ListContainersRequest } // Send marshals and sends the ListContainers API request. @@ -316,7 +322,7 @@ func (c *MediaStore) ListContainersRequest(input *ListContainersInput) ListConta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListContainersRequest{Request: req, Input: input} + return ListContainersRequest{Request: req, Input: input, Copy: c.ListContainersRequest} } const opPutContainerPolicy = "PutContainerPolicy" @@ -325,6 +331,7 @@ const opPutContainerPolicy = "PutContainerPolicy" type PutContainerPolicyRequest struct { *aws.Request Input *PutContainerPolicyInput + Copy func(*PutContainerPolicyInput) PutContainerPolicyRequest } // Send marshals and sends the PutContainerPolicy API request. @@ -372,7 +379,7 @@ func (c *MediaStore) PutContainerPolicyRequest(input *PutContainerPolicyInput) P req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutContainerPolicyRequest{Request: req, Input: input} + return PutContainerPolicyRequest{Request: req, Input: input, Copy: c.PutContainerPolicyRequest} } // This section describes operations that you can perform on an AWS Elemental diff --git a/service/mediastoredata/api.go b/service/mediastoredata/api.go index 51def83cc4f..86fbc59f5c5 100644 --- a/service/mediastoredata/api.go +++ b/service/mediastoredata/api.go @@ -18,6 +18,7 @@ const opDeleteObject = "DeleteObject" type DeleteObjectRequest struct { *aws.Request Input *DeleteObjectInput + Copy func(*DeleteObjectInput) DeleteObjectRequest } // Send marshals and sends the DeleteObject API request. @@ -58,7 +59,7 @@ func (c *MediaStoreData) DeleteObjectRequest(input *DeleteObjectInput) DeleteObj req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteObjectRequest{Request: req, Input: input} + return DeleteObjectRequest{Request: req, Input: input, Copy: c.DeleteObjectRequest} } const opDescribeObject = "DescribeObject" @@ -67,6 +68,7 @@ const opDescribeObject = "DescribeObject" type DescribeObjectRequest struct { *aws.Request Input *DescribeObjectInput + Copy func(*DescribeObjectInput) DescribeObjectRequest } // Send marshals and sends the DescribeObject API request. @@ -107,7 +109,7 @@ func (c *MediaStoreData) DescribeObjectRequest(input *DescribeObjectInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeObjectRequest{Request: req, Input: input} + return DescribeObjectRequest{Request: req, Input: input, Copy: c.DescribeObjectRequest} } const opGetObject = "GetObject" @@ -116,6 +118,7 @@ const opGetObject = "GetObject" type GetObjectRequest struct { *aws.Request Input *GetObjectInput + Copy func(*GetObjectInput) GetObjectRequest } // Send marshals and sends the GetObject API request. @@ -156,7 +159,7 @@ func (c *MediaStoreData) GetObjectRequest(input *GetObjectInput) GetObjectReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetObjectRequest{Request: req, Input: input} + return GetObjectRequest{Request: req, Input: input, Copy: c.GetObjectRequest} } const opListItems = "ListItems" @@ -165,6 +168,7 @@ const opListItems = "ListItems" type ListItemsRequest struct { *aws.Request Input *ListItemsInput + Copy func(*ListItemsInput) ListItemsRequest } // Send marshals and sends the ListItems API request. @@ -206,7 +210,7 @@ func (c *MediaStoreData) ListItemsRequest(input *ListItemsInput) ListItemsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListItemsRequest{Request: req, Input: input} + return ListItemsRequest{Request: req, Input: input, Copy: c.ListItemsRequest} } const opPutObject = "PutObject" @@ -215,6 +219,7 @@ const opPutObject = "PutObject" type PutObjectRequest struct { *aws.Request Input *PutObjectInput + Copy func(*PutObjectInput) PutObjectRequest } // Send marshals and sends the PutObject API request. @@ -258,7 +263,7 @@ func (c *MediaStoreData) PutObjectRequest(input *PutObjectInput) PutObjectReques req.Handlers.Sign.Remove(v4.SignRequestHandler) handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) req.Handlers.Sign.PushFrontNamed(handler) - return PutObjectRequest{Request: req, Input: input} + return PutObjectRequest{Request: req, Input: input, Copy: c.PutObjectRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/mediastore-data-2017-09-01/DeleteObjectRequest diff --git a/service/migrationhub/api.go b/service/migrationhub/api.go index da4cebd901d..fd420021a88 100644 --- a/service/migrationhub/api.go +++ b/service/migrationhub/api.go @@ -16,6 +16,7 @@ const opAssociateCreatedArtifact = "AssociateCreatedArtifact" type AssociateCreatedArtifactRequest struct { *aws.Request Input *AssociateCreatedArtifactInput + Copy func(*AssociateCreatedArtifactInput) AssociateCreatedArtifactRequest } // Send marshals and sends the AssociateCreatedArtifact API request. @@ -68,7 +69,7 @@ func (c *MigrationHub) AssociateCreatedArtifactRequest(input *AssociateCreatedAr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateCreatedArtifactRequest{Request: req, Input: input} + return AssociateCreatedArtifactRequest{Request: req, Input: input, Copy: c.AssociateCreatedArtifactRequest} } const opAssociateDiscoveredResource = "AssociateDiscoveredResource" @@ -77,6 +78,7 @@ const opAssociateDiscoveredResource = "AssociateDiscoveredResource" type AssociateDiscoveredResourceRequest struct { *aws.Request Input *AssociateDiscoveredResourceInput + Copy func(*AssociateDiscoveredResourceInput) AssociateDiscoveredResourceRequest } // Send marshals and sends the AssociateDiscoveredResource API request. @@ -118,7 +120,7 @@ func (c *MigrationHub) AssociateDiscoveredResourceRequest(input *AssociateDiscov req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateDiscoveredResourceRequest{Request: req, Input: input} + return AssociateDiscoveredResourceRequest{Request: req, Input: input, Copy: c.AssociateDiscoveredResourceRequest} } const opCreateProgressUpdateStream = "CreateProgressUpdateStream" @@ -127,6 +129,7 @@ const opCreateProgressUpdateStream = "CreateProgressUpdateStream" type CreateProgressUpdateStreamRequest struct { *aws.Request Input *CreateProgressUpdateStreamInput + Copy func(*CreateProgressUpdateStreamInput) CreateProgressUpdateStreamRequest } // Send marshals and sends the CreateProgressUpdateStream API request. @@ -171,7 +174,7 @@ func (c *MigrationHub) CreateProgressUpdateStreamRequest(input *CreateProgressUp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateProgressUpdateStreamRequest{Request: req, Input: input} + return CreateProgressUpdateStreamRequest{Request: req, Input: input, Copy: c.CreateProgressUpdateStreamRequest} } const opDeleteProgressUpdateStream = "DeleteProgressUpdateStream" @@ -180,6 +183,7 @@ const opDeleteProgressUpdateStream = "DeleteProgressUpdateStream" type DeleteProgressUpdateStreamRequest struct { *aws.Request Input *DeleteProgressUpdateStreamInput + Copy func(*DeleteProgressUpdateStreamInput) DeleteProgressUpdateStreamRequest } // Send marshals and sends the DeleteProgressUpdateStream API request. @@ -242,7 +246,7 @@ func (c *MigrationHub) DeleteProgressUpdateStreamRequest(input *DeleteProgressUp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteProgressUpdateStreamRequest{Request: req, Input: input} + return DeleteProgressUpdateStreamRequest{Request: req, Input: input, Copy: c.DeleteProgressUpdateStreamRequest} } const opDescribeApplicationState = "DescribeApplicationState" @@ -251,6 +255,7 @@ const opDescribeApplicationState = "DescribeApplicationState" type DescribeApplicationStateRequest struct { *aws.Request Input *DescribeApplicationStateInput + Copy func(*DescribeApplicationStateInput) DescribeApplicationStateRequest } // Send marshals and sends the DescribeApplicationState API request. @@ -291,7 +296,7 @@ func (c *MigrationHub) DescribeApplicationStateRequest(input *DescribeApplicatio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeApplicationStateRequest{Request: req, Input: input} + return DescribeApplicationStateRequest{Request: req, Input: input, Copy: c.DescribeApplicationStateRequest} } const opDescribeMigrationTask = "DescribeMigrationTask" @@ -300,6 +305,7 @@ const opDescribeMigrationTask = "DescribeMigrationTask" type DescribeMigrationTaskRequest struct { *aws.Request Input *DescribeMigrationTaskInput + Copy func(*DescribeMigrationTaskInput) DescribeMigrationTaskRequest } // Send marshals and sends the DescribeMigrationTask API request. @@ -340,7 +346,7 @@ func (c *MigrationHub) DescribeMigrationTaskRequest(input *DescribeMigrationTask req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMigrationTaskRequest{Request: req, Input: input} + return DescribeMigrationTaskRequest{Request: req, Input: input, Copy: c.DescribeMigrationTaskRequest} } const opDisassociateCreatedArtifact = "DisassociateCreatedArtifact" @@ -349,6 +355,7 @@ const opDisassociateCreatedArtifact = "DisassociateCreatedArtifact" type DisassociateCreatedArtifactRequest struct { *aws.Request Input *DisassociateCreatedArtifactInput + Copy func(*DisassociateCreatedArtifactInput) DisassociateCreatedArtifactRequest } // Send marshals and sends the DisassociateCreatedArtifact API request. @@ -401,7 +408,7 @@ func (c *MigrationHub) DisassociateCreatedArtifactRequest(input *DisassociateCre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateCreatedArtifactRequest{Request: req, Input: input} + return DisassociateCreatedArtifactRequest{Request: req, Input: input, Copy: c.DisassociateCreatedArtifactRequest} } const opDisassociateDiscoveredResource = "DisassociateDiscoveredResource" @@ -410,6 +417,7 @@ const opDisassociateDiscoveredResource = "DisassociateDiscoveredResource" type DisassociateDiscoveredResourceRequest struct { *aws.Request Input *DisassociateDiscoveredResourceInput + Copy func(*DisassociateDiscoveredResourceInput) DisassociateDiscoveredResourceRequest } // Send marshals and sends the DisassociateDiscoveredResource API request. @@ -451,7 +459,7 @@ func (c *MigrationHub) DisassociateDiscoveredResourceRequest(input *Disassociate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateDiscoveredResourceRequest{Request: req, Input: input} + return DisassociateDiscoveredResourceRequest{Request: req, Input: input, Copy: c.DisassociateDiscoveredResourceRequest} } const opImportMigrationTask = "ImportMigrationTask" @@ -460,6 +468,7 @@ const opImportMigrationTask = "ImportMigrationTask" type ImportMigrationTaskRequest struct { *aws.Request Input *ImportMigrationTaskInput + Copy func(*ImportMigrationTaskInput) ImportMigrationTaskRequest } // Send marshals and sends the ImportMigrationTask API request. @@ -505,7 +514,7 @@ func (c *MigrationHub) ImportMigrationTaskRequest(input *ImportMigrationTaskInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportMigrationTaskRequest{Request: req, Input: input} + return ImportMigrationTaskRequest{Request: req, Input: input, Copy: c.ImportMigrationTaskRequest} } const opListCreatedArtifacts = "ListCreatedArtifacts" @@ -514,6 +523,7 @@ const opListCreatedArtifacts = "ListCreatedArtifacts" type ListCreatedArtifactsRequest struct { *aws.Request Input *ListCreatedArtifactsInput + Copy func(*ListCreatedArtifactsInput) ListCreatedArtifactsRequest } // Send marshals and sends the ListCreatedArtifacts API request. @@ -562,7 +572,7 @@ func (c *MigrationHub) ListCreatedArtifactsRequest(input *ListCreatedArtifactsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCreatedArtifactsRequest{Request: req, Input: input} + return ListCreatedArtifactsRequest{Request: req, Input: input, Copy: c.ListCreatedArtifactsRequest} } const opListDiscoveredResources = "ListDiscoveredResources" @@ -571,6 +581,7 @@ const opListDiscoveredResources = "ListDiscoveredResources" type ListDiscoveredResourcesRequest struct { *aws.Request Input *ListDiscoveredResourcesInput + Copy func(*ListDiscoveredResourcesInput) ListDiscoveredResourcesRequest } // Send marshals and sends the ListDiscoveredResources API request. @@ -611,7 +622,7 @@ func (c *MigrationHub) ListDiscoveredResourcesRequest(input *ListDiscoveredResou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDiscoveredResourcesRequest{Request: req, Input: input} + return ListDiscoveredResourcesRequest{Request: req, Input: input, Copy: c.ListDiscoveredResourcesRequest} } const opListMigrationTasks = "ListMigrationTasks" @@ -620,6 +631,7 @@ const opListMigrationTasks = "ListMigrationTasks" type ListMigrationTasksRequest struct { *aws.Request Input *ListMigrationTasksInput + Copy func(*ListMigrationTasksInput) ListMigrationTasksRequest } // Send marshals and sends the ListMigrationTasks API request. @@ -668,7 +680,7 @@ func (c *MigrationHub) ListMigrationTasksRequest(input *ListMigrationTasksInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListMigrationTasksRequest{Request: req, Input: input} + return ListMigrationTasksRequest{Request: req, Input: input, Copy: c.ListMigrationTasksRequest} } const opListProgressUpdateStreams = "ListProgressUpdateStreams" @@ -677,6 +689,7 @@ const opListProgressUpdateStreams = "ListProgressUpdateStreams" type ListProgressUpdateStreamsRequest struct { *aws.Request Input *ListProgressUpdateStreamsInput + Copy func(*ListProgressUpdateStreamsInput) ListProgressUpdateStreamsRequest } // Send marshals and sends the ListProgressUpdateStreams API request. @@ -718,7 +731,7 @@ func (c *MigrationHub) ListProgressUpdateStreamsRequest(input *ListProgressUpdat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListProgressUpdateStreamsRequest{Request: req, Input: input} + return ListProgressUpdateStreamsRequest{Request: req, Input: input, Copy: c.ListProgressUpdateStreamsRequest} } const opNotifyApplicationState = "NotifyApplicationState" @@ -727,6 +740,7 @@ const opNotifyApplicationState = "NotifyApplicationState" type NotifyApplicationStateRequest struct { *aws.Request Input *NotifyApplicationStateInput + Copy func(*NotifyApplicationStateInput) NotifyApplicationStateRequest } // Send marshals and sends the NotifyApplicationState API request. @@ -769,7 +783,7 @@ func (c *MigrationHub) NotifyApplicationStateRequest(input *NotifyApplicationSta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return NotifyApplicationStateRequest{Request: req, Input: input} + return NotifyApplicationStateRequest{Request: req, Input: input, Copy: c.NotifyApplicationStateRequest} } const opNotifyMigrationTaskState = "NotifyMigrationTaskState" @@ -778,6 +792,7 @@ const opNotifyMigrationTaskState = "NotifyMigrationTaskState" type NotifyMigrationTaskStateRequest struct { *aws.Request Input *NotifyMigrationTaskStateInput + Copy func(*NotifyMigrationTaskStateInput) NotifyMigrationTaskStateRequest } // Send marshals and sends the NotifyMigrationTaskState API request. @@ -827,7 +842,7 @@ func (c *MigrationHub) NotifyMigrationTaskStateRequest(input *NotifyMigrationTas req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return NotifyMigrationTaskStateRequest{Request: req, Input: input} + return NotifyMigrationTaskStateRequest{Request: req, Input: input, Copy: c.NotifyMigrationTaskStateRequest} } const opPutResourceAttributes = "PutResourceAttributes" @@ -836,6 +851,7 @@ const opPutResourceAttributes = "PutResourceAttributes" type PutResourceAttributesRequest struct { *aws.Request Input *PutResourceAttributesInput + Copy func(*PutResourceAttributesInput) PutResourceAttributesRequest } // Send marshals and sends the PutResourceAttributes API request. @@ -888,7 +904,7 @@ func (c *MigrationHub) PutResourceAttributesRequest(input *PutResourceAttributes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutResourceAttributesRequest{Request: req, Input: input} + return PutResourceAttributesRequest{Request: req, Input: input, Copy: c.PutResourceAttributesRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/AWSMigrationHub-2017-05-31/AssociateCreatedArtifactRequest diff --git a/service/mobile/api.go b/service/mobile/api.go index 8fa34af5045..6736f110bb7 100644 --- a/service/mobile/api.go +++ b/service/mobile/api.go @@ -16,6 +16,7 @@ const opCreateProject = "CreateProject" type CreateProjectRequest struct { *aws.Request Input *CreateProjectInput + Copy func(*CreateProjectInput) CreateProjectRequest } // Send marshals and sends the CreateProject API request. @@ -56,7 +57,7 @@ func (c *Mobile) CreateProjectRequest(input *CreateProjectInput) CreateProjectRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateProjectRequest{Request: req, Input: input} + return CreateProjectRequest{Request: req, Input: input, Copy: c.CreateProjectRequest} } const opDeleteProject = "DeleteProject" @@ -65,6 +66,7 @@ const opDeleteProject = "DeleteProject" type DeleteProjectRequest struct { *aws.Request Input *DeleteProjectInput + Copy func(*DeleteProjectInput) DeleteProjectRequest } // Send marshals and sends the DeleteProject API request. @@ -105,7 +107,7 @@ func (c *Mobile) DeleteProjectRequest(input *DeleteProjectInput) DeleteProjectRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteProjectRequest{Request: req, Input: input} + return DeleteProjectRequest{Request: req, Input: input, Copy: c.DeleteProjectRequest} } const opDescribeBundle = "DescribeBundle" @@ -114,6 +116,7 @@ const opDescribeBundle = "DescribeBundle" type DescribeBundleRequest struct { *aws.Request Input *DescribeBundleInput + Copy func(*DescribeBundleInput) DescribeBundleRequest } // Send marshals and sends the DescribeBundle API request. @@ -154,7 +157,7 @@ func (c *Mobile) DescribeBundleRequest(input *DescribeBundleInput) DescribeBundl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBundleRequest{Request: req, Input: input} + return DescribeBundleRequest{Request: req, Input: input, Copy: c.DescribeBundleRequest} } const opDescribeProject = "DescribeProject" @@ -163,6 +166,7 @@ const opDescribeProject = "DescribeProject" type DescribeProjectRequest struct { *aws.Request Input *DescribeProjectInput + Copy func(*DescribeProjectInput) DescribeProjectRequest } // Send marshals and sends the DescribeProject API request. @@ -203,7 +207,7 @@ func (c *Mobile) DescribeProjectRequest(input *DescribeProjectInput) DescribePro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeProjectRequest{Request: req, Input: input} + return DescribeProjectRequest{Request: req, Input: input, Copy: c.DescribeProjectRequest} } const opExportBundle = "ExportBundle" @@ -212,6 +216,7 @@ const opExportBundle = "ExportBundle" type ExportBundleRequest struct { *aws.Request Input *ExportBundleInput + Copy func(*ExportBundleInput) ExportBundleRequest } // Send marshals and sends the ExportBundle API request. @@ -253,7 +258,7 @@ func (c *Mobile) ExportBundleRequest(input *ExportBundleInput) ExportBundleReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ExportBundleRequest{Request: req, Input: input} + return ExportBundleRequest{Request: req, Input: input, Copy: c.ExportBundleRequest} } const opExportProject = "ExportProject" @@ -262,6 +267,7 @@ const opExportProject = "ExportProject" type ExportProjectRequest struct { *aws.Request Input *ExportProjectInput + Copy func(*ExportProjectInput) ExportProjectRequest } // Send marshals and sends the ExportProject API request. @@ -304,7 +310,7 @@ func (c *Mobile) ExportProjectRequest(input *ExportProjectInput) ExportProjectRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ExportProjectRequest{Request: req, Input: input} + return ExportProjectRequest{Request: req, Input: input, Copy: c.ExportProjectRequest} } const opListBundles = "ListBundles" @@ -313,6 +319,7 @@ const opListBundles = "ListBundles" type ListBundlesRequest struct { *aws.Request Input *ListBundlesInput + Copy func(*ListBundlesInput) ListBundlesRequest } // Send marshals and sends the ListBundles API request. @@ -359,57 +366,53 @@ func (c *Mobile) ListBundlesRequest(input *ListBundlesInput) ListBundlesRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBundlesRequest{Request: req, Input: input} + return ListBundlesRequest{Request: req, Input: input, Copy: c.ListBundlesRequest} } -// ListBundlesPages iterates over the pages of a ListBundles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListBundles method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListBundlesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListBundles operation. -// pageNum := 0 -// err := client.ListBundlesPages(params, -// func(page *ListBundlesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListBundlesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Mobile) ListBundlesPages(input *ListBundlesInput, fn func(*ListBundlesOutput, bool) bool) error { - return c.ListBundlesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListBundlesPagesWithContext same as ListBundlesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Mobile) ListBundlesPagesWithContext(ctx aws.Context, input *ListBundlesInput, fn func(*ListBundlesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListBundlesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListBundlesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListBundlesRequest) Paginate(opts ...aws.Option) ListBundlesPager { + return ListBundlesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListBundlesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBundlesOutput), !p.HasNextPage()) - } - return p.Err() +// ListBundlesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListBundlesPager struct { + aws.Pager +} + +func (p *ListBundlesPager) CurrentPage() *ListBundlesOutput { + return p.Pager.CurrentPage().(*ListBundlesOutput) } const opListProjects = "ListProjects" @@ -418,6 +421,7 @@ const opListProjects = "ListProjects" type ListProjectsRequest struct { *aws.Request Input *ListProjectsInput + Copy func(*ListProjectsInput) ListProjectsRequest } // Send marshals and sends the ListProjects API request. @@ -464,57 +468,53 @@ func (c *Mobile) ListProjectsRequest(input *ListProjectsInput) ListProjectsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListProjectsRequest{Request: req, Input: input} + return ListProjectsRequest{Request: req, Input: input, Copy: c.ListProjectsRequest} } -// ListProjectsPages iterates over the pages of a ListProjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProjects method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListProjectsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListProjects operation. -// pageNum := 0 -// err := client.ListProjectsPages(params, -// func(page *ListProjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListProjectsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Mobile) ListProjectsPages(input *ListProjectsInput, fn func(*ListProjectsOutput, bool) bool) error { - return c.ListProjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProjectsPagesWithContext same as ListProjectsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Mobile) ListProjectsPagesWithContext(ctx aws.Context, input *ListProjectsInput, fn func(*ListProjectsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListProjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListProjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListProjectsRequest) Paginate(opts ...aws.Option) ListProjectsPager { + return ListProjectsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListProjectsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListProjectsOutput), !p.HasNextPage()) - } - return p.Err() +// ListProjectsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListProjectsPager struct { + aws.Pager +} + +func (p *ListProjectsPager) CurrentPage() *ListProjectsOutput { + return p.Pager.CurrentPage().(*ListProjectsOutput) } const opUpdateProject = "UpdateProject" @@ -523,6 +523,7 @@ const opUpdateProject = "UpdateProject" type UpdateProjectRequest struct { *aws.Request Input *UpdateProjectInput + Copy func(*UpdateProjectInput) UpdateProjectRequest } // Send marshals and sends the UpdateProject API request. @@ -563,7 +564,7 @@ func (c *Mobile) UpdateProjectRequest(input *UpdateProjectInput) UpdateProjectRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateProjectRequest{Request: req, Input: input} + return UpdateProjectRequest{Request: req, Input: input, Copy: c.UpdateProjectRequest} } // The details of the bundle. diff --git a/service/mobile/mobileiface/interface.go b/service/mobile/mobileiface/interface.go index 7c319c54a27..a6a9789637a 100644 --- a/service/mobile/mobileiface/interface.go +++ b/service/mobile/mobileiface/interface.go @@ -9,7 +9,6 @@ package mobileiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mobile" ) @@ -77,14 +76,8 @@ type MobileAPI interface { ListBundlesRequest(*mobile.ListBundlesInput) mobile.ListBundlesRequest - ListBundlesPages(*mobile.ListBundlesInput, func(*mobile.ListBundlesOutput, bool) bool) error - ListBundlesPagesWithContext(aws.Context, *mobile.ListBundlesInput, func(*mobile.ListBundlesOutput, bool) bool, ...aws.Option) error - ListProjectsRequest(*mobile.ListProjectsInput) mobile.ListProjectsRequest - ListProjectsPages(*mobile.ListProjectsInput, func(*mobile.ListProjectsOutput, bool) bool) error - ListProjectsPagesWithContext(aws.Context, *mobile.ListProjectsInput, func(*mobile.ListProjectsOutput, bool) bool, ...aws.Option) error - UpdateProjectRequest(*mobile.UpdateProjectInput) mobile.UpdateProjectRequest } diff --git a/service/mobileanalytics/api.go b/service/mobileanalytics/api.go index 00556bef134..b68a6c670e0 100644 --- a/service/mobileanalytics/api.go +++ b/service/mobileanalytics/api.go @@ -17,6 +17,7 @@ const opPutEvents = "PutEvents" type PutEventsRequest struct { *aws.Request Input *PutEventsInput + Copy func(*PutEventsInput) PutEventsRequest } // Send marshals and sends the PutEvents API request. @@ -59,7 +60,7 @@ func (c *MobileAnalytics) PutEventsRequest(input *PutEventsInput) PutEventsReque req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutEventsRequest{Request: req, Input: input} + return PutEventsRequest{Request: req, Input: input, Copy: c.PutEventsRequest} } // A JSON object representing a batch of unique event occurrences in your app. diff --git a/service/mq/api.go b/service/mq/api.go index 7a9c3759bfe..80058b8760a 100644 --- a/service/mq/api.go +++ b/service/mq/api.go @@ -14,6 +14,7 @@ const opCreateBroker = "CreateBroker" type CreateBrokerRequest struct { *aws.Request Input *CreateBrokerInput + Copy func(*CreateBrokerInput) CreateBrokerRequest } // Send marshals and sends the CreateBroker API request. @@ -54,7 +55,7 @@ func (c *MQ) CreateBrokerRequest(input *CreateBrokerInput) CreateBrokerRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBrokerRequest{Request: req, Input: input} + return CreateBrokerRequest{Request: req, Input: input, Copy: c.CreateBrokerRequest} } const opCreateConfiguration = "CreateConfiguration" @@ -63,6 +64,7 @@ const opCreateConfiguration = "CreateConfiguration" type CreateConfigurationRequest struct { *aws.Request Input *CreateConfigurationInput + Copy func(*CreateConfigurationInput) CreateConfigurationRequest } // Send marshals and sends the CreateConfiguration API request. @@ -105,7 +107,7 @@ func (c *MQ) CreateConfigurationRequest(input *CreateConfigurationInput) CreateC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateConfigurationRequest{Request: req, Input: input} + return CreateConfigurationRequest{Request: req, Input: input, Copy: c.CreateConfigurationRequest} } const opCreateUser = "CreateUser" @@ -114,6 +116,7 @@ const opCreateUser = "CreateUser" type CreateUserRequest struct { *aws.Request Input *CreateUserInput + Copy func(*CreateUserInput) CreateUserRequest } // Send marshals and sends the CreateUser API request. @@ -154,7 +157,7 @@ func (c *MQ) CreateUserRequest(input *CreateUserInput) CreateUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserRequest{Request: req, Input: input} + return CreateUserRequest{Request: req, Input: input, Copy: c.CreateUserRequest} } const opDeleteBroker = "DeleteBroker" @@ -163,6 +166,7 @@ const opDeleteBroker = "DeleteBroker" type DeleteBrokerRequest struct { *aws.Request Input *DeleteBrokerInput + Copy func(*DeleteBrokerInput) DeleteBrokerRequest } // Send marshals and sends the DeleteBroker API request. @@ -203,7 +207,7 @@ func (c *MQ) DeleteBrokerRequest(input *DeleteBrokerInput) DeleteBrokerRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteBrokerRequest{Request: req, Input: input} + return DeleteBrokerRequest{Request: req, Input: input, Copy: c.DeleteBrokerRequest} } const opDeleteUser = "DeleteUser" @@ -212,6 +216,7 @@ const opDeleteUser = "DeleteUser" type DeleteUserRequest struct { *aws.Request Input *DeleteUserInput + Copy func(*DeleteUserInput) DeleteUserRequest } // Send marshals and sends the DeleteUser API request. @@ -252,7 +257,7 @@ func (c *MQ) DeleteUserRequest(input *DeleteUserInput) DeleteUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteUserRequest{Request: req, Input: input} + return DeleteUserRequest{Request: req, Input: input, Copy: c.DeleteUserRequest} } const opDescribeBroker = "DescribeBroker" @@ -261,6 +266,7 @@ const opDescribeBroker = "DescribeBroker" type DescribeBrokerRequest struct { *aws.Request Input *DescribeBrokerInput + Copy func(*DescribeBrokerInput) DescribeBrokerRequest } // Send marshals and sends the DescribeBroker API request. @@ -301,7 +307,7 @@ func (c *MQ) DescribeBrokerRequest(input *DescribeBrokerInput) DescribeBrokerReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBrokerRequest{Request: req, Input: input} + return DescribeBrokerRequest{Request: req, Input: input, Copy: c.DescribeBrokerRequest} } const opDescribeConfiguration = "DescribeConfiguration" @@ -310,6 +316,7 @@ const opDescribeConfiguration = "DescribeConfiguration" type DescribeConfigurationRequest struct { *aws.Request Input *DescribeConfigurationInput + Copy func(*DescribeConfigurationInput) DescribeConfigurationRequest } // Send marshals and sends the DescribeConfiguration API request. @@ -350,7 +357,7 @@ func (c *MQ) DescribeConfigurationRequest(input *DescribeConfigurationInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigurationRequest{Request: req, Input: input} + return DescribeConfigurationRequest{Request: req, Input: input, Copy: c.DescribeConfigurationRequest} } const opDescribeConfigurationRevision = "DescribeConfigurationRevision" @@ -359,6 +366,7 @@ const opDescribeConfigurationRevision = "DescribeConfigurationRevision" type DescribeConfigurationRevisionRequest struct { *aws.Request Input *DescribeConfigurationRevisionInput + Copy func(*DescribeConfigurationRevisionInput) DescribeConfigurationRevisionRequest } // Send marshals and sends the DescribeConfigurationRevision API request. @@ -399,7 +407,7 @@ func (c *MQ) DescribeConfigurationRevisionRequest(input *DescribeConfigurationRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigurationRevisionRequest{Request: req, Input: input} + return DescribeConfigurationRevisionRequest{Request: req, Input: input, Copy: c.DescribeConfigurationRevisionRequest} } const opDescribeUser = "DescribeUser" @@ -408,6 +416,7 @@ const opDescribeUser = "DescribeUser" type DescribeUserRequest struct { *aws.Request Input *DescribeUserInput + Copy func(*DescribeUserInput) DescribeUserRequest } // Send marshals and sends the DescribeUser API request. @@ -448,7 +457,7 @@ func (c *MQ) DescribeUserRequest(input *DescribeUserInput) DescribeUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUserRequest{Request: req, Input: input} + return DescribeUserRequest{Request: req, Input: input, Copy: c.DescribeUserRequest} } const opListBrokers = "ListBrokers" @@ -457,6 +466,7 @@ const opListBrokers = "ListBrokers" type ListBrokersRequest struct { *aws.Request Input *ListBrokersInput + Copy func(*ListBrokersInput) ListBrokersRequest } // Send marshals and sends the ListBrokers API request. @@ -497,7 +507,7 @@ func (c *MQ) ListBrokersRequest(input *ListBrokersInput) ListBrokersRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBrokersRequest{Request: req, Input: input} + return ListBrokersRequest{Request: req, Input: input, Copy: c.ListBrokersRequest} } const opListConfigurationRevisions = "ListConfigurationRevisions" @@ -506,6 +516,7 @@ const opListConfigurationRevisions = "ListConfigurationRevisions" type ListConfigurationRevisionsRequest struct { *aws.Request Input *ListConfigurationRevisionsInput + Copy func(*ListConfigurationRevisionsInput) ListConfigurationRevisionsRequest } // Send marshals and sends the ListConfigurationRevisions API request. @@ -546,7 +557,7 @@ func (c *MQ) ListConfigurationRevisionsRequest(input *ListConfigurationRevisions req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListConfigurationRevisionsRequest{Request: req, Input: input} + return ListConfigurationRevisionsRequest{Request: req, Input: input, Copy: c.ListConfigurationRevisionsRequest} } const opListConfigurations = "ListConfigurations" @@ -555,6 +566,7 @@ const opListConfigurations = "ListConfigurations" type ListConfigurationsRequest struct { *aws.Request Input *ListConfigurationsInput + Copy func(*ListConfigurationsInput) ListConfigurationsRequest } // Send marshals and sends the ListConfigurations API request. @@ -595,7 +607,7 @@ func (c *MQ) ListConfigurationsRequest(input *ListConfigurationsInput) ListConfi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListConfigurationsRequest{Request: req, Input: input} + return ListConfigurationsRequest{Request: req, Input: input, Copy: c.ListConfigurationsRequest} } const opListUsers = "ListUsers" @@ -604,6 +616,7 @@ const opListUsers = "ListUsers" type ListUsersRequest struct { *aws.Request Input *ListUsersInput + Copy func(*ListUsersInput) ListUsersRequest } // Send marshals and sends the ListUsers API request. @@ -644,7 +657,7 @@ func (c *MQ) ListUsersRequest(input *ListUsersInput) ListUsersRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUsersRequest{Request: req, Input: input} + return ListUsersRequest{Request: req, Input: input, Copy: c.ListUsersRequest} } const opRebootBroker = "RebootBroker" @@ -653,6 +666,7 @@ const opRebootBroker = "RebootBroker" type RebootBrokerRequest struct { *aws.Request Input *RebootBrokerInput + Copy func(*RebootBrokerInput) RebootBrokerRequest } // Send marshals and sends the RebootBroker API request. @@ -693,7 +707,7 @@ func (c *MQ) RebootBrokerRequest(input *RebootBrokerInput) RebootBrokerRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RebootBrokerRequest{Request: req, Input: input} + return RebootBrokerRequest{Request: req, Input: input, Copy: c.RebootBrokerRequest} } const opUpdateBroker = "UpdateBroker" @@ -702,6 +716,7 @@ const opUpdateBroker = "UpdateBroker" type UpdateBrokerRequest struct { *aws.Request Input *UpdateBrokerInput + Copy func(*UpdateBrokerInput) UpdateBrokerRequest } // Send marshals and sends the UpdateBroker API request. @@ -742,7 +757,7 @@ func (c *MQ) UpdateBrokerRequest(input *UpdateBrokerInput) UpdateBrokerRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateBrokerRequest{Request: req, Input: input} + return UpdateBrokerRequest{Request: req, Input: input, Copy: c.UpdateBrokerRequest} } const opUpdateConfiguration = "UpdateConfiguration" @@ -751,6 +766,7 @@ const opUpdateConfiguration = "UpdateConfiguration" type UpdateConfigurationRequest struct { *aws.Request Input *UpdateConfigurationInput + Copy func(*UpdateConfigurationInput) UpdateConfigurationRequest } // Send marshals and sends the UpdateConfiguration API request. @@ -791,7 +807,7 @@ func (c *MQ) UpdateConfigurationRequest(input *UpdateConfigurationInput) UpdateC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateConfigurationRequest{Request: req, Input: input} + return UpdateConfigurationRequest{Request: req, Input: input, Copy: c.UpdateConfigurationRequest} } const opUpdateUser = "UpdateUser" @@ -800,6 +816,7 @@ const opUpdateUser = "UpdateUser" type UpdateUserRequest struct { *aws.Request Input *UpdateUserInput + Copy func(*UpdateUserInput) UpdateUserRequest } // Send marshals and sends the UpdateUser API request. @@ -840,7 +857,7 @@ func (c *MQ) UpdateUserRequest(input *UpdateUserInput) UpdateUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateUserRequest{Request: req, Input: input} + return UpdateUserRequest{Request: req, Input: input, Copy: c.UpdateUserRequest} } // Returns information about all brokers. diff --git a/service/mturk/api.go b/service/mturk/api.go index 025307a8052..df74e7819a0 100644 --- a/service/mturk/api.go +++ b/service/mturk/api.go @@ -16,6 +16,7 @@ const opAcceptQualificationRequest = "AcceptQualificationRequest" type AcceptQualificationRequestRequest struct { *aws.Request Input *AcceptQualificationRequestInput + Copy func(*AcceptQualificationRequestInput) AcceptQualificationRequestRequest } // Send marshals and sends the AcceptQualificationRequest API request. @@ -63,7 +64,7 @@ func (c *MTurk) AcceptQualificationRequestRequest(input *AcceptQualificationRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcceptQualificationRequestRequest{Request: req, Input: input} + return AcceptQualificationRequestRequest{Request: req, Input: input, Copy: c.AcceptQualificationRequestRequest} } const opApproveAssignment = "ApproveAssignment" @@ -72,6 +73,7 @@ const opApproveAssignment = "ApproveAssignment" type ApproveAssignmentRequest struct { *aws.Request Input *ApproveAssignmentInput + Copy func(*ApproveAssignmentInput) ApproveAssignmentRequest } // Send marshals and sends the ApproveAssignment API request. @@ -130,7 +132,7 @@ func (c *MTurk) ApproveAssignmentRequest(input *ApproveAssignmentInput) ApproveA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ApproveAssignmentRequest{Request: req, Input: input} + return ApproveAssignmentRequest{Request: req, Input: input, Copy: c.ApproveAssignmentRequest} } const opAssociateQualificationWithWorker = "AssociateQualificationWithWorker" @@ -139,6 +141,7 @@ const opAssociateQualificationWithWorker = "AssociateQualificationWithWorker" type AssociateQualificationWithWorkerRequest struct { *aws.Request Input *AssociateQualificationWithWorkerInput + Copy func(*AssociateQualificationWithWorkerInput) AssociateQualificationWithWorkerRequest } // Send marshals and sends the AssociateQualificationWithWorker API request. @@ -191,7 +194,7 @@ func (c *MTurk) AssociateQualificationWithWorkerRequest(input *AssociateQualific req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateQualificationWithWorkerRequest{Request: req, Input: input} + return AssociateQualificationWithWorkerRequest{Request: req, Input: input, Copy: c.AssociateQualificationWithWorkerRequest} } const opCreateAdditionalAssignmentsForHIT = "CreateAdditionalAssignmentsForHIT" @@ -200,6 +203,7 @@ const opCreateAdditionalAssignmentsForHIT = "CreateAdditionalAssignmentsForHIT" type CreateAdditionalAssignmentsForHITRequest struct { *aws.Request Input *CreateAdditionalAssignmentsForHITInput + Copy func(*CreateAdditionalAssignmentsForHITInput) CreateAdditionalAssignmentsForHITRequest } // Send marshals and sends the CreateAdditionalAssignmentsForHIT API request. @@ -254,7 +258,7 @@ func (c *MTurk) CreateAdditionalAssignmentsForHITRequest(input *CreateAdditional req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAdditionalAssignmentsForHITRequest{Request: req, Input: input} + return CreateAdditionalAssignmentsForHITRequest{Request: req, Input: input, Copy: c.CreateAdditionalAssignmentsForHITRequest} } const opCreateHIT = "CreateHIT" @@ -263,6 +267,7 @@ const opCreateHIT = "CreateHIT" type CreateHITRequest struct { *aws.Request Input *CreateHITInput + Copy func(*CreateHITInput) CreateHITRequest } // Send marshals and sends the CreateHIT API request. @@ -324,7 +329,7 @@ func (c *MTurk) CreateHITRequest(input *CreateHITInput) CreateHITRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHITRequest{Request: req, Input: input} + return CreateHITRequest{Request: req, Input: input, Copy: c.CreateHITRequest} } const opCreateHITType = "CreateHITType" @@ -333,6 +338,7 @@ const opCreateHITType = "CreateHITType" type CreateHITTypeRequest struct { *aws.Request Input *CreateHITTypeInput + Copy func(*CreateHITTypeInput) CreateHITTypeRequest } // Send marshals and sends the CreateHITType API request. @@ -376,7 +382,7 @@ func (c *MTurk) CreateHITTypeRequest(input *CreateHITTypeInput) CreateHITTypeReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHITTypeRequest{Request: req, Input: input} + return CreateHITTypeRequest{Request: req, Input: input, Copy: c.CreateHITTypeRequest} } const opCreateHITWithHITType = "CreateHITWithHITType" @@ -385,6 +391,7 @@ const opCreateHITWithHITType = "CreateHITWithHITType" type CreateHITWithHITTypeRequest struct { *aws.Request Input *CreateHITWithHITTypeInput + Copy func(*CreateHITWithHITTypeInput) CreateHITWithHITTypeRequest } // Send marshals and sends the CreateHITWithHITType API request. @@ -437,7 +444,7 @@ func (c *MTurk) CreateHITWithHITTypeRequest(input *CreateHITWithHITTypeInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHITWithHITTypeRequest{Request: req, Input: input} + return CreateHITWithHITTypeRequest{Request: req, Input: input, Copy: c.CreateHITWithHITTypeRequest} } const opCreateQualificationType = "CreateQualificationType" @@ -446,6 +453,7 @@ const opCreateQualificationType = "CreateQualificationType" type CreateQualificationTypeRequest struct { *aws.Request Input *CreateQualificationTypeInput + Copy func(*CreateQualificationTypeInput) CreateQualificationTypeRequest } // Send marshals and sends the CreateQualificationType API request. @@ -487,7 +495,7 @@ func (c *MTurk) CreateQualificationTypeRequest(input *CreateQualificationTypeInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateQualificationTypeRequest{Request: req, Input: input} + return CreateQualificationTypeRequest{Request: req, Input: input, Copy: c.CreateQualificationTypeRequest} } const opCreateWorkerBlock = "CreateWorkerBlock" @@ -496,6 +504,7 @@ const opCreateWorkerBlock = "CreateWorkerBlock" type CreateWorkerBlockRequest struct { *aws.Request Input *CreateWorkerBlockInput + Copy func(*CreateWorkerBlockInput) CreateWorkerBlockRequest } // Send marshals and sends the CreateWorkerBlock API request. @@ -538,7 +547,7 @@ func (c *MTurk) CreateWorkerBlockRequest(input *CreateWorkerBlockInput) CreateWo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateWorkerBlockRequest{Request: req, Input: input} + return CreateWorkerBlockRequest{Request: req, Input: input, Copy: c.CreateWorkerBlockRequest} } const opDeleteHIT = "DeleteHIT" @@ -547,6 +556,7 @@ const opDeleteHIT = "DeleteHIT" type DeleteHITRequest struct { *aws.Request Input *DeleteHITInput + Copy func(*DeleteHITInput) DeleteHITRequest } // Send marshals and sends the DeleteHIT API request. @@ -605,7 +615,7 @@ func (c *MTurk) DeleteHITRequest(input *DeleteHITInput) DeleteHITRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteHITRequest{Request: req, Input: input} + return DeleteHITRequest{Request: req, Input: input, Copy: c.DeleteHITRequest} } const opDeleteQualificationType = "DeleteQualificationType" @@ -614,6 +624,7 @@ const opDeleteQualificationType = "DeleteQualificationType" type DeleteQualificationTypeRequest struct { *aws.Request Input *DeleteQualificationTypeInput + Copy func(*DeleteQualificationTypeInput) DeleteQualificationTypeRequest } // Send marshals and sends the DeleteQualificationType API request. @@ -666,7 +677,7 @@ func (c *MTurk) DeleteQualificationTypeRequest(input *DeleteQualificationTypeInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteQualificationTypeRequest{Request: req, Input: input} + return DeleteQualificationTypeRequest{Request: req, Input: input, Copy: c.DeleteQualificationTypeRequest} } const opDeleteWorkerBlock = "DeleteWorkerBlock" @@ -675,6 +686,7 @@ const opDeleteWorkerBlock = "DeleteWorkerBlock" type DeleteWorkerBlockRequest struct { *aws.Request Input *DeleteWorkerBlockInput + Copy func(*DeleteWorkerBlockInput) DeleteWorkerBlockRequest } // Send marshals and sends the DeleteWorkerBlock API request. @@ -720,7 +732,7 @@ func (c *MTurk) DeleteWorkerBlockRequest(input *DeleteWorkerBlockInput) DeleteWo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteWorkerBlockRequest{Request: req, Input: input} + return DeleteWorkerBlockRequest{Request: req, Input: input, Copy: c.DeleteWorkerBlockRequest} } const opDisassociateQualificationFromWorker = "DisassociateQualificationFromWorker" @@ -729,6 +741,7 @@ const opDisassociateQualificationFromWorker = "DisassociateQualificationFromWork type DisassociateQualificationFromWorkerRequest struct { *aws.Request Input *DisassociateQualificationFromWorkerInput + Copy func(*DisassociateQualificationFromWorkerInput) DisassociateQualificationFromWorkerRequest } // Send marshals and sends the DisassociateQualificationFromWorker API request. @@ -773,7 +786,7 @@ func (c *MTurk) DisassociateQualificationFromWorkerRequest(input *DisassociateQu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateQualificationFromWorkerRequest{Request: req, Input: input} + return DisassociateQualificationFromWorkerRequest{Request: req, Input: input, Copy: c.DisassociateQualificationFromWorkerRequest} } const opGetAccountBalance = "GetAccountBalance" @@ -782,6 +795,7 @@ const opGetAccountBalance = "GetAccountBalance" type GetAccountBalanceRequest struct { *aws.Request Input *GetAccountBalanceInput + Copy func(*GetAccountBalanceInput) GetAccountBalanceRequest } // Send marshals and sends the GetAccountBalance API request. @@ -823,7 +837,7 @@ func (c *MTurk) GetAccountBalanceRequest(input *GetAccountBalanceInput) GetAccou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccountBalanceRequest{Request: req, Input: input} + return GetAccountBalanceRequest{Request: req, Input: input, Copy: c.GetAccountBalanceRequest} } const opGetAssignment = "GetAssignment" @@ -832,6 +846,7 @@ const opGetAssignment = "GetAssignment" type GetAssignmentRequest struct { *aws.Request Input *GetAssignmentInput + Copy func(*GetAssignmentInput) GetAssignmentRequest } // Send marshals and sends the GetAssignment API request. @@ -872,7 +887,7 @@ func (c *MTurk) GetAssignmentRequest(input *GetAssignmentInput) GetAssignmentReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAssignmentRequest{Request: req, Input: input} + return GetAssignmentRequest{Request: req, Input: input, Copy: c.GetAssignmentRequest} } const opGetFileUploadURL = "GetFileUploadURL" @@ -881,6 +896,7 @@ const opGetFileUploadURL = "GetFileUploadURL" type GetFileUploadURLRequest struct { *aws.Request Input *GetFileUploadURLInput + Copy func(*GetFileUploadURLInput) GetFileUploadURLRequest } // Send marshals and sends the GetFileUploadURL API request. @@ -927,7 +943,7 @@ func (c *MTurk) GetFileUploadURLRequest(input *GetFileUploadURLInput) GetFileUpl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFileUploadURLRequest{Request: req, Input: input} + return GetFileUploadURLRequest{Request: req, Input: input, Copy: c.GetFileUploadURLRequest} } const opGetHIT = "GetHIT" @@ -936,6 +952,7 @@ const opGetHIT = "GetHIT" type GetHITRequest struct { *aws.Request Input *GetHITInput + Copy func(*GetHITInput) GetHITRequest } // Send marshals and sends the GetHIT API request. @@ -976,7 +993,7 @@ func (c *MTurk) GetHITRequest(input *GetHITInput) GetHITRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHITRequest{Request: req, Input: input} + return GetHITRequest{Request: req, Input: input, Copy: c.GetHITRequest} } const opGetQualificationScore = "GetQualificationScore" @@ -985,6 +1002,7 @@ const opGetQualificationScore = "GetQualificationScore" type GetQualificationScoreRequest struct { *aws.Request Input *GetQualificationScoreInput + Copy func(*GetQualificationScoreInput) GetQualificationScoreRequest } // Send marshals and sends the GetQualificationScore API request. @@ -1033,7 +1051,7 @@ func (c *MTurk) GetQualificationScoreRequest(input *GetQualificationScoreInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetQualificationScoreRequest{Request: req, Input: input} + return GetQualificationScoreRequest{Request: req, Input: input, Copy: c.GetQualificationScoreRequest} } const opGetQualificationType = "GetQualificationType" @@ -1042,6 +1060,7 @@ const opGetQualificationType = "GetQualificationType" type GetQualificationTypeRequest struct { *aws.Request Input *GetQualificationTypeInput + Copy func(*GetQualificationTypeInput) GetQualificationTypeRequest } // Send marshals and sends the GetQualificationType API request. @@ -1083,7 +1102,7 @@ func (c *MTurk) GetQualificationTypeRequest(input *GetQualificationTypeInput) Ge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetQualificationTypeRequest{Request: req, Input: input} + return GetQualificationTypeRequest{Request: req, Input: input, Copy: c.GetQualificationTypeRequest} } const opListAssignmentsForHIT = "ListAssignmentsForHIT" @@ -1092,6 +1111,7 @@ const opListAssignmentsForHIT = "ListAssignmentsForHIT" type ListAssignmentsForHITRequest struct { *aws.Request Input *ListAssignmentsForHITInput + Copy func(*ListAssignmentsForHITInput) ListAssignmentsForHITRequest } // Send marshals and sends the ListAssignmentsForHIT API request. @@ -1158,57 +1178,53 @@ func (c *MTurk) ListAssignmentsForHITRequest(input *ListAssignmentsForHITInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAssignmentsForHITRequest{Request: req, Input: input} + return ListAssignmentsForHITRequest{Request: req, Input: input, Copy: c.ListAssignmentsForHITRequest} } -// ListAssignmentsForHITPages iterates over the pages of a ListAssignmentsForHIT operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssignmentsForHIT method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAssignmentsForHITRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAssignmentsForHIT operation. -// pageNum := 0 -// err := client.ListAssignmentsForHITPages(params, -// func(page *ListAssignmentsForHITOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListAssignmentsForHITPages(input *ListAssignmentsForHITInput, fn func(*ListAssignmentsForHITOutput, bool) bool) error { - return c.ListAssignmentsForHITPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssignmentsForHITPagesWithContext same as ListAssignmentsForHITPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListAssignmentsForHITPagesWithContext(ctx aws.Context, input *ListAssignmentsForHITInput, fn func(*ListAssignmentsForHITOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAssignmentsForHITInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAssignmentsForHITRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAssignmentsForHITRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAssignmentsForHITRequest) Paginate(opts ...aws.Option) ListAssignmentsForHITPager { + return ListAssignmentsForHITPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAssignmentsForHITInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssignmentsForHITOutput), !p.HasNextPage()) - } - return p.Err() +// ListAssignmentsForHITPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAssignmentsForHITPager struct { + aws.Pager +} + +func (p *ListAssignmentsForHITPager) CurrentPage() *ListAssignmentsForHITOutput { + return p.Pager.CurrentPage().(*ListAssignmentsForHITOutput) } const opListBonusPayments = "ListBonusPayments" @@ -1217,6 +1233,7 @@ const opListBonusPayments = "ListBonusPayments" type ListBonusPaymentsRequest struct { *aws.Request Input *ListBonusPaymentsInput + Copy func(*ListBonusPaymentsInput) ListBonusPaymentsRequest } // Send marshals and sends the ListBonusPayments API request. @@ -1264,57 +1281,53 @@ func (c *MTurk) ListBonusPaymentsRequest(input *ListBonusPaymentsInput) ListBonu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBonusPaymentsRequest{Request: req, Input: input} + return ListBonusPaymentsRequest{Request: req, Input: input, Copy: c.ListBonusPaymentsRequest} } -// ListBonusPaymentsPages iterates over the pages of a ListBonusPayments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListBonusPayments method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListBonusPaymentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListBonusPayments operation. -// pageNum := 0 -// err := client.ListBonusPaymentsPages(params, -// func(page *ListBonusPaymentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListBonusPaymentsPages(input *ListBonusPaymentsInput, fn func(*ListBonusPaymentsOutput, bool) bool) error { - return c.ListBonusPaymentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListBonusPaymentsPagesWithContext same as ListBonusPaymentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListBonusPaymentsPagesWithContext(ctx aws.Context, input *ListBonusPaymentsInput, fn func(*ListBonusPaymentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListBonusPaymentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListBonusPaymentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListBonusPaymentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListBonusPaymentsRequest) Paginate(opts ...aws.Option) ListBonusPaymentsPager { + return ListBonusPaymentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListBonusPaymentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBonusPaymentsOutput), !p.HasNextPage()) - } - return p.Err() +// ListBonusPaymentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListBonusPaymentsPager struct { + aws.Pager +} + +func (p *ListBonusPaymentsPager) CurrentPage() *ListBonusPaymentsOutput { + return p.Pager.CurrentPage().(*ListBonusPaymentsOutput) } const opListHITs = "ListHITs" @@ -1323,6 +1336,7 @@ const opListHITs = "ListHITs" type ListHITsRequest struct { *aws.Request Input *ListHITsInput + Copy func(*ListHITsInput) ListHITsRequest } // Send marshals and sends the ListHITs API request. @@ -1371,57 +1385,53 @@ func (c *MTurk) ListHITsRequest(input *ListHITsInput) ListHITsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListHITsRequest{Request: req, Input: input} + return ListHITsRequest{Request: req, Input: input, Copy: c.ListHITsRequest} } -// ListHITsPages iterates over the pages of a ListHITs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHITs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListHITsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListHITs operation. -// pageNum := 0 -// err := client.ListHITsPages(params, -// func(page *ListHITsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListHITsPages(input *ListHITsInput, fn func(*ListHITsOutput, bool) bool) error { - return c.ListHITsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHITsPagesWithContext same as ListHITsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListHITsPagesWithContext(ctx aws.Context, input *ListHITsInput, fn func(*ListHITsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListHITsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListHITsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListHITsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListHITsRequest) Paginate(opts ...aws.Option) ListHITsPager { + return ListHITsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListHITsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHITsOutput), !p.HasNextPage()) - } - return p.Err() +// ListHITsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListHITsPager struct { + aws.Pager +} + +func (p *ListHITsPager) CurrentPage() *ListHITsOutput { + return p.Pager.CurrentPage().(*ListHITsOutput) } const opListHITsForQualificationType = "ListHITsForQualificationType" @@ -1430,6 +1440,7 @@ const opListHITsForQualificationType = "ListHITsForQualificationType" type ListHITsForQualificationTypeRequest struct { *aws.Request Input *ListHITsForQualificationTypeInput + Copy func(*ListHITsForQualificationTypeInput) ListHITsForQualificationTypeRequest } // Send marshals and sends the ListHITsForQualificationType API request. @@ -1479,57 +1490,53 @@ func (c *MTurk) ListHITsForQualificationTypeRequest(input *ListHITsForQualificat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListHITsForQualificationTypeRequest{Request: req, Input: input} + return ListHITsForQualificationTypeRequest{Request: req, Input: input, Copy: c.ListHITsForQualificationTypeRequest} } -// ListHITsForQualificationTypePages iterates over the pages of a ListHITsForQualificationType operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHITsForQualificationType method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListHITsForQualificationTypeRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListHITsForQualificationType operation. -// pageNum := 0 -// err := client.ListHITsForQualificationTypePages(params, -// func(page *ListHITsForQualificationTypeOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListHITsForQualificationTypePages(input *ListHITsForQualificationTypeInput, fn func(*ListHITsForQualificationTypeOutput, bool) bool) error { - return c.ListHITsForQualificationTypePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHITsForQualificationTypePagesWithContext same as ListHITsForQualificationTypePages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListHITsForQualificationTypePagesWithContext(ctx aws.Context, input *ListHITsForQualificationTypeInput, fn func(*ListHITsForQualificationTypeOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListHITsForQualificationTypeInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListHITsForQualificationTypeRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListHITsForQualificationTypeRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListHITsForQualificationTypeRequest) Paginate(opts ...aws.Option) ListHITsForQualificationTypePager { + return ListHITsForQualificationTypePager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListHITsForQualificationTypeInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHITsForQualificationTypeOutput), !p.HasNextPage()) - } - return p.Err() +// ListHITsForQualificationTypePager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListHITsForQualificationTypePager struct { + aws.Pager +} + +func (p *ListHITsForQualificationTypePager) CurrentPage() *ListHITsForQualificationTypeOutput { + return p.Pager.CurrentPage().(*ListHITsForQualificationTypeOutput) } const opListQualificationRequests = "ListQualificationRequests" @@ -1538,6 +1545,7 @@ const opListQualificationRequests = "ListQualificationRequests" type ListQualificationRequestsRequest struct { *aws.Request Input *ListQualificationRequestsInput + Copy func(*ListQualificationRequestsInput) ListQualificationRequestsRequest } // Send marshals and sends the ListQualificationRequests API request. @@ -1587,57 +1595,53 @@ func (c *MTurk) ListQualificationRequestsRequest(input *ListQualificationRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListQualificationRequestsRequest{Request: req, Input: input} + return ListQualificationRequestsRequest{Request: req, Input: input, Copy: c.ListQualificationRequestsRequest} } -// ListQualificationRequestsPages iterates over the pages of a ListQualificationRequests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListQualificationRequests method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListQualificationRequestsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListQualificationRequests operation. -// pageNum := 0 -// err := client.ListQualificationRequestsPages(params, -// func(page *ListQualificationRequestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListQualificationRequestsPages(input *ListQualificationRequestsInput, fn func(*ListQualificationRequestsOutput, bool) bool) error { - return c.ListQualificationRequestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListQualificationRequestsPagesWithContext same as ListQualificationRequestsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListQualificationRequestsPagesWithContext(ctx aws.Context, input *ListQualificationRequestsInput, fn func(*ListQualificationRequestsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListQualificationRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListQualificationRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListQualificationRequestsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListQualificationRequestsRequest) Paginate(opts ...aws.Option) ListQualificationRequestsPager { + return ListQualificationRequestsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListQualificationRequestsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListQualificationRequestsOutput), !p.HasNextPage()) - } - return p.Err() +// ListQualificationRequestsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListQualificationRequestsPager struct { + aws.Pager +} + +func (p *ListQualificationRequestsPager) CurrentPage() *ListQualificationRequestsOutput { + return p.Pager.CurrentPage().(*ListQualificationRequestsOutput) } const opListQualificationTypes = "ListQualificationTypes" @@ -1646,6 +1650,7 @@ const opListQualificationTypes = "ListQualificationTypes" type ListQualificationTypesRequest struct { *aws.Request Input *ListQualificationTypesInput + Copy func(*ListQualificationTypesInput) ListQualificationTypesRequest } // Send marshals and sends the ListQualificationTypes API request. @@ -1695,57 +1700,53 @@ func (c *MTurk) ListQualificationTypesRequest(input *ListQualificationTypesInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListQualificationTypesRequest{Request: req, Input: input} + return ListQualificationTypesRequest{Request: req, Input: input, Copy: c.ListQualificationTypesRequest} } -// ListQualificationTypesPages iterates over the pages of a ListQualificationTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListQualificationTypes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListQualificationTypesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListQualificationTypes operation. -// pageNum := 0 -// err := client.ListQualificationTypesPages(params, -// func(page *ListQualificationTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListQualificationTypesPages(input *ListQualificationTypesInput, fn func(*ListQualificationTypesOutput, bool) bool) error { - return c.ListQualificationTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListQualificationTypesPagesWithContext same as ListQualificationTypesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListQualificationTypesPagesWithContext(ctx aws.Context, input *ListQualificationTypesInput, fn func(*ListQualificationTypesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListQualificationTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListQualificationTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListQualificationTypesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListQualificationTypesRequest) Paginate(opts ...aws.Option) ListQualificationTypesPager { + return ListQualificationTypesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListQualificationTypesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListQualificationTypesOutput), !p.HasNextPage()) - } - return p.Err() +// ListQualificationTypesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListQualificationTypesPager struct { + aws.Pager +} + +func (p *ListQualificationTypesPager) CurrentPage() *ListQualificationTypesOutput { + return p.Pager.CurrentPage().(*ListQualificationTypesOutput) } const opListReviewPolicyResultsForHIT = "ListReviewPolicyResultsForHIT" @@ -1754,6 +1755,7 @@ const opListReviewPolicyResultsForHIT = "ListReviewPolicyResultsForHIT" type ListReviewPolicyResultsForHITRequest struct { *aws.Request Input *ListReviewPolicyResultsForHITInput + Copy func(*ListReviewPolicyResultsForHITInput) ListReviewPolicyResultsForHITRequest } // Send marshals and sends the ListReviewPolicyResultsForHIT API request. @@ -1804,57 +1806,53 @@ func (c *MTurk) ListReviewPolicyResultsForHITRequest(input *ListReviewPolicyResu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListReviewPolicyResultsForHITRequest{Request: req, Input: input} + return ListReviewPolicyResultsForHITRequest{Request: req, Input: input, Copy: c.ListReviewPolicyResultsForHITRequest} } -// ListReviewPolicyResultsForHITPages iterates over the pages of a ListReviewPolicyResultsForHIT operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReviewPolicyResultsForHIT method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListReviewPolicyResultsForHITRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListReviewPolicyResultsForHIT operation. -// pageNum := 0 -// err := client.ListReviewPolicyResultsForHITPages(params, -// func(page *ListReviewPolicyResultsForHITOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListReviewPolicyResultsForHITPages(input *ListReviewPolicyResultsForHITInput, fn func(*ListReviewPolicyResultsForHITOutput, bool) bool) error { - return c.ListReviewPolicyResultsForHITPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReviewPolicyResultsForHITPagesWithContext same as ListReviewPolicyResultsForHITPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListReviewPolicyResultsForHITPagesWithContext(ctx aws.Context, input *ListReviewPolicyResultsForHITInput, fn func(*ListReviewPolicyResultsForHITOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListReviewPolicyResultsForHITInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListReviewPolicyResultsForHITRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListReviewPolicyResultsForHITRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListReviewPolicyResultsForHITRequest) Paginate(opts ...aws.Option) ListReviewPolicyResultsForHITPager { + return ListReviewPolicyResultsForHITPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListReviewPolicyResultsForHITInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListReviewPolicyResultsForHITOutput), !p.HasNextPage()) - } - return p.Err() +// ListReviewPolicyResultsForHITPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListReviewPolicyResultsForHITPager struct { + aws.Pager +} + +func (p *ListReviewPolicyResultsForHITPager) CurrentPage() *ListReviewPolicyResultsForHITOutput { + return p.Pager.CurrentPage().(*ListReviewPolicyResultsForHITOutput) } const opListReviewableHITs = "ListReviewableHITs" @@ -1863,6 +1861,7 @@ const opListReviewableHITs = "ListReviewableHITs" type ListReviewableHITsRequest struct { *aws.Request Input *ListReviewableHITsInput + Copy func(*ListReviewableHITsInput) ListReviewableHITsRequest } // Send marshals and sends the ListReviewableHITs API request. @@ -1911,57 +1910,53 @@ func (c *MTurk) ListReviewableHITsRequest(input *ListReviewableHITsInput) ListRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListReviewableHITsRequest{Request: req, Input: input} + return ListReviewableHITsRequest{Request: req, Input: input, Copy: c.ListReviewableHITsRequest} } -// ListReviewableHITsPages iterates over the pages of a ListReviewableHITs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReviewableHITs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListReviewableHITsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListReviewableHITs operation. -// pageNum := 0 -// err := client.ListReviewableHITsPages(params, -// func(page *ListReviewableHITsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListReviewableHITsPages(input *ListReviewableHITsInput, fn func(*ListReviewableHITsOutput, bool) bool) error { - return c.ListReviewableHITsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReviewableHITsPagesWithContext same as ListReviewableHITsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListReviewableHITsPagesWithContext(ctx aws.Context, input *ListReviewableHITsInput, fn func(*ListReviewableHITsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListReviewableHITsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListReviewableHITsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListReviewableHITsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListReviewableHITsRequest) Paginate(opts ...aws.Option) ListReviewableHITsPager { + return ListReviewableHITsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListReviewableHITsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListReviewableHITsOutput), !p.HasNextPage()) - } - return p.Err() +// ListReviewableHITsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListReviewableHITsPager struct { + aws.Pager +} + +func (p *ListReviewableHITsPager) CurrentPage() *ListReviewableHITsOutput { + return p.Pager.CurrentPage().(*ListReviewableHITsOutput) } const opListWorkerBlocks = "ListWorkerBlocks" @@ -1970,6 +1965,7 @@ const opListWorkerBlocks = "ListWorkerBlocks" type ListWorkerBlocksRequest struct { *aws.Request Input *ListWorkerBlocksInput + Copy func(*ListWorkerBlocksInput) ListWorkerBlocksRequest } // Send marshals and sends the ListWorkerBlocks API request. @@ -2017,57 +2013,53 @@ func (c *MTurk) ListWorkerBlocksRequest(input *ListWorkerBlocksInput) ListWorker req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListWorkerBlocksRequest{Request: req, Input: input} + return ListWorkerBlocksRequest{Request: req, Input: input, Copy: c.ListWorkerBlocksRequest} } -// ListWorkerBlocksPages iterates over the pages of a ListWorkerBlocks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkerBlocks method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListWorkerBlocksRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListWorkerBlocks operation. -// pageNum := 0 -// err := client.ListWorkerBlocksPages(params, -// func(page *ListWorkerBlocksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListWorkerBlocksPages(input *ListWorkerBlocksInput, fn func(*ListWorkerBlocksOutput, bool) bool) error { - return c.ListWorkerBlocksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkerBlocksPagesWithContext same as ListWorkerBlocksPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListWorkerBlocksPagesWithContext(ctx aws.Context, input *ListWorkerBlocksInput, fn func(*ListWorkerBlocksOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListWorkerBlocksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListWorkerBlocksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListWorkerBlocksRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListWorkerBlocksRequest) Paginate(opts ...aws.Option) ListWorkerBlocksPager { + return ListWorkerBlocksPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListWorkerBlocksInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWorkerBlocksOutput), !p.HasNextPage()) - } - return p.Err() +// ListWorkerBlocksPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListWorkerBlocksPager struct { + aws.Pager +} + +func (p *ListWorkerBlocksPager) CurrentPage() *ListWorkerBlocksOutput { + return p.Pager.CurrentPage().(*ListWorkerBlocksOutput) } const opListWorkersWithQualificationType = "ListWorkersWithQualificationType" @@ -2076,6 +2068,7 @@ const opListWorkersWithQualificationType = "ListWorkersWithQualificationType" type ListWorkersWithQualificationTypeRequest struct { *aws.Request Input *ListWorkersWithQualificationTypeInput + Copy func(*ListWorkersWithQualificationTypeInput) ListWorkersWithQualificationTypeRequest } // Send marshals and sends the ListWorkersWithQualificationType API request. @@ -2123,57 +2116,53 @@ func (c *MTurk) ListWorkersWithQualificationTypeRequest(input *ListWorkersWithQu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListWorkersWithQualificationTypeRequest{Request: req, Input: input} + return ListWorkersWithQualificationTypeRequest{Request: req, Input: input, Copy: c.ListWorkersWithQualificationTypeRequest} } -// ListWorkersWithQualificationTypePages iterates over the pages of a ListWorkersWithQualificationType operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkersWithQualificationType method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListWorkersWithQualificationTypeRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListWorkersWithQualificationType operation. -// pageNum := 0 -// err := client.ListWorkersWithQualificationTypePages(params, -// func(page *ListWorkersWithQualificationTypeOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *MTurk) ListWorkersWithQualificationTypePages(input *ListWorkersWithQualificationTypeInput, fn func(*ListWorkersWithQualificationTypeOutput, bool) bool) error { - return c.ListWorkersWithQualificationTypePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkersWithQualificationTypePagesWithContext same as ListWorkersWithQualificationTypePages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *MTurk) ListWorkersWithQualificationTypePagesWithContext(ctx aws.Context, input *ListWorkersWithQualificationTypeInput, fn func(*ListWorkersWithQualificationTypeOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListWorkersWithQualificationTypeInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListWorkersWithQualificationTypeRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListWorkersWithQualificationTypeRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListWorkersWithQualificationTypeRequest) Paginate(opts ...aws.Option) ListWorkersWithQualificationTypePager { + return ListWorkersWithQualificationTypePager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListWorkersWithQualificationTypeInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWorkersWithQualificationTypeOutput), !p.HasNextPage()) - } - return p.Err() +// ListWorkersWithQualificationTypePager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListWorkersWithQualificationTypePager struct { + aws.Pager +} + +func (p *ListWorkersWithQualificationTypePager) CurrentPage() *ListWorkersWithQualificationTypeOutput { + return p.Pager.CurrentPage().(*ListWorkersWithQualificationTypeOutput) } const opNotifyWorkers = "NotifyWorkers" @@ -2182,6 +2171,7 @@ const opNotifyWorkers = "NotifyWorkers" type NotifyWorkersRequest struct { *aws.Request Input *NotifyWorkersInput + Copy func(*NotifyWorkersInput) NotifyWorkersRequest } // Send marshals and sends the NotifyWorkers API request. @@ -2226,7 +2216,7 @@ func (c *MTurk) NotifyWorkersRequest(input *NotifyWorkersInput) NotifyWorkersReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return NotifyWorkersRequest{Request: req, Input: input} + return NotifyWorkersRequest{Request: req, Input: input, Copy: c.NotifyWorkersRequest} } const opRejectAssignment = "RejectAssignment" @@ -2235,6 +2225,7 @@ const opRejectAssignment = "RejectAssignment" type RejectAssignmentRequest struct { *aws.Request Input *RejectAssignmentInput + Copy func(*RejectAssignmentInput) RejectAssignmentRequest } // Send marshals and sends the RejectAssignment API request. @@ -2283,7 +2274,7 @@ func (c *MTurk) RejectAssignmentRequest(input *RejectAssignmentInput) RejectAssi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RejectAssignmentRequest{Request: req, Input: input} + return RejectAssignmentRequest{Request: req, Input: input, Copy: c.RejectAssignmentRequest} } const opRejectQualificationRequest = "RejectQualificationRequest" @@ -2292,6 +2283,7 @@ const opRejectQualificationRequest = "RejectQualificationRequest" type RejectQualificationRequestRequest struct { *aws.Request Input *RejectQualificationRequestInput + Copy func(*RejectQualificationRequestInput) RejectQualificationRequestRequest } // Send marshals and sends the RejectQualificationRequest API request. @@ -2335,7 +2327,7 @@ func (c *MTurk) RejectQualificationRequestRequest(input *RejectQualificationRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RejectQualificationRequestRequest{Request: req, Input: input} + return RejectQualificationRequestRequest{Request: req, Input: input, Copy: c.RejectQualificationRequestRequest} } const opSendBonus = "SendBonus" @@ -2344,6 +2336,7 @@ const opSendBonus = "SendBonus" type SendBonusRequest struct { *aws.Request Input *SendBonusInput + Copy func(*SendBonusInput) SendBonusRequest } // Send marshals and sends the SendBonus API request. @@ -2392,7 +2385,7 @@ func (c *MTurk) SendBonusRequest(input *SendBonusInput) SendBonusRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendBonusRequest{Request: req, Input: input} + return SendBonusRequest{Request: req, Input: input, Copy: c.SendBonusRequest} } const opSendTestEventNotification = "SendTestEventNotification" @@ -2401,6 +2394,7 @@ const opSendTestEventNotification = "SendTestEventNotification" type SendTestEventNotificationRequest struct { *aws.Request Input *SendTestEventNotificationInput + Copy func(*SendTestEventNotificationInput) SendTestEventNotificationRequest } // Send marshals and sends the SendTestEventNotification API request. @@ -2446,7 +2440,7 @@ func (c *MTurk) SendTestEventNotificationRequest(input *SendTestEventNotificatio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendTestEventNotificationRequest{Request: req, Input: input} + return SendTestEventNotificationRequest{Request: req, Input: input, Copy: c.SendTestEventNotificationRequest} } const opUpdateExpirationForHIT = "UpdateExpirationForHIT" @@ -2455,6 +2449,7 @@ const opUpdateExpirationForHIT = "UpdateExpirationForHIT" type UpdateExpirationForHITRequest struct { *aws.Request Input *UpdateExpirationForHITInput + Copy func(*UpdateExpirationForHITInput) UpdateExpirationForHITRequest } // Send marshals and sends the UpdateExpirationForHIT API request. @@ -2497,7 +2492,7 @@ func (c *MTurk) UpdateExpirationForHITRequest(input *UpdateExpirationForHITInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateExpirationForHITRequest{Request: req, Input: input} + return UpdateExpirationForHITRequest{Request: req, Input: input, Copy: c.UpdateExpirationForHITRequest} } const opUpdateHITReviewStatus = "UpdateHITReviewStatus" @@ -2506,6 +2501,7 @@ const opUpdateHITReviewStatus = "UpdateHITReviewStatus" type UpdateHITReviewStatusRequest struct { *aws.Request Input *UpdateHITReviewStatusInput + Copy func(*UpdateHITReviewStatusInput) UpdateHITReviewStatusRequest } // Send marshals and sends the UpdateHITReviewStatus API request. @@ -2548,7 +2544,7 @@ func (c *MTurk) UpdateHITReviewStatusRequest(input *UpdateHITReviewStatusInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateHITReviewStatusRequest{Request: req, Input: input} + return UpdateHITReviewStatusRequest{Request: req, Input: input, Copy: c.UpdateHITReviewStatusRequest} } const opUpdateHITTypeOfHIT = "UpdateHITTypeOfHIT" @@ -2557,6 +2553,7 @@ const opUpdateHITTypeOfHIT = "UpdateHITTypeOfHIT" type UpdateHITTypeOfHITRequest struct { *aws.Request Input *UpdateHITTypeOfHITInput + Copy func(*UpdateHITTypeOfHITInput) UpdateHITTypeOfHITRequest } // Send marshals and sends the UpdateHITTypeOfHIT API request. @@ -2600,7 +2597,7 @@ func (c *MTurk) UpdateHITTypeOfHITRequest(input *UpdateHITTypeOfHITInput) Update req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateHITTypeOfHITRequest{Request: req, Input: input} + return UpdateHITTypeOfHITRequest{Request: req, Input: input, Copy: c.UpdateHITTypeOfHITRequest} } const opUpdateNotificationSettings = "UpdateNotificationSettings" @@ -2609,6 +2606,7 @@ const opUpdateNotificationSettings = "UpdateNotificationSettings" type UpdateNotificationSettingsRequest struct { *aws.Request Input *UpdateNotificationSettingsInput + Copy func(*UpdateNotificationSettingsInput) UpdateNotificationSettingsRequest } // Send marshals and sends the UpdateNotificationSettings API request. @@ -2658,7 +2656,7 @@ func (c *MTurk) UpdateNotificationSettingsRequest(input *UpdateNotificationSetti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateNotificationSettingsRequest{Request: req, Input: input} + return UpdateNotificationSettingsRequest{Request: req, Input: input, Copy: c.UpdateNotificationSettingsRequest} } const opUpdateQualificationType = "UpdateQualificationType" @@ -2667,6 +2665,7 @@ const opUpdateQualificationType = "UpdateQualificationType" type UpdateQualificationTypeRequest struct { *aws.Request Input *UpdateQualificationTypeInput + Copy func(*UpdateQualificationTypeInput) UpdateQualificationTypeRequest } // Send marshals and sends the UpdateQualificationType API request. @@ -2737,7 +2736,7 @@ func (c *MTurk) UpdateQualificationTypeRequest(input *UpdateQualificationTypeInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateQualificationTypeRequest{Request: req, Input: input} + return UpdateQualificationTypeRequest{Request: req, Input: input, Copy: c.UpdateQualificationTypeRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/mturk-requester-2017-01-17/AcceptQualificationRequestRequest diff --git a/service/mturk/mturkiface/interface.go b/service/mturk/mturkiface/interface.go index 66b8e34bfaf..faa921215f9 100644 --- a/service/mturk/mturkiface/interface.go +++ b/service/mturk/mturkiface/interface.go @@ -9,7 +9,6 @@ package mturkiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mturk" ) @@ -103,54 +102,24 @@ type MTurkAPI interface { ListAssignmentsForHITRequest(*mturk.ListAssignmentsForHITInput) mturk.ListAssignmentsForHITRequest - ListAssignmentsForHITPages(*mturk.ListAssignmentsForHITInput, func(*mturk.ListAssignmentsForHITOutput, bool) bool) error - ListAssignmentsForHITPagesWithContext(aws.Context, *mturk.ListAssignmentsForHITInput, func(*mturk.ListAssignmentsForHITOutput, bool) bool, ...aws.Option) error - ListBonusPaymentsRequest(*mturk.ListBonusPaymentsInput) mturk.ListBonusPaymentsRequest - ListBonusPaymentsPages(*mturk.ListBonusPaymentsInput, func(*mturk.ListBonusPaymentsOutput, bool) bool) error - ListBonusPaymentsPagesWithContext(aws.Context, *mturk.ListBonusPaymentsInput, func(*mturk.ListBonusPaymentsOutput, bool) bool, ...aws.Option) error - ListHITsRequest(*mturk.ListHITsInput) mturk.ListHITsRequest - ListHITsPages(*mturk.ListHITsInput, func(*mturk.ListHITsOutput, bool) bool) error - ListHITsPagesWithContext(aws.Context, *mturk.ListHITsInput, func(*mturk.ListHITsOutput, bool) bool, ...aws.Option) error - ListHITsForQualificationTypeRequest(*mturk.ListHITsForQualificationTypeInput) mturk.ListHITsForQualificationTypeRequest - ListHITsForQualificationTypePages(*mturk.ListHITsForQualificationTypeInput, func(*mturk.ListHITsForQualificationTypeOutput, bool) bool) error - ListHITsForQualificationTypePagesWithContext(aws.Context, *mturk.ListHITsForQualificationTypeInput, func(*mturk.ListHITsForQualificationTypeOutput, bool) bool, ...aws.Option) error - ListQualificationRequestsRequest(*mturk.ListQualificationRequestsInput) mturk.ListQualificationRequestsRequest - ListQualificationRequestsPages(*mturk.ListQualificationRequestsInput, func(*mturk.ListQualificationRequestsOutput, bool) bool) error - ListQualificationRequestsPagesWithContext(aws.Context, *mturk.ListQualificationRequestsInput, func(*mturk.ListQualificationRequestsOutput, bool) bool, ...aws.Option) error - ListQualificationTypesRequest(*mturk.ListQualificationTypesInput) mturk.ListQualificationTypesRequest - ListQualificationTypesPages(*mturk.ListQualificationTypesInput, func(*mturk.ListQualificationTypesOutput, bool) bool) error - ListQualificationTypesPagesWithContext(aws.Context, *mturk.ListQualificationTypesInput, func(*mturk.ListQualificationTypesOutput, bool) bool, ...aws.Option) error - ListReviewPolicyResultsForHITRequest(*mturk.ListReviewPolicyResultsForHITInput) mturk.ListReviewPolicyResultsForHITRequest - ListReviewPolicyResultsForHITPages(*mturk.ListReviewPolicyResultsForHITInput, func(*mturk.ListReviewPolicyResultsForHITOutput, bool) bool) error - ListReviewPolicyResultsForHITPagesWithContext(aws.Context, *mturk.ListReviewPolicyResultsForHITInput, func(*mturk.ListReviewPolicyResultsForHITOutput, bool) bool, ...aws.Option) error - ListReviewableHITsRequest(*mturk.ListReviewableHITsInput) mturk.ListReviewableHITsRequest - ListReviewableHITsPages(*mturk.ListReviewableHITsInput, func(*mturk.ListReviewableHITsOutput, bool) bool) error - ListReviewableHITsPagesWithContext(aws.Context, *mturk.ListReviewableHITsInput, func(*mturk.ListReviewableHITsOutput, bool) bool, ...aws.Option) error - ListWorkerBlocksRequest(*mturk.ListWorkerBlocksInput) mturk.ListWorkerBlocksRequest - ListWorkerBlocksPages(*mturk.ListWorkerBlocksInput, func(*mturk.ListWorkerBlocksOutput, bool) bool) error - ListWorkerBlocksPagesWithContext(aws.Context, *mturk.ListWorkerBlocksInput, func(*mturk.ListWorkerBlocksOutput, bool) bool, ...aws.Option) error - ListWorkersWithQualificationTypeRequest(*mturk.ListWorkersWithQualificationTypeInput) mturk.ListWorkersWithQualificationTypeRequest - ListWorkersWithQualificationTypePages(*mturk.ListWorkersWithQualificationTypeInput, func(*mturk.ListWorkersWithQualificationTypeOutput, bool) bool) error - ListWorkersWithQualificationTypePagesWithContext(aws.Context, *mturk.ListWorkersWithQualificationTypeInput, func(*mturk.ListWorkersWithQualificationTypeOutput, bool) bool, ...aws.Option) error - NotifyWorkersRequest(*mturk.NotifyWorkersInput) mturk.NotifyWorkersRequest RejectAssignmentRequest(*mturk.RejectAssignmentInput) mturk.RejectAssignmentRequest diff --git a/service/opsworks/api.go b/service/opsworks/api.go index 07ccee48ec0..bcd59116229 100644 --- a/service/opsworks/api.go +++ b/service/opsworks/api.go @@ -17,6 +17,7 @@ const opAssignInstance = "AssignInstance" type AssignInstanceRequest struct { *aws.Request Input *AssignInstanceInput + Copy func(*AssignInstanceInput) AssignInstanceRequest } // Send marshals and sends the AssignInstance API request. @@ -71,7 +72,7 @@ func (c *OpsWorks) AssignInstanceRequest(input *AssignInstanceInput) AssignInsta req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AssignInstanceRequest{Request: req, Input: input} + return AssignInstanceRequest{Request: req, Input: input, Copy: c.AssignInstanceRequest} } const opAssignVolume = "AssignVolume" @@ -80,6 +81,7 @@ const opAssignVolume = "AssignVolume" type AssignVolumeRequest struct { *aws.Request Input *AssignVolumeInput + Copy func(*AssignVolumeInput) AssignVolumeRequest } // Send marshals and sends the AssignVolume API request. @@ -131,7 +133,7 @@ func (c *OpsWorks) AssignVolumeRequest(input *AssignVolumeInput) AssignVolumeReq req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AssignVolumeRequest{Request: req, Input: input} + return AssignVolumeRequest{Request: req, Input: input, Copy: c.AssignVolumeRequest} } const opAssociateElasticIp = "AssociateElasticIp" @@ -140,6 +142,7 @@ const opAssociateElasticIp = "AssociateElasticIp" type AssociateElasticIpRequest struct { *aws.Request Input *AssociateElasticIpInput + Copy func(*AssociateElasticIpInput) AssociateElasticIpRequest } // Send marshals and sends the AssociateElasticIp API request. @@ -189,7 +192,7 @@ func (c *OpsWorks) AssociateElasticIpRequest(input *AssociateElasticIpInput) Ass req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AssociateElasticIpRequest{Request: req, Input: input} + return AssociateElasticIpRequest{Request: req, Input: input, Copy: c.AssociateElasticIpRequest} } const opAttachElasticLoadBalancer = "AttachElasticLoadBalancer" @@ -198,6 +201,7 @@ const opAttachElasticLoadBalancer = "AttachElasticLoadBalancer" type AttachElasticLoadBalancerRequest struct { *aws.Request Input *AttachElasticLoadBalancerInput + Copy func(*AttachElasticLoadBalancerInput) AttachElasticLoadBalancerRequest } // Send marshals and sends the AttachElasticLoadBalancer API request. @@ -252,7 +256,7 @@ func (c *OpsWorks) AttachElasticLoadBalancerRequest(input *AttachElasticLoadBala req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AttachElasticLoadBalancerRequest{Request: req, Input: input} + return AttachElasticLoadBalancerRequest{Request: req, Input: input, Copy: c.AttachElasticLoadBalancerRequest} } const opCloneStack = "CloneStack" @@ -261,6 +265,7 @@ const opCloneStack = "CloneStack" type CloneStackRequest struct { *aws.Request Input *CloneStackInput + Copy func(*CloneStackInput) CloneStackRequest } // Send marshals and sends the CloneStack API request. @@ -307,7 +312,7 @@ func (c *OpsWorks) CloneStackRequest(input *CloneStackInput) CloneStackRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CloneStackRequest{Request: req, Input: input} + return CloneStackRequest{Request: req, Input: input, Copy: c.CloneStackRequest} } const opCreateApp = "CreateApp" @@ -316,6 +321,7 @@ const opCreateApp = "CreateApp" type CreateAppRequest struct { *aws.Request Input *CreateAppInput + Copy func(*CreateAppInput) CreateAppRequest } // Send marshals and sends the CreateApp API request. @@ -362,7 +368,7 @@ func (c *OpsWorks) CreateAppRequest(input *CreateAppInput) CreateAppRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAppRequest{Request: req, Input: input} + return CreateAppRequest{Request: req, Input: input, Copy: c.CreateAppRequest} } const opCreateDeployment = "CreateDeployment" @@ -371,6 +377,7 @@ const opCreateDeployment = "CreateDeployment" type CreateDeploymentRequest struct { *aws.Request Input *CreateDeploymentInput + Copy func(*CreateDeploymentInput) CreateDeploymentRequest } // Send marshals and sends the CreateDeployment API request. @@ -418,7 +425,7 @@ func (c *OpsWorks) CreateDeploymentRequest(input *CreateDeploymentInput) CreateD req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDeploymentRequest{Request: req, Input: input} + return CreateDeploymentRequest{Request: req, Input: input, Copy: c.CreateDeploymentRequest} } const opCreateInstance = "CreateInstance" @@ -427,6 +434,7 @@ const opCreateInstance = "CreateInstance" type CreateInstanceRequest struct { *aws.Request Input *CreateInstanceInput + Copy func(*CreateInstanceInput) CreateInstanceRequest } // Send marshals and sends the CreateInstance API request. @@ -473,7 +481,7 @@ func (c *OpsWorks) CreateInstanceRequest(input *CreateInstanceInput) CreateInsta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateInstanceRequest{Request: req, Input: input} + return CreateInstanceRequest{Request: req, Input: input, Copy: c.CreateInstanceRequest} } const opCreateLayer = "CreateLayer" @@ -482,6 +490,7 @@ const opCreateLayer = "CreateLayer" type CreateLayerRequest struct { *aws.Request Input *CreateLayerInput + Copy func(*CreateLayerInput) CreateLayerRequest } // Send marshals and sends the CreateLayer API request. @@ -534,7 +543,7 @@ func (c *OpsWorks) CreateLayerRequest(input *CreateLayerInput) CreateLayerReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLayerRequest{Request: req, Input: input} + return CreateLayerRequest{Request: req, Input: input, Copy: c.CreateLayerRequest} } const opCreateStack = "CreateStack" @@ -543,6 +552,7 @@ const opCreateStack = "CreateStack" type CreateStackRequest struct { *aws.Request Input *CreateStackInput + Copy func(*CreateStackInput) CreateStackRequest } // Send marshals and sends the CreateStack API request. @@ -587,7 +597,7 @@ func (c *OpsWorks) CreateStackRequest(input *CreateStackInput) CreateStackReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStackRequest{Request: req, Input: input} + return CreateStackRequest{Request: req, Input: input, Copy: c.CreateStackRequest} } const opCreateUserProfile = "CreateUserProfile" @@ -596,6 +606,7 @@ const opCreateUserProfile = "CreateUserProfile" type CreateUserProfileRequest struct { *aws.Request Input *CreateUserProfileInput + Copy func(*CreateUserProfileInput) CreateUserProfileRequest } // Send marshals and sends the CreateUserProfile API request. @@ -640,7 +651,7 @@ func (c *OpsWorks) CreateUserProfileRequest(input *CreateUserProfileInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserProfileRequest{Request: req, Input: input} + return CreateUserProfileRequest{Request: req, Input: input, Copy: c.CreateUserProfileRequest} } const opDeleteApp = "DeleteApp" @@ -649,6 +660,7 @@ const opDeleteApp = "DeleteApp" type DeleteAppRequest struct { *aws.Request Input *DeleteAppInput + Copy func(*DeleteAppInput) DeleteAppRequest } // Send marshals and sends the DeleteApp API request. @@ -696,7 +708,7 @@ func (c *OpsWorks) DeleteAppRequest(input *DeleteAppInput) DeleteAppRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAppRequest{Request: req, Input: input} + return DeleteAppRequest{Request: req, Input: input, Copy: c.DeleteAppRequest} } const opDeleteInstance = "DeleteInstance" @@ -705,6 +717,7 @@ const opDeleteInstance = "DeleteInstance" type DeleteInstanceRequest struct { *aws.Request Input *DeleteInstanceInput + Copy func(*DeleteInstanceInput) DeleteInstanceRequest } // Send marshals and sends the DeleteInstance API request. @@ -755,7 +768,7 @@ func (c *OpsWorks) DeleteInstanceRequest(input *DeleteInstanceInput) DeleteInsta req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteInstanceRequest{Request: req, Input: input} + return DeleteInstanceRequest{Request: req, Input: input, Copy: c.DeleteInstanceRequest} } const opDeleteLayer = "DeleteLayer" @@ -764,6 +777,7 @@ const opDeleteLayer = "DeleteLayer" type DeleteLayerRequest struct { *aws.Request Input *DeleteLayerInput + Copy func(*DeleteLayerInput) DeleteLayerRequest } // Send marshals and sends the DeleteLayer API request. @@ -813,7 +827,7 @@ func (c *OpsWorks) DeleteLayerRequest(input *DeleteLayerInput) DeleteLayerReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteLayerRequest{Request: req, Input: input} + return DeleteLayerRequest{Request: req, Input: input, Copy: c.DeleteLayerRequest} } const opDeleteStack = "DeleteStack" @@ -822,6 +836,7 @@ const opDeleteStack = "DeleteStack" type DeleteStackRequest struct { *aws.Request Input *DeleteStackInput + Copy func(*DeleteStackInput) DeleteStackRequest } // Send marshals and sends the DeleteStack API request. @@ -871,7 +886,7 @@ func (c *OpsWorks) DeleteStackRequest(input *DeleteStackInput) DeleteStackReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteStackRequest{Request: req, Input: input} + return DeleteStackRequest{Request: req, Input: input, Copy: c.DeleteStackRequest} } const opDeleteUserProfile = "DeleteUserProfile" @@ -880,6 +895,7 @@ const opDeleteUserProfile = "DeleteUserProfile" type DeleteUserProfileRequest struct { *aws.Request Input *DeleteUserProfileInput + Copy func(*DeleteUserProfileInput) DeleteUserProfileRequest } // Send marshals and sends the DeleteUserProfile API request. @@ -926,7 +942,7 @@ func (c *OpsWorks) DeleteUserProfileRequest(input *DeleteUserProfileInput) Delet req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteUserProfileRequest{Request: req, Input: input} + return DeleteUserProfileRequest{Request: req, Input: input, Copy: c.DeleteUserProfileRequest} } const opDeregisterEcsCluster = "DeregisterEcsCluster" @@ -935,6 +951,7 @@ const opDeregisterEcsCluster = "DeregisterEcsCluster" type DeregisterEcsClusterRequest struct { *aws.Request Input *DeregisterEcsClusterInput + Copy func(*DeregisterEcsClusterInput) DeregisterEcsClusterRequest } // Send marshals and sends the DeregisterEcsCluster API request. @@ -983,7 +1000,7 @@ func (c *OpsWorks) DeregisterEcsClusterRequest(input *DeregisterEcsClusterInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeregisterEcsClusterRequest{Request: req, Input: input} + return DeregisterEcsClusterRequest{Request: req, Input: input, Copy: c.DeregisterEcsClusterRequest} } const opDeregisterElasticIp = "DeregisterElasticIp" @@ -992,6 +1009,7 @@ const opDeregisterElasticIp = "DeregisterElasticIp" type DeregisterElasticIpRequest struct { *aws.Request Input *DeregisterElasticIpInput + Copy func(*DeregisterElasticIpInput) DeregisterElasticIpRequest } // Send marshals and sends the DeregisterElasticIp API request. @@ -1040,7 +1058,7 @@ func (c *OpsWorks) DeregisterElasticIpRequest(input *DeregisterElasticIpInput) D req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeregisterElasticIpRequest{Request: req, Input: input} + return DeregisterElasticIpRequest{Request: req, Input: input, Copy: c.DeregisterElasticIpRequest} } const opDeregisterInstance = "DeregisterInstance" @@ -1049,6 +1067,7 @@ const opDeregisterInstance = "DeregisterInstance" type DeregisterInstanceRequest struct { *aws.Request Input *DeregisterInstanceInput + Copy func(*DeregisterInstanceInput) DeregisterInstanceRequest } // Send marshals and sends the DeregisterInstance API request. @@ -1098,7 +1117,7 @@ func (c *OpsWorks) DeregisterInstanceRequest(input *DeregisterInstanceInput) Der req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeregisterInstanceRequest{Request: req, Input: input} + return DeregisterInstanceRequest{Request: req, Input: input, Copy: c.DeregisterInstanceRequest} } const opDeregisterRdsDbInstance = "DeregisterRdsDbInstance" @@ -1107,6 +1126,7 @@ const opDeregisterRdsDbInstance = "DeregisterRdsDbInstance" type DeregisterRdsDbInstanceRequest struct { *aws.Request Input *DeregisterRdsDbInstanceInput + Copy func(*DeregisterRdsDbInstanceInput) DeregisterRdsDbInstanceRequest } // Send marshals and sends the DeregisterRdsDbInstance API request. @@ -1154,7 +1174,7 @@ func (c *OpsWorks) DeregisterRdsDbInstanceRequest(input *DeregisterRdsDbInstance req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeregisterRdsDbInstanceRequest{Request: req, Input: input} + return DeregisterRdsDbInstanceRequest{Request: req, Input: input, Copy: c.DeregisterRdsDbInstanceRequest} } const opDeregisterVolume = "DeregisterVolume" @@ -1163,6 +1183,7 @@ const opDeregisterVolume = "DeregisterVolume" type DeregisterVolumeRequest struct { *aws.Request Input *DeregisterVolumeInput + Copy func(*DeregisterVolumeInput) DeregisterVolumeRequest } // Send marshals and sends the DeregisterVolume API request. @@ -1211,7 +1232,7 @@ func (c *OpsWorks) DeregisterVolumeRequest(input *DeregisterVolumeInput) Deregis req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeregisterVolumeRequest{Request: req, Input: input} + return DeregisterVolumeRequest{Request: req, Input: input, Copy: c.DeregisterVolumeRequest} } const opDescribeAgentVersions = "DescribeAgentVersions" @@ -1220,6 +1241,7 @@ const opDescribeAgentVersions = "DescribeAgentVersions" type DescribeAgentVersionsRequest struct { *aws.Request Input *DescribeAgentVersionsInput + Copy func(*DescribeAgentVersionsInput) DescribeAgentVersionsRequest } // Send marshals and sends the DescribeAgentVersions API request. @@ -1262,7 +1284,7 @@ func (c *OpsWorks) DescribeAgentVersionsRequest(input *DescribeAgentVersionsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAgentVersionsRequest{Request: req, Input: input} + return DescribeAgentVersionsRequest{Request: req, Input: input, Copy: c.DescribeAgentVersionsRequest} } const opDescribeApps = "DescribeApps" @@ -1271,6 +1293,7 @@ const opDescribeApps = "DescribeApps" type DescribeAppsRequest struct { *aws.Request Input *DescribeAppsInput + Copy func(*DescribeAppsInput) DescribeAppsRequest } // Send marshals and sends the DescribeApps API request. @@ -1318,7 +1341,7 @@ func (c *OpsWorks) DescribeAppsRequest(input *DescribeAppsInput) DescribeAppsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAppsRequest{Request: req, Input: input} + return DescribeAppsRequest{Request: req, Input: input, Copy: c.DescribeAppsRequest} } const opDescribeCommands = "DescribeCommands" @@ -1327,6 +1350,7 @@ const opDescribeCommands = "DescribeCommands" type DescribeCommandsRequest struct { *aws.Request Input *DescribeCommandsInput + Copy func(*DescribeCommandsInput) DescribeCommandsRequest } // Send marshals and sends the DescribeCommands API request. @@ -1374,7 +1398,7 @@ func (c *OpsWorks) DescribeCommandsRequest(input *DescribeCommandsInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCommandsRequest{Request: req, Input: input} + return DescribeCommandsRequest{Request: req, Input: input, Copy: c.DescribeCommandsRequest} } const opDescribeDeployments = "DescribeDeployments" @@ -1383,6 +1407,7 @@ const opDescribeDeployments = "DescribeDeployments" type DescribeDeploymentsRequest struct { *aws.Request Input *DescribeDeploymentsInput + Copy func(*DescribeDeploymentsInput) DescribeDeploymentsRequest } // Send marshals and sends the DescribeDeployments API request. @@ -1430,7 +1455,7 @@ func (c *OpsWorks) DescribeDeploymentsRequest(input *DescribeDeploymentsInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDeploymentsRequest{Request: req, Input: input} + return DescribeDeploymentsRequest{Request: req, Input: input, Copy: c.DescribeDeploymentsRequest} } const opDescribeEcsClusters = "DescribeEcsClusters" @@ -1439,6 +1464,7 @@ const opDescribeEcsClusters = "DescribeEcsClusters" type DescribeEcsClustersRequest struct { *aws.Request Input *DescribeEcsClustersInput + Copy func(*DescribeEcsClustersInput) DescribeEcsClustersRequest } // Send marshals and sends the DescribeEcsClusters API request. @@ -1495,57 +1521,53 @@ func (c *OpsWorks) DescribeEcsClustersRequest(input *DescribeEcsClustersInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEcsClustersRequest{Request: req, Input: input} + return DescribeEcsClustersRequest{Request: req, Input: input, Copy: c.DescribeEcsClustersRequest} } -// DescribeEcsClustersPages iterates over the pages of a DescribeEcsClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEcsClusters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEcsClustersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEcsClusters operation. -// pageNum := 0 -// err := client.DescribeEcsClustersPages(params, -// func(page *DescribeEcsClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *OpsWorks) DescribeEcsClustersPages(input *DescribeEcsClustersInput, fn func(*DescribeEcsClustersOutput, bool) bool) error { - return c.DescribeEcsClustersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEcsClustersPagesWithContext same as DescribeEcsClustersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OpsWorks) DescribeEcsClustersPagesWithContext(ctx aws.Context, input *DescribeEcsClustersInput, fn func(*DescribeEcsClustersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEcsClustersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEcsClustersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEcsClustersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEcsClustersRequest) Paginate(opts ...aws.Option) DescribeEcsClustersPager { + return DescribeEcsClustersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEcsClustersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEcsClustersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEcsClustersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEcsClustersPager struct { + aws.Pager +} + +func (p *DescribeEcsClustersPager) CurrentPage() *DescribeEcsClustersOutput { + return p.Pager.CurrentPage().(*DescribeEcsClustersOutput) } const opDescribeElasticIps = "DescribeElasticIps" @@ -1554,6 +1576,7 @@ const opDescribeElasticIps = "DescribeElasticIps" type DescribeElasticIpsRequest struct { *aws.Request Input *DescribeElasticIpsInput + Copy func(*DescribeElasticIpsInput) DescribeElasticIpsRequest } // Send marshals and sends the DescribeElasticIps API request. @@ -1601,7 +1624,7 @@ func (c *OpsWorks) DescribeElasticIpsRequest(input *DescribeElasticIpsInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeElasticIpsRequest{Request: req, Input: input} + return DescribeElasticIpsRequest{Request: req, Input: input, Copy: c.DescribeElasticIpsRequest} } const opDescribeElasticLoadBalancers = "DescribeElasticLoadBalancers" @@ -1610,6 +1633,7 @@ const opDescribeElasticLoadBalancers = "DescribeElasticLoadBalancers" type DescribeElasticLoadBalancersRequest struct { *aws.Request Input *DescribeElasticLoadBalancersInput + Copy func(*DescribeElasticLoadBalancersInput) DescribeElasticLoadBalancersRequest } // Send marshals and sends the DescribeElasticLoadBalancers API request. @@ -1657,7 +1681,7 @@ func (c *OpsWorks) DescribeElasticLoadBalancersRequest(input *DescribeElasticLoa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeElasticLoadBalancersRequest{Request: req, Input: input} + return DescribeElasticLoadBalancersRequest{Request: req, Input: input, Copy: c.DescribeElasticLoadBalancersRequest} } const opDescribeInstances = "DescribeInstances" @@ -1666,6 +1690,7 @@ const opDescribeInstances = "DescribeInstances" type DescribeInstancesRequest struct { *aws.Request Input *DescribeInstancesInput + Copy func(*DescribeInstancesInput) DescribeInstancesRequest } // Send marshals and sends the DescribeInstances API request. @@ -1713,7 +1738,7 @@ func (c *OpsWorks) DescribeInstancesRequest(input *DescribeInstancesInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstancesRequest{Request: req, Input: input} + return DescribeInstancesRequest{Request: req, Input: input, Copy: c.DescribeInstancesRequest} } const opDescribeLayers = "DescribeLayers" @@ -1722,6 +1747,7 @@ const opDescribeLayers = "DescribeLayers" type DescribeLayersRequest struct { *aws.Request Input *DescribeLayersInput + Copy func(*DescribeLayersInput) DescribeLayersRequest } // Send marshals and sends the DescribeLayers API request. @@ -1769,7 +1795,7 @@ func (c *OpsWorks) DescribeLayersRequest(input *DescribeLayersInput) DescribeLay req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLayersRequest{Request: req, Input: input} + return DescribeLayersRequest{Request: req, Input: input, Copy: c.DescribeLayersRequest} } const opDescribeLoadBasedAutoScaling = "DescribeLoadBasedAutoScaling" @@ -1778,6 +1804,7 @@ const opDescribeLoadBasedAutoScaling = "DescribeLoadBasedAutoScaling" type DescribeLoadBasedAutoScalingRequest struct { *aws.Request Input *DescribeLoadBasedAutoScalingInput + Copy func(*DescribeLoadBasedAutoScalingInput) DescribeLoadBasedAutoScalingRequest } // Send marshals and sends the DescribeLoadBasedAutoScaling API request. @@ -1825,7 +1852,7 @@ func (c *OpsWorks) DescribeLoadBasedAutoScalingRequest(input *DescribeLoadBasedA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoadBasedAutoScalingRequest{Request: req, Input: input} + return DescribeLoadBasedAutoScalingRequest{Request: req, Input: input, Copy: c.DescribeLoadBasedAutoScalingRequest} } const opDescribeMyUserProfile = "DescribeMyUserProfile" @@ -1834,6 +1861,7 @@ const opDescribeMyUserProfile = "DescribeMyUserProfile" type DescribeMyUserProfileRequest struct { *aws.Request Input *DescribeMyUserProfileInput + Copy func(*DescribeMyUserProfileInput) DescribeMyUserProfileRequest } // Send marshals and sends the DescribeMyUserProfile API request. @@ -1878,7 +1906,7 @@ func (c *OpsWorks) DescribeMyUserProfileRequest(input *DescribeMyUserProfileInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMyUserProfileRequest{Request: req, Input: input} + return DescribeMyUserProfileRequest{Request: req, Input: input, Copy: c.DescribeMyUserProfileRequest} } const opDescribePermissions = "DescribePermissions" @@ -1887,6 +1915,7 @@ const opDescribePermissions = "DescribePermissions" type DescribePermissionsRequest struct { *aws.Request Input *DescribePermissionsInput + Copy func(*DescribePermissionsInput) DescribePermissionsRequest } // Send marshals and sends the DescribePermissions API request. @@ -1932,7 +1961,7 @@ func (c *OpsWorks) DescribePermissionsRequest(input *DescribePermissionsInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePermissionsRequest{Request: req, Input: input} + return DescribePermissionsRequest{Request: req, Input: input, Copy: c.DescribePermissionsRequest} } const opDescribeRaidArrays = "DescribeRaidArrays" @@ -1941,6 +1970,7 @@ const opDescribeRaidArrays = "DescribeRaidArrays" type DescribeRaidArraysRequest struct { *aws.Request Input *DescribeRaidArraysInput + Copy func(*DescribeRaidArraysInput) DescribeRaidArraysRequest } // Send marshals and sends the DescribeRaidArrays API request. @@ -1988,7 +2018,7 @@ func (c *OpsWorks) DescribeRaidArraysRequest(input *DescribeRaidArraysInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRaidArraysRequest{Request: req, Input: input} + return DescribeRaidArraysRequest{Request: req, Input: input, Copy: c.DescribeRaidArraysRequest} } const opDescribeRdsDbInstances = "DescribeRdsDbInstances" @@ -1997,6 +2027,7 @@ const opDescribeRdsDbInstances = "DescribeRdsDbInstances" type DescribeRdsDbInstancesRequest struct { *aws.Request Input *DescribeRdsDbInstancesInput + Copy func(*DescribeRdsDbInstancesInput) DescribeRdsDbInstancesRequest } // Send marshals and sends the DescribeRdsDbInstances API request. @@ -2044,7 +2075,7 @@ func (c *OpsWorks) DescribeRdsDbInstancesRequest(input *DescribeRdsDbInstancesIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRdsDbInstancesRequest{Request: req, Input: input} + return DescribeRdsDbInstancesRequest{Request: req, Input: input, Copy: c.DescribeRdsDbInstancesRequest} } const opDescribeServiceErrors = "DescribeServiceErrors" @@ -2053,6 +2084,7 @@ const opDescribeServiceErrors = "DescribeServiceErrors" type DescribeServiceErrorsRequest struct { *aws.Request Input *DescribeServiceErrorsInput + Copy func(*DescribeServiceErrorsInput) DescribeServiceErrorsRequest } // Send marshals and sends the DescribeServiceErrors API request. @@ -2100,7 +2132,7 @@ func (c *OpsWorks) DescribeServiceErrorsRequest(input *DescribeServiceErrorsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeServiceErrorsRequest{Request: req, Input: input} + return DescribeServiceErrorsRequest{Request: req, Input: input, Copy: c.DescribeServiceErrorsRequest} } const opDescribeStackProvisioningParameters = "DescribeStackProvisioningParameters" @@ -2109,6 +2141,7 @@ const opDescribeStackProvisioningParameters = "DescribeStackProvisioningParamete type DescribeStackProvisioningParametersRequest struct { *aws.Request Input *DescribeStackProvisioningParametersInput + Copy func(*DescribeStackProvisioningParametersInput) DescribeStackProvisioningParametersRequest } // Send marshals and sends the DescribeStackProvisioningParameters API request. @@ -2154,7 +2187,7 @@ func (c *OpsWorks) DescribeStackProvisioningParametersRequest(input *DescribeSta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStackProvisioningParametersRequest{Request: req, Input: input} + return DescribeStackProvisioningParametersRequest{Request: req, Input: input, Copy: c.DescribeStackProvisioningParametersRequest} } const opDescribeStackSummary = "DescribeStackSummary" @@ -2163,6 +2196,7 @@ const opDescribeStackSummary = "DescribeStackSummary" type DescribeStackSummaryRequest struct { *aws.Request Input *DescribeStackSummaryInput + Copy func(*DescribeStackSummaryInput) DescribeStackSummaryRequest } // Send marshals and sends the DescribeStackSummary API request. @@ -2209,7 +2243,7 @@ func (c *OpsWorks) DescribeStackSummaryRequest(input *DescribeStackSummaryInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStackSummaryRequest{Request: req, Input: input} + return DescribeStackSummaryRequest{Request: req, Input: input, Copy: c.DescribeStackSummaryRequest} } const opDescribeStacks = "DescribeStacks" @@ -2218,6 +2252,7 @@ const opDescribeStacks = "DescribeStacks" type DescribeStacksRequest struct { *aws.Request Input *DescribeStacksInput + Copy func(*DescribeStacksInput) DescribeStacksRequest } // Send marshals and sends the DescribeStacks API request. @@ -2263,7 +2298,7 @@ func (c *OpsWorks) DescribeStacksRequest(input *DescribeStacksInput) DescribeSta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStacksRequest{Request: req, Input: input} + return DescribeStacksRequest{Request: req, Input: input, Copy: c.DescribeStacksRequest} } const opDescribeTimeBasedAutoScaling = "DescribeTimeBasedAutoScaling" @@ -2272,6 +2307,7 @@ const opDescribeTimeBasedAutoScaling = "DescribeTimeBasedAutoScaling" type DescribeTimeBasedAutoScalingRequest struct { *aws.Request Input *DescribeTimeBasedAutoScalingInput + Copy func(*DescribeTimeBasedAutoScalingInput) DescribeTimeBasedAutoScalingRequest } // Send marshals and sends the DescribeTimeBasedAutoScaling API request. @@ -2319,7 +2355,7 @@ func (c *OpsWorks) DescribeTimeBasedAutoScalingRequest(input *DescribeTimeBasedA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTimeBasedAutoScalingRequest{Request: req, Input: input} + return DescribeTimeBasedAutoScalingRequest{Request: req, Input: input, Copy: c.DescribeTimeBasedAutoScalingRequest} } const opDescribeUserProfiles = "DescribeUserProfiles" @@ -2328,6 +2364,7 @@ const opDescribeUserProfiles = "DescribeUserProfiles" type DescribeUserProfilesRequest struct { *aws.Request Input *DescribeUserProfilesInput + Copy func(*DescribeUserProfilesInput) DescribeUserProfilesRequest } // Send marshals and sends the DescribeUserProfiles API request. @@ -2372,7 +2409,7 @@ func (c *OpsWorks) DescribeUserProfilesRequest(input *DescribeUserProfilesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUserProfilesRequest{Request: req, Input: input} + return DescribeUserProfilesRequest{Request: req, Input: input, Copy: c.DescribeUserProfilesRequest} } const opDescribeVolumes = "DescribeVolumes" @@ -2381,6 +2418,7 @@ const opDescribeVolumes = "DescribeVolumes" type DescribeVolumesRequest struct { *aws.Request Input *DescribeVolumesInput + Copy func(*DescribeVolumesInput) DescribeVolumesRequest } // Send marshals and sends the DescribeVolumes API request. @@ -2428,7 +2466,7 @@ func (c *OpsWorks) DescribeVolumesRequest(input *DescribeVolumesInput) DescribeV req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVolumesRequest{Request: req, Input: input} + return DescribeVolumesRequest{Request: req, Input: input, Copy: c.DescribeVolumesRequest} } const opDetachElasticLoadBalancer = "DetachElasticLoadBalancer" @@ -2437,6 +2475,7 @@ const opDetachElasticLoadBalancer = "DetachElasticLoadBalancer" type DetachElasticLoadBalancerRequest struct { *aws.Request Input *DetachElasticLoadBalancerInput + Copy func(*DetachElasticLoadBalancerInput) DetachElasticLoadBalancerRequest } // Send marshals and sends the DetachElasticLoadBalancer API request. @@ -2484,7 +2523,7 @@ func (c *OpsWorks) DetachElasticLoadBalancerRequest(input *DetachElasticLoadBala req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachElasticLoadBalancerRequest{Request: req, Input: input} + return DetachElasticLoadBalancerRequest{Request: req, Input: input, Copy: c.DetachElasticLoadBalancerRequest} } const opDisassociateElasticIp = "DisassociateElasticIp" @@ -2493,6 +2532,7 @@ const opDisassociateElasticIp = "DisassociateElasticIp" type DisassociateElasticIpRequest struct { *aws.Request Input *DisassociateElasticIpInput + Copy func(*DisassociateElasticIpInput) DisassociateElasticIpRequest } // Send marshals and sends the DisassociateElasticIp API request. @@ -2542,7 +2582,7 @@ func (c *OpsWorks) DisassociateElasticIpRequest(input *DisassociateElasticIpInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisassociateElasticIpRequest{Request: req, Input: input} + return DisassociateElasticIpRequest{Request: req, Input: input, Copy: c.DisassociateElasticIpRequest} } const opGetHostnameSuggestion = "GetHostnameSuggestion" @@ -2551,6 +2591,7 @@ const opGetHostnameSuggestion = "GetHostnameSuggestion" type GetHostnameSuggestionRequest struct { *aws.Request Input *GetHostnameSuggestionInput + Copy func(*GetHostnameSuggestionInput) GetHostnameSuggestionRequest } // Send marshals and sends the GetHostnameSuggestion API request. @@ -2597,7 +2638,7 @@ func (c *OpsWorks) GetHostnameSuggestionRequest(input *GetHostnameSuggestionInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHostnameSuggestionRequest{Request: req, Input: input} + return GetHostnameSuggestionRequest{Request: req, Input: input, Copy: c.GetHostnameSuggestionRequest} } const opGrantAccess = "GrantAccess" @@ -2606,6 +2647,7 @@ const opGrantAccess = "GrantAccess" type GrantAccessRequest struct { *aws.Request Input *GrantAccessInput + Copy func(*GrantAccessInput) GrantAccessRequest } // Send marshals and sends the GrantAccess API request. @@ -2648,7 +2690,7 @@ func (c *OpsWorks) GrantAccessRequest(input *GrantAccessInput) GrantAccessReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GrantAccessRequest{Request: req, Input: input} + return GrantAccessRequest{Request: req, Input: input, Copy: c.GrantAccessRequest} } const opListTags = "ListTags" @@ -2657,6 +2699,7 @@ const opListTags = "ListTags" type ListTagsRequest struct { *aws.Request Input *ListTagsInput + Copy func(*ListTagsInput) ListTagsRequest } // Send marshals and sends the ListTags API request. @@ -2697,7 +2740,7 @@ func (c *OpsWorks) ListTagsRequest(input *ListTagsInput) ListTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsRequest{Request: req, Input: input} + return ListTagsRequest{Request: req, Input: input, Copy: c.ListTagsRequest} } const opRebootInstance = "RebootInstance" @@ -2706,6 +2749,7 @@ const opRebootInstance = "RebootInstance" type RebootInstanceRequest struct { *aws.Request Input *RebootInstanceInput + Copy func(*RebootInstanceInput) RebootInstanceRequest } // Send marshals and sends the RebootInstance API request. @@ -2754,7 +2798,7 @@ func (c *OpsWorks) RebootInstanceRequest(input *RebootInstanceInput) RebootInsta req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RebootInstanceRequest{Request: req, Input: input} + return RebootInstanceRequest{Request: req, Input: input, Copy: c.RebootInstanceRequest} } const opRegisterEcsCluster = "RegisterEcsCluster" @@ -2763,6 +2807,7 @@ const opRegisterEcsCluster = "RegisterEcsCluster" type RegisterEcsClusterRequest struct { *aws.Request Input *RegisterEcsClusterInput + Copy func(*RegisterEcsClusterInput) RegisterEcsClusterRequest } // Send marshals and sends the RegisterEcsCluster API request. @@ -2810,7 +2855,7 @@ func (c *OpsWorks) RegisterEcsClusterRequest(input *RegisterEcsClusterInput) Reg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterEcsClusterRequest{Request: req, Input: input} + return RegisterEcsClusterRequest{Request: req, Input: input, Copy: c.RegisterEcsClusterRequest} } const opRegisterElasticIp = "RegisterElasticIp" @@ -2819,6 +2864,7 @@ const opRegisterElasticIp = "RegisterElasticIp" type RegisterElasticIpRequest struct { *aws.Request Input *RegisterElasticIpInput + Copy func(*RegisterElasticIpInput) RegisterElasticIpRequest } // Send marshals and sends the RegisterElasticIp API request. @@ -2867,7 +2913,7 @@ func (c *OpsWorks) RegisterElasticIpRequest(input *RegisterElasticIpInput) Regis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterElasticIpRequest{Request: req, Input: input} + return RegisterElasticIpRequest{Request: req, Input: input, Copy: c.RegisterElasticIpRequest} } const opRegisterInstance = "RegisterInstance" @@ -2876,6 +2922,7 @@ const opRegisterInstance = "RegisterInstance" type RegisterInstanceRequest struct { *aws.Request Input *RegisterInstanceInput + Copy func(*RegisterInstanceInput) RegisterInstanceRequest } // Send marshals and sends the RegisterInstance API request. @@ -2935,7 +2982,7 @@ func (c *OpsWorks) RegisterInstanceRequest(input *RegisterInstanceInput) Registe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterInstanceRequest{Request: req, Input: input} + return RegisterInstanceRequest{Request: req, Input: input, Copy: c.RegisterInstanceRequest} } const opRegisterRdsDbInstance = "RegisterRdsDbInstance" @@ -2944,6 +2991,7 @@ const opRegisterRdsDbInstance = "RegisterRdsDbInstance" type RegisterRdsDbInstanceRequest struct { *aws.Request Input *RegisterRdsDbInstanceInput + Copy func(*RegisterRdsDbInstanceInput) RegisterRdsDbInstanceRequest } // Send marshals and sends the RegisterRdsDbInstance API request. @@ -2991,7 +3039,7 @@ func (c *OpsWorks) RegisterRdsDbInstanceRequest(input *RegisterRdsDbInstanceInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RegisterRdsDbInstanceRequest{Request: req, Input: input} + return RegisterRdsDbInstanceRequest{Request: req, Input: input, Copy: c.RegisterRdsDbInstanceRequest} } const opRegisterVolume = "RegisterVolume" @@ -3000,6 +3048,7 @@ const opRegisterVolume = "RegisterVolume" type RegisterVolumeRequest struct { *aws.Request Input *RegisterVolumeInput + Copy func(*RegisterVolumeInput) RegisterVolumeRequest } // Send marshals and sends the RegisterVolume API request. @@ -3048,7 +3097,7 @@ func (c *OpsWorks) RegisterVolumeRequest(input *RegisterVolumeInput) RegisterVol req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterVolumeRequest{Request: req, Input: input} + return RegisterVolumeRequest{Request: req, Input: input, Copy: c.RegisterVolumeRequest} } const opSetLoadBasedAutoScaling = "SetLoadBasedAutoScaling" @@ -3057,6 +3106,7 @@ const opSetLoadBasedAutoScaling = "SetLoadBasedAutoScaling" type SetLoadBasedAutoScalingRequest struct { *aws.Request Input *SetLoadBasedAutoScalingInput + Copy func(*SetLoadBasedAutoScalingInput) SetLoadBasedAutoScalingRequest } // Send marshals and sends the SetLoadBasedAutoScaling API request. @@ -3111,7 +3161,7 @@ func (c *OpsWorks) SetLoadBasedAutoScalingRequest(input *SetLoadBasedAutoScaling req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetLoadBasedAutoScalingRequest{Request: req, Input: input} + return SetLoadBasedAutoScalingRequest{Request: req, Input: input, Copy: c.SetLoadBasedAutoScalingRequest} } const opSetPermission = "SetPermission" @@ -3120,6 +3170,7 @@ const opSetPermission = "SetPermission" type SetPermissionRequest struct { *aws.Request Input *SetPermissionInput + Copy func(*SetPermissionInput) SetPermissionRequest } // Send marshals and sends the SetPermission API request. @@ -3168,7 +3219,7 @@ func (c *OpsWorks) SetPermissionRequest(input *SetPermissionInput) SetPermission req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetPermissionRequest{Request: req, Input: input} + return SetPermissionRequest{Request: req, Input: input, Copy: c.SetPermissionRequest} } const opSetTimeBasedAutoScaling = "SetTimeBasedAutoScaling" @@ -3177,6 +3228,7 @@ const opSetTimeBasedAutoScaling = "SetTimeBasedAutoScaling" type SetTimeBasedAutoScalingRequest struct { *aws.Request Input *SetTimeBasedAutoScalingInput + Copy func(*SetTimeBasedAutoScalingInput) SetTimeBasedAutoScalingRequest } // Send marshals and sends the SetTimeBasedAutoScaling API request. @@ -3226,7 +3278,7 @@ func (c *OpsWorks) SetTimeBasedAutoScalingRequest(input *SetTimeBasedAutoScaling req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetTimeBasedAutoScalingRequest{Request: req, Input: input} + return SetTimeBasedAutoScalingRequest{Request: req, Input: input, Copy: c.SetTimeBasedAutoScalingRequest} } const opStartInstance = "StartInstance" @@ -3235,6 +3287,7 @@ const opStartInstance = "StartInstance" type StartInstanceRequest struct { *aws.Request Input *StartInstanceInput + Copy func(*StartInstanceInput) StartInstanceRequest } // Send marshals and sends the StartInstance API request. @@ -3283,7 +3336,7 @@ func (c *OpsWorks) StartInstanceRequest(input *StartInstanceInput) StartInstance req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StartInstanceRequest{Request: req, Input: input} + return StartInstanceRequest{Request: req, Input: input, Copy: c.StartInstanceRequest} } const opStartStack = "StartStack" @@ -3292,6 +3345,7 @@ const opStartStack = "StartStack" type StartStackRequest struct { *aws.Request Input *StartStackInput + Copy func(*StartStackInput) StartStackRequest } // Send marshals and sends the StartStack API request. @@ -3339,7 +3393,7 @@ func (c *OpsWorks) StartStackRequest(input *StartStackInput) StartStackRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StartStackRequest{Request: req, Input: input} + return StartStackRequest{Request: req, Input: input, Copy: c.StartStackRequest} } const opStopInstance = "StopInstance" @@ -3348,6 +3402,7 @@ const opStopInstance = "StopInstance" type StopInstanceRequest struct { *aws.Request Input *StopInstanceInput + Copy func(*StopInstanceInput) StopInstanceRequest } // Send marshals and sends the StopInstance API request. @@ -3398,7 +3453,7 @@ func (c *OpsWorks) StopInstanceRequest(input *StopInstanceInput) StopInstanceReq req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StopInstanceRequest{Request: req, Input: input} + return StopInstanceRequest{Request: req, Input: input, Copy: c.StopInstanceRequest} } const opStopStack = "StopStack" @@ -3407,6 +3462,7 @@ const opStopStack = "StopStack" type StopStackRequest struct { *aws.Request Input *StopStackInput + Copy func(*StopStackInput) StopStackRequest } // Send marshals and sends the StopStack API request. @@ -3454,7 +3510,7 @@ func (c *OpsWorks) StopStackRequest(input *StopStackInput) StopStackRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StopStackRequest{Request: req, Input: input} + return StopStackRequest{Request: req, Input: input, Copy: c.StopStackRequest} } const opTagResource = "TagResource" @@ -3463,6 +3519,7 @@ const opTagResource = "TagResource" type TagResourceRequest struct { *aws.Request Input *TagResourceInput + Copy func(*TagResourceInput) TagResourceRequest } // Send marshals and sends the TagResource API request. @@ -3507,7 +3564,7 @@ func (c *OpsWorks) TagResourceRequest(input *TagResourceInput) TagResourceReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TagResourceRequest{Request: req, Input: input} + return TagResourceRequest{Request: req, Input: input, Copy: c.TagResourceRequest} } const opUnassignInstance = "UnassignInstance" @@ -3516,6 +3573,7 @@ const opUnassignInstance = "UnassignInstance" type UnassignInstanceRequest struct { *aws.Request Input *UnassignInstanceInput + Copy func(*UnassignInstanceInput) UnassignInstanceRequest } // Send marshals and sends the UnassignInstance API request. @@ -3566,7 +3624,7 @@ func (c *OpsWorks) UnassignInstanceRequest(input *UnassignInstanceInput) Unassig req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UnassignInstanceRequest{Request: req, Input: input} + return UnassignInstanceRequest{Request: req, Input: input, Copy: c.UnassignInstanceRequest} } const opUnassignVolume = "UnassignVolume" @@ -3575,6 +3633,7 @@ const opUnassignVolume = "UnassignVolume" type UnassignVolumeRequest struct { *aws.Request Input *UnassignVolumeInput + Copy func(*UnassignVolumeInput) UnassignVolumeRequest } // Send marshals and sends the UnassignVolume API request. @@ -3623,7 +3682,7 @@ func (c *OpsWorks) UnassignVolumeRequest(input *UnassignVolumeInput) UnassignVol req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UnassignVolumeRequest{Request: req, Input: input} + return UnassignVolumeRequest{Request: req, Input: input, Copy: c.UnassignVolumeRequest} } const opUntagResource = "UntagResource" @@ -3632,6 +3691,7 @@ const opUntagResource = "UntagResource" type UntagResourceRequest struct { *aws.Request Input *UntagResourceInput + Copy func(*UntagResourceInput) UntagResourceRequest } // Send marshals and sends the UntagResource API request. @@ -3674,7 +3734,7 @@ func (c *OpsWorks) UntagResourceRequest(input *UntagResourceInput) UntagResource req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UntagResourceRequest{Request: req, Input: input} + return UntagResourceRequest{Request: req, Input: input, Copy: c.UntagResourceRequest} } const opUpdateApp = "UpdateApp" @@ -3683,6 +3743,7 @@ const opUpdateApp = "UpdateApp" type UpdateAppRequest struct { *aws.Request Input *UpdateAppInput + Copy func(*UpdateAppInput) UpdateAppRequest } // Send marshals and sends the UpdateApp API request. @@ -3730,7 +3791,7 @@ func (c *OpsWorks) UpdateAppRequest(input *UpdateAppInput) UpdateAppRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateAppRequest{Request: req, Input: input} + return UpdateAppRequest{Request: req, Input: input, Copy: c.UpdateAppRequest} } const opUpdateElasticIp = "UpdateElasticIp" @@ -3739,6 +3800,7 @@ const opUpdateElasticIp = "UpdateElasticIp" type UpdateElasticIpRequest struct { *aws.Request Input *UpdateElasticIpInput + Copy func(*UpdateElasticIpInput) UpdateElasticIpRequest } // Send marshals and sends the UpdateElasticIp API request. @@ -3787,7 +3849,7 @@ func (c *OpsWorks) UpdateElasticIpRequest(input *UpdateElasticIpInput) UpdateEla req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateElasticIpRequest{Request: req, Input: input} + return UpdateElasticIpRequest{Request: req, Input: input, Copy: c.UpdateElasticIpRequest} } const opUpdateInstance = "UpdateInstance" @@ -3796,6 +3858,7 @@ const opUpdateInstance = "UpdateInstance" type UpdateInstanceRequest struct { *aws.Request Input *UpdateInstanceInput + Copy func(*UpdateInstanceInput) UpdateInstanceRequest } // Send marshals and sends the UpdateInstance API request. @@ -3843,7 +3906,7 @@ func (c *OpsWorks) UpdateInstanceRequest(input *UpdateInstanceInput) UpdateInsta req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateInstanceRequest{Request: req, Input: input} + return UpdateInstanceRequest{Request: req, Input: input, Copy: c.UpdateInstanceRequest} } const opUpdateLayer = "UpdateLayer" @@ -3852,6 +3915,7 @@ const opUpdateLayer = "UpdateLayer" type UpdateLayerRequest struct { *aws.Request Input *UpdateLayerInput + Copy func(*UpdateLayerInput) UpdateLayerRequest } // Send marshals and sends the UpdateLayer API request. @@ -3899,7 +3963,7 @@ func (c *OpsWorks) UpdateLayerRequest(input *UpdateLayerInput) UpdateLayerReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateLayerRequest{Request: req, Input: input} + return UpdateLayerRequest{Request: req, Input: input, Copy: c.UpdateLayerRequest} } const opUpdateMyUserProfile = "UpdateMyUserProfile" @@ -3908,6 +3972,7 @@ const opUpdateMyUserProfile = "UpdateMyUserProfile" type UpdateMyUserProfileRequest struct { *aws.Request Input *UpdateMyUserProfileInput + Copy func(*UpdateMyUserProfileInput) UpdateMyUserProfileRequest } // Send marshals and sends the UpdateMyUserProfile API request. @@ -3954,7 +4019,7 @@ func (c *OpsWorks) UpdateMyUserProfileRequest(input *UpdateMyUserProfileInput) U req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateMyUserProfileRequest{Request: req, Input: input} + return UpdateMyUserProfileRequest{Request: req, Input: input, Copy: c.UpdateMyUserProfileRequest} } const opUpdateRdsDbInstance = "UpdateRdsDbInstance" @@ -3963,6 +4028,7 @@ const opUpdateRdsDbInstance = "UpdateRdsDbInstance" type UpdateRdsDbInstanceRequest struct { *aws.Request Input *UpdateRdsDbInstanceInput + Copy func(*UpdateRdsDbInstanceInput) UpdateRdsDbInstanceRequest } // Send marshals and sends the UpdateRdsDbInstance API request. @@ -4010,7 +4076,7 @@ func (c *OpsWorks) UpdateRdsDbInstanceRequest(input *UpdateRdsDbInstanceInput) U req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateRdsDbInstanceRequest{Request: req, Input: input} + return UpdateRdsDbInstanceRequest{Request: req, Input: input, Copy: c.UpdateRdsDbInstanceRequest} } const opUpdateStack = "UpdateStack" @@ -4019,6 +4085,7 @@ const opUpdateStack = "UpdateStack" type UpdateStackRequest struct { *aws.Request Input *UpdateStackInput + Copy func(*UpdateStackInput) UpdateStackRequest } // Send marshals and sends the UpdateStack API request. @@ -4066,7 +4133,7 @@ func (c *OpsWorks) UpdateStackRequest(input *UpdateStackInput) UpdateStackReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateStackRequest{Request: req, Input: input} + return UpdateStackRequest{Request: req, Input: input, Copy: c.UpdateStackRequest} } const opUpdateUserProfile = "UpdateUserProfile" @@ -4075,6 +4142,7 @@ const opUpdateUserProfile = "UpdateUserProfile" type UpdateUserProfileRequest struct { *aws.Request Input *UpdateUserProfileInput + Copy func(*UpdateUserProfileInput) UpdateUserProfileRequest } // Send marshals and sends the UpdateUserProfile API request. @@ -4121,7 +4189,7 @@ func (c *OpsWorks) UpdateUserProfileRequest(input *UpdateUserProfileInput) Updat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateUserProfileRequest{Request: req, Input: input} + return UpdateUserProfileRequest{Request: req, Input: input, Copy: c.UpdateUserProfileRequest} } const opUpdateVolume = "UpdateVolume" @@ -4130,6 +4198,7 @@ const opUpdateVolume = "UpdateVolume" type UpdateVolumeRequest struct { *aws.Request Input *UpdateVolumeInput + Copy func(*UpdateVolumeInput) UpdateVolumeRequest } // Send marshals and sends the UpdateVolume API request. @@ -4178,7 +4247,7 @@ func (c *OpsWorks) UpdateVolumeRequest(input *UpdateVolumeInput) UpdateVolumeReq req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateVolumeRequest{Request: req, Input: input} + return UpdateVolumeRequest{Request: req, Input: input, Copy: c.UpdateVolumeRequest} } // Describes an agent version. diff --git a/service/opsworks/opsworksiface/interface.go b/service/opsworks/opsworksiface/interface.go index 8add21937ad..c2c43685c20 100644 --- a/service/opsworks/opsworksiface/interface.go +++ b/service/opsworks/opsworksiface/interface.go @@ -115,9 +115,6 @@ type OpsWorksAPI interface { DescribeEcsClustersRequest(*opsworks.DescribeEcsClustersInput) opsworks.DescribeEcsClustersRequest - DescribeEcsClustersPages(*opsworks.DescribeEcsClustersInput, func(*opsworks.DescribeEcsClustersOutput, bool) bool) error - DescribeEcsClustersPagesWithContext(aws.Context, *opsworks.DescribeEcsClustersInput, func(*opsworks.DescribeEcsClustersOutput, bool) bool, ...aws.Option) error - DescribeElasticIpsRequest(*opsworks.DescribeElasticIpsInput) opsworks.DescribeElasticIpsRequest DescribeElasticLoadBalancersRequest(*opsworks.DescribeElasticLoadBalancersInput) opsworks.DescribeElasticLoadBalancersRequest diff --git a/service/opsworkscm/api.go b/service/opsworkscm/api.go index 8a22d9cf1a4..00ce50f014e 100644 --- a/service/opsworkscm/api.go +++ b/service/opsworkscm/api.go @@ -15,6 +15,7 @@ const opAssociateNode = "AssociateNode" type AssociateNodeRequest struct { *aws.Request Input *AssociateNodeInput + Copy func(*AssociateNodeInput) AssociateNodeRequest } // Send marshals and sends the AssociateNode API request. @@ -75,7 +76,7 @@ func (c *OpsWorksCM) AssociateNodeRequest(input *AssociateNodeInput) AssociateNo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateNodeRequest{Request: req, Input: input} + return AssociateNodeRequest{Request: req, Input: input, Copy: c.AssociateNodeRequest} } const opCreateBackup = "CreateBackup" @@ -84,6 +85,7 @@ const opCreateBackup = "CreateBackup" type CreateBackupRequest struct { *aws.Request Input *CreateBackupInput + Copy func(*CreateBackupInput) CreateBackupRequest } // Send marshals and sends the CreateBackup API request. @@ -137,7 +139,7 @@ func (c *OpsWorksCM) CreateBackupRequest(input *CreateBackupInput) CreateBackupR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBackupRequest{Request: req, Input: input} + return CreateBackupRequest{Request: req, Input: input, Copy: c.CreateBackupRequest} } const opCreateServer = "CreateServer" @@ -146,6 +148,7 @@ const opCreateServer = "CreateServer" type CreateServerRequest struct { *aws.Request Input *CreateServerInput + Copy func(*CreateServerInput) CreateServerRequest } // Send marshals and sends the CreateServer API request. @@ -212,7 +215,7 @@ func (c *OpsWorksCM) CreateServerRequest(input *CreateServerInput) CreateServerR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateServerRequest{Request: req, Input: input} + return CreateServerRequest{Request: req, Input: input, Copy: c.CreateServerRequest} } const opDeleteBackup = "DeleteBackup" @@ -221,6 +224,7 @@ const opDeleteBackup = "DeleteBackup" type DeleteBackupRequest struct { *aws.Request Input *DeleteBackupInput + Copy func(*DeleteBackupInput) DeleteBackupRequest } // Send marshals and sends the DeleteBackup API request. @@ -266,7 +270,7 @@ func (c *OpsWorksCM) DeleteBackupRequest(input *DeleteBackupInput) DeleteBackupR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteBackupRequest{Request: req, Input: input} + return DeleteBackupRequest{Request: req, Input: input, Copy: c.DeleteBackupRequest} } const opDeleteServer = "DeleteServer" @@ -275,6 +279,7 @@ const opDeleteServer = "DeleteServer" type DeleteServerRequest struct { *aws.Request Input *DeleteServerInput + Copy func(*DeleteServerInput) DeleteServerRequest } // Send marshals and sends the DeleteServer API request. @@ -325,7 +330,7 @@ func (c *OpsWorksCM) DeleteServerRequest(input *DeleteServerInput) DeleteServerR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteServerRequest{Request: req, Input: input} + return DeleteServerRequest{Request: req, Input: input, Copy: c.DeleteServerRequest} } const opDescribeAccountAttributes = "DescribeAccountAttributes" @@ -334,6 +339,7 @@ const opDescribeAccountAttributes = "DescribeAccountAttributes" type DescribeAccountAttributesRequest struct { *aws.Request Input *DescribeAccountAttributesInput + Copy func(*DescribeAccountAttributesInput) DescribeAccountAttributesRequest } // Send marshals and sends the DescribeAccountAttributes API request. @@ -377,7 +383,7 @@ func (c *OpsWorksCM) DescribeAccountAttributesRequest(input *DescribeAccountAttr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAccountAttributesRequest{Request: req, Input: input} + return DescribeAccountAttributesRequest{Request: req, Input: input, Copy: c.DescribeAccountAttributesRequest} } const opDescribeBackups = "DescribeBackups" @@ -386,6 +392,7 @@ const opDescribeBackups = "DescribeBackups" type DescribeBackupsRequest struct { *aws.Request Input *DescribeBackupsInput + Copy func(*DescribeBackupsInput) DescribeBackupsRequest } // Send marshals and sends the DescribeBackups API request. @@ -432,7 +439,7 @@ func (c *OpsWorksCM) DescribeBackupsRequest(input *DescribeBackupsInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBackupsRequest{Request: req, Input: input} + return DescribeBackupsRequest{Request: req, Input: input, Copy: c.DescribeBackupsRequest} } const opDescribeEvents = "DescribeEvents" @@ -441,6 +448,7 @@ const opDescribeEvents = "DescribeEvents" type DescribeEventsRequest struct { *aws.Request Input *DescribeEventsInput + Copy func(*DescribeEventsInput) DescribeEventsRequest } // Send marshals and sends the DescribeEvents API request. @@ -487,7 +495,7 @@ func (c *OpsWorksCM) DescribeEventsRequest(input *DescribeEventsInput) DescribeE req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventsRequest{Request: req, Input: input} + return DescribeEventsRequest{Request: req, Input: input, Copy: c.DescribeEventsRequest} } const opDescribeNodeAssociationStatus = "DescribeNodeAssociationStatus" @@ -496,6 +504,7 @@ const opDescribeNodeAssociationStatus = "DescribeNodeAssociationStatus" type DescribeNodeAssociationStatusRequest struct { *aws.Request Input *DescribeNodeAssociationStatusInput + Copy func(*DescribeNodeAssociationStatusInput) DescribeNodeAssociationStatusRequest } // Send marshals and sends the DescribeNodeAssociationStatus API request. @@ -540,7 +549,7 @@ func (c *OpsWorksCM) DescribeNodeAssociationStatusRequest(input *DescribeNodeAss req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNodeAssociationStatusRequest{Request: req, Input: input} + return DescribeNodeAssociationStatusRequest{Request: req, Input: input, Copy: c.DescribeNodeAssociationStatusRequest} } const opDescribeServers = "DescribeServers" @@ -549,6 +558,7 @@ const opDescribeServers = "DescribeServers" type DescribeServersRequest struct { *aws.Request Input *DescribeServersInput + Copy func(*DescribeServersInput) DescribeServersRequest } // Send marshals and sends the DescribeServers API request. @@ -596,7 +606,7 @@ func (c *OpsWorksCM) DescribeServersRequest(input *DescribeServersInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeServersRequest{Request: req, Input: input} + return DescribeServersRequest{Request: req, Input: input, Copy: c.DescribeServersRequest} } const opDisassociateNode = "DisassociateNode" @@ -605,6 +615,7 @@ const opDisassociateNode = "DisassociateNode" type DisassociateNodeRequest struct { *aws.Request Input *DisassociateNodeInput + Copy func(*DisassociateNodeInput) DisassociateNodeRequest } // Send marshals and sends the DisassociateNode API request. @@ -653,7 +664,7 @@ func (c *OpsWorksCM) DisassociateNodeRequest(input *DisassociateNodeInput) Disas req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateNodeRequest{Request: req, Input: input} + return DisassociateNodeRequest{Request: req, Input: input, Copy: c.DisassociateNodeRequest} } const opRestoreServer = "RestoreServer" @@ -662,6 +673,7 @@ const opRestoreServer = "RestoreServer" type RestoreServerRequest struct { *aws.Request Input *RestoreServerInput + Copy func(*RestoreServerInput) RestoreServerRequest } // Send marshals and sends the RestoreServer API request. @@ -712,7 +724,7 @@ func (c *OpsWorksCM) RestoreServerRequest(input *RestoreServerInput) RestoreServ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreServerRequest{Request: req, Input: input} + return RestoreServerRequest{Request: req, Input: input, Copy: c.RestoreServerRequest} } const opStartMaintenance = "StartMaintenance" @@ -721,6 +733,7 @@ const opStartMaintenance = "StartMaintenance" type StartMaintenanceRequest struct { *aws.Request Input *StartMaintenanceInput + Copy func(*StartMaintenanceInput) StartMaintenanceRequest } // Send marshals and sends the StartMaintenance API request. @@ -769,7 +782,7 @@ func (c *OpsWorksCM) StartMaintenanceRequest(input *StartMaintenanceInput) Start req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartMaintenanceRequest{Request: req, Input: input} + return StartMaintenanceRequest{Request: req, Input: input, Copy: c.StartMaintenanceRequest} } const opUpdateServer = "UpdateServer" @@ -778,6 +791,7 @@ const opUpdateServer = "UpdateServer" type UpdateServerRequest struct { *aws.Request Input *UpdateServerInput + Copy func(*UpdateServerInput) UpdateServerRequest } // Send marshals and sends the UpdateServer API request. @@ -820,7 +834,7 @@ func (c *OpsWorksCM) UpdateServerRequest(input *UpdateServerInput) UpdateServerR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateServerRequest{Request: req, Input: input} + return UpdateServerRequest{Request: req, Input: input, Copy: c.UpdateServerRequest} } const opUpdateServerEngineAttributes = "UpdateServerEngineAttributes" @@ -829,6 +843,7 @@ const opUpdateServerEngineAttributes = "UpdateServerEngineAttributes" type UpdateServerEngineAttributesRequest struct { *aws.Request Input *UpdateServerEngineAttributesInput + Copy func(*UpdateServerEngineAttributesInput) UpdateServerEngineAttributesRequest } // Send marshals and sends the UpdateServerEngineAttributes API request. @@ -880,7 +895,7 @@ func (c *OpsWorksCM) UpdateServerEngineAttributesRequest(input *UpdateServerEngi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateServerEngineAttributesRequest{Request: req, Input: input} + return UpdateServerEngineAttributesRequest{Request: req, Input: input, Copy: c.UpdateServerEngineAttributesRequest} } // Stores account attributes. diff --git a/service/organizations/api.go b/service/organizations/api.go index a6987a2d66f..4e40ce454c7 100644 --- a/service/organizations/api.go +++ b/service/organizations/api.go @@ -17,6 +17,7 @@ const opAcceptHandshake = "AcceptHandshake" type AcceptHandshakeRequest struct { *aws.Request Input *AcceptHandshakeInput + Copy func(*AcceptHandshakeInput) AcceptHandshakeRequest } // Send marshals and sends the AcceptHandshake API request. @@ -84,7 +85,7 @@ func (c *Organizations) AcceptHandshakeRequest(input *AcceptHandshakeInput) Acce req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcceptHandshakeRequest{Request: req, Input: input} + return AcceptHandshakeRequest{Request: req, Input: input, Copy: c.AcceptHandshakeRequest} } const opAttachPolicy = "AttachPolicy" @@ -93,6 +94,7 @@ const opAttachPolicy = "AttachPolicy" type AttachPolicyRequest struct { *aws.Request Input *AttachPolicyInput + Copy func(*AttachPolicyInput) AttachPolicyRequest } // Send marshals and sends the AttachPolicy API request. @@ -173,7 +175,7 @@ func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) AttachPoli req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AttachPolicyRequest{Request: req, Input: input} + return AttachPolicyRequest{Request: req, Input: input, Copy: c.AttachPolicyRequest} } const opCancelHandshake = "CancelHandshake" @@ -182,6 +184,7 @@ const opCancelHandshake = "CancelHandshake" type CancelHandshakeRequest struct { *aws.Request Input *CancelHandshakeInput + Copy func(*CancelHandshakeInput) CancelHandshakeRequest } // Send marshals and sends the CancelHandshake API request. @@ -230,7 +233,7 @@ func (c *Organizations) CancelHandshakeRequest(input *CancelHandshakeInput) Canc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelHandshakeRequest{Request: req, Input: input} + return CancelHandshakeRequest{Request: req, Input: input, Copy: c.CancelHandshakeRequest} } const opCreateAccount = "CreateAccount" @@ -239,6 +242,7 @@ const opCreateAccount = "CreateAccount" type CreateAccountRequest struct { *aws.Request Input *CreateAccountInput + Copy func(*CreateAccountInput) CreateAccountRequest } // Send marshals and sends the CreateAccount API request. @@ -327,7 +331,7 @@ func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) CreateAc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAccountRequest{Request: req, Input: input} + return CreateAccountRequest{Request: req, Input: input, Copy: c.CreateAccountRequest} } const opCreateOrganization = "CreateOrganization" @@ -336,6 +340,7 @@ const opCreateOrganization = "CreateOrganization" type CreateOrganizationRequest struct { *aws.Request Input *CreateOrganizationInput + Copy func(*CreateOrganizationInput) CreateOrganizationRequest } // Send marshals and sends the CreateOrganization API request. @@ -389,7 +394,7 @@ func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateOrganizationRequest{Request: req, Input: input} + return CreateOrganizationRequest{Request: req, Input: input, Copy: c.CreateOrganizationRequest} } const opCreateOrganizationalUnit = "CreateOrganizationalUnit" @@ -398,6 +403,7 @@ const opCreateOrganizationalUnit = "CreateOrganizationalUnit" type CreateOrganizationalUnitRequest struct { *aws.Request Input *CreateOrganizationalUnitInput + Copy func(*CreateOrganizationalUnitInput) CreateOrganizationalUnitRequest } // Send marshals and sends the CreateOrganizationalUnit API request. @@ -447,7 +453,7 @@ func (c *Organizations) CreateOrganizationalUnitRequest(input *CreateOrganizatio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateOrganizationalUnitRequest{Request: req, Input: input} + return CreateOrganizationalUnitRequest{Request: req, Input: input, Copy: c.CreateOrganizationalUnitRequest} } const opCreatePolicy = "CreatePolicy" @@ -456,6 +462,7 @@ const opCreatePolicy = "CreatePolicy" type CreatePolicyRequest struct { *aws.Request Input *CreatePolicyInput + Copy func(*CreatePolicyInput) CreatePolicyRequest } // Send marshals and sends the CreatePolicy API request. @@ -502,7 +509,7 @@ func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) CreatePoli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePolicyRequest{Request: req, Input: input} + return CreatePolicyRequest{Request: req, Input: input, Copy: c.CreatePolicyRequest} } const opDeclineHandshake = "DeclineHandshake" @@ -511,6 +518,7 @@ const opDeclineHandshake = "DeclineHandshake" type DeclineHandshakeRequest struct { *aws.Request Input *DeclineHandshakeInput + Copy func(*DeclineHandshakeInput) DeclineHandshakeRequest } // Send marshals and sends the DeclineHandshake API request. @@ -560,7 +568,7 @@ func (c *Organizations) DeclineHandshakeRequest(input *DeclineHandshakeInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeclineHandshakeRequest{Request: req, Input: input} + return DeclineHandshakeRequest{Request: req, Input: input, Copy: c.DeclineHandshakeRequest} } const opDeleteOrganization = "DeleteOrganization" @@ -569,6 +577,7 @@ const opDeleteOrganization = "DeleteOrganization" type DeleteOrganizationRequest struct { *aws.Request Input *DeleteOrganizationInput + Copy func(*DeleteOrganizationInput) DeleteOrganizationRequest } // Send marshals and sends the DeleteOrganization API request. @@ -613,7 +622,7 @@ func (c *Organizations) DeleteOrganizationRequest(input *DeleteOrganizationInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteOrganizationRequest{Request: req, Input: input} + return DeleteOrganizationRequest{Request: req, Input: input, Copy: c.DeleteOrganizationRequest} } const opDeleteOrganizationalUnit = "DeleteOrganizationalUnit" @@ -622,6 +631,7 @@ const opDeleteOrganizationalUnit = "DeleteOrganizationalUnit" type DeleteOrganizationalUnitRequest struct { *aws.Request Input *DeleteOrganizationalUnitInput + Copy func(*DeleteOrganizationalUnitInput) DeleteOrganizationalUnitRequest } // Send marshals and sends the DeleteOrganizationalUnit API request. @@ -667,7 +677,7 @@ func (c *Organizations) DeleteOrganizationalUnitRequest(input *DeleteOrganizatio req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteOrganizationalUnitRequest{Request: req, Input: input} + return DeleteOrganizationalUnitRequest{Request: req, Input: input, Copy: c.DeleteOrganizationalUnitRequest} } const opDeletePolicy = "DeletePolicy" @@ -676,6 +686,7 @@ const opDeletePolicy = "DeletePolicy" type DeletePolicyRequest struct { *aws.Request Input *DeletePolicyInput + Copy func(*DeletePolicyInput) DeletePolicyRequest } // Send marshals and sends the DeletePolicy API request. @@ -721,7 +732,7 @@ func (c *Organizations) DeletePolicyRequest(input *DeletePolicyInput) DeletePoli req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePolicyRequest{Request: req, Input: input} + return DeletePolicyRequest{Request: req, Input: input, Copy: c.DeletePolicyRequest} } const opDescribeAccount = "DescribeAccount" @@ -730,6 +741,7 @@ const opDescribeAccount = "DescribeAccount" type DescribeAccountRequest struct { *aws.Request Input *DescribeAccountInput + Copy func(*DescribeAccountInput) DescribeAccountRequest } // Send marshals and sends the DescribeAccount API request. @@ -772,7 +784,7 @@ func (c *Organizations) DescribeAccountRequest(input *DescribeAccountInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAccountRequest{Request: req, Input: input} + return DescribeAccountRequest{Request: req, Input: input, Copy: c.DescribeAccountRequest} } const opDescribeCreateAccountStatus = "DescribeCreateAccountStatus" @@ -781,6 +793,7 @@ const opDescribeCreateAccountStatus = "DescribeCreateAccountStatus" type DescribeCreateAccountStatusRequest struct { *aws.Request Input *DescribeCreateAccountStatusInput + Copy func(*DescribeCreateAccountStatusInput) DescribeCreateAccountStatusRequest } // Send marshals and sends the DescribeCreateAccountStatus API request. @@ -823,7 +836,7 @@ func (c *Organizations) DescribeCreateAccountStatusRequest(input *DescribeCreate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCreateAccountStatusRequest{Request: req, Input: input} + return DescribeCreateAccountStatusRequest{Request: req, Input: input, Copy: c.DescribeCreateAccountStatusRequest} } const opDescribeHandshake = "DescribeHandshake" @@ -832,6 +845,7 @@ const opDescribeHandshake = "DescribeHandshake" type DescribeHandshakeRequest struct { *aws.Request Input *DescribeHandshakeInput + Copy func(*DescribeHandshakeInput) DescribeHandshakeRequest } // Send marshals and sends the DescribeHandshake API request. @@ -880,7 +894,7 @@ func (c *Organizations) DescribeHandshakeRequest(input *DescribeHandshakeInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeHandshakeRequest{Request: req, Input: input} + return DescribeHandshakeRequest{Request: req, Input: input, Copy: c.DescribeHandshakeRequest} } const opDescribeOrganization = "DescribeOrganization" @@ -889,6 +903,7 @@ const opDescribeOrganization = "DescribeOrganization" type DescribeOrganizationRequest struct { *aws.Request Input *DescribeOrganizationInput + Copy func(*DescribeOrganizationInput) DescribeOrganizationRequest } // Send marshals and sends the DescribeOrganization API request. @@ -932,7 +947,7 @@ func (c *Organizations) DescribeOrganizationRequest(input *DescribeOrganizationI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeOrganizationRequest{Request: req, Input: input} + return DescribeOrganizationRequest{Request: req, Input: input, Copy: c.DescribeOrganizationRequest} } const opDescribeOrganizationalUnit = "DescribeOrganizationalUnit" @@ -941,6 +956,7 @@ const opDescribeOrganizationalUnit = "DescribeOrganizationalUnit" type DescribeOrganizationalUnitRequest struct { *aws.Request Input *DescribeOrganizationalUnitInput + Copy func(*DescribeOrganizationalUnitInput) DescribeOrganizationalUnitRequest } // Send marshals and sends the DescribeOrganizationalUnit API request. @@ -983,7 +999,7 @@ func (c *Organizations) DescribeOrganizationalUnitRequest(input *DescribeOrganiz req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeOrganizationalUnitRequest{Request: req, Input: input} + return DescribeOrganizationalUnitRequest{Request: req, Input: input, Copy: c.DescribeOrganizationalUnitRequest} } const opDescribePolicy = "DescribePolicy" @@ -992,6 +1008,7 @@ const opDescribePolicy = "DescribePolicy" type DescribePolicyRequest struct { *aws.Request Input *DescribePolicyInput + Copy func(*DescribePolicyInput) DescribePolicyRequest } // Send marshals and sends the DescribePolicy API request. @@ -1034,7 +1051,7 @@ func (c *Organizations) DescribePolicyRequest(input *DescribePolicyInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePolicyRequest{Request: req, Input: input} + return DescribePolicyRequest{Request: req, Input: input, Copy: c.DescribePolicyRequest} } const opDetachPolicy = "DetachPolicy" @@ -1043,6 +1060,7 @@ const opDetachPolicy = "DetachPolicy" type DetachPolicyRequest struct { *aws.Request Input *DetachPolicyInput + Copy func(*DetachPolicyInput) DetachPolicyRequest } // Send marshals and sends the DetachPolicy API request. @@ -1099,7 +1117,7 @@ func (c *Organizations) DetachPolicyRequest(input *DetachPolicyInput) DetachPoli req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DetachPolicyRequest{Request: req, Input: input} + return DetachPolicyRequest{Request: req, Input: input, Copy: c.DetachPolicyRequest} } const opDisableAWSServiceAccess = "DisableAWSServiceAccess" @@ -1108,6 +1126,7 @@ const opDisableAWSServiceAccess = "DisableAWSServiceAccess" type DisableAWSServiceAccessRequest struct { *aws.Request Input *DisableAWSServiceAccessInput + Copy func(*DisableAWSServiceAccessInput) DisableAWSServiceAccessRequest } // Send marshals and sends the DisableAWSServiceAccess API request. @@ -1172,7 +1191,7 @@ func (c *Organizations) DisableAWSServiceAccessRequest(input *DisableAWSServiceA req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DisableAWSServiceAccessRequest{Request: req, Input: input} + return DisableAWSServiceAccessRequest{Request: req, Input: input, Copy: c.DisableAWSServiceAccessRequest} } const opDisablePolicyType = "DisablePolicyType" @@ -1181,6 +1200,7 @@ const opDisablePolicyType = "DisablePolicyType" type DisablePolicyTypeRequest struct { *aws.Request Input *DisablePolicyTypeInput + Copy func(*DisablePolicyTypeInput) DisablePolicyTypeRequest } // Send marshals and sends the DisablePolicyType API request. @@ -1227,7 +1247,7 @@ func (c *Organizations) DisablePolicyTypeRequest(input *DisablePolicyTypeInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisablePolicyTypeRequest{Request: req, Input: input} + return DisablePolicyTypeRequest{Request: req, Input: input, Copy: c.DisablePolicyTypeRequest} } const opEnableAWSServiceAccess = "EnableAWSServiceAccess" @@ -1236,6 +1256,7 @@ const opEnableAWSServiceAccess = "EnableAWSServiceAccess" type EnableAWSServiceAccessRequest struct { *aws.Request Input *EnableAWSServiceAccessInput + Copy func(*EnableAWSServiceAccessInput) EnableAWSServiceAccessRequest } // Send marshals and sends the EnableAWSServiceAccess API request. @@ -1297,7 +1318,7 @@ func (c *Organizations) EnableAWSServiceAccessRequest(input *EnableAWSServiceAcc req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return EnableAWSServiceAccessRequest{Request: req, Input: input} + return EnableAWSServiceAccessRequest{Request: req, Input: input, Copy: c.EnableAWSServiceAccessRequest} } const opEnableAllFeatures = "EnableAllFeatures" @@ -1306,6 +1327,7 @@ const opEnableAllFeatures = "EnableAllFeatures" type EnableAllFeaturesRequest struct { *aws.Request Input *EnableAllFeaturesInput + Copy func(*EnableAllFeaturesInput) EnableAllFeaturesRequest } // Send marshals and sends the EnableAllFeatures API request. @@ -1372,7 +1394,7 @@ func (c *Organizations) EnableAllFeaturesRequest(input *EnableAllFeaturesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableAllFeaturesRequest{Request: req, Input: input} + return EnableAllFeaturesRequest{Request: req, Input: input, Copy: c.EnableAllFeaturesRequest} } const opEnablePolicyType = "EnablePolicyType" @@ -1381,6 +1403,7 @@ const opEnablePolicyType = "EnablePolicyType" type EnablePolicyTypeRequest struct { *aws.Request Input *EnablePolicyTypeInput + Copy func(*EnablePolicyTypeInput) EnablePolicyTypeRequest } // Send marshals and sends the EnablePolicyType API request. @@ -1425,7 +1448,7 @@ func (c *Organizations) EnablePolicyTypeRequest(input *EnablePolicyTypeInput) En req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnablePolicyTypeRequest{Request: req, Input: input} + return EnablePolicyTypeRequest{Request: req, Input: input, Copy: c.EnablePolicyTypeRequest} } const opInviteAccountToOrganization = "InviteAccountToOrganization" @@ -1434,6 +1457,7 @@ const opInviteAccountToOrganization = "InviteAccountToOrganization" type InviteAccountToOrganizationRequest struct { *aws.Request Input *InviteAccountToOrganizationInput + Copy func(*InviteAccountToOrganizationInput) InviteAccountToOrganizationRequest } // Send marshals and sends the InviteAccountToOrganization API request. @@ -1490,7 +1514,7 @@ func (c *Organizations) InviteAccountToOrganizationRequest(input *InviteAccountT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InviteAccountToOrganizationRequest{Request: req, Input: input} + return InviteAccountToOrganizationRequest{Request: req, Input: input, Copy: c.InviteAccountToOrganizationRequest} } const opLeaveOrganization = "LeaveOrganization" @@ -1499,6 +1523,7 @@ const opLeaveOrganization = "LeaveOrganization" type LeaveOrganizationRequest struct { *aws.Request Input *LeaveOrganizationInput + Copy func(*LeaveOrganizationInput) LeaveOrganizationRequest } // Send marshals and sends the LeaveOrganization API request. @@ -1569,7 +1594,7 @@ func (c *Organizations) LeaveOrganizationRequest(input *LeaveOrganizationInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return LeaveOrganizationRequest{Request: req, Input: input} + return LeaveOrganizationRequest{Request: req, Input: input, Copy: c.LeaveOrganizationRequest} } const opListAWSServiceAccessForOrganization = "ListAWSServiceAccessForOrganization" @@ -1578,6 +1603,7 @@ const opListAWSServiceAccessForOrganization = "ListAWSServiceAccessForOrganizati type ListAWSServiceAccessForOrganizationRequest struct { *aws.Request Input *ListAWSServiceAccessForOrganizationInput + Copy func(*ListAWSServiceAccessForOrganizationInput) ListAWSServiceAccessForOrganizationRequest } // Send marshals and sends the ListAWSServiceAccessForOrganization API request. @@ -1634,57 +1660,53 @@ func (c *Organizations) ListAWSServiceAccessForOrganizationRequest(input *ListAW req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAWSServiceAccessForOrganizationRequest{Request: req, Input: input} + return ListAWSServiceAccessForOrganizationRequest{Request: req, Input: input, Copy: c.ListAWSServiceAccessForOrganizationRequest} } -// ListAWSServiceAccessForOrganizationPages iterates over the pages of a ListAWSServiceAccessForOrganization operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAWSServiceAccessForOrganization method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAWSServiceAccessForOrganizationRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAWSServiceAccessForOrganization operation. -// pageNum := 0 -// err := client.ListAWSServiceAccessForOrganizationPages(params, -// func(page *ListAWSServiceAccessForOrganizationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListAWSServiceAccessForOrganizationPages(input *ListAWSServiceAccessForOrganizationInput, fn func(*ListAWSServiceAccessForOrganizationOutput, bool) bool) error { - return c.ListAWSServiceAccessForOrganizationPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAWSServiceAccessForOrganizationPagesWithContext same as ListAWSServiceAccessForOrganizationPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListAWSServiceAccessForOrganizationPagesWithContext(ctx aws.Context, input *ListAWSServiceAccessForOrganizationInput, fn func(*ListAWSServiceAccessForOrganizationOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAWSServiceAccessForOrganizationInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAWSServiceAccessForOrganizationRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAWSServiceAccessForOrganizationRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAWSServiceAccessForOrganizationRequest) Paginate(opts ...aws.Option) ListAWSServiceAccessForOrganizationPager { + return ListAWSServiceAccessForOrganizationPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAWSServiceAccessForOrganizationInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAWSServiceAccessForOrganizationOutput), !p.HasNextPage()) - } - return p.Err() +// ListAWSServiceAccessForOrganizationPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAWSServiceAccessForOrganizationPager struct { + aws.Pager +} + +func (p *ListAWSServiceAccessForOrganizationPager) CurrentPage() *ListAWSServiceAccessForOrganizationOutput { + return p.Pager.CurrentPage().(*ListAWSServiceAccessForOrganizationOutput) } const opListAccounts = "ListAccounts" @@ -1693,6 +1715,7 @@ const opListAccounts = "ListAccounts" type ListAccountsRequest struct { *aws.Request Input *ListAccountsInput + Copy func(*ListAccountsInput) ListAccountsRequest } // Send marshals and sends the ListAccounts API request. @@ -1742,57 +1765,53 @@ func (c *Organizations) ListAccountsRequest(input *ListAccountsInput) ListAccoun req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAccountsRequest{Request: req, Input: input} + return ListAccountsRequest{Request: req, Input: input, Copy: c.ListAccountsRequest} } -// ListAccountsPages iterates over the pages of a ListAccounts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccounts method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAccountsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAccounts operation. -// pageNum := 0 -// err := client.ListAccountsPages(params, -// func(page *ListAccountsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListAccountsPages(input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool) error { - return c.ListAccountsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAccountsPagesWithContext same as ListAccountsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListAccountsPagesWithContext(ctx aws.Context, input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAccountsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAccountsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAccountsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAccountsRequest) Paginate(opts ...aws.Option) ListAccountsPager { + return ListAccountsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAccountsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAccountsOutput), !p.HasNextPage()) - } - return p.Err() +// ListAccountsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAccountsPager struct { + aws.Pager +} + +func (p *ListAccountsPager) CurrentPage() *ListAccountsOutput { + return p.Pager.CurrentPage().(*ListAccountsOutput) } const opListAccountsForParent = "ListAccountsForParent" @@ -1801,6 +1820,7 @@ const opListAccountsForParent = "ListAccountsForParent" type ListAccountsForParentRequest struct { *aws.Request Input *ListAccountsForParentInput + Copy func(*ListAccountsForParentInput) ListAccountsForParentRequest } // Send marshals and sends the ListAccountsForParent API request. @@ -1854,57 +1874,53 @@ func (c *Organizations) ListAccountsForParentRequest(input *ListAccountsForParen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAccountsForParentRequest{Request: req, Input: input} + return ListAccountsForParentRequest{Request: req, Input: input, Copy: c.ListAccountsForParentRequest} } -// ListAccountsForParentPages iterates over the pages of a ListAccountsForParent operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccountsForParent method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAccountsForParentRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAccountsForParent operation. -// pageNum := 0 -// err := client.ListAccountsForParentPages(params, -// func(page *ListAccountsForParentOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListAccountsForParentPages(input *ListAccountsForParentInput, fn func(*ListAccountsForParentOutput, bool) bool) error { - return c.ListAccountsForParentPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAccountsForParentPagesWithContext same as ListAccountsForParentPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListAccountsForParentPagesWithContext(ctx aws.Context, input *ListAccountsForParentInput, fn func(*ListAccountsForParentOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAccountsForParentInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAccountsForParentRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAccountsForParentRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAccountsForParentRequest) Paginate(opts ...aws.Option) ListAccountsForParentPager { + return ListAccountsForParentPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAccountsForParentInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAccountsForParentOutput), !p.HasNextPage()) - } - return p.Err() +// ListAccountsForParentPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAccountsForParentPager struct { + aws.Pager +} + +func (p *ListAccountsForParentPager) CurrentPage() *ListAccountsForParentOutput { + return p.Pager.CurrentPage().(*ListAccountsForParentOutput) } const opListChildren = "ListChildren" @@ -1913,6 +1929,7 @@ const opListChildren = "ListChildren" type ListChildrenRequest struct { *aws.Request Input *ListChildrenInput + Copy func(*ListChildrenInput) ListChildrenRequest } // Send marshals and sends the ListChildren API request. @@ -1963,57 +1980,53 @@ func (c *Organizations) ListChildrenRequest(input *ListChildrenInput) ListChildr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListChildrenRequest{Request: req, Input: input} + return ListChildrenRequest{Request: req, Input: input, Copy: c.ListChildrenRequest} } -// ListChildrenPages iterates over the pages of a ListChildren operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListChildren method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListChildrenRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListChildren operation. -// pageNum := 0 -// err := client.ListChildrenPages(params, -// func(page *ListChildrenOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListChildrenPages(input *ListChildrenInput, fn func(*ListChildrenOutput, bool) bool) error { - return c.ListChildrenPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListChildrenPagesWithContext same as ListChildrenPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListChildrenPagesWithContext(ctx aws.Context, input *ListChildrenInput, fn func(*ListChildrenOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListChildrenInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListChildrenRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListChildrenRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListChildrenRequest) Paginate(opts ...aws.Option) ListChildrenPager { + return ListChildrenPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListChildrenInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListChildrenOutput), !p.HasNextPage()) - } - return p.Err() +// ListChildrenPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListChildrenPager struct { + aws.Pager +} + +func (p *ListChildrenPager) CurrentPage() *ListChildrenOutput { + return p.Pager.CurrentPage().(*ListChildrenOutput) } const opListCreateAccountStatus = "ListCreateAccountStatus" @@ -2022,6 +2035,7 @@ const opListCreateAccountStatus = "ListCreateAccountStatus" type ListCreateAccountStatusRequest struct { *aws.Request Input *ListCreateAccountStatusInput + Copy func(*ListCreateAccountStatusInput) ListCreateAccountStatusRequest } // Send marshals and sends the ListCreateAccountStatus API request. @@ -2071,57 +2085,53 @@ func (c *Organizations) ListCreateAccountStatusRequest(input *ListCreateAccountS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCreateAccountStatusRequest{Request: req, Input: input} + return ListCreateAccountStatusRequest{Request: req, Input: input, Copy: c.ListCreateAccountStatusRequest} } -// ListCreateAccountStatusPages iterates over the pages of a ListCreateAccountStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCreateAccountStatus method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListCreateAccountStatusRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListCreateAccountStatus operation. -// pageNum := 0 -// err := client.ListCreateAccountStatusPages(params, -// func(page *ListCreateAccountStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListCreateAccountStatusPages(input *ListCreateAccountStatusInput, fn func(*ListCreateAccountStatusOutput, bool) bool) error { - return c.ListCreateAccountStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCreateAccountStatusPagesWithContext same as ListCreateAccountStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListCreateAccountStatusPagesWithContext(ctx aws.Context, input *ListCreateAccountStatusInput, fn func(*ListCreateAccountStatusOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListCreateAccountStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListCreateAccountStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListCreateAccountStatusRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListCreateAccountStatusRequest) Paginate(opts ...aws.Option) ListCreateAccountStatusPager { + return ListCreateAccountStatusPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListCreateAccountStatusInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCreateAccountStatusOutput), !p.HasNextPage()) - } - return p.Err() +// ListCreateAccountStatusPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListCreateAccountStatusPager struct { + aws.Pager +} + +func (p *ListCreateAccountStatusPager) CurrentPage() *ListCreateAccountStatusOutput { + return p.Pager.CurrentPage().(*ListCreateAccountStatusOutput) } const opListHandshakesForAccount = "ListHandshakesForAccount" @@ -2130,6 +2140,7 @@ const opListHandshakesForAccount = "ListHandshakesForAccount" type ListHandshakesForAccountRequest struct { *aws.Request Input *ListHandshakesForAccountInput + Copy func(*ListHandshakesForAccountInput) ListHandshakesForAccountRequest } // Send marshals and sends the ListHandshakesForAccount API request. @@ -2183,57 +2194,53 @@ func (c *Organizations) ListHandshakesForAccountRequest(input *ListHandshakesFor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListHandshakesForAccountRequest{Request: req, Input: input} + return ListHandshakesForAccountRequest{Request: req, Input: input, Copy: c.ListHandshakesForAccountRequest} } -// ListHandshakesForAccountPages iterates over the pages of a ListHandshakesForAccount operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHandshakesForAccount method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListHandshakesForAccountRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListHandshakesForAccount operation. -// pageNum := 0 -// err := client.ListHandshakesForAccountPages(params, -// func(page *ListHandshakesForAccountOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListHandshakesForAccountPages(input *ListHandshakesForAccountInput, fn func(*ListHandshakesForAccountOutput, bool) bool) error { - return c.ListHandshakesForAccountPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHandshakesForAccountPagesWithContext same as ListHandshakesForAccountPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListHandshakesForAccountPagesWithContext(ctx aws.Context, input *ListHandshakesForAccountInput, fn func(*ListHandshakesForAccountOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListHandshakesForAccountInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListHandshakesForAccountRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListHandshakesForAccountRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListHandshakesForAccountRequest) Paginate(opts ...aws.Option) ListHandshakesForAccountPager { + return ListHandshakesForAccountPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListHandshakesForAccountInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHandshakesForAccountOutput), !p.HasNextPage()) - } - return p.Err() +// ListHandshakesForAccountPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListHandshakesForAccountPager struct { + aws.Pager +} + +func (p *ListHandshakesForAccountPager) CurrentPage() *ListHandshakesForAccountOutput { + return p.Pager.CurrentPage().(*ListHandshakesForAccountOutput) } const opListHandshakesForOrganization = "ListHandshakesForOrganization" @@ -2242,6 +2249,7 @@ const opListHandshakesForOrganization = "ListHandshakesForOrganization" type ListHandshakesForOrganizationRequest struct { *aws.Request Input *ListHandshakesForOrganizationInput + Copy func(*ListHandshakesForOrganizationInput) ListHandshakesForOrganizationRequest } // Send marshals and sends the ListHandshakesForOrganization API request. @@ -2297,57 +2305,53 @@ func (c *Organizations) ListHandshakesForOrganizationRequest(input *ListHandshak req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListHandshakesForOrganizationRequest{Request: req, Input: input} + return ListHandshakesForOrganizationRequest{Request: req, Input: input, Copy: c.ListHandshakesForOrganizationRequest} } -// ListHandshakesForOrganizationPages iterates over the pages of a ListHandshakesForOrganization operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHandshakesForOrganization method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListHandshakesForOrganizationRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListHandshakesForOrganization operation. -// pageNum := 0 -// err := client.ListHandshakesForOrganizationPages(params, -// func(page *ListHandshakesForOrganizationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListHandshakesForOrganizationPages(input *ListHandshakesForOrganizationInput, fn func(*ListHandshakesForOrganizationOutput, bool) bool) error { - return c.ListHandshakesForOrganizationPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHandshakesForOrganizationPagesWithContext same as ListHandshakesForOrganizationPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListHandshakesForOrganizationPagesWithContext(ctx aws.Context, input *ListHandshakesForOrganizationInput, fn func(*ListHandshakesForOrganizationOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListHandshakesForOrganizationInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListHandshakesForOrganizationRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListHandshakesForOrganizationRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListHandshakesForOrganizationRequest) Paginate(opts ...aws.Option) ListHandshakesForOrganizationPager { + return ListHandshakesForOrganizationPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListHandshakesForOrganizationInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHandshakesForOrganizationOutput), !p.HasNextPage()) - } - return p.Err() +// ListHandshakesForOrganizationPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListHandshakesForOrganizationPager struct { + aws.Pager +} + +func (p *ListHandshakesForOrganizationPager) CurrentPage() *ListHandshakesForOrganizationOutput { + return p.Pager.CurrentPage().(*ListHandshakesForOrganizationOutput) } const opListOrganizationalUnitsForParent = "ListOrganizationalUnitsForParent" @@ -2356,6 +2360,7 @@ const opListOrganizationalUnitsForParent = "ListOrganizationalUnitsForParent" type ListOrganizationalUnitsForParentRequest struct { *aws.Request Input *ListOrganizationalUnitsForParentInput + Copy func(*ListOrganizationalUnitsForParentInput) ListOrganizationalUnitsForParentRequest } // Send marshals and sends the ListOrganizationalUnitsForParent API request. @@ -2404,57 +2409,53 @@ func (c *Organizations) ListOrganizationalUnitsForParentRequest(input *ListOrgan req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOrganizationalUnitsForParentRequest{Request: req, Input: input} + return ListOrganizationalUnitsForParentRequest{Request: req, Input: input, Copy: c.ListOrganizationalUnitsForParentRequest} } -// ListOrganizationalUnitsForParentPages iterates over the pages of a ListOrganizationalUnitsForParent operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOrganizationalUnitsForParent method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListOrganizationalUnitsForParentRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListOrganizationalUnitsForParent operation. -// pageNum := 0 -// err := client.ListOrganizationalUnitsForParentPages(params, -// func(page *ListOrganizationalUnitsForParentOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListOrganizationalUnitsForParentPages(input *ListOrganizationalUnitsForParentInput, fn func(*ListOrganizationalUnitsForParentOutput, bool) bool) error { - return c.ListOrganizationalUnitsForParentPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOrganizationalUnitsForParentPagesWithContext same as ListOrganizationalUnitsForParentPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListOrganizationalUnitsForParentPagesWithContext(ctx aws.Context, input *ListOrganizationalUnitsForParentInput, fn func(*ListOrganizationalUnitsForParentOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListOrganizationalUnitsForParentInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListOrganizationalUnitsForParentRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListOrganizationalUnitsForParentRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListOrganizationalUnitsForParentRequest) Paginate(opts ...aws.Option) ListOrganizationalUnitsForParentPager { + return ListOrganizationalUnitsForParentPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListOrganizationalUnitsForParentInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOrganizationalUnitsForParentOutput), !p.HasNextPage()) - } - return p.Err() +// ListOrganizationalUnitsForParentPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListOrganizationalUnitsForParentPager struct { + aws.Pager +} + +func (p *ListOrganizationalUnitsForParentPager) CurrentPage() *ListOrganizationalUnitsForParentOutput { + return p.Pager.CurrentPage().(*ListOrganizationalUnitsForParentOutput) } const opListParents = "ListParents" @@ -2463,6 +2464,7 @@ const opListParents = "ListParents" type ListParentsRequest struct { *aws.Request Input *ListParentsInput + Copy func(*ListParentsInput) ListParentsRequest } // Send marshals and sends the ListParents API request. @@ -2515,57 +2517,53 @@ func (c *Organizations) ListParentsRequest(input *ListParentsInput) ListParentsR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListParentsRequest{Request: req, Input: input} + return ListParentsRequest{Request: req, Input: input, Copy: c.ListParentsRequest} } -// ListParentsPages iterates over the pages of a ListParents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListParents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListParentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListParents operation. -// pageNum := 0 -// err := client.ListParentsPages(params, -// func(page *ListParentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListParentsPages(input *ListParentsInput, fn func(*ListParentsOutput, bool) bool) error { - return c.ListParentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListParentsPagesWithContext same as ListParentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListParentsPagesWithContext(ctx aws.Context, input *ListParentsInput, fn func(*ListParentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListParentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListParentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListParentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListParentsRequest) Paginate(opts ...aws.Option) ListParentsPager { + return ListParentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListParentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListParentsOutput), !p.HasNextPage()) - } - return p.Err() +// ListParentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListParentsPager struct { + aws.Pager +} + +func (p *ListParentsPager) CurrentPage() *ListParentsOutput { + return p.Pager.CurrentPage().(*ListParentsOutput) } const opListPolicies = "ListPolicies" @@ -2574,6 +2572,7 @@ const opListPolicies = "ListPolicies" type ListPoliciesRequest struct { *aws.Request Input *ListPoliciesInput + Copy func(*ListPoliciesInput) ListPoliciesRequest } // Send marshals and sends the ListPolicies API request. @@ -2622,57 +2621,53 @@ func (c *Organizations) ListPoliciesRequest(input *ListPoliciesInput) ListPolici req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPoliciesRequest{Request: req, Input: input} + return ListPoliciesRequest{Request: req, Input: input, Copy: c.ListPoliciesRequest} } -// ListPoliciesPages iterates over the pages of a ListPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicies method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPoliciesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPolicies operation. -// pageNum := 0 -// err := client.ListPoliciesPages(params, -// func(page *ListPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListPoliciesPages(input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool) error { - return c.ListPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPoliciesPagesWithContext same as ListPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListPoliciesPagesWithContext(ctx aws.Context, input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPoliciesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPoliciesRequest) Paginate(opts ...aws.Option) ListPoliciesPager { + return ListPoliciesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPoliciesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) - } - return p.Err() +// ListPoliciesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPoliciesPager struct { + aws.Pager +} + +func (p *ListPoliciesPager) CurrentPage() *ListPoliciesOutput { + return p.Pager.CurrentPage().(*ListPoliciesOutput) } const opListPoliciesForTarget = "ListPoliciesForTarget" @@ -2681,6 +2676,7 @@ const opListPoliciesForTarget = "ListPoliciesForTarget" type ListPoliciesForTargetRequest struct { *aws.Request Input *ListPoliciesForTargetInput + Copy func(*ListPoliciesForTargetInput) ListPoliciesForTargetRequest } // Send marshals and sends the ListPoliciesForTarget API request. @@ -2731,57 +2727,53 @@ func (c *Organizations) ListPoliciesForTargetRequest(input *ListPoliciesForTarge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPoliciesForTargetRequest{Request: req, Input: input} + return ListPoliciesForTargetRequest{Request: req, Input: input, Copy: c.ListPoliciesForTargetRequest} } -// ListPoliciesForTargetPages iterates over the pages of a ListPoliciesForTarget operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPoliciesForTarget method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPoliciesForTargetRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPoliciesForTarget operation. -// pageNum := 0 -// err := client.ListPoliciesForTargetPages(params, -// func(page *ListPoliciesForTargetOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListPoliciesForTargetPages(input *ListPoliciesForTargetInput, fn func(*ListPoliciesForTargetOutput, bool) bool) error { - return c.ListPoliciesForTargetPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPoliciesForTargetPagesWithContext same as ListPoliciesForTargetPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListPoliciesForTargetPagesWithContext(ctx aws.Context, input *ListPoliciesForTargetInput, fn func(*ListPoliciesForTargetOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPoliciesForTargetInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPoliciesForTargetRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPoliciesForTargetRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPoliciesForTargetRequest) Paginate(opts ...aws.Option) ListPoliciesForTargetPager { + return ListPoliciesForTargetPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPoliciesForTargetInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPoliciesForTargetOutput), !p.HasNextPage()) - } - return p.Err() +// ListPoliciesForTargetPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPoliciesForTargetPager struct { + aws.Pager +} + +func (p *ListPoliciesForTargetPager) CurrentPage() *ListPoliciesForTargetOutput { + return p.Pager.CurrentPage().(*ListPoliciesForTargetOutput) } const opListRoots = "ListRoots" @@ -2790,6 +2782,7 @@ const opListRoots = "ListRoots" type ListRootsRequest struct { *aws.Request Input *ListRootsInput + Copy func(*ListRootsInput) ListRootsRequest } // Send marshals and sends the ListRoots API request. @@ -2838,57 +2831,53 @@ func (c *Organizations) ListRootsRequest(input *ListRootsInput) ListRootsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRootsRequest{Request: req, Input: input} + return ListRootsRequest{Request: req, Input: input, Copy: c.ListRootsRequest} } -// ListRootsPages iterates over the pages of a ListRoots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRoots method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListRootsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListRoots operation. -// pageNum := 0 -// err := client.ListRootsPages(params, -// func(page *ListRootsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListRootsPages(input *ListRootsInput, fn func(*ListRootsOutput, bool) bool) error { - return c.ListRootsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRootsPagesWithContext same as ListRootsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListRootsPagesWithContext(ctx aws.Context, input *ListRootsInput, fn func(*ListRootsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListRootsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListRootsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListRootsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListRootsRequest) Paginate(opts ...aws.Option) ListRootsPager { + return ListRootsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListRootsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRootsOutput), !p.HasNextPage()) - } - return p.Err() +// ListRootsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListRootsPager struct { + aws.Pager +} + +func (p *ListRootsPager) CurrentPage() *ListRootsOutput { + return p.Pager.CurrentPage().(*ListRootsOutput) } const opListTargetsForPolicy = "ListTargetsForPolicy" @@ -2897,6 +2886,7 @@ const opListTargetsForPolicy = "ListTargetsForPolicy" type ListTargetsForPolicyRequest struct { *aws.Request Input *ListTargetsForPolicyInput + Copy func(*ListTargetsForPolicyInput) ListTargetsForPolicyRequest } // Send marshals and sends the ListTargetsForPolicy API request. @@ -2945,57 +2935,53 @@ func (c *Organizations) ListTargetsForPolicyRequest(input *ListTargetsForPolicyI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTargetsForPolicyRequest{Request: req, Input: input} + return ListTargetsForPolicyRequest{Request: req, Input: input, Copy: c.ListTargetsForPolicyRequest} } -// ListTargetsForPolicyPages iterates over the pages of a ListTargetsForPolicy operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTargetsForPolicy method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTargetsForPolicyRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTargetsForPolicy operation. -// pageNum := 0 -// err := client.ListTargetsForPolicyPages(params, -// func(page *ListTargetsForPolicyOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Organizations) ListTargetsForPolicyPages(input *ListTargetsForPolicyInput, fn func(*ListTargetsForPolicyOutput, bool) bool) error { - return c.ListTargetsForPolicyPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTargetsForPolicyPagesWithContext same as ListTargetsForPolicyPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListTargetsForPolicyPagesWithContext(ctx aws.Context, input *ListTargetsForPolicyInput, fn func(*ListTargetsForPolicyOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTargetsForPolicyInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTargetsForPolicyRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTargetsForPolicyRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTargetsForPolicyRequest) Paginate(opts ...aws.Option) ListTargetsForPolicyPager { + return ListTargetsForPolicyPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTargetsForPolicyInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTargetsForPolicyOutput), !p.HasNextPage()) - } - return p.Err() +// ListTargetsForPolicyPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTargetsForPolicyPager struct { + aws.Pager +} + +func (p *ListTargetsForPolicyPager) CurrentPage() *ListTargetsForPolicyOutput { + return p.Pager.CurrentPage().(*ListTargetsForPolicyOutput) } const opMoveAccount = "MoveAccount" @@ -3004,6 +2990,7 @@ const opMoveAccount = "MoveAccount" type MoveAccountRequest struct { *aws.Request Input *MoveAccountInput + Copy func(*MoveAccountInput) MoveAccountRequest } // Send marshals and sends the MoveAccount API request. @@ -3049,7 +3036,7 @@ func (c *Organizations) MoveAccountRequest(input *MoveAccountInput) MoveAccountR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return MoveAccountRequest{Request: req, Input: input} + return MoveAccountRequest{Request: req, Input: input, Copy: c.MoveAccountRequest} } const opRemoveAccountFromOrganization = "RemoveAccountFromOrganization" @@ -3058,6 +3045,7 @@ const opRemoveAccountFromOrganization = "RemoveAccountFromOrganization" type RemoveAccountFromOrganizationRequest struct { *aws.Request Input *RemoveAccountFromOrganizationInput + Copy func(*RemoveAccountFromOrganizationInput) RemoveAccountFromOrganizationRequest } // Send marshals and sends the RemoveAccountFromOrganization API request. @@ -3129,7 +3117,7 @@ func (c *Organizations) RemoveAccountFromOrganizationRequest(input *RemoveAccoun req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveAccountFromOrganizationRequest{Request: req, Input: input} + return RemoveAccountFromOrganizationRequest{Request: req, Input: input, Copy: c.RemoveAccountFromOrganizationRequest} } const opUpdateOrganizationalUnit = "UpdateOrganizationalUnit" @@ -3138,6 +3126,7 @@ const opUpdateOrganizationalUnit = "UpdateOrganizationalUnit" type UpdateOrganizationalUnitRequest struct { *aws.Request Input *UpdateOrganizationalUnitInput + Copy func(*UpdateOrganizationalUnitInput) UpdateOrganizationalUnitRequest } // Send marshals and sends the UpdateOrganizationalUnit API request. @@ -3182,7 +3171,7 @@ func (c *Organizations) UpdateOrganizationalUnitRequest(input *UpdateOrganizatio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateOrganizationalUnitRequest{Request: req, Input: input} + return UpdateOrganizationalUnitRequest{Request: req, Input: input, Copy: c.UpdateOrganizationalUnitRequest} } const opUpdatePolicy = "UpdatePolicy" @@ -3191,6 +3180,7 @@ const opUpdatePolicy = "UpdatePolicy" type UpdatePolicyRequest struct { *aws.Request Input *UpdatePolicyInput + Copy func(*UpdatePolicyInput) UpdatePolicyRequest } // Send marshals and sends the UpdatePolicy API request. @@ -3235,7 +3225,7 @@ func (c *Organizations) UpdatePolicyRequest(input *UpdatePolicyInput) UpdatePoli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePolicyRequest{Request: req, Input: input} + return UpdatePolicyRequest{Request: req, Input: input, Copy: c.UpdatePolicyRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AcceptHandshakeRequest diff --git a/service/organizations/organizationsiface/interface.go b/service/organizations/organizationsiface/interface.go index 3165b1ad67d..b5138b5c643 100644 --- a/service/organizations/organizationsiface/interface.go +++ b/service/organizations/organizationsiface/interface.go @@ -9,7 +9,6 @@ package organizationsiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/organizations" ) @@ -115,69 +114,30 @@ type OrganizationsAPI interface { ListAWSServiceAccessForOrganizationRequest(*organizations.ListAWSServiceAccessForOrganizationInput) organizations.ListAWSServiceAccessForOrganizationRequest - ListAWSServiceAccessForOrganizationPages(*organizations.ListAWSServiceAccessForOrganizationInput, func(*organizations.ListAWSServiceAccessForOrganizationOutput, bool) bool) error - ListAWSServiceAccessForOrganizationPagesWithContext(aws.Context, *organizations.ListAWSServiceAccessForOrganizationInput, func(*organizations.ListAWSServiceAccessForOrganizationOutput, bool) bool, ...aws.Option) error - ListAccountsRequest(*organizations.ListAccountsInput) organizations.ListAccountsRequest - ListAccountsPages(*organizations.ListAccountsInput, func(*organizations.ListAccountsOutput, bool) bool) error - ListAccountsPagesWithContext(aws.Context, *organizations.ListAccountsInput, func(*organizations.ListAccountsOutput, bool) bool, ...aws.Option) error - ListAccountsForParentRequest(*organizations.ListAccountsForParentInput) organizations.ListAccountsForParentRequest - ListAccountsForParentPages(*organizations.ListAccountsForParentInput, func(*organizations.ListAccountsForParentOutput, bool) bool) error - ListAccountsForParentPagesWithContext(aws.Context, *organizations.ListAccountsForParentInput, func(*organizations.ListAccountsForParentOutput, bool) bool, ...aws.Option) error - ListChildrenRequest(*organizations.ListChildrenInput) organizations.ListChildrenRequest - ListChildrenPages(*organizations.ListChildrenInput, func(*organizations.ListChildrenOutput, bool) bool) error - ListChildrenPagesWithContext(aws.Context, *organizations.ListChildrenInput, func(*organizations.ListChildrenOutput, bool) bool, ...aws.Option) error - ListCreateAccountStatusRequest(*organizations.ListCreateAccountStatusInput) organizations.ListCreateAccountStatusRequest - ListCreateAccountStatusPages(*organizations.ListCreateAccountStatusInput, func(*organizations.ListCreateAccountStatusOutput, bool) bool) error - ListCreateAccountStatusPagesWithContext(aws.Context, *organizations.ListCreateAccountStatusInput, func(*organizations.ListCreateAccountStatusOutput, bool) bool, ...aws.Option) error - ListHandshakesForAccountRequest(*organizations.ListHandshakesForAccountInput) organizations.ListHandshakesForAccountRequest - ListHandshakesForAccountPages(*organizations.ListHandshakesForAccountInput, func(*organizations.ListHandshakesForAccountOutput, bool) bool) error - ListHandshakesForAccountPagesWithContext(aws.Context, *organizations.ListHandshakesForAccountInput, func(*organizations.ListHandshakesForAccountOutput, bool) bool, ...aws.Option) error - ListHandshakesForOrganizationRequest(*organizations.ListHandshakesForOrganizationInput) organizations.ListHandshakesForOrganizationRequest - ListHandshakesForOrganizationPages(*organizations.ListHandshakesForOrganizationInput, func(*organizations.ListHandshakesForOrganizationOutput, bool) bool) error - ListHandshakesForOrganizationPagesWithContext(aws.Context, *organizations.ListHandshakesForOrganizationInput, func(*organizations.ListHandshakesForOrganizationOutput, bool) bool, ...aws.Option) error - ListOrganizationalUnitsForParentRequest(*organizations.ListOrganizationalUnitsForParentInput) organizations.ListOrganizationalUnitsForParentRequest - ListOrganizationalUnitsForParentPages(*organizations.ListOrganizationalUnitsForParentInput, func(*organizations.ListOrganizationalUnitsForParentOutput, bool) bool) error - ListOrganizationalUnitsForParentPagesWithContext(aws.Context, *organizations.ListOrganizationalUnitsForParentInput, func(*organizations.ListOrganizationalUnitsForParentOutput, bool) bool, ...aws.Option) error - ListParentsRequest(*organizations.ListParentsInput) organizations.ListParentsRequest - ListParentsPages(*organizations.ListParentsInput, func(*organizations.ListParentsOutput, bool) bool) error - ListParentsPagesWithContext(aws.Context, *organizations.ListParentsInput, func(*organizations.ListParentsOutput, bool) bool, ...aws.Option) error - ListPoliciesRequest(*organizations.ListPoliciesInput) organizations.ListPoliciesRequest - ListPoliciesPages(*organizations.ListPoliciesInput, func(*organizations.ListPoliciesOutput, bool) bool) error - ListPoliciesPagesWithContext(aws.Context, *organizations.ListPoliciesInput, func(*organizations.ListPoliciesOutput, bool) bool, ...aws.Option) error - ListPoliciesForTargetRequest(*organizations.ListPoliciesForTargetInput) organizations.ListPoliciesForTargetRequest - ListPoliciesForTargetPages(*organizations.ListPoliciesForTargetInput, func(*organizations.ListPoliciesForTargetOutput, bool) bool) error - ListPoliciesForTargetPagesWithContext(aws.Context, *organizations.ListPoliciesForTargetInput, func(*organizations.ListPoliciesForTargetOutput, bool) bool, ...aws.Option) error - ListRootsRequest(*organizations.ListRootsInput) organizations.ListRootsRequest - ListRootsPages(*organizations.ListRootsInput, func(*organizations.ListRootsOutput, bool) bool) error - ListRootsPagesWithContext(aws.Context, *organizations.ListRootsInput, func(*organizations.ListRootsOutput, bool) bool, ...aws.Option) error - ListTargetsForPolicyRequest(*organizations.ListTargetsForPolicyInput) organizations.ListTargetsForPolicyRequest - ListTargetsForPolicyPages(*organizations.ListTargetsForPolicyInput, func(*organizations.ListTargetsForPolicyOutput, bool) bool) error - ListTargetsForPolicyPagesWithContext(aws.Context, *organizations.ListTargetsForPolicyInput, func(*organizations.ListTargetsForPolicyOutput, bool) bool, ...aws.Option) error - MoveAccountRequest(*organizations.MoveAccountInput) organizations.MoveAccountRequest RemoveAccountFromOrganizationRequest(*organizations.RemoveAccountFromOrganizationInput) organizations.RemoveAccountFromOrganizationRequest diff --git a/service/pinpoint/api.go b/service/pinpoint/api.go index 7861d14337f..afc6a6b90de 100644 --- a/service/pinpoint/api.go +++ b/service/pinpoint/api.go @@ -14,6 +14,7 @@ const opCreateApp = "CreateApp" type CreateAppRequest struct { *aws.Request Input *CreateAppInput + Copy func(*CreateAppInput) CreateAppRequest } // Send marshals and sends the CreateApp API request. @@ -54,7 +55,7 @@ func (c *Pinpoint) CreateAppRequest(input *CreateAppInput) CreateAppRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAppRequest{Request: req, Input: input} + return CreateAppRequest{Request: req, Input: input, Copy: c.CreateAppRequest} } const opCreateCampaign = "CreateCampaign" @@ -63,6 +64,7 @@ const opCreateCampaign = "CreateCampaign" type CreateCampaignRequest struct { *aws.Request Input *CreateCampaignInput + Copy func(*CreateCampaignInput) CreateCampaignRequest } // Send marshals and sends the CreateCampaign API request. @@ -103,7 +105,7 @@ func (c *Pinpoint) CreateCampaignRequest(input *CreateCampaignInput) CreateCampa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCampaignRequest{Request: req, Input: input} + return CreateCampaignRequest{Request: req, Input: input, Copy: c.CreateCampaignRequest} } const opCreateImportJob = "CreateImportJob" @@ -112,6 +114,7 @@ const opCreateImportJob = "CreateImportJob" type CreateImportJobRequest struct { *aws.Request Input *CreateImportJobInput + Copy func(*CreateImportJobInput) CreateImportJobRequest } // Send marshals and sends the CreateImportJob API request. @@ -152,7 +155,7 @@ func (c *Pinpoint) CreateImportJobRequest(input *CreateImportJobInput) CreateImp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateImportJobRequest{Request: req, Input: input} + return CreateImportJobRequest{Request: req, Input: input, Copy: c.CreateImportJobRequest} } const opCreateSegment = "CreateSegment" @@ -161,6 +164,7 @@ const opCreateSegment = "CreateSegment" type CreateSegmentRequest struct { *aws.Request Input *CreateSegmentInput + Copy func(*CreateSegmentInput) CreateSegmentRequest } // Send marshals and sends the CreateSegment API request. @@ -201,7 +205,7 @@ func (c *Pinpoint) CreateSegmentRequest(input *CreateSegmentInput) CreateSegment req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSegmentRequest{Request: req, Input: input} + return CreateSegmentRequest{Request: req, Input: input, Copy: c.CreateSegmentRequest} } const opDeleteAdmChannel = "DeleteAdmChannel" @@ -210,6 +214,7 @@ const opDeleteAdmChannel = "DeleteAdmChannel" type DeleteAdmChannelRequest struct { *aws.Request Input *DeleteAdmChannelInput + Copy func(*DeleteAdmChannelInput) DeleteAdmChannelRequest } // Send marshals and sends the DeleteAdmChannel API request. @@ -250,7 +255,7 @@ func (c *Pinpoint) DeleteAdmChannelRequest(input *DeleteAdmChannelInput) DeleteA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteAdmChannelRequest{Request: req, Input: input} + return DeleteAdmChannelRequest{Request: req, Input: input, Copy: c.DeleteAdmChannelRequest} } const opDeleteApnsChannel = "DeleteApnsChannel" @@ -259,6 +264,7 @@ const opDeleteApnsChannel = "DeleteApnsChannel" type DeleteApnsChannelRequest struct { *aws.Request Input *DeleteApnsChannelInput + Copy func(*DeleteApnsChannelInput) DeleteApnsChannelRequest } // Send marshals and sends the DeleteApnsChannel API request. @@ -299,7 +305,7 @@ func (c *Pinpoint) DeleteApnsChannelRequest(input *DeleteApnsChannelInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApnsChannelRequest{Request: req, Input: input} + return DeleteApnsChannelRequest{Request: req, Input: input, Copy: c.DeleteApnsChannelRequest} } const opDeleteApnsSandboxChannel = "DeleteApnsSandboxChannel" @@ -308,6 +314,7 @@ const opDeleteApnsSandboxChannel = "DeleteApnsSandboxChannel" type DeleteApnsSandboxChannelRequest struct { *aws.Request Input *DeleteApnsSandboxChannelInput + Copy func(*DeleteApnsSandboxChannelInput) DeleteApnsSandboxChannelRequest } // Send marshals and sends the DeleteApnsSandboxChannel API request. @@ -348,7 +355,7 @@ func (c *Pinpoint) DeleteApnsSandboxChannelRequest(input *DeleteApnsSandboxChann req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApnsSandboxChannelRequest{Request: req, Input: input} + return DeleteApnsSandboxChannelRequest{Request: req, Input: input, Copy: c.DeleteApnsSandboxChannelRequest} } const opDeleteApnsVoipChannel = "DeleteApnsVoipChannel" @@ -357,6 +364,7 @@ const opDeleteApnsVoipChannel = "DeleteApnsVoipChannel" type DeleteApnsVoipChannelRequest struct { *aws.Request Input *DeleteApnsVoipChannelInput + Copy func(*DeleteApnsVoipChannelInput) DeleteApnsVoipChannelRequest } // Send marshals and sends the DeleteApnsVoipChannel API request. @@ -397,7 +405,7 @@ func (c *Pinpoint) DeleteApnsVoipChannelRequest(input *DeleteApnsVoipChannelInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApnsVoipChannelRequest{Request: req, Input: input} + return DeleteApnsVoipChannelRequest{Request: req, Input: input, Copy: c.DeleteApnsVoipChannelRequest} } const opDeleteApnsVoipSandboxChannel = "DeleteApnsVoipSandboxChannel" @@ -406,6 +414,7 @@ const opDeleteApnsVoipSandboxChannel = "DeleteApnsVoipSandboxChannel" type DeleteApnsVoipSandboxChannelRequest struct { *aws.Request Input *DeleteApnsVoipSandboxChannelInput + Copy func(*DeleteApnsVoipSandboxChannelInput) DeleteApnsVoipSandboxChannelRequest } // Send marshals and sends the DeleteApnsVoipSandboxChannel API request. @@ -446,7 +455,7 @@ func (c *Pinpoint) DeleteApnsVoipSandboxChannelRequest(input *DeleteApnsVoipSand req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteApnsVoipSandboxChannelRequest{Request: req, Input: input} + return DeleteApnsVoipSandboxChannelRequest{Request: req, Input: input, Copy: c.DeleteApnsVoipSandboxChannelRequest} } const opDeleteApp = "DeleteApp" @@ -455,6 +464,7 @@ const opDeleteApp = "DeleteApp" type DeleteAppRequest struct { *aws.Request Input *DeleteAppInput + Copy func(*DeleteAppInput) DeleteAppRequest } // Send marshals and sends the DeleteApp API request. @@ -495,7 +505,7 @@ func (c *Pinpoint) DeleteAppRequest(input *DeleteAppInput) DeleteAppRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteAppRequest{Request: req, Input: input} + return DeleteAppRequest{Request: req, Input: input, Copy: c.DeleteAppRequest} } const opDeleteBaiduChannel = "DeleteBaiduChannel" @@ -504,6 +514,7 @@ const opDeleteBaiduChannel = "DeleteBaiduChannel" type DeleteBaiduChannelRequest struct { *aws.Request Input *DeleteBaiduChannelInput + Copy func(*DeleteBaiduChannelInput) DeleteBaiduChannelRequest } // Send marshals and sends the DeleteBaiduChannel API request. @@ -544,7 +555,7 @@ func (c *Pinpoint) DeleteBaiduChannelRequest(input *DeleteBaiduChannelInput) Del req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteBaiduChannelRequest{Request: req, Input: input} + return DeleteBaiduChannelRequest{Request: req, Input: input, Copy: c.DeleteBaiduChannelRequest} } const opDeleteCampaign = "DeleteCampaign" @@ -553,6 +564,7 @@ const opDeleteCampaign = "DeleteCampaign" type DeleteCampaignRequest struct { *aws.Request Input *DeleteCampaignInput + Copy func(*DeleteCampaignInput) DeleteCampaignRequest } // Send marshals and sends the DeleteCampaign API request. @@ -593,7 +605,7 @@ func (c *Pinpoint) DeleteCampaignRequest(input *DeleteCampaignInput) DeleteCampa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteCampaignRequest{Request: req, Input: input} + return DeleteCampaignRequest{Request: req, Input: input, Copy: c.DeleteCampaignRequest} } const opDeleteEmailChannel = "DeleteEmailChannel" @@ -602,6 +614,7 @@ const opDeleteEmailChannel = "DeleteEmailChannel" type DeleteEmailChannelRequest struct { *aws.Request Input *DeleteEmailChannelInput + Copy func(*DeleteEmailChannelInput) DeleteEmailChannelRequest } // Send marshals and sends the DeleteEmailChannel API request. @@ -642,7 +655,7 @@ func (c *Pinpoint) DeleteEmailChannelRequest(input *DeleteEmailChannelInput) Del req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEmailChannelRequest{Request: req, Input: input} + return DeleteEmailChannelRequest{Request: req, Input: input, Copy: c.DeleteEmailChannelRequest} } const opDeleteEventStream = "DeleteEventStream" @@ -651,6 +664,7 @@ const opDeleteEventStream = "DeleteEventStream" type DeleteEventStreamRequest struct { *aws.Request Input *DeleteEventStreamInput + Copy func(*DeleteEventStreamInput) DeleteEventStreamRequest } // Send marshals and sends the DeleteEventStream API request. @@ -691,7 +705,7 @@ func (c *Pinpoint) DeleteEventStreamRequest(input *DeleteEventStreamInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEventStreamRequest{Request: req, Input: input} + return DeleteEventStreamRequest{Request: req, Input: input, Copy: c.DeleteEventStreamRequest} } const opDeleteGcmChannel = "DeleteGcmChannel" @@ -700,6 +714,7 @@ const opDeleteGcmChannel = "DeleteGcmChannel" type DeleteGcmChannelRequest struct { *aws.Request Input *DeleteGcmChannelInput + Copy func(*DeleteGcmChannelInput) DeleteGcmChannelRequest } // Send marshals and sends the DeleteGcmChannel API request. @@ -740,7 +755,7 @@ func (c *Pinpoint) DeleteGcmChannelRequest(input *DeleteGcmChannelInput) DeleteG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGcmChannelRequest{Request: req, Input: input} + return DeleteGcmChannelRequest{Request: req, Input: input, Copy: c.DeleteGcmChannelRequest} } const opDeleteSegment = "DeleteSegment" @@ -749,6 +764,7 @@ const opDeleteSegment = "DeleteSegment" type DeleteSegmentRequest struct { *aws.Request Input *DeleteSegmentInput + Copy func(*DeleteSegmentInput) DeleteSegmentRequest } // Send marshals and sends the DeleteSegment API request. @@ -789,7 +805,7 @@ func (c *Pinpoint) DeleteSegmentRequest(input *DeleteSegmentInput) DeleteSegment req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSegmentRequest{Request: req, Input: input} + return DeleteSegmentRequest{Request: req, Input: input, Copy: c.DeleteSegmentRequest} } const opDeleteSmsChannel = "DeleteSmsChannel" @@ -798,6 +814,7 @@ const opDeleteSmsChannel = "DeleteSmsChannel" type DeleteSmsChannelRequest struct { *aws.Request Input *DeleteSmsChannelInput + Copy func(*DeleteSmsChannelInput) DeleteSmsChannelRequest } // Send marshals and sends the DeleteSmsChannel API request. @@ -838,7 +855,7 @@ func (c *Pinpoint) DeleteSmsChannelRequest(input *DeleteSmsChannelInput) DeleteS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSmsChannelRequest{Request: req, Input: input} + return DeleteSmsChannelRequest{Request: req, Input: input, Copy: c.DeleteSmsChannelRequest} } const opGetAdmChannel = "GetAdmChannel" @@ -847,6 +864,7 @@ const opGetAdmChannel = "GetAdmChannel" type GetAdmChannelRequest struct { *aws.Request Input *GetAdmChannelInput + Copy func(*GetAdmChannelInput) GetAdmChannelRequest } // Send marshals and sends the GetAdmChannel API request. @@ -887,7 +905,7 @@ func (c *Pinpoint) GetAdmChannelRequest(input *GetAdmChannelInput) GetAdmChannel req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAdmChannelRequest{Request: req, Input: input} + return GetAdmChannelRequest{Request: req, Input: input, Copy: c.GetAdmChannelRequest} } const opGetApnsChannel = "GetApnsChannel" @@ -896,6 +914,7 @@ const opGetApnsChannel = "GetApnsChannel" type GetApnsChannelRequest struct { *aws.Request Input *GetApnsChannelInput + Copy func(*GetApnsChannelInput) GetApnsChannelRequest } // Send marshals and sends the GetApnsChannel API request. @@ -936,7 +955,7 @@ func (c *Pinpoint) GetApnsChannelRequest(input *GetApnsChannelInput) GetApnsChan req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApnsChannelRequest{Request: req, Input: input} + return GetApnsChannelRequest{Request: req, Input: input, Copy: c.GetApnsChannelRequest} } const opGetApnsSandboxChannel = "GetApnsSandboxChannel" @@ -945,6 +964,7 @@ const opGetApnsSandboxChannel = "GetApnsSandboxChannel" type GetApnsSandboxChannelRequest struct { *aws.Request Input *GetApnsSandboxChannelInput + Copy func(*GetApnsSandboxChannelInput) GetApnsSandboxChannelRequest } // Send marshals and sends the GetApnsSandboxChannel API request. @@ -985,7 +1005,7 @@ func (c *Pinpoint) GetApnsSandboxChannelRequest(input *GetApnsSandboxChannelInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApnsSandboxChannelRequest{Request: req, Input: input} + return GetApnsSandboxChannelRequest{Request: req, Input: input, Copy: c.GetApnsSandboxChannelRequest} } const opGetApnsVoipChannel = "GetApnsVoipChannel" @@ -994,6 +1014,7 @@ const opGetApnsVoipChannel = "GetApnsVoipChannel" type GetApnsVoipChannelRequest struct { *aws.Request Input *GetApnsVoipChannelInput + Copy func(*GetApnsVoipChannelInput) GetApnsVoipChannelRequest } // Send marshals and sends the GetApnsVoipChannel API request. @@ -1034,7 +1055,7 @@ func (c *Pinpoint) GetApnsVoipChannelRequest(input *GetApnsVoipChannelInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApnsVoipChannelRequest{Request: req, Input: input} + return GetApnsVoipChannelRequest{Request: req, Input: input, Copy: c.GetApnsVoipChannelRequest} } const opGetApnsVoipSandboxChannel = "GetApnsVoipSandboxChannel" @@ -1043,6 +1064,7 @@ const opGetApnsVoipSandboxChannel = "GetApnsVoipSandboxChannel" type GetApnsVoipSandboxChannelRequest struct { *aws.Request Input *GetApnsVoipSandboxChannelInput + Copy func(*GetApnsVoipSandboxChannelInput) GetApnsVoipSandboxChannelRequest } // Send marshals and sends the GetApnsVoipSandboxChannel API request. @@ -1083,7 +1105,7 @@ func (c *Pinpoint) GetApnsVoipSandboxChannelRequest(input *GetApnsVoipSandboxCha req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApnsVoipSandboxChannelRequest{Request: req, Input: input} + return GetApnsVoipSandboxChannelRequest{Request: req, Input: input, Copy: c.GetApnsVoipSandboxChannelRequest} } const opGetApp = "GetApp" @@ -1092,6 +1114,7 @@ const opGetApp = "GetApp" type GetAppRequest struct { *aws.Request Input *GetAppInput + Copy func(*GetAppInput) GetAppRequest } // Send marshals and sends the GetApp API request. @@ -1132,7 +1155,7 @@ func (c *Pinpoint) GetAppRequest(input *GetAppInput) GetAppRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAppRequest{Request: req, Input: input} + return GetAppRequest{Request: req, Input: input, Copy: c.GetAppRequest} } const opGetApplicationSettings = "GetApplicationSettings" @@ -1141,6 +1164,7 @@ const opGetApplicationSettings = "GetApplicationSettings" type GetApplicationSettingsRequest struct { *aws.Request Input *GetApplicationSettingsInput + Copy func(*GetApplicationSettingsInput) GetApplicationSettingsRequest } // Send marshals and sends the GetApplicationSettings API request. @@ -1181,7 +1205,7 @@ func (c *Pinpoint) GetApplicationSettingsRequest(input *GetApplicationSettingsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApplicationSettingsRequest{Request: req, Input: input} + return GetApplicationSettingsRequest{Request: req, Input: input, Copy: c.GetApplicationSettingsRequest} } const opGetApps = "GetApps" @@ -1190,6 +1214,7 @@ const opGetApps = "GetApps" type GetAppsRequest struct { *aws.Request Input *GetAppsInput + Copy func(*GetAppsInput) GetAppsRequest } // Send marshals and sends the GetApps API request. @@ -1230,7 +1255,7 @@ func (c *Pinpoint) GetAppsRequest(input *GetAppsInput) GetAppsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAppsRequest{Request: req, Input: input} + return GetAppsRequest{Request: req, Input: input, Copy: c.GetAppsRequest} } const opGetBaiduChannel = "GetBaiduChannel" @@ -1239,6 +1264,7 @@ const opGetBaiduChannel = "GetBaiduChannel" type GetBaiduChannelRequest struct { *aws.Request Input *GetBaiduChannelInput + Copy func(*GetBaiduChannelInput) GetBaiduChannelRequest } // Send marshals and sends the GetBaiduChannel API request. @@ -1279,7 +1305,7 @@ func (c *Pinpoint) GetBaiduChannelRequest(input *GetBaiduChannelInput) GetBaiduC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBaiduChannelRequest{Request: req, Input: input} + return GetBaiduChannelRequest{Request: req, Input: input, Copy: c.GetBaiduChannelRequest} } const opGetCampaign = "GetCampaign" @@ -1288,6 +1314,7 @@ const opGetCampaign = "GetCampaign" type GetCampaignRequest struct { *aws.Request Input *GetCampaignInput + Copy func(*GetCampaignInput) GetCampaignRequest } // Send marshals and sends the GetCampaign API request. @@ -1328,7 +1355,7 @@ func (c *Pinpoint) GetCampaignRequest(input *GetCampaignInput) GetCampaignReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCampaignRequest{Request: req, Input: input} + return GetCampaignRequest{Request: req, Input: input, Copy: c.GetCampaignRequest} } const opGetCampaignActivities = "GetCampaignActivities" @@ -1337,6 +1364,7 @@ const opGetCampaignActivities = "GetCampaignActivities" type GetCampaignActivitiesRequest struct { *aws.Request Input *GetCampaignActivitiesInput + Copy func(*GetCampaignActivitiesInput) GetCampaignActivitiesRequest } // Send marshals and sends the GetCampaignActivities API request. @@ -1377,7 +1405,7 @@ func (c *Pinpoint) GetCampaignActivitiesRequest(input *GetCampaignActivitiesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCampaignActivitiesRequest{Request: req, Input: input} + return GetCampaignActivitiesRequest{Request: req, Input: input, Copy: c.GetCampaignActivitiesRequest} } const opGetCampaignVersion = "GetCampaignVersion" @@ -1386,6 +1414,7 @@ const opGetCampaignVersion = "GetCampaignVersion" type GetCampaignVersionRequest struct { *aws.Request Input *GetCampaignVersionInput + Copy func(*GetCampaignVersionInput) GetCampaignVersionRequest } // Send marshals and sends the GetCampaignVersion API request. @@ -1426,7 +1455,7 @@ func (c *Pinpoint) GetCampaignVersionRequest(input *GetCampaignVersionInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCampaignVersionRequest{Request: req, Input: input} + return GetCampaignVersionRequest{Request: req, Input: input, Copy: c.GetCampaignVersionRequest} } const opGetCampaignVersions = "GetCampaignVersions" @@ -1435,6 +1464,7 @@ const opGetCampaignVersions = "GetCampaignVersions" type GetCampaignVersionsRequest struct { *aws.Request Input *GetCampaignVersionsInput + Copy func(*GetCampaignVersionsInput) GetCampaignVersionsRequest } // Send marshals and sends the GetCampaignVersions API request. @@ -1475,7 +1505,7 @@ func (c *Pinpoint) GetCampaignVersionsRequest(input *GetCampaignVersionsInput) G req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCampaignVersionsRequest{Request: req, Input: input} + return GetCampaignVersionsRequest{Request: req, Input: input, Copy: c.GetCampaignVersionsRequest} } const opGetCampaigns = "GetCampaigns" @@ -1484,6 +1514,7 @@ const opGetCampaigns = "GetCampaigns" type GetCampaignsRequest struct { *aws.Request Input *GetCampaignsInput + Copy func(*GetCampaignsInput) GetCampaignsRequest } // Send marshals and sends the GetCampaigns API request. @@ -1524,7 +1555,7 @@ func (c *Pinpoint) GetCampaignsRequest(input *GetCampaignsInput) GetCampaignsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCampaignsRequest{Request: req, Input: input} + return GetCampaignsRequest{Request: req, Input: input, Copy: c.GetCampaignsRequest} } const opGetEmailChannel = "GetEmailChannel" @@ -1533,6 +1564,7 @@ const opGetEmailChannel = "GetEmailChannel" type GetEmailChannelRequest struct { *aws.Request Input *GetEmailChannelInput + Copy func(*GetEmailChannelInput) GetEmailChannelRequest } // Send marshals and sends the GetEmailChannel API request. @@ -1573,7 +1605,7 @@ func (c *Pinpoint) GetEmailChannelRequest(input *GetEmailChannelInput) GetEmailC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetEmailChannelRequest{Request: req, Input: input} + return GetEmailChannelRequest{Request: req, Input: input, Copy: c.GetEmailChannelRequest} } const opGetEndpoint = "GetEndpoint" @@ -1582,6 +1614,7 @@ const opGetEndpoint = "GetEndpoint" type GetEndpointRequest struct { *aws.Request Input *GetEndpointInput + Copy func(*GetEndpointInput) GetEndpointRequest } // Send marshals and sends the GetEndpoint API request. @@ -1622,7 +1655,7 @@ func (c *Pinpoint) GetEndpointRequest(input *GetEndpointInput) GetEndpointReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetEndpointRequest{Request: req, Input: input} + return GetEndpointRequest{Request: req, Input: input, Copy: c.GetEndpointRequest} } const opGetEventStream = "GetEventStream" @@ -1631,6 +1664,7 @@ const opGetEventStream = "GetEventStream" type GetEventStreamRequest struct { *aws.Request Input *GetEventStreamInput + Copy func(*GetEventStreamInput) GetEventStreamRequest } // Send marshals and sends the GetEventStream API request. @@ -1671,7 +1705,7 @@ func (c *Pinpoint) GetEventStreamRequest(input *GetEventStreamInput) GetEventStr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetEventStreamRequest{Request: req, Input: input} + return GetEventStreamRequest{Request: req, Input: input, Copy: c.GetEventStreamRequest} } const opGetGcmChannel = "GetGcmChannel" @@ -1680,6 +1714,7 @@ const opGetGcmChannel = "GetGcmChannel" type GetGcmChannelRequest struct { *aws.Request Input *GetGcmChannelInput + Copy func(*GetGcmChannelInput) GetGcmChannelRequest } // Send marshals and sends the GetGcmChannel API request. @@ -1720,7 +1755,7 @@ func (c *Pinpoint) GetGcmChannelRequest(input *GetGcmChannelInput) GetGcmChannel req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGcmChannelRequest{Request: req, Input: input} + return GetGcmChannelRequest{Request: req, Input: input, Copy: c.GetGcmChannelRequest} } const opGetImportJob = "GetImportJob" @@ -1729,6 +1764,7 @@ const opGetImportJob = "GetImportJob" type GetImportJobRequest struct { *aws.Request Input *GetImportJobInput + Copy func(*GetImportJobInput) GetImportJobRequest } // Send marshals and sends the GetImportJob API request. @@ -1769,7 +1805,7 @@ func (c *Pinpoint) GetImportJobRequest(input *GetImportJobInput) GetImportJobReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetImportJobRequest{Request: req, Input: input} + return GetImportJobRequest{Request: req, Input: input, Copy: c.GetImportJobRequest} } const opGetImportJobs = "GetImportJobs" @@ -1778,6 +1814,7 @@ const opGetImportJobs = "GetImportJobs" type GetImportJobsRequest struct { *aws.Request Input *GetImportJobsInput + Copy func(*GetImportJobsInput) GetImportJobsRequest } // Send marshals and sends the GetImportJobs API request. @@ -1818,7 +1855,7 @@ func (c *Pinpoint) GetImportJobsRequest(input *GetImportJobsInput) GetImportJobs req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetImportJobsRequest{Request: req, Input: input} + return GetImportJobsRequest{Request: req, Input: input, Copy: c.GetImportJobsRequest} } const opGetSegment = "GetSegment" @@ -1827,6 +1864,7 @@ const opGetSegment = "GetSegment" type GetSegmentRequest struct { *aws.Request Input *GetSegmentInput + Copy func(*GetSegmentInput) GetSegmentRequest } // Send marshals and sends the GetSegment API request. @@ -1867,7 +1905,7 @@ func (c *Pinpoint) GetSegmentRequest(input *GetSegmentInput) GetSegmentRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSegmentRequest{Request: req, Input: input} + return GetSegmentRequest{Request: req, Input: input, Copy: c.GetSegmentRequest} } const opGetSegmentImportJobs = "GetSegmentImportJobs" @@ -1876,6 +1914,7 @@ const opGetSegmentImportJobs = "GetSegmentImportJobs" type GetSegmentImportJobsRequest struct { *aws.Request Input *GetSegmentImportJobsInput + Copy func(*GetSegmentImportJobsInput) GetSegmentImportJobsRequest } // Send marshals and sends the GetSegmentImportJobs API request. @@ -1916,7 +1955,7 @@ func (c *Pinpoint) GetSegmentImportJobsRequest(input *GetSegmentImportJobsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSegmentImportJobsRequest{Request: req, Input: input} + return GetSegmentImportJobsRequest{Request: req, Input: input, Copy: c.GetSegmentImportJobsRequest} } const opGetSegmentVersion = "GetSegmentVersion" @@ -1925,6 +1964,7 @@ const opGetSegmentVersion = "GetSegmentVersion" type GetSegmentVersionRequest struct { *aws.Request Input *GetSegmentVersionInput + Copy func(*GetSegmentVersionInput) GetSegmentVersionRequest } // Send marshals and sends the GetSegmentVersion API request. @@ -1965,7 +2005,7 @@ func (c *Pinpoint) GetSegmentVersionRequest(input *GetSegmentVersionInput) GetSe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSegmentVersionRequest{Request: req, Input: input} + return GetSegmentVersionRequest{Request: req, Input: input, Copy: c.GetSegmentVersionRequest} } const opGetSegmentVersions = "GetSegmentVersions" @@ -1974,6 +2014,7 @@ const opGetSegmentVersions = "GetSegmentVersions" type GetSegmentVersionsRequest struct { *aws.Request Input *GetSegmentVersionsInput + Copy func(*GetSegmentVersionsInput) GetSegmentVersionsRequest } // Send marshals and sends the GetSegmentVersions API request. @@ -2014,7 +2055,7 @@ func (c *Pinpoint) GetSegmentVersionsRequest(input *GetSegmentVersionsInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSegmentVersionsRequest{Request: req, Input: input} + return GetSegmentVersionsRequest{Request: req, Input: input, Copy: c.GetSegmentVersionsRequest} } const opGetSegments = "GetSegments" @@ -2023,6 +2064,7 @@ const opGetSegments = "GetSegments" type GetSegmentsRequest struct { *aws.Request Input *GetSegmentsInput + Copy func(*GetSegmentsInput) GetSegmentsRequest } // Send marshals and sends the GetSegments API request. @@ -2063,7 +2105,7 @@ func (c *Pinpoint) GetSegmentsRequest(input *GetSegmentsInput) GetSegmentsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSegmentsRequest{Request: req, Input: input} + return GetSegmentsRequest{Request: req, Input: input, Copy: c.GetSegmentsRequest} } const opGetSmsChannel = "GetSmsChannel" @@ -2072,6 +2114,7 @@ const opGetSmsChannel = "GetSmsChannel" type GetSmsChannelRequest struct { *aws.Request Input *GetSmsChannelInput + Copy func(*GetSmsChannelInput) GetSmsChannelRequest } // Send marshals and sends the GetSmsChannel API request. @@ -2112,7 +2155,7 @@ func (c *Pinpoint) GetSmsChannelRequest(input *GetSmsChannelInput) GetSmsChannel req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSmsChannelRequest{Request: req, Input: input} + return GetSmsChannelRequest{Request: req, Input: input, Copy: c.GetSmsChannelRequest} } const opPutEventStream = "PutEventStream" @@ -2121,6 +2164,7 @@ const opPutEventStream = "PutEventStream" type PutEventStreamRequest struct { *aws.Request Input *PutEventStreamInput + Copy func(*PutEventStreamInput) PutEventStreamRequest } // Send marshals and sends the PutEventStream API request. @@ -2161,7 +2205,7 @@ func (c *Pinpoint) PutEventStreamRequest(input *PutEventStreamInput) PutEventStr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutEventStreamRequest{Request: req, Input: input} + return PutEventStreamRequest{Request: req, Input: input, Copy: c.PutEventStreamRequest} } const opSendMessages = "SendMessages" @@ -2170,6 +2214,7 @@ const opSendMessages = "SendMessages" type SendMessagesRequest struct { *aws.Request Input *SendMessagesInput + Copy func(*SendMessagesInput) SendMessagesRequest } // Send marshals and sends the SendMessages API request. @@ -2210,7 +2255,7 @@ func (c *Pinpoint) SendMessagesRequest(input *SendMessagesInput) SendMessagesReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendMessagesRequest{Request: req, Input: input} + return SendMessagesRequest{Request: req, Input: input, Copy: c.SendMessagesRequest} } const opSendUsersMessages = "SendUsersMessages" @@ -2219,6 +2264,7 @@ const opSendUsersMessages = "SendUsersMessages" type SendUsersMessagesRequest struct { *aws.Request Input *SendUsersMessagesInput + Copy func(*SendUsersMessagesInput) SendUsersMessagesRequest } // Send marshals and sends the SendUsersMessages API request. @@ -2259,7 +2305,7 @@ func (c *Pinpoint) SendUsersMessagesRequest(input *SendUsersMessagesInput) SendU req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendUsersMessagesRequest{Request: req, Input: input} + return SendUsersMessagesRequest{Request: req, Input: input, Copy: c.SendUsersMessagesRequest} } const opUpdateAdmChannel = "UpdateAdmChannel" @@ -2268,6 +2314,7 @@ const opUpdateAdmChannel = "UpdateAdmChannel" type UpdateAdmChannelRequest struct { *aws.Request Input *UpdateAdmChannelInput + Copy func(*UpdateAdmChannelInput) UpdateAdmChannelRequest } // Send marshals and sends the UpdateAdmChannel API request. @@ -2308,7 +2355,7 @@ func (c *Pinpoint) UpdateAdmChannelRequest(input *UpdateAdmChannelInput) UpdateA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAdmChannelRequest{Request: req, Input: input} + return UpdateAdmChannelRequest{Request: req, Input: input, Copy: c.UpdateAdmChannelRequest} } const opUpdateApnsChannel = "UpdateApnsChannel" @@ -2317,6 +2364,7 @@ const opUpdateApnsChannel = "UpdateApnsChannel" type UpdateApnsChannelRequest struct { *aws.Request Input *UpdateApnsChannelInput + Copy func(*UpdateApnsChannelInput) UpdateApnsChannelRequest } // Send marshals and sends the UpdateApnsChannel API request. @@ -2357,7 +2405,7 @@ func (c *Pinpoint) UpdateApnsChannelRequest(input *UpdateApnsChannelInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApnsChannelRequest{Request: req, Input: input} + return UpdateApnsChannelRequest{Request: req, Input: input, Copy: c.UpdateApnsChannelRequest} } const opUpdateApnsSandboxChannel = "UpdateApnsSandboxChannel" @@ -2366,6 +2414,7 @@ const opUpdateApnsSandboxChannel = "UpdateApnsSandboxChannel" type UpdateApnsSandboxChannelRequest struct { *aws.Request Input *UpdateApnsSandboxChannelInput + Copy func(*UpdateApnsSandboxChannelInput) UpdateApnsSandboxChannelRequest } // Send marshals and sends the UpdateApnsSandboxChannel API request. @@ -2406,7 +2455,7 @@ func (c *Pinpoint) UpdateApnsSandboxChannelRequest(input *UpdateApnsSandboxChann req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApnsSandboxChannelRequest{Request: req, Input: input} + return UpdateApnsSandboxChannelRequest{Request: req, Input: input, Copy: c.UpdateApnsSandboxChannelRequest} } const opUpdateApnsVoipChannel = "UpdateApnsVoipChannel" @@ -2415,6 +2464,7 @@ const opUpdateApnsVoipChannel = "UpdateApnsVoipChannel" type UpdateApnsVoipChannelRequest struct { *aws.Request Input *UpdateApnsVoipChannelInput + Copy func(*UpdateApnsVoipChannelInput) UpdateApnsVoipChannelRequest } // Send marshals and sends the UpdateApnsVoipChannel API request. @@ -2455,7 +2505,7 @@ func (c *Pinpoint) UpdateApnsVoipChannelRequest(input *UpdateApnsVoipChannelInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApnsVoipChannelRequest{Request: req, Input: input} + return UpdateApnsVoipChannelRequest{Request: req, Input: input, Copy: c.UpdateApnsVoipChannelRequest} } const opUpdateApnsVoipSandboxChannel = "UpdateApnsVoipSandboxChannel" @@ -2464,6 +2514,7 @@ const opUpdateApnsVoipSandboxChannel = "UpdateApnsVoipSandboxChannel" type UpdateApnsVoipSandboxChannelRequest struct { *aws.Request Input *UpdateApnsVoipSandboxChannelInput + Copy func(*UpdateApnsVoipSandboxChannelInput) UpdateApnsVoipSandboxChannelRequest } // Send marshals and sends the UpdateApnsVoipSandboxChannel API request. @@ -2504,7 +2555,7 @@ func (c *Pinpoint) UpdateApnsVoipSandboxChannelRequest(input *UpdateApnsVoipSand req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApnsVoipSandboxChannelRequest{Request: req, Input: input} + return UpdateApnsVoipSandboxChannelRequest{Request: req, Input: input, Copy: c.UpdateApnsVoipSandboxChannelRequest} } const opUpdateApplicationSettings = "UpdateApplicationSettings" @@ -2513,6 +2564,7 @@ const opUpdateApplicationSettings = "UpdateApplicationSettings" type UpdateApplicationSettingsRequest struct { *aws.Request Input *UpdateApplicationSettingsInput + Copy func(*UpdateApplicationSettingsInput) UpdateApplicationSettingsRequest } // Send marshals and sends the UpdateApplicationSettings API request. @@ -2553,7 +2605,7 @@ func (c *Pinpoint) UpdateApplicationSettingsRequest(input *UpdateApplicationSett req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApplicationSettingsRequest{Request: req, Input: input} + return UpdateApplicationSettingsRequest{Request: req, Input: input, Copy: c.UpdateApplicationSettingsRequest} } const opUpdateBaiduChannel = "UpdateBaiduChannel" @@ -2562,6 +2614,7 @@ const opUpdateBaiduChannel = "UpdateBaiduChannel" type UpdateBaiduChannelRequest struct { *aws.Request Input *UpdateBaiduChannelInput + Copy func(*UpdateBaiduChannelInput) UpdateBaiduChannelRequest } // Send marshals and sends the UpdateBaiduChannel API request. @@ -2602,7 +2655,7 @@ func (c *Pinpoint) UpdateBaiduChannelRequest(input *UpdateBaiduChannelInput) Upd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateBaiduChannelRequest{Request: req, Input: input} + return UpdateBaiduChannelRequest{Request: req, Input: input, Copy: c.UpdateBaiduChannelRequest} } const opUpdateCampaign = "UpdateCampaign" @@ -2611,6 +2664,7 @@ const opUpdateCampaign = "UpdateCampaign" type UpdateCampaignRequest struct { *aws.Request Input *UpdateCampaignInput + Copy func(*UpdateCampaignInput) UpdateCampaignRequest } // Send marshals and sends the UpdateCampaign API request. @@ -2651,7 +2705,7 @@ func (c *Pinpoint) UpdateCampaignRequest(input *UpdateCampaignInput) UpdateCampa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateCampaignRequest{Request: req, Input: input} + return UpdateCampaignRequest{Request: req, Input: input, Copy: c.UpdateCampaignRequest} } const opUpdateEmailChannel = "UpdateEmailChannel" @@ -2660,6 +2714,7 @@ const opUpdateEmailChannel = "UpdateEmailChannel" type UpdateEmailChannelRequest struct { *aws.Request Input *UpdateEmailChannelInput + Copy func(*UpdateEmailChannelInput) UpdateEmailChannelRequest } // Send marshals and sends the UpdateEmailChannel API request. @@ -2700,7 +2755,7 @@ func (c *Pinpoint) UpdateEmailChannelRequest(input *UpdateEmailChannelInput) Upd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEmailChannelRequest{Request: req, Input: input} + return UpdateEmailChannelRequest{Request: req, Input: input, Copy: c.UpdateEmailChannelRequest} } const opUpdateEndpoint = "UpdateEndpoint" @@ -2709,6 +2764,7 @@ const opUpdateEndpoint = "UpdateEndpoint" type UpdateEndpointRequest struct { *aws.Request Input *UpdateEndpointInput + Copy func(*UpdateEndpointInput) UpdateEndpointRequest } // Send marshals and sends the UpdateEndpoint API request. @@ -2749,7 +2805,7 @@ func (c *Pinpoint) UpdateEndpointRequest(input *UpdateEndpointInput) UpdateEndpo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEndpointRequest{Request: req, Input: input} + return UpdateEndpointRequest{Request: req, Input: input, Copy: c.UpdateEndpointRequest} } const opUpdateEndpointsBatch = "UpdateEndpointsBatch" @@ -2758,6 +2814,7 @@ const opUpdateEndpointsBatch = "UpdateEndpointsBatch" type UpdateEndpointsBatchRequest struct { *aws.Request Input *UpdateEndpointsBatchInput + Copy func(*UpdateEndpointsBatchInput) UpdateEndpointsBatchRequest } // Send marshals and sends the UpdateEndpointsBatch API request. @@ -2798,7 +2855,7 @@ func (c *Pinpoint) UpdateEndpointsBatchRequest(input *UpdateEndpointsBatchInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEndpointsBatchRequest{Request: req, Input: input} + return UpdateEndpointsBatchRequest{Request: req, Input: input, Copy: c.UpdateEndpointsBatchRequest} } const opUpdateGcmChannel = "UpdateGcmChannel" @@ -2807,6 +2864,7 @@ const opUpdateGcmChannel = "UpdateGcmChannel" type UpdateGcmChannelRequest struct { *aws.Request Input *UpdateGcmChannelInput + Copy func(*UpdateGcmChannelInput) UpdateGcmChannelRequest } // Send marshals and sends the UpdateGcmChannel API request. @@ -2847,7 +2905,7 @@ func (c *Pinpoint) UpdateGcmChannelRequest(input *UpdateGcmChannelInput) UpdateG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGcmChannelRequest{Request: req, Input: input} + return UpdateGcmChannelRequest{Request: req, Input: input, Copy: c.UpdateGcmChannelRequest} } const opUpdateSegment = "UpdateSegment" @@ -2856,6 +2914,7 @@ const opUpdateSegment = "UpdateSegment" type UpdateSegmentRequest struct { *aws.Request Input *UpdateSegmentInput + Copy func(*UpdateSegmentInput) UpdateSegmentRequest } // Send marshals and sends the UpdateSegment API request. @@ -2896,7 +2955,7 @@ func (c *Pinpoint) UpdateSegmentRequest(input *UpdateSegmentInput) UpdateSegment req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSegmentRequest{Request: req, Input: input} + return UpdateSegmentRequest{Request: req, Input: input, Copy: c.UpdateSegmentRequest} } const opUpdateSmsChannel = "UpdateSmsChannel" @@ -2905,6 +2964,7 @@ const opUpdateSmsChannel = "UpdateSmsChannel" type UpdateSmsChannelRequest struct { *aws.Request Input *UpdateSmsChannelInput + Copy func(*UpdateSmsChannelInput) UpdateSmsChannelRequest } // Send marshals and sends the UpdateSmsChannel API request. @@ -2945,7 +3005,7 @@ func (c *Pinpoint) UpdateSmsChannelRequest(input *UpdateSmsChannelInput) UpdateS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSmsChannelRequest{Request: req, Input: input} + return UpdateSmsChannelRequest{Request: req, Input: input, Copy: c.UpdateSmsChannelRequest} } // Amazon Device Messaging channel definition. diff --git a/service/polly/api.go b/service/polly/api.go index e908a6faccf..feb57047f1a 100644 --- a/service/polly/api.go +++ b/service/polly/api.go @@ -17,6 +17,7 @@ const opDeleteLexicon = "DeleteLexicon" type DeleteLexiconRequest struct { *aws.Request Input *DeleteLexiconInput + Copy func(*DeleteLexiconInput) DeleteLexiconRequest } // Send marshals and sends the DeleteLexicon API request. @@ -61,7 +62,7 @@ func (c *Polly) DeleteLexiconRequest(input *DeleteLexiconInput) DeleteLexiconReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLexiconRequest{Request: req, Input: input} + return DeleteLexiconRequest{Request: req, Input: input, Copy: c.DeleteLexiconRequest} } const opDescribeVoices = "DescribeVoices" @@ -70,6 +71,7 @@ const opDescribeVoices = "DescribeVoices" type DescribeVoicesRequest struct { *aws.Request Input *DescribeVoicesInput + Copy func(*DescribeVoicesInput) DescribeVoicesRequest } // Send marshals and sends the DescribeVoices API request. @@ -126,7 +128,7 @@ func (c *Polly) DescribeVoicesRequest(input *DescribeVoicesInput) DescribeVoices req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVoicesRequest{Request: req, Input: input} + return DescribeVoicesRequest{Request: req, Input: input, Copy: c.DescribeVoicesRequest} } const opGetLexicon = "GetLexicon" @@ -135,6 +137,7 @@ const opGetLexicon = "GetLexicon" type GetLexiconRequest struct { *aws.Request Input *GetLexiconInput + Copy func(*GetLexiconInput) GetLexiconRequest } // Send marshals and sends the GetLexicon API request. @@ -176,7 +179,7 @@ func (c *Polly) GetLexiconRequest(input *GetLexiconInput) GetLexiconRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLexiconRequest{Request: req, Input: input} + return GetLexiconRequest{Request: req, Input: input, Copy: c.GetLexiconRequest} } const opListLexicons = "ListLexicons" @@ -185,6 +188,7 @@ const opListLexicons = "ListLexicons" type ListLexiconsRequest struct { *aws.Request Input *ListLexiconsInput + Copy func(*ListLexiconsInput) ListLexiconsRequest } // Send marshals and sends the ListLexicons API request. @@ -226,7 +230,7 @@ func (c *Polly) ListLexiconsRequest(input *ListLexiconsInput) ListLexiconsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListLexiconsRequest{Request: req, Input: input} + return ListLexiconsRequest{Request: req, Input: input, Copy: c.ListLexiconsRequest} } const opPutLexicon = "PutLexicon" @@ -235,6 +239,7 @@ const opPutLexicon = "PutLexicon" type PutLexiconRequest struct { *aws.Request Input *PutLexiconInput + Copy func(*PutLexiconInput) PutLexiconRequest } // Send marshals and sends the PutLexicon API request. @@ -280,7 +285,7 @@ func (c *Polly) PutLexiconRequest(input *PutLexiconInput) PutLexiconRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutLexiconRequest{Request: req, Input: input} + return PutLexiconRequest{Request: req, Input: input, Copy: c.PutLexiconRequest} } const opSynthesizeSpeech = "SynthesizeSpeech" @@ -289,6 +294,7 @@ const opSynthesizeSpeech = "SynthesizeSpeech" type SynthesizeSpeechRequest struct { *aws.Request Input *SynthesizeSpeechInput + Copy func(*SynthesizeSpeechInput) SynthesizeSpeechRequest } // Send marshals and sends the SynthesizeSpeech API request. @@ -333,7 +339,7 @@ func (c *Polly) SynthesizeSpeechRequest(input *SynthesizeSpeechInput) Synthesize req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SynthesizeSpeechRequest{Request: req, Input: input} + return SynthesizeSpeechRequest{Request: req, Input: input, Copy: c.SynthesizeSpeechRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DeleteLexiconInput diff --git a/service/pricing/api.go b/service/pricing/api.go index b975c281139..4980886c23d 100644 --- a/service/pricing/api.go +++ b/service/pricing/api.go @@ -15,6 +15,7 @@ const opDescribeServices = "DescribeServices" type DescribeServicesRequest struct { *aws.Request Input *DescribeServicesInput + Copy func(*DescribeServicesInput) DescribeServicesRequest } // Send marshals and sends the DescribeServices API request. @@ -66,57 +67,53 @@ func (c *Pricing) DescribeServicesRequest(input *DescribeServicesInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeServicesRequest{Request: req, Input: input} + return DescribeServicesRequest{Request: req, Input: input, Copy: c.DescribeServicesRequest} } -// DescribeServicesPages iterates over the pages of a DescribeServices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeServices method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeServicesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeServices operation. -// pageNum := 0 -// err := client.DescribeServicesPages(params, -// func(page *DescribeServicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.DescribeServicesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Pricing) DescribeServicesPages(input *DescribeServicesInput, fn func(*DescribeServicesOutput, bool) bool) error { - return c.DescribeServicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeServicesPagesWithContext same as DescribeServicesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Pricing) DescribeServicesPagesWithContext(ctx aws.Context, input *DescribeServicesInput, fn func(*DescribeServicesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeServicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeServicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *DescribeServicesRequest) Paginate(opts ...aws.Option) DescribeServicesPager { + return DescribeServicesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeServicesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeServicesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeServicesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeServicesPager struct { + aws.Pager +} + +func (p *DescribeServicesPager) CurrentPage() *DescribeServicesOutput { + return p.Pager.CurrentPage().(*DescribeServicesOutput) } const opGetAttributeValues = "GetAttributeValues" @@ -125,6 +122,7 @@ const opGetAttributeValues = "GetAttributeValues" type GetAttributeValuesRequest struct { *aws.Request Input *GetAttributeValuesInput + Copy func(*GetAttributeValuesInput) GetAttributeValuesRequest } // Send marshals and sends the GetAttributeValues API request. @@ -174,57 +172,53 @@ func (c *Pricing) GetAttributeValuesRequest(input *GetAttributeValuesInput) GetA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAttributeValuesRequest{Request: req, Input: input} + return GetAttributeValuesRequest{Request: req, Input: input, Copy: c.GetAttributeValuesRequest} } -// GetAttributeValuesPages iterates over the pages of a GetAttributeValues operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetAttributeValues method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetAttributeValuesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetAttributeValues operation. -// pageNum := 0 -// err := client.GetAttributeValuesPages(params, -// func(page *GetAttributeValuesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetAttributeValuesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Pricing) GetAttributeValuesPages(input *GetAttributeValuesInput, fn func(*GetAttributeValuesOutput, bool) bool) error { - return c.GetAttributeValuesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetAttributeValuesPagesWithContext same as GetAttributeValuesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Pricing) GetAttributeValuesPagesWithContext(ctx aws.Context, input *GetAttributeValuesInput, fn func(*GetAttributeValuesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetAttributeValuesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetAttributeValuesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetAttributeValuesRequest) Paginate(opts ...aws.Option) GetAttributeValuesPager { + return GetAttributeValuesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetAttributeValuesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetAttributeValuesOutput), !p.HasNextPage()) - } - return p.Err() +// GetAttributeValuesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetAttributeValuesPager struct { + aws.Pager +} + +func (p *GetAttributeValuesPager) CurrentPage() *GetAttributeValuesOutput { + return p.Pager.CurrentPage().(*GetAttributeValuesOutput) } const opGetProducts = "GetProducts" @@ -233,6 +227,7 @@ const opGetProducts = "GetProducts" type GetProductsRequest struct { *aws.Request Input *GetProductsInput + Copy func(*GetProductsInput) GetProductsRequest } // Send marshals and sends the GetProducts API request. @@ -279,57 +274,53 @@ func (c *Pricing) GetProductsRequest(input *GetProductsInput) GetProductsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetProductsRequest{Request: req, Input: input} + return GetProductsRequest{Request: req, Input: input, Copy: c.GetProductsRequest} } -// GetProductsPages iterates over the pages of a GetProducts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetProducts method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetProductsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetProducts operation. -// pageNum := 0 -// err := client.GetProductsPages(params, -// func(page *GetProductsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetProductsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Pricing) GetProductsPages(input *GetProductsInput, fn func(*GetProductsOutput, bool) bool) error { - return c.GetProductsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetProductsPagesWithContext same as GetProductsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Pricing) GetProductsPagesWithContext(ctx aws.Context, input *GetProductsInput, fn func(*GetProductsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetProductsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetProductsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetProductsRequest) Paginate(opts ...aws.Option) GetProductsPager { + return GetProductsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetProductsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetProductsOutput), !p.HasNextPage()) - } - return p.Err() +// GetProductsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetProductsPager struct { + aws.Pager +} + +func (p *GetProductsPager) CurrentPage() *GetProductsOutput { + return p.Pager.CurrentPage().(*GetProductsOutput) } // The values of a given attribute, such as Throughput Optimized HDD or Provisioned diff --git a/service/pricing/pricingiface/interface.go b/service/pricing/pricingiface/interface.go index d88160d3303..226877d5705 100644 --- a/service/pricing/pricingiface/interface.go +++ b/service/pricing/pricingiface/interface.go @@ -9,7 +9,6 @@ package pricingiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/pricing" ) @@ -65,18 +64,9 @@ import ( type PricingAPI interface { DescribeServicesRequest(*pricing.DescribeServicesInput) pricing.DescribeServicesRequest - DescribeServicesPages(*pricing.DescribeServicesInput, func(*pricing.DescribeServicesOutput, bool) bool) error - DescribeServicesPagesWithContext(aws.Context, *pricing.DescribeServicesInput, func(*pricing.DescribeServicesOutput, bool) bool, ...aws.Option) error - GetAttributeValuesRequest(*pricing.GetAttributeValuesInput) pricing.GetAttributeValuesRequest - GetAttributeValuesPages(*pricing.GetAttributeValuesInput, func(*pricing.GetAttributeValuesOutput, bool) bool) error - GetAttributeValuesPagesWithContext(aws.Context, *pricing.GetAttributeValuesInput, func(*pricing.GetAttributeValuesOutput, bool) bool, ...aws.Option) error - GetProductsRequest(*pricing.GetProductsInput) pricing.GetProductsRequest - - GetProductsPages(*pricing.GetProductsInput, func(*pricing.GetProductsOutput, bool) bool) error - GetProductsPagesWithContext(aws.Context, *pricing.GetProductsInput, func(*pricing.GetProductsOutput, bool) bool, ...aws.Option) error } var _ PricingAPI = (*pricing.Pricing)(nil) diff --git a/service/rds/api.go b/service/rds/api.go index 80cd90525ed..f353d2268de 100644 --- a/service/rds/api.go +++ b/service/rds/api.go @@ -18,6 +18,7 @@ const opAddRoleToDBCluster = "AddRoleToDBCluster" type AddRoleToDBClusterRequest struct { *aws.Request Input *AddRoleToDBClusterInput + Copy func(*AddRoleToDBClusterInput) AddRoleToDBClusterRequest } // Send marshals and sends the AddRoleToDBCluster API request. @@ -62,7 +63,7 @@ func (c *RDS) AddRoleToDBClusterRequest(input *AddRoleToDBClusterInput) AddRoleT req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddRoleToDBClusterRequest{Request: req, Input: input} + return AddRoleToDBClusterRequest{Request: req, Input: input, Copy: c.AddRoleToDBClusterRequest} } const opAddSourceIdentifierToSubscription = "AddSourceIdentifierToSubscription" @@ -71,6 +72,7 @@ const opAddSourceIdentifierToSubscription = "AddSourceIdentifierToSubscription" type AddSourceIdentifierToSubscriptionRequest struct { *aws.Request Input *AddSourceIdentifierToSubscriptionInput + Copy func(*AddSourceIdentifierToSubscriptionInput) AddSourceIdentifierToSubscriptionRequest } // Send marshals and sends the AddSourceIdentifierToSubscription API request. @@ -111,7 +113,7 @@ func (c *RDS) AddSourceIdentifierToSubscriptionRequest(input *AddSourceIdentifie req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddSourceIdentifierToSubscriptionRequest{Request: req, Input: input} + return AddSourceIdentifierToSubscriptionRequest{Request: req, Input: input, Copy: c.AddSourceIdentifierToSubscriptionRequest} } const opAddTagsToResource = "AddTagsToResource" @@ -120,6 +122,7 @@ const opAddTagsToResource = "AddTagsToResource" type AddTagsToResourceRequest struct { *aws.Request Input *AddTagsToResourceInput + Copy func(*AddTagsToResourceInput) AddTagsToResourceRequest } // Send marshals and sends the AddTagsToResource API request. @@ -167,7 +170,7 @@ func (c *RDS) AddTagsToResourceRequest(input *AddTagsToResourceInput) AddTagsToR req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddTagsToResourceRequest{Request: req, Input: input} + return AddTagsToResourceRequest{Request: req, Input: input, Copy: c.AddTagsToResourceRequest} } const opApplyPendingMaintenanceAction = "ApplyPendingMaintenanceAction" @@ -176,6 +179,7 @@ const opApplyPendingMaintenanceAction = "ApplyPendingMaintenanceAction" type ApplyPendingMaintenanceActionRequest struct { *aws.Request Input *ApplyPendingMaintenanceActionInput + Copy func(*ApplyPendingMaintenanceActionInput) ApplyPendingMaintenanceActionRequest } // Send marshals and sends the ApplyPendingMaintenanceAction API request. @@ -217,7 +221,7 @@ func (c *RDS) ApplyPendingMaintenanceActionRequest(input *ApplyPendingMaintenanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ApplyPendingMaintenanceActionRequest{Request: req, Input: input} + return ApplyPendingMaintenanceActionRequest{Request: req, Input: input, Copy: c.ApplyPendingMaintenanceActionRequest} } const opAuthorizeDBSecurityGroupIngress = "AuthorizeDBSecurityGroupIngress" @@ -226,6 +230,7 @@ const opAuthorizeDBSecurityGroupIngress = "AuthorizeDBSecurityGroupIngress" type AuthorizeDBSecurityGroupIngressRequest struct { *aws.Request Input *AuthorizeDBSecurityGroupIngressInput + Copy func(*AuthorizeDBSecurityGroupIngressInput) AuthorizeDBSecurityGroupIngressRequest } // Send marshals and sends the AuthorizeDBSecurityGroupIngress API request. @@ -278,7 +283,7 @@ func (c *RDS) AuthorizeDBSecurityGroupIngressRequest(input *AuthorizeDBSecurityG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AuthorizeDBSecurityGroupIngressRequest{Request: req, Input: input} + return AuthorizeDBSecurityGroupIngressRequest{Request: req, Input: input, Copy: c.AuthorizeDBSecurityGroupIngressRequest} } const opCopyDBClusterParameterGroup = "CopyDBClusterParameterGroup" @@ -287,6 +292,7 @@ const opCopyDBClusterParameterGroup = "CopyDBClusterParameterGroup" type CopyDBClusterParameterGroupRequest struct { *aws.Request Input *CopyDBClusterParameterGroupInput + Copy func(*CopyDBClusterParameterGroupInput) CopyDBClusterParameterGroupRequest } // Send marshals and sends the CopyDBClusterParameterGroup API request. @@ -327,7 +333,7 @@ func (c *RDS) CopyDBClusterParameterGroupRequest(input *CopyDBClusterParameterGr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyDBClusterParameterGroupRequest{Request: req, Input: input} + return CopyDBClusterParameterGroupRequest{Request: req, Input: input, Copy: c.CopyDBClusterParameterGroupRequest} } const opCopyDBClusterSnapshot = "CopyDBClusterSnapshot" @@ -336,6 +342,7 @@ const opCopyDBClusterSnapshot = "CopyDBClusterSnapshot" type CopyDBClusterSnapshotRequest struct { *aws.Request Input *CopyDBClusterSnapshotInput + Copy func(*CopyDBClusterSnapshotInput) CopyDBClusterSnapshotRequest } // Send marshals and sends the CopyDBClusterSnapshot API request. @@ -438,7 +445,7 @@ func (c *RDS) CopyDBClusterSnapshotRequest(input *CopyDBClusterSnapshotInput) Co req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyDBClusterSnapshotRequest{Request: req, Input: input} + return CopyDBClusterSnapshotRequest{Request: req, Input: input, Copy: c.CopyDBClusterSnapshotRequest} } const opCopyDBParameterGroup = "CopyDBParameterGroup" @@ -447,6 +454,7 @@ const opCopyDBParameterGroup = "CopyDBParameterGroup" type CopyDBParameterGroupRequest struct { *aws.Request Input *CopyDBParameterGroupInput + Copy func(*CopyDBParameterGroupInput) CopyDBParameterGroupRequest } // Send marshals and sends the CopyDBParameterGroup API request. @@ -487,7 +495,7 @@ func (c *RDS) CopyDBParameterGroupRequest(input *CopyDBParameterGroupInput) Copy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyDBParameterGroupRequest{Request: req, Input: input} + return CopyDBParameterGroupRequest{Request: req, Input: input, Copy: c.CopyDBParameterGroupRequest} } const opCopyDBSnapshot = "CopyDBSnapshot" @@ -496,6 +504,7 @@ const opCopyDBSnapshot = "CopyDBSnapshot" type CopyDBSnapshotRequest struct { *aws.Request Input *CopyDBSnapshotInput + Copy func(*CopyDBSnapshotInput) CopyDBSnapshotRequest } // Send marshals and sends the CopyDBSnapshot API request. @@ -546,7 +555,7 @@ func (c *RDS) CopyDBSnapshotRequest(input *CopyDBSnapshotInput) CopyDBSnapshotRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyDBSnapshotRequest{Request: req, Input: input} + return CopyDBSnapshotRequest{Request: req, Input: input, Copy: c.CopyDBSnapshotRequest} } const opCopyOptionGroup = "CopyOptionGroup" @@ -555,6 +564,7 @@ const opCopyOptionGroup = "CopyOptionGroup" type CopyOptionGroupRequest struct { *aws.Request Input *CopyOptionGroupInput + Copy func(*CopyOptionGroupInput) CopyOptionGroupRequest } // Send marshals and sends the CopyOptionGroup API request. @@ -595,7 +605,7 @@ func (c *RDS) CopyOptionGroupRequest(input *CopyOptionGroupInput) CopyOptionGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyOptionGroupRequest{Request: req, Input: input} + return CopyOptionGroupRequest{Request: req, Input: input, Copy: c.CopyOptionGroupRequest} } const opCreateDBCluster = "CreateDBCluster" @@ -604,6 +614,7 @@ const opCreateDBCluster = "CreateDBCluster" type CreateDBClusterRequest struct { *aws.Request Input *CreateDBClusterInput + Copy func(*CreateDBClusterInput) CreateDBClusterRequest } // Send marshals and sends the CreateDBCluster API request. @@ -652,7 +663,7 @@ func (c *RDS) CreateDBClusterRequest(input *CreateDBClusterInput) CreateDBCluste req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDBClusterRequest{Request: req, Input: input} + return CreateDBClusterRequest{Request: req, Input: input, Copy: c.CreateDBClusterRequest} } const opCreateDBClusterParameterGroup = "CreateDBClusterParameterGroup" @@ -661,6 +672,7 @@ const opCreateDBClusterParameterGroup = "CreateDBClusterParameterGroup" type CreateDBClusterParameterGroupRequest struct { *aws.Request Input *CreateDBClusterParameterGroupInput + Copy func(*CreateDBClusterParameterGroupInput) CreateDBClusterParameterGroupRequest } // Send marshals and sends the CreateDBClusterParameterGroup API request. @@ -728,7 +740,7 @@ func (c *RDS) CreateDBClusterParameterGroupRequest(input *CreateDBClusterParamet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDBClusterParameterGroupRequest{Request: req, Input: input} + return CreateDBClusterParameterGroupRequest{Request: req, Input: input, Copy: c.CreateDBClusterParameterGroupRequest} } const opCreateDBClusterSnapshot = "CreateDBClusterSnapshot" @@ -737,6 +749,7 @@ const opCreateDBClusterSnapshot = "CreateDBClusterSnapshot" type CreateDBClusterSnapshotRequest struct { *aws.Request Input *CreateDBClusterSnapshotInput + Copy func(*CreateDBClusterSnapshotInput) CreateDBClusterSnapshotRequest } // Send marshals and sends the CreateDBClusterSnapshot API request. @@ -779,7 +792,7 @@ func (c *RDS) CreateDBClusterSnapshotRequest(input *CreateDBClusterSnapshotInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDBClusterSnapshotRequest{Request: req, Input: input} + return CreateDBClusterSnapshotRequest{Request: req, Input: input, Copy: c.CreateDBClusterSnapshotRequest} } const opCreateDBInstance = "CreateDBInstance" @@ -788,6 +801,7 @@ const opCreateDBInstance = "CreateDBInstance" type CreateDBInstanceRequest struct { *aws.Request Input *CreateDBInstanceInput + Copy func(*CreateDBInstanceInput) CreateDBInstanceRequest } // Send marshals and sends the CreateDBInstance API request. @@ -828,7 +842,7 @@ func (c *RDS) CreateDBInstanceRequest(input *CreateDBInstanceInput) CreateDBInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDBInstanceRequest{Request: req, Input: input} + return CreateDBInstanceRequest{Request: req, Input: input, Copy: c.CreateDBInstanceRequest} } const opCreateDBInstanceReadReplica = "CreateDBInstanceReadReplica" @@ -837,6 +851,7 @@ const opCreateDBInstanceReadReplica = "CreateDBInstanceReadReplica" type CreateDBInstanceReadReplicaRequest struct { *aws.Request Input *CreateDBInstanceReadReplicaInput + Copy func(*CreateDBInstanceReadReplicaInput) CreateDBInstanceReadReplicaRequest } // Send marshals and sends the CreateDBInstanceReadReplica API request. @@ -889,7 +904,7 @@ func (c *RDS) CreateDBInstanceReadReplicaRequest(input *CreateDBInstanceReadRepl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDBInstanceReadReplicaRequest{Request: req, Input: input} + return CreateDBInstanceReadReplicaRequest{Request: req, Input: input, Copy: c.CreateDBInstanceReadReplicaRequest} } const opCreateDBParameterGroup = "CreateDBParameterGroup" @@ -898,6 +913,7 @@ const opCreateDBParameterGroup = "CreateDBParameterGroup" type CreateDBParameterGroupRequest struct { *aws.Request Input *CreateDBParameterGroupInput + Copy func(*CreateDBParameterGroupInput) CreateDBParameterGroupRequest } // Send marshals and sends the CreateDBParameterGroup API request. @@ -958,7 +974,7 @@ func (c *RDS) CreateDBParameterGroupRequest(input *CreateDBParameterGroupInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDBParameterGroupRequest{Request: req, Input: input} + return CreateDBParameterGroupRequest{Request: req, Input: input, Copy: c.CreateDBParameterGroupRequest} } const opCreateDBSecurityGroup = "CreateDBSecurityGroup" @@ -967,6 +983,7 @@ const opCreateDBSecurityGroup = "CreateDBSecurityGroup" type CreateDBSecurityGroupRequest struct { *aws.Request Input *CreateDBSecurityGroupInput + Copy func(*CreateDBSecurityGroupInput) CreateDBSecurityGroupRequest } // Send marshals and sends the CreateDBSecurityGroup API request. @@ -1008,7 +1025,7 @@ func (c *RDS) CreateDBSecurityGroupRequest(input *CreateDBSecurityGroupInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDBSecurityGroupRequest{Request: req, Input: input} + return CreateDBSecurityGroupRequest{Request: req, Input: input, Copy: c.CreateDBSecurityGroupRequest} } const opCreateDBSnapshot = "CreateDBSnapshot" @@ -1017,6 +1034,7 @@ const opCreateDBSnapshot = "CreateDBSnapshot" type CreateDBSnapshotRequest struct { *aws.Request Input *CreateDBSnapshotInput + Copy func(*CreateDBSnapshotInput) CreateDBSnapshotRequest } // Send marshals and sends the CreateDBSnapshot API request. @@ -1057,7 +1075,7 @@ func (c *RDS) CreateDBSnapshotRequest(input *CreateDBSnapshotInput) CreateDBSnap req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDBSnapshotRequest{Request: req, Input: input} + return CreateDBSnapshotRequest{Request: req, Input: input, Copy: c.CreateDBSnapshotRequest} } const opCreateDBSubnetGroup = "CreateDBSubnetGroup" @@ -1066,6 +1084,7 @@ const opCreateDBSubnetGroup = "CreateDBSubnetGroup" type CreateDBSubnetGroupRequest struct { *aws.Request Input *CreateDBSubnetGroupInput + Copy func(*CreateDBSubnetGroupInput) CreateDBSubnetGroupRequest } // Send marshals and sends the CreateDBSubnetGroup API request. @@ -1107,7 +1126,7 @@ func (c *RDS) CreateDBSubnetGroupRequest(input *CreateDBSubnetGroupInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDBSubnetGroupRequest{Request: req, Input: input} + return CreateDBSubnetGroupRequest{Request: req, Input: input, Copy: c.CreateDBSubnetGroupRequest} } const opCreateEventSubscription = "CreateEventSubscription" @@ -1116,6 +1135,7 @@ const opCreateEventSubscription = "CreateEventSubscription" type CreateEventSubscriptionRequest struct { *aws.Request Input *CreateEventSubscriptionInput + Copy func(*CreateEventSubscriptionInput) CreateEventSubscriptionRequest } // Send marshals and sends the CreateEventSubscription API request. @@ -1173,7 +1193,7 @@ func (c *RDS) CreateEventSubscriptionRequest(input *CreateEventSubscriptionInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEventSubscriptionRequest{Request: req, Input: input} + return CreateEventSubscriptionRequest{Request: req, Input: input, Copy: c.CreateEventSubscriptionRequest} } const opCreateOptionGroup = "CreateOptionGroup" @@ -1182,6 +1202,7 @@ const opCreateOptionGroup = "CreateOptionGroup" type CreateOptionGroupRequest struct { *aws.Request Input *CreateOptionGroupInput + Copy func(*CreateOptionGroupInput) CreateOptionGroupRequest } // Send marshals and sends the CreateOptionGroup API request. @@ -1222,7 +1243,7 @@ func (c *RDS) CreateOptionGroupRequest(input *CreateOptionGroupInput) CreateOpti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateOptionGroupRequest{Request: req, Input: input} + return CreateOptionGroupRequest{Request: req, Input: input, Copy: c.CreateOptionGroupRequest} } const opDeleteDBCluster = "DeleteDBCluster" @@ -1231,6 +1252,7 @@ const opDeleteDBCluster = "DeleteDBCluster" type DeleteDBClusterRequest struct { *aws.Request Input *DeleteDBClusterInput + Copy func(*DeleteDBClusterInput) DeleteDBClusterRequest } // Send marshals and sends the DeleteDBCluster API request. @@ -1276,7 +1298,7 @@ func (c *RDS) DeleteDBClusterRequest(input *DeleteDBClusterInput) DeleteDBCluste req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDBClusterRequest{Request: req, Input: input} + return DeleteDBClusterRequest{Request: req, Input: input, Copy: c.DeleteDBClusterRequest} } const opDeleteDBClusterParameterGroup = "DeleteDBClusterParameterGroup" @@ -1285,6 +1307,7 @@ const opDeleteDBClusterParameterGroup = "DeleteDBClusterParameterGroup" type DeleteDBClusterParameterGroupRequest struct { *aws.Request Input *DeleteDBClusterParameterGroupInput + Copy func(*DeleteDBClusterParameterGroupInput) DeleteDBClusterParameterGroupRequest } // Send marshals and sends the DeleteDBClusterParameterGroup API request. @@ -1331,7 +1354,7 @@ func (c *RDS) DeleteDBClusterParameterGroupRequest(input *DeleteDBClusterParamet req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDBClusterParameterGroupRequest{Request: req, Input: input} + return DeleteDBClusterParameterGroupRequest{Request: req, Input: input, Copy: c.DeleteDBClusterParameterGroupRequest} } const opDeleteDBClusterSnapshot = "DeleteDBClusterSnapshot" @@ -1340,6 +1363,7 @@ const opDeleteDBClusterSnapshot = "DeleteDBClusterSnapshot" type DeleteDBClusterSnapshotRequest struct { *aws.Request Input *DeleteDBClusterSnapshotInput + Copy func(*DeleteDBClusterSnapshotInput) DeleteDBClusterSnapshotRequest } // Send marshals and sends the DeleteDBClusterSnapshot API request. @@ -1386,7 +1410,7 @@ func (c *RDS) DeleteDBClusterSnapshotRequest(input *DeleteDBClusterSnapshotInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDBClusterSnapshotRequest{Request: req, Input: input} + return DeleteDBClusterSnapshotRequest{Request: req, Input: input, Copy: c.DeleteDBClusterSnapshotRequest} } const opDeleteDBInstance = "DeleteDBInstance" @@ -1395,6 +1419,7 @@ const opDeleteDBInstance = "DeleteDBInstance" type DeleteDBInstanceRequest struct { *aws.Request Input *DeleteDBInstanceInput + Copy func(*DeleteDBInstanceInput) DeleteDBInstanceRequest } // Send marshals and sends the DeleteDBInstance API request. @@ -1459,7 +1484,7 @@ func (c *RDS) DeleteDBInstanceRequest(input *DeleteDBInstanceInput) DeleteDBInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDBInstanceRequest{Request: req, Input: input} + return DeleteDBInstanceRequest{Request: req, Input: input, Copy: c.DeleteDBInstanceRequest} } const opDeleteDBParameterGroup = "DeleteDBParameterGroup" @@ -1468,6 +1493,7 @@ const opDeleteDBParameterGroup = "DeleteDBParameterGroup" type DeleteDBParameterGroupRequest struct { *aws.Request Input *DeleteDBParameterGroupInput + Copy func(*DeleteDBParameterGroupInput) DeleteDBParameterGroupRequest } // Send marshals and sends the DeleteDBParameterGroup API request. @@ -1511,7 +1537,7 @@ func (c *RDS) DeleteDBParameterGroupRequest(input *DeleteDBParameterGroupInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDBParameterGroupRequest{Request: req, Input: input} + return DeleteDBParameterGroupRequest{Request: req, Input: input, Copy: c.DeleteDBParameterGroupRequest} } const opDeleteDBSecurityGroup = "DeleteDBSecurityGroup" @@ -1520,6 +1546,7 @@ const opDeleteDBSecurityGroup = "DeleteDBSecurityGroup" type DeleteDBSecurityGroupRequest struct { *aws.Request Input *DeleteDBSecurityGroupInput + Copy func(*DeleteDBSecurityGroupInput) DeleteDBSecurityGroupRequest } // Send marshals and sends the DeleteDBSecurityGroup API request. @@ -1564,7 +1591,7 @@ func (c *RDS) DeleteDBSecurityGroupRequest(input *DeleteDBSecurityGroupInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDBSecurityGroupRequest{Request: req, Input: input} + return DeleteDBSecurityGroupRequest{Request: req, Input: input, Copy: c.DeleteDBSecurityGroupRequest} } const opDeleteDBSnapshot = "DeleteDBSnapshot" @@ -1573,6 +1600,7 @@ const opDeleteDBSnapshot = "DeleteDBSnapshot" type DeleteDBSnapshotRequest struct { *aws.Request Input *DeleteDBSnapshotInput + Copy func(*DeleteDBSnapshotInput) DeleteDBSnapshotRequest } // Send marshals and sends the DeleteDBSnapshot API request. @@ -1616,7 +1644,7 @@ func (c *RDS) DeleteDBSnapshotRequest(input *DeleteDBSnapshotInput) DeleteDBSnap req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDBSnapshotRequest{Request: req, Input: input} + return DeleteDBSnapshotRequest{Request: req, Input: input, Copy: c.DeleteDBSnapshotRequest} } const opDeleteDBSubnetGroup = "DeleteDBSubnetGroup" @@ -1625,6 +1653,7 @@ const opDeleteDBSubnetGroup = "DeleteDBSubnetGroup" type DeleteDBSubnetGroupRequest struct { *aws.Request Input *DeleteDBSubnetGroupInput + Copy func(*DeleteDBSubnetGroupInput) DeleteDBSubnetGroupRequest } // Send marshals and sends the DeleteDBSubnetGroup API request. @@ -1669,7 +1698,7 @@ func (c *RDS) DeleteDBSubnetGroupRequest(input *DeleteDBSubnetGroupInput) Delete req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDBSubnetGroupRequest{Request: req, Input: input} + return DeleteDBSubnetGroupRequest{Request: req, Input: input, Copy: c.DeleteDBSubnetGroupRequest} } const opDeleteEventSubscription = "DeleteEventSubscription" @@ -1678,6 +1707,7 @@ const opDeleteEventSubscription = "DeleteEventSubscription" type DeleteEventSubscriptionRequest struct { *aws.Request Input *DeleteEventSubscriptionInput + Copy func(*DeleteEventSubscriptionInput) DeleteEventSubscriptionRequest } // Send marshals and sends the DeleteEventSubscription API request. @@ -1718,7 +1748,7 @@ func (c *RDS) DeleteEventSubscriptionRequest(input *DeleteEventSubscriptionInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteEventSubscriptionRequest{Request: req, Input: input} + return DeleteEventSubscriptionRequest{Request: req, Input: input, Copy: c.DeleteEventSubscriptionRequest} } const opDeleteOptionGroup = "DeleteOptionGroup" @@ -1727,6 +1757,7 @@ const opDeleteOptionGroup = "DeleteOptionGroup" type DeleteOptionGroupRequest struct { *aws.Request Input *DeleteOptionGroupInput + Copy func(*DeleteOptionGroupInput) DeleteOptionGroupRequest } // Send marshals and sends the DeleteOptionGroup API request. @@ -1769,7 +1800,7 @@ func (c *RDS) DeleteOptionGroupRequest(input *DeleteOptionGroupInput) DeleteOpti req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteOptionGroupRequest{Request: req, Input: input} + return DeleteOptionGroupRequest{Request: req, Input: input, Copy: c.DeleteOptionGroupRequest} } const opDescribeAccountAttributes = "DescribeAccountAttributes" @@ -1778,6 +1809,7 @@ const opDescribeAccountAttributes = "DescribeAccountAttributes" type DescribeAccountAttributesRequest struct { *aws.Request Input *DescribeAccountAttributesInput + Copy func(*DescribeAccountAttributesInput) DescribeAccountAttributesRequest } // Send marshals and sends the DescribeAccountAttributes API request. @@ -1823,7 +1855,7 @@ func (c *RDS) DescribeAccountAttributesRequest(input *DescribeAccountAttributesI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAccountAttributesRequest{Request: req, Input: input} + return DescribeAccountAttributesRequest{Request: req, Input: input, Copy: c.DescribeAccountAttributesRequest} } const opDescribeCertificates = "DescribeCertificates" @@ -1832,6 +1864,7 @@ const opDescribeCertificates = "DescribeCertificates" type DescribeCertificatesRequest struct { *aws.Request Input *DescribeCertificatesInput + Copy func(*DescribeCertificatesInput) DescribeCertificatesRequest } // Send marshals and sends the DescribeCertificates API request. @@ -1872,7 +1905,7 @@ func (c *RDS) DescribeCertificatesRequest(input *DescribeCertificatesInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCertificatesRequest{Request: req, Input: input} + return DescribeCertificatesRequest{Request: req, Input: input, Copy: c.DescribeCertificatesRequest} } const opDescribeDBClusterParameterGroups = "DescribeDBClusterParameterGroups" @@ -1881,6 +1914,7 @@ const opDescribeDBClusterParameterGroups = "DescribeDBClusterParameterGroups" type DescribeDBClusterParameterGroupsRequest struct { *aws.Request Input *DescribeDBClusterParameterGroupsInput + Copy func(*DescribeDBClusterParameterGroupsInput) DescribeDBClusterParameterGroupsRequest } // Send marshals and sends the DescribeDBClusterParameterGroups API request. @@ -1926,7 +1960,7 @@ func (c *RDS) DescribeDBClusterParameterGroupsRequest(input *DescribeDBClusterPa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBClusterParameterGroupsRequest{Request: req, Input: input} + return DescribeDBClusterParameterGroupsRequest{Request: req, Input: input, Copy: c.DescribeDBClusterParameterGroupsRequest} } const opDescribeDBClusterParameters = "DescribeDBClusterParameters" @@ -1935,6 +1969,7 @@ const opDescribeDBClusterParameters = "DescribeDBClusterParameters" type DescribeDBClusterParametersRequest struct { *aws.Request Input *DescribeDBClusterParametersInput + Copy func(*DescribeDBClusterParametersInput) DescribeDBClusterParametersRequest } // Send marshals and sends the DescribeDBClusterParameters API request. @@ -1979,7 +2014,7 @@ func (c *RDS) DescribeDBClusterParametersRequest(input *DescribeDBClusterParamet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBClusterParametersRequest{Request: req, Input: input} + return DescribeDBClusterParametersRequest{Request: req, Input: input, Copy: c.DescribeDBClusterParametersRequest} } const opDescribeDBClusterSnapshotAttributes = "DescribeDBClusterSnapshotAttributes" @@ -1988,6 +2023,7 @@ const opDescribeDBClusterSnapshotAttributes = "DescribeDBClusterSnapshotAttribut type DescribeDBClusterSnapshotAttributesRequest struct { *aws.Request Input *DescribeDBClusterSnapshotAttributesInput + Copy func(*DescribeDBClusterSnapshotAttributesInput) DescribeDBClusterSnapshotAttributesRequest } // Send marshals and sends the DescribeDBClusterSnapshotAttributes API request. @@ -2039,7 +2075,7 @@ func (c *RDS) DescribeDBClusterSnapshotAttributesRequest(input *DescribeDBCluste req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBClusterSnapshotAttributesRequest{Request: req, Input: input} + return DescribeDBClusterSnapshotAttributesRequest{Request: req, Input: input, Copy: c.DescribeDBClusterSnapshotAttributesRequest} } const opDescribeDBClusterSnapshots = "DescribeDBClusterSnapshots" @@ -2048,6 +2084,7 @@ const opDescribeDBClusterSnapshots = "DescribeDBClusterSnapshots" type DescribeDBClusterSnapshotsRequest struct { *aws.Request Input *DescribeDBClusterSnapshotsInput + Copy func(*DescribeDBClusterSnapshotsInput) DescribeDBClusterSnapshotsRequest } // Send marshals and sends the DescribeDBClusterSnapshots API request. @@ -2092,7 +2129,7 @@ func (c *RDS) DescribeDBClusterSnapshotsRequest(input *DescribeDBClusterSnapshot req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBClusterSnapshotsRequest{Request: req, Input: input} + return DescribeDBClusterSnapshotsRequest{Request: req, Input: input, Copy: c.DescribeDBClusterSnapshotsRequest} } const opDescribeDBClusters = "DescribeDBClusters" @@ -2101,6 +2138,7 @@ const opDescribeDBClusters = "DescribeDBClusters" type DescribeDBClustersRequest struct { *aws.Request Input *DescribeDBClustersInput + Copy func(*DescribeDBClustersInput) DescribeDBClustersRequest } // Send marshals and sends the DescribeDBClusters API request. @@ -2145,7 +2183,7 @@ func (c *RDS) DescribeDBClustersRequest(input *DescribeDBClustersInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBClustersRequest{Request: req, Input: input} + return DescribeDBClustersRequest{Request: req, Input: input, Copy: c.DescribeDBClustersRequest} } const opDescribeDBEngineVersions = "DescribeDBEngineVersions" @@ -2154,6 +2192,7 @@ const opDescribeDBEngineVersions = "DescribeDBEngineVersions" type DescribeDBEngineVersionsRequest struct { *aws.Request Input *DescribeDBEngineVersionsInput + Copy func(*DescribeDBEngineVersionsInput) DescribeDBEngineVersionsRequest } // Send marshals and sends the DescribeDBEngineVersions API request. @@ -2200,57 +2239,53 @@ func (c *RDS) DescribeDBEngineVersionsRequest(input *DescribeDBEngineVersionsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBEngineVersionsRequest{Request: req, Input: input} + return DescribeDBEngineVersionsRequest{Request: req, Input: input, Copy: c.DescribeDBEngineVersionsRequest} } -// DescribeDBEngineVersionsPages iterates over the pages of a DescribeDBEngineVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBEngineVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDBEngineVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDBEngineVersions operation. -// pageNum := 0 -// err := client.DescribeDBEngineVersionsPages(params, -// func(page *DescribeDBEngineVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBEngineVersionsPages(input *DescribeDBEngineVersionsInput, fn func(*DescribeDBEngineVersionsOutput, bool) bool) error { - return c.DescribeDBEngineVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDBEngineVersionsPagesWithContext same as DescribeDBEngineVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeDBEngineVersionsPagesWithContext(ctx aws.Context, input *DescribeDBEngineVersionsInput, fn func(*DescribeDBEngineVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDBEngineVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDBEngineVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDBEngineVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDBEngineVersionsRequest) Paginate(opts ...aws.Option) DescribeDBEngineVersionsPager { + return DescribeDBEngineVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDBEngineVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBEngineVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDBEngineVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDBEngineVersionsPager struct { + aws.Pager +} + +func (p *DescribeDBEngineVersionsPager) CurrentPage() *DescribeDBEngineVersionsOutput { + return p.Pager.CurrentPage().(*DescribeDBEngineVersionsOutput) } const opDescribeDBInstances = "DescribeDBInstances" @@ -2259,6 +2294,7 @@ const opDescribeDBInstances = "DescribeDBInstances" type DescribeDBInstancesRequest struct { *aws.Request Input *DescribeDBInstancesInput + Copy func(*DescribeDBInstancesInput) DescribeDBInstancesRequest } // Send marshals and sends the DescribeDBInstances API request. @@ -2305,57 +2341,53 @@ func (c *RDS) DescribeDBInstancesRequest(input *DescribeDBInstancesInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBInstancesRequest{Request: req, Input: input} + return DescribeDBInstancesRequest{Request: req, Input: input, Copy: c.DescribeDBInstancesRequest} } -// DescribeDBInstancesPages iterates over the pages of a DescribeDBInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDBInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDBInstances operation. -// pageNum := 0 -// err := client.DescribeDBInstancesPages(params, -// func(page *DescribeDBInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBInstancesPages(input *DescribeDBInstancesInput, fn func(*DescribeDBInstancesOutput, bool) bool) error { - return c.DescribeDBInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDBInstancesPagesWithContext same as DescribeDBInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeDBInstancesPagesWithContext(ctx aws.Context, input *DescribeDBInstancesInput, fn func(*DescribeDBInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDBInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDBInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDBInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDBInstancesRequest) Paginate(opts ...aws.Option) DescribeDBInstancesPager { + return DescribeDBInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDBInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDBInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDBInstancesPager struct { + aws.Pager +} + +func (p *DescribeDBInstancesPager) CurrentPage() *DescribeDBInstancesOutput { + return p.Pager.CurrentPage().(*DescribeDBInstancesOutput) } const opDescribeDBLogFiles = "DescribeDBLogFiles" @@ -2364,6 +2396,7 @@ const opDescribeDBLogFiles = "DescribeDBLogFiles" type DescribeDBLogFilesRequest struct { *aws.Request Input *DescribeDBLogFilesInput + Copy func(*DescribeDBLogFilesInput) DescribeDBLogFilesRequest } // Send marshals and sends the DescribeDBLogFiles API request. @@ -2410,57 +2443,53 @@ func (c *RDS) DescribeDBLogFilesRequest(input *DescribeDBLogFilesInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBLogFilesRequest{Request: req, Input: input} + return DescribeDBLogFilesRequest{Request: req, Input: input, Copy: c.DescribeDBLogFilesRequest} } -// DescribeDBLogFilesPages iterates over the pages of a DescribeDBLogFiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBLogFiles method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDBLogFilesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDBLogFiles operation. -// pageNum := 0 -// err := client.DescribeDBLogFilesPages(params, -// func(page *DescribeDBLogFilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBLogFilesPages(input *DescribeDBLogFilesInput, fn func(*DescribeDBLogFilesOutput, bool) bool) error { - return c.DescribeDBLogFilesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDBLogFilesPagesWithContext same as DescribeDBLogFilesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeDBLogFilesPagesWithContext(ctx aws.Context, input *DescribeDBLogFilesInput, fn func(*DescribeDBLogFilesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDBLogFilesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDBLogFilesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDBLogFilesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDBLogFilesRequest) Paginate(opts ...aws.Option) DescribeDBLogFilesPager { + return DescribeDBLogFilesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDBLogFilesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBLogFilesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDBLogFilesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDBLogFilesPager struct { + aws.Pager +} + +func (p *DescribeDBLogFilesPager) CurrentPage() *DescribeDBLogFilesOutput { + return p.Pager.CurrentPage().(*DescribeDBLogFilesOutput) } const opDescribeDBParameterGroups = "DescribeDBParameterGroups" @@ -2469,6 +2498,7 @@ const opDescribeDBParameterGroups = "DescribeDBParameterGroups" type DescribeDBParameterGroupsRequest struct { *aws.Request Input *DescribeDBParameterGroupsInput + Copy func(*DescribeDBParameterGroupsInput) DescribeDBParameterGroupsRequest } // Send marshals and sends the DescribeDBParameterGroups API request. @@ -2517,57 +2547,53 @@ func (c *RDS) DescribeDBParameterGroupsRequest(input *DescribeDBParameterGroupsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBParameterGroupsRequest{Request: req, Input: input} + return DescribeDBParameterGroupsRequest{Request: req, Input: input, Copy: c.DescribeDBParameterGroupsRequest} } -// DescribeDBParameterGroupsPages iterates over the pages of a DescribeDBParameterGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBParameterGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDBParameterGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDBParameterGroups operation. -// pageNum := 0 -// err := client.DescribeDBParameterGroupsPages(params, -// func(page *DescribeDBParameterGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBParameterGroupsPages(input *DescribeDBParameterGroupsInput, fn func(*DescribeDBParameterGroupsOutput, bool) bool) error { - return c.DescribeDBParameterGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDBParameterGroupsPagesWithContext same as DescribeDBParameterGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeDBParameterGroupsPagesWithContext(ctx aws.Context, input *DescribeDBParameterGroupsInput, fn func(*DescribeDBParameterGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDBParameterGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDBParameterGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDBParameterGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDBParameterGroupsRequest) Paginate(opts ...aws.Option) DescribeDBParameterGroupsPager { + return DescribeDBParameterGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDBParameterGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBParameterGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDBParameterGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDBParameterGroupsPager struct { + aws.Pager +} + +func (p *DescribeDBParameterGroupsPager) CurrentPage() *DescribeDBParameterGroupsOutput { + return p.Pager.CurrentPage().(*DescribeDBParameterGroupsOutput) } const opDescribeDBParameters = "DescribeDBParameters" @@ -2576,6 +2602,7 @@ const opDescribeDBParameters = "DescribeDBParameters" type DescribeDBParametersRequest struct { *aws.Request Input *DescribeDBParametersInput + Copy func(*DescribeDBParametersInput) DescribeDBParametersRequest } // Send marshals and sends the DescribeDBParameters API request. @@ -2622,57 +2649,53 @@ func (c *RDS) DescribeDBParametersRequest(input *DescribeDBParametersInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBParametersRequest{Request: req, Input: input} + return DescribeDBParametersRequest{Request: req, Input: input, Copy: c.DescribeDBParametersRequest} } -// DescribeDBParametersPages iterates over the pages of a DescribeDBParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBParameters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDBParametersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDBParameters operation. -// pageNum := 0 -// err := client.DescribeDBParametersPages(params, -// func(page *DescribeDBParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBParametersPages(input *DescribeDBParametersInput, fn func(*DescribeDBParametersOutput, bool) bool) error { - return c.DescribeDBParametersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDBParametersPagesWithContext same as DescribeDBParametersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeDBParametersPagesWithContext(ctx aws.Context, input *DescribeDBParametersInput, fn func(*DescribeDBParametersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDBParametersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDBParametersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDBParametersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDBParametersRequest) Paginate(opts ...aws.Option) DescribeDBParametersPager { + return DescribeDBParametersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDBParametersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBParametersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDBParametersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDBParametersPager struct { + aws.Pager +} + +func (p *DescribeDBParametersPager) CurrentPage() *DescribeDBParametersOutput { + return p.Pager.CurrentPage().(*DescribeDBParametersOutput) } const opDescribeDBSecurityGroups = "DescribeDBSecurityGroups" @@ -2681,6 +2704,7 @@ const opDescribeDBSecurityGroups = "DescribeDBSecurityGroups" type DescribeDBSecurityGroupsRequest struct { *aws.Request Input *DescribeDBSecurityGroupsInput + Copy func(*DescribeDBSecurityGroupsInput) DescribeDBSecurityGroupsRequest } // Send marshals and sends the DescribeDBSecurityGroups API request. @@ -2729,57 +2753,53 @@ func (c *RDS) DescribeDBSecurityGroupsRequest(input *DescribeDBSecurityGroupsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBSecurityGroupsRequest{Request: req, Input: input} + return DescribeDBSecurityGroupsRequest{Request: req, Input: input, Copy: c.DescribeDBSecurityGroupsRequest} } -// DescribeDBSecurityGroupsPages iterates over the pages of a DescribeDBSecurityGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBSecurityGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDBSecurityGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDBSecurityGroups operation. -// pageNum := 0 -// err := client.DescribeDBSecurityGroupsPages(params, -// func(page *DescribeDBSecurityGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBSecurityGroupsPages(input *DescribeDBSecurityGroupsInput, fn func(*DescribeDBSecurityGroupsOutput, bool) bool) error { - return c.DescribeDBSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDBSecurityGroupsPagesWithContext same as DescribeDBSecurityGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeDBSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeDBSecurityGroupsInput, fn func(*DescribeDBSecurityGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDBSecurityGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDBSecurityGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDBSecurityGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDBSecurityGroupsRequest) Paginate(opts ...aws.Option) DescribeDBSecurityGroupsPager { + return DescribeDBSecurityGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDBSecurityGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBSecurityGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDBSecurityGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDBSecurityGroupsPager struct { + aws.Pager +} + +func (p *DescribeDBSecurityGroupsPager) CurrentPage() *DescribeDBSecurityGroupsOutput { + return p.Pager.CurrentPage().(*DescribeDBSecurityGroupsOutput) } const opDescribeDBSnapshotAttributes = "DescribeDBSnapshotAttributes" @@ -2788,6 +2808,7 @@ const opDescribeDBSnapshotAttributes = "DescribeDBSnapshotAttributes" type DescribeDBSnapshotAttributesRequest struct { *aws.Request Input *DescribeDBSnapshotAttributesInput + Copy func(*DescribeDBSnapshotAttributesInput) DescribeDBSnapshotAttributesRequest } // Send marshals and sends the DescribeDBSnapshotAttributes API request. @@ -2839,7 +2860,7 @@ func (c *RDS) DescribeDBSnapshotAttributesRequest(input *DescribeDBSnapshotAttri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBSnapshotAttributesRequest{Request: req, Input: input} + return DescribeDBSnapshotAttributesRequest{Request: req, Input: input, Copy: c.DescribeDBSnapshotAttributesRequest} } const opDescribeDBSnapshots = "DescribeDBSnapshots" @@ -2848,6 +2869,7 @@ const opDescribeDBSnapshots = "DescribeDBSnapshots" type DescribeDBSnapshotsRequest struct { *aws.Request Input *DescribeDBSnapshotsInput + Copy func(*DescribeDBSnapshotsInput) DescribeDBSnapshotsRequest } // Send marshals and sends the DescribeDBSnapshots API request. @@ -2894,57 +2916,53 @@ func (c *RDS) DescribeDBSnapshotsRequest(input *DescribeDBSnapshotsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBSnapshotsRequest{Request: req, Input: input} + return DescribeDBSnapshotsRequest{Request: req, Input: input, Copy: c.DescribeDBSnapshotsRequest} } -// DescribeDBSnapshotsPages iterates over the pages of a DescribeDBSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBSnapshots method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDBSnapshotsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDBSnapshots operation. -// pageNum := 0 -// err := client.DescribeDBSnapshotsPages(params, -// func(page *DescribeDBSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBSnapshotsPages(input *DescribeDBSnapshotsInput, fn func(*DescribeDBSnapshotsOutput, bool) bool) error { - return c.DescribeDBSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDBSnapshotsPagesWithContext same as DescribeDBSnapshotsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeDBSnapshotsPagesWithContext(ctx aws.Context, input *DescribeDBSnapshotsInput, fn func(*DescribeDBSnapshotsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDBSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDBSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDBSnapshotsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDBSnapshotsRequest) Paginate(opts ...aws.Option) DescribeDBSnapshotsPager { + return DescribeDBSnapshotsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDBSnapshotsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBSnapshotsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDBSnapshotsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDBSnapshotsPager struct { + aws.Pager +} + +func (p *DescribeDBSnapshotsPager) CurrentPage() *DescribeDBSnapshotsOutput { + return p.Pager.CurrentPage().(*DescribeDBSnapshotsOutput) } const opDescribeDBSubnetGroups = "DescribeDBSubnetGroups" @@ -2953,6 +2971,7 @@ const opDescribeDBSubnetGroups = "DescribeDBSubnetGroups" type DescribeDBSubnetGroupsRequest struct { *aws.Request Input *DescribeDBSubnetGroupsInput + Copy func(*DescribeDBSubnetGroupsInput) DescribeDBSubnetGroupsRequest } // Send marshals and sends the DescribeDBSubnetGroups API request. @@ -3002,57 +3021,53 @@ func (c *RDS) DescribeDBSubnetGroupsRequest(input *DescribeDBSubnetGroupsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDBSubnetGroupsRequest{Request: req, Input: input} + return DescribeDBSubnetGroupsRequest{Request: req, Input: input, Copy: c.DescribeDBSubnetGroupsRequest} } -// DescribeDBSubnetGroupsPages iterates over the pages of a DescribeDBSubnetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBSubnetGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDBSubnetGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDBSubnetGroups operation. -// pageNum := 0 -// err := client.DescribeDBSubnetGroupsPages(params, -// func(page *DescribeDBSubnetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBSubnetGroupsPages(input *DescribeDBSubnetGroupsInput, fn func(*DescribeDBSubnetGroupsOutput, bool) bool) error { - return c.DescribeDBSubnetGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDBSubnetGroupsPagesWithContext same as DescribeDBSubnetGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeDBSubnetGroupsPagesWithContext(ctx aws.Context, input *DescribeDBSubnetGroupsInput, fn func(*DescribeDBSubnetGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDBSubnetGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDBSubnetGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDBSubnetGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDBSubnetGroupsRequest) Paginate(opts ...aws.Option) DescribeDBSubnetGroupsPager { + return DescribeDBSubnetGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDBSubnetGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBSubnetGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDBSubnetGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDBSubnetGroupsPager struct { + aws.Pager +} + +func (p *DescribeDBSubnetGroupsPager) CurrentPage() *DescribeDBSubnetGroupsOutput { + return p.Pager.CurrentPage().(*DescribeDBSubnetGroupsOutput) } const opDescribeEngineDefaultClusterParameters = "DescribeEngineDefaultClusterParameters" @@ -3061,6 +3076,7 @@ const opDescribeEngineDefaultClusterParameters = "DescribeEngineDefaultClusterPa type DescribeEngineDefaultClusterParametersRequest struct { *aws.Request Input *DescribeEngineDefaultClusterParametersInput + Copy func(*DescribeEngineDefaultClusterParametersInput) DescribeEngineDefaultClusterParametersRequest } // Send marshals and sends the DescribeEngineDefaultClusterParameters API request. @@ -3105,7 +3121,7 @@ func (c *RDS) DescribeEngineDefaultClusterParametersRequest(input *DescribeEngin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEngineDefaultClusterParametersRequest{Request: req, Input: input} + return DescribeEngineDefaultClusterParametersRequest{Request: req, Input: input, Copy: c.DescribeEngineDefaultClusterParametersRequest} } const opDescribeEngineDefaultParameters = "DescribeEngineDefaultParameters" @@ -3114,6 +3130,7 @@ const opDescribeEngineDefaultParameters = "DescribeEngineDefaultParameters" type DescribeEngineDefaultParametersRequest struct { *aws.Request Input *DescribeEngineDefaultParametersInput + Copy func(*DescribeEngineDefaultParametersInput) DescribeEngineDefaultParametersRequest } // Send marshals and sends the DescribeEngineDefaultParameters API request. @@ -3161,57 +3178,53 @@ func (c *RDS) DescribeEngineDefaultParametersRequest(input *DescribeEngineDefaul req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEngineDefaultParametersRequest{Request: req, Input: input} + return DescribeEngineDefaultParametersRequest{Request: req, Input: input, Copy: c.DescribeEngineDefaultParametersRequest} } -// DescribeEngineDefaultParametersPages iterates over the pages of a DescribeEngineDefaultParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEngineDefaultParameters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEngineDefaultParametersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEngineDefaultParameters operation. -// pageNum := 0 -// err := client.DescribeEngineDefaultParametersPages(params, -// func(page *DescribeEngineDefaultParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeEngineDefaultParametersPages(input *DescribeEngineDefaultParametersInput, fn func(*DescribeEngineDefaultParametersOutput, bool) bool) error { - return c.DescribeEngineDefaultParametersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEngineDefaultParametersPagesWithContext same as DescribeEngineDefaultParametersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeEngineDefaultParametersPagesWithContext(ctx aws.Context, input *DescribeEngineDefaultParametersInput, fn func(*DescribeEngineDefaultParametersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEngineDefaultParametersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEngineDefaultParametersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEngineDefaultParametersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEngineDefaultParametersRequest) Paginate(opts ...aws.Option) DescribeEngineDefaultParametersPager { + return DescribeEngineDefaultParametersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEngineDefaultParametersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEngineDefaultParametersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEngineDefaultParametersPager struct { + aws.Pager +} + +func (p *DescribeEngineDefaultParametersPager) CurrentPage() *DescribeEngineDefaultParametersOutput { + return p.Pager.CurrentPage().(*DescribeEngineDefaultParametersOutput) } const opDescribeEventCategories = "DescribeEventCategories" @@ -3220,6 +3233,7 @@ const opDescribeEventCategories = "DescribeEventCategories" type DescribeEventCategoriesRequest struct { *aws.Request Input *DescribeEventCategoriesInput + Copy func(*DescribeEventCategoriesInput) DescribeEventCategoriesRequest } // Send marshals and sends the DescribeEventCategories API request. @@ -3263,7 +3277,7 @@ func (c *RDS) DescribeEventCategoriesRequest(input *DescribeEventCategoriesInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventCategoriesRequest{Request: req, Input: input} + return DescribeEventCategoriesRequest{Request: req, Input: input, Copy: c.DescribeEventCategoriesRequest} } const opDescribeEventSubscriptions = "DescribeEventSubscriptions" @@ -3272,6 +3286,7 @@ const opDescribeEventSubscriptions = "DescribeEventSubscriptions" type DescribeEventSubscriptionsRequest struct { *aws.Request Input *DescribeEventSubscriptionsInput + Copy func(*DescribeEventSubscriptionsInput) DescribeEventSubscriptionsRequest } // Send marshals and sends the DescribeEventSubscriptions API request. @@ -3322,57 +3337,53 @@ func (c *RDS) DescribeEventSubscriptionsRequest(input *DescribeEventSubscription req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventSubscriptionsRequest{Request: req, Input: input} + return DescribeEventSubscriptionsRequest{Request: req, Input: input, Copy: c.DescribeEventSubscriptionsRequest} } -// DescribeEventSubscriptionsPages iterates over the pages of a DescribeEventSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEventSubscriptions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventSubscriptionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEventSubscriptions operation. -// pageNum := 0 -// err := client.DescribeEventSubscriptionsPages(params, -// func(page *DescribeEventSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeEventSubscriptionsPages(input *DescribeEventSubscriptionsInput, fn func(*DescribeEventSubscriptionsOutput, bool) bool) error { - return c.DescribeEventSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventSubscriptionsPagesWithContext same as DescribeEventSubscriptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeEventSubscriptionsPagesWithContext(ctx aws.Context, input *DescribeEventSubscriptionsInput, fn func(*DescribeEventSubscriptionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventSubscriptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventSubscriptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEventSubscriptionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEventSubscriptionsRequest) Paginate(opts ...aws.Option) DescribeEventSubscriptionsPager { + return DescribeEventSubscriptionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventSubscriptionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventSubscriptionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventSubscriptionsPager struct { + aws.Pager +} + +func (p *DescribeEventSubscriptionsPager) CurrentPage() *DescribeEventSubscriptionsOutput { + return p.Pager.CurrentPage().(*DescribeEventSubscriptionsOutput) } const opDescribeEvents = "DescribeEvents" @@ -3381,6 +3392,7 @@ const opDescribeEvents = "DescribeEvents" type DescribeEventsRequest struct { *aws.Request Input *DescribeEventsInput + Copy func(*DescribeEventsInput) DescribeEventsRequest } // Send marshals and sends the DescribeEvents API request. @@ -3431,57 +3443,53 @@ func (c *RDS) DescribeEventsRequest(input *DescribeEventsInput) DescribeEventsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventsRequest{Request: req, Input: input} + return DescribeEventsRequest{Request: req, Input: input, Copy: c.DescribeEventsRequest} } -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeEventsPages(input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool) error { - return c.DescribeEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventsPagesWithContext same as DescribeEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeEventsPagesWithContext(ctx aws.Context, input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEventsRequest) Paginate(opts ...aws.Option) DescribeEventsPager { + return DescribeEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventsPager struct { + aws.Pager +} + +func (p *DescribeEventsPager) CurrentPage() *DescribeEventsOutput { + return p.Pager.CurrentPage().(*DescribeEventsOutput) } const opDescribeOptionGroupOptions = "DescribeOptionGroupOptions" @@ -3490,6 +3498,7 @@ const opDescribeOptionGroupOptions = "DescribeOptionGroupOptions" type DescribeOptionGroupOptionsRequest struct { *aws.Request Input *DescribeOptionGroupOptionsInput + Copy func(*DescribeOptionGroupOptionsInput) DescribeOptionGroupOptionsRequest } // Send marshals and sends the DescribeOptionGroupOptions API request. @@ -3536,57 +3545,53 @@ func (c *RDS) DescribeOptionGroupOptionsRequest(input *DescribeOptionGroupOption req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeOptionGroupOptionsRequest{Request: req, Input: input} + return DescribeOptionGroupOptionsRequest{Request: req, Input: input, Copy: c.DescribeOptionGroupOptionsRequest} } -// DescribeOptionGroupOptionsPages iterates over the pages of a DescribeOptionGroupOptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeOptionGroupOptions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeOptionGroupOptionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeOptionGroupOptions operation. -// pageNum := 0 -// err := client.DescribeOptionGroupOptionsPages(params, -// func(page *DescribeOptionGroupOptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeOptionGroupOptionsPages(input *DescribeOptionGroupOptionsInput, fn func(*DescribeOptionGroupOptionsOutput, bool) bool) error { - return c.DescribeOptionGroupOptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeOptionGroupOptionsPagesWithContext same as DescribeOptionGroupOptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeOptionGroupOptionsPagesWithContext(ctx aws.Context, input *DescribeOptionGroupOptionsInput, fn func(*DescribeOptionGroupOptionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeOptionGroupOptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeOptionGroupOptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeOptionGroupOptionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeOptionGroupOptionsRequest) Paginate(opts ...aws.Option) DescribeOptionGroupOptionsPager { + return DescribeOptionGroupOptionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeOptionGroupOptionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOptionGroupOptionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeOptionGroupOptionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeOptionGroupOptionsPager struct { + aws.Pager +} + +func (p *DescribeOptionGroupOptionsPager) CurrentPage() *DescribeOptionGroupOptionsOutput { + return p.Pager.CurrentPage().(*DescribeOptionGroupOptionsOutput) } const opDescribeOptionGroups = "DescribeOptionGroups" @@ -3595,6 +3600,7 @@ const opDescribeOptionGroups = "DescribeOptionGroups" type DescribeOptionGroupsRequest struct { *aws.Request Input *DescribeOptionGroupsInput + Copy func(*DescribeOptionGroupsInput) DescribeOptionGroupsRequest } // Send marshals and sends the DescribeOptionGroups API request. @@ -3641,57 +3647,53 @@ func (c *RDS) DescribeOptionGroupsRequest(input *DescribeOptionGroupsInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeOptionGroupsRequest{Request: req, Input: input} + return DescribeOptionGroupsRequest{Request: req, Input: input, Copy: c.DescribeOptionGroupsRequest} } -// DescribeOptionGroupsPages iterates over the pages of a DescribeOptionGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeOptionGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeOptionGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeOptionGroups operation. -// pageNum := 0 -// err := client.DescribeOptionGroupsPages(params, -// func(page *DescribeOptionGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeOptionGroupsPages(input *DescribeOptionGroupsInput, fn func(*DescribeOptionGroupsOutput, bool) bool) error { - return c.DescribeOptionGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeOptionGroupsPagesWithContext same as DescribeOptionGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeOptionGroupsPagesWithContext(ctx aws.Context, input *DescribeOptionGroupsInput, fn func(*DescribeOptionGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeOptionGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeOptionGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeOptionGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeOptionGroupsRequest) Paginate(opts ...aws.Option) DescribeOptionGroupsPager { + return DescribeOptionGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeOptionGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOptionGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeOptionGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeOptionGroupsPager struct { + aws.Pager +} + +func (p *DescribeOptionGroupsPager) CurrentPage() *DescribeOptionGroupsOutput { + return p.Pager.CurrentPage().(*DescribeOptionGroupsOutput) } const opDescribeOrderableDBInstanceOptions = "DescribeOrderableDBInstanceOptions" @@ -3700,6 +3702,7 @@ const opDescribeOrderableDBInstanceOptions = "DescribeOrderableDBInstanceOptions type DescribeOrderableDBInstanceOptionsRequest struct { *aws.Request Input *DescribeOrderableDBInstanceOptionsInput + Copy func(*DescribeOrderableDBInstanceOptionsInput) DescribeOrderableDBInstanceOptionsRequest } // Send marshals and sends the DescribeOrderableDBInstanceOptions API request. @@ -3746,57 +3749,53 @@ func (c *RDS) DescribeOrderableDBInstanceOptionsRequest(input *DescribeOrderable req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeOrderableDBInstanceOptionsRequest{Request: req, Input: input} + return DescribeOrderableDBInstanceOptionsRequest{Request: req, Input: input, Copy: c.DescribeOrderableDBInstanceOptionsRequest} } -// DescribeOrderableDBInstanceOptionsPages iterates over the pages of a DescribeOrderableDBInstanceOptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeOrderableDBInstanceOptions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeOrderableDBInstanceOptionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeOrderableDBInstanceOptions operation. -// pageNum := 0 -// err := client.DescribeOrderableDBInstanceOptionsPages(params, -// func(page *DescribeOrderableDBInstanceOptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeOrderableDBInstanceOptionsPages(input *DescribeOrderableDBInstanceOptionsInput, fn func(*DescribeOrderableDBInstanceOptionsOutput, bool) bool) error { - return c.DescribeOrderableDBInstanceOptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeOrderableDBInstanceOptionsPagesWithContext same as DescribeOrderableDBInstanceOptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeOrderableDBInstanceOptionsPagesWithContext(ctx aws.Context, input *DescribeOrderableDBInstanceOptionsInput, fn func(*DescribeOrderableDBInstanceOptionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeOrderableDBInstanceOptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeOrderableDBInstanceOptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeOrderableDBInstanceOptionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeOrderableDBInstanceOptionsRequest) Paginate(opts ...aws.Option) DescribeOrderableDBInstanceOptionsPager { + return DescribeOrderableDBInstanceOptionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeOrderableDBInstanceOptionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOrderableDBInstanceOptionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeOrderableDBInstanceOptionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeOrderableDBInstanceOptionsPager struct { + aws.Pager +} + +func (p *DescribeOrderableDBInstanceOptionsPager) CurrentPage() *DescribeOrderableDBInstanceOptionsOutput { + return p.Pager.CurrentPage().(*DescribeOrderableDBInstanceOptionsOutput) } const opDescribePendingMaintenanceActions = "DescribePendingMaintenanceActions" @@ -3805,6 +3804,7 @@ const opDescribePendingMaintenanceActions = "DescribePendingMaintenanceActions" type DescribePendingMaintenanceActionsRequest struct { *aws.Request Input *DescribePendingMaintenanceActionsInput + Copy func(*DescribePendingMaintenanceActionsInput) DescribePendingMaintenanceActionsRequest } // Send marshals and sends the DescribePendingMaintenanceActions API request. @@ -3846,7 +3846,7 @@ func (c *RDS) DescribePendingMaintenanceActionsRequest(input *DescribePendingMai req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePendingMaintenanceActionsRequest{Request: req, Input: input} + return DescribePendingMaintenanceActionsRequest{Request: req, Input: input, Copy: c.DescribePendingMaintenanceActionsRequest} } const opDescribeReservedDBInstances = "DescribeReservedDBInstances" @@ -3855,6 +3855,7 @@ const opDescribeReservedDBInstances = "DescribeReservedDBInstances" type DescribeReservedDBInstancesRequest struct { *aws.Request Input *DescribeReservedDBInstancesInput + Copy func(*DescribeReservedDBInstancesInput) DescribeReservedDBInstancesRequest } // Send marshals and sends the DescribeReservedDBInstances API request. @@ -3902,57 +3903,53 @@ func (c *RDS) DescribeReservedDBInstancesRequest(input *DescribeReservedDBInstan req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedDBInstancesRequest{Request: req, Input: input} + return DescribeReservedDBInstancesRequest{Request: req, Input: input, Copy: c.DescribeReservedDBInstancesRequest} } -// DescribeReservedDBInstancesPages iterates over the pages of a DescribeReservedDBInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedDBInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReservedDBInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReservedDBInstances operation. -// pageNum := 0 -// err := client.DescribeReservedDBInstancesPages(params, -// func(page *DescribeReservedDBInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeReservedDBInstancesPages(input *DescribeReservedDBInstancesInput, fn func(*DescribeReservedDBInstancesOutput, bool) bool) error { - return c.DescribeReservedDBInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedDBInstancesPagesWithContext same as DescribeReservedDBInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeReservedDBInstancesPagesWithContext(ctx aws.Context, input *DescribeReservedDBInstancesInput, fn func(*DescribeReservedDBInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReservedDBInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReservedDBInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReservedDBInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReservedDBInstancesRequest) Paginate(opts ...aws.Option) DescribeReservedDBInstancesPager { + return DescribeReservedDBInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReservedDBInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedDBInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReservedDBInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReservedDBInstancesPager struct { + aws.Pager +} + +func (p *DescribeReservedDBInstancesPager) CurrentPage() *DescribeReservedDBInstancesOutput { + return p.Pager.CurrentPage().(*DescribeReservedDBInstancesOutput) } const opDescribeReservedDBInstancesOfferings = "DescribeReservedDBInstancesOfferings" @@ -3961,6 +3958,7 @@ const opDescribeReservedDBInstancesOfferings = "DescribeReservedDBInstancesOffer type DescribeReservedDBInstancesOfferingsRequest struct { *aws.Request Input *DescribeReservedDBInstancesOfferingsInput + Copy func(*DescribeReservedDBInstancesOfferingsInput) DescribeReservedDBInstancesOfferingsRequest } // Send marshals and sends the DescribeReservedDBInstancesOfferings API request. @@ -4007,57 +4005,53 @@ func (c *RDS) DescribeReservedDBInstancesOfferingsRequest(input *DescribeReserve req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedDBInstancesOfferingsRequest{Request: req, Input: input} + return DescribeReservedDBInstancesOfferingsRequest{Request: req, Input: input, Copy: c.DescribeReservedDBInstancesOfferingsRequest} } -// DescribeReservedDBInstancesOfferingsPages iterates over the pages of a DescribeReservedDBInstancesOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedDBInstancesOfferings method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReservedDBInstancesOfferingsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReservedDBInstancesOfferings operation. -// pageNum := 0 -// err := client.DescribeReservedDBInstancesOfferingsPages(params, -// func(page *DescribeReservedDBInstancesOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeReservedDBInstancesOfferingsPages(input *DescribeReservedDBInstancesOfferingsInput, fn func(*DescribeReservedDBInstancesOfferingsOutput, bool) bool) error { - return c.DescribeReservedDBInstancesOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedDBInstancesOfferingsPagesWithContext same as DescribeReservedDBInstancesOfferingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DescribeReservedDBInstancesOfferingsPagesWithContext(ctx aws.Context, input *DescribeReservedDBInstancesOfferingsInput, fn func(*DescribeReservedDBInstancesOfferingsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReservedDBInstancesOfferingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReservedDBInstancesOfferingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReservedDBInstancesOfferingsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReservedDBInstancesOfferingsRequest) Paginate(opts ...aws.Option) DescribeReservedDBInstancesOfferingsPager { + return DescribeReservedDBInstancesOfferingsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReservedDBInstancesOfferingsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedDBInstancesOfferingsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReservedDBInstancesOfferingsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReservedDBInstancesOfferingsPager struct { + aws.Pager +} + +func (p *DescribeReservedDBInstancesOfferingsPager) CurrentPage() *DescribeReservedDBInstancesOfferingsOutput { + return p.Pager.CurrentPage().(*DescribeReservedDBInstancesOfferingsOutput) } const opDescribeSourceRegions = "DescribeSourceRegions" @@ -4066,6 +4060,7 @@ const opDescribeSourceRegions = "DescribeSourceRegions" type DescribeSourceRegionsRequest struct { *aws.Request Input *DescribeSourceRegionsInput + Copy func(*DescribeSourceRegionsInput) DescribeSourceRegionsRequest } // Send marshals and sends the DescribeSourceRegions API request. @@ -4108,7 +4103,7 @@ func (c *RDS) DescribeSourceRegionsRequest(input *DescribeSourceRegionsInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSourceRegionsRequest{Request: req, Input: input} + return DescribeSourceRegionsRequest{Request: req, Input: input, Copy: c.DescribeSourceRegionsRequest} } const opDescribeValidDBInstanceModifications = "DescribeValidDBInstanceModifications" @@ -4117,6 +4112,7 @@ const opDescribeValidDBInstanceModifications = "DescribeValidDBInstanceModificat type DescribeValidDBInstanceModificationsRequest struct { *aws.Request Input *DescribeValidDBInstanceModificationsInput + Copy func(*DescribeValidDBInstanceModificationsInput) DescribeValidDBInstanceModificationsRequest } // Send marshals and sends the DescribeValidDBInstanceModifications API request. @@ -4159,7 +4155,7 @@ func (c *RDS) DescribeValidDBInstanceModificationsRequest(input *DescribeValidDB req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeValidDBInstanceModificationsRequest{Request: req, Input: input} + return DescribeValidDBInstanceModificationsRequest{Request: req, Input: input, Copy: c.DescribeValidDBInstanceModificationsRequest} } const opDownloadDBLogFilePortion = "DownloadDBLogFilePortion" @@ -4168,6 +4164,7 @@ const opDownloadDBLogFilePortion = "DownloadDBLogFilePortion" type DownloadDBLogFilePortionRequest struct { *aws.Request Input *DownloadDBLogFilePortionInput + Copy func(*DownloadDBLogFilePortionInput) DownloadDBLogFilePortionRequest } // Send marshals and sends the DownloadDBLogFilePortion API request. @@ -4214,57 +4211,53 @@ func (c *RDS) DownloadDBLogFilePortionRequest(input *DownloadDBLogFilePortionInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DownloadDBLogFilePortionRequest{Request: req, Input: input} + return DownloadDBLogFilePortionRequest{Request: req, Input: input, Copy: c.DownloadDBLogFilePortionRequest} } -// DownloadDBLogFilePortionPages iterates over the pages of a DownloadDBLogFilePortion operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DownloadDBLogFilePortion method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DownloadDBLogFilePortionRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DownloadDBLogFilePortion operation. -// pageNum := 0 -// err := client.DownloadDBLogFilePortionPages(params, -// func(page *DownloadDBLogFilePortionOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DownloadDBLogFilePortionPages(input *DownloadDBLogFilePortionInput, fn func(*DownloadDBLogFilePortionOutput, bool) bool) error { - return c.DownloadDBLogFilePortionPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DownloadDBLogFilePortionPagesWithContext same as DownloadDBLogFilePortionPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *RDS) DownloadDBLogFilePortionPagesWithContext(ctx aws.Context, input *DownloadDBLogFilePortionInput, fn func(*DownloadDBLogFilePortionOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DownloadDBLogFilePortionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DownloadDBLogFilePortionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DownloadDBLogFilePortionRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DownloadDBLogFilePortionRequest) Paginate(opts ...aws.Option) DownloadDBLogFilePortionPager { + return DownloadDBLogFilePortionPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DownloadDBLogFilePortionInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DownloadDBLogFilePortionOutput), !p.HasNextPage()) - } - return p.Err() +// DownloadDBLogFilePortionPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DownloadDBLogFilePortionPager struct { + aws.Pager +} + +func (p *DownloadDBLogFilePortionPager) CurrentPage() *DownloadDBLogFilePortionOutput { + return p.Pager.CurrentPage().(*DownloadDBLogFilePortionOutput) } const opFailoverDBCluster = "FailoverDBCluster" @@ -4273,6 +4266,7 @@ const opFailoverDBCluster = "FailoverDBCluster" type FailoverDBClusterRequest struct { *aws.Request Input *FailoverDBClusterInput + Copy func(*FailoverDBClusterInput) FailoverDBClusterRequest } // Send marshals and sends the FailoverDBCluster API request. @@ -4326,7 +4320,7 @@ func (c *RDS) FailoverDBClusterRequest(input *FailoverDBClusterInput) FailoverDB req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return FailoverDBClusterRequest{Request: req, Input: input} + return FailoverDBClusterRequest{Request: req, Input: input, Copy: c.FailoverDBClusterRequest} } const opListTagsForResource = "ListTagsForResource" @@ -4335,6 +4329,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -4378,7 +4373,7 @@ func (c *RDS) ListTagsForResourceRequest(input *ListTagsForResourceInput) ListTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opModifyDBCluster = "ModifyDBCluster" @@ -4387,6 +4382,7 @@ const opModifyDBCluster = "ModifyDBCluster" type ModifyDBClusterRequest struct { *aws.Request Input *ModifyDBClusterInput + Copy func(*ModifyDBClusterInput) ModifyDBClusterRequest } // Send marshals and sends the ModifyDBCluster API request. @@ -4431,7 +4427,7 @@ func (c *RDS) ModifyDBClusterRequest(input *ModifyDBClusterInput) ModifyDBCluste req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyDBClusterRequest{Request: req, Input: input} + return ModifyDBClusterRequest{Request: req, Input: input, Copy: c.ModifyDBClusterRequest} } const opModifyDBClusterParameterGroup = "ModifyDBClusterParameterGroup" @@ -4440,6 +4436,7 @@ const opModifyDBClusterParameterGroup = "ModifyDBClusterParameterGroup" type ModifyDBClusterParameterGroupRequest struct { *aws.Request Input *ModifyDBClusterParameterGroupInput + Copy func(*ModifyDBClusterParameterGroupInput) ModifyDBClusterParameterGroupRequest } // Send marshals and sends the ModifyDBClusterParameterGroup API request. @@ -4500,7 +4497,7 @@ func (c *RDS) ModifyDBClusterParameterGroupRequest(input *ModifyDBClusterParamet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyDBClusterParameterGroupRequest{Request: req, Input: input} + return ModifyDBClusterParameterGroupRequest{Request: req, Input: input, Copy: c.ModifyDBClusterParameterGroupRequest} } const opModifyDBClusterSnapshotAttribute = "ModifyDBClusterSnapshotAttribute" @@ -4509,6 +4506,7 @@ const opModifyDBClusterSnapshotAttribute = "ModifyDBClusterSnapshotAttribute" type ModifyDBClusterSnapshotAttributeRequest struct { *aws.Request Input *ModifyDBClusterSnapshotAttributeInput + Copy func(*ModifyDBClusterSnapshotAttributeInput) ModifyDBClusterSnapshotAttributeRequest } // Send marshals and sends the ModifyDBClusterSnapshotAttribute API request. @@ -4565,7 +4563,7 @@ func (c *RDS) ModifyDBClusterSnapshotAttributeRequest(input *ModifyDBClusterSnap req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyDBClusterSnapshotAttributeRequest{Request: req, Input: input} + return ModifyDBClusterSnapshotAttributeRequest{Request: req, Input: input, Copy: c.ModifyDBClusterSnapshotAttributeRequest} } const opModifyDBInstance = "ModifyDBInstance" @@ -4574,6 +4572,7 @@ const opModifyDBInstance = "ModifyDBInstance" type ModifyDBInstanceRequest struct { *aws.Request Input *ModifyDBInstanceInput + Copy func(*ModifyDBInstanceInput) ModifyDBInstanceRequest } // Send marshals and sends the ModifyDBInstance API request. @@ -4617,7 +4616,7 @@ func (c *RDS) ModifyDBInstanceRequest(input *ModifyDBInstanceInput) ModifyDBInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyDBInstanceRequest{Request: req, Input: input} + return ModifyDBInstanceRequest{Request: req, Input: input, Copy: c.ModifyDBInstanceRequest} } const opModifyDBParameterGroup = "ModifyDBParameterGroup" @@ -4626,6 +4625,7 @@ const opModifyDBParameterGroup = "ModifyDBParameterGroup" type ModifyDBParameterGroupRequest struct { *aws.Request Input *ModifyDBParameterGroupInput + Copy func(*ModifyDBParameterGroupInput) ModifyDBParameterGroupRequest } // Send marshals and sends the ModifyDBParameterGroup API request. @@ -4683,7 +4683,7 @@ func (c *RDS) ModifyDBParameterGroupRequest(input *ModifyDBParameterGroupInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyDBParameterGroupRequest{Request: req, Input: input} + return ModifyDBParameterGroupRequest{Request: req, Input: input, Copy: c.ModifyDBParameterGroupRequest} } const opModifyDBSnapshot = "ModifyDBSnapshot" @@ -4692,6 +4692,7 @@ const opModifyDBSnapshot = "ModifyDBSnapshot" type ModifyDBSnapshotRequest struct { *aws.Request Input *ModifyDBSnapshotInput + Copy func(*ModifyDBSnapshotInput) ModifyDBSnapshotRequest } // Send marshals and sends the ModifyDBSnapshot API request. @@ -4735,7 +4736,7 @@ func (c *RDS) ModifyDBSnapshotRequest(input *ModifyDBSnapshotInput) ModifyDBSnap req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyDBSnapshotRequest{Request: req, Input: input} + return ModifyDBSnapshotRequest{Request: req, Input: input, Copy: c.ModifyDBSnapshotRequest} } const opModifyDBSnapshotAttribute = "ModifyDBSnapshotAttribute" @@ -4744,6 +4745,7 @@ const opModifyDBSnapshotAttribute = "ModifyDBSnapshotAttribute" type ModifyDBSnapshotAttributeRequest struct { *aws.Request Input *ModifyDBSnapshotAttributeInput + Copy func(*ModifyDBSnapshotAttributeInput) ModifyDBSnapshotAttributeRequest } // Send marshals and sends the ModifyDBSnapshotAttribute API request. @@ -4800,7 +4802,7 @@ func (c *RDS) ModifyDBSnapshotAttributeRequest(input *ModifyDBSnapshotAttributeI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyDBSnapshotAttributeRequest{Request: req, Input: input} + return ModifyDBSnapshotAttributeRequest{Request: req, Input: input, Copy: c.ModifyDBSnapshotAttributeRequest} } const opModifyDBSubnetGroup = "ModifyDBSubnetGroup" @@ -4809,6 +4811,7 @@ const opModifyDBSubnetGroup = "ModifyDBSubnetGroup" type ModifyDBSubnetGroupRequest struct { *aws.Request Input *ModifyDBSubnetGroupInput + Copy func(*ModifyDBSubnetGroupInput) ModifyDBSubnetGroupRequest } // Send marshals and sends the ModifyDBSubnetGroup API request. @@ -4850,7 +4853,7 @@ func (c *RDS) ModifyDBSubnetGroupRequest(input *ModifyDBSubnetGroupInput) Modify req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyDBSubnetGroupRequest{Request: req, Input: input} + return ModifyDBSubnetGroupRequest{Request: req, Input: input, Copy: c.ModifyDBSubnetGroupRequest} } const opModifyEventSubscription = "ModifyEventSubscription" @@ -4859,6 +4862,7 @@ const opModifyEventSubscription = "ModifyEventSubscription" type ModifyEventSubscriptionRequest struct { *aws.Request Input *ModifyEventSubscriptionInput + Copy func(*ModifyEventSubscriptionInput) ModifyEventSubscriptionRequest } // Send marshals and sends the ModifyEventSubscription API request. @@ -4907,7 +4911,7 @@ func (c *RDS) ModifyEventSubscriptionRequest(input *ModifyEventSubscriptionInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyEventSubscriptionRequest{Request: req, Input: input} + return ModifyEventSubscriptionRequest{Request: req, Input: input, Copy: c.ModifyEventSubscriptionRequest} } const opModifyOptionGroup = "ModifyOptionGroup" @@ -4916,6 +4920,7 @@ const opModifyOptionGroup = "ModifyOptionGroup" type ModifyOptionGroupRequest struct { *aws.Request Input *ModifyOptionGroupInput + Copy func(*ModifyOptionGroupInput) ModifyOptionGroupRequest } // Send marshals and sends the ModifyOptionGroup API request. @@ -4956,7 +4961,7 @@ func (c *RDS) ModifyOptionGroupRequest(input *ModifyOptionGroupInput) ModifyOpti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyOptionGroupRequest{Request: req, Input: input} + return ModifyOptionGroupRequest{Request: req, Input: input, Copy: c.ModifyOptionGroupRequest} } const opPromoteReadReplica = "PromoteReadReplica" @@ -4965,6 +4970,7 @@ const opPromoteReadReplica = "PromoteReadReplica" type PromoteReadReplicaRequest struct { *aws.Request Input *PromoteReadReplicaInput + Copy func(*PromoteReadReplicaInput) PromoteReadReplicaRequest } // Send marshals and sends the PromoteReadReplica API request. @@ -5010,7 +5016,7 @@ func (c *RDS) PromoteReadReplicaRequest(input *PromoteReadReplicaInput) PromoteR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PromoteReadReplicaRequest{Request: req, Input: input} + return PromoteReadReplicaRequest{Request: req, Input: input, Copy: c.PromoteReadReplicaRequest} } const opPromoteReadReplicaDBCluster = "PromoteReadReplicaDBCluster" @@ -5019,6 +5025,7 @@ const opPromoteReadReplicaDBCluster = "PromoteReadReplicaDBCluster" type PromoteReadReplicaDBClusterRequest struct { *aws.Request Input *PromoteReadReplicaDBClusterInput + Copy func(*PromoteReadReplicaDBClusterInput) PromoteReadReplicaDBClusterRequest } // Send marshals and sends the PromoteReadReplicaDBCluster API request. @@ -5059,7 +5066,7 @@ func (c *RDS) PromoteReadReplicaDBClusterRequest(input *PromoteReadReplicaDBClus req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PromoteReadReplicaDBClusterRequest{Request: req, Input: input} + return PromoteReadReplicaDBClusterRequest{Request: req, Input: input, Copy: c.PromoteReadReplicaDBClusterRequest} } const opPurchaseReservedDBInstancesOffering = "PurchaseReservedDBInstancesOffering" @@ -5068,6 +5075,7 @@ const opPurchaseReservedDBInstancesOffering = "PurchaseReservedDBInstancesOfferi type PurchaseReservedDBInstancesOfferingRequest struct { *aws.Request Input *PurchaseReservedDBInstancesOfferingInput + Copy func(*PurchaseReservedDBInstancesOfferingInput) PurchaseReservedDBInstancesOfferingRequest } // Send marshals and sends the PurchaseReservedDBInstancesOffering API request. @@ -5108,7 +5116,7 @@ func (c *RDS) PurchaseReservedDBInstancesOfferingRequest(input *PurchaseReserved req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PurchaseReservedDBInstancesOfferingRequest{Request: req, Input: input} + return PurchaseReservedDBInstancesOfferingRequest{Request: req, Input: input, Copy: c.PurchaseReservedDBInstancesOfferingRequest} } const opRebootDBInstance = "RebootDBInstance" @@ -5117,6 +5125,7 @@ const opRebootDBInstance = "RebootDBInstance" type RebootDBInstanceRequest struct { *aws.Request Input *RebootDBInstanceInput + Copy func(*RebootDBInstanceInput) RebootDBInstanceRequest } // Send marshals and sends the RebootDBInstance API request. @@ -5166,7 +5175,7 @@ func (c *RDS) RebootDBInstanceRequest(input *RebootDBInstanceInput) RebootDBInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RebootDBInstanceRequest{Request: req, Input: input} + return RebootDBInstanceRequest{Request: req, Input: input, Copy: c.RebootDBInstanceRequest} } const opRemoveRoleFromDBCluster = "RemoveRoleFromDBCluster" @@ -5175,6 +5184,7 @@ const opRemoveRoleFromDBCluster = "RemoveRoleFromDBCluster" type RemoveRoleFromDBClusterRequest struct { *aws.Request Input *RemoveRoleFromDBClusterInput + Copy func(*RemoveRoleFromDBClusterInput) RemoveRoleFromDBClusterRequest } // Send marshals and sends the RemoveRoleFromDBCluster API request. @@ -5219,7 +5229,7 @@ func (c *RDS) RemoveRoleFromDBClusterRequest(input *RemoveRoleFromDBClusterInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveRoleFromDBClusterRequest{Request: req, Input: input} + return RemoveRoleFromDBClusterRequest{Request: req, Input: input, Copy: c.RemoveRoleFromDBClusterRequest} } const opRemoveSourceIdentifierFromSubscription = "RemoveSourceIdentifierFromSubscription" @@ -5228,6 +5238,7 @@ const opRemoveSourceIdentifierFromSubscription = "RemoveSourceIdentifierFromSubs type RemoveSourceIdentifierFromSubscriptionRequest struct { *aws.Request Input *RemoveSourceIdentifierFromSubscriptionInput + Copy func(*RemoveSourceIdentifierFromSubscriptionInput) RemoveSourceIdentifierFromSubscriptionRequest } // Send marshals and sends the RemoveSourceIdentifierFromSubscription API request. @@ -5268,7 +5279,7 @@ func (c *RDS) RemoveSourceIdentifierFromSubscriptionRequest(input *RemoveSourceI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveSourceIdentifierFromSubscriptionRequest{Request: req, Input: input} + return RemoveSourceIdentifierFromSubscriptionRequest{Request: req, Input: input, Copy: c.RemoveSourceIdentifierFromSubscriptionRequest} } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -5277,6 +5288,7 @@ const opRemoveTagsFromResource = "RemoveTagsFromResource" type RemoveTagsFromResourceRequest struct { *aws.Request Input *RemoveTagsFromResourceInput + Copy func(*RemoveTagsFromResourceInput) RemoveTagsFromResourceRequest } // Send marshals and sends the RemoveTagsFromResource API request. @@ -5322,7 +5334,7 @@ func (c *RDS) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromResourceRequest{Request: req, Input: input} + return RemoveTagsFromResourceRequest{Request: req, Input: input, Copy: c.RemoveTagsFromResourceRequest} } const opResetDBClusterParameterGroup = "ResetDBClusterParameterGroup" @@ -5331,6 +5343,7 @@ const opResetDBClusterParameterGroup = "ResetDBClusterParameterGroup" type ResetDBClusterParameterGroupRequest struct { *aws.Request Input *ResetDBClusterParameterGroupInput + Copy func(*ResetDBClusterParameterGroupInput) ResetDBClusterParameterGroupRequest } // Send marshals and sends the ResetDBClusterParameterGroup API request. @@ -5383,7 +5396,7 @@ func (c *RDS) ResetDBClusterParameterGroupRequest(input *ResetDBClusterParameter req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetDBClusterParameterGroupRequest{Request: req, Input: input} + return ResetDBClusterParameterGroupRequest{Request: req, Input: input, Copy: c.ResetDBClusterParameterGroupRequest} } const opResetDBParameterGroup = "ResetDBParameterGroup" @@ -5392,6 +5405,7 @@ const opResetDBParameterGroup = "ResetDBParameterGroup" type ResetDBParameterGroupRequest struct { *aws.Request Input *ResetDBParameterGroupInput + Copy func(*ResetDBParameterGroupInput) ResetDBParameterGroupRequest } // Send marshals and sends the ResetDBParameterGroup API request. @@ -5438,7 +5452,7 @@ func (c *RDS) ResetDBParameterGroupRequest(input *ResetDBParameterGroupInput) Re req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetDBParameterGroupRequest{Request: req, Input: input} + return ResetDBParameterGroupRequest{Request: req, Input: input, Copy: c.ResetDBParameterGroupRequest} } const opRestoreDBClusterFromS3 = "RestoreDBClusterFromS3" @@ -5447,6 +5461,7 @@ const opRestoreDBClusterFromS3 = "RestoreDBClusterFromS3" type RestoreDBClusterFromS3Request struct { *aws.Request Input *RestoreDBClusterFromS3Input + Copy func(*RestoreDBClusterFromS3Input) RestoreDBClusterFromS3Request } // Send marshals and sends the RestoreDBClusterFromS3 API request. @@ -5490,7 +5505,7 @@ func (c *RDS) RestoreDBClusterFromS3Request(input *RestoreDBClusterFromS3Input) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreDBClusterFromS3Request{Request: req, Input: input} + return RestoreDBClusterFromS3Request{Request: req, Input: input, Copy: c.RestoreDBClusterFromS3Request} } const opRestoreDBClusterFromSnapshot = "RestoreDBClusterFromSnapshot" @@ -5499,6 +5514,7 @@ const opRestoreDBClusterFromSnapshot = "RestoreDBClusterFromSnapshot" type RestoreDBClusterFromSnapshotRequest struct { *aws.Request Input *RestoreDBClusterFromSnapshotInput + Copy func(*RestoreDBClusterFromSnapshotInput) RestoreDBClusterFromSnapshotRequest } // Send marshals and sends the RestoreDBClusterFromSnapshot API request. @@ -5550,7 +5566,7 @@ func (c *RDS) RestoreDBClusterFromSnapshotRequest(input *RestoreDBClusterFromSna req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreDBClusterFromSnapshotRequest{Request: req, Input: input} + return RestoreDBClusterFromSnapshotRequest{Request: req, Input: input, Copy: c.RestoreDBClusterFromSnapshotRequest} } const opRestoreDBClusterToPointInTime = "RestoreDBClusterToPointInTime" @@ -5559,6 +5575,7 @@ const opRestoreDBClusterToPointInTime = "RestoreDBClusterToPointInTime" type RestoreDBClusterToPointInTimeRequest struct { *aws.Request Input *RestoreDBClusterToPointInTimeInput + Copy func(*RestoreDBClusterToPointInTimeInput) RestoreDBClusterToPointInTimeRequest } // Send marshals and sends the RestoreDBClusterToPointInTime API request. @@ -5613,7 +5630,7 @@ func (c *RDS) RestoreDBClusterToPointInTimeRequest(input *RestoreDBClusterToPoin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreDBClusterToPointInTimeRequest{Request: req, Input: input} + return RestoreDBClusterToPointInTimeRequest{Request: req, Input: input, Copy: c.RestoreDBClusterToPointInTimeRequest} } const opRestoreDBInstanceFromDBSnapshot = "RestoreDBInstanceFromDBSnapshot" @@ -5622,6 +5639,7 @@ const opRestoreDBInstanceFromDBSnapshot = "RestoreDBInstanceFromDBSnapshot" type RestoreDBInstanceFromDBSnapshotRequest struct { *aws.Request Input *RestoreDBInstanceFromDBSnapshotInput + Copy func(*RestoreDBInstanceFromDBSnapshotInput) RestoreDBInstanceFromDBSnapshotRequest } // Send marshals and sends the RestoreDBInstanceFromDBSnapshot API request. @@ -5680,7 +5698,7 @@ func (c *RDS) RestoreDBInstanceFromDBSnapshotRequest(input *RestoreDBInstanceFro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreDBInstanceFromDBSnapshotRequest{Request: req, Input: input} + return RestoreDBInstanceFromDBSnapshotRequest{Request: req, Input: input, Copy: c.RestoreDBInstanceFromDBSnapshotRequest} } const opRestoreDBInstanceFromS3 = "RestoreDBInstanceFromS3" @@ -5689,6 +5707,7 @@ const opRestoreDBInstanceFromS3 = "RestoreDBInstanceFromS3" type RestoreDBInstanceFromS3Request struct { *aws.Request Input *RestoreDBInstanceFromS3Input + Copy func(*RestoreDBInstanceFromS3Input) RestoreDBInstanceFromS3Request } // Send marshals and sends the RestoreDBInstanceFromS3 API request. @@ -5734,7 +5753,7 @@ func (c *RDS) RestoreDBInstanceFromS3Request(input *RestoreDBInstanceFromS3Input req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreDBInstanceFromS3Request{Request: req, Input: input} + return RestoreDBInstanceFromS3Request{Request: req, Input: input, Copy: c.RestoreDBInstanceFromS3Request} } const opRestoreDBInstanceToPointInTime = "RestoreDBInstanceToPointInTime" @@ -5743,6 +5762,7 @@ const opRestoreDBInstanceToPointInTime = "RestoreDBInstanceToPointInTime" type RestoreDBInstanceToPointInTimeRequest struct { *aws.Request Input *RestoreDBInstanceToPointInTimeInput + Copy func(*RestoreDBInstanceToPointInTimeInput) RestoreDBInstanceToPointInTimeRequest } // Send marshals and sends the RestoreDBInstanceToPointInTime API request. @@ -5794,7 +5814,7 @@ func (c *RDS) RestoreDBInstanceToPointInTimeRequest(input *RestoreDBInstanceToPo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreDBInstanceToPointInTimeRequest{Request: req, Input: input} + return RestoreDBInstanceToPointInTimeRequest{Request: req, Input: input, Copy: c.RestoreDBInstanceToPointInTimeRequest} } const opRevokeDBSecurityGroupIngress = "RevokeDBSecurityGroupIngress" @@ -5803,6 +5823,7 @@ const opRevokeDBSecurityGroupIngress = "RevokeDBSecurityGroupIngress" type RevokeDBSecurityGroupIngressRequest struct { *aws.Request Input *RevokeDBSecurityGroupIngressInput + Copy func(*RevokeDBSecurityGroupIngressInput) RevokeDBSecurityGroupIngressRequest } // Send marshals and sends the RevokeDBSecurityGroupIngress API request. @@ -5846,7 +5867,7 @@ func (c *RDS) RevokeDBSecurityGroupIngressRequest(input *RevokeDBSecurityGroupIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RevokeDBSecurityGroupIngressRequest{Request: req, Input: input} + return RevokeDBSecurityGroupIngressRequest{Request: req, Input: input, Copy: c.RevokeDBSecurityGroupIngressRequest} } const opStartDBInstance = "StartDBInstance" @@ -5855,6 +5876,7 @@ const opStartDBInstance = "StartDBInstance" type StartDBInstanceRequest struct { *aws.Request Input *StartDBInstanceInput + Copy func(*StartDBInstanceInput) StartDBInstanceRequest } // Send marshals and sends the StartDBInstance API request. @@ -5899,7 +5921,7 @@ func (c *RDS) StartDBInstanceRequest(input *StartDBInstanceInput) StartDBInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartDBInstanceRequest{Request: req, Input: input} + return StartDBInstanceRequest{Request: req, Input: input, Copy: c.StartDBInstanceRequest} } const opStopDBInstance = "StopDBInstance" @@ -5908,6 +5930,7 @@ const opStopDBInstance = "StopDBInstance" type StopDBInstanceRequest struct { *aws.Request Input *StopDBInstanceInput + Copy func(*StopDBInstanceInput) StopDBInstanceRequest } // Send marshals and sends the StopDBInstance API request. @@ -5954,7 +5977,7 @@ func (c *RDS) StopDBInstanceRequest(input *StopDBInstanceInput) StopDBInstanceRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopDBInstanceRequest{Request: req, Input: input} + return StopDBInstanceRequest{Request: req, Input: input, Copy: c.StopDBInstanceRequest} } // Describes a quota for an AWS account, for example, the number of DB instances diff --git a/service/rds/rdsiface/interface.go b/service/rds/rdsiface/interface.go index cc0c9540980..399dc177617 100644 --- a/service/rds/rdsiface/interface.go +++ b/service/rds/rdsiface/interface.go @@ -141,101 +141,50 @@ type RDSAPI interface { DescribeDBEngineVersionsRequest(*rds.DescribeDBEngineVersionsInput) rds.DescribeDBEngineVersionsRequest - DescribeDBEngineVersionsPages(*rds.DescribeDBEngineVersionsInput, func(*rds.DescribeDBEngineVersionsOutput, bool) bool) error - DescribeDBEngineVersionsPagesWithContext(aws.Context, *rds.DescribeDBEngineVersionsInput, func(*rds.DescribeDBEngineVersionsOutput, bool) bool, ...aws.Option) error - DescribeDBInstancesRequest(*rds.DescribeDBInstancesInput) rds.DescribeDBInstancesRequest - DescribeDBInstancesPages(*rds.DescribeDBInstancesInput, func(*rds.DescribeDBInstancesOutput, bool) bool) error - DescribeDBInstancesPagesWithContext(aws.Context, *rds.DescribeDBInstancesInput, func(*rds.DescribeDBInstancesOutput, bool) bool, ...aws.Option) error - DescribeDBLogFilesRequest(*rds.DescribeDBLogFilesInput) rds.DescribeDBLogFilesRequest - DescribeDBLogFilesPages(*rds.DescribeDBLogFilesInput, func(*rds.DescribeDBLogFilesOutput, bool) bool) error - DescribeDBLogFilesPagesWithContext(aws.Context, *rds.DescribeDBLogFilesInput, func(*rds.DescribeDBLogFilesOutput, bool) bool, ...aws.Option) error - DescribeDBParameterGroupsRequest(*rds.DescribeDBParameterGroupsInput) rds.DescribeDBParameterGroupsRequest - DescribeDBParameterGroupsPages(*rds.DescribeDBParameterGroupsInput, func(*rds.DescribeDBParameterGroupsOutput, bool) bool) error - DescribeDBParameterGroupsPagesWithContext(aws.Context, *rds.DescribeDBParameterGroupsInput, func(*rds.DescribeDBParameterGroupsOutput, bool) bool, ...aws.Option) error - DescribeDBParametersRequest(*rds.DescribeDBParametersInput) rds.DescribeDBParametersRequest - DescribeDBParametersPages(*rds.DescribeDBParametersInput, func(*rds.DescribeDBParametersOutput, bool) bool) error - DescribeDBParametersPagesWithContext(aws.Context, *rds.DescribeDBParametersInput, func(*rds.DescribeDBParametersOutput, bool) bool, ...aws.Option) error - DescribeDBSecurityGroupsRequest(*rds.DescribeDBSecurityGroupsInput) rds.DescribeDBSecurityGroupsRequest - DescribeDBSecurityGroupsPages(*rds.DescribeDBSecurityGroupsInput, func(*rds.DescribeDBSecurityGroupsOutput, bool) bool) error - DescribeDBSecurityGroupsPagesWithContext(aws.Context, *rds.DescribeDBSecurityGroupsInput, func(*rds.DescribeDBSecurityGroupsOutput, bool) bool, ...aws.Option) error - DescribeDBSnapshotAttributesRequest(*rds.DescribeDBSnapshotAttributesInput) rds.DescribeDBSnapshotAttributesRequest DescribeDBSnapshotsRequest(*rds.DescribeDBSnapshotsInput) rds.DescribeDBSnapshotsRequest - DescribeDBSnapshotsPages(*rds.DescribeDBSnapshotsInput, func(*rds.DescribeDBSnapshotsOutput, bool) bool) error - DescribeDBSnapshotsPagesWithContext(aws.Context, *rds.DescribeDBSnapshotsInput, func(*rds.DescribeDBSnapshotsOutput, bool) bool, ...aws.Option) error - DescribeDBSubnetGroupsRequest(*rds.DescribeDBSubnetGroupsInput) rds.DescribeDBSubnetGroupsRequest - DescribeDBSubnetGroupsPages(*rds.DescribeDBSubnetGroupsInput, func(*rds.DescribeDBSubnetGroupsOutput, bool) bool) error - DescribeDBSubnetGroupsPagesWithContext(aws.Context, *rds.DescribeDBSubnetGroupsInput, func(*rds.DescribeDBSubnetGroupsOutput, bool) bool, ...aws.Option) error - DescribeEngineDefaultClusterParametersRequest(*rds.DescribeEngineDefaultClusterParametersInput) rds.DescribeEngineDefaultClusterParametersRequest DescribeEngineDefaultParametersRequest(*rds.DescribeEngineDefaultParametersInput) rds.DescribeEngineDefaultParametersRequest - DescribeEngineDefaultParametersPages(*rds.DescribeEngineDefaultParametersInput, func(*rds.DescribeEngineDefaultParametersOutput, bool) bool) error - DescribeEngineDefaultParametersPagesWithContext(aws.Context, *rds.DescribeEngineDefaultParametersInput, func(*rds.DescribeEngineDefaultParametersOutput, bool) bool, ...aws.Option) error - DescribeEventCategoriesRequest(*rds.DescribeEventCategoriesInput) rds.DescribeEventCategoriesRequest DescribeEventSubscriptionsRequest(*rds.DescribeEventSubscriptionsInput) rds.DescribeEventSubscriptionsRequest - DescribeEventSubscriptionsPages(*rds.DescribeEventSubscriptionsInput, func(*rds.DescribeEventSubscriptionsOutput, bool) bool) error - DescribeEventSubscriptionsPagesWithContext(aws.Context, *rds.DescribeEventSubscriptionsInput, func(*rds.DescribeEventSubscriptionsOutput, bool) bool, ...aws.Option) error - DescribeEventsRequest(*rds.DescribeEventsInput) rds.DescribeEventsRequest - DescribeEventsPages(*rds.DescribeEventsInput, func(*rds.DescribeEventsOutput, bool) bool) error - DescribeEventsPagesWithContext(aws.Context, *rds.DescribeEventsInput, func(*rds.DescribeEventsOutput, bool) bool, ...aws.Option) error - DescribeOptionGroupOptionsRequest(*rds.DescribeOptionGroupOptionsInput) rds.DescribeOptionGroupOptionsRequest - DescribeOptionGroupOptionsPages(*rds.DescribeOptionGroupOptionsInput, func(*rds.DescribeOptionGroupOptionsOutput, bool) bool) error - DescribeOptionGroupOptionsPagesWithContext(aws.Context, *rds.DescribeOptionGroupOptionsInput, func(*rds.DescribeOptionGroupOptionsOutput, bool) bool, ...aws.Option) error - DescribeOptionGroupsRequest(*rds.DescribeOptionGroupsInput) rds.DescribeOptionGroupsRequest - DescribeOptionGroupsPages(*rds.DescribeOptionGroupsInput, func(*rds.DescribeOptionGroupsOutput, bool) bool) error - DescribeOptionGroupsPagesWithContext(aws.Context, *rds.DescribeOptionGroupsInput, func(*rds.DescribeOptionGroupsOutput, bool) bool, ...aws.Option) error - DescribeOrderableDBInstanceOptionsRequest(*rds.DescribeOrderableDBInstanceOptionsInput) rds.DescribeOrderableDBInstanceOptionsRequest - DescribeOrderableDBInstanceOptionsPages(*rds.DescribeOrderableDBInstanceOptionsInput, func(*rds.DescribeOrderableDBInstanceOptionsOutput, bool) bool) error - DescribeOrderableDBInstanceOptionsPagesWithContext(aws.Context, *rds.DescribeOrderableDBInstanceOptionsInput, func(*rds.DescribeOrderableDBInstanceOptionsOutput, bool) bool, ...aws.Option) error - DescribePendingMaintenanceActionsRequest(*rds.DescribePendingMaintenanceActionsInput) rds.DescribePendingMaintenanceActionsRequest DescribeReservedDBInstancesRequest(*rds.DescribeReservedDBInstancesInput) rds.DescribeReservedDBInstancesRequest - DescribeReservedDBInstancesPages(*rds.DescribeReservedDBInstancesInput, func(*rds.DescribeReservedDBInstancesOutput, bool) bool) error - DescribeReservedDBInstancesPagesWithContext(aws.Context, *rds.DescribeReservedDBInstancesInput, func(*rds.DescribeReservedDBInstancesOutput, bool) bool, ...aws.Option) error - DescribeReservedDBInstancesOfferingsRequest(*rds.DescribeReservedDBInstancesOfferingsInput) rds.DescribeReservedDBInstancesOfferingsRequest - DescribeReservedDBInstancesOfferingsPages(*rds.DescribeReservedDBInstancesOfferingsInput, func(*rds.DescribeReservedDBInstancesOfferingsOutput, bool) bool) error - DescribeReservedDBInstancesOfferingsPagesWithContext(aws.Context, *rds.DescribeReservedDBInstancesOfferingsInput, func(*rds.DescribeReservedDBInstancesOfferingsOutput, bool) bool, ...aws.Option) error - DescribeSourceRegionsRequest(*rds.DescribeSourceRegionsInput) rds.DescribeSourceRegionsRequest DescribeValidDBInstanceModificationsRequest(*rds.DescribeValidDBInstanceModificationsInput) rds.DescribeValidDBInstanceModificationsRequest DownloadDBLogFilePortionRequest(*rds.DownloadDBLogFilePortionInput) rds.DownloadDBLogFilePortionRequest - DownloadDBLogFilePortionPages(*rds.DownloadDBLogFilePortionInput, func(*rds.DownloadDBLogFilePortionOutput, bool) bool) error - DownloadDBLogFilePortionPagesWithContext(aws.Context, *rds.DownloadDBLogFilePortionInput, func(*rds.DownloadDBLogFilePortionOutput, bool) bool, ...aws.Option) error - FailoverDBClusterRequest(*rds.FailoverDBClusterInput) rds.FailoverDBClusterRequest ListTagsForResourceRequest(*rds.ListTagsForResourceInput) rds.ListTagsForResourceRequest diff --git a/service/redshift/api.go b/service/redshift/api.go index cff2e7c9075..9850180e6e9 100644 --- a/service/redshift/api.go +++ b/service/redshift/api.go @@ -17,6 +17,7 @@ const opAuthorizeClusterSecurityGroupIngress = "AuthorizeClusterSecurityGroupIng type AuthorizeClusterSecurityGroupIngressRequest struct { *aws.Request Input *AuthorizeClusterSecurityGroupIngressInput + Copy func(*AuthorizeClusterSecurityGroupIngressInput) AuthorizeClusterSecurityGroupIngressRequest } // Send marshals and sends the AuthorizeClusterSecurityGroupIngress API request. @@ -76,7 +77,7 @@ func (c *Redshift) AuthorizeClusterSecurityGroupIngressRequest(input *AuthorizeC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AuthorizeClusterSecurityGroupIngressRequest{Request: req, Input: input} + return AuthorizeClusterSecurityGroupIngressRequest{Request: req, Input: input, Copy: c.AuthorizeClusterSecurityGroupIngressRequest} } const opAuthorizeSnapshotAccess = "AuthorizeSnapshotAccess" @@ -85,6 +86,7 @@ const opAuthorizeSnapshotAccess = "AuthorizeSnapshotAccess" type AuthorizeSnapshotAccessRequest struct { *aws.Request Input *AuthorizeSnapshotAccessInput + Copy func(*AuthorizeSnapshotAccessInput) AuthorizeSnapshotAccessRequest } // Send marshals and sends the AuthorizeSnapshotAccess API request. @@ -129,7 +131,7 @@ func (c *Redshift) AuthorizeSnapshotAccessRequest(input *AuthorizeSnapshotAccess req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AuthorizeSnapshotAccessRequest{Request: req, Input: input} + return AuthorizeSnapshotAccessRequest{Request: req, Input: input, Copy: c.AuthorizeSnapshotAccessRequest} } const opCopyClusterSnapshot = "CopyClusterSnapshot" @@ -138,6 +140,7 @@ const opCopyClusterSnapshot = "CopyClusterSnapshot" type CopyClusterSnapshotRequest struct { *aws.Request Input *CopyClusterSnapshotInput + Copy func(*CopyClusterSnapshotInput) CopyClusterSnapshotRequest } // Send marshals and sends the CopyClusterSnapshot API request. @@ -190,7 +193,7 @@ func (c *Redshift) CopyClusterSnapshotRequest(input *CopyClusterSnapshotInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyClusterSnapshotRequest{Request: req, Input: input} + return CopyClusterSnapshotRequest{Request: req, Input: input, Copy: c.CopyClusterSnapshotRequest} } const opCreateCluster = "CreateCluster" @@ -199,6 +202,7 @@ const opCreateCluster = "CreateCluster" type CreateClusterRequest struct { *aws.Request Input *CreateClusterInput + Copy func(*CreateClusterInput) CreateClusterRequest } // Send marshals and sends the CreateCluster API request. @@ -245,7 +249,7 @@ func (c *Redshift) CreateClusterRequest(input *CreateClusterInput) CreateCluster req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClusterRequest{Request: req, Input: input} + return CreateClusterRequest{Request: req, Input: input, Copy: c.CreateClusterRequest} } const opCreateClusterParameterGroup = "CreateClusterParameterGroup" @@ -254,6 +258,7 @@ const opCreateClusterParameterGroup = "CreateClusterParameterGroup" type CreateClusterParameterGroupRequest struct { *aws.Request Input *CreateClusterParameterGroupInput + Copy func(*CreateClusterParameterGroupInput) CreateClusterParameterGroupRequest } // Send marshals and sends the CreateClusterParameterGroup API request. @@ -304,7 +309,7 @@ func (c *Redshift) CreateClusterParameterGroupRequest(input *CreateClusterParame req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClusterParameterGroupRequest{Request: req, Input: input} + return CreateClusterParameterGroupRequest{Request: req, Input: input, Copy: c.CreateClusterParameterGroupRequest} } const opCreateClusterSecurityGroup = "CreateClusterSecurityGroup" @@ -313,6 +318,7 @@ const opCreateClusterSecurityGroup = "CreateClusterSecurityGroup" type CreateClusterSecurityGroupRequest struct { *aws.Request Input *CreateClusterSecurityGroupInput + Copy func(*CreateClusterSecurityGroupInput) CreateClusterSecurityGroupRequest } // Send marshals and sends the CreateClusterSecurityGroup API request. @@ -358,7 +364,7 @@ func (c *Redshift) CreateClusterSecurityGroupRequest(input *CreateClusterSecurit req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClusterSecurityGroupRequest{Request: req, Input: input} + return CreateClusterSecurityGroupRequest{Request: req, Input: input, Copy: c.CreateClusterSecurityGroupRequest} } const opCreateClusterSnapshot = "CreateClusterSnapshot" @@ -367,6 +373,7 @@ const opCreateClusterSnapshot = "CreateClusterSnapshot" type CreateClusterSnapshotRequest struct { *aws.Request Input *CreateClusterSnapshotInput + Copy func(*CreateClusterSnapshotInput) CreateClusterSnapshotRequest } // Send marshals and sends the CreateClusterSnapshot API request. @@ -412,7 +419,7 @@ func (c *Redshift) CreateClusterSnapshotRequest(input *CreateClusterSnapshotInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClusterSnapshotRequest{Request: req, Input: input} + return CreateClusterSnapshotRequest{Request: req, Input: input, Copy: c.CreateClusterSnapshotRequest} } const opCreateClusterSubnetGroup = "CreateClusterSubnetGroup" @@ -421,6 +428,7 @@ const opCreateClusterSubnetGroup = "CreateClusterSubnetGroup" type CreateClusterSubnetGroupRequest struct { *aws.Request Input *CreateClusterSubnetGroupInput + Copy func(*CreateClusterSubnetGroupInput) CreateClusterSubnetGroupRequest } // Send marshals and sends the CreateClusterSubnetGroup API request. @@ -467,7 +475,7 @@ func (c *Redshift) CreateClusterSubnetGroupRequest(input *CreateClusterSubnetGro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClusterSubnetGroupRequest{Request: req, Input: input} + return CreateClusterSubnetGroupRequest{Request: req, Input: input, Copy: c.CreateClusterSubnetGroupRequest} } const opCreateEventSubscription = "CreateEventSubscription" @@ -476,6 +484,7 @@ const opCreateEventSubscription = "CreateEventSubscription" type CreateEventSubscriptionRequest struct { *aws.Request Input *CreateEventSubscriptionInput + Copy func(*CreateEventSubscriptionInput) CreateEventSubscriptionRequest } // Send marshals and sends the CreateEventSubscription API request. @@ -537,7 +546,7 @@ func (c *Redshift) CreateEventSubscriptionRequest(input *CreateEventSubscription req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEventSubscriptionRequest{Request: req, Input: input} + return CreateEventSubscriptionRequest{Request: req, Input: input, Copy: c.CreateEventSubscriptionRequest} } const opCreateHsmClientCertificate = "CreateHsmClientCertificate" @@ -546,6 +555,7 @@ const opCreateHsmClientCertificate = "CreateHsmClientCertificate" type CreateHsmClientCertificateRequest struct { *aws.Request Input *CreateHsmClientCertificateInput + Copy func(*CreateHsmClientCertificateInput) CreateHsmClientCertificateRequest } // Send marshals and sends the CreateHsmClientCertificate API request. @@ -594,7 +604,7 @@ func (c *Redshift) CreateHsmClientCertificateRequest(input *CreateHsmClientCerti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHsmClientCertificateRequest{Request: req, Input: input} + return CreateHsmClientCertificateRequest{Request: req, Input: input, Copy: c.CreateHsmClientCertificateRequest} } const opCreateHsmConfiguration = "CreateHsmConfiguration" @@ -603,6 +613,7 @@ const opCreateHsmConfiguration = "CreateHsmConfiguration" type CreateHsmConfigurationRequest struct { *aws.Request Input *CreateHsmConfigurationInput + Copy func(*CreateHsmConfigurationInput) CreateHsmConfigurationRequest } // Send marshals and sends the CreateHsmConfiguration API request. @@ -652,7 +663,7 @@ func (c *Redshift) CreateHsmConfigurationRequest(input *CreateHsmConfigurationIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHsmConfigurationRequest{Request: req, Input: input} + return CreateHsmConfigurationRequest{Request: req, Input: input, Copy: c.CreateHsmConfigurationRequest} } const opCreateSnapshotCopyGrant = "CreateSnapshotCopyGrant" @@ -661,6 +672,7 @@ const opCreateSnapshotCopyGrant = "CreateSnapshotCopyGrant" type CreateSnapshotCopyGrantRequest struct { *aws.Request Input *CreateSnapshotCopyGrantInput + Copy func(*CreateSnapshotCopyGrantInput) CreateSnapshotCopyGrantRequest } // Send marshals and sends the CreateSnapshotCopyGrant API request. @@ -707,7 +719,7 @@ func (c *Redshift) CreateSnapshotCopyGrantRequest(input *CreateSnapshotCopyGrant req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSnapshotCopyGrantRequest{Request: req, Input: input} + return CreateSnapshotCopyGrantRequest{Request: req, Input: input, Copy: c.CreateSnapshotCopyGrantRequest} } const opCreateTags = "CreateTags" @@ -716,6 +728,7 @@ const opCreateTags = "CreateTags" type CreateTagsRequest struct { *aws.Request Input *CreateTagsInput + Copy func(*CreateTagsInput) CreateTagsRequest } // Send marshals and sends the CreateTags API request. @@ -764,7 +777,7 @@ func (c *Redshift) CreateTagsRequest(input *CreateTagsInput) CreateTagsRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateTagsRequest{Request: req, Input: input} + return CreateTagsRequest{Request: req, Input: input, Copy: c.CreateTagsRequest} } const opDeleteCluster = "DeleteCluster" @@ -773,6 +786,7 @@ const opDeleteCluster = "DeleteCluster" type DeleteClusterRequest struct { *aws.Request Input *DeleteClusterInput + Copy func(*DeleteClusterInput) DeleteClusterRequest } // Send marshals and sends the DeleteCluster API request. @@ -829,7 +843,7 @@ func (c *Redshift) DeleteClusterRequest(input *DeleteClusterInput) DeleteCluster req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteClusterRequest{Request: req, Input: input} + return DeleteClusterRequest{Request: req, Input: input, Copy: c.DeleteClusterRequest} } const opDeleteClusterParameterGroup = "DeleteClusterParameterGroup" @@ -838,6 +852,7 @@ const opDeleteClusterParameterGroup = "DeleteClusterParameterGroup" type DeleteClusterParameterGroupRequest struct { *aws.Request Input *DeleteClusterParameterGroupInput + Copy func(*DeleteClusterParameterGroupInput) DeleteClusterParameterGroupRequest } // Send marshals and sends the DeleteClusterParameterGroup API request. @@ -882,7 +897,7 @@ func (c *Redshift) DeleteClusterParameterGroupRequest(input *DeleteClusterParame req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteClusterParameterGroupRequest{Request: req, Input: input} + return DeleteClusterParameterGroupRequest{Request: req, Input: input, Copy: c.DeleteClusterParameterGroupRequest} } const opDeleteClusterSecurityGroup = "DeleteClusterSecurityGroup" @@ -891,6 +906,7 @@ const opDeleteClusterSecurityGroup = "DeleteClusterSecurityGroup" type DeleteClusterSecurityGroupRequest struct { *aws.Request Input *DeleteClusterSecurityGroupInput + Copy func(*DeleteClusterSecurityGroupInput) DeleteClusterSecurityGroupRequest } // Send marshals and sends the DeleteClusterSecurityGroup API request. @@ -940,7 +956,7 @@ func (c *Redshift) DeleteClusterSecurityGroupRequest(input *DeleteClusterSecurit req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteClusterSecurityGroupRequest{Request: req, Input: input} + return DeleteClusterSecurityGroupRequest{Request: req, Input: input, Copy: c.DeleteClusterSecurityGroupRequest} } const opDeleteClusterSnapshot = "DeleteClusterSnapshot" @@ -949,6 +965,7 @@ const opDeleteClusterSnapshot = "DeleteClusterSnapshot" type DeleteClusterSnapshotRequest struct { *aws.Request Input *DeleteClusterSnapshotInput + Copy func(*DeleteClusterSnapshotInput) DeleteClusterSnapshotRequest } // Send marshals and sends the DeleteClusterSnapshot API request. @@ -996,7 +1013,7 @@ func (c *Redshift) DeleteClusterSnapshotRequest(input *DeleteClusterSnapshotInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteClusterSnapshotRequest{Request: req, Input: input} + return DeleteClusterSnapshotRequest{Request: req, Input: input, Copy: c.DeleteClusterSnapshotRequest} } const opDeleteClusterSubnetGroup = "DeleteClusterSubnetGroup" @@ -1005,6 +1022,7 @@ const opDeleteClusterSubnetGroup = "DeleteClusterSubnetGroup" type DeleteClusterSubnetGroupRequest struct { *aws.Request Input *DeleteClusterSubnetGroupInput + Copy func(*DeleteClusterSubnetGroupInput) DeleteClusterSubnetGroupRequest } // Send marshals and sends the DeleteClusterSubnetGroup API request. @@ -1047,7 +1065,7 @@ func (c *Redshift) DeleteClusterSubnetGroupRequest(input *DeleteClusterSubnetGro req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteClusterSubnetGroupRequest{Request: req, Input: input} + return DeleteClusterSubnetGroupRequest{Request: req, Input: input, Copy: c.DeleteClusterSubnetGroupRequest} } const opDeleteEventSubscription = "DeleteEventSubscription" @@ -1056,6 +1074,7 @@ const opDeleteEventSubscription = "DeleteEventSubscription" type DeleteEventSubscriptionRequest struct { *aws.Request Input *DeleteEventSubscriptionInput + Copy func(*DeleteEventSubscriptionInput) DeleteEventSubscriptionRequest } // Send marshals and sends the DeleteEventSubscription API request. @@ -1098,7 +1117,7 @@ func (c *Redshift) DeleteEventSubscriptionRequest(input *DeleteEventSubscription req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteEventSubscriptionRequest{Request: req, Input: input} + return DeleteEventSubscriptionRequest{Request: req, Input: input, Copy: c.DeleteEventSubscriptionRequest} } const opDeleteHsmClientCertificate = "DeleteHsmClientCertificate" @@ -1107,6 +1126,7 @@ const opDeleteHsmClientCertificate = "DeleteHsmClientCertificate" type DeleteHsmClientCertificateRequest struct { *aws.Request Input *DeleteHsmClientCertificateInput + Copy func(*DeleteHsmClientCertificateInput) DeleteHsmClientCertificateRequest } // Send marshals and sends the DeleteHsmClientCertificate API request. @@ -1149,7 +1169,7 @@ func (c *Redshift) DeleteHsmClientCertificateRequest(input *DeleteHsmClientCerti req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteHsmClientCertificateRequest{Request: req, Input: input} + return DeleteHsmClientCertificateRequest{Request: req, Input: input, Copy: c.DeleteHsmClientCertificateRequest} } const opDeleteHsmConfiguration = "DeleteHsmConfiguration" @@ -1158,6 +1178,7 @@ const opDeleteHsmConfiguration = "DeleteHsmConfiguration" type DeleteHsmConfigurationRequest struct { *aws.Request Input *DeleteHsmConfigurationInput + Copy func(*DeleteHsmConfigurationInput) DeleteHsmConfigurationRequest } // Send marshals and sends the DeleteHsmConfiguration API request. @@ -1200,7 +1221,7 @@ func (c *Redshift) DeleteHsmConfigurationRequest(input *DeleteHsmConfigurationIn req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteHsmConfigurationRequest{Request: req, Input: input} + return DeleteHsmConfigurationRequest{Request: req, Input: input, Copy: c.DeleteHsmConfigurationRequest} } const opDeleteSnapshotCopyGrant = "DeleteSnapshotCopyGrant" @@ -1209,6 +1230,7 @@ const opDeleteSnapshotCopyGrant = "DeleteSnapshotCopyGrant" type DeleteSnapshotCopyGrantRequest struct { *aws.Request Input *DeleteSnapshotCopyGrantInput + Copy func(*DeleteSnapshotCopyGrantInput) DeleteSnapshotCopyGrantRequest } // Send marshals and sends the DeleteSnapshotCopyGrant API request. @@ -1251,7 +1273,7 @@ func (c *Redshift) DeleteSnapshotCopyGrantRequest(input *DeleteSnapshotCopyGrant req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteSnapshotCopyGrantRequest{Request: req, Input: input} + return DeleteSnapshotCopyGrantRequest{Request: req, Input: input, Copy: c.DeleteSnapshotCopyGrantRequest} } const opDeleteTags = "DeleteTags" @@ -1260,6 +1282,7 @@ const opDeleteTags = "DeleteTags" type DeleteTagsRequest struct { *aws.Request Input *DeleteTagsInput + Copy func(*DeleteTagsInput) DeleteTagsRequest } // Send marshals and sends the DeleteTags API request. @@ -1303,7 +1326,7 @@ func (c *Redshift) DeleteTagsRequest(input *DeleteTagsInput) DeleteTagsRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteTagsRequest{Request: req, Input: input} + return DeleteTagsRequest{Request: req, Input: input, Copy: c.DeleteTagsRequest} } const opDescribeClusterParameterGroups = "DescribeClusterParameterGroups" @@ -1312,6 +1335,7 @@ const opDescribeClusterParameterGroups = "DescribeClusterParameterGroups" type DescribeClusterParameterGroupsRequest struct { *aws.Request Input *DescribeClusterParameterGroupsInput + Copy func(*DescribeClusterParameterGroupsInput) DescribeClusterParameterGroupsRequest } // Send marshals and sends the DescribeClusterParameterGroups API request. @@ -1376,57 +1400,53 @@ func (c *Redshift) DescribeClusterParameterGroupsRequest(input *DescribeClusterP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClusterParameterGroupsRequest{Request: req, Input: input} + return DescribeClusterParameterGroupsRequest{Request: req, Input: input, Copy: c.DescribeClusterParameterGroupsRequest} } -// DescribeClusterParameterGroupsPages iterates over the pages of a DescribeClusterParameterGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterParameterGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeClusterParameterGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeClusterParameterGroups operation. -// pageNum := 0 -// err := client.DescribeClusterParameterGroupsPages(params, -// func(page *DescribeClusterParameterGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterParameterGroupsPages(input *DescribeClusterParameterGroupsInput, fn func(*DescribeClusterParameterGroupsOutput, bool) bool) error { - return c.DescribeClusterParameterGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeClusterParameterGroupsPagesWithContext same as DescribeClusterParameterGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeClusterParameterGroupsPagesWithContext(ctx aws.Context, input *DescribeClusterParameterGroupsInput, fn func(*DescribeClusterParameterGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeClusterParameterGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeClusterParameterGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeClusterParameterGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeClusterParameterGroupsRequest) Paginate(opts ...aws.Option) DescribeClusterParameterGroupsPager { + return DescribeClusterParameterGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeClusterParameterGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterParameterGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeClusterParameterGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeClusterParameterGroupsPager struct { + aws.Pager +} + +func (p *DescribeClusterParameterGroupsPager) CurrentPage() *DescribeClusterParameterGroupsOutput { + return p.Pager.CurrentPage().(*DescribeClusterParameterGroupsOutput) } const opDescribeClusterParameters = "DescribeClusterParameters" @@ -1435,6 +1455,7 @@ const opDescribeClusterParameters = "DescribeClusterParameters" type DescribeClusterParametersRequest struct { *aws.Request Input *DescribeClusterParametersInput + Copy func(*DescribeClusterParametersInput) DescribeClusterParametersRequest } // Send marshals and sends the DescribeClusterParameters API request. @@ -1492,57 +1513,53 @@ func (c *Redshift) DescribeClusterParametersRequest(input *DescribeClusterParame req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClusterParametersRequest{Request: req, Input: input} + return DescribeClusterParametersRequest{Request: req, Input: input, Copy: c.DescribeClusterParametersRequest} } -// DescribeClusterParametersPages iterates over the pages of a DescribeClusterParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterParameters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeClusterParametersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeClusterParameters operation. -// pageNum := 0 -// err := client.DescribeClusterParametersPages(params, -// func(page *DescribeClusterParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterParametersPages(input *DescribeClusterParametersInput, fn func(*DescribeClusterParametersOutput, bool) bool) error { - return c.DescribeClusterParametersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeClusterParametersPagesWithContext same as DescribeClusterParametersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeClusterParametersPagesWithContext(ctx aws.Context, input *DescribeClusterParametersInput, fn func(*DescribeClusterParametersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeClusterParametersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeClusterParametersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeClusterParametersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeClusterParametersRequest) Paginate(opts ...aws.Option) DescribeClusterParametersPager { + return DescribeClusterParametersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeClusterParametersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterParametersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeClusterParametersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeClusterParametersPager struct { + aws.Pager +} + +func (p *DescribeClusterParametersPager) CurrentPage() *DescribeClusterParametersOutput { + return p.Pager.CurrentPage().(*DescribeClusterParametersOutput) } const opDescribeClusterSecurityGroups = "DescribeClusterSecurityGroups" @@ -1551,6 +1568,7 @@ const opDescribeClusterSecurityGroups = "DescribeClusterSecurityGroups" type DescribeClusterSecurityGroupsRequest struct { *aws.Request Input *DescribeClusterSecurityGroupsInput + Copy func(*DescribeClusterSecurityGroupsInput) DescribeClusterSecurityGroupsRequest } // Send marshals and sends the DescribeClusterSecurityGroups API request. @@ -1613,57 +1631,53 @@ func (c *Redshift) DescribeClusterSecurityGroupsRequest(input *DescribeClusterSe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClusterSecurityGroupsRequest{Request: req, Input: input} + return DescribeClusterSecurityGroupsRequest{Request: req, Input: input, Copy: c.DescribeClusterSecurityGroupsRequest} } -// DescribeClusterSecurityGroupsPages iterates over the pages of a DescribeClusterSecurityGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterSecurityGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeClusterSecurityGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeClusterSecurityGroups operation. -// pageNum := 0 -// err := client.DescribeClusterSecurityGroupsPages(params, -// func(page *DescribeClusterSecurityGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterSecurityGroupsPages(input *DescribeClusterSecurityGroupsInput, fn func(*DescribeClusterSecurityGroupsOutput, bool) bool) error { - return c.DescribeClusterSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeClusterSecurityGroupsPagesWithContext same as DescribeClusterSecurityGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeClusterSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeClusterSecurityGroupsInput, fn func(*DescribeClusterSecurityGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeClusterSecurityGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeClusterSecurityGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeClusterSecurityGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeClusterSecurityGroupsRequest) Paginate(opts ...aws.Option) DescribeClusterSecurityGroupsPager { + return DescribeClusterSecurityGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeClusterSecurityGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterSecurityGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeClusterSecurityGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeClusterSecurityGroupsPager struct { + aws.Pager +} + +func (p *DescribeClusterSecurityGroupsPager) CurrentPage() *DescribeClusterSecurityGroupsOutput { + return p.Pager.CurrentPage().(*DescribeClusterSecurityGroupsOutput) } const opDescribeClusterSnapshots = "DescribeClusterSnapshots" @@ -1672,6 +1686,7 @@ const opDescribeClusterSnapshots = "DescribeClusterSnapshots" type DescribeClusterSnapshotsRequest struct { *aws.Request Input *DescribeClusterSnapshotsInput + Copy func(*DescribeClusterSnapshotsInput) DescribeClusterSnapshotsRequest } // Send marshals and sends the DescribeClusterSnapshots API request. @@ -1732,57 +1747,53 @@ func (c *Redshift) DescribeClusterSnapshotsRequest(input *DescribeClusterSnapsho req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClusterSnapshotsRequest{Request: req, Input: input} + return DescribeClusterSnapshotsRequest{Request: req, Input: input, Copy: c.DescribeClusterSnapshotsRequest} } -// DescribeClusterSnapshotsPages iterates over the pages of a DescribeClusterSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterSnapshots method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeClusterSnapshotsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeClusterSnapshots operation. -// pageNum := 0 -// err := client.DescribeClusterSnapshotsPages(params, -// func(page *DescribeClusterSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterSnapshotsPages(input *DescribeClusterSnapshotsInput, fn func(*DescribeClusterSnapshotsOutput, bool) bool) error { - return c.DescribeClusterSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeClusterSnapshotsPagesWithContext same as DescribeClusterSnapshotsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeClusterSnapshotsPagesWithContext(ctx aws.Context, input *DescribeClusterSnapshotsInput, fn func(*DescribeClusterSnapshotsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeClusterSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeClusterSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeClusterSnapshotsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeClusterSnapshotsRequest) Paginate(opts ...aws.Option) DescribeClusterSnapshotsPager { + return DescribeClusterSnapshotsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeClusterSnapshotsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterSnapshotsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeClusterSnapshotsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeClusterSnapshotsPager struct { + aws.Pager +} + +func (p *DescribeClusterSnapshotsPager) CurrentPage() *DescribeClusterSnapshotsOutput { + return p.Pager.CurrentPage().(*DescribeClusterSnapshotsOutput) } const opDescribeClusterSubnetGroups = "DescribeClusterSubnetGroups" @@ -1791,6 +1802,7 @@ const opDescribeClusterSubnetGroups = "DescribeClusterSubnetGroups" type DescribeClusterSubnetGroupsRequest struct { *aws.Request Input *DescribeClusterSubnetGroupsInput + Copy func(*DescribeClusterSubnetGroupsInput) DescribeClusterSubnetGroupsRequest } // Send marshals and sends the DescribeClusterSubnetGroups API request. @@ -1849,57 +1861,53 @@ func (c *Redshift) DescribeClusterSubnetGroupsRequest(input *DescribeClusterSubn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClusterSubnetGroupsRequest{Request: req, Input: input} + return DescribeClusterSubnetGroupsRequest{Request: req, Input: input, Copy: c.DescribeClusterSubnetGroupsRequest} } -// DescribeClusterSubnetGroupsPages iterates over the pages of a DescribeClusterSubnetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterSubnetGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeClusterSubnetGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeClusterSubnetGroups operation. -// pageNum := 0 -// err := client.DescribeClusterSubnetGroupsPages(params, -// func(page *DescribeClusterSubnetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterSubnetGroupsPages(input *DescribeClusterSubnetGroupsInput, fn func(*DescribeClusterSubnetGroupsOutput, bool) bool) error { - return c.DescribeClusterSubnetGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeClusterSubnetGroupsPagesWithContext same as DescribeClusterSubnetGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeClusterSubnetGroupsPagesWithContext(ctx aws.Context, input *DescribeClusterSubnetGroupsInput, fn func(*DescribeClusterSubnetGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeClusterSubnetGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeClusterSubnetGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeClusterSubnetGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeClusterSubnetGroupsRequest) Paginate(opts ...aws.Option) DescribeClusterSubnetGroupsPager { + return DescribeClusterSubnetGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeClusterSubnetGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterSubnetGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeClusterSubnetGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeClusterSubnetGroupsPager struct { + aws.Pager +} + +func (p *DescribeClusterSubnetGroupsPager) CurrentPage() *DescribeClusterSubnetGroupsOutput { + return p.Pager.CurrentPage().(*DescribeClusterSubnetGroupsOutput) } const opDescribeClusterVersions = "DescribeClusterVersions" @@ -1908,6 +1916,7 @@ const opDescribeClusterVersions = "DescribeClusterVersions" type DescribeClusterVersionsRequest struct { *aws.Request Input *DescribeClusterVersionsInput + Copy func(*DescribeClusterVersionsInput) DescribeClusterVersionsRequest } // Send marshals and sends the DescribeClusterVersions API request. @@ -1958,57 +1967,53 @@ func (c *Redshift) DescribeClusterVersionsRequest(input *DescribeClusterVersions req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClusterVersionsRequest{Request: req, Input: input} + return DescribeClusterVersionsRequest{Request: req, Input: input, Copy: c.DescribeClusterVersionsRequest} } -// DescribeClusterVersionsPages iterates over the pages of a DescribeClusterVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeClusterVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeClusterVersions operation. -// pageNum := 0 -// err := client.DescribeClusterVersionsPages(params, -// func(page *DescribeClusterVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterVersionsPages(input *DescribeClusterVersionsInput, fn func(*DescribeClusterVersionsOutput, bool) bool) error { - return c.DescribeClusterVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeClusterVersionsPagesWithContext same as DescribeClusterVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeClusterVersionsPagesWithContext(ctx aws.Context, input *DescribeClusterVersionsInput, fn func(*DescribeClusterVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeClusterVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeClusterVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeClusterVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeClusterVersionsRequest) Paginate(opts ...aws.Option) DescribeClusterVersionsPager { + return DescribeClusterVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeClusterVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeClusterVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeClusterVersionsPager struct { + aws.Pager +} + +func (p *DescribeClusterVersionsPager) CurrentPage() *DescribeClusterVersionsOutput { + return p.Pager.CurrentPage().(*DescribeClusterVersionsOutput) } const opDescribeClusters = "DescribeClusters" @@ -2017,6 +2022,7 @@ const opDescribeClusters = "DescribeClusters" type DescribeClustersRequest struct { *aws.Request Input *DescribeClustersInput + Copy func(*DescribeClustersInput) DescribeClustersRequest } // Send marshals and sends the DescribeClusters API request. @@ -2076,57 +2082,53 @@ func (c *Redshift) DescribeClustersRequest(input *DescribeClustersInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClustersRequest{Request: req, Input: input} + return DescribeClustersRequest{Request: req, Input: input, Copy: c.DescribeClustersRequest} } -// DescribeClustersPages iterates over the pages of a DescribeClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeClustersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeClusters operation. -// pageNum := 0 -// err := client.DescribeClustersPages(params, -// func(page *DescribeClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClustersPages(input *DescribeClustersInput, fn func(*DescribeClustersOutput, bool) bool) error { - return c.DescribeClustersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeClustersPagesWithContext same as DescribeClustersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeClustersPagesWithContext(ctx aws.Context, input *DescribeClustersInput, fn func(*DescribeClustersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeClustersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeClustersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeClustersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeClustersRequest) Paginate(opts ...aws.Option) DescribeClustersPager { + return DescribeClustersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeClustersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClustersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeClustersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeClustersPager struct { + aws.Pager +} + +func (p *DescribeClustersPager) CurrentPage() *DescribeClustersOutput { + return p.Pager.CurrentPage().(*DescribeClustersOutput) } const opDescribeDefaultClusterParameters = "DescribeDefaultClusterParameters" @@ -2135,6 +2137,7 @@ const opDescribeDefaultClusterParameters = "DescribeDefaultClusterParameters" type DescribeDefaultClusterParametersRequest struct { *aws.Request Input *DescribeDefaultClusterParametersInput + Copy func(*DescribeDefaultClusterParametersInput) DescribeDefaultClusterParametersRequest } // Send marshals and sends the DescribeDefaultClusterParameters API request. @@ -2185,57 +2188,53 @@ func (c *Redshift) DescribeDefaultClusterParametersRequest(input *DescribeDefaul req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDefaultClusterParametersRequest{Request: req, Input: input} + return DescribeDefaultClusterParametersRequest{Request: req, Input: input, Copy: c.DescribeDefaultClusterParametersRequest} } -// DescribeDefaultClusterParametersPages iterates over the pages of a DescribeDefaultClusterParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDefaultClusterParameters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDefaultClusterParametersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDefaultClusterParameters operation. -// pageNum := 0 -// err := client.DescribeDefaultClusterParametersPages(params, -// func(page *DescribeDefaultClusterParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeDefaultClusterParametersPages(input *DescribeDefaultClusterParametersInput, fn func(*DescribeDefaultClusterParametersOutput, bool) bool) error { - return c.DescribeDefaultClusterParametersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDefaultClusterParametersPagesWithContext same as DescribeDefaultClusterParametersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeDefaultClusterParametersPagesWithContext(ctx aws.Context, input *DescribeDefaultClusterParametersInput, fn func(*DescribeDefaultClusterParametersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDefaultClusterParametersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDefaultClusterParametersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDefaultClusterParametersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDefaultClusterParametersRequest) Paginate(opts ...aws.Option) DescribeDefaultClusterParametersPager { + return DescribeDefaultClusterParametersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDefaultClusterParametersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDefaultClusterParametersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDefaultClusterParametersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDefaultClusterParametersPager struct { + aws.Pager +} + +func (p *DescribeDefaultClusterParametersPager) CurrentPage() *DescribeDefaultClusterParametersOutput { + return p.Pager.CurrentPage().(*DescribeDefaultClusterParametersOutput) } const opDescribeEventCategories = "DescribeEventCategories" @@ -2244,6 +2243,7 @@ const opDescribeEventCategories = "DescribeEventCategories" type DescribeEventCategoriesRequest struct { *aws.Request Input *DescribeEventCategoriesInput + Copy func(*DescribeEventCategoriesInput) DescribeEventCategoriesRequest } // Send marshals and sends the DescribeEventCategories API request. @@ -2286,7 +2286,7 @@ func (c *Redshift) DescribeEventCategoriesRequest(input *DescribeEventCategories req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventCategoriesRequest{Request: req, Input: input} + return DescribeEventCategoriesRequest{Request: req, Input: input, Copy: c.DescribeEventCategoriesRequest} } const opDescribeEventSubscriptions = "DescribeEventSubscriptions" @@ -2295,6 +2295,7 @@ const opDescribeEventSubscriptions = "DescribeEventSubscriptions" type DescribeEventSubscriptionsRequest struct { *aws.Request Input *DescribeEventSubscriptionsInput + Copy func(*DescribeEventSubscriptionsInput) DescribeEventSubscriptionsRequest } // Send marshals and sends the DescribeEventSubscriptions API request. @@ -2353,57 +2354,53 @@ func (c *Redshift) DescribeEventSubscriptionsRequest(input *DescribeEventSubscri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventSubscriptionsRequest{Request: req, Input: input} + return DescribeEventSubscriptionsRequest{Request: req, Input: input, Copy: c.DescribeEventSubscriptionsRequest} } -// DescribeEventSubscriptionsPages iterates over the pages of a DescribeEventSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEventSubscriptions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventSubscriptionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEventSubscriptions operation. -// pageNum := 0 -// err := client.DescribeEventSubscriptionsPages(params, -// func(page *DescribeEventSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeEventSubscriptionsPages(input *DescribeEventSubscriptionsInput, fn func(*DescribeEventSubscriptionsOutput, bool) bool) error { - return c.DescribeEventSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventSubscriptionsPagesWithContext same as DescribeEventSubscriptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeEventSubscriptionsPagesWithContext(ctx aws.Context, input *DescribeEventSubscriptionsInput, fn func(*DescribeEventSubscriptionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventSubscriptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventSubscriptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEventSubscriptionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEventSubscriptionsRequest) Paginate(opts ...aws.Option) DescribeEventSubscriptionsPager { + return DescribeEventSubscriptionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventSubscriptionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventSubscriptionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventSubscriptionsPager struct { + aws.Pager +} + +func (p *DescribeEventSubscriptionsPager) CurrentPage() *DescribeEventSubscriptionsOutput { + return p.Pager.CurrentPage().(*DescribeEventSubscriptionsOutput) } const opDescribeEvents = "DescribeEvents" @@ -2412,6 +2409,7 @@ const opDescribeEvents = "DescribeEvents" type DescribeEventsRequest struct { *aws.Request Input *DescribeEventsInput + Copy func(*DescribeEventsInput) DescribeEventsRequest } // Send marshals and sends the DescribeEvents API request. @@ -2461,57 +2459,53 @@ func (c *Redshift) DescribeEventsRequest(input *DescribeEventsInput) DescribeEve req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEventsRequest{Request: req, Input: input} + return DescribeEventsRequest{Request: req, Input: input, Copy: c.DescribeEventsRequest} } -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeEventsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeEventsPages(input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool) error { - return c.DescribeEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeEventsPagesWithContext same as DescribeEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeEventsPagesWithContext(ctx aws.Context, input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeEventsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeEventsRequest) Paginate(opts ...aws.Option) DescribeEventsPager { + return DescribeEventsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeEventsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeEventsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeEventsPager struct { + aws.Pager +} + +func (p *DescribeEventsPager) CurrentPage() *DescribeEventsOutput { + return p.Pager.CurrentPage().(*DescribeEventsOutput) } const opDescribeHsmClientCertificates = "DescribeHsmClientCertificates" @@ -2520,6 +2514,7 @@ const opDescribeHsmClientCertificates = "DescribeHsmClientCertificates" type DescribeHsmClientCertificatesRequest struct { *aws.Request Input *DescribeHsmClientCertificatesInput + Copy func(*DescribeHsmClientCertificatesInput) DescribeHsmClientCertificatesRequest } // Send marshals and sends the DescribeHsmClientCertificates API request. @@ -2578,57 +2573,53 @@ func (c *Redshift) DescribeHsmClientCertificatesRequest(input *DescribeHsmClient req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeHsmClientCertificatesRequest{Request: req, Input: input} + return DescribeHsmClientCertificatesRequest{Request: req, Input: input, Copy: c.DescribeHsmClientCertificatesRequest} } -// DescribeHsmClientCertificatesPages iterates over the pages of a DescribeHsmClientCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeHsmClientCertificates method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeHsmClientCertificatesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeHsmClientCertificates operation. -// pageNum := 0 -// err := client.DescribeHsmClientCertificatesPages(params, -// func(page *DescribeHsmClientCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeHsmClientCertificatesPages(input *DescribeHsmClientCertificatesInput, fn func(*DescribeHsmClientCertificatesOutput, bool) bool) error { - return c.DescribeHsmClientCertificatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeHsmClientCertificatesPagesWithContext same as DescribeHsmClientCertificatesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeHsmClientCertificatesPagesWithContext(ctx aws.Context, input *DescribeHsmClientCertificatesInput, fn func(*DescribeHsmClientCertificatesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeHsmClientCertificatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeHsmClientCertificatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeHsmClientCertificatesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeHsmClientCertificatesRequest) Paginate(opts ...aws.Option) DescribeHsmClientCertificatesPager { + return DescribeHsmClientCertificatesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeHsmClientCertificatesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeHsmClientCertificatesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeHsmClientCertificatesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeHsmClientCertificatesPager struct { + aws.Pager +} + +func (p *DescribeHsmClientCertificatesPager) CurrentPage() *DescribeHsmClientCertificatesOutput { + return p.Pager.CurrentPage().(*DescribeHsmClientCertificatesOutput) } const opDescribeHsmConfigurations = "DescribeHsmConfigurations" @@ -2637,6 +2628,7 @@ const opDescribeHsmConfigurations = "DescribeHsmConfigurations" type DescribeHsmConfigurationsRequest struct { *aws.Request Input *DescribeHsmConfigurationsInput + Copy func(*DescribeHsmConfigurationsInput) DescribeHsmConfigurationsRequest } // Send marshals and sends the DescribeHsmConfigurations API request. @@ -2695,57 +2687,53 @@ func (c *Redshift) DescribeHsmConfigurationsRequest(input *DescribeHsmConfigurat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeHsmConfigurationsRequest{Request: req, Input: input} + return DescribeHsmConfigurationsRequest{Request: req, Input: input, Copy: c.DescribeHsmConfigurationsRequest} } -// DescribeHsmConfigurationsPages iterates over the pages of a DescribeHsmConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeHsmConfigurations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeHsmConfigurationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeHsmConfigurations operation. -// pageNum := 0 -// err := client.DescribeHsmConfigurationsPages(params, -// func(page *DescribeHsmConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeHsmConfigurationsPages(input *DescribeHsmConfigurationsInput, fn func(*DescribeHsmConfigurationsOutput, bool) bool) error { - return c.DescribeHsmConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeHsmConfigurationsPagesWithContext same as DescribeHsmConfigurationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeHsmConfigurationsPagesWithContext(ctx aws.Context, input *DescribeHsmConfigurationsInput, fn func(*DescribeHsmConfigurationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeHsmConfigurationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeHsmConfigurationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeHsmConfigurationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeHsmConfigurationsRequest) Paginate(opts ...aws.Option) DescribeHsmConfigurationsPager { + return DescribeHsmConfigurationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeHsmConfigurationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeHsmConfigurationsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeHsmConfigurationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeHsmConfigurationsPager struct { + aws.Pager +} + +func (p *DescribeHsmConfigurationsPager) CurrentPage() *DescribeHsmConfigurationsOutput { + return p.Pager.CurrentPage().(*DescribeHsmConfigurationsOutput) } const opDescribeLoggingStatus = "DescribeLoggingStatus" @@ -2754,6 +2742,7 @@ const opDescribeLoggingStatus = "DescribeLoggingStatus" type DescribeLoggingStatusRequest struct { *aws.Request Input *DescribeLoggingStatusInput + Copy func(*DescribeLoggingStatusInput) DescribeLoggingStatusRequest } // Send marshals and sends the DescribeLoggingStatus API request. @@ -2795,7 +2784,7 @@ func (c *Redshift) DescribeLoggingStatusRequest(input *DescribeLoggingStatusInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeLoggingStatusRequest{Request: req, Input: input} + return DescribeLoggingStatusRequest{Request: req, Input: input, Copy: c.DescribeLoggingStatusRequest} } const opDescribeOrderableClusterOptions = "DescribeOrderableClusterOptions" @@ -2804,6 +2793,7 @@ const opDescribeOrderableClusterOptions = "DescribeOrderableClusterOptions" type DescribeOrderableClusterOptionsRequest struct { *aws.Request Input *DescribeOrderableClusterOptionsInput + Copy func(*DescribeOrderableClusterOptionsInput) DescribeOrderableClusterOptionsRequest } // Send marshals and sends the DescribeOrderableClusterOptions API request. @@ -2858,57 +2848,53 @@ func (c *Redshift) DescribeOrderableClusterOptionsRequest(input *DescribeOrderab req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeOrderableClusterOptionsRequest{Request: req, Input: input} + return DescribeOrderableClusterOptionsRequest{Request: req, Input: input, Copy: c.DescribeOrderableClusterOptionsRequest} } -// DescribeOrderableClusterOptionsPages iterates over the pages of a DescribeOrderableClusterOptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeOrderableClusterOptions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeOrderableClusterOptionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeOrderableClusterOptions operation. -// pageNum := 0 -// err := client.DescribeOrderableClusterOptionsPages(params, -// func(page *DescribeOrderableClusterOptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeOrderableClusterOptionsPages(input *DescribeOrderableClusterOptionsInput, fn func(*DescribeOrderableClusterOptionsOutput, bool) bool) error { - return c.DescribeOrderableClusterOptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeOrderableClusterOptionsPagesWithContext same as DescribeOrderableClusterOptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeOrderableClusterOptionsPagesWithContext(ctx aws.Context, input *DescribeOrderableClusterOptionsInput, fn func(*DescribeOrderableClusterOptionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeOrderableClusterOptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeOrderableClusterOptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeOrderableClusterOptionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeOrderableClusterOptionsRequest) Paginate(opts ...aws.Option) DescribeOrderableClusterOptionsPager { + return DescribeOrderableClusterOptionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeOrderableClusterOptionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOrderableClusterOptionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeOrderableClusterOptionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeOrderableClusterOptionsPager struct { + aws.Pager +} + +func (p *DescribeOrderableClusterOptionsPager) CurrentPage() *DescribeOrderableClusterOptionsOutput { + return p.Pager.CurrentPage().(*DescribeOrderableClusterOptionsOutput) } const opDescribeReservedNodeOfferings = "DescribeReservedNodeOfferings" @@ -2917,6 +2903,7 @@ const opDescribeReservedNodeOfferings = "DescribeReservedNodeOfferings" type DescribeReservedNodeOfferingsRequest struct { *aws.Request Input *DescribeReservedNodeOfferingsInput + Copy func(*DescribeReservedNodeOfferingsInput) DescribeReservedNodeOfferingsRequest } // Send marshals and sends the DescribeReservedNodeOfferings API request. @@ -2972,57 +2959,53 @@ func (c *Redshift) DescribeReservedNodeOfferingsRequest(input *DescribeReservedN req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedNodeOfferingsRequest{Request: req, Input: input} + return DescribeReservedNodeOfferingsRequest{Request: req, Input: input, Copy: c.DescribeReservedNodeOfferingsRequest} } -// DescribeReservedNodeOfferingsPages iterates over the pages of a DescribeReservedNodeOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedNodeOfferings method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReservedNodeOfferingsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReservedNodeOfferings operation. -// pageNum := 0 -// err := client.DescribeReservedNodeOfferingsPages(params, -// func(page *DescribeReservedNodeOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeReservedNodeOfferingsPages(input *DescribeReservedNodeOfferingsInput, fn func(*DescribeReservedNodeOfferingsOutput, bool) bool) error { - return c.DescribeReservedNodeOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedNodeOfferingsPagesWithContext same as DescribeReservedNodeOfferingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeReservedNodeOfferingsPagesWithContext(ctx aws.Context, input *DescribeReservedNodeOfferingsInput, fn func(*DescribeReservedNodeOfferingsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReservedNodeOfferingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReservedNodeOfferingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReservedNodeOfferingsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReservedNodeOfferingsRequest) Paginate(opts ...aws.Option) DescribeReservedNodeOfferingsPager { + return DescribeReservedNodeOfferingsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReservedNodeOfferingsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedNodeOfferingsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReservedNodeOfferingsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReservedNodeOfferingsPager struct { + aws.Pager +} + +func (p *DescribeReservedNodeOfferingsPager) CurrentPage() *DescribeReservedNodeOfferingsOutput { + return p.Pager.CurrentPage().(*DescribeReservedNodeOfferingsOutput) } const opDescribeReservedNodes = "DescribeReservedNodes" @@ -3031,6 +3014,7 @@ const opDescribeReservedNodes = "DescribeReservedNodes" type DescribeReservedNodesRequest struct { *aws.Request Input *DescribeReservedNodesInput + Copy func(*DescribeReservedNodesInput) DescribeReservedNodesRequest } // Send marshals and sends the DescribeReservedNodes API request. @@ -3077,57 +3061,53 @@ func (c *Redshift) DescribeReservedNodesRequest(input *DescribeReservedNodesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReservedNodesRequest{Request: req, Input: input} + return DescribeReservedNodesRequest{Request: req, Input: input, Copy: c.DescribeReservedNodesRequest} } -// DescribeReservedNodesPages iterates over the pages of a DescribeReservedNodes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedNodes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeReservedNodesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeReservedNodes operation. -// pageNum := 0 -// err := client.DescribeReservedNodesPages(params, -// func(page *DescribeReservedNodesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeReservedNodesPages(input *DescribeReservedNodesInput, fn func(*DescribeReservedNodesOutput, bool) bool) error { - return c.DescribeReservedNodesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedNodesPagesWithContext same as DescribeReservedNodesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Redshift) DescribeReservedNodesPagesWithContext(ctx aws.Context, input *DescribeReservedNodesInput, fn func(*DescribeReservedNodesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeReservedNodesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeReservedNodesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeReservedNodesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeReservedNodesRequest) Paginate(opts ...aws.Option) DescribeReservedNodesPager { + return DescribeReservedNodesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeReservedNodesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedNodesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeReservedNodesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeReservedNodesPager struct { + aws.Pager +} + +func (p *DescribeReservedNodesPager) CurrentPage() *DescribeReservedNodesOutput { + return p.Pager.CurrentPage().(*DescribeReservedNodesOutput) } const opDescribeResize = "DescribeResize" @@ -3136,6 +3116,7 @@ const opDescribeResize = "DescribeResize" type DescribeResizeRequest struct { *aws.Request Input *DescribeResizeInput + Copy func(*DescribeResizeInput) DescribeResizeRequest } // Send marshals and sends the DescribeResize API request. @@ -3182,7 +3163,7 @@ func (c *Redshift) DescribeResizeRequest(input *DescribeResizeInput) DescribeRes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeResizeRequest{Request: req, Input: input} + return DescribeResizeRequest{Request: req, Input: input, Copy: c.DescribeResizeRequest} } const opDescribeSnapshotCopyGrants = "DescribeSnapshotCopyGrants" @@ -3191,6 +3172,7 @@ const opDescribeSnapshotCopyGrants = "DescribeSnapshotCopyGrants" type DescribeSnapshotCopyGrantsRequest struct { *aws.Request Input *DescribeSnapshotCopyGrantsInput + Copy func(*DescribeSnapshotCopyGrantsInput) DescribeSnapshotCopyGrantsRequest } // Send marshals and sends the DescribeSnapshotCopyGrants API request. @@ -3236,7 +3218,7 @@ func (c *Redshift) DescribeSnapshotCopyGrantsRequest(input *DescribeSnapshotCopy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSnapshotCopyGrantsRequest{Request: req, Input: input} + return DescribeSnapshotCopyGrantsRequest{Request: req, Input: input, Copy: c.DescribeSnapshotCopyGrantsRequest} } const opDescribeTableRestoreStatus = "DescribeTableRestoreStatus" @@ -3245,6 +3227,7 @@ const opDescribeTableRestoreStatus = "DescribeTableRestoreStatus" type DescribeTableRestoreStatusRequest struct { *aws.Request Input *DescribeTableRestoreStatusInput + Copy func(*DescribeTableRestoreStatusInput) DescribeTableRestoreStatusRequest } // Send marshals and sends the DescribeTableRestoreStatus API request. @@ -3289,7 +3272,7 @@ func (c *Redshift) DescribeTableRestoreStatusRequest(input *DescribeTableRestore req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTableRestoreStatusRequest{Request: req, Input: input} + return DescribeTableRestoreStatusRequest{Request: req, Input: input, Copy: c.DescribeTableRestoreStatusRequest} } const opDescribeTags = "DescribeTags" @@ -3298,6 +3281,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -3360,7 +3344,7 @@ func (c *Redshift) DescribeTagsRequest(input *DescribeTagsInput) DescribeTagsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } const opDisableLogging = "DisableLogging" @@ -3369,6 +3353,7 @@ const opDisableLogging = "DisableLogging" type DisableLoggingRequest struct { *aws.Request Input *DisableLoggingInput + Copy func(*DisableLoggingInput) DisableLoggingRequest } // Send marshals and sends the DisableLogging API request. @@ -3410,7 +3395,7 @@ func (c *Redshift) DisableLoggingRequest(input *DisableLoggingInput) DisableLogg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableLoggingRequest{Request: req, Input: input} + return DisableLoggingRequest{Request: req, Input: input, Copy: c.DisableLoggingRequest} } const opDisableSnapshotCopy = "DisableSnapshotCopy" @@ -3419,6 +3404,7 @@ const opDisableSnapshotCopy = "DisableSnapshotCopy" type DisableSnapshotCopyRequest struct { *aws.Request Input *DisableSnapshotCopyInput + Copy func(*DisableSnapshotCopyInput) DisableSnapshotCopyRequest } // Send marshals and sends the DisableSnapshotCopy API request. @@ -3464,7 +3450,7 @@ func (c *Redshift) DisableSnapshotCopyRequest(input *DisableSnapshotCopyInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableSnapshotCopyRequest{Request: req, Input: input} + return DisableSnapshotCopyRequest{Request: req, Input: input, Copy: c.DisableSnapshotCopyRequest} } const opEnableLogging = "EnableLogging" @@ -3473,6 +3459,7 @@ const opEnableLogging = "EnableLogging" type EnableLoggingRequest struct { *aws.Request Input *EnableLoggingInput + Copy func(*EnableLoggingInput) EnableLoggingRequest } // Send marshals and sends the EnableLogging API request. @@ -3514,7 +3501,7 @@ func (c *Redshift) EnableLoggingRequest(input *EnableLoggingInput) EnableLogging req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableLoggingRequest{Request: req, Input: input} + return EnableLoggingRequest{Request: req, Input: input, Copy: c.EnableLoggingRequest} } const opEnableSnapshotCopy = "EnableSnapshotCopy" @@ -3523,6 +3510,7 @@ const opEnableSnapshotCopy = "EnableSnapshotCopy" type EnableSnapshotCopyRequest struct { *aws.Request Input *EnableSnapshotCopyInput + Copy func(*EnableSnapshotCopyInput) EnableSnapshotCopyRequest } // Send marshals and sends the EnableSnapshotCopy API request. @@ -3564,7 +3552,7 @@ func (c *Redshift) EnableSnapshotCopyRequest(input *EnableSnapshotCopyInput) Ena req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableSnapshotCopyRequest{Request: req, Input: input} + return EnableSnapshotCopyRequest{Request: req, Input: input, Copy: c.EnableSnapshotCopyRequest} } const opGetClusterCredentials = "GetClusterCredentials" @@ -3573,6 +3561,7 @@ const opGetClusterCredentials = "GetClusterCredentials" type GetClusterCredentialsRequest struct { *aws.Request Input *GetClusterCredentialsInput + Copy func(*GetClusterCredentialsInput) GetClusterCredentialsRequest } // Send marshals and sends the GetClusterCredentials API request. @@ -3636,7 +3625,7 @@ func (c *Redshift) GetClusterCredentialsRequest(input *GetClusterCredentialsInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetClusterCredentialsRequest{Request: req, Input: input} + return GetClusterCredentialsRequest{Request: req, Input: input, Copy: c.GetClusterCredentialsRequest} } const opModifyCluster = "ModifyCluster" @@ -3645,6 +3634,7 @@ const opModifyCluster = "ModifyCluster" type ModifyClusterRequest struct { *aws.Request Input *ModifyClusterInput + Copy func(*ModifyClusterInput) ModifyClusterRequest } // Send marshals and sends the ModifyCluster API request. @@ -3695,7 +3685,7 @@ func (c *Redshift) ModifyClusterRequest(input *ModifyClusterInput) ModifyCluster req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyClusterRequest{Request: req, Input: input} + return ModifyClusterRequest{Request: req, Input: input, Copy: c.ModifyClusterRequest} } const opModifyClusterIamRoles = "ModifyClusterIamRoles" @@ -3704,6 +3694,7 @@ const opModifyClusterIamRoles = "ModifyClusterIamRoles" type ModifyClusterIamRolesRequest struct { *aws.Request Input *ModifyClusterIamRolesInput + Copy func(*ModifyClusterIamRolesInput) ModifyClusterIamRolesRequest } // Send marshals and sends the ModifyClusterIamRoles API request. @@ -3747,7 +3738,7 @@ func (c *Redshift) ModifyClusterIamRolesRequest(input *ModifyClusterIamRolesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyClusterIamRolesRequest{Request: req, Input: input} + return ModifyClusterIamRolesRequest{Request: req, Input: input, Copy: c.ModifyClusterIamRolesRequest} } const opModifyClusterParameterGroup = "ModifyClusterParameterGroup" @@ -3756,6 +3747,7 @@ const opModifyClusterParameterGroup = "ModifyClusterParameterGroup" type ModifyClusterParameterGroupRequest struct { *aws.Request Input *ModifyClusterParameterGroupInput + Copy func(*ModifyClusterParameterGroupInput) ModifyClusterParameterGroupRequest } // Send marshals and sends the ModifyClusterParameterGroup API request. @@ -3800,7 +3792,7 @@ func (c *Redshift) ModifyClusterParameterGroupRequest(input *ModifyClusterParame req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyClusterParameterGroupRequest{Request: req, Input: input} + return ModifyClusterParameterGroupRequest{Request: req, Input: input, Copy: c.ModifyClusterParameterGroupRequest} } const opModifyClusterSubnetGroup = "ModifyClusterSubnetGroup" @@ -3809,6 +3801,7 @@ const opModifyClusterSubnetGroup = "ModifyClusterSubnetGroup" type ModifyClusterSubnetGroupRequest struct { *aws.Request Input *ModifyClusterSubnetGroupInput + Copy func(*ModifyClusterSubnetGroupInput) ModifyClusterSubnetGroupRequest } // Send marshals and sends the ModifyClusterSubnetGroup API request. @@ -3851,7 +3844,7 @@ func (c *Redshift) ModifyClusterSubnetGroupRequest(input *ModifyClusterSubnetGro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyClusterSubnetGroupRequest{Request: req, Input: input} + return ModifyClusterSubnetGroupRequest{Request: req, Input: input, Copy: c.ModifyClusterSubnetGroupRequest} } const opModifyEventSubscription = "ModifyEventSubscription" @@ -3860,6 +3853,7 @@ const opModifyEventSubscription = "ModifyEventSubscription" type ModifyEventSubscriptionRequest struct { *aws.Request Input *ModifyEventSubscriptionInput + Copy func(*ModifyEventSubscriptionInput) ModifyEventSubscriptionRequest } // Send marshals and sends the ModifyEventSubscription API request. @@ -3900,7 +3894,7 @@ func (c *Redshift) ModifyEventSubscriptionRequest(input *ModifyEventSubscription req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyEventSubscriptionRequest{Request: req, Input: input} + return ModifyEventSubscriptionRequest{Request: req, Input: input, Copy: c.ModifyEventSubscriptionRequest} } const opModifySnapshotCopyRetentionPeriod = "ModifySnapshotCopyRetentionPeriod" @@ -3909,6 +3903,7 @@ const opModifySnapshotCopyRetentionPeriod = "ModifySnapshotCopyRetentionPeriod" type ModifySnapshotCopyRetentionPeriodRequest struct { *aws.Request Input *ModifySnapshotCopyRetentionPeriodInput + Copy func(*ModifySnapshotCopyRetentionPeriodInput) ModifySnapshotCopyRetentionPeriodRequest } // Send marshals and sends the ModifySnapshotCopyRetentionPeriod API request. @@ -3950,7 +3945,7 @@ func (c *Redshift) ModifySnapshotCopyRetentionPeriodRequest(input *ModifySnapsho req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifySnapshotCopyRetentionPeriodRequest{Request: req, Input: input} + return ModifySnapshotCopyRetentionPeriodRequest{Request: req, Input: input, Copy: c.ModifySnapshotCopyRetentionPeriodRequest} } const opPurchaseReservedNodeOffering = "PurchaseReservedNodeOffering" @@ -3959,6 +3954,7 @@ const opPurchaseReservedNodeOffering = "PurchaseReservedNodeOffering" type PurchaseReservedNodeOfferingRequest struct { *aws.Request Input *PurchaseReservedNodeOfferingInput + Copy func(*PurchaseReservedNodeOfferingInput) PurchaseReservedNodeOfferingRequest } // Send marshals and sends the PurchaseReservedNodeOffering API request. @@ -4007,7 +4003,7 @@ func (c *Redshift) PurchaseReservedNodeOfferingRequest(input *PurchaseReservedNo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PurchaseReservedNodeOfferingRequest{Request: req, Input: input} + return PurchaseReservedNodeOfferingRequest{Request: req, Input: input, Copy: c.PurchaseReservedNodeOfferingRequest} } const opRebootCluster = "RebootCluster" @@ -4016,6 +4012,7 @@ const opRebootCluster = "RebootCluster" type RebootClusterRequest struct { *aws.Request Input *RebootClusterInput + Copy func(*RebootClusterInput) RebootClusterRequest } // Send marshals and sends the RebootCluster API request. @@ -4062,7 +4059,7 @@ func (c *Redshift) RebootClusterRequest(input *RebootClusterInput) RebootCluster req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RebootClusterRequest{Request: req, Input: input} + return RebootClusterRequest{Request: req, Input: input, Copy: c.RebootClusterRequest} } const opResetClusterParameterGroup = "ResetClusterParameterGroup" @@ -4071,6 +4068,7 @@ const opResetClusterParameterGroup = "ResetClusterParameterGroup" type ResetClusterParameterGroupRequest struct { *aws.Request Input *ResetClusterParameterGroupInput + Copy func(*ResetClusterParameterGroupInput) ResetClusterParameterGroupRequest } // Send marshals and sends the ResetClusterParameterGroup API request. @@ -4114,7 +4112,7 @@ func (c *Redshift) ResetClusterParameterGroupRequest(input *ResetClusterParamete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetClusterParameterGroupRequest{Request: req, Input: input} + return ResetClusterParameterGroupRequest{Request: req, Input: input, Copy: c.ResetClusterParameterGroupRequest} } const opRestoreFromClusterSnapshot = "RestoreFromClusterSnapshot" @@ -4123,6 +4121,7 @@ const opRestoreFromClusterSnapshot = "RestoreFromClusterSnapshot" type RestoreFromClusterSnapshotRequest struct { *aws.Request Input *RestoreFromClusterSnapshotInput + Copy func(*RestoreFromClusterSnapshotInput) RestoreFromClusterSnapshotRequest } // Send marshals and sends the RestoreFromClusterSnapshot API request. @@ -4177,7 +4176,7 @@ func (c *Redshift) RestoreFromClusterSnapshotRequest(input *RestoreFromClusterSn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreFromClusterSnapshotRequest{Request: req, Input: input} + return RestoreFromClusterSnapshotRequest{Request: req, Input: input, Copy: c.RestoreFromClusterSnapshotRequest} } const opRestoreTableFromClusterSnapshot = "RestoreTableFromClusterSnapshot" @@ -4186,6 +4185,7 @@ const opRestoreTableFromClusterSnapshot = "RestoreTableFromClusterSnapshot" type RestoreTableFromClusterSnapshotRequest struct { *aws.Request Input *RestoreTableFromClusterSnapshotInput + Copy func(*RestoreTableFromClusterSnapshotInput) RestoreTableFromClusterSnapshotRequest } // Send marshals and sends the RestoreTableFromClusterSnapshot API request. @@ -4238,7 +4238,7 @@ func (c *Redshift) RestoreTableFromClusterSnapshotRequest(input *RestoreTableFro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreTableFromClusterSnapshotRequest{Request: req, Input: input} + return RestoreTableFromClusterSnapshotRequest{Request: req, Input: input, Copy: c.RestoreTableFromClusterSnapshotRequest} } const opRevokeClusterSecurityGroupIngress = "RevokeClusterSecurityGroupIngress" @@ -4247,6 +4247,7 @@ const opRevokeClusterSecurityGroupIngress = "RevokeClusterSecurityGroupIngress" type RevokeClusterSecurityGroupIngressRequest struct { *aws.Request Input *RevokeClusterSecurityGroupIngressInput + Copy func(*RevokeClusterSecurityGroupIngressInput) RevokeClusterSecurityGroupIngressRequest } // Send marshals and sends the RevokeClusterSecurityGroupIngress API request. @@ -4291,7 +4292,7 @@ func (c *Redshift) RevokeClusterSecurityGroupIngressRequest(input *RevokeCluster req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RevokeClusterSecurityGroupIngressRequest{Request: req, Input: input} + return RevokeClusterSecurityGroupIngressRequest{Request: req, Input: input, Copy: c.RevokeClusterSecurityGroupIngressRequest} } const opRevokeSnapshotAccess = "RevokeSnapshotAccess" @@ -4300,6 +4301,7 @@ const opRevokeSnapshotAccess = "RevokeSnapshotAccess" type RevokeSnapshotAccessRequest struct { *aws.Request Input *RevokeSnapshotAccessInput + Copy func(*RevokeSnapshotAccessInput) RevokeSnapshotAccessRequest } // Send marshals and sends the RevokeSnapshotAccess API request. @@ -4346,7 +4348,7 @@ func (c *Redshift) RevokeSnapshotAccessRequest(input *RevokeSnapshotAccessInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RevokeSnapshotAccessRequest{Request: req, Input: input} + return RevokeSnapshotAccessRequest{Request: req, Input: input, Copy: c.RevokeSnapshotAccessRequest} } const opRotateEncryptionKey = "RotateEncryptionKey" @@ -4355,6 +4357,7 @@ const opRotateEncryptionKey = "RotateEncryptionKey" type RotateEncryptionKeyRequest struct { *aws.Request Input *RotateEncryptionKeyInput + Copy func(*RotateEncryptionKeyInput) RotateEncryptionKeyRequest } // Send marshals and sends the RotateEncryptionKey API request. @@ -4395,7 +4398,7 @@ func (c *Redshift) RotateEncryptionKeyRequest(input *RotateEncryptionKeyInput) R req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RotateEncryptionKeyRequest{Request: req, Input: input} + return RotateEncryptionKeyRequest{Request: req, Input: input, Copy: c.RotateEncryptionKeyRequest} } // Describes an AWS customer account authorized to restore a snapshot. diff --git a/service/redshift/redshiftiface/interface.go b/service/redshift/redshiftiface/interface.go index 0443d674124..7fffffd2558 100644 --- a/service/redshift/redshiftiface/interface.go +++ b/service/redshift/redshiftiface/interface.go @@ -111,83 +111,38 @@ type RedshiftAPI interface { DescribeClusterParameterGroupsRequest(*redshift.DescribeClusterParameterGroupsInput) redshift.DescribeClusterParameterGroupsRequest - DescribeClusterParameterGroupsPages(*redshift.DescribeClusterParameterGroupsInput, func(*redshift.DescribeClusterParameterGroupsOutput, bool) bool) error - DescribeClusterParameterGroupsPagesWithContext(aws.Context, *redshift.DescribeClusterParameterGroupsInput, func(*redshift.DescribeClusterParameterGroupsOutput, bool) bool, ...aws.Option) error - DescribeClusterParametersRequest(*redshift.DescribeClusterParametersInput) redshift.DescribeClusterParametersRequest - DescribeClusterParametersPages(*redshift.DescribeClusterParametersInput, func(*redshift.DescribeClusterParametersOutput, bool) bool) error - DescribeClusterParametersPagesWithContext(aws.Context, *redshift.DescribeClusterParametersInput, func(*redshift.DescribeClusterParametersOutput, bool) bool, ...aws.Option) error - DescribeClusterSecurityGroupsRequest(*redshift.DescribeClusterSecurityGroupsInput) redshift.DescribeClusterSecurityGroupsRequest - DescribeClusterSecurityGroupsPages(*redshift.DescribeClusterSecurityGroupsInput, func(*redshift.DescribeClusterSecurityGroupsOutput, bool) bool) error - DescribeClusterSecurityGroupsPagesWithContext(aws.Context, *redshift.DescribeClusterSecurityGroupsInput, func(*redshift.DescribeClusterSecurityGroupsOutput, bool) bool, ...aws.Option) error - DescribeClusterSnapshotsRequest(*redshift.DescribeClusterSnapshotsInput) redshift.DescribeClusterSnapshotsRequest - DescribeClusterSnapshotsPages(*redshift.DescribeClusterSnapshotsInput, func(*redshift.DescribeClusterSnapshotsOutput, bool) bool) error - DescribeClusterSnapshotsPagesWithContext(aws.Context, *redshift.DescribeClusterSnapshotsInput, func(*redshift.DescribeClusterSnapshotsOutput, bool) bool, ...aws.Option) error - DescribeClusterSubnetGroupsRequest(*redshift.DescribeClusterSubnetGroupsInput) redshift.DescribeClusterSubnetGroupsRequest - DescribeClusterSubnetGroupsPages(*redshift.DescribeClusterSubnetGroupsInput, func(*redshift.DescribeClusterSubnetGroupsOutput, bool) bool) error - DescribeClusterSubnetGroupsPagesWithContext(aws.Context, *redshift.DescribeClusterSubnetGroupsInput, func(*redshift.DescribeClusterSubnetGroupsOutput, bool) bool, ...aws.Option) error - DescribeClusterVersionsRequest(*redshift.DescribeClusterVersionsInput) redshift.DescribeClusterVersionsRequest - DescribeClusterVersionsPages(*redshift.DescribeClusterVersionsInput, func(*redshift.DescribeClusterVersionsOutput, bool) bool) error - DescribeClusterVersionsPagesWithContext(aws.Context, *redshift.DescribeClusterVersionsInput, func(*redshift.DescribeClusterVersionsOutput, bool) bool, ...aws.Option) error - DescribeClustersRequest(*redshift.DescribeClustersInput) redshift.DescribeClustersRequest - DescribeClustersPages(*redshift.DescribeClustersInput, func(*redshift.DescribeClustersOutput, bool) bool) error - DescribeClustersPagesWithContext(aws.Context, *redshift.DescribeClustersInput, func(*redshift.DescribeClustersOutput, bool) bool, ...aws.Option) error - DescribeDefaultClusterParametersRequest(*redshift.DescribeDefaultClusterParametersInput) redshift.DescribeDefaultClusterParametersRequest - DescribeDefaultClusterParametersPages(*redshift.DescribeDefaultClusterParametersInput, func(*redshift.DescribeDefaultClusterParametersOutput, bool) bool) error - DescribeDefaultClusterParametersPagesWithContext(aws.Context, *redshift.DescribeDefaultClusterParametersInput, func(*redshift.DescribeDefaultClusterParametersOutput, bool) bool, ...aws.Option) error - DescribeEventCategoriesRequest(*redshift.DescribeEventCategoriesInput) redshift.DescribeEventCategoriesRequest DescribeEventSubscriptionsRequest(*redshift.DescribeEventSubscriptionsInput) redshift.DescribeEventSubscriptionsRequest - DescribeEventSubscriptionsPages(*redshift.DescribeEventSubscriptionsInput, func(*redshift.DescribeEventSubscriptionsOutput, bool) bool) error - DescribeEventSubscriptionsPagesWithContext(aws.Context, *redshift.DescribeEventSubscriptionsInput, func(*redshift.DescribeEventSubscriptionsOutput, bool) bool, ...aws.Option) error - DescribeEventsRequest(*redshift.DescribeEventsInput) redshift.DescribeEventsRequest - DescribeEventsPages(*redshift.DescribeEventsInput, func(*redshift.DescribeEventsOutput, bool) bool) error - DescribeEventsPagesWithContext(aws.Context, *redshift.DescribeEventsInput, func(*redshift.DescribeEventsOutput, bool) bool, ...aws.Option) error - DescribeHsmClientCertificatesRequest(*redshift.DescribeHsmClientCertificatesInput) redshift.DescribeHsmClientCertificatesRequest - DescribeHsmClientCertificatesPages(*redshift.DescribeHsmClientCertificatesInput, func(*redshift.DescribeHsmClientCertificatesOutput, bool) bool) error - DescribeHsmClientCertificatesPagesWithContext(aws.Context, *redshift.DescribeHsmClientCertificatesInput, func(*redshift.DescribeHsmClientCertificatesOutput, bool) bool, ...aws.Option) error - DescribeHsmConfigurationsRequest(*redshift.DescribeHsmConfigurationsInput) redshift.DescribeHsmConfigurationsRequest - DescribeHsmConfigurationsPages(*redshift.DescribeHsmConfigurationsInput, func(*redshift.DescribeHsmConfigurationsOutput, bool) bool) error - DescribeHsmConfigurationsPagesWithContext(aws.Context, *redshift.DescribeHsmConfigurationsInput, func(*redshift.DescribeHsmConfigurationsOutput, bool) bool, ...aws.Option) error - DescribeLoggingStatusRequest(*redshift.DescribeLoggingStatusInput) redshift.DescribeLoggingStatusRequest DescribeOrderableClusterOptionsRequest(*redshift.DescribeOrderableClusterOptionsInput) redshift.DescribeOrderableClusterOptionsRequest - DescribeOrderableClusterOptionsPages(*redshift.DescribeOrderableClusterOptionsInput, func(*redshift.DescribeOrderableClusterOptionsOutput, bool) bool) error - DescribeOrderableClusterOptionsPagesWithContext(aws.Context, *redshift.DescribeOrderableClusterOptionsInput, func(*redshift.DescribeOrderableClusterOptionsOutput, bool) bool, ...aws.Option) error - DescribeReservedNodeOfferingsRequest(*redshift.DescribeReservedNodeOfferingsInput) redshift.DescribeReservedNodeOfferingsRequest - DescribeReservedNodeOfferingsPages(*redshift.DescribeReservedNodeOfferingsInput, func(*redshift.DescribeReservedNodeOfferingsOutput, bool) bool) error - DescribeReservedNodeOfferingsPagesWithContext(aws.Context, *redshift.DescribeReservedNodeOfferingsInput, func(*redshift.DescribeReservedNodeOfferingsOutput, bool) bool, ...aws.Option) error - DescribeReservedNodesRequest(*redshift.DescribeReservedNodesInput) redshift.DescribeReservedNodesRequest - DescribeReservedNodesPages(*redshift.DescribeReservedNodesInput, func(*redshift.DescribeReservedNodesOutput, bool) bool) error - DescribeReservedNodesPagesWithContext(aws.Context, *redshift.DescribeReservedNodesInput, func(*redshift.DescribeReservedNodesOutput, bool) bool, ...aws.Option) error - DescribeResizeRequest(*redshift.DescribeResizeInput) redshift.DescribeResizeRequest DescribeSnapshotCopyGrantsRequest(*redshift.DescribeSnapshotCopyGrantsInput) redshift.DescribeSnapshotCopyGrantsRequest diff --git a/service/rekognition/api.go b/service/rekognition/api.go index 18b8ee933af..8aa172165d8 100644 --- a/service/rekognition/api.go +++ b/service/rekognition/api.go @@ -15,6 +15,7 @@ const opCompareFaces = "CompareFaces" type CompareFacesRequest struct { *aws.Request Input *CompareFacesInput + Copy func(*CompareFacesInput) CompareFacesRequest } // Send marshals and sends the CompareFaces API request. @@ -94,7 +95,7 @@ func (c *Rekognition) CompareFacesRequest(input *CompareFacesInput) CompareFaces req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CompareFacesRequest{Request: req, Input: input} + return CompareFacesRequest{Request: req, Input: input, Copy: c.CompareFacesRequest} } const opCreateCollection = "CreateCollection" @@ -103,6 +104,7 @@ const opCreateCollection = "CreateCollection" type CreateCollectionRequest struct { *aws.Request Input *CreateCollectionInput + Copy func(*CreateCollectionInput) CreateCollectionRequest } // Send marshals and sends the CreateCollection API request. @@ -152,7 +154,7 @@ func (c *Rekognition) CreateCollectionRequest(input *CreateCollectionInput) Crea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCollectionRequest{Request: req, Input: input} + return CreateCollectionRequest{Request: req, Input: input, Copy: c.CreateCollectionRequest} } const opCreateStreamProcessor = "CreateStreamProcessor" @@ -161,6 +163,7 @@ const opCreateStreamProcessor = "CreateStreamProcessor" type CreateStreamProcessorRequest struct { *aws.Request Input *CreateStreamProcessorInput + Copy func(*CreateStreamProcessorInput) CreateStreamProcessorRequest } // Send marshals and sends the CreateStreamProcessor API request. @@ -213,7 +216,7 @@ func (c *Rekognition) CreateStreamProcessorRequest(input *CreateStreamProcessorI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStreamProcessorRequest{Request: req, Input: input} + return CreateStreamProcessorRequest{Request: req, Input: input, Copy: c.CreateStreamProcessorRequest} } const opDeleteCollection = "DeleteCollection" @@ -222,6 +225,7 @@ const opDeleteCollection = "DeleteCollection" type DeleteCollectionRequest struct { *aws.Request Input *DeleteCollectionInput + Copy func(*DeleteCollectionInput) DeleteCollectionRequest } // Send marshals and sends the DeleteCollection API request. @@ -264,7 +268,7 @@ func (c *Rekognition) DeleteCollectionRequest(input *DeleteCollectionInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteCollectionRequest{Request: req, Input: input} + return DeleteCollectionRequest{Request: req, Input: input, Copy: c.DeleteCollectionRequest} } const opDeleteFaces = "DeleteFaces" @@ -273,6 +277,7 @@ const opDeleteFaces = "DeleteFaces" type DeleteFacesRequest struct { *aws.Request Input *DeleteFacesInput + Copy func(*DeleteFacesInput) DeleteFacesRequest } // Send marshals and sends the DeleteFaces API request. @@ -315,7 +320,7 @@ func (c *Rekognition) DeleteFacesRequest(input *DeleteFacesInput) DeleteFacesReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteFacesRequest{Request: req, Input: input} + return DeleteFacesRequest{Request: req, Input: input, Copy: c.DeleteFacesRequest} } const opDeleteStreamProcessor = "DeleteStreamProcessor" @@ -324,6 +329,7 @@ const opDeleteStreamProcessor = "DeleteStreamProcessor" type DeleteStreamProcessorRequest struct { *aws.Request Input *DeleteStreamProcessorInput + Copy func(*DeleteStreamProcessorInput) DeleteStreamProcessorRequest } // Send marshals and sends the DeleteStreamProcessor API request. @@ -365,7 +371,7 @@ func (c *Rekognition) DeleteStreamProcessorRequest(input *DeleteStreamProcessorI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteStreamProcessorRequest{Request: req, Input: input} + return DeleteStreamProcessorRequest{Request: req, Input: input, Copy: c.DeleteStreamProcessorRequest} } const opDescribeStreamProcessor = "DescribeStreamProcessor" @@ -374,6 +380,7 @@ const opDescribeStreamProcessor = "DescribeStreamProcessor" type DescribeStreamProcessorRequest struct { *aws.Request Input *DescribeStreamProcessorInput + Copy func(*DescribeStreamProcessorInput) DescribeStreamProcessorRequest } // Send marshals and sends the DescribeStreamProcessor API request. @@ -414,7 +421,7 @@ func (c *Rekognition) DescribeStreamProcessorRequest(input *DescribeStreamProces req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStreamProcessorRequest{Request: req, Input: input} + return DescribeStreamProcessorRequest{Request: req, Input: input, Copy: c.DescribeStreamProcessorRequest} } const opDetectFaces = "DetectFaces" @@ -423,6 +430,7 @@ const opDetectFaces = "DetectFaces" type DetectFacesRequest struct { *aws.Request Input *DetectFacesInput + Copy func(*DetectFacesInput) DetectFacesRequest } // Send marshals and sends the DetectFaces API request. @@ -484,7 +492,7 @@ func (c *Rekognition) DetectFacesRequest(input *DetectFacesInput) DetectFacesReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetectFacesRequest{Request: req, Input: input} + return DetectFacesRequest{Request: req, Input: input, Copy: c.DetectFacesRequest} } const opDetectLabels = "DetectLabels" @@ -493,6 +501,7 @@ const opDetectLabels = "DetectLabels" type DetectLabelsRequest struct { *aws.Request Input *DetectLabelsInput + Copy func(*DetectLabelsInput) DetectLabelsRequest } // Send marshals and sends the DetectLabels API request. @@ -584,7 +593,7 @@ func (c *Rekognition) DetectLabelsRequest(input *DetectLabelsInput) DetectLabels req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetectLabelsRequest{Request: req, Input: input} + return DetectLabelsRequest{Request: req, Input: input, Copy: c.DetectLabelsRequest} } const opDetectModerationLabels = "DetectModerationLabels" @@ -593,6 +602,7 @@ const opDetectModerationLabels = "DetectModerationLabels" type DetectModerationLabelsRequest struct { *aws.Request Input *DetectModerationLabelsInput + Copy func(*DetectModerationLabelsInput) DetectModerationLabelsRequest } // Send marshals and sends the DetectModerationLabels API request. @@ -643,7 +653,7 @@ func (c *Rekognition) DetectModerationLabelsRequest(input *DetectModerationLabel req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetectModerationLabelsRequest{Request: req, Input: input} + return DetectModerationLabelsRequest{Request: req, Input: input, Copy: c.DetectModerationLabelsRequest} } const opDetectText = "DetectText" @@ -652,6 +662,7 @@ const opDetectText = "DetectText" type DetectTextRequest struct { *aws.Request Input *DetectTextInput + Copy func(*DetectTextInput) DetectTextRequest } // Send marshals and sends the DetectText API request. @@ -720,7 +731,7 @@ func (c *Rekognition) DetectTextRequest(input *DetectTextInput) DetectTextReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DetectTextRequest{Request: req, Input: input} + return DetectTextRequest{Request: req, Input: input, Copy: c.DetectTextRequest} } const opGetCelebrityInfo = "GetCelebrityInfo" @@ -729,6 +740,7 @@ const opGetCelebrityInfo = "GetCelebrityInfo" type GetCelebrityInfoRequest struct { *aws.Request Input *GetCelebrityInfoInput + Copy func(*GetCelebrityInfoInput) GetCelebrityInfoRequest } // Send marshals and sends the GetCelebrityInfo API request. @@ -773,7 +785,7 @@ func (c *Rekognition) GetCelebrityInfoRequest(input *GetCelebrityInfoInput) GetC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCelebrityInfoRequest{Request: req, Input: input} + return GetCelebrityInfoRequest{Request: req, Input: input, Copy: c.GetCelebrityInfoRequest} } const opGetCelebrityRecognition = "GetCelebrityRecognition" @@ -782,6 +794,7 @@ const opGetCelebrityRecognition = "GetCelebrityRecognition" type GetCelebrityRecognitionRequest struct { *aws.Request Input *GetCelebrityRecognitionInput + Copy func(*GetCelebrityRecognitionInput) GetCelebrityRecognitionRequest } // Send marshals and sends the GetCelebrityRecognition API request. @@ -859,57 +872,53 @@ func (c *Rekognition) GetCelebrityRecognitionRequest(input *GetCelebrityRecognit req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCelebrityRecognitionRequest{Request: req, Input: input} + return GetCelebrityRecognitionRequest{Request: req, Input: input, Copy: c.GetCelebrityRecognitionRequest} } -// GetCelebrityRecognitionPages iterates over the pages of a GetCelebrityRecognition operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetCelebrityRecognition method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetCelebrityRecognitionRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetCelebrityRecognition operation. -// pageNum := 0 -// err := client.GetCelebrityRecognitionPages(params, -// func(page *GetCelebrityRecognitionOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Rekognition) GetCelebrityRecognitionPages(input *GetCelebrityRecognitionInput, fn func(*GetCelebrityRecognitionOutput, bool) bool) error { - return c.GetCelebrityRecognitionPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetCelebrityRecognitionPagesWithContext same as GetCelebrityRecognitionPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Rekognition) GetCelebrityRecognitionPagesWithContext(ctx aws.Context, input *GetCelebrityRecognitionInput, fn func(*GetCelebrityRecognitionOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetCelebrityRecognitionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetCelebrityRecognitionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetCelebrityRecognitionRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetCelebrityRecognitionRequest) Paginate(opts ...aws.Option) GetCelebrityRecognitionPager { + return GetCelebrityRecognitionPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetCelebrityRecognitionInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetCelebrityRecognitionOutput), !p.HasNextPage()) - } - return p.Err() +// GetCelebrityRecognitionPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetCelebrityRecognitionPager struct { + aws.Pager +} + +func (p *GetCelebrityRecognitionPager) CurrentPage() *GetCelebrityRecognitionOutput { + return p.Pager.CurrentPage().(*GetCelebrityRecognitionOutput) } const opGetContentModeration = "GetContentModeration" @@ -918,6 +927,7 @@ const opGetContentModeration = "GetContentModeration" type GetContentModerationRequest struct { *aws.Request Input *GetContentModerationInput + Copy func(*GetContentModerationInput) GetContentModerationRequest } // Send marshals and sends the GetContentModeration API request. @@ -989,57 +999,53 @@ func (c *Rekognition) GetContentModerationRequest(input *GetContentModerationInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetContentModerationRequest{Request: req, Input: input} + return GetContentModerationRequest{Request: req, Input: input, Copy: c.GetContentModerationRequest} } -// GetContentModerationPages iterates over the pages of a GetContentModeration operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetContentModeration method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetContentModerationRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetContentModeration operation. -// pageNum := 0 -// err := client.GetContentModerationPages(params, -// func(page *GetContentModerationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Rekognition) GetContentModerationPages(input *GetContentModerationInput, fn func(*GetContentModerationOutput, bool) bool) error { - return c.GetContentModerationPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetContentModerationPagesWithContext same as GetContentModerationPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Rekognition) GetContentModerationPagesWithContext(ctx aws.Context, input *GetContentModerationInput, fn func(*GetContentModerationOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetContentModerationInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetContentModerationRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetContentModerationRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetContentModerationRequest) Paginate(opts ...aws.Option) GetContentModerationPager { + return GetContentModerationPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetContentModerationInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetContentModerationOutput), !p.HasNextPage()) - } - return p.Err() +// GetContentModerationPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetContentModerationPager struct { + aws.Pager +} + +func (p *GetContentModerationPager) CurrentPage() *GetContentModerationOutput { + return p.Pager.CurrentPage().(*GetContentModerationOutput) } const opGetFaceDetection = "GetFaceDetection" @@ -1048,6 +1054,7 @@ const opGetFaceDetection = "GetFaceDetection" type GetFaceDetectionRequest struct { *aws.Request Input *GetFaceDetectionInput + Copy func(*GetFaceDetectionInput) GetFaceDetectionRequest } // Send marshals and sends the GetFaceDetection API request. @@ -1111,57 +1118,53 @@ func (c *Rekognition) GetFaceDetectionRequest(input *GetFaceDetectionInput) GetF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFaceDetectionRequest{Request: req, Input: input} + return GetFaceDetectionRequest{Request: req, Input: input, Copy: c.GetFaceDetectionRequest} } -// GetFaceDetectionPages iterates over the pages of a GetFaceDetection operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetFaceDetection method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetFaceDetectionRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetFaceDetection operation. -// pageNum := 0 -// err := client.GetFaceDetectionPages(params, -// func(page *GetFaceDetectionOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Rekognition) GetFaceDetectionPages(input *GetFaceDetectionInput, fn func(*GetFaceDetectionOutput, bool) bool) error { - return c.GetFaceDetectionPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetFaceDetectionPagesWithContext same as GetFaceDetectionPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Rekognition) GetFaceDetectionPagesWithContext(ctx aws.Context, input *GetFaceDetectionInput, fn func(*GetFaceDetectionOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetFaceDetectionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetFaceDetectionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetFaceDetectionRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetFaceDetectionRequest) Paginate(opts ...aws.Option) GetFaceDetectionPager { + return GetFaceDetectionPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetFaceDetectionInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetFaceDetectionOutput), !p.HasNextPage()) - } - return p.Err() +// GetFaceDetectionPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetFaceDetectionPager struct { + aws.Pager +} + +func (p *GetFaceDetectionPager) CurrentPage() *GetFaceDetectionOutput { + return p.Pager.CurrentPage().(*GetFaceDetectionOutput) } const opGetFaceSearch = "GetFaceSearch" @@ -1170,6 +1173,7 @@ const opGetFaceSearch = "GetFaceSearch" type GetFaceSearchRequest struct { *aws.Request Input *GetFaceSearchInput + Copy func(*GetFaceSearchInput) GetFaceSearchRequest } // Send marshals and sends the GetFaceSearch API request. @@ -1235,57 +1239,53 @@ func (c *Rekognition) GetFaceSearchRequest(input *GetFaceSearchInput) GetFaceSea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFaceSearchRequest{Request: req, Input: input} + return GetFaceSearchRequest{Request: req, Input: input, Copy: c.GetFaceSearchRequest} } -// GetFaceSearchPages iterates over the pages of a GetFaceSearch operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetFaceSearch method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetFaceSearchRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetFaceSearch operation. -// pageNum := 0 -// err := client.GetFaceSearchPages(params, -// func(page *GetFaceSearchOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Rekognition) GetFaceSearchPages(input *GetFaceSearchInput, fn func(*GetFaceSearchOutput, bool) bool) error { - return c.GetFaceSearchPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetFaceSearchPagesWithContext same as GetFaceSearchPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Rekognition) GetFaceSearchPagesWithContext(ctx aws.Context, input *GetFaceSearchInput, fn func(*GetFaceSearchOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetFaceSearchInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetFaceSearchRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetFaceSearchRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetFaceSearchRequest) Paginate(opts ...aws.Option) GetFaceSearchPager { + return GetFaceSearchPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetFaceSearchInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetFaceSearchOutput), !p.HasNextPage()) - } - return p.Err() +// GetFaceSearchPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetFaceSearchPager struct { + aws.Pager +} + +func (p *GetFaceSearchPager) CurrentPage() *GetFaceSearchOutput { + return p.Pager.CurrentPage().(*GetFaceSearchOutput) } const opGetLabelDetection = "GetLabelDetection" @@ -1294,6 +1294,7 @@ const opGetLabelDetection = "GetLabelDetection" type GetLabelDetectionRequest struct { *aws.Request Input *GetLabelDetectionInput + Copy func(*GetLabelDetectionInput) GetLabelDetectionRequest } // Send marshals and sends the GetLabelDetection API request. @@ -1362,57 +1363,53 @@ func (c *Rekognition) GetLabelDetectionRequest(input *GetLabelDetectionInput) Ge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetLabelDetectionRequest{Request: req, Input: input} + return GetLabelDetectionRequest{Request: req, Input: input, Copy: c.GetLabelDetectionRequest} } -// GetLabelDetectionPages iterates over the pages of a GetLabelDetection operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetLabelDetection method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetLabelDetectionRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetLabelDetection operation. -// pageNum := 0 -// err := client.GetLabelDetectionPages(params, -// func(page *GetLabelDetectionOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Rekognition) GetLabelDetectionPages(input *GetLabelDetectionInput, fn func(*GetLabelDetectionOutput, bool) bool) error { - return c.GetLabelDetectionPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetLabelDetectionPagesWithContext same as GetLabelDetectionPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Rekognition) GetLabelDetectionPagesWithContext(ctx aws.Context, input *GetLabelDetectionInput, fn func(*GetLabelDetectionOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetLabelDetectionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetLabelDetectionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetLabelDetectionRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetLabelDetectionRequest) Paginate(opts ...aws.Option) GetLabelDetectionPager { + return GetLabelDetectionPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetLabelDetectionInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetLabelDetectionOutput), !p.HasNextPage()) - } - return p.Err() +// GetLabelDetectionPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetLabelDetectionPager struct { + aws.Pager +} + +func (p *GetLabelDetectionPager) CurrentPage() *GetLabelDetectionOutput { + return p.Pager.CurrentPage().(*GetLabelDetectionOutput) } const opGetPersonTracking = "GetPersonTracking" @@ -1421,6 +1418,7 @@ const opGetPersonTracking = "GetPersonTracking" type GetPersonTrackingRequest struct { *aws.Request Input *GetPersonTrackingInput + Copy func(*GetPersonTrackingInput) GetPersonTrackingRequest } // Send marshals and sends the GetPersonTracking API request. @@ -1489,57 +1487,53 @@ func (c *Rekognition) GetPersonTrackingRequest(input *GetPersonTrackingInput) Ge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPersonTrackingRequest{Request: req, Input: input} + return GetPersonTrackingRequest{Request: req, Input: input, Copy: c.GetPersonTrackingRequest} } -// GetPersonTrackingPages iterates over the pages of a GetPersonTracking operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetPersonTracking method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetPersonTrackingRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetPersonTracking operation. -// pageNum := 0 -// err := client.GetPersonTrackingPages(params, -// func(page *GetPersonTrackingOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Rekognition) GetPersonTrackingPages(input *GetPersonTrackingInput, fn func(*GetPersonTrackingOutput, bool) bool) error { - return c.GetPersonTrackingPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetPersonTrackingPagesWithContext same as GetPersonTrackingPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Rekognition) GetPersonTrackingPagesWithContext(ctx aws.Context, input *GetPersonTrackingInput, fn func(*GetPersonTrackingOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetPersonTrackingInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetPersonTrackingRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetPersonTrackingRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetPersonTrackingRequest) Paginate(opts ...aws.Option) GetPersonTrackingPager { + return GetPersonTrackingPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetPersonTrackingInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetPersonTrackingOutput), !p.HasNextPage()) - } - return p.Err() +// GetPersonTrackingPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetPersonTrackingPager struct { + aws.Pager +} + +func (p *GetPersonTrackingPager) CurrentPage() *GetPersonTrackingOutput { + return p.Pager.CurrentPage().(*GetPersonTrackingOutput) } const opIndexFaces = "IndexFaces" @@ -1548,6 +1542,7 @@ const opIndexFaces = "IndexFaces" type IndexFacesRequest struct { *aws.Request Input *IndexFacesInput + Copy func(*IndexFacesInput) IndexFacesRequest } // Send marshals and sends the IndexFaces API request. @@ -1623,7 +1618,7 @@ func (c *Rekognition) IndexFacesRequest(input *IndexFacesInput) IndexFacesReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return IndexFacesRequest{Request: req, Input: input} + return IndexFacesRequest{Request: req, Input: input, Copy: c.IndexFacesRequest} } const opListCollections = "ListCollections" @@ -1632,6 +1627,7 @@ const opListCollections = "ListCollections" type ListCollectionsRequest struct { *aws.Request Input *ListCollectionsInput + Copy func(*ListCollectionsInput) ListCollectionsRequest } // Send marshals and sends the ListCollections API request. @@ -1683,57 +1679,53 @@ func (c *Rekognition) ListCollectionsRequest(input *ListCollectionsInput) ListCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCollectionsRequest{Request: req, Input: input} + return ListCollectionsRequest{Request: req, Input: input, Copy: c.ListCollectionsRequest} } -// ListCollectionsPages iterates over the pages of a ListCollections operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCollections method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListCollectionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListCollections operation. -// pageNum := 0 -// err := client.ListCollectionsPages(params, -// func(page *ListCollectionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Rekognition) ListCollectionsPages(input *ListCollectionsInput, fn func(*ListCollectionsOutput, bool) bool) error { - return c.ListCollectionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCollectionsPagesWithContext same as ListCollectionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Rekognition) ListCollectionsPagesWithContext(ctx aws.Context, input *ListCollectionsInput, fn func(*ListCollectionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListCollectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListCollectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListCollectionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListCollectionsRequest) Paginate(opts ...aws.Option) ListCollectionsPager { + return ListCollectionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListCollectionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCollectionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListCollectionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListCollectionsPager struct { + aws.Pager +} + +func (p *ListCollectionsPager) CurrentPage() *ListCollectionsOutput { + return p.Pager.CurrentPage().(*ListCollectionsOutput) } const opListFaces = "ListFaces" @@ -1742,6 +1734,7 @@ const opListFaces = "ListFaces" type ListFacesRequest struct { *aws.Request Input *ListFacesInput + Copy func(*ListFacesInput) ListFacesRequest } // Send marshals and sends the ListFaces API request. @@ -1791,57 +1784,53 @@ func (c *Rekognition) ListFacesRequest(input *ListFacesInput) ListFacesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFacesRequest{Request: req, Input: input} + return ListFacesRequest{Request: req, Input: input, Copy: c.ListFacesRequest} } -// ListFacesPages iterates over the pages of a ListFaces operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFaces method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListFacesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListFaces operation. -// pageNum := 0 -// err := client.ListFacesPages(params, -// func(page *ListFacesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Rekognition) ListFacesPages(input *ListFacesInput, fn func(*ListFacesOutput, bool) bool) error { - return c.ListFacesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFacesPagesWithContext same as ListFacesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Rekognition) ListFacesPagesWithContext(ctx aws.Context, input *ListFacesInput, fn func(*ListFacesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListFacesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListFacesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListFacesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListFacesRequest) Paginate(opts ...aws.Option) ListFacesPager { + return ListFacesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListFacesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFacesOutput), !p.HasNextPage()) - } - return p.Err() +// ListFacesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListFacesPager struct { + aws.Pager +} + +func (p *ListFacesPager) CurrentPage() *ListFacesOutput { + return p.Pager.CurrentPage().(*ListFacesOutput) } const opListStreamProcessors = "ListStreamProcessors" @@ -1850,6 +1839,7 @@ const opListStreamProcessors = "ListStreamProcessors" type ListStreamProcessorsRequest struct { *aws.Request Input *ListStreamProcessorsInput + Copy func(*ListStreamProcessorsInput) ListStreamProcessorsRequest } // Send marshals and sends the ListStreamProcessors API request. @@ -1894,57 +1884,53 @@ func (c *Rekognition) ListStreamProcessorsRequest(input *ListStreamProcessorsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStreamProcessorsRequest{Request: req, Input: input} + return ListStreamProcessorsRequest{Request: req, Input: input, Copy: c.ListStreamProcessorsRequest} } -// ListStreamProcessorsPages iterates over the pages of a ListStreamProcessors operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStreamProcessors method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListStreamProcessorsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListStreamProcessors operation. -// pageNum := 0 -// err := client.ListStreamProcessorsPages(params, -// func(page *ListStreamProcessorsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Rekognition) ListStreamProcessorsPages(input *ListStreamProcessorsInput, fn func(*ListStreamProcessorsOutput, bool) bool) error { - return c.ListStreamProcessorsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStreamProcessorsPagesWithContext same as ListStreamProcessorsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Rekognition) ListStreamProcessorsPagesWithContext(ctx aws.Context, input *ListStreamProcessorsInput, fn func(*ListStreamProcessorsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListStreamProcessorsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListStreamProcessorsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListStreamProcessorsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListStreamProcessorsRequest) Paginate(opts ...aws.Option) ListStreamProcessorsPager { + return ListStreamProcessorsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListStreamProcessorsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStreamProcessorsOutput), !p.HasNextPage()) - } - return p.Err() +// ListStreamProcessorsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListStreamProcessorsPager struct { + aws.Pager +} + +func (p *ListStreamProcessorsPager) CurrentPage() *ListStreamProcessorsOutput { + return p.Pager.CurrentPage().(*ListStreamProcessorsOutput) } const opRecognizeCelebrities = "RecognizeCelebrities" @@ -1953,6 +1939,7 @@ const opRecognizeCelebrities = "RecognizeCelebrities" type RecognizeCelebritiesRequest struct { *aws.Request Input *RecognizeCelebritiesInput + Copy func(*RecognizeCelebritiesInput) RecognizeCelebritiesRequest } // Send marshals and sends the RecognizeCelebrities API request. @@ -2019,7 +2006,7 @@ func (c *Rekognition) RecognizeCelebritiesRequest(input *RecognizeCelebritiesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RecognizeCelebritiesRequest{Request: req, Input: input} + return RecognizeCelebritiesRequest{Request: req, Input: input, Copy: c.RecognizeCelebritiesRequest} } const opSearchFaces = "SearchFaces" @@ -2028,6 +2015,7 @@ const opSearchFaces = "SearchFaces" type SearchFacesRequest struct { *aws.Request Input *SearchFacesInput + Copy func(*SearchFacesInput) SearchFacesRequest } // Send marshals and sends the SearchFaces API request. @@ -2083,7 +2071,7 @@ func (c *Rekognition) SearchFacesRequest(input *SearchFacesInput) SearchFacesReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchFacesRequest{Request: req, Input: input} + return SearchFacesRequest{Request: req, Input: input, Copy: c.SearchFacesRequest} } const opSearchFacesByImage = "SearchFacesByImage" @@ -2092,6 +2080,7 @@ const opSearchFacesByImage = "SearchFacesByImage" type SearchFacesByImageRequest struct { *aws.Request Input *SearchFacesByImageInput + Copy func(*SearchFacesByImageInput) SearchFacesByImageRequest } // Send marshals and sends the SearchFacesByImage API request. @@ -2157,7 +2146,7 @@ func (c *Rekognition) SearchFacesByImageRequest(input *SearchFacesByImageInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchFacesByImageRequest{Request: req, Input: input} + return SearchFacesByImageRequest{Request: req, Input: input, Copy: c.SearchFacesByImageRequest} } const opStartCelebrityRecognition = "StartCelebrityRecognition" @@ -2166,6 +2155,7 @@ const opStartCelebrityRecognition = "StartCelebrityRecognition" type StartCelebrityRecognitionRequest struct { *aws.Request Input *StartCelebrityRecognitionInput + Copy func(*StartCelebrityRecognitionInput) StartCelebrityRecognitionRequest } // Send marshals and sends the StartCelebrityRecognition API request. @@ -2215,7 +2205,7 @@ func (c *Rekognition) StartCelebrityRecognitionRequest(input *StartCelebrityReco req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartCelebrityRecognitionRequest{Request: req, Input: input} + return StartCelebrityRecognitionRequest{Request: req, Input: input, Copy: c.StartCelebrityRecognitionRequest} } const opStartContentModeration = "StartContentModeration" @@ -2224,6 +2214,7 @@ const opStartContentModeration = "StartContentModeration" type StartContentModerationRequest struct { *aws.Request Input *StartContentModerationInput + Copy func(*StartContentModerationInput) StartContentModerationRequest } // Send marshals and sends the StartContentModeration API request. @@ -2275,7 +2266,7 @@ func (c *Rekognition) StartContentModerationRequest(input *StartContentModeratio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartContentModerationRequest{Request: req, Input: input} + return StartContentModerationRequest{Request: req, Input: input, Copy: c.StartContentModerationRequest} } const opStartFaceDetection = "StartFaceDetection" @@ -2284,6 +2275,7 @@ const opStartFaceDetection = "StartFaceDetection" type StartFaceDetectionRequest struct { *aws.Request Input *StartFaceDetectionInput + Copy func(*StartFaceDetectionInput) StartFaceDetectionRequest } // Send marshals and sends the StartFaceDetection API request. @@ -2332,7 +2324,7 @@ func (c *Rekognition) StartFaceDetectionRequest(input *StartFaceDetectionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartFaceDetectionRequest{Request: req, Input: input} + return StartFaceDetectionRequest{Request: req, Input: input, Copy: c.StartFaceDetectionRequest} } const opStartFaceSearch = "StartFaceSearch" @@ -2341,6 +2333,7 @@ const opStartFaceSearch = "StartFaceSearch" type StartFaceSearchRequest struct { *aws.Request Input *StartFaceSearchInput + Copy func(*StartFaceSearchInput) StartFaceSearchRequest } // Send marshals and sends the StartFaceSearch API request. @@ -2390,7 +2383,7 @@ func (c *Rekognition) StartFaceSearchRequest(input *StartFaceSearchInput) StartF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartFaceSearchRequest{Request: req, Input: input} + return StartFaceSearchRequest{Request: req, Input: input, Copy: c.StartFaceSearchRequest} } const opStartLabelDetection = "StartLabelDetection" @@ -2399,6 +2392,7 @@ const opStartLabelDetection = "StartLabelDetection" type StartLabelDetectionRequest struct { *aws.Request Input *StartLabelDetectionInput + Copy func(*StartLabelDetectionInput) StartLabelDetectionRequest } // Send marshals and sends the StartLabelDetection API request. @@ -2454,7 +2448,7 @@ func (c *Rekognition) StartLabelDetectionRequest(input *StartLabelDetectionInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartLabelDetectionRequest{Request: req, Input: input} + return StartLabelDetectionRequest{Request: req, Input: input, Copy: c.StartLabelDetectionRequest} } const opStartPersonTracking = "StartPersonTracking" @@ -2463,6 +2457,7 @@ const opStartPersonTracking = "StartPersonTracking" type StartPersonTrackingRequest struct { *aws.Request Input *StartPersonTrackingInput + Copy func(*StartPersonTrackingInput) StartPersonTrackingRequest } // Send marshals and sends the StartPersonTracking API request. @@ -2512,7 +2507,7 @@ func (c *Rekognition) StartPersonTrackingRequest(input *StartPersonTrackingInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartPersonTrackingRequest{Request: req, Input: input} + return StartPersonTrackingRequest{Request: req, Input: input, Copy: c.StartPersonTrackingRequest} } const opStartStreamProcessor = "StartStreamProcessor" @@ -2521,6 +2516,7 @@ const opStartStreamProcessor = "StartStreamProcessor" type StartStreamProcessorRequest struct { *aws.Request Input *StartStreamProcessorInput + Copy func(*StartStreamProcessorInput) StartStreamProcessorRequest } // Send marshals and sends the StartStreamProcessor API request. @@ -2561,7 +2557,7 @@ func (c *Rekognition) StartStreamProcessorRequest(input *StartStreamProcessorInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartStreamProcessorRequest{Request: req, Input: input} + return StartStreamProcessorRequest{Request: req, Input: input, Copy: c.StartStreamProcessorRequest} } const opStopStreamProcessor = "StopStreamProcessor" @@ -2570,6 +2566,7 @@ const opStopStreamProcessor = "StopStreamProcessor" type StopStreamProcessorRequest struct { *aws.Request Input *StopStreamProcessorInput + Copy func(*StopStreamProcessorInput) StopStreamProcessorRequest } // Send marshals and sends the StopStreamProcessor API request. @@ -2608,7 +2605,7 @@ func (c *Rekognition) StopStreamProcessorRequest(input *StopStreamProcessorInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopStreamProcessorRequest{Request: req, Input: input} + return StopStreamProcessorRequest{Request: req, Input: input, Copy: c.StopStreamProcessorRequest} } // Structure containing the estimated age range, in years, for a face. diff --git a/service/rekognition/rekognitioniface/interface.go b/service/rekognition/rekognitioniface/interface.go index 3cadd44f1f8..c4b1da90c88 100644 --- a/service/rekognition/rekognitioniface/interface.go +++ b/service/rekognition/rekognitioniface/interface.go @@ -9,7 +9,6 @@ package rekognitioniface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/rekognition" ) @@ -89,51 +88,24 @@ type RekognitionAPI interface { GetCelebrityRecognitionRequest(*rekognition.GetCelebrityRecognitionInput) rekognition.GetCelebrityRecognitionRequest - GetCelebrityRecognitionPages(*rekognition.GetCelebrityRecognitionInput, func(*rekognition.GetCelebrityRecognitionOutput, bool) bool) error - GetCelebrityRecognitionPagesWithContext(aws.Context, *rekognition.GetCelebrityRecognitionInput, func(*rekognition.GetCelebrityRecognitionOutput, bool) bool, ...aws.Option) error - GetContentModerationRequest(*rekognition.GetContentModerationInput) rekognition.GetContentModerationRequest - GetContentModerationPages(*rekognition.GetContentModerationInput, func(*rekognition.GetContentModerationOutput, bool) bool) error - GetContentModerationPagesWithContext(aws.Context, *rekognition.GetContentModerationInput, func(*rekognition.GetContentModerationOutput, bool) bool, ...aws.Option) error - GetFaceDetectionRequest(*rekognition.GetFaceDetectionInput) rekognition.GetFaceDetectionRequest - GetFaceDetectionPages(*rekognition.GetFaceDetectionInput, func(*rekognition.GetFaceDetectionOutput, bool) bool) error - GetFaceDetectionPagesWithContext(aws.Context, *rekognition.GetFaceDetectionInput, func(*rekognition.GetFaceDetectionOutput, bool) bool, ...aws.Option) error - GetFaceSearchRequest(*rekognition.GetFaceSearchInput) rekognition.GetFaceSearchRequest - GetFaceSearchPages(*rekognition.GetFaceSearchInput, func(*rekognition.GetFaceSearchOutput, bool) bool) error - GetFaceSearchPagesWithContext(aws.Context, *rekognition.GetFaceSearchInput, func(*rekognition.GetFaceSearchOutput, bool) bool, ...aws.Option) error - GetLabelDetectionRequest(*rekognition.GetLabelDetectionInput) rekognition.GetLabelDetectionRequest - GetLabelDetectionPages(*rekognition.GetLabelDetectionInput, func(*rekognition.GetLabelDetectionOutput, bool) bool) error - GetLabelDetectionPagesWithContext(aws.Context, *rekognition.GetLabelDetectionInput, func(*rekognition.GetLabelDetectionOutput, bool) bool, ...aws.Option) error - GetPersonTrackingRequest(*rekognition.GetPersonTrackingInput) rekognition.GetPersonTrackingRequest - GetPersonTrackingPages(*rekognition.GetPersonTrackingInput, func(*rekognition.GetPersonTrackingOutput, bool) bool) error - GetPersonTrackingPagesWithContext(aws.Context, *rekognition.GetPersonTrackingInput, func(*rekognition.GetPersonTrackingOutput, bool) bool, ...aws.Option) error - IndexFacesRequest(*rekognition.IndexFacesInput) rekognition.IndexFacesRequest ListCollectionsRequest(*rekognition.ListCollectionsInput) rekognition.ListCollectionsRequest - ListCollectionsPages(*rekognition.ListCollectionsInput, func(*rekognition.ListCollectionsOutput, bool) bool) error - ListCollectionsPagesWithContext(aws.Context, *rekognition.ListCollectionsInput, func(*rekognition.ListCollectionsOutput, bool) bool, ...aws.Option) error - ListFacesRequest(*rekognition.ListFacesInput) rekognition.ListFacesRequest - ListFacesPages(*rekognition.ListFacesInput, func(*rekognition.ListFacesOutput, bool) bool) error - ListFacesPagesWithContext(aws.Context, *rekognition.ListFacesInput, func(*rekognition.ListFacesOutput, bool) bool, ...aws.Option) error - ListStreamProcessorsRequest(*rekognition.ListStreamProcessorsInput) rekognition.ListStreamProcessorsRequest - ListStreamProcessorsPages(*rekognition.ListStreamProcessorsInput, func(*rekognition.ListStreamProcessorsOutput, bool) bool) error - ListStreamProcessorsPagesWithContext(aws.Context, *rekognition.ListStreamProcessorsInput, func(*rekognition.ListStreamProcessorsOutput, bool) bool, ...aws.Option) error - RecognizeCelebritiesRequest(*rekognition.RecognizeCelebritiesInput) rekognition.RecognizeCelebritiesRequest SearchFacesRequest(*rekognition.SearchFacesInput) rekognition.SearchFacesRequest diff --git a/service/resourcegroups/api.go b/service/resourcegroups/api.go index 7ad11b8b131..f0951c05731 100644 --- a/service/resourcegroups/api.go +++ b/service/resourcegroups/api.go @@ -14,6 +14,7 @@ const opCreateGroup = "CreateGroup" type CreateGroupRequest struct { *aws.Request Input *CreateGroupInput + Copy func(*CreateGroupInput) CreateGroupRequest } // Send marshals and sends the CreateGroup API request. @@ -54,7 +55,7 @@ func (c *ResourceGroups) CreateGroupRequest(input *CreateGroupInput) CreateGroup req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGroupRequest{Request: req, Input: input} + return CreateGroupRequest{Request: req, Input: input, Copy: c.CreateGroupRequest} } const opDeleteGroup = "DeleteGroup" @@ -63,6 +64,7 @@ const opDeleteGroup = "DeleteGroup" type DeleteGroupRequest struct { *aws.Request Input *DeleteGroupInput + Copy func(*DeleteGroupInput) DeleteGroupRequest } // Send marshals and sends the DeleteGroup API request. @@ -104,7 +106,7 @@ func (c *ResourceGroups) DeleteGroupRequest(input *DeleteGroupInput) DeleteGroup req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGroupRequest{Request: req, Input: input} + return DeleteGroupRequest{Request: req, Input: input, Copy: c.DeleteGroupRequest} } const opGetGroup = "GetGroup" @@ -113,6 +115,7 @@ const opGetGroup = "GetGroup" type GetGroupRequest struct { *aws.Request Input *GetGroupInput + Copy func(*GetGroupInput) GetGroupRequest } // Send marshals and sends the GetGroup API request. @@ -153,7 +156,7 @@ func (c *ResourceGroups) GetGroupRequest(input *GetGroupInput) GetGroupRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGroupRequest{Request: req, Input: input} + return GetGroupRequest{Request: req, Input: input, Copy: c.GetGroupRequest} } const opGetGroupQuery = "GetGroupQuery" @@ -162,6 +165,7 @@ const opGetGroupQuery = "GetGroupQuery" type GetGroupQueryRequest struct { *aws.Request Input *GetGroupQueryInput + Copy func(*GetGroupQueryInput) GetGroupQueryRequest } // Send marshals and sends the GetGroupQuery API request. @@ -202,7 +206,7 @@ func (c *ResourceGroups) GetGroupQueryRequest(input *GetGroupQueryInput) GetGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGroupQueryRequest{Request: req, Input: input} + return GetGroupQueryRequest{Request: req, Input: input, Copy: c.GetGroupQueryRequest} } const opGetTags = "GetTags" @@ -211,6 +215,7 @@ const opGetTags = "GetTags" type GetTagsRequest struct { *aws.Request Input *GetTagsInput + Copy func(*GetTagsInput) GetTagsRequest } // Send marshals and sends the GetTags API request. @@ -252,7 +257,7 @@ func (c *ResourceGroups) GetTagsRequest(input *GetTagsInput) GetTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTagsRequest{Request: req, Input: input} + return GetTagsRequest{Request: req, Input: input, Copy: c.GetTagsRequest} } const opListGroupResources = "ListGroupResources" @@ -261,6 +266,7 @@ const opListGroupResources = "ListGroupResources" type ListGroupResourcesRequest struct { *aws.Request Input *ListGroupResourcesInput + Copy func(*ListGroupResourcesInput) ListGroupResourcesRequest } // Send marshals and sends the ListGroupResources API request. @@ -308,57 +314,53 @@ func (c *ResourceGroups) ListGroupResourcesRequest(input *ListGroupResourcesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupResourcesRequest{Request: req, Input: input} + return ListGroupResourcesRequest{Request: req, Input: input, Copy: c.ListGroupResourcesRequest} } -// ListGroupResourcesPages iterates over the pages of a ListGroupResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroupResources method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListGroupResourcesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGroupResources operation. -// pageNum := 0 -// err := client.ListGroupResourcesPages(params, -// func(page *ListGroupResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListGroupResourcesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ResourceGroups) ListGroupResourcesPages(input *ListGroupResourcesInput, fn func(*ListGroupResourcesOutput, bool) bool) error { - return c.ListGroupResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGroupResourcesPagesWithContext same as ListGroupResourcesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroups) ListGroupResourcesPagesWithContext(ctx aws.Context, input *ListGroupResourcesInput, fn func(*ListGroupResourcesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListGroupResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListGroupResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListGroupResourcesRequest) Paginate(opts ...aws.Option) ListGroupResourcesPager { + return ListGroupResourcesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListGroupResourcesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupResourcesOutput), !p.HasNextPage()) - } - return p.Err() +// ListGroupResourcesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListGroupResourcesPager struct { + aws.Pager +} + +func (p *ListGroupResourcesPager) CurrentPage() *ListGroupResourcesOutput { + return p.Pager.CurrentPage().(*ListGroupResourcesOutput) } const opListGroups = "ListGroups" @@ -367,6 +369,7 @@ const opListGroups = "ListGroups" type ListGroupsRequest struct { *aws.Request Input *ListGroupsInput + Copy func(*ListGroupsInput) ListGroupsRequest } // Send marshals and sends the ListGroups API request. @@ -413,57 +416,53 @@ func (c *ResourceGroups) ListGroupsRequest(input *ListGroupsInput) ListGroupsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupsRequest{Request: req, Input: input} + return ListGroupsRequest{Request: req, Input: input, Copy: c.ListGroupsRequest} } -// ListGroupsPages iterates over the pages of a ListGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGroups operation. -// pageNum := 0 -// err := client.ListGroupsPages(params, -// func(page *ListGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ResourceGroups) ListGroupsPages(input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool) error { - return c.ListGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGroupsPagesWithContext same as ListGroupsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroups) ListGroupsPagesWithContext(ctx aws.Context, input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListGroupsRequest) Paginate(opts ...aws.Option) ListGroupsPager { + return ListGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// ListGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListGroupsPager struct { + aws.Pager +} + +func (p *ListGroupsPager) CurrentPage() *ListGroupsOutput { + return p.Pager.CurrentPage().(*ListGroupsOutput) } const opSearchResources = "SearchResources" @@ -472,6 +471,7 @@ const opSearchResources = "SearchResources" type SearchResourcesRequest struct { *aws.Request Input *SearchResourcesInput + Copy func(*SearchResourcesInput) SearchResourcesRequest } // Send marshals and sends the SearchResources API request. @@ -520,57 +520,53 @@ func (c *ResourceGroups) SearchResourcesRequest(input *SearchResourcesInput) Sea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchResourcesRequest{Request: req, Input: input} + return SearchResourcesRequest{Request: req, Input: input, Copy: c.SearchResourcesRequest} } -// SearchResourcesPages iterates over the pages of a SearchResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchResources method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SearchResourcesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SearchResources operation. -// pageNum := 0 -// err := client.SearchResourcesPages(params, -// func(page *SearchResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.SearchResourcesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *ResourceGroups) SearchResourcesPages(input *SearchResourcesInput, fn func(*SearchResourcesOutput, bool) bool) error { - return c.SearchResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchResourcesPagesWithContext same as SearchResourcesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroups) SearchResourcesPagesWithContext(ctx aws.Context, input *SearchResourcesInput, fn func(*SearchResourcesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SearchResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SearchResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *SearchResourcesRequest) Paginate(opts ...aws.Option) SearchResourcesPager { + return SearchResourcesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SearchResourcesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchResourcesOutput), !p.HasNextPage()) - } - return p.Err() +// SearchResourcesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SearchResourcesPager struct { + aws.Pager +} + +func (p *SearchResourcesPager) CurrentPage() *SearchResourcesOutput { + return p.Pager.CurrentPage().(*SearchResourcesOutput) } const opTag = "Tag" @@ -579,6 +575,7 @@ const opTag = "Tag" type TagRequest struct { *aws.Request Input *TagInput + Copy func(*TagInput) TagRequest } // Send marshals and sends the Tag API request. @@ -620,7 +617,7 @@ func (c *ResourceGroups) TagRequest(input *TagInput) TagRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagRequest{Request: req, Input: input} + return TagRequest{Request: req, Input: input, Copy: c.TagRequest} } const opUntag = "Untag" @@ -629,6 +626,7 @@ const opUntag = "Untag" type UntagRequest struct { *aws.Request Input *UntagInput + Copy func(*UntagInput) UntagRequest } // Send marshals and sends the Untag API request. @@ -669,7 +667,7 @@ func (c *ResourceGroups) UntagRequest(input *UntagInput) UntagRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagRequest{Request: req, Input: input} + return UntagRequest{Request: req, Input: input, Copy: c.UntagRequest} } const opUpdateGroup = "UpdateGroup" @@ -678,6 +676,7 @@ const opUpdateGroup = "UpdateGroup" type UpdateGroupRequest struct { *aws.Request Input *UpdateGroupInput + Copy func(*UpdateGroupInput) UpdateGroupRequest } // Send marshals and sends the UpdateGroup API request. @@ -719,7 +718,7 @@ func (c *ResourceGroups) UpdateGroupRequest(input *UpdateGroupInput) UpdateGroup req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGroupRequest{Request: req, Input: input} + return UpdateGroupRequest{Request: req, Input: input, Copy: c.UpdateGroupRequest} } const opUpdateGroupQuery = "UpdateGroupQuery" @@ -728,6 +727,7 @@ const opUpdateGroupQuery = "UpdateGroupQuery" type UpdateGroupQueryRequest struct { *aws.Request Input *UpdateGroupQueryInput + Copy func(*UpdateGroupQueryInput) UpdateGroupQueryRequest } // Send marshals and sends the UpdateGroupQuery API request. @@ -768,7 +768,7 @@ func (c *ResourceGroups) UpdateGroupQueryRequest(input *UpdateGroupQueryInput) U req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGroupQueryRequest{Request: req, Input: input} + return UpdateGroupQueryRequest{Request: req, Input: input, Copy: c.UpdateGroupQueryRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/CreateGroupInput diff --git a/service/resourcegroups/resourcegroupsiface/interface.go b/service/resourcegroups/resourcegroupsiface/interface.go index 6ae7643655c..16812b17f5c 100644 --- a/service/resourcegroups/resourcegroupsiface/interface.go +++ b/service/resourcegroups/resourcegroupsiface/interface.go @@ -9,7 +9,6 @@ package resourcegroupsiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/resourcegroups" ) @@ -75,19 +74,10 @@ type ResourceGroupsAPI interface { ListGroupResourcesRequest(*resourcegroups.ListGroupResourcesInput) resourcegroups.ListGroupResourcesRequest - ListGroupResourcesPages(*resourcegroups.ListGroupResourcesInput, func(*resourcegroups.ListGroupResourcesOutput, bool) bool) error - ListGroupResourcesPagesWithContext(aws.Context, *resourcegroups.ListGroupResourcesInput, func(*resourcegroups.ListGroupResourcesOutput, bool) bool, ...aws.Option) error - ListGroupsRequest(*resourcegroups.ListGroupsInput) resourcegroups.ListGroupsRequest - ListGroupsPages(*resourcegroups.ListGroupsInput, func(*resourcegroups.ListGroupsOutput, bool) bool) error - ListGroupsPagesWithContext(aws.Context, *resourcegroups.ListGroupsInput, func(*resourcegroups.ListGroupsOutput, bool) bool, ...aws.Option) error - SearchResourcesRequest(*resourcegroups.SearchResourcesInput) resourcegroups.SearchResourcesRequest - SearchResourcesPages(*resourcegroups.SearchResourcesInput, func(*resourcegroups.SearchResourcesOutput, bool) bool) error - SearchResourcesPagesWithContext(aws.Context, *resourcegroups.SearchResourcesInput, func(*resourcegroups.SearchResourcesOutput, bool) bool, ...aws.Option) error - TagRequest(*resourcegroups.TagInput) resourcegroups.TagRequest UntagRequest(*resourcegroups.UntagInput) resourcegroups.UntagRequest diff --git a/service/resourcegroupstaggingapi/api.go b/service/resourcegroupstaggingapi/api.go index 812c37117e5..a132aa84a45 100644 --- a/service/resourcegroupstaggingapi/api.go +++ b/service/resourcegroupstaggingapi/api.go @@ -15,6 +15,7 @@ const opGetResources = "GetResources" type GetResourcesRequest struct { *aws.Request Input *GetResourcesInput + Copy func(*GetResourcesInput) GetResourcesRequest } // Send marshals and sends the GetResources API request. @@ -66,57 +67,53 @@ func (c *ResourceGroupsTaggingAPI) GetResourcesRequest(input *GetResourcesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetResourcesRequest{Request: req, Input: input} + return GetResourcesRequest{Request: req, Input: input, Copy: c.GetResourcesRequest} } -// GetResourcesPages iterates over the pages of a GetResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetResources method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetResourcesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetResources operation. -// pageNum := 0 -// err := client.GetResourcesPages(params, -// func(page *GetResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ResourceGroupsTaggingAPI) GetResourcesPages(input *GetResourcesInput, fn func(*GetResourcesOutput, bool) bool) error { - return c.GetResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetResourcesPagesWithContext same as GetResourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetResourcesPagesWithContext(ctx aws.Context, input *GetResourcesInput, fn func(*GetResourcesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetResourcesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetResourcesRequest) Paginate(opts ...aws.Option) GetResourcesPager { + return GetResourcesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetResourcesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetResourcesOutput), !p.HasNextPage()) - } - return p.Err() +// GetResourcesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetResourcesPager struct { + aws.Pager +} + +func (p *GetResourcesPager) CurrentPage() *GetResourcesOutput { + return p.Pager.CurrentPage().(*GetResourcesOutput) } const opGetTagKeys = "GetTagKeys" @@ -125,6 +122,7 @@ const opGetTagKeys = "GetTagKeys" type GetTagKeysRequest struct { *aws.Request Input *GetTagKeysInput + Copy func(*GetTagKeysInput) GetTagKeysRequest } // Send marshals and sends the GetTagKeys API request. @@ -171,57 +169,53 @@ func (c *ResourceGroupsTaggingAPI) GetTagKeysRequest(input *GetTagKeysInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTagKeysRequest{Request: req, Input: input} + return GetTagKeysRequest{Request: req, Input: input, Copy: c.GetTagKeysRequest} } -// GetTagKeysPages iterates over the pages of a GetTagKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTagKeys method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetTagKeysRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetTagKeys operation. -// pageNum := 0 -// err := client.GetTagKeysPages(params, -// func(page *GetTagKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ResourceGroupsTaggingAPI) GetTagKeysPages(input *GetTagKeysInput, fn func(*GetTagKeysOutput, bool) bool) error { - return c.GetTagKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTagKeysPagesWithContext same as GetTagKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetTagKeysPagesWithContext(ctx aws.Context, input *GetTagKeysInput, fn func(*GetTagKeysOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetTagKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetTagKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetTagKeysRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetTagKeysRequest) Paginate(opts ...aws.Option) GetTagKeysPager { + return GetTagKeysPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetTagKeysInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTagKeysOutput), !p.HasNextPage()) - } - return p.Err() +// GetTagKeysPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetTagKeysPager struct { + aws.Pager +} + +func (p *GetTagKeysPager) CurrentPage() *GetTagKeysOutput { + return p.Pager.CurrentPage().(*GetTagKeysOutput) } const opGetTagValues = "GetTagValues" @@ -230,6 +224,7 @@ const opGetTagValues = "GetTagValues" type GetTagValuesRequest struct { *aws.Request Input *GetTagValuesInput + Copy func(*GetTagValuesInput) GetTagValuesRequest } // Send marshals and sends the GetTagValues API request. @@ -277,57 +272,53 @@ func (c *ResourceGroupsTaggingAPI) GetTagValuesRequest(input *GetTagValuesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTagValuesRequest{Request: req, Input: input} + return GetTagValuesRequest{Request: req, Input: input, Copy: c.GetTagValuesRequest} } -// GetTagValuesPages iterates over the pages of a GetTagValues operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTagValues method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetTagValuesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetTagValues operation. -// pageNum := 0 -// err := client.GetTagValuesPages(params, -// func(page *GetTagValuesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ResourceGroupsTaggingAPI) GetTagValuesPages(input *GetTagValuesInput, fn func(*GetTagValuesOutput, bool) bool) error { - return c.GetTagValuesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTagValuesPagesWithContext same as GetTagValuesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetTagValuesPagesWithContext(ctx aws.Context, input *GetTagValuesInput, fn func(*GetTagValuesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetTagValuesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetTagValuesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetTagValuesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetTagValuesRequest) Paginate(opts ...aws.Option) GetTagValuesPager { + return GetTagValuesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetTagValuesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTagValuesOutput), !p.HasNextPage()) - } - return p.Err() +// GetTagValuesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetTagValuesPager struct { + aws.Pager +} + +func (p *GetTagValuesPager) CurrentPage() *GetTagValuesOutput { + return p.Pager.CurrentPage().(*GetTagValuesOutput) } const opTagResources = "TagResources" @@ -336,6 +327,7 @@ const opTagResources = "TagResources" type TagResourcesRequest struct { *aws.Request Input *TagResourcesInput + Copy func(*TagResourcesInput) TagResourcesRequest } // Send marshals and sends the TagResources API request. @@ -392,7 +384,7 @@ func (c *ResourceGroupsTaggingAPI) TagResourcesRequest(input *TagResourcesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TagResourcesRequest{Request: req, Input: input} + return TagResourcesRequest{Request: req, Input: input, Copy: c.TagResourcesRequest} } const opUntagResources = "UntagResources" @@ -401,6 +393,7 @@ const opUntagResources = "UntagResources" type UntagResourcesRequest struct { *aws.Request Input *UntagResourcesInput + Copy func(*UntagResourcesInput) UntagResourcesRequest } // Send marshals and sends the UntagResources API request. @@ -452,7 +445,7 @@ func (c *ResourceGroupsTaggingAPI) UntagResourcesRequest(input *UntagResourcesIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UntagResourcesRequest{Request: req, Input: input} + return UntagResourcesRequest{Request: req, Input: input, Copy: c.UntagResourcesRequest} } // Details of the common errors that all actions return. diff --git a/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface/interface.go b/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface/interface.go index 1f22f4e7c3c..fd837ebd1c6 100644 --- a/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface/interface.go +++ b/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface/interface.go @@ -9,7 +9,6 @@ package resourcegroupstaggingapiiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi" ) @@ -65,19 +64,10 @@ import ( type ResourceGroupsTaggingAPIAPI interface { GetResourcesRequest(*resourcegroupstaggingapi.GetResourcesInput) resourcegroupstaggingapi.GetResourcesRequest - GetResourcesPages(*resourcegroupstaggingapi.GetResourcesInput, func(*resourcegroupstaggingapi.GetResourcesOutput, bool) bool) error - GetResourcesPagesWithContext(aws.Context, *resourcegroupstaggingapi.GetResourcesInput, func(*resourcegroupstaggingapi.GetResourcesOutput, bool) bool, ...aws.Option) error - GetTagKeysRequest(*resourcegroupstaggingapi.GetTagKeysInput) resourcegroupstaggingapi.GetTagKeysRequest - GetTagKeysPages(*resourcegroupstaggingapi.GetTagKeysInput, func(*resourcegroupstaggingapi.GetTagKeysOutput, bool) bool) error - GetTagKeysPagesWithContext(aws.Context, *resourcegroupstaggingapi.GetTagKeysInput, func(*resourcegroupstaggingapi.GetTagKeysOutput, bool) bool, ...aws.Option) error - GetTagValuesRequest(*resourcegroupstaggingapi.GetTagValuesInput) resourcegroupstaggingapi.GetTagValuesRequest - GetTagValuesPages(*resourcegroupstaggingapi.GetTagValuesInput, func(*resourcegroupstaggingapi.GetTagValuesOutput, bool) bool) error - GetTagValuesPagesWithContext(aws.Context, *resourcegroupstaggingapi.GetTagValuesInput, func(*resourcegroupstaggingapi.GetTagValuesOutput, bool) bool, ...aws.Option) error - TagResourcesRequest(*resourcegroupstaggingapi.TagResourcesInput) resourcegroupstaggingapi.TagResourcesRequest UntagResourcesRequest(*resourcegroupstaggingapi.UntagResourcesInput) resourcegroupstaggingapi.UntagResourcesRequest diff --git a/service/route53/api.go b/service/route53/api.go index 561c60d896b..fcdb8dd44fd 100644 --- a/service/route53/api.go +++ b/service/route53/api.go @@ -17,6 +17,7 @@ const opAssociateVPCWithHostedZone = "AssociateVPCWithHostedZone" type AssociateVPCWithHostedZoneRequest struct { *aws.Request Input *AssociateVPCWithHostedZoneInput + Copy func(*AssociateVPCWithHostedZoneInput) AssociateVPCWithHostedZoneRequest } // Send marshals and sends the AssociateVPCWithHostedZone API request. @@ -66,7 +67,7 @@ func (c *Route53) AssociateVPCWithHostedZoneRequest(input *AssociateVPCWithHoste req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateVPCWithHostedZoneRequest{Request: req, Input: input} + return AssociateVPCWithHostedZoneRequest{Request: req, Input: input, Copy: c.AssociateVPCWithHostedZoneRequest} } const opChangeResourceRecordSets = "ChangeResourceRecordSets" @@ -75,6 +76,7 @@ const opChangeResourceRecordSets = "ChangeResourceRecordSets" type ChangeResourceRecordSetsRequest struct { *aws.Request Input *ChangeResourceRecordSetsInput + Copy func(*ChangeResourceRecordSetsInput) ChangeResourceRecordSetsRequest } // Send marshals and sends the ChangeResourceRecordSets API request. @@ -193,7 +195,7 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ChangeResourceRecordSetsRequest{Request: req, Input: input} + return ChangeResourceRecordSetsRequest{Request: req, Input: input, Copy: c.ChangeResourceRecordSetsRequest} } const opChangeTagsForResource = "ChangeTagsForResource" @@ -202,6 +204,7 @@ const opChangeTagsForResource = "ChangeTagsForResource" type ChangeTagsForResourceRequest struct { *aws.Request Input *ChangeTagsForResourceInput + Copy func(*ChangeTagsForResourceInput) ChangeTagsForResourceRequest } // Send marshals and sends the ChangeTagsForResource API request. @@ -246,7 +249,7 @@ func (c *Route53) ChangeTagsForResourceRequest(input *ChangeTagsForResourceInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ChangeTagsForResourceRequest{Request: req, Input: input} + return ChangeTagsForResourceRequest{Request: req, Input: input, Copy: c.ChangeTagsForResourceRequest} } const opCreateHealthCheck = "CreateHealthCheck" @@ -255,6 +258,7 @@ const opCreateHealthCheck = "CreateHealthCheck" type CreateHealthCheckRequest struct { *aws.Request Input *CreateHealthCheckInput + Copy func(*CreateHealthCheckInput) CreateHealthCheckRequest } // Send marshals and sends the CreateHealthCheck API request. @@ -326,7 +330,7 @@ func (c *Route53) CreateHealthCheckRequest(input *CreateHealthCheckInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHealthCheckRequest{Request: req, Input: input} + return CreateHealthCheckRequest{Request: req, Input: input, Copy: c.CreateHealthCheckRequest} } const opCreateHostedZone = "CreateHostedZone" @@ -335,6 +339,7 @@ const opCreateHostedZone = "CreateHostedZone" type CreateHostedZoneRequest struct { *aws.Request Input *CreateHostedZoneInput + Copy func(*CreateHostedZoneInput) CreateHostedZoneRequest } // Send marshals and sends the CreateHostedZone API request. @@ -409,7 +414,7 @@ func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) CreateHo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateHostedZoneRequest{Request: req, Input: input} + return CreateHostedZoneRequest{Request: req, Input: input, Copy: c.CreateHostedZoneRequest} } const opCreateQueryLoggingConfig = "CreateQueryLoggingConfig" @@ -418,6 +423,7 @@ const opCreateQueryLoggingConfig = "CreateQueryLoggingConfig" type CreateQueryLoggingConfigRequest struct { *aws.Request Input *CreateQueryLoggingConfigInput + Copy func(*CreateQueryLoggingConfigInput) CreateQueryLoggingConfigRequest } // Send marshals and sends the CreateQueryLoggingConfig API request. @@ -554,7 +560,7 @@ func (c *Route53) CreateQueryLoggingConfigRequest(input *CreateQueryLoggingConfi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateQueryLoggingConfigRequest{Request: req, Input: input} + return CreateQueryLoggingConfigRequest{Request: req, Input: input, Copy: c.CreateQueryLoggingConfigRequest} } const opCreateReusableDelegationSet = "CreateReusableDelegationSet" @@ -563,6 +569,7 @@ const opCreateReusableDelegationSet = "CreateReusableDelegationSet" type CreateReusableDelegationSetRequest struct { *aws.Request Input *CreateReusableDelegationSetInput + Copy func(*CreateReusableDelegationSetInput) CreateReusableDelegationSetRequest } // Send marshals and sends the CreateReusableDelegationSet API request. @@ -646,7 +653,7 @@ func (c *Route53) CreateReusableDelegationSetRequest(input *CreateReusableDelega req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReusableDelegationSetRequest{Request: req, Input: input} + return CreateReusableDelegationSetRequest{Request: req, Input: input, Copy: c.CreateReusableDelegationSetRequest} } const opCreateTrafficPolicy = "CreateTrafficPolicy" @@ -655,6 +662,7 @@ const opCreateTrafficPolicy = "CreateTrafficPolicy" type CreateTrafficPolicyRequest struct { *aws.Request Input *CreateTrafficPolicyInput + Copy func(*CreateTrafficPolicyInput) CreateTrafficPolicyRequest } // Send marshals and sends the CreateTrafficPolicy API request. @@ -697,7 +705,7 @@ func (c *Route53) CreateTrafficPolicyRequest(input *CreateTrafficPolicyInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTrafficPolicyRequest{Request: req, Input: input} + return CreateTrafficPolicyRequest{Request: req, Input: input, Copy: c.CreateTrafficPolicyRequest} } const opCreateTrafficPolicyInstance = "CreateTrafficPolicyInstance" @@ -706,6 +714,7 @@ const opCreateTrafficPolicyInstance = "CreateTrafficPolicyInstance" type CreateTrafficPolicyInstanceRequest struct { *aws.Request Input *CreateTrafficPolicyInstanceInput + Copy func(*CreateTrafficPolicyInstanceInput) CreateTrafficPolicyInstanceRequest } // Send marshals and sends the CreateTrafficPolicyInstance API request. @@ -751,7 +760,7 @@ func (c *Route53) CreateTrafficPolicyInstanceRequest(input *CreateTrafficPolicyI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTrafficPolicyInstanceRequest{Request: req, Input: input} + return CreateTrafficPolicyInstanceRequest{Request: req, Input: input, Copy: c.CreateTrafficPolicyInstanceRequest} } const opCreateTrafficPolicyVersion = "CreateTrafficPolicyVersion" @@ -760,6 +769,7 @@ const opCreateTrafficPolicyVersion = "CreateTrafficPolicyVersion" type CreateTrafficPolicyVersionRequest struct { *aws.Request Input *CreateTrafficPolicyVersionInput + Copy func(*CreateTrafficPolicyVersionInput) CreateTrafficPolicyVersionRequest } // Send marshals and sends the CreateTrafficPolicyVersion API request. @@ -807,7 +817,7 @@ func (c *Route53) CreateTrafficPolicyVersionRequest(input *CreateTrafficPolicyVe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTrafficPolicyVersionRequest{Request: req, Input: input} + return CreateTrafficPolicyVersionRequest{Request: req, Input: input, Copy: c.CreateTrafficPolicyVersionRequest} } const opCreateVPCAssociationAuthorization = "CreateVPCAssociationAuthorization" @@ -816,6 +826,7 @@ const opCreateVPCAssociationAuthorization = "CreateVPCAssociationAuthorization" type CreateVPCAssociationAuthorizationRequest struct { *aws.Request Input *CreateVPCAssociationAuthorizationInput + Copy func(*CreateVPCAssociationAuthorizationInput) CreateVPCAssociationAuthorizationRequest } // Send marshals and sends the CreateVPCAssociationAuthorization API request. @@ -865,7 +876,7 @@ func (c *Route53) CreateVPCAssociationAuthorizationRequest(input *CreateVPCAssoc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateVPCAssociationAuthorizationRequest{Request: req, Input: input} + return CreateVPCAssociationAuthorizationRequest{Request: req, Input: input, Copy: c.CreateVPCAssociationAuthorizationRequest} } const opDeleteHealthCheck = "DeleteHealthCheck" @@ -874,6 +885,7 @@ const opDeleteHealthCheck = "DeleteHealthCheck" type DeleteHealthCheckRequest struct { *aws.Request Input *DeleteHealthCheckInput + Copy func(*DeleteHealthCheckInput) DeleteHealthCheckRequest } // Send marshals and sends the DeleteHealthCheck API request. @@ -922,7 +934,7 @@ func (c *Route53) DeleteHealthCheckRequest(input *DeleteHealthCheckInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteHealthCheckRequest{Request: req, Input: input} + return DeleteHealthCheckRequest{Request: req, Input: input, Copy: c.DeleteHealthCheckRequest} } const opDeleteHostedZone = "DeleteHostedZone" @@ -931,6 +943,7 @@ const opDeleteHostedZone = "DeleteHostedZone" type DeleteHostedZoneRequest struct { *aws.Request Input *DeleteHostedZoneInput + Copy func(*DeleteHostedZoneInput) DeleteHostedZoneRequest } // Send marshals and sends the DeleteHostedZone API request. @@ -1000,7 +1013,7 @@ func (c *Route53) DeleteHostedZoneRequest(input *DeleteHostedZoneInput) DeleteHo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteHostedZoneRequest{Request: req, Input: input} + return DeleteHostedZoneRequest{Request: req, Input: input, Copy: c.DeleteHostedZoneRequest} } const opDeleteQueryLoggingConfig = "DeleteQueryLoggingConfig" @@ -1009,6 +1022,7 @@ const opDeleteQueryLoggingConfig = "DeleteQueryLoggingConfig" type DeleteQueryLoggingConfigRequest struct { *aws.Request Input *DeleteQueryLoggingConfigInput + Copy func(*DeleteQueryLoggingConfigInput) DeleteQueryLoggingConfigRequest } // Send marshals and sends the DeleteQueryLoggingConfig API request. @@ -1053,7 +1067,7 @@ func (c *Route53) DeleteQueryLoggingConfigRequest(input *DeleteQueryLoggingConfi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteQueryLoggingConfigRequest{Request: req, Input: input} + return DeleteQueryLoggingConfigRequest{Request: req, Input: input, Copy: c.DeleteQueryLoggingConfigRequest} } const opDeleteReusableDelegationSet = "DeleteReusableDelegationSet" @@ -1062,6 +1076,7 @@ const opDeleteReusableDelegationSet = "DeleteReusableDelegationSet" type DeleteReusableDelegationSetRequest struct { *aws.Request Input *DeleteReusableDelegationSetInput + Copy func(*DeleteReusableDelegationSetInput) DeleteReusableDelegationSetRequest } // Send marshals and sends the DeleteReusableDelegationSet API request. @@ -1109,7 +1124,7 @@ func (c *Route53) DeleteReusableDelegationSetRequest(input *DeleteReusableDelega req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReusableDelegationSetRequest{Request: req, Input: input} + return DeleteReusableDelegationSetRequest{Request: req, Input: input, Copy: c.DeleteReusableDelegationSetRequest} } const opDeleteTrafficPolicy = "DeleteTrafficPolicy" @@ -1118,6 +1133,7 @@ const opDeleteTrafficPolicy = "DeleteTrafficPolicy" type DeleteTrafficPolicyRequest struct { *aws.Request Input *DeleteTrafficPolicyInput + Copy func(*DeleteTrafficPolicyInput) DeleteTrafficPolicyRequest } // Send marshals and sends the DeleteTrafficPolicy API request. @@ -1158,7 +1174,7 @@ func (c *Route53) DeleteTrafficPolicyRequest(input *DeleteTrafficPolicyInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTrafficPolicyRequest{Request: req, Input: input} + return DeleteTrafficPolicyRequest{Request: req, Input: input, Copy: c.DeleteTrafficPolicyRequest} } const opDeleteTrafficPolicyInstance = "DeleteTrafficPolicyInstance" @@ -1167,6 +1183,7 @@ const opDeleteTrafficPolicyInstance = "DeleteTrafficPolicyInstance" type DeleteTrafficPolicyInstanceRequest struct { *aws.Request Input *DeleteTrafficPolicyInstanceInput + Copy func(*DeleteTrafficPolicyInstanceInput) DeleteTrafficPolicyInstanceRequest } // Send marshals and sends the DeleteTrafficPolicyInstance API request. @@ -1211,7 +1228,7 @@ func (c *Route53) DeleteTrafficPolicyInstanceRequest(input *DeleteTrafficPolicyI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTrafficPolicyInstanceRequest{Request: req, Input: input} + return DeleteTrafficPolicyInstanceRequest{Request: req, Input: input, Copy: c.DeleteTrafficPolicyInstanceRequest} } const opDeleteVPCAssociationAuthorization = "DeleteVPCAssociationAuthorization" @@ -1220,6 +1237,7 @@ const opDeleteVPCAssociationAuthorization = "DeleteVPCAssociationAuthorization" type DeleteVPCAssociationAuthorizationRequest struct { *aws.Request Input *DeleteVPCAssociationAuthorizationInput + Copy func(*DeleteVPCAssociationAuthorizationInput) DeleteVPCAssociationAuthorizationRequest } // Send marshals and sends the DeleteVPCAssociationAuthorization API request. @@ -1269,7 +1287,7 @@ func (c *Route53) DeleteVPCAssociationAuthorizationRequest(input *DeleteVPCAssoc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteVPCAssociationAuthorizationRequest{Request: req, Input: input} + return DeleteVPCAssociationAuthorizationRequest{Request: req, Input: input, Copy: c.DeleteVPCAssociationAuthorizationRequest} } const opDisassociateVPCFromHostedZone = "DisassociateVPCFromHostedZone" @@ -1278,6 +1296,7 @@ const opDisassociateVPCFromHostedZone = "DisassociateVPCFromHostedZone" type DisassociateVPCFromHostedZoneRequest struct { *aws.Request Input *DisassociateVPCFromHostedZoneInput + Copy func(*DisassociateVPCFromHostedZoneInput) DisassociateVPCFromHostedZoneRequest } // Send marshals and sends the DisassociateVPCFromHostedZone API request. @@ -1324,7 +1343,7 @@ func (c *Route53) DisassociateVPCFromHostedZoneRequest(input *DisassociateVPCFro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateVPCFromHostedZoneRequest{Request: req, Input: input} + return DisassociateVPCFromHostedZoneRequest{Request: req, Input: input, Copy: c.DisassociateVPCFromHostedZoneRequest} } const opGetAccountLimit = "GetAccountLimit" @@ -1333,6 +1352,7 @@ const opGetAccountLimit = "GetAccountLimit" type GetAccountLimitRequest struct { *aws.Request Input *GetAccountLimitInput + Copy func(*GetAccountLimitInput) GetAccountLimitRequest } // Send marshals and sends the GetAccountLimit API request. @@ -1378,7 +1398,7 @@ func (c *Route53) GetAccountLimitRequest(input *GetAccountLimitInput) GetAccount req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccountLimitRequest{Request: req, Input: input} + return GetAccountLimitRequest{Request: req, Input: input, Copy: c.GetAccountLimitRequest} } const opGetChange = "GetChange" @@ -1387,6 +1407,7 @@ const opGetChange = "GetChange" type GetChangeRequest struct { *aws.Request Input *GetChangeInput + Copy func(*GetChangeInput) GetChangeRequest } // Send marshals and sends the GetChange API request. @@ -1435,7 +1456,7 @@ func (c *Route53) GetChangeRequest(input *GetChangeInput) GetChangeRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetChangeRequest{Request: req, Input: input} + return GetChangeRequest{Request: req, Input: input, Copy: c.GetChangeRequest} } const opGetCheckerIpRanges = "GetCheckerIpRanges" @@ -1444,6 +1465,7 @@ const opGetCheckerIpRanges = "GetCheckerIpRanges" type GetCheckerIpRangesRequest struct { *aws.Request Input *GetCheckerIpRangesInput + Copy func(*GetCheckerIpRangesInput) GetCheckerIpRangesRequest } // Send marshals and sends the GetCheckerIpRanges API request. @@ -1487,7 +1509,7 @@ func (c *Route53) GetCheckerIpRangesRequest(input *GetCheckerIpRangesInput) GetC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCheckerIpRangesRequest{Request: req, Input: input} + return GetCheckerIpRangesRequest{Request: req, Input: input, Copy: c.GetCheckerIpRangesRequest} } const opGetGeoLocation = "GetGeoLocation" @@ -1496,6 +1518,7 @@ const opGetGeoLocation = "GetGeoLocation" type GetGeoLocationRequest struct { *aws.Request Input *GetGeoLocationInput + Copy func(*GetGeoLocationInput) GetGeoLocationRequest } // Send marshals and sends the GetGeoLocation API request. @@ -1553,7 +1576,7 @@ func (c *Route53) GetGeoLocationRequest(input *GetGeoLocationInput) GetGeoLocati req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGeoLocationRequest{Request: req, Input: input} + return GetGeoLocationRequest{Request: req, Input: input, Copy: c.GetGeoLocationRequest} } const opGetHealthCheck = "GetHealthCheck" @@ -1562,6 +1585,7 @@ const opGetHealthCheck = "GetHealthCheck" type GetHealthCheckRequest struct { *aws.Request Input *GetHealthCheckInput + Copy func(*GetHealthCheckInput) GetHealthCheckRequest } // Send marshals and sends the GetHealthCheck API request. @@ -1602,7 +1626,7 @@ func (c *Route53) GetHealthCheckRequest(input *GetHealthCheckInput) GetHealthChe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHealthCheckRequest{Request: req, Input: input} + return GetHealthCheckRequest{Request: req, Input: input, Copy: c.GetHealthCheckRequest} } const opGetHealthCheckCount = "GetHealthCheckCount" @@ -1611,6 +1635,7 @@ const opGetHealthCheckCount = "GetHealthCheckCount" type GetHealthCheckCountRequest struct { *aws.Request Input *GetHealthCheckCountInput + Copy func(*GetHealthCheckCountInput) GetHealthCheckCountRequest } // Send marshals and sends the GetHealthCheckCount API request. @@ -1652,7 +1677,7 @@ func (c *Route53) GetHealthCheckCountRequest(input *GetHealthCheckCountInput) Ge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHealthCheckCountRequest{Request: req, Input: input} + return GetHealthCheckCountRequest{Request: req, Input: input, Copy: c.GetHealthCheckCountRequest} } const opGetHealthCheckLastFailureReason = "GetHealthCheckLastFailureReason" @@ -1661,6 +1686,7 @@ const opGetHealthCheckLastFailureReason = "GetHealthCheckLastFailureReason" type GetHealthCheckLastFailureReasonRequest struct { *aws.Request Input *GetHealthCheckLastFailureReasonInput + Copy func(*GetHealthCheckLastFailureReasonInput) GetHealthCheckLastFailureReasonRequest } // Send marshals and sends the GetHealthCheckLastFailureReason API request. @@ -1701,7 +1727,7 @@ func (c *Route53) GetHealthCheckLastFailureReasonRequest(input *GetHealthCheckLa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHealthCheckLastFailureReasonRequest{Request: req, Input: input} + return GetHealthCheckLastFailureReasonRequest{Request: req, Input: input, Copy: c.GetHealthCheckLastFailureReasonRequest} } const opGetHealthCheckStatus = "GetHealthCheckStatus" @@ -1710,6 +1736,7 @@ const opGetHealthCheckStatus = "GetHealthCheckStatus" type GetHealthCheckStatusRequest struct { *aws.Request Input *GetHealthCheckStatusInput + Copy func(*GetHealthCheckStatusInput) GetHealthCheckStatusRequest } // Send marshals and sends the GetHealthCheckStatus API request. @@ -1750,7 +1777,7 @@ func (c *Route53) GetHealthCheckStatusRequest(input *GetHealthCheckStatusInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHealthCheckStatusRequest{Request: req, Input: input} + return GetHealthCheckStatusRequest{Request: req, Input: input, Copy: c.GetHealthCheckStatusRequest} } const opGetHostedZone = "GetHostedZone" @@ -1759,6 +1786,7 @@ const opGetHostedZone = "GetHostedZone" type GetHostedZoneRequest struct { *aws.Request Input *GetHostedZoneInput + Copy func(*GetHostedZoneInput) GetHostedZoneRequest } // Send marshals and sends the GetHostedZone API request. @@ -1800,7 +1828,7 @@ func (c *Route53) GetHostedZoneRequest(input *GetHostedZoneInput) GetHostedZoneR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHostedZoneRequest{Request: req, Input: input} + return GetHostedZoneRequest{Request: req, Input: input, Copy: c.GetHostedZoneRequest} } const opGetHostedZoneCount = "GetHostedZoneCount" @@ -1809,6 +1837,7 @@ const opGetHostedZoneCount = "GetHostedZoneCount" type GetHostedZoneCountRequest struct { *aws.Request Input *GetHostedZoneCountInput + Copy func(*GetHostedZoneCountInput) GetHostedZoneCountRequest } // Send marshals and sends the GetHostedZoneCount API request. @@ -1850,7 +1879,7 @@ func (c *Route53) GetHostedZoneCountRequest(input *GetHostedZoneCountInput) GetH req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHostedZoneCountRequest{Request: req, Input: input} + return GetHostedZoneCountRequest{Request: req, Input: input, Copy: c.GetHostedZoneCountRequest} } const opGetHostedZoneLimit = "GetHostedZoneLimit" @@ -1859,6 +1888,7 @@ const opGetHostedZoneLimit = "GetHostedZoneLimit" type GetHostedZoneLimitRequest struct { *aws.Request Input *GetHostedZoneLimitInput + Copy func(*GetHostedZoneLimitInput) GetHostedZoneLimitRequest } // Send marshals and sends the GetHostedZoneLimit API request. @@ -1904,7 +1934,7 @@ func (c *Route53) GetHostedZoneLimitRequest(input *GetHostedZoneLimitInput) GetH req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetHostedZoneLimitRequest{Request: req, Input: input} + return GetHostedZoneLimitRequest{Request: req, Input: input, Copy: c.GetHostedZoneLimitRequest} } const opGetQueryLoggingConfig = "GetQueryLoggingConfig" @@ -1913,6 +1943,7 @@ const opGetQueryLoggingConfig = "GetQueryLoggingConfig" type GetQueryLoggingConfigRequest struct { *aws.Request Input *GetQueryLoggingConfigInput + Copy func(*GetQueryLoggingConfigInput) GetQueryLoggingConfigRequest } // Send marshals and sends the GetQueryLoggingConfig API request. @@ -1956,7 +1987,7 @@ func (c *Route53) GetQueryLoggingConfigRequest(input *GetQueryLoggingConfigInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetQueryLoggingConfigRequest{Request: req, Input: input} + return GetQueryLoggingConfigRequest{Request: req, Input: input, Copy: c.GetQueryLoggingConfigRequest} } const opGetReusableDelegationSet = "GetReusableDelegationSet" @@ -1965,6 +1996,7 @@ const opGetReusableDelegationSet = "GetReusableDelegationSet" type GetReusableDelegationSetRequest struct { *aws.Request Input *GetReusableDelegationSetInput + Copy func(*GetReusableDelegationSetInput) GetReusableDelegationSetRequest } // Send marshals and sends the GetReusableDelegationSet API request. @@ -2006,7 +2038,7 @@ func (c *Route53) GetReusableDelegationSetRequest(input *GetReusableDelegationSe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetReusableDelegationSetRequest{Request: req, Input: input} + return GetReusableDelegationSetRequest{Request: req, Input: input, Copy: c.GetReusableDelegationSetRequest} } const opGetReusableDelegationSetLimit = "GetReusableDelegationSetLimit" @@ -2015,6 +2047,7 @@ const opGetReusableDelegationSetLimit = "GetReusableDelegationSetLimit" type GetReusableDelegationSetLimitRequest struct { *aws.Request Input *GetReusableDelegationSetLimitInput + Copy func(*GetReusableDelegationSetLimitInput) GetReusableDelegationSetLimitRequest } // Send marshals and sends the GetReusableDelegationSetLimit API request. @@ -2060,7 +2093,7 @@ func (c *Route53) GetReusableDelegationSetLimitRequest(input *GetReusableDelegat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetReusableDelegationSetLimitRequest{Request: req, Input: input} + return GetReusableDelegationSetLimitRequest{Request: req, Input: input, Copy: c.GetReusableDelegationSetLimitRequest} } const opGetTrafficPolicy = "GetTrafficPolicy" @@ -2069,6 +2102,7 @@ const opGetTrafficPolicy = "GetTrafficPolicy" type GetTrafficPolicyRequest struct { *aws.Request Input *GetTrafficPolicyInput + Copy func(*GetTrafficPolicyInput) GetTrafficPolicyRequest } // Send marshals and sends the GetTrafficPolicy API request. @@ -2109,7 +2143,7 @@ func (c *Route53) GetTrafficPolicyRequest(input *GetTrafficPolicyInput) GetTraff req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTrafficPolicyRequest{Request: req, Input: input} + return GetTrafficPolicyRequest{Request: req, Input: input, Copy: c.GetTrafficPolicyRequest} } const opGetTrafficPolicyInstance = "GetTrafficPolicyInstance" @@ -2118,6 +2152,7 @@ const opGetTrafficPolicyInstance = "GetTrafficPolicyInstance" type GetTrafficPolicyInstanceRequest struct { *aws.Request Input *GetTrafficPolicyInstanceInput + Copy func(*GetTrafficPolicyInstanceInput) GetTrafficPolicyInstanceRequest } // Send marshals and sends the GetTrafficPolicyInstance API request. @@ -2166,7 +2201,7 @@ func (c *Route53) GetTrafficPolicyInstanceRequest(input *GetTrafficPolicyInstanc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTrafficPolicyInstanceRequest{Request: req, Input: input} + return GetTrafficPolicyInstanceRequest{Request: req, Input: input, Copy: c.GetTrafficPolicyInstanceRequest} } const opGetTrafficPolicyInstanceCount = "GetTrafficPolicyInstanceCount" @@ -2175,6 +2210,7 @@ const opGetTrafficPolicyInstanceCount = "GetTrafficPolicyInstanceCount" type GetTrafficPolicyInstanceCountRequest struct { *aws.Request Input *GetTrafficPolicyInstanceCountInput + Copy func(*GetTrafficPolicyInstanceCountInput) GetTrafficPolicyInstanceCountRequest } // Send marshals and sends the GetTrafficPolicyInstanceCount API request. @@ -2216,7 +2252,7 @@ func (c *Route53) GetTrafficPolicyInstanceCountRequest(input *GetTrafficPolicyIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTrafficPolicyInstanceCountRequest{Request: req, Input: input} + return GetTrafficPolicyInstanceCountRequest{Request: req, Input: input, Copy: c.GetTrafficPolicyInstanceCountRequest} } const opListGeoLocations = "ListGeoLocations" @@ -2225,6 +2261,7 @@ const opListGeoLocations = "ListGeoLocations" type ListGeoLocationsRequest struct { *aws.Request Input *ListGeoLocationsInput + Copy func(*ListGeoLocationsInput) ListGeoLocationsRequest } // Send marshals and sends the ListGeoLocations API request. @@ -2270,7 +2307,7 @@ func (c *Route53) ListGeoLocationsRequest(input *ListGeoLocationsInput) ListGeoL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGeoLocationsRequest{Request: req, Input: input} + return ListGeoLocationsRequest{Request: req, Input: input, Copy: c.ListGeoLocationsRequest} } const opListHealthChecks = "ListHealthChecks" @@ -2279,6 +2316,7 @@ const opListHealthChecks = "ListHealthChecks" type ListHealthChecksRequest struct { *aws.Request Input *ListHealthChecksInput + Copy func(*ListHealthChecksInput) ListHealthChecksRequest } // Send marshals and sends the ListHealthChecks API request. @@ -2326,57 +2364,53 @@ func (c *Route53) ListHealthChecksRequest(input *ListHealthChecksInput) ListHeal req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListHealthChecksRequest{Request: req, Input: input} + return ListHealthChecksRequest{Request: req, Input: input, Copy: c.ListHealthChecksRequest} } -// ListHealthChecksPages iterates over the pages of a ListHealthChecks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHealthChecks method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListHealthChecksRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListHealthChecks operation. -// pageNum := 0 -// err := client.ListHealthChecksPages(params, -// func(page *ListHealthChecksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Route53) ListHealthChecksPages(input *ListHealthChecksInput, fn func(*ListHealthChecksOutput, bool) bool) error { - return c.ListHealthChecksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHealthChecksPagesWithContext same as ListHealthChecksPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Route53) ListHealthChecksPagesWithContext(ctx aws.Context, input *ListHealthChecksInput, fn func(*ListHealthChecksOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListHealthChecksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListHealthChecksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListHealthChecksRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListHealthChecksRequest) Paginate(opts ...aws.Option) ListHealthChecksPager { + return ListHealthChecksPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListHealthChecksInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHealthChecksOutput), !p.HasNextPage()) - } - return p.Err() +// ListHealthChecksPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListHealthChecksPager struct { + aws.Pager +} + +func (p *ListHealthChecksPager) CurrentPage() *ListHealthChecksOutput { + return p.Pager.CurrentPage().(*ListHealthChecksOutput) } const opListHostedZones = "ListHostedZones" @@ -2385,6 +2419,7 @@ const opListHostedZones = "ListHostedZones" type ListHostedZonesRequest struct { *aws.Request Input *ListHostedZonesInput + Copy func(*ListHostedZonesInput) ListHostedZonesRequest } // Send marshals and sends the ListHostedZones API request. @@ -2437,57 +2472,53 @@ func (c *Route53) ListHostedZonesRequest(input *ListHostedZonesInput) ListHosted req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListHostedZonesRequest{Request: req, Input: input} + return ListHostedZonesRequest{Request: req, Input: input, Copy: c.ListHostedZonesRequest} } -// ListHostedZonesPages iterates over the pages of a ListHostedZones operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHostedZones method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListHostedZonesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListHostedZones operation. -// pageNum := 0 -// err := client.ListHostedZonesPages(params, -// func(page *ListHostedZonesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Route53) ListHostedZonesPages(input *ListHostedZonesInput, fn func(*ListHostedZonesOutput, bool) bool) error { - return c.ListHostedZonesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHostedZonesPagesWithContext same as ListHostedZonesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Route53) ListHostedZonesPagesWithContext(ctx aws.Context, input *ListHostedZonesInput, fn func(*ListHostedZonesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListHostedZonesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListHostedZonesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListHostedZonesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListHostedZonesRequest) Paginate(opts ...aws.Option) ListHostedZonesPager { + return ListHostedZonesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListHostedZonesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHostedZonesOutput), !p.HasNextPage()) - } - return p.Err() +// ListHostedZonesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListHostedZonesPager struct { + aws.Pager +} + +func (p *ListHostedZonesPager) CurrentPage() *ListHostedZonesOutput { + return p.Pager.CurrentPage().(*ListHostedZonesOutput) } const opListHostedZonesByName = "ListHostedZonesByName" @@ -2496,6 +2527,7 @@ const opListHostedZonesByName = "ListHostedZonesByName" type ListHostedZonesByNameRequest struct { *aws.Request Input *ListHostedZonesByNameInput + Copy func(*ListHostedZonesByNameInput) ListHostedZonesByNameRequest } // Send marshals and sends the ListHostedZonesByName API request. @@ -2585,7 +2617,7 @@ func (c *Route53) ListHostedZonesByNameRequest(input *ListHostedZonesByNameInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListHostedZonesByNameRequest{Request: req, Input: input} + return ListHostedZonesByNameRequest{Request: req, Input: input, Copy: c.ListHostedZonesByNameRequest} } const opListQueryLoggingConfigs = "ListQueryLoggingConfigs" @@ -2594,6 +2626,7 @@ const opListQueryLoggingConfigs = "ListQueryLoggingConfigs" type ListQueryLoggingConfigsRequest struct { *aws.Request Input *ListQueryLoggingConfigsInput + Copy func(*ListQueryLoggingConfigsInput) ListQueryLoggingConfigsRequest } // Send marshals and sends the ListQueryLoggingConfigs API request. @@ -2641,7 +2674,7 @@ func (c *Route53) ListQueryLoggingConfigsRequest(input *ListQueryLoggingConfigsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListQueryLoggingConfigsRequest{Request: req, Input: input} + return ListQueryLoggingConfigsRequest{Request: req, Input: input, Copy: c.ListQueryLoggingConfigsRequest} } const opListResourceRecordSets = "ListResourceRecordSets" @@ -2650,6 +2683,7 @@ const opListResourceRecordSets = "ListResourceRecordSets" type ListResourceRecordSetsRequest struct { *aws.Request Input *ListResourceRecordSetsInput + Copy func(*ListResourceRecordSetsInput) ListResourceRecordSetsRequest } // Send marshals and sends the ListResourceRecordSets API request. @@ -2734,57 +2768,53 @@ func (c *Route53) ListResourceRecordSetsRequest(input *ListResourceRecordSetsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourceRecordSetsRequest{Request: req, Input: input} + return ListResourceRecordSetsRequest{Request: req, Input: input, Copy: c.ListResourceRecordSetsRequest} } -// ListResourceRecordSetsPages iterates over the pages of a ListResourceRecordSets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListResourceRecordSets method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListResourceRecordSetsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListResourceRecordSets operation. -// pageNum := 0 -// err := client.ListResourceRecordSetsPages(params, -// func(page *ListResourceRecordSetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Route53) ListResourceRecordSetsPages(input *ListResourceRecordSetsInput, fn func(*ListResourceRecordSetsOutput, bool) bool) error { - return c.ListResourceRecordSetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListResourceRecordSetsPagesWithContext same as ListResourceRecordSetsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Route53) ListResourceRecordSetsPagesWithContext(ctx aws.Context, input *ListResourceRecordSetsInput, fn func(*ListResourceRecordSetsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListResourceRecordSetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListResourceRecordSetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListResourceRecordSetsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListResourceRecordSetsRequest) Paginate(opts ...aws.Option) ListResourceRecordSetsPager { + return ListResourceRecordSetsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListResourceRecordSetsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResourceRecordSetsOutput), !p.HasNextPage()) - } - return p.Err() +// ListResourceRecordSetsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListResourceRecordSetsPager struct { + aws.Pager +} + +func (p *ListResourceRecordSetsPager) CurrentPage() *ListResourceRecordSetsOutput { + return p.Pager.CurrentPage().(*ListResourceRecordSetsOutput) } const opListReusableDelegationSets = "ListReusableDelegationSets" @@ -2793,6 +2823,7 @@ const opListReusableDelegationSets = "ListReusableDelegationSets" type ListReusableDelegationSetsRequest struct { *aws.Request Input *ListReusableDelegationSetsInput + Copy func(*ListReusableDelegationSetsInput) ListReusableDelegationSetsRequest } // Send marshals and sends the ListReusableDelegationSets API request. @@ -2834,7 +2865,7 @@ func (c *Route53) ListReusableDelegationSetsRequest(input *ListReusableDelegatio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListReusableDelegationSetsRequest{Request: req, Input: input} + return ListReusableDelegationSetsRequest{Request: req, Input: input, Copy: c.ListReusableDelegationSetsRequest} } const opListTagsForResource = "ListTagsForResource" @@ -2843,6 +2874,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -2887,7 +2919,7 @@ func (c *Route53) ListTagsForResourceRequest(input *ListTagsForResourceInput) Li req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opListTagsForResources = "ListTagsForResources" @@ -2896,6 +2928,7 @@ const opListTagsForResources = "ListTagsForResources" type ListTagsForResourcesRequest struct { *aws.Request Input *ListTagsForResourcesInput + Copy func(*ListTagsForResourcesInput) ListTagsForResourcesRequest } // Send marshals and sends the ListTagsForResources API request. @@ -2940,7 +2973,7 @@ func (c *Route53) ListTagsForResourcesRequest(input *ListTagsForResourcesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourcesRequest{Request: req, Input: input} + return ListTagsForResourcesRequest{Request: req, Input: input, Copy: c.ListTagsForResourcesRequest} } const opListTrafficPolicies = "ListTrafficPolicies" @@ -2949,6 +2982,7 @@ const opListTrafficPolicies = "ListTrafficPolicies" type ListTrafficPoliciesRequest struct { *aws.Request Input *ListTrafficPoliciesInput + Copy func(*ListTrafficPoliciesInput) ListTrafficPoliciesRequest } // Send marshals and sends the ListTrafficPolicies API request. @@ -2991,7 +3025,7 @@ func (c *Route53) ListTrafficPoliciesRequest(input *ListTrafficPoliciesInput) Li req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTrafficPoliciesRequest{Request: req, Input: input} + return ListTrafficPoliciesRequest{Request: req, Input: input, Copy: c.ListTrafficPoliciesRequest} } const opListTrafficPolicyInstances = "ListTrafficPolicyInstances" @@ -3000,6 +3034,7 @@ const opListTrafficPolicyInstances = "ListTrafficPolicyInstances" type ListTrafficPolicyInstancesRequest struct { *aws.Request Input *ListTrafficPolicyInstancesInput + Copy func(*ListTrafficPolicyInstancesInput) ListTrafficPolicyInstancesRequest } // Send marshals and sends the ListTrafficPolicyInstances API request. @@ -3050,7 +3085,7 @@ func (c *Route53) ListTrafficPolicyInstancesRequest(input *ListTrafficPolicyInst req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTrafficPolicyInstancesRequest{Request: req, Input: input} + return ListTrafficPolicyInstancesRequest{Request: req, Input: input, Copy: c.ListTrafficPolicyInstancesRequest} } const opListTrafficPolicyInstancesByHostedZone = "ListTrafficPolicyInstancesByHostedZone" @@ -3059,6 +3094,7 @@ const opListTrafficPolicyInstancesByHostedZone = "ListTrafficPolicyInstancesByHo type ListTrafficPolicyInstancesByHostedZoneRequest struct { *aws.Request Input *ListTrafficPolicyInstancesByHostedZoneInput + Copy func(*ListTrafficPolicyInstancesByHostedZoneInput) ListTrafficPolicyInstancesByHostedZoneRequest } // Send marshals and sends the ListTrafficPolicyInstancesByHostedZone API request. @@ -3109,7 +3145,7 @@ func (c *Route53) ListTrafficPolicyInstancesByHostedZoneRequest(input *ListTraff req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTrafficPolicyInstancesByHostedZoneRequest{Request: req, Input: input} + return ListTrafficPolicyInstancesByHostedZoneRequest{Request: req, Input: input, Copy: c.ListTrafficPolicyInstancesByHostedZoneRequest} } const opListTrafficPolicyInstancesByPolicy = "ListTrafficPolicyInstancesByPolicy" @@ -3118,6 +3154,7 @@ const opListTrafficPolicyInstancesByPolicy = "ListTrafficPolicyInstancesByPolicy type ListTrafficPolicyInstancesByPolicyRequest struct { *aws.Request Input *ListTrafficPolicyInstancesByPolicyInput + Copy func(*ListTrafficPolicyInstancesByPolicyInput) ListTrafficPolicyInstancesByPolicyRequest } // Send marshals and sends the ListTrafficPolicyInstancesByPolicy API request. @@ -3168,7 +3205,7 @@ func (c *Route53) ListTrafficPolicyInstancesByPolicyRequest(input *ListTrafficPo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTrafficPolicyInstancesByPolicyRequest{Request: req, Input: input} + return ListTrafficPolicyInstancesByPolicyRequest{Request: req, Input: input, Copy: c.ListTrafficPolicyInstancesByPolicyRequest} } const opListTrafficPolicyVersions = "ListTrafficPolicyVersions" @@ -3177,6 +3214,7 @@ const opListTrafficPolicyVersions = "ListTrafficPolicyVersions" type ListTrafficPolicyVersionsRequest struct { *aws.Request Input *ListTrafficPolicyVersionsInput + Copy func(*ListTrafficPolicyVersionsInput) ListTrafficPolicyVersionsRequest } // Send marshals and sends the ListTrafficPolicyVersions API request. @@ -3219,7 +3257,7 @@ func (c *Route53) ListTrafficPolicyVersionsRequest(input *ListTrafficPolicyVersi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTrafficPolicyVersionsRequest{Request: req, Input: input} + return ListTrafficPolicyVersionsRequest{Request: req, Input: input, Copy: c.ListTrafficPolicyVersionsRequest} } const opListVPCAssociationAuthorizations = "ListVPCAssociationAuthorizations" @@ -3228,6 +3266,7 @@ const opListVPCAssociationAuthorizations = "ListVPCAssociationAuthorizations" type ListVPCAssociationAuthorizationsRequest struct { *aws.Request Input *ListVPCAssociationAuthorizationsInput + Copy func(*ListVPCAssociationAuthorizationsInput) ListVPCAssociationAuthorizationsRequest } // Send marshals and sends the ListVPCAssociationAuthorizations API request. @@ -3273,7 +3312,7 @@ func (c *Route53) ListVPCAssociationAuthorizationsRequest(input *ListVPCAssociat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListVPCAssociationAuthorizationsRequest{Request: req, Input: input} + return ListVPCAssociationAuthorizationsRequest{Request: req, Input: input, Copy: c.ListVPCAssociationAuthorizationsRequest} } const opTestDNSAnswer = "TestDNSAnswer" @@ -3282,6 +3321,7 @@ const opTestDNSAnswer = "TestDNSAnswer" type TestDNSAnswerRequest struct { *aws.Request Input *TestDNSAnswerInput + Copy func(*TestDNSAnswerInput) TestDNSAnswerRequest } // Send marshals and sends the TestDNSAnswer API request. @@ -3324,7 +3364,7 @@ func (c *Route53) TestDNSAnswerRequest(input *TestDNSAnswerInput) TestDNSAnswerR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestDNSAnswerRequest{Request: req, Input: input} + return TestDNSAnswerRequest{Request: req, Input: input, Copy: c.TestDNSAnswerRequest} } const opUpdateHealthCheck = "UpdateHealthCheck" @@ -3333,6 +3373,7 @@ const opUpdateHealthCheck = "UpdateHealthCheck" type UpdateHealthCheckRequest struct { *aws.Request Input *UpdateHealthCheckInput + Copy func(*UpdateHealthCheckInput) UpdateHealthCheckRequest } // Send marshals and sends the UpdateHealthCheck API request. @@ -3377,7 +3418,7 @@ func (c *Route53) UpdateHealthCheckRequest(input *UpdateHealthCheckInput) Update req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateHealthCheckRequest{Request: req, Input: input} + return UpdateHealthCheckRequest{Request: req, Input: input, Copy: c.UpdateHealthCheckRequest} } const opUpdateHostedZoneComment = "UpdateHostedZoneComment" @@ -3386,6 +3427,7 @@ const opUpdateHostedZoneComment = "UpdateHostedZoneComment" type UpdateHostedZoneCommentRequest struct { *aws.Request Input *UpdateHostedZoneCommentInput + Copy func(*UpdateHostedZoneCommentInput) UpdateHostedZoneCommentRequest } // Send marshals and sends the UpdateHostedZoneComment API request. @@ -3426,7 +3468,7 @@ func (c *Route53) UpdateHostedZoneCommentRequest(input *UpdateHostedZoneCommentI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateHostedZoneCommentRequest{Request: req, Input: input} + return UpdateHostedZoneCommentRequest{Request: req, Input: input, Copy: c.UpdateHostedZoneCommentRequest} } const opUpdateTrafficPolicyComment = "UpdateTrafficPolicyComment" @@ -3435,6 +3477,7 @@ const opUpdateTrafficPolicyComment = "UpdateTrafficPolicyComment" type UpdateTrafficPolicyCommentRequest struct { *aws.Request Input *UpdateTrafficPolicyCommentInput + Copy func(*UpdateTrafficPolicyCommentInput) UpdateTrafficPolicyCommentRequest } // Send marshals and sends the UpdateTrafficPolicyComment API request. @@ -3475,7 +3518,7 @@ func (c *Route53) UpdateTrafficPolicyCommentRequest(input *UpdateTrafficPolicyCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTrafficPolicyCommentRequest{Request: req, Input: input} + return UpdateTrafficPolicyCommentRequest{Request: req, Input: input, Copy: c.UpdateTrafficPolicyCommentRequest} } const opUpdateTrafficPolicyInstance = "UpdateTrafficPolicyInstance" @@ -3484,6 +3527,7 @@ const opUpdateTrafficPolicyInstance = "UpdateTrafficPolicyInstance" type UpdateTrafficPolicyInstanceRequest struct { *aws.Request Input *UpdateTrafficPolicyInstanceInput + Copy func(*UpdateTrafficPolicyInstanceInput) UpdateTrafficPolicyInstanceRequest } // Send marshals and sends the UpdateTrafficPolicyInstance API request. @@ -3542,7 +3586,7 @@ func (c *Route53) UpdateTrafficPolicyInstanceRequest(input *UpdateTrafficPolicyI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTrafficPolicyInstanceRequest{Request: req, Input: input} + return UpdateTrafficPolicyInstanceRequest{Request: req, Input: input, Copy: c.UpdateTrafficPolicyInstanceRequest} } // A complex type that contains the type of limit that you specified in the diff --git a/service/route53/route53iface/interface.go b/service/route53/route53iface/interface.go index 9def78f70bb..49e2527558e 100644 --- a/service/route53/route53iface/interface.go +++ b/service/route53/route53iface/interface.go @@ -139,23 +139,14 @@ type Route53API interface { ListHealthChecksRequest(*route53.ListHealthChecksInput) route53.ListHealthChecksRequest - ListHealthChecksPages(*route53.ListHealthChecksInput, func(*route53.ListHealthChecksOutput, bool) bool) error - ListHealthChecksPagesWithContext(aws.Context, *route53.ListHealthChecksInput, func(*route53.ListHealthChecksOutput, bool) bool, ...aws.Option) error - ListHostedZonesRequest(*route53.ListHostedZonesInput) route53.ListHostedZonesRequest - ListHostedZonesPages(*route53.ListHostedZonesInput, func(*route53.ListHostedZonesOutput, bool) bool) error - ListHostedZonesPagesWithContext(aws.Context, *route53.ListHostedZonesInput, func(*route53.ListHostedZonesOutput, bool) bool, ...aws.Option) error - ListHostedZonesByNameRequest(*route53.ListHostedZonesByNameInput) route53.ListHostedZonesByNameRequest ListQueryLoggingConfigsRequest(*route53.ListQueryLoggingConfigsInput) route53.ListQueryLoggingConfigsRequest ListResourceRecordSetsRequest(*route53.ListResourceRecordSetsInput) route53.ListResourceRecordSetsRequest - ListResourceRecordSetsPages(*route53.ListResourceRecordSetsInput, func(*route53.ListResourceRecordSetsOutput, bool) bool) error - ListResourceRecordSetsPagesWithContext(aws.Context, *route53.ListResourceRecordSetsInput, func(*route53.ListResourceRecordSetsOutput, bool) bool, ...aws.Option) error - ListReusableDelegationSetsRequest(*route53.ListReusableDelegationSetsInput) route53.ListReusableDelegationSetsRequest ListTagsForResourceRequest(*route53.ListTagsForResourceInput) route53.ListTagsForResourceRequest diff --git a/service/route53domains/api.go b/service/route53domains/api.go index 499f91459a9..74bd655c657 100644 --- a/service/route53domains/api.go +++ b/service/route53domains/api.go @@ -16,6 +16,7 @@ const opCheckDomainAvailability = "CheckDomainAvailability" type CheckDomainAvailabilityRequest struct { *aws.Request Input *CheckDomainAvailabilityInput + Copy func(*CheckDomainAvailabilityInput) CheckDomainAvailabilityRequest } // Send marshals and sends the CheckDomainAvailability API request. @@ -58,7 +59,7 @@ func (c *Route53Domains) CheckDomainAvailabilityRequest(input *CheckDomainAvaila req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CheckDomainAvailabilityRequest{Request: req, Input: input} + return CheckDomainAvailabilityRequest{Request: req, Input: input, Copy: c.CheckDomainAvailabilityRequest} } const opCheckDomainTransferability = "CheckDomainTransferability" @@ -67,6 +68,7 @@ const opCheckDomainTransferability = "CheckDomainTransferability" type CheckDomainTransferabilityRequest struct { *aws.Request Input *CheckDomainTransferabilityInput + Copy func(*CheckDomainTransferabilityInput) CheckDomainTransferabilityRequest } // Send marshals and sends the CheckDomainTransferability API request. @@ -107,7 +109,7 @@ func (c *Route53Domains) CheckDomainTransferabilityRequest(input *CheckDomainTra req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CheckDomainTransferabilityRequest{Request: req, Input: input} + return CheckDomainTransferabilityRequest{Request: req, Input: input, Copy: c.CheckDomainTransferabilityRequest} } const opDeleteTagsForDomain = "DeleteTagsForDomain" @@ -116,6 +118,7 @@ const opDeleteTagsForDomain = "DeleteTagsForDomain" type DeleteTagsForDomainRequest struct { *aws.Request Input *DeleteTagsForDomainInput + Copy func(*DeleteTagsForDomainInput) DeleteTagsForDomainRequest } // Send marshals and sends the DeleteTagsForDomain API request. @@ -159,7 +162,7 @@ func (c *Route53Domains) DeleteTagsForDomainRequest(input *DeleteTagsForDomainIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTagsForDomainRequest{Request: req, Input: input} + return DeleteTagsForDomainRequest{Request: req, Input: input, Copy: c.DeleteTagsForDomainRequest} } const opDisableDomainAutoRenew = "DisableDomainAutoRenew" @@ -168,6 +171,7 @@ const opDisableDomainAutoRenew = "DisableDomainAutoRenew" type DisableDomainAutoRenewRequest struct { *aws.Request Input *DisableDomainAutoRenewInput + Copy func(*DisableDomainAutoRenewInput) DisableDomainAutoRenewRequest } // Send marshals and sends the DisableDomainAutoRenew API request. @@ -209,7 +213,7 @@ func (c *Route53Domains) DisableDomainAutoRenewRequest(input *DisableDomainAutoR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableDomainAutoRenewRequest{Request: req, Input: input} + return DisableDomainAutoRenewRequest{Request: req, Input: input, Copy: c.DisableDomainAutoRenewRequest} } const opDisableDomainTransferLock = "DisableDomainTransferLock" @@ -218,6 +222,7 @@ const opDisableDomainTransferLock = "DisableDomainTransferLock" type DisableDomainTransferLockRequest struct { *aws.Request Input *DisableDomainTransferLockInput + Copy func(*DisableDomainTransferLockInput) DisableDomainTransferLockRequest } // Send marshals and sends the DisableDomainTransferLock API request. @@ -264,7 +269,7 @@ func (c *Route53Domains) DisableDomainTransferLockRequest(input *DisableDomainTr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableDomainTransferLockRequest{Request: req, Input: input} + return DisableDomainTransferLockRequest{Request: req, Input: input, Copy: c.DisableDomainTransferLockRequest} } const opEnableDomainAutoRenew = "EnableDomainAutoRenew" @@ -273,6 +278,7 @@ const opEnableDomainAutoRenew = "EnableDomainAutoRenew" type EnableDomainAutoRenewRequest struct { *aws.Request Input *EnableDomainAutoRenewInput + Copy func(*EnableDomainAutoRenewInput) EnableDomainAutoRenewRequest } // Send marshals and sends the EnableDomainAutoRenew API request. @@ -322,7 +328,7 @@ func (c *Route53Domains) EnableDomainAutoRenewRequest(input *EnableDomainAutoRen req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableDomainAutoRenewRequest{Request: req, Input: input} + return EnableDomainAutoRenewRequest{Request: req, Input: input, Copy: c.EnableDomainAutoRenewRequest} } const opEnableDomainTransferLock = "EnableDomainTransferLock" @@ -331,6 +337,7 @@ const opEnableDomainTransferLock = "EnableDomainTransferLock" type EnableDomainTransferLockRequest struct { *aws.Request Input *EnableDomainTransferLockInput + Copy func(*EnableDomainTransferLockInput) EnableDomainTransferLockRequest } // Send marshals and sends the EnableDomainTransferLock API request. @@ -375,7 +382,7 @@ func (c *Route53Domains) EnableDomainTransferLockRequest(input *EnableDomainTran req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return EnableDomainTransferLockRequest{Request: req, Input: input} + return EnableDomainTransferLockRequest{Request: req, Input: input, Copy: c.EnableDomainTransferLockRequest} } const opGetContactReachabilityStatus = "GetContactReachabilityStatus" @@ -384,6 +391,7 @@ const opGetContactReachabilityStatus = "GetContactReachabilityStatus" type GetContactReachabilityStatusRequest struct { *aws.Request Input *GetContactReachabilityStatusInput + Copy func(*GetContactReachabilityStatusInput) GetContactReachabilityStatusRequest } // Send marshals and sends the GetContactReachabilityStatus API request. @@ -429,7 +437,7 @@ func (c *Route53Domains) GetContactReachabilityStatusRequest(input *GetContactRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetContactReachabilityStatusRequest{Request: req, Input: input} + return GetContactReachabilityStatusRequest{Request: req, Input: input, Copy: c.GetContactReachabilityStatusRequest} } const opGetDomainDetail = "GetDomainDetail" @@ -438,6 +446,7 @@ const opGetDomainDetail = "GetDomainDetail" type GetDomainDetailRequest struct { *aws.Request Input *GetDomainDetailInput + Copy func(*GetDomainDetailInput) GetDomainDetailRequest } // Send marshals and sends the GetDomainDetail API request. @@ -480,7 +489,7 @@ func (c *Route53Domains) GetDomainDetailRequest(input *GetDomainDetailInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDomainDetailRequest{Request: req, Input: input} + return GetDomainDetailRequest{Request: req, Input: input, Copy: c.GetDomainDetailRequest} } const opGetDomainSuggestions = "GetDomainSuggestions" @@ -489,6 +498,7 @@ const opGetDomainSuggestions = "GetDomainSuggestions" type GetDomainSuggestionsRequest struct { *aws.Request Input *GetDomainSuggestionsInput + Copy func(*GetDomainSuggestionsInput) GetDomainSuggestionsRequest } // Send marshals and sends the GetDomainSuggestions API request. @@ -531,7 +541,7 @@ func (c *Route53Domains) GetDomainSuggestionsRequest(input *GetDomainSuggestions req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDomainSuggestionsRequest{Request: req, Input: input} + return GetDomainSuggestionsRequest{Request: req, Input: input, Copy: c.GetDomainSuggestionsRequest} } const opGetOperationDetail = "GetOperationDetail" @@ -540,6 +550,7 @@ const opGetOperationDetail = "GetOperationDetail" type GetOperationDetailRequest struct { *aws.Request Input *GetOperationDetailInput + Copy func(*GetOperationDetailInput) GetOperationDetailRequest } // Send marshals and sends the GetOperationDetail API request. @@ -580,7 +591,7 @@ func (c *Route53Domains) GetOperationDetailRequest(input *GetOperationDetailInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOperationDetailRequest{Request: req, Input: input} + return GetOperationDetailRequest{Request: req, Input: input, Copy: c.GetOperationDetailRequest} } const opListDomains = "ListDomains" @@ -589,6 +600,7 @@ const opListDomains = "ListDomains" type ListDomainsRequest struct { *aws.Request Input *ListDomainsInput + Copy func(*ListDomainsInput) ListDomainsRequest } // Send marshals and sends the ListDomains API request. @@ -636,57 +648,53 @@ func (c *Route53Domains) ListDomainsRequest(input *ListDomainsInput) ListDomains req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDomainsRequest{Request: req, Input: input} + return ListDomainsRequest{Request: req, Input: input, Copy: c.ListDomainsRequest} } -// ListDomainsPages iterates over the pages of a ListDomains operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDomains method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDomainsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDomains operation. -// pageNum := 0 -// err := client.ListDomainsPages(params, -// func(page *ListDomainsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListDomainsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Route53Domains) ListDomainsPages(input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool) error { - return c.ListDomainsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDomainsPagesWithContext same as ListDomainsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Route53Domains) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDomainsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDomainsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListDomainsRequest) Paginate(opts ...aws.Option) ListDomainsPager { + return ListDomainsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDomainsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDomainsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDomainsPager struct { + aws.Pager +} + +func (p *ListDomainsPager) CurrentPage() *ListDomainsOutput { + return p.Pager.CurrentPage().(*ListDomainsOutput) } const opListOperations = "ListOperations" @@ -695,6 +703,7 @@ const opListOperations = "ListOperations" type ListOperationsRequest struct { *aws.Request Input *ListOperationsInput + Copy func(*ListOperationsInput) ListOperationsRequest } // Send marshals and sends the ListOperations API request. @@ -741,57 +750,53 @@ func (c *Route53Domains) ListOperationsRequest(input *ListOperationsInput) ListO req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOperationsRequest{Request: req, Input: input} + return ListOperationsRequest{Request: req, Input: input, Copy: c.ListOperationsRequest} } -// ListOperationsPages iterates over the pages of a ListOperations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOperations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListOperationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListOperations operation. -// pageNum := 0 -// err := client.ListOperationsPages(params, -// func(page *ListOperationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListOperationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *Route53Domains) ListOperationsPages(input *ListOperationsInput, fn func(*ListOperationsOutput, bool) bool) error { - return c.ListOperationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOperationsPagesWithContext same as ListOperationsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Route53Domains) ListOperationsPagesWithContext(ctx aws.Context, input *ListOperationsInput, fn func(*ListOperationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListOperationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListOperationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListOperationsRequest) Paginate(opts ...aws.Option) ListOperationsPager { + return ListOperationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListOperationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOperationsOutput), !p.HasNextPage()) - } - return p.Err() +// ListOperationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListOperationsPager struct { + aws.Pager +} + +func (p *ListOperationsPager) CurrentPage() *ListOperationsOutput { + return p.Pager.CurrentPage().(*ListOperationsOutput) } const opListTagsForDomain = "ListTagsForDomain" @@ -800,6 +805,7 @@ const opListTagsForDomain = "ListTagsForDomain" type ListTagsForDomainRequest struct { *aws.Request Input *ListTagsForDomainInput + Copy func(*ListTagsForDomainInput) ListTagsForDomainRequest } // Send marshals and sends the ListTagsForDomain API request. @@ -844,7 +850,7 @@ func (c *Route53Domains) ListTagsForDomainRequest(input *ListTagsForDomainInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForDomainRequest{Request: req, Input: input} + return ListTagsForDomainRequest{Request: req, Input: input, Copy: c.ListTagsForDomainRequest} } const opRegisterDomain = "RegisterDomain" @@ -853,6 +859,7 @@ const opRegisterDomain = "RegisterDomain" type RegisterDomainRequest struct { *aws.Request Input *RegisterDomainInput + Copy func(*RegisterDomainInput) RegisterDomainRequest } // Send marshals and sends the RegisterDomain API request. @@ -917,7 +924,7 @@ func (c *Route53Domains) RegisterDomainRequest(input *RegisterDomainInput) Regis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterDomainRequest{Request: req, Input: input} + return RegisterDomainRequest{Request: req, Input: input, Copy: c.RegisterDomainRequest} } const opRenewDomain = "RenewDomain" @@ -926,6 +933,7 @@ const opRenewDomain = "RenewDomain" type RenewDomainRequest struct { *aws.Request Input *RenewDomainInput + Copy func(*RenewDomainInput) RenewDomainRequest } // Send marshals and sends the RenewDomain API request. @@ -973,7 +981,7 @@ func (c *Route53Domains) RenewDomainRequest(input *RenewDomainInput) RenewDomain req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RenewDomainRequest{Request: req, Input: input} + return RenewDomainRequest{Request: req, Input: input, Copy: c.RenewDomainRequest} } const opResendContactReachabilityEmail = "ResendContactReachabilityEmail" @@ -982,6 +990,7 @@ const opResendContactReachabilityEmail = "ResendContactReachabilityEmail" type ResendContactReachabilityEmailRequest struct { *aws.Request Input *ResendContactReachabilityEmailInput + Copy func(*ResendContactReachabilityEmailInput) ResendContactReachabilityEmailRequest } // Send marshals and sends the ResendContactReachabilityEmail API request. @@ -1024,7 +1033,7 @@ func (c *Route53Domains) ResendContactReachabilityEmailRequest(input *ResendCont req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResendContactReachabilityEmailRequest{Request: req, Input: input} + return ResendContactReachabilityEmailRequest{Request: req, Input: input, Copy: c.ResendContactReachabilityEmailRequest} } const opRetrieveDomainAuthCode = "RetrieveDomainAuthCode" @@ -1033,6 +1042,7 @@ const opRetrieveDomainAuthCode = "RetrieveDomainAuthCode" type RetrieveDomainAuthCodeRequest struct { *aws.Request Input *RetrieveDomainAuthCodeInput + Copy func(*RetrieveDomainAuthCodeInput) RetrieveDomainAuthCodeRequest } // Send marshals and sends the RetrieveDomainAuthCode API request. @@ -1074,7 +1084,7 @@ func (c *Route53Domains) RetrieveDomainAuthCodeRequest(input *RetrieveDomainAuth req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RetrieveDomainAuthCodeRequest{Request: req, Input: input} + return RetrieveDomainAuthCodeRequest{Request: req, Input: input, Copy: c.RetrieveDomainAuthCodeRequest} } const opTransferDomain = "TransferDomain" @@ -1083,6 +1093,7 @@ const opTransferDomain = "TransferDomain" type TransferDomainRequest struct { *aws.Request Input *TransferDomainInput + Copy func(*TransferDomainInput) TransferDomainRequest } // Send marshals and sends the TransferDomain API request. @@ -1147,7 +1158,7 @@ func (c *Route53Domains) TransferDomainRequest(input *TransferDomainInput) Trans req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TransferDomainRequest{Request: req, Input: input} + return TransferDomainRequest{Request: req, Input: input, Copy: c.TransferDomainRequest} } const opUpdateDomainContact = "UpdateDomainContact" @@ -1156,6 +1167,7 @@ const opUpdateDomainContact = "UpdateDomainContact" type UpdateDomainContactRequest struct { *aws.Request Input *UpdateDomainContactInput + Copy func(*UpdateDomainContactInput) UpdateDomainContactRequest } // Send marshals and sends the UpdateDomainContact API request. @@ -1203,7 +1215,7 @@ func (c *Route53Domains) UpdateDomainContactRequest(input *UpdateDomainContactIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDomainContactRequest{Request: req, Input: input} + return UpdateDomainContactRequest{Request: req, Input: input, Copy: c.UpdateDomainContactRequest} } const opUpdateDomainContactPrivacy = "UpdateDomainContactPrivacy" @@ -1212,6 +1224,7 @@ const opUpdateDomainContactPrivacy = "UpdateDomainContactPrivacy" type UpdateDomainContactPrivacyRequest struct { *aws.Request Input *UpdateDomainContactPrivacyInput + Copy func(*UpdateDomainContactPrivacyInput) UpdateDomainContactPrivacyRequest } // Send marshals and sends the UpdateDomainContactPrivacy API request. @@ -1262,7 +1275,7 @@ func (c *Route53Domains) UpdateDomainContactPrivacyRequest(input *UpdateDomainCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDomainContactPrivacyRequest{Request: req, Input: input} + return UpdateDomainContactPrivacyRequest{Request: req, Input: input, Copy: c.UpdateDomainContactPrivacyRequest} } const opUpdateDomainNameservers = "UpdateDomainNameservers" @@ -1271,6 +1284,7 @@ const opUpdateDomainNameservers = "UpdateDomainNameservers" type UpdateDomainNameserversRequest struct { *aws.Request Input *UpdateDomainNameserversInput + Copy func(*UpdateDomainNameserversInput) UpdateDomainNameserversRequest } // Send marshals and sends the UpdateDomainNameservers API request. @@ -1318,7 +1332,7 @@ func (c *Route53Domains) UpdateDomainNameserversRequest(input *UpdateDomainNames req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDomainNameserversRequest{Request: req, Input: input} + return UpdateDomainNameserversRequest{Request: req, Input: input, Copy: c.UpdateDomainNameserversRequest} } const opUpdateTagsForDomain = "UpdateTagsForDomain" @@ -1327,6 +1341,7 @@ const opUpdateTagsForDomain = "UpdateTagsForDomain" type UpdateTagsForDomainRequest struct { *aws.Request Input *UpdateTagsForDomainInput + Copy func(*UpdateTagsForDomainInput) UpdateTagsForDomainRequest } // Send marshals and sends the UpdateTagsForDomain API request. @@ -1370,7 +1385,7 @@ func (c *Route53Domains) UpdateTagsForDomainRequest(input *UpdateTagsForDomainIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTagsForDomainRequest{Request: req, Input: input} + return UpdateTagsForDomainRequest{Request: req, Input: input, Copy: c.UpdateTagsForDomainRequest} } const opViewBilling = "ViewBilling" @@ -1379,6 +1394,7 @@ const opViewBilling = "ViewBilling" type ViewBillingRequest struct { *aws.Request Input *ViewBillingInput + Copy func(*ViewBillingInput) ViewBillingRequest } // Send marshals and sends the ViewBilling API request. @@ -1420,7 +1436,7 @@ func (c *Route53Domains) ViewBillingRequest(input *ViewBillingInput) ViewBilling req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ViewBillingRequest{Request: req, Input: input} + return ViewBillingRequest{Request: req, Input: input, Copy: c.ViewBillingRequest} } // Information for one billing record. diff --git a/service/route53domains/route53domainsiface/interface.go b/service/route53domains/route53domainsiface/interface.go index 12411403aad..d3926abcd37 100644 --- a/service/route53domains/route53domainsiface/interface.go +++ b/service/route53domains/route53domainsiface/interface.go @@ -9,7 +9,6 @@ package route53domainsiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/route53domains" ) @@ -87,14 +86,8 @@ type Route53DomainsAPI interface { ListDomainsRequest(*route53domains.ListDomainsInput) route53domains.ListDomainsRequest - ListDomainsPages(*route53domains.ListDomainsInput, func(*route53domains.ListDomainsOutput, bool) bool) error - ListDomainsPagesWithContext(aws.Context, *route53domains.ListDomainsInput, func(*route53domains.ListDomainsOutput, bool) bool, ...aws.Option) error - ListOperationsRequest(*route53domains.ListOperationsInput) route53domains.ListOperationsRequest - ListOperationsPages(*route53domains.ListOperationsInput, func(*route53domains.ListOperationsOutput, bool) bool) error - ListOperationsPagesWithContext(aws.Context, *route53domains.ListOperationsInput, func(*route53domains.ListOperationsOutput, bool) bool, ...aws.Option) error - ListTagsForDomainRequest(*route53domains.ListTagsForDomainInput) route53domains.ListTagsForDomainRequest RegisterDomainRequest(*route53domains.RegisterDomainInput) route53domains.RegisterDomainRequest diff --git a/service/s3/api.go b/service/s3/api.go index 3f2de102eb9..382dc528183 100644 --- a/service/s3/api.go +++ b/service/s3/api.go @@ -19,6 +19,7 @@ const opAbortMultipartUpload = "AbortMultipartUpload" type AbortMultipartUploadRequest struct { *aws.Request Input *AbortMultipartUploadInput + Copy func(*AbortMultipartUploadInput) AbortMultipartUploadRequest } // Send marshals and sends the AbortMultipartUpload API request. @@ -63,7 +64,7 @@ func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) Abort req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AbortMultipartUploadRequest{Request: req, Input: input} + return AbortMultipartUploadRequest{Request: req, Input: input, Copy: c.AbortMultipartUploadRequest} } const opCompleteMultipartUpload = "CompleteMultipartUpload" @@ -72,6 +73,7 @@ const opCompleteMultipartUpload = "CompleteMultipartUpload" type CompleteMultipartUploadRequest struct { *aws.Request Input *CompleteMultipartUploadInput + Copy func(*CompleteMultipartUploadInput) CompleteMultipartUploadRequest } // Send marshals and sends the CompleteMultipartUpload API request. @@ -112,7 +114,7 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CompleteMultipartUploadRequest{Request: req, Input: input} + return CompleteMultipartUploadRequest{Request: req, Input: input, Copy: c.CompleteMultipartUploadRequest} } const opCopyObject = "CopyObject" @@ -121,6 +123,7 @@ const opCopyObject = "CopyObject" type CopyObjectRequest struct { *aws.Request Input *CopyObjectInput + Copy func(*CopyObjectInput) CopyObjectRequest } // Send marshals and sends the CopyObject API request. @@ -161,7 +164,7 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) CopyObjectRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyObjectRequest{Request: req, Input: input} + return CopyObjectRequest{Request: req, Input: input, Copy: c.CopyObjectRequest} } const opCreateBucket = "CreateBucket" @@ -170,6 +173,7 @@ const opCreateBucket = "CreateBucket" type CreateBucketRequest struct { *aws.Request Input *CreateBucketInput + Copy func(*CreateBucketInput) CreateBucketRequest } // Send marshals and sends the CreateBucket API request. @@ -210,7 +214,7 @@ func (c *S3) CreateBucketRequest(input *CreateBucketInput) CreateBucketRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateBucketRequest{Request: req, Input: input} + return CreateBucketRequest{Request: req, Input: input, Copy: c.CreateBucketRequest} } const opCreateMultipartUpload = "CreateMultipartUpload" @@ -219,6 +223,7 @@ const opCreateMultipartUpload = "CreateMultipartUpload" type CreateMultipartUploadRequest struct { *aws.Request Input *CreateMultipartUploadInput + Copy func(*CreateMultipartUploadInput) CreateMultipartUploadRequest } // Send marshals and sends the CreateMultipartUpload API request. @@ -265,7 +270,7 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateMultipartUploadRequest{Request: req, Input: input} + return CreateMultipartUploadRequest{Request: req, Input: input, Copy: c.CreateMultipartUploadRequest} } const opDeleteBucket = "DeleteBucket" @@ -274,6 +279,7 @@ const opDeleteBucket = "DeleteBucket" type DeleteBucketRequest struct { *aws.Request Input *DeleteBucketInput + Copy func(*DeleteBucketInput) DeleteBucketRequest } // Send marshals and sends the DeleteBucket API request. @@ -317,7 +323,7 @@ func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) DeleteBucketRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketRequest{Request: req, Input: input} + return DeleteBucketRequest{Request: req, Input: input, Copy: c.DeleteBucketRequest} } const opDeleteBucketAnalyticsConfiguration = "DeleteBucketAnalyticsConfiguration" @@ -326,6 +332,7 @@ const opDeleteBucketAnalyticsConfiguration = "DeleteBucketAnalyticsConfiguration type DeleteBucketAnalyticsConfigurationRequest struct { *aws.Request Input *DeleteBucketAnalyticsConfigurationInput + Copy func(*DeleteBucketAnalyticsConfigurationInput) DeleteBucketAnalyticsConfigurationRequest } // Send marshals and sends the DeleteBucketAnalyticsConfiguration API request. @@ -369,7 +376,7 @@ func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyt req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketAnalyticsConfigurationRequest{Request: req, Input: input} + return DeleteBucketAnalyticsConfigurationRequest{Request: req, Input: input, Copy: c.DeleteBucketAnalyticsConfigurationRequest} } const opDeleteBucketCors = "DeleteBucketCors" @@ -378,6 +385,7 @@ const opDeleteBucketCors = "DeleteBucketCors" type DeleteBucketCorsRequest struct { *aws.Request Input *DeleteBucketCorsInput + Copy func(*DeleteBucketCorsInput) DeleteBucketCorsRequest } // Send marshals and sends the DeleteBucketCors API request. @@ -420,7 +428,7 @@ func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) DeleteBucketC req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketCorsRequest{Request: req, Input: input} + return DeleteBucketCorsRequest{Request: req, Input: input, Copy: c.DeleteBucketCorsRequest} } const opDeleteBucketEncryption = "DeleteBucketEncryption" @@ -429,6 +437,7 @@ const opDeleteBucketEncryption = "DeleteBucketEncryption" type DeleteBucketEncryptionRequest struct { *aws.Request Input *DeleteBucketEncryptionInput + Copy func(*DeleteBucketEncryptionInput) DeleteBucketEncryptionRequest } // Send marshals and sends the DeleteBucketEncryption API request. @@ -471,7 +480,7 @@ func (c *S3) DeleteBucketEncryptionRequest(input *DeleteBucketEncryptionInput) D req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketEncryptionRequest{Request: req, Input: input} + return DeleteBucketEncryptionRequest{Request: req, Input: input, Copy: c.DeleteBucketEncryptionRequest} } const opDeleteBucketInventoryConfiguration = "DeleteBucketInventoryConfiguration" @@ -480,6 +489,7 @@ const opDeleteBucketInventoryConfiguration = "DeleteBucketInventoryConfiguration type DeleteBucketInventoryConfigurationRequest struct { *aws.Request Input *DeleteBucketInventoryConfigurationInput + Copy func(*DeleteBucketInventoryConfigurationInput) DeleteBucketInventoryConfigurationRequest } // Send marshals and sends the DeleteBucketInventoryConfiguration API request. @@ -523,7 +533,7 @@ func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInvent req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketInventoryConfigurationRequest{Request: req, Input: input} + return DeleteBucketInventoryConfigurationRequest{Request: req, Input: input, Copy: c.DeleteBucketInventoryConfigurationRequest} } const opDeleteBucketLifecycle = "DeleteBucketLifecycle" @@ -532,6 +542,7 @@ const opDeleteBucketLifecycle = "DeleteBucketLifecycle" type DeleteBucketLifecycleRequest struct { *aws.Request Input *DeleteBucketLifecycleInput + Copy func(*DeleteBucketLifecycleInput) DeleteBucketLifecycleRequest } // Send marshals and sends the DeleteBucketLifecycle API request. @@ -574,7 +585,7 @@ func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) Del req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketLifecycleRequest{Request: req, Input: input} + return DeleteBucketLifecycleRequest{Request: req, Input: input, Copy: c.DeleteBucketLifecycleRequest} } const opDeleteBucketMetricsConfiguration = "DeleteBucketMetricsConfiguration" @@ -583,6 +594,7 @@ const opDeleteBucketMetricsConfiguration = "DeleteBucketMetricsConfiguration" type DeleteBucketMetricsConfigurationRequest struct { *aws.Request Input *DeleteBucketMetricsConfigurationInput + Copy func(*DeleteBucketMetricsConfigurationInput) DeleteBucketMetricsConfigurationRequest } // Send marshals and sends the DeleteBucketMetricsConfiguration API request. @@ -626,7 +638,7 @@ func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsC req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketMetricsConfigurationRequest{Request: req, Input: input} + return DeleteBucketMetricsConfigurationRequest{Request: req, Input: input, Copy: c.DeleteBucketMetricsConfigurationRequest} } const opDeleteBucketPolicy = "DeleteBucketPolicy" @@ -635,6 +647,7 @@ const opDeleteBucketPolicy = "DeleteBucketPolicy" type DeleteBucketPolicyRequest struct { *aws.Request Input *DeleteBucketPolicyInput + Copy func(*DeleteBucketPolicyInput) DeleteBucketPolicyRequest } // Send marshals and sends the DeleteBucketPolicy API request. @@ -677,7 +690,7 @@ func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) DeleteBuc req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketPolicyRequest{Request: req, Input: input} + return DeleteBucketPolicyRequest{Request: req, Input: input, Copy: c.DeleteBucketPolicyRequest} } const opDeleteBucketReplication = "DeleteBucketReplication" @@ -686,6 +699,7 @@ const opDeleteBucketReplication = "DeleteBucketReplication" type DeleteBucketReplicationRequest struct { *aws.Request Input *DeleteBucketReplicationInput + Copy func(*DeleteBucketReplicationInput) DeleteBucketReplicationRequest } // Send marshals and sends the DeleteBucketReplication API request. @@ -728,7 +742,7 @@ func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketReplicationRequest{Request: req, Input: input} + return DeleteBucketReplicationRequest{Request: req, Input: input, Copy: c.DeleteBucketReplicationRequest} } const opDeleteBucketTagging = "DeleteBucketTagging" @@ -737,6 +751,7 @@ const opDeleteBucketTagging = "DeleteBucketTagging" type DeleteBucketTaggingRequest struct { *aws.Request Input *DeleteBucketTaggingInput + Copy func(*DeleteBucketTaggingInput) DeleteBucketTaggingRequest } // Send marshals and sends the DeleteBucketTagging API request. @@ -779,7 +794,7 @@ func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) DeleteB req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketTaggingRequest{Request: req, Input: input} + return DeleteBucketTaggingRequest{Request: req, Input: input, Copy: c.DeleteBucketTaggingRequest} } const opDeleteBucketWebsite = "DeleteBucketWebsite" @@ -788,6 +803,7 @@ const opDeleteBucketWebsite = "DeleteBucketWebsite" type DeleteBucketWebsiteRequest struct { *aws.Request Input *DeleteBucketWebsiteInput + Copy func(*DeleteBucketWebsiteInput) DeleteBucketWebsiteRequest } // Send marshals and sends the DeleteBucketWebsite API request. @@ -830,7 +846,7 @@ func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) DeleteB req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteBucketWebsiteRequest{Request: req, Input: input} + return DeleteBucketWebsiteRequest{Request: req, Input: input, Copy: c.DeleteBucketWebsiteRequest} } const opDeleteObject = "DeleteObject" @@ -839,6 +855,7 @@ const opDeleteObject = "DeleteObject" type DeleteObjectRequest struct { *aws.Request Input *DeleteObjectInput + Copy func(*DeleteObjectInput) DeleteObjectRequest } // Send marshals and sends the DeleteObject API request. @@ -881,7 +898,7 @@ func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) DeleteObjectRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteObjectRequest{Request: req, Input: input} + return DeleteObjectRequest{Request: req, Input: input, Copy: c.DeleteObjectRequest} } const opDeleteObjectTagging = "DeleteObjectTagging" @@ -890,6 +907,7 @@ const opDeleteObjectTagging = "DeleteObjectTagging" type DeleteObjectTaggingRequest struct { *aws.Request Input *DeleteObjectTaggingInput + Copy func(*DeleteObjectTaggingInput) DeleteObjectTaggingRequest } // Send marshals and sends the DeleteObjectTagging API request. @@ -930,7 +948,7 @@ func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) DeleteO req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteObjectTaggingRequest{Request: req, Input: input} + return DeleteObjectTaggingRequest{Request: req, Input: input, Copy: c.DeleteObjectTaggingRequest} } const opDeleteObjects = "DeleteObjects" @@ -939,6 +957,7 @@ const opDeleteObjects = "DeleteObjects" type DeleteObjectsRequest struct { *aws.Request Input *DeleteObjectsInput + Copy func(*DeleteObjectsInput) DeleteObjectsRequest } // Send marshals and sends the DeleteObjects API request. @@ -980,7 +999,7 @@ func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) DeleteObjectsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteObjectsRequest{Request: req, Input: input} + return DeleteObjectsRequest{Request: req, Input: input, Copy: c.DeleteObjectsRequest} } const opGetBucketAccelerateConfiguration = "GetBucketAccelerateConfiguration" @@ -989,6 +1008,7 @@ const opGetBucketAccelerateConfiguration = "GetBucketAccelerateConfiguration" type GetBucketAccelerateConfigurationRequest struct { *aws.Request Input *GetBucketAccelerateConfigurationInput + Copy func(*GetBucketAccelerateConfigurationInput) GetBucketAccelerateConfigurationRequest } // Send marshals and sends the GetBucketAccelerateConfiguration API request. @@ -1029,7 +1049,7 @@ func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketAccelerateConfigurationRequest{Request: req, Input: input} + return GetBucketAccelerateConfigurationRequest{Request: req, Input: input, Copy: c.GetBucketAccelerateConfigurationRequest} } const opGetBucketAcl = "GetBucketAcl" @@ -1038,6 +1058,7 @@ const opGetBucketAcl = "GetBucketAcl" type GetBucketAclRequest struct { *aws.Request Input *GetBucketAclInput + Copy func(*GetBucketAclInput) GetBucketAclRequest } // Send marshals and sends the GetBucketAcl API request. @@ -1078,7 +1099,7 @@ func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) GetBucketAclRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketAclRequest{Request: req, Input: input} + return GetBucketAclRequest{Request: req, Input: input, Copy: c.GetBucketAclRequest} } const opGetBucketAnalyticsConfiguration = "GetBucketAnalyticsConfiguration" @@ -1087,6 +1108,7 @@ const opGetBucketAnalyticsConfiguration = "GetBucketAnalyticsConfiguration" type GetBucketAnalyticsConfigurationRequest struct { *aws.Request Input *GetBucketAnalyticsConfigurationInput + Copy func(*GetBucketAnalyticsConfigurationInput) GetBucketAnalyticsConfigurationRequest } // Send marshals and sends the GetBucketAnalyticsConfiguration API request. @@ -1128,7 +1150,7 @@ func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsCon req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketAnalyticsConfigurationRequest{Request: req, Input: input} + return GetBucketAnalyticsConfigurationRequest{Request: req, Input: input, Copy: c.GetBucketAnalyticsConfigurationRequest} } const opGetBucketCors = "GetBucketCors" @@ -1137,6 +1159,7 @@ const opGetBucketCors = "GetBucketCors" type GetBucketCorsRequest struct { *aws.Request Input *GetBucketCorsInput + Copy func(*GetBucketCorsInput) GetBucketCorsRequest } // Send marshals and sends the GetBucketCors API request. @@ -1177,7 +1200,7 @@ func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) GetBucketCorsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketCorsRequest{Request: req, Input: input} + return GetBucketCorsRequest{Request: req, Input: input, Copy: c.GetBucketCorsRequest} } const opGetBucketEncryption = "GetBucketEncryption" @@ -1186,6 +1209,7 @@ const opGetBucketEncryption = "GetBucketEncryption" type GetBucketEncryptionRequest struct { *aws.Request Input *GetBucketEncryptionInput + Copy func(*GetBucketEncryptionInput) GetBucketEncryptionRequest } // Send marshals and sends the GetBucketEncryption API request. @@ -1226,7 +1250,7 @@ func (c *S3) GetBucketEncryptionRequest(input *GetBucketEncryptionInput) GetBuck req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketEncryptionRequest{Request: req, Input: input} + return GetBucketEncryptionRequest{Request: req, Input: input, Copy: c.GetBucketEncryptionRequest} } const opGetBucketInventoryConfiguration = "GetBucketInventoryConfiguration" @@ -1235,6 +1259,7 @@ const opGetBucketInventoryConfiguration = "GetBucketInventoryConfiguration" type GetBucketInventoryConfigurationRequest struct { *aws.Request Input *GetBucketInventoryConfigurationInput + Copy func(*GetBucketInventoryConfigurationInput) GetBucketInventoryConfigurationRequest } // Send marshals and sends the GetBucketInventoryConfiguration API request. @@ -1276,7 +1301,7 @@ func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryCon req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketInventoryConfigurationRequest{Request: req, Input: input} + return GetBucketInventoryConfigurationRequest{Request: req, Input: input, Copy: c.GetBucketInventoryConfigurationRequest} } const opGetBucketLifecycle = "GetBucketLifecycle" @@ -1285,6 +1310,7 @@ const opGetBucketLifecycle = "GetBucketLifecycle" type GetBucketLifecycleRequest struct { *aws.Request Input *GetBucketLifecycleInput + Copy func(*GetBucketLifecycleInput) GetBucketLifecycleRequest } // Send marshals and sends the GetBucketLifecycle API request. @@ -1328,7 +1354,7 @@ func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) GetBucket req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketLifecycleRequest{Request: req, Input: input} + return GetBucketLifecycleRequest{Request: req, Input: input, Copy: c.GetBucketLifecycleRequest} } const opGetBucketLifecycleConfiguration = "GetBucketLifecycleConfiguration" @@ -1337,6 +1363,7 @@ const opGetBucketLifecycleConfiguration = "GetBucketLifecycleConfiguration" type GetBucketLifecycleConfigurationRequest struct { *aws.Request Input *GetBucketLifecycleConfigurationInput + Copy func(*GetBucketLifecycleConfigurationInput) GetBucketLifecycleConfigurationRequest } // Send marshals and sends the GetBucketLifecycleConfiguration API request. @@ -1377,7 +1404,7 @@ func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleCon req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketLifecycleConfigurationRequest{Request: req, Input: input} + return GetBucketLifecycleConfigurationRequest{Request: req, Input: input, Copy: c.GetBucketLifecycleConfigurationRequest} } const opGetBucketLocation = "GetBucketLocation" @@ -1386,6 +1413,7 @@ const opGetBucketLocation = "GetBucketLocation" type GetBucketLocationRequest struct { *aws.Request Input *GetBucketLocationInput + Copy func(*GetBucketLocationInput) GetBucketLocationRequest } // Send marshals and sends the GetBucketLocation API request. @@ -1426,7 +1454,7 @@ func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) GetBucketLo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketLocationRequest{Request: req, Input: input} + return GetBucketLocationRequest{Request: req, Input: input, Copy: c.GetBucketLocationRequest} } const opGetBucketLogging = "GetBucketLogging" @@ -1435,6 +1463,7 @@ const opGetBucketLogging = "GetBucketLogging" type GetBucketLoggingRequest struct { *aws.Request Input *GetBucketLoggingInput + Copy func(*GetBucketLoggingInput) GetBucketLoggingRequest } // Send marshals and sends the GetBucketLogging API request. @@ -1476,7 +1505,7 @@ func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) GetBucketLogg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketLoggingRequest{Request: req, Input: input} + return GetBucketLoggingRequest{Request: req, Input: input, Copy: c.GetBucketLoggingRequest} } const opGetBucketMetricsConfiguration = "GetBucketMetricsConfiguration" @@ -1485,6 +1514,7 @@ const opGetBucketMetricsConfiguration = "GetBucketMetricsConfiguration" type GetBucketMetricsConfigurationRequest struct { *aws.Request Input *GetBucketMetricsConfigurationInput + Copy func(*GetBucketMetricsConfigurationInput) GetBucketMetricsConfigurationRequest } // Send marshals and sends the GetBucketMetricsConfiguration API request. @@ -1526,7 +1556,7 @@ func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketMetricsConfigurationRequest{Request: req, Input: input} + return GetBucketMetricsConfigurationRequest{Request: req, Input: input, Copy: c.GetBucketMetricsConfigurationRequest} } const opGetBucketNotification = "GetBucketNotification" @@ -1535,6 +1565,7 @@ const opGetBucketNotification = "GetBucketNotification" type GetBucketNotificationRequest struct { *aws.Request Input *GetBucketNotificationConfigurationInput + Copy func(*GetBucketNotificationConfigurationInput) GetBucketNotificationRequest } // Send marshals and sends the GetBucketNotification API request. @@ -1578,7 +1609,7 @@ func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketNotificationRequest{Request: req, Input: input} + return GetBucketNotificationRequest{Request: req, Input: input, Copy: c.GetBucketNotificationRequest} } const opGetBucketNotificationConfiguration = "GetBucketNotificationConfiguration" @@ -1587,6 +1618,7 @@ const opGetBucketNotificationConfiguration = "GetBucketNotificationConfiguration type GetBucketNotificationConfigurationRequest struct { *aws.Request Input *GetBucketNotificationConfigurationInput + Copy func(*GetBucketNotificationConfigurationInput) GetBucketNotificationConfigurationRequest } // Send marshals and sends the GetBucketNotificationConfiguration API request. @@ -1627,7 +1659,7 @@ func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketNotificationConfigurationRequest{Request: req, Input: input} + return GetBucketNotificationConfigurationRequest{Request: req, Input: input, Copy: c.GetBucketNotificationConfigurationRequest} } const opGetBucketPolicy = "GetBucketPolicy" @@ -1636,6 +1668,7 @@ const opGetBucketPolicy = "GetBucketPolicy" type GetBucketPolicyRequest struct { *aws.Request Input *GetBucketPolicyInput + Copy func(*GetBucketPolicyInput) GetBucketPolicyRequest } // Send marshals and sends the GetBucketPolicy API request. @@ -1676,7 +1709,7 @@ func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) GetBucketPolicy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketPolicyRequest{Request: req, Input: input} + return GetBucketPolicyRequest{Request: req, Input: input, Copy: c.GetBucketPolicyRequest} } const opGetBucketReplication = "GetBucketReplication" @@ -1685,6 +1718,7 @@ const opGetBucketReplication = "GetBucketReplication" type GetBucketReplicationRequest struct { *aws.Request Input *GetBucketReplicationInput + Copy func(*GetBucketReplicationInput) GetBucketReplicationRequest } // Send marshals and sends the GetBucketReplication API request. @@ -1725,7 +1759,7 @@ func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) GetBu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketReplicationRequest{Request: req, Input: input} + return GetBucketReplicationRequest{Request: req, Input: input, Copy: c.GetBucketReplicationRequest} } const opGetBucketRequestPayment = "GetBucketRequestPayment" @@ -1734,6 +1768,7 @@ const opGetBucketRequestPayment = "GetBucketRequestPayment" type GetBucketRequestPaymentRequest struct { *aws.Request Input *GetBucketRequestPaymentInput + Copy func(*GetBucketRequestPaymentInput) GetBucketRequestPaymentRequest } // Send marshals and sends the GetBucketRequestPayment API request. @@ -1774,7 +1809,7 @@ func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketRequestPaymentRequest{Request: req, Input: input} + return GetBucketRequestPaymentRequest{Request: req, Input: input, Copy: c.GetBucketRequestPaymentRequest} } const opGetBucketTagging = "GetBucketTagging" @@ -1783,6 +1818,7 @@ const opGetBucketTagging = "GetBucketTagging" type GetBucketTaggingRequest struct { *aws.Request Input *GetBucketTaggingInput + Copy func(*GetBucketTaggingInput) GetBucketTaggingRequest } // Send marshals and sends the GetBucketTagging API request. @@ -1823,7 +1859,7 @@ func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) GetBucketTagg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketTaggingRequest{Request: req, Input: input} + return GetBucketTaggingRequest{Request: req, Input: input, Copy: c.GetBucketTaggingRequest} } const opGetBucketVersioning = "GetBucketVersioning" @@ -1832,6 +1868,7 @@ const opGetBucketVersioning = "GetBucketVersioning" type GetBucketVersioningRequest struct { *aws.Request Input *GetBucketVersioningInput + Copy func(*GetBucketVersioningInput) GetBucketVersioningRequest } // Send marshals and sends the GetBucketVersioning API request. @@ -1872,7 +1909,7 @@ func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) GetBuck req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketVersioningRequest{Request: req, Input: input} + return GetBucketVersioningRequest{Request: req, Input: input, Copy: c.GetBucketVersioningRequest} } const opGetBucketWebsite = "GetBucketWebsite" @@ -1881,6 +1918,7 @@ const opGetBucketWebsite = "GetBucketWebsite" type GetBucketWebsiteRequest struct { *aws.Request Input *GetBucketWebsiteInput + Copy func(*GetBucketWebsiteInput) GetBucketWebsiteRequest } // Send marshals and sends the GetBucketWebsite API request. @@ -1921,7 +1959,7 @@ func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) GetBucketWebs req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetBucketWebsiteRequest{Request: req, Input: input} + return GetBucketWebsiteRequest{Request: req, Input: input, Copy: c.GetBucketWebsiteRequest} } const opGetObject = "GetObject" @@ -1930,6 +1968,7 @@ const opGetObject = "GetObject" type GetObjectRequest struct { *aws.Request Input *GetObjectInput + Copy func(*GetObjectInput) GetObjectRequest } // Send marshals and sends the GetObject API request. @@ -1970,7 +2009,7 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) GetObjectRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetObjectRequest{Request: req, Input: input} + return GetObjectRequest{Request: req, Input: input, Copy: c.GetObjectRequest} } const opGetObjectAcl = "GetObjectAcl" @@ -1979,6 +2018,7 @@ const opGetObjectAcl = "GetObjectAcl" type GetObjectAclRequest struct { *aws.Request Input *GetObjectAclInput + Copy func(*GetObjectAclInput) GetObjectAclRequest } // Send marshals and sends the GetObjectAcl API request. @@ -2019,7 +2059,7 @@ func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) GetObjectAclRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetObjectAclRequest{Request: req, Input: input} + return GetObjectAclRequest{Request: req, Input: input, Copy: c.GetObjectAclRequest} } const opGetObjectTagging = "GetObjectTagging" @@ -2028,6 +2068,7 @@ const opGetObjectTagging = "GetObjectTagging" type GetObjectTaggingRequest struct { *aws.Request Input *GetObjectTaggingInput + Copy func(*GetObjectTaggingInput) GetObjectTaggingRequest } // Send marshals and sends the GetObjectTagging API request. @@ -2068,7 +2109,7 @@ func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) GetObjectTagg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetObjectTaggingRequest{Request: req, Input: input} + return GetObjectTaggingRequest{Request: req, Input: input, Copy: c.GetObjectTaggingRequest} } const opGetObjectTorrent = "GetObjectTorrent" @@ -2077,6 +2118,7 @@ const opGetObjectTorrent = "GetObjectTorrent" type GetObjectTorrentRequest struct { *aws.Request Input *GetObjectTorrentInput + Copy func(*GetObjectTorrentInput) GetObjectTorrentRequest } // Send marshals and sends the GetObjectTorrent API request. @@ -2117,7 +2159,7 @@ func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) GetObjectTorr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetObjectTorrentRequest{Request: req, Input: input} + return GetObjectTorrentRequest{Request: req, Input: input, Copy: c.GetObjectTorrentRequest} } const opHeadBucket = "HeadBucket" @@ -2126,6 +2168,7 @@ const opHeadBucket = "HeadBucket" type HeadBucketRequest struct { *aws.Request Input *HeadBucketInput + Copy func(*HeadBucketInput) HeadBucketRequest } // Send marshals and sends the HeadBucket API request. @@ -2169,7 +2212,7 @@ func (c *S3) HeadBucketRequest(input *HeadBucketInput) HeadBucketRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return HeadBucketRequest{Request: req, Input: input} + return HeadBucketRequest{Request: req, Input: input, Copy: c.HeadBucketRequest} } const opHeadObject = "HeadObject" @@ -2178,6 +2221,7 @@ const opHeadObject = "HeadObject" type HeadObjectRequest struct { *aws.Request Input *HeadObjectInput + Copy func(*HeadObjectInput) HeadObjectRequest } // Send marshals and sends the HeadObject API request. @@ -2223,7 +2267,7 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) HeadObjectRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return HeadObjectRequest{Request: req, Input: input} + return HeadObjectRequest{Request: req, Input: input, Copy: c.HeadObjectRequest} } const opListBucketAnalyticsConfigurations = "ListBucketAnalyticsConfigurations" @@ -2232,6 +2276,7 @@ const opListBucketAnalyticsConfigurations = "ListBucketAnalyticsConfigurations" type ListBucketAnalyticsConfigurationsRequest struct { *aws.Request Input *ListBucketAnalyticsConfigurationsInput + Copy func(*ListBucketAnalyticsConfigurationsInput) ListBucketAnalyticsConfigurationsRequest } // Send marshals and sends the ListBucketAnalyticsConfigurations API request. @@ -2272,7 +2317,7 @@ func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalytics req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBucketAnalyticsConfigurationsRequest{Request: req, Input: input} + return ListBucketAnalyticsConfigurationsRequest{Request: req, Input: input, Copy: c.ListBucketAnalyticsConfigurationsRequest} } const opListBucketInventoryConfigurations = "ListBucketInventoryConfigurations" @@ -2281,6 +2326,7 @@ const opListBucketInventoryConfigurations = "ListBucketInventoryConfigurations" type ListBucketInventoryConfigurationsRequest struct { *aws.Request Input *ListBucketInventoryConfigurationsInput + Copy func(*ListBucketInventoryConfigurationsInput) ListBucketInventoryConfigurationsRequest } // Send marshals and sends the ListBucketInventoryConfigurations API request. @@ -2321,7 +2367,7 @@ func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventory req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBucketInventoryConfigurationsRequest{Request: req, Input: input} + return ListBucketInventoryConfigurationsRequest{Request: req, Input: input, Copy: c.ListBucketInventoryConfigurationsRequest} } const opListBucketMetricsConfigurations = "ListBucketMetricsConfigurations" @@ -2330,6 +2376,7 @@ const opListBucketMetricsConfigurations = "ListBucketMetricsConfigurations" type ListBucketMetricsConfigurationsRequest struct { *aws.Request Input *ListBucketMetricsConfigurationsInput + Copy func(*ListBucketMetricsConfigurationsInput) ListBucketMetricsConfigurationsRequest } // Send marshals and sends the ListBucketMetricsConfigurations API request. @@ -2370,7 +2417,7 @@ func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBucketMetricsConfigurationsRequest{Request: req, Input: input} + return ListBucketMetricsConfigurationsRequest{Request: req, Input: input, Copy: c.ListBucketMetricsConfigurationsRequest} } const opListBuckets = "ListBuckets" @@ -2379,6 +2426,7 @@ const opListBuckets = "ListBuckets" type ListBucketsRequest struct { *aws.Request Input *ListBucketsInput + Copy func(*ListBucketsInput) ListBucketsRequest } // Send marshals and sends the ListBuckets API request. @@ -2419,7 +2467,7 @@ func (c *S3) ListBucketsRequest(input *ListBucketsInput) ListBucketsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListBucketsRequest{Request: req, Input: input} + return ListBucketsRequest{Request: req, Input: input, Copy: c.ListBucketsRequest} } const opListMultipartUploads = "ListMultipartUploads" @@ -2428,6 +2476,7 @@ const opListMultipartUploads = "ListMultipartUploads" type ListMultipartUploadsRequest struct { *aws.Request Input *ListMultipartUploadsInput + Copy func(*ListMultipartUploadsInput) ListMultipartUploadsRequest } // Send marshals and sends the ListMultipartUploads API request. @@ -2474,57 +2523,53 @@ func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) ListM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListMultipartUploadsRequest{Request: req, Input: input} + return ListMultipartUploadsRequest{Request: req, Input: input, Copy: c.ListMultipartUploadsRequest} } -// ListMultipartUploadsPages iterates over the pages of a ListMultipartUploads operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMultipartUploads method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListMultipartUploadsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListMultipartUploads operation. -// pageNum := 0 -// err := client.ListMultipartUploadsPages(params, -// func(page *ListMultipartUploadsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool) error { - return c.ListMultipartUploadsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMultipartUploadsPagesWithContext same as ListMultipartUploadsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListMultipartUploadsPagesWithContext(ctx aws.Context, input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListMultipartUploadsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListMultipartUploadsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListMultipartUploadsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListMultipartUploadsRequest) Paginate(opts ...aws.Option) ListMultipartUploadsPager { + return ListMultipartUploadsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListMultipartUploadsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) - } - return p.Err() +// ListMultipartUploadsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListMultipartUploadsPager struct { + aws.Pager +} + +func (p *ListMultipartUploadsPager) CurrentPage() *ListMultipartUploadsOutput { + return p.Pager.CurrentPage().(*ListMultipartUploadsOutput) } const opListObjectVersions = "ListObjectVersions" @@ -2533,6 +2578,7 @@ const opListObjectVersions = "ListObjectVersions" type ListObjectVersionsRequest struct { *aws.Request Input *ListObjectVersionsInput + Copy func(*ListObjectVersionsInput) ListObjectVersionsRequest } // Send marshals and sends the ListObjectVersions API request. @@ -2579,57 +2625,53 @@ func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) ListObjec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListObjectVersionsRequest{Request: req, Input: input} + return ListObjectVersionsRequest{Request: req, Input: input, Copy: c.ListObjectVersionsRequest} } -// ListObjectVersionsPages iterates over the pages of a ListObjectVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListObjectVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListObjectVersions operation. -// pageNum := 0 -// err := client.ListObjectVersionsPages(params, -// func(page *ListObjectVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListObjectVersionsPages(input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool) error { - return c.ListObjectVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectVersionsPagesWithContext same as ListObjectVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListObjectVersionsPagesWithContext(ctx aws.Context, input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListObjectVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListObjectVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListObjectVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListObjectVersionsRequest) Paginate(opts ...aws.Option) ListObjectVersionsPager { + return ListObjectVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListObjectVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListObjectVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListObjectVersionsPager struct { + aws.Pager +} + +func (p *ListObjectVersionsPager) CurrentPage() *ListObjectVersionsOutput { + return p.Pager.CurrentPage().(*ListObjectVersionsOutput) } const opListObjects = "ListObjects" @@ -2638,6 +2680,7 @@ const opListObjects = "ListObjects" type ListObjectsRequest struct { *aws.Request Input *ListObjectsInput + Copy func(*ListObjectsInput) ListObjectsRequest } // Send marshals and sends the ListObjects API request. @@ -2686,57 +2729,53 @@ func (c *S3) ListObjectsRequest(input *ListObjectsInput) ListObjectsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListObjectsRequest{Request: req, Input: input} + return ListObjectsRequest{Request: req, Input: input, Copy: c.ListObjectsRequest} } -// ListObjectsPages iterates over the pages of a ListObjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjects method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListObjectsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListObjects operation. -// pageNum := 0 -// err := client.ListObjectsPages(params, -// func(page *ListObjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListObjectsPages(input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool) error { - return c.ListObjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectsPagesWithContext same as ListObjectsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListObjectsPagesWithContext(ctx aws.Context, input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListObjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListObjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListObjectsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListObjectsRequest) Paginate(opts ...aws.Option) ListObjectsPager { + return ListObjectsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListObjectsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectsOutput), !p.HasNextPage()) - } - return p.Err() +// ListObjectsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListObjectsPager struct { + aws.Pager +} + +func (p *ListObjectsPager) CurrentPage() *ListObjectsOutput { + return p.Pager.CurrentPage().(*ListObjectsOutput) } const opListObjectsV2 = "ListObjectsV2" @@ -2745,6 +2784,7 @@ const opListObjectsV2 = "ListObjectsV2" type ListObjectsV2Request struct { *aws.Request Input *ListObjectsV2Input + Copy func(*ListObjectsV2Input) ListObjectsV2Request } // Send marshals and sends the ListObjectsV2 API request. @@ -2794,57 +2834,53 @@ func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) ListObjectsV2Reques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListObjectsV2Request{Request: req, Input: input} + return ListObjectsV2Request{Request: req, Input: input, Copy: c.ListObjectsV2Request} } -// ListObjectsV2Pages iterates over the pages of a ListObjectsV2 operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectsV2 method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListObjectsV2Request operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListObjectsV2 operation. -// pageNum := 0 -// err := client.ListObjectsV2Pages(params, -// func(page *ListObjectsV2Output, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListObjectsV2Pages(input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool) error { - return c.ListObjectsV2PagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectsV2PagesWithContext same as ListObjectsV2Pages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListObjectsV2PagesWithContext(ctx aws.Context, input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListObjectsV2Input - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListObjectsV2Request(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListObjectsV2Request(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListObjectsV2Request) Paginate(opts ...aws.Option) ListObjectsV2Pager { + return ListObjectsV2Pager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListObjectsV2Input + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectsV2Output), !p.HasNextPage()) - } - return p.Err() +// ListObjectsV2Pager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListObjectsV2Pager struct { + aws.Pager +} + +func (p *ListObjectsV2Pager) CurrentPage() *ListObjectsV2Output { + return p.Pager.CurrentPage().(*ListObjectsV2Output) } const opListParts = "ListParts" @@ -2853,6 +2889,7 @@ const opListParts = "ListParts" type ListPartsRequest struct { *aws.Request Input *ListPartsInput + Copy func(*ListPartsInput) ListPartsRequest } // Send marshals and sends the ListParts API request. @@ -2899,57 +2936,53 @@ func (c *S3) ListPartsRequest(input *ListPartsInput) ListPartsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPartsRequest{Request: req, Input: input} + return ListPartsRequest{Request: req, Input: input, Copy: c.ListPartsRequest} } -// ListPartsPages iterates over the pages of a ListParts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListParts method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPartsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListParts operation. -// pageNum := 0 -// err := client.ListPartsPages(params, -// func(page *ListPartsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListPartsPages(input *ListPartsInput, fn func(*ListPartsOutput, bool) bool) error { - return c.ListPartsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPartsPagesWithContext same as ListPartsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListPartsPagesWithContext(ctx aws.Context, input *ListPartsInput, fn func(*ListPartsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPartsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPartsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPartsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPartsRequest) Paginate(opts ...aws.Option) ListPartsPager { + return ListPartsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPartsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) - } - return p.Err() +// ListPartsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPartsPager struct { + aws.Pager +} + +func (p *ListPartsPager) CurrentPage() *ListPartsOutput { + return p.Pager.CurrentPage().(*ListPartsOutput) } const opPutBucketAccelerateConfiguration = "PutBucketAccelerateConfiguration" @@ -2958,6 +2991,7 @@ const opPutBucketAccelerateConfiguration = "PutBucketAccelerateConfiguration" type PutBucketAccelerateConfigurationRequest struct { *aws.Request Input *PutBucketAccelerateConfigurationInput + Copy func(*PutBucketAccelerateConfigurationInput) PutBucketAccelerateConfigurationRequest } // Send marshals and sends the PutBucketAccelerateConfiguration API request. @@ -3000,7 +3034,7 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketAccelerateConfigurationRequest{Request: req, Input: input} + return PutBucketAccelerateConfigurationRequest{Request: req, Input: input, Copy: c.PutBucketAccelerateConfigurationRequest} } const opPutBucketAcl = "PutBucketAcl" @@ -3009,6 +3043,7 @@ const opPutBucketAcl = "PutBucketAcl" type PutBucketAclRequest struct { *aws.Request Input *PutBucketAclInput + Copy func(*PutBucketAclInput) PutBucketAclRequest } // Send marshals and sends the PutBucketAcl API request. @@ -3051,7 +3086,7 @@ func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) PutBucketAclRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketAclRequest{Request: req, Input: input} + return PutBucketAclRequest{Request: req, Input: input, Copy: c.PutBucketAclRequest} } const opPutBucketAnalyticsConfiguration = "PutBucketAnalyticsConfiguration" @@ -3060,6 +3095,7 @@ const opPutBucketAnalyticsConfiguration = "PutBucketAnalyticsConfiguration" type PutBucketAnalyticsConfigurationRequest struct { *aws.Request Input *PutBucketAnalyticsConfigurationInput + Copy func(*PutBucketAnalyticsConfigurationInput) PutBucketAnalyticsConfigurationRequest } // Send marshals and sends the PutBucketAnalyticsConfiguration API request. @@ -3103,7 +3139,7 @@ func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsCon req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketAnalyticsConfigurationRequest{Request: req, Input: input} + return PutBucketAnalyticsConfigurationRequest{Request: req, Input: input, Copy: c.PutBucketAnalyticsConfigurationRequest} } const opPutBucketCors = "PutBucketCors" @@ -3112,6 +3148,7 @@ const opPutBucketCors = "PutBucketCors" type PutBucketCorsRequest struct { *aws.Request Input *PutBucketCorsInput + Copy func(*PutBucketCorsInput) PutBucketCorsRequest } // Send marshals and sends the PutBucketCors API request. @@ -3154,7 +3191,7 @@ func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) PutBucketCorsReques req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketCorsRequest{Request: req, Input: input} + return PutBucketCorsRequest{Request: req, Input: input, Copy: c.PutBucketCorsRequest} } const opPutBucketEncryption = "PutBucketEncryption" @@ -3163,6 +3200,7 @@ const opPutBucketEncryption = "PutBucketEncryption" type PutBucketEncryptionRequest struct { *aws.Request Input *PutBucketEncryptionInput + Copy func(*PutBucketEncryptionInput) PutBucketEncryptionRequest } // Send marshals and sends the PutBucketEncryption API request. @@ -3206,7 +3244,7 @@ func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) PutBuck req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketEncryptionRequest{Request: req, Input: input} + return PutBucketEncryptionRequest{Request: req, Input: input, Copy: c.PutBucketEncryptionRequest} } const opPutBucketInventoryConfiguration = "PutBucketInventoryConfiguration" @@ -3215,6 +3253,7 @@ const opPutBucketInventoryConfiguration = "PutBucketInventoryConfiguration" type PutBucketInventoryConfigurationRequest struct { *aws.Request Input *PutBucketInventoryConfigurationInput + Copy func(*PutBucketInventoryConfigurationInput) PutBucketInventoryConfigurationRequest } // Send marshals and sends the PutBucketInventoryConfiguration API request. @@ -3258,7 +3297,7 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketInventoryConfigurationRequest{Request: req, Input: input} + return PutBucketInventoryConfigurationRequest{Request: req, Input: input, Copy: c.PutBucketInventoryConfigurationRequest} } const opPutBucketLifecycle = "PutBucketLifecycle" @@ -3267,6 +3306,7 @@ const opPutBucketLifecycle = "PutBucketLifecycle" type PutBucketLifecycleRequest struct { *aws.Request Input *PutBucketLifecycleInput + Copy func(*PutBucketLifecycleInput) PutBucketLifecycleRequest } // Send marshals and sends the PutBucketLifecycle API request. @@ -3312,7 +3352,7 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) PutBucket req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketLifecycleRequest{Request: req, Input: input} + return PutBucketLifecycleRequest{Request: req, Input: input, Copy: c.PutBucketLifecycleRequest} } const opPutBucketLifecycleConfiguration = "PutBucketLifecycleConfiguration" @@ -3321,6 +3361,7 @@ const opPutBucketLifecycleConfiguration = "PutBucketLifecycleConfiguration" type PutBucketLifecycleConfigurationRequest struct { *aws.Request Input *PutBucketLifecycleConfigurationInput + Copy func(*PutBucketLifecycleConfigurationInput) PutBucketLifecycleConfigurationRequest } // Send marshals and sends the PutBucketLifecycleConfiguration API request. @@ -3364,7 +3405,7 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketLifecycleConfigurationRequest{Request: req, Input: input} + return PutBucketLifecycleConfigurationRequest{Request: req, Input: input, Copy: c.PutBucketLifecycleConfigurationRequest} } const opPutBucketLogging = "PutBucketLogging" @@ -3373,6 +3414,7 @@ const opPutBucketLogging = "PutBucketLogging" type PutBucketLoggingRequest struct { *aws.Request Input *PutBucketLoggingInput + Copy func(*PutBucketLoggingInput) PutBucketLoggingRequest } // Send marshals and sends the PutBucketLogging API request. @@ -3417,7 +3459,7 @@ func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) PutBucketLogg req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketLoggingRequest{Request: req, Input: input} + return PutBucketLoggingRequest{Request: req, Input: input, Copy: c.PutBucketLoggingRequest} } const opPutBucketMetricsConfiguration = "PutBucketMetricsConfiguration" @@ -3426,6 +3468,7 @@ const opPutBucketMetricsConfiguration = "PutBucketMetricsConfiguration" type PutBucketMetricsConfigurationRequest struct { *aws.Request Input *PutBucketMetricsConfigurationInput + Copy func(*PutBucketMetricsConfigurationInput) PutBucketMetricsConfigurationRequest } // Send marshals and sends the PutBucketMetricsConfiguration API request. @@ -3469,7 +3512,7 @@ func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketMetricsConfigurationRequest{Request: req, Input: input} + return PutBucketMetricsConfigurationRequest{Request: req, Input: input, Copy: c.PutBucketMetricsConfigurationRequest} } const opPutBucketNotification = "PutBucketNotification" @@ -3478,6 +3521,7 @@ const opPutBucketNotification = "PutBucketNotification" type PutBucketNotificationRequest struct { *aws.Request Input *PutBucketNotificationInput + Copy func(*PutBucketNotificationInput) PutBucketNotificationRequest } // Send marshals and sends the PutBucketNotification API request. @@ -3523,7 +3567,7 @@ func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) Put req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketNotificationRequest{Request: req, Input: input} + return PutBucketNotificationRequest{Request: req, Input: input, Copy: c.PutBucketNotificationRequest} } const opPutBucketNotificationConfiguration = "PutBucketNotificationConfiguration" @@ -3532,6 +3576,7 @@ const opPutBucketNotificationConfiguration = "PutBucketNotificationConfiguration type PutBucketNotificationConfigurationRequest struct { *aws.Request Input *PutBucketNotificationConfigurationInput + Copy func(*PutBucketNotificationConfigurationInput) PutBucketNotificationConfigurationRequest } // Send marshals and sends the PutBucketNotificationConfiguration API request. @@ -3574,7 +3619,7 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketNotificationConfigurationRequest{Request: req, Input: input} + return PutBucketNotificationConfigurationRequest{Request: req, Input: input, Copy: c.PutBucketNotificationConfigurationRequest} } const opPutBucketPolicy = "PutBucketPolicy" @@ -3583,6 +3628,7 @@ const opPutBucketPolicy = "PutBucketPolicy" type PutBucketPolicyRequest struct { *aws.Request Input *PutBucketPolicyInput + Copy func(*PutBucketPolicyInput) PutBucketPolicyRequest } // Send marshals and sends the PutBucketPolicy API request. @@ -3626,7 +3672,7 @@ func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) PutBucketPolicy req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketPolicyRequest{Request: req, Input: input} + return PutBucketPolicyRequest{Request: req, Input: input, Copy: c.PutBucketPolicyRequest} } const opPutBucketReplication = "PutBucketReplication" @@ -3635,6 +3681,7 @@ const opPutBucketReplication = "PutBucketReplication" type PutBucketReplicationRequest struct { *aws.Request Input *PutBucketReplicationInput + Copy func(*PutBucketReplicationInput) PutBucketReplicationRequest } // Send marshals and sends the PutBucketReplication API request. @@ -3678,7 +3725,7 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) PutBu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketReplicationRequest{Request: req, Input: input} + return PutBucketReplicationRequest{Request: req, Input: input, Copy: c.PutBucketReplicationRequest} } const opPutBucketRequestPayment = "PutBucketRequestPayment" @@ -3687,6 +3734,7 @@ const opPutBucketRequestPayment = "PutBucketRequestPayment" type PutBucketRequestPaymentRequest struct { *aws.Request Input *PutBucketRequestPaymentInput + Copy func(*PutBucketRequestPaymentInput) PutBucketRequestPaymentRequest } // Send marshals and sends the PutBucketRequestPayment API request. @@ -3733,7 +3781,7 @@ func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketRequestPaymentRequest{Request: req, Input: input} + return PutBucketRequestPaymentRequest{Request: req, Input: input, Copy: c.PutBucketRequestPaymentRequest} } const opPutBucketTagging = "PutBucketTagging" @@ -3742,6 +3790,7 @@ const opPutBucketTagging = "PutBucketTagging" type PutBucketTaggingRequest struct { *aws.Request Input *PutBucketTaggingInput + Copy func(*PutBucketTaggingInput) PutBucketTaggingRequest } // Send marshals and sends the PutBucketTagging API request. @@ -3784,7 +3833,7 @@ func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) PutBucketTagg req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketTaggingRequest{Request: req, Input: input} + return PutBucketTaggingRequest{Request: req, Input: input, Copy: c.PutBucketTaggingRequest} } const opPutBucketVersioning = "PutBucketVersioning" @@ -3793,6 +3842,7 @@ const opPutBucketVersioning = "PutBucketVersioning" type PutBucketVersioningRequest struct { *aws.Request Input *PutBucketVersioningInput + Copy func(*PutBucketVersioningInput) PutBucketVersioningRequest } // Send marshals and sends the PutBucketVersioning API request. @@ -3836,7 +3886,7 @@ func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) PutBuck req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketVersioningRequest{Request: req, Input: input} + return PutBucketVersioningRequest{Request: req, Input: input, Copy: c.PutBucketVersioningRequest} } const opPutBucketWebsite = "PutBucketWebsite" @@ -3845,6 +3895,7 @@ const opPutBucketWebsite = "PutBucketWebsite" type PutBucketWebsiteRequest struct { *aws.Request Input *PutBucketWebsiteInput + Copy func(*PutBucketWebsiteInput) PutBucketWebsiteRequest } // Send marshals and sends the PutBucketWebsite API request. @@ -3887,7 +3938,7 @@ func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) PutBucketWebs req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutBucketWebsiteRequest{Request: req, Input: input} + return PutBucketWebsiteRequest{Request: req, Input: input, Copy: c.PutBucketWebsiteRequest} } const opPutObject = "PutObject" @@ -3896,6 +3947,7 @@ const opPutObject = "PutObject" type PutObjectRequest struct { *aws.Request Input *PutObjectInput + Copy func(*PutObjectInput) PutObjectRequest } // Send marshals and sends the PutObject API request. @@ -3936,7 +3988,7 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) PutObjectRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutObjectRequest{Request: req, Input: input} + return PutObjectRequest{Request: req, Input: input, Copy: c.PutObjectRequest} } const opPutObjectAcl = "PutObjectAcl" @@ -3945,6 +3997,7 @@ const opPutObjectAcl = "PutObjectAcl" type PutObjectAclRequest struct { *aws.Request Input *PutObjectAclInput + Copy func(*PutObjectAclInput) PutObjectAclRequest } // Send marshals and sends the PutObjectAcl API request. @@ -3986,7 +4039,7 @@ func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) PutObjectAclRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutObjectAclRequest{Request: req, Input: input} + return PutObjectAclRequest{Request: req, Input: input, Copy: c.PutObjectAclRequest} } const opPutObjectTagging = "PutObjectTagging" @@ -3995,6 +4048,7 @@ const opPutObjectTagging = "PutObjectTagging" type PutObjectTaggingRequest struct { *aws.Request Input *PutObjectTaggingInput + Copy func(*PutObjectTaggingInput) PutObjectTaggingRequest } // Send marshals and sends the PutObjectTagging API request. @@ -4035,7 +4089,7 @@ func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) PutObjectTagg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutObjectTaggingRequest{Request: req, Input: input} + return PutObjectTaggingRequest{Request: req, Input: input, Copy: c.PutObjectTaggingRequest} } const opRestoreObject = "RestoreObject" @@ -4044,6 +4098,7 @@ const opRestoreObject = "RestoreObject" type RestoreObjectRequest struct { *aws.Request Input *RestoreObjectInput + Copy func(*RestoreObjectInput) RestoreObjectRequest } // Send marshals and sends the RestoreObject API request. @@ -4084,7 +4139,7 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) RestoreObjectReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RestoreObjectRequest{Request: req, Input: input} + return RestoreObjectRequest{Request: req, Input: input, Copy: c.RestoreObjectRequest} } const opUploadPart = "UploadPart" @@ -4093,6 +4148,7 @@ const opUploadPart = "UploadPart" type UploadPartRequest struct { *aws.Request Input *UploadPartInput + Copy func(*UploadPartInput) UploadPartRequest } // Send marshals and sends the UploadPart API request. @@ -4139,7 +4195,7 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) UploadPartRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UploadPartRequest{Request: req, Input: input} + return UploadPartRequest{Request: req, Input: input, Copy: c.UploadPartRequest} } const opUploadPartCopy = "UploadPartCopy" @@ -4148,6 +4204,7 @@ const opUploadPartCopy = "UploadPartCopy" type UploadPartCopyRequest struct { *aws.Request Input *UploadPartCopyInput + Copy func(*UploadPartCopyInput) UploadPartCopyRequest } // Send marshals and sends the UploadPartCopy API request. @@ -4188,7 +4245,7 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) UploadPartCopyReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UploadPartCopyRequest{Request: req, Input: input} + return UploadPartCopyRequest{Request: req, Input: input, Copy: c.UploadPartCopyRequest} } // Specifies the days since the initiation of an Incomplete Multipart Upload diff --git a/service/s3/s3iface/interface.go b/service/s3/s3iface/interface.go index 7f0836b06c9..a0935d87c24 100644 --- a/service/s3/s3iface/interface.go +++ b/service/s3/s3iface/interface.go @@ -161,29 +161,14 @@ type S3API interface { ListMultipartUploadsRequest(*s3.ListMultipartUploadsInput) s3.ListMultipartUploadsRequest - ListMultipartUploadsPages(*s3.ListMultipartUploadsInput, func(*s3.ListMultipartUploadsOutput, bool) bool) error - ListMultipartUploadsPagesWithContext(aws.Context, *s3.ListMultipartUploadsInput, func(*s3.ListMultipartUploadsOutput, bool) bool, ...aws.Option) error - ListObjectVersionsRequest(*s3.ListObjectVersionsInput) s3.ListObjectVersionsRequest - ListObjectVersionsPages(*s3.ListObjectVersionsInput, func(*s3.ListObjectVersionsOutput, bool) bool) error - ListObjectVersionsPagesWithContext(aws.Context, *s3.ListObjectVersionsInput, func(*s3.ListObjectVersionsOutput, bool) bool, ...aws.Option) error - ListObjectsRequest(*s3.ListObjectsInput) s3.ListObjectsRequest - ListObjectsPages(*s3.ListObjectsInput, func(*s3.ListObjectsOutput, bool) bool) error - ListObjectsPagesWithContext(aws.Context, *s3.ListObjectsInput, func(*s3.ListObjectsOutput, bool) bool, ...aws.Option) error - ListObjectsV2Request(*s3.ListObjectsV2Input) s3.ListObjectsV2Request - ListObjectsV2Pages(*s3.ListObjectsV2Input, func(*s3.ListObjectsV2Output, bool) bool) error - ListObjectsV2PagesWithContext(aws.Context, *s3.ListObjectsV2Input, func(*s3.ListObjectsV2Output, bool) bool, ...aws.Option) error - ListPartsRequest(*s3.ListPartsInput) s3.ListPartsRequest - ListPartsPages(*s3.ListPartsInput, func(*s3.ListPartsOutput, bool) bool) error - ListPartsPagesWithContext(aws.Context, *s3.ListPartsInput, func(*s3.ListPartsOutput, bool) bool, ...aws.Option) error - PutBucketAccelerateConfigurationRequest(*s3.PutBucketAccelerateConfigurationInput) s3.PutBucketAccelerateConfigurationRequest PutBucketAclRequest(*s3.PutBucketAclInput) s3.PutBucketAclRequest diff --git a/service/s3/s3manager/batch.go b/service/s3/s3manager/batch.go index 08cb23fd7cb..f645c2aac32 100644 --- a/service/s3/s3manager/batch.go +++ b/service/s3/s3manager/batch.go @@ -6,7 +6,6 @@ import ( "io" "github.com/aws/aws-sdk-go-v2/aws" - request "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/awserr" "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/s3iface" @@ -128,25 +127,16 @@ type BatchDeleteIterator interface { // } type DeleteListIterator struct { Bucket *string - Paginator request.Pagination + Paginator s3.ListObjectsPager objects []s3.Object } // NewDeleteListIterator will return a new DeleteListIterator. func NewDeleteListIterator(svc s3iface.S3API, input *s3.ListObjectsInput, opts ...func(*DeleteListIterator)) BatchDeleteIterator { + req := svc.ListObjectsRequest(input) iter := &DeleteListIterator{ - Bucket: input.Bucket, - Paginator: request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *s3.ListObjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := svc.ListObjectsRequest(inCpy) - return req.Request, nil - }, - }, + Bucket: input.Bucket, + Paginator: req.Paginate(), } for _, opt := range opts { @@ -162,7 +152,7 @@ func (iter *DeleteListIterator) Next() bool { } if len(iter.objects) == 0 && iter.Paginator.Next() { - iter.objects = iter.Paginator.Page().(s3.ListObjectsOutput).Contents + iter.objects = iter.Paginator.CurrentPage().Contents } return len(iter.objects) > 0 diff --git a/service/s3/s3manager/batch_test.go b/service/s3/s3manager/batch_test.go index 79b47173c65..7b13e25e8a4 100644 --- a/service/s3/s3manager/batch_test.go +++ b/service/s3/s3manager/batch_test.go @@ -10,7 +10,6 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/aws" - request "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awstesting/unit" "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/s3iface" @@ -315,12 +314,16 @@ type mockS3Client struct { } func (client *mockS3Client) ListObjectsRequest(input *s3.ListObjectsInput) s3.ListObjectsRequest { - object := client.objects[client.index] - client.index++ req := client.S3.ListObjectsRequest(input) - req.Handlers.Send.PushBack(func(r *aws.Request) { - r.Data = object - }) + req.Copy = func(v *s3.ListObjectsInput) s3.ListObjectsRequest { + r := client.S3.ListObjectsRequest(v) + r.Handlers.Send.PushBack(func(r *aws.Request) { + object := client.objects[client.index] + client.index++ + r.Data = &object + }) + return r + } return req } @@ -372,20 +375,11 @@ func TestBatchDeleteList(t *testing.T) { input := &s3.ListObjectsInput{ Bucket: aws.String("bucket"), } - iter := &DeleteListIterator{ - Bucket: input.Bucket, - Paginator: request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *s3.ListObjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := svc.ListObjectsRequest(inCpy) - return req.Request, nil - }, - }, + req := svc.ListObjectsRequest(input) + iter := &DeleteListIterator{ + Bucket: input.Bucket, + Paginator: req.Paginate(), } if err := batcher.Delete(aws.BackgroundContext(), iter); err != nil { @@ -431,6 +425,7 @@ func TestBatchDeleteList_EmptyListObjects(t *testing.T) { Bucket: aws.String("bucket"), } + req := svc.ListObjectsRequest(input) // Test DeleteListIterator in the case when the ListObjectsRequest responds // with an empty listing. @@ -438,13 +433,8 @@ func TestBatchDeleteList_EmptyListObjects(t *testing.T) { // Pagination.HasNextPage() is always true the first time Pagination.Next() // called on it iter := &DeleteListIterator{ - Bucket: input.Bucket, - Paginator: request.Pagination{ - NewRequest: func() (*request.Request, error) { - req := svc.ListObjectsRequest(input) - return req.Request, nil - }, - }, + Bucket: input.Bucket, + Paginator: req.Paginate(), } if err := batcher.Delete(aws.BackgroundContext(), iter); err != nil { diff --git a/service/sagemaker/api.go b/service/sagemaker/api.go index 29b06fa20ec..661f0f4bdfa 100644 --- a/service/sagemaker/api.go +++ b/service/sagemaker/api.go @@ -18,6 +18,7 @@ const opAddTags = "AddTags" type AddTagsRequest struct { *aws.Request Input *AddTagsInput + Copy func(*AddTagsInput) AddTagsRequest } // Send marshals and sends the AddTags API request. @@ -65,7 +66,7 @@ func (c *SageMaker) AddTagsRequest(input *AddTagsInput) AddTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsRequest{Request: req, Input: input} + return AddTagsRequest{Request: req, Input: input, Copy: c.AddTagsRequest} } const opCreateEndpoint = "CreateEndpoint" @@ -74,6 +75,7 @@ const opCreateEndpoint = "CreateEndpoint" type CreateEndpointRequest struct { *aws.Request Input *CreateEndpointInput + Copy func(*CreateEndpointInput) CreateEndpointRequest } // Send marshals and sends the CreateEndpoint API request. @@ -133,7 +135,7 @@ func (c *SageMaker) CreateEndpointRequest(input *CreateEndpointInput) CreateEndp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEndpointRequest{Request: req, Input: input} + return CreateEndpointRequest{Request: req, Input: input, Copy: c.CreateEndpointRequest} } const opCreateEndpointConfig = "CreateEndpointConfig" @@ -142,6 +144,7 @@ const opCreateEndpointConfig = "CreateEndpointConfig" type CreateEndpointConfigRequest struct { *aws.Request Input *CreateEndpointConfigInput + Copy func(*CreateEndpointConfigInput) CreateEndpointConfigRequest } // Send marshals and sends the CreateEndpointConfig API request. @@ -200,7 +203,7 @@ func (c *SageMaker) CreateEndpointConfigRequest(input *CreateEndpointConfigInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateEndpointConfigRequest{Request: req, Input: input} + return CreateEndpointConfigRequest{Request: req, Input: input, Copy: c.CreateEndpointConfigRequest} } const opCreateModel = "CreateModel" @@ -209,6 +212,7 @@ const opCreateModel = "CreateModel" type CreateModelRequest struct { *aws.Request Input *CreateModelInput + Copy func(*CreateModelInput) CreateModelRequest } // Send marshals and sends the CreateModel API request. @@ -270,7 +274,7 @@ func (c *SageMaker) CreateModelRequest(input *CreateModelInput) CreateModelReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateModelRequest{Request: req, Input: input} + return CreateModelRequest{Request: req, Input: input, Copy: c.CreateModelRequest} } const opCreateNotebookInstance = "CreateNotebookInstance" @@ -279,6 +283,7 @@ const opCreateNotebookInstance = "CreateNotebookInstance" type CreateNotebookInstanceRequest struct { *aws.Request Input *CreateNotebookInstanceInput + Copy func(*CreateNotebookInstanceInput) CreateNotebookInstanceRequest } // Send marshals and sends the CreateNotebookInstance API request. @@ -355,7 +360,7 @@ func (c *SageMaker) CreateNotebookInstanceRequest(input *CreateNotebookInstanceI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNotebookInstanceRequest{Request: req, Input: input} + return CreateNotebookInstanceRequest{Request: req, Input: input, Copy: c.CreateNotebookInstanceRequest} } const opCreatePresignedNotebookInstanceUrl = "CreatePresignedNotebookInstanceUrl" @@ -364,6 +369,7 @@ const opCreatePresignedNotebookInstanceUrl = "CreatePresignedNotebookInstanceUrl type CreatePresignedNotebookInstanceUrlRequest struct { *aws.Request Input *CreatePresignedNotebookInstanceUrlInput + Copy func(*CreatePresignedNotebookInstanceUrlInput) CreatePresignedNotebookInstanceUrlRequest } // Send marshals and sends the CreatePresignedNotebookInstanceUrl API request. @@ -408,7 +414,7 @@ func (c *SageMaker) CreatePresignedNotebookInstanceUrlRequest(input *CreatePresi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePresignedNotebookInstanceUrlRequest{Request: req, Input: input} + return CreatePresignedNotebookInstanceUrlRequest{Request: req, Input: input, Copy: c.CreatePresignedNotebookInstanceUrlRequest} } const opCreateTrainingJob = "CreateTrainingJob" @@ -417,6 +423,7 @@ const opCreateTrainingJob = "CreateTrainingJob" type CreateTrainingJobRequest struct { *aws.Request Input *CreateTrainingJobInput + Copy func(*CreateTrainingJobInput) CreateTrainingJobRequest } // Send marshals and sends the CreateTrainingJob API request. @@ -492,7 +499,7 @@ func (c *SageMaker) CreateTrainingJobRequest(input *CreateTrainingJobInput) Crea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTrainingJobRequest{Request: req, Input: input} + return CreateTrainingJobRequest{Request: req, Input: input, Copy: c.CreateTrainingJobRequest} } const opDeleteEndpoint = "DeleteEndpoint" @@ -501,6 +508,7 @@ const opDeleteEndpoint = "DeleteEndpoint" type DeleteEndpointRequest struct { *aws.Request Input *DeleteEndpointInput + Copy func(*DeleteEndpointInput) DeleteEndpointRequest } // Send marshals and sends the DeleteEndpoint API request. @@ -544,7 +552,7 @@ func (c *SageMaker) DeleteEndpointRequest(input *DeleteEndpointInput) DeleteEndp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteEndpointRequest{Request: req, Input: input} + return DeleteEndpointRequest{Request: req, Input: input, Copy: c.DeleteEndpointRequest} } const opDeleteEndpointConfig = "DeleteEndpointConfig" @@ -553,6 +561,7 @@ const opDeleteEndpointConfig = "DeleteEndpointConfig" type DeleteEndpointConfigRequest struct { *aws.Request Input *DeleteEndpointConfigInput + Copy func(*DeleteEndpointConfigInput) DeleteEndpointConfigRequest } // Send marshals and sends the DeleteEndpointConfig API request. @@ -597,7 +606,7 @@ func (c *SageMaker) DeleteEndpointConfigRequest(input *DeleteEndpointConfigInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteEndpointConfigRequest{Request: req, Input: input} + return DeleteEndpointConfigRequest{Request: req, Input: input, Copy: c.DeleteEndpointConfigRequest} } const opDeleteModel = "DeleteModel" @@ -606,6 +615,7 @@ const opDeleteModel = "DeleteModel" type DeleteModelRequest struct { *aws.Request Input *DeleteModelInput + Copy func(*DeleteModelInput) DeleteModelRequest } // Send marshals and sends the DeleteModel API request. @@ -651,7 +661,7 @@ func (c *SageMaker) DeleteModelRequest(input *DeleteModelInput) DeleteModelReque req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteModelRequest{Request: req, Input: input} + return DeleteModelRequest{Request: req, Input: input, Copy: c.DeleteModelRequest} } const opDeleteNotebookInstance = "DeleteNotebookInstance" @@ -660,6 +670,7 @@ const opDeleteNotebookInstance = "DeleteNotebookInstance" type DeleteNotebookInstanceRequest struct { *aws.Request Input *DeleteNotebookInstanceInput + Copy func(*DeleteNotebookInstanceInput) DeleteNotebookInstanceRequest } // Send marshals and sends the DeleteNotebookInstance API request. @@ -707,7 +718,7 @@ func (c *SageMaker) DeleteNotebookInstanceRequest(input *DeleteNotebookInstanceI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteNotebookInstanceRequest{Request: req, Input: input} + return DeleteNotebookInstanceRequest{Request: req, Input: input, Copy: c.DeleteNotebookInstanceRequest} } const opDeleteTags = "DeleteTags" @@ -716,6 +727,7 @@ const opDeleteTags = "DeleteTags" type DeleteTagsRequest struct { *aws.Request Input *DeleteTagsInput + Copy func(*DeleteTagsInput) DeleteTagsRequest } // Send marshals and sends the DeleteTags API request. @@ -758,7 +770,7 @@ func (c *SageMaker) DeleteTagsRequest(input *DeleteTagsInput) DeleteTagsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTagsRequest{Request: req, Input: input} + return DeleteTagsRequest{Request: req, Input: input, Copy: c.DeleteTagsRequest} } const opDescribeEndpoint = "DescribeEndpoint" @@ -767,6 +779,7 @@ const opDescribeEndpoint = "DescribeEndpoint" type DescribeEndpointRequest struct { *aws.Request Input *DescribeEndpointInput + Copy func(*DescribeEndpointInput) DescribeEndpointRequest } // Send marshals and sends the DescribeEndpoint API request. @@ -807,7 +820,7 @@ func (c *SageMaker) DescribeEndpointRequest(input *DescribeEndpointInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEndpointRequest{Request: req, Input: input} + return DescribeEndpointRequest{Request: req, Input: input, Copy: c.DescribeEndpointRequest} } const opDescribeEndpointConfig = "DescribeEndpointConfig" @@ -816,6 +829,7 @@ const opDescribeEndpointConfig = "DescribeEndpointConfig" type DescribeEndpointConfigRequest struct { *aws.Request Input *DescribeEndpointConfigInput + Copy func(*DescribeEndpointConfigInput) DescribeEndpointConfigRequest } // Send marshals and sends the DescribeEndpointConfig API request. @@ -857,7 +871,7 @@ func (c *SageMaker) DescribeEndpointConfigRequest(input *DescribeEndpointConfigI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEndpointConfigRequest{Request: req, Input: input} + return DescribeEndpointConfigRequest{Request: req, Input: input, Copy: c.DescribeEndpointConfigRequest} } const opDescribeModel = "DescribeModel" @@ -866,6 +880,7 @@ const opDescribeModel = "DescribeModel" type DescribeModelRequest struct { *aws.Request Input *DescribeModelInput + Copy func(*DescribeModelInput) DescribeModelRequest } // Send marshals and sends the DescribeModel API request. @@ -906,7 +921,7 @@ func (c *SageMaker) DescribeModelRequest(input *DescribeModelInput) DescribeMode req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeModelRequest{Request: req, Input: input} + return DescribeModelRequest{Request: req, Input: input, Copy: c.DescribeModelRequest} } const opDescribeNotebookInstance = "DescribeNotebookInstance" @@ -915,6 +930,7 @@ const opDescribeNotebookInstance = "DescribeNotebookInstance" type DescribeNotebookInstanceRequest struct { *aws.Request Input *DescribeNotebookInstanceInput + Copy func(*DescribeNotebookInstanceInput) DescribeNotebookInstanceRequest } // Send marshals and sends the DescribeNotebookInstance API request. @@ -955,7 +971,7 @@ func (c *SageMaker) DescribeNotebookInstanceRequest(input *DescribeNotebookInsta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNotebookInstanceRequest{Request: req, Input: input} + return DescribeNotebookInstanceRequest{Request: req, Input: input, Copy: c.DescribeNotebookInstanceRequest} } const opDescribeTrainingJob = "DescribeTrainingJob" @@ -964,6 +980,7 @@ const opDescribeTrainingJob = "DescribeTrainingJob" type DescribeTrainingJobRequest struct { *aws.Request Input *DescribeTrainingJobInput + Copy func(*DescribeTrainingJobInput) DescribeTrainingJobRequest } // Send marshals and sends the DescribeTrainingJob API request. @@ -1004,7 +1021,7 @@ func (c *SageMaker) DescribeTrainingJobRequest(input *DescribeTrainingJobInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTrainingJobRequest{Request: req, Input: input} + return DescribeTrainingJobRequest{Request: req, Input: input, Copy: c.DescribeTrainingJobRequest} } const opListEndpointConfigs = "ListEndpointConfigs" @@ -1013,6 +1030,7 @@ const opListEndpointConfigs = "ListEndpointConfigs" type ListEndpointConfigsRequest struct { *aws.Request Input *ListEndpointConfigsInput + Copy func(*ListEndpointConfigsInput) ListEndpointConfigsRequest } // Send marshals and sends the ListEndpointConfigs API request. @@ -1059,57 +1077,53 @@ func (c *SageMaker) ListEndpointConfigsRequest(input *ListEndpointConfigsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListEndpointConfigsRequest{Request: req, Input: input} + return ListEndpointConfigsRequest{Request: req, Input: input, Copy: c.ListEndpointConfigsRequest} } -// ListEndpointConfigsPages iterates over the pages of a ListEndpointConfigs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEndpointConfigs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListEndpointConfigsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListEndpointConfigs operation. -// pageNum := 0 -// err := client.ListEndpointConfigsPages(params, -// func(page *ListEndpointConfigsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListEndpointConfigsPages(input *ListEndpointConfigsInput, fn func(*ListEndpointConfigsOutput, bool) bool) error { - return c.ListEndpointConfigsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEndpointConfigsPagesWithContext same as ListEndpointConfigsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SageMaker) ListEndpointConfigsPagesWithContext(ctx aws.Context, input *ListEndpointConfigsInput, fn func(*ListEndpointConfigsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListEndpointConfigsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListEndpointConfigsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListEndpointConfigsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListEndpointConfigsRequest) Paginate(opts ...aws.Option) ListEndpointConfigsPager { + return ListEndpointConfigsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListEndpointConfigsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEndpointConfigsOutput), !p.HasNextPage()) - } - return p.Err() +// ListEndpointConfigsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListEndpointConfigsPager struct { + aws.Pager +} + +func (p *ListEndpointConfigsPager) CurrentPage() *ListEndpointConfigsOutput { + return p.Pager.CurrentPage().(*ListEndpointConfigsOutput) } const opListEndpoints = "ListEndpoints" @@ -1118,6 +1132,7 @@ const opListEndpoints = "ListEndpoints" type ListEndpointsRequest struct { *aws.Request Input *ListEndpointsInput + Copy func(*ListEndpointsInput) ListEndpointsRequest } // Send marshals and sends the ListEndpoints API request. @@ -1164,57 +1179,53 @@ func (c *SageMaker) ListEndpointsRequest(input *ListEndpointsInput) ListEndpoint req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListEndpointsRequest{Request: req, Input: input} + return ListEndpointsRequest{Request: req, Input: input, Copy: c.ListEndpointsRequest} } -// ListEndpointsPages iterates over the pages of a ListEndpoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEndpoints method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListEndpointsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListEndpoints operation. -// pageNum := 0 -// err := client.ListEndpointsPages(params, -// func(page *ListEndpointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListEndpointsPages(input *ListEndpointsInput, fn func(*ListEndpointsOutput, bool) bool) error { - return c.ListEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEndpointsPagesWithContext same as ListEndpointsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SageMaker) ListEndpointsPagesWithContext(ctx aws.Context, input *ListEndpointsInput, fn func(*ListEndpointsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListEndpointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListEndpointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListEndpointsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListEndpointsRequest) Paginate(opts ...aws.Option) ListEndpointsPager { + return ListEndpointsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListEndpointsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEndpointsOutput), !p.HasNextPage()) - } - return p.Err() +// ListEndpointsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListEndpointsPager struct { + aws.Pager +} + +func (p *ListEndpointsPager) CurrentPage() *ListEndpointsOutput { + return p.Pager.CurrentPage().(*ListEndpointsOutput) } const opListModels = "ListModels" @@ -1223,6 +1234,7 @@ const opListModels = "ListModels" type ListModelsRequest struct { *aws.Request Input *ListModelsInput + Copy func(*ListModelsInput) ListModelsRequest } // Send marshals and sends the ListModels API request. @@ -1270,57 +1282,53 @@ func (c *SageMaker) ListModelsRequest(input *ListModelsInput) ListModelsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListModelsRequest{Request: req, Input: input} + return ListModelsRequest{Request: req, Input: input, Copy: c.ListModelsRequest} } -// ListModelsPages iterates over the pages of a ListModels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListModels method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListModelsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListModels operation. -// pageNum := 0 -// err := client.ListModelsPages(params, -// func(page *ListModelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListModelsPages(input *ListModelsInput, fn func(*ListModelsOutput, bool) bool) error { - return c.ListModelsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListModelsPagesWithContext same as ListModelsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SageMaker) ListModelsPagesWithContext(ctx aws.Context, input *ListModelsInput, fn func(*ListModelsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListModelsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListModelsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListModelsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListModelsRequest) Paginate(opts ...aws.Option) ListModelsPager { + return ListModelsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListModelsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListModelsOutput), !p.HasNextPage()) - } - return p.Err() +// ListModelsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListModelsPager struct { + aws.Pager +} + +func (p *ListModelsPager) CurrentPage() *ListModelsOutput { + return p.Pager.CurrentPage().(*ListModelsOutput) } const opListNotebookInstances = "ListNotebookInstances" @@ -1329,6 +1337,7 @@ const opListNotebookInstances = "ListNotebookInstances" type ListNotebookInstancesRequest struct { *aws.Request Input *ListNotebookInstancesInput + Copy func(*ListNotebookInstancesInput) ListNotebookInstancesRequest } // Send marshals and sends the ListNotebookInstances API request. @@ -1376,57 +1385,53 @@ func (c *SageMaker) ListNotebookInstancesRequest(input *ListNotebookInstancesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListNotebookInstancesRequest{Request: req, Input: input} + return ListNotebookInstancesRequest{Request: req, Input: input, Copy: c.ListNotebookInstancesRequest} } -// ListNotebookInstancesPages iterates over the pages of a ListNotebookInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNotebookInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListNotebookInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListNotebookInstances operation. -// pageNum := 0 -// err := client.ListNotebookInstancesPages(params, -// func(page *ListNotebookInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListNotebookInstancesPages(input *ListNotebookInstancesInput, fn func(*ListNotebookInstancesOutput, bool) bool) error { - return c.ListNotebookInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNotebookInstancesPagesWithContext same as ListNotebookInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SageMaker) ListNotebookInstancesPagesWithContext(ctx aws.Context, input *ListNotebookInstancesInput, fn func(*ListNotebookInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListNotebookInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListNotebookInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListNotebookInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListNotebookInstancesRequest) Paginate(opts ...aws.Option) ListNotebookInstancesPager { + return ListNotebookInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListNotebookInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNotebookInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// ListNotebookInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListNotebookInstancesPager struct { + aws.Pager +} + +func (p *ListNotebookInstancesPager) CurrentPage() *ListNotebookInstancesOutput { + return p.Pager.CurrentPage().(*ListNotebookInstancesOutput) } const opListTags = "ListTags" @@ -1435,6 +1440,7 @@ const opListTags = "ListTags" type ListTagsRequest struct { *aws.Request Input *ListTagsInput + Copy func(*ListTagsInput) ListTagsRequest } // Send marshals and sends the ListTags API request. @@ -1481,57 +1487,53 @@ func (c *SageMaker) ListTagsRequest(input *ListTagsInput) ListTagsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsRequest{Request: req, Input: input} + return ListTagsRequest{Request: req, Input: input, Copy: c.ListTagsRequest} } -// ListTagsPages iterates over the pages of a ListTags operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTags method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTagsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTags operation. -// pageNum := 0 -// err := client.ListTagsPages(params, -// func(page *ListTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListTagsPages(input *ListTagsInput, fn func(*ListTagsOutput, bool) bool) error { - return c.ListTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTagsPagesWithContext same as ListTagsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SageMaker) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, fn func(*ListTagsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTagsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTagsRequest) Paginate(opts ...aws.Option) ListTagsPager { + return ListTagsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTagsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) - } - return p.Err() +// ListTagsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTagsPager struct { + aws.Pager +} + +func (p *ListTagsPager) CurrentPage() *ListTagsOutput { + return p.Pager.CurrentPage().(*ListTagsOutput) } const opListTrainingJobs = "ListTrainingJobs" @@ -1540,6 +1542,7 @@ const opListTrainingJobs = "ListTrainingJobs" type ListTrainingJobsRequest struct { *aws.Request Input *ListTrainingJobsInput + Copy func(*ListTrainingJobsInput) ListTrainingJobsRequest } // Send marshals and sends the ListTrainingJobs API request. @@ -1586,57 +1589,53 @@ func (c *SageMaker) ListTrainingJobsRequest(input *ListTrainingJobsInput) ListTr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTrainingJobsRequest{Request: req, Input: input} + return ListTrainingJobsRequest{Request: req, Input: input, Copy: c.ListTrainingJobsRequest} } -// ListTrainingJobsPages iterates over the pages of a ListTrainingJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTrainingJobs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTrainingJobsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTrainingJobs operation. -// pageNum := 0 -// err := client.ListTrainingJobsPages(params, -// func(page *ListTrainingJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListTrainingJobsPages(input *ListTrainingJobsInput, fn func(*ListTrainingJobsOutput, bool) bool) error { - return c.ListTrainingJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTrainingJobsPagesWithContext same as ListTrainingJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SageMaker) ListTrainingJobsPagesWithContext(ctx aws.Context, input *ListTrainingJobsInput, fn func(*ListTrainingJobsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTrainingJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTrainingJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTrainingJobsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTrainingJobsRequest) Paginate(opts ...aws.Option) ListTrainingJobsPager { + return ListTrainingJobsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTrainingJobsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTrainingJobsOutput), !p.HasNextPage()) - } - return p.Err() +// ListTrainingJobsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTrainingJobsPager struct { + aws.Pager +} + +func (p *ListTrainingJobsPager) CurrentPage() *ListTrainingJobsOutput { + return p.Pager.CurrentPage().(*ListTrainingJobsOutput) } const opStartNotebookInstance = "StartNotebookInstance" @@ -1645,6 +1644,7 @@ const opStartNotebookInstance = "StartNotebookInstance" type StartNotebookInstanceRequest struct { *aws.Request Input *StartNotebookInstanceInput + Copy func(*StartNotebookInstanceInput) StartNotebookInstanceRequest } // Send marshals and sends the StartNotebookInstance API request. @@ -1691,7 +1691,7 @@ func (c *SageMaker) StartNotebookInstanceRequest(input *StartNotebookInstanceInp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StartNotebookInstanceRequest{Request: req, Input: input} + return StartNotebookInstanceRequest{Request: req, Input: input, Copy: c.StartNotebookInstanceRequest} } const opStopNotebookInstance = "StopNotebookInstance" @@ -1700,6 +1700,7 @@ const opStopNotebookInstance = "StopNotebookInstance" type StopNotebookInstanceRequest struct { *aws.Request Input *StopNotebookInstanceInput + Copy func(*StopNotebookInstanceInput) StopNotebookInstanceRequest } // Send marshals and sends the StopNotebookInstance API request. @@ -1749,7 +1750,7 @@ func (c *SageMaker) StopNotebookInstanceRequest(input *StopNotebookInstanceInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StopNotebookInstanceRequest{Request: req, Input: input} + return StopNotebookInstanceRequest{Request: req, Input: input, Copy: c.StopNotebookInstanceRequest} } const opStopTrainingJob = "StopTrainingJob" @@ -1758,6 +1759,7 @@ const opStopTrainingJob = "StopTrainingJob" type StopTrainingJobRequest struct { *aws.Request Input *StopTrainingJobInput + Copy func(*StopTrainingJobInput) StopTrainingJobRequest } // Send marshals and sends the StopTrainingJob API request. @@ -1812,7 +1814,7 @@ func (c *SageMaker) StopTrainingJobRequest(input *StopTrainingJobInput) StopTrai req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return StopTrainingJobRequest{Request: req, Input: input} + return StopTrainingJobRequest{Request: req, Input: input, Copy: c.StopTrainingJobRequest} } const opUpdateEndpoint = "UpdateEndpoint" @@ -1821,6 +1823,7 @@ const opUpdateEndpoint = "UpdateEndpoint" type UpdateEndpointRequest struct { *aws.Request Input *UpdateEndpointInput + Copy func(*UpdateEndpointInput) UpdateEndpointRequest } // Send marshals and sends the UpdateEndpoint API request. @@ -1868,7 +1871,7 @@ func (c *SageMaker) UpdateEndpointRequest(input *UpdateEndpointInput) UpdateEndp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEndpointRequest{Request: req, Input: input} + return UpdateEndpointRequest{Request: req, Input: input, Copy: c.UpdateEndpointRequest} } const opUpdateEndpointWeightsAndCapacities = "UpdateEndpointWeightsAndCapacities" @@ -1877,6 +1880,7 @@ const opUpdateEndpointWeightsAndCapacities = "UpdateEndpointWeightsAndCapacities type UpdateEndpointWeightsAndCapacitiesRequest struct { *aws.Request Input *UpdateEndpointWeightsAndCapacitiesInput + Copy func(*UpdateEndpointWeightsAndCapacitiesInput) UpdateEndpointWeightsAndCapacitiesRequest } // Send marshals and sends the UpdateEndpointWeightsAndCapacities API request. @@ -1923,7 +1927,7 @@ func (c *SageMaker) UpdateEndpointWeightsAndCapacitiesRequest(input *UpdateEndpo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateEndpointWeightsAndCapacitiesRequest{Request: req, Input: input} + return UpdateEndpointWeightsAndCapacitiesRequest{Request: req, Input: input, Copy: c.UpdateEndpointWeightsAndCapacitiesRequest} } const opUpdateNotebookInstance = "UpdateNotebookInstance" @@ -1932,6 +1936,7 @@ const opUpdateNotebookInstance = "UpdateNotebookInstance" type UpdateNotebookInstanceRequest struct { *aws.Request Input *UpdateNotebookInstanceInput + Copy func(*UpdateNotebookInstanceInput) UpdateNotebookInstanceRequest } // Send marshals and sends the UpdateNotebookInstance API request. @@ -1975,7 +1980,7 @@ func (c *SageMaker) UpdateNotebookInstanceRequest(input *UpdateNotebookInstanceI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateNotebookInstanceRequest{Request: req, Input: input} + return UpdateNotebookInstanceRequest{Request: req, Input: input, Copy: c.UpdateNotebookInstanceRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/AddTagsInput diff --git a/service/sagemaker/sagemakeriface/interface.go b/service/sagemaker/sagemakeriface/interface.go index d82a24aa404..66831100398 100644 --- a/service/sagemaker/sagemakeriface/interface.go +++ b/service/sagemaker/sagemakeriface/interface.go @@ -99,34 +99,16 @@ type SageMakerAPI interface { ListEndpointConfigsRequest(*sagemaker.ListEndpointConfigsInput) sagemaker.ListEndpointConfigsRequest - ListEndpointConfigsPages(*sagemaker.ListEndpointConfigsInput, func(*sagemaker.ListEndpointConfigsOutput, bool) bool) error - ListEndpointConfigsPagesWithContext(aws.Context, *sagemaker.ListEndpointConfigsInput, func(*sagemaker.ListEndpointConfigsOutput, bool) bool, ...aws.Option) error - ListEndpointsRequest(*sagemaker.ListEndpointsInput) sagemaker.ListEndpointsRequest - ListEndpointsPages(*sagemaker.ListEndpointsInput, func(*sagemaker.ListEndpointsOutput, bool) bool) error - ListEndpointsPagesWithContext(aws.Context, *sagemaker.ListEndpointsInput, func(*sagemaker.ListEndpointsOutput, bool) bool, ...aws.Option) error - ListModelsRequest(*sagemaker.ListModelsInput) sagemaker.ListModelsRequest - ListModelsPages(*sagemaker.ListModelsInput, func(*sagemaker.ListModelsOutput, bool) bool) error - ListModelsPagesWithContext(aws.Context, *sagemaker.ListModelsInput, func(*sagemaker.ListModelsOutput, bool) bool, ...aws.Option) error - ListNotebookInstancesRequest(*sagemaker.ListNotebookInstancesInput) sagemaker.ListNotebookInstancesRequest - ListNotebookInstancesPages(*sagemaker.ListNotebookInstancesInput, func(*sagemaker.ListNotebookInstancesOutput, bool) bool) error - ListNotebookInstancesPagesWithContext(aws.Context, *sagemaker.ListNotebookInstancesInput, func(*sagemaker.ListNotebookInstancesOutput, bool) bool, ...aws.Option) error - ListTagsRequest(*sagemaker.ListTagsInput) sagemaker.ListTagsRequest - ListTagsPages(*sagemaker.ListTagsInput, func(*sagemaker.ListTagsOutput, bool) bool) error - ListTagsPagesWithContext(aws.Context, *sagemaker.ListTagsInput, func(*sagemaker.ListTagsOutput, bool) bool, ...aws.Option) error - ListTrainingJobsRequest(*sagemaker.ListTrainingJobsInput) sagemaker.ListTrainingJobsRequest - ListTrainingJobsPages(*sagemaker.ListTrainingJobsInput, func(*sagemaker.ListTrainingJobsOutput, bool) bool) error - ListTrainingJobsPagesWithContext(aws.Context, *sagemaker.ListTrainingJobsInput, func(*sagemaker.ListTrainingJobsOutput, bool) bool, ...aws.Option) error - StartNotebookInstanceRequest(*sagemaker.StartNotebookInstanceInput) sagemaker.StartNotebookInstanceRequest StopNotebookInstanceRequest(*sagemaker.StopNotebookInstanceInput) sagemaker.StopNotebookInstanceRequest diff --git a/service/sagemakerruntime/api.go b/service/sagemakerruntime/api.go index ef1192a6aa3..2fdd661f6b3 100644 --- a/service/sagemakerruntime/api.go +++ b/service/sagemakerruntime/api.go @@ -14,6 +14,7 @@ const opInvokeEndpoint = "InvokeEndpoint" type InvokeEndpointRequest struct { *aws.Request Input *InvokeEndpointInput + Copy func(*InvokeEndpointInput) InvokeEndpointRequest } // Send marshals and sends the InvokeEndpoint API request. @@ -62,7 +63,7 @@ func (c *SageMakerRuntime) InvokeEndpointRequest(input *InvokeEndpointInput) Inv req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InvokeEndpointRequest{Request: req, Input: input} + return InvokeEndpointRequest{Request: req, Input: input, Copy: c.InvokeEndpointRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/runtime.sagemaker-2017-05-13/InvokeEndpointInput diff --git a/service/serverlessapplicationrepository/api.go b/service/serverlessapplicationrepository/api.go index 4d14248db76..82739752a69 100644 --- a/service/serverlessapplicationrepository/api.go +++ b/service/serverlessapplicationrepository/api.go @@ -14,6 +14,7 @@ const opCreateApplication = "CreateApplication" type CreateApplicationRequest struct { *aws.Request Input *CreateApplicationInput + Copy func(*CreateApplicationInput) CreateApplicationRequest } // Send marshals and sends the CreateApplication API request. @@ -55,7 +56,7 @@ func (c *ServerlessApplicationRepository) CreateApplicationRequest(input *Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateApplicationRequest{Request: req, Input: input} + return CreateApplicationRequest{Request: req, Input: input, Copy: c.CreateApplicationRequest} } const opCreateApplicationVersion = "CreateApplicationVersion" @@ -64,6 +65,7 @@ const opCreateApplicationVersion = "CreateApplicationVersion" type CreateApplicationVersionRequest struct { *aws.Request Input *CreateApplicationVersionInput + Copy func(*CreateApplicationVersionInput) CreateApplicationVersionRequest } // Send marshals and sends the CreateApplicationVersion API request. @@ -104,7 +106,7 @@ func (c *ServerlessApplicationRepository) CreateApplicationVersionRequest(input req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateApplicationVersionRequest{Request: req, Input: input} + return CreateApplicationVersionRequest{Request: req, Input: input, Copy: c.CreateApplicationVersionRequest} } const opCreateCloudFormationChangeSet = "CreateCloudFormationChangeSet" @@ -113,6 +115,7 @@ const opCreateCloudFormationChangeSet = "CreateCloudFormationChangeSet" type CreateCloudFormationChangeSetRequest struct { *aws.Request Input *CreateCloudFormationChangeSetInput + Copy func(*CreateCloudFormationChangeSetInput) CreateCloudFormationChangeSetRequest } // Send marshals and sends the CreateCloudFormationChangeSet API request. @@ -153,7 +156,7 @@ func (c *ServerlessApplicationRepository) CreateCloudFormationChangeSetRequest(i req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCloudFormationChangeSetRequest{Request: req, Input: input} + return CreateCloudFormationChangeSetRequest{Request: req, Input: input, Copy: c.CreateCloudFormationChangeSetRequest} } const opGetApplication = "GetApplication" @@ -162,6 +165,7 @@ const opGetApplication = "GetApplication" type GetApplicationRequest struct { *aws.Request Input *GetApplicationInput + Copy func(*GetApplicationInput) GetApplicationRequest } // Send marshals and sends the GetApplication API request. @@ -202,7 +206,7 @@ func (c *ServerlessApplicationRepository) GetApplicationRequest(input *GetApplic req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApplicationRequest{Request: req, Input: input} + return GetApplicationRequest{Request: req, Input: input, Copy: c.GetApplicationRequest} } const opGetApplicationPolicy = "GetApplicationPolicy" @@ -211,6 +215,7 @@ const opGetApplicationPolicy = "GetApplicationPolicy" type GetApplicationPolicyRequest struct { *aws.Request Input *GetApplicationPolicyInput + Copy func(*GetApplicationPolicyInput) GetApplicationPolicyRequest } // Send marshals and sends the GetApplicationPolicy API request. @@ -251,7 +256,7 @@ func (c *ServerlessApplicationRepository) GetApplicationPolicyRequest(input *Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetApplicationPolicyRequest{Request: req, Input: input} + return GetApplicationPolicyRequest{Request: req, Input: input, Copy: c.GetApplicationPolicyRequest} } const opListApplicationVersions = "ListApplicationVersions" @@ -260,6 +265,7 @@ const opListApplicationVersions = "ListApplicationVersions" type ListApplicationVersionsRequest struct { *aws.Request Input *ListApplicationVersionsInput + Copy func(*ListApplicationVersionsInput) ListApplicationVersionsRequest } // Send marshals and sends the ListApplicationVersions API request. @@ -300,7 +306,7 @@ func (c *ServerlessApplicationRepository) ListApplicationVersionsRequest(input * req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListApplicationVersionsRequest{Request: req, Input: input} + return ListApplicationVersionsRequest{Request: req, Input: input, Copy: c.ListApplicationVersionsRequest} } const opListApplications = "ListApplications" @@ -309,6 +315,7 @@ const opListApplications = "ListApplications" type ListApplicationsRequest struct { *aws.Request Input *ListApplicationsInput + Copy func(*ListApplicationsInput) ListApplicationsRequest } // Send marshals and sends the ListApplications API request. @@ -349,7 +356,7 @@ func (c *ServerlessApplicationRepository) ListApplicationsRequest(input *ListApp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListApplicationsRequest{Request: req, Input: input} + return ListApplicationsRequest{Request: req, Input: input, Copy: c.ListApplicationsRequest} } const opPutApplicationPolicy = "PutApplicationPolicy" @@ -358,6 +365,7 @@ const opPutApplicationPolicy = "PutApplicationPolicy" type PutApplicationPolicyRequest struct { *aws.Request Input *PutApplicationPolicyInput + Copy func(*PutApplicationPolicyInput) PutApplicationPolicyRequest } // Send marshals and sends the PutApplicationPolicy API request. @@ -398,7 +406,7 @@ func (c *ServerlessApplicationRepository) PutApplicationPolicyRequest(input *Put req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutApplicationPolicyRequest{Request: req, Input: input} + return PutApplicationPolicyRequest{Request: req, Input: input, Copy: c.PutApplicationPolicyRequest} } const opUpdateApplication = "UpdateApplication" @@ -407,6 +415,7 @@ const opUpdateApplication = "UpdateApplication" type UpdateApplicationRequest struct { *aws.Request Input *UpdateApplicationInput + Copy func(*UpdateApplicationInput) UpdateApplicationRequest } // Send marshals and sends the UpdateApplication API request. @@ -447,7 +456,7 @@ func (c *ServerlessApplicationRepository) UpdateApplicationRequest(input *Update req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateApplicationRequest{Request: req, Input: input} + return UpdateApplicationRequest{Request: req, Input: input, Copy: c.UpdateApplicationRequest} } // Policy statement applied to the application. diff --git a/service/servicecatalog/api.go b/service/servicecatalog/api.go index 9671733638a..4fa30b1820b 100644 --- a/service/servicecatalog/api.go +++ b/service/servicecatalog/api.go @@ -16,6 +16,7 @@ const opAcceptPortfolioShare = "AcceptPortfolioShare" type AcceptPortfolioShareRequest struct { *aws.Request Input *AcceptPortfolioShareInput + Copy func(*AcceptPortfolioShareInput) AcceptPortfolioShareRequest } // Send marshals and sends the AcceptPortfolioShare API request. @@ -56,7 +57,7 @@ func (c *ServiceCatalog) AcceptPortfolioShareRequest(input *AcceptPortfolioShare req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AcceptPortfolioShareRequest{Request: req, Input: input} + return AcceptPortfolioShareRequest{Request: req, Input: input, Copy: c.AcceptPortfolioShareRequest} } const opAssociatePrincipalWithPortfolio = "AssociatePrincipalWithPortfolio" @@ -65,6 +66,7 @@ const opAssociatePrincipalWithPortfolio = "AssociatePrincipalWithPortfolio" type AssociatePrincipalWithPortfolioRequest struct { *aws.Request Input *AssociatePrincipalWithPortfolioInput + Copy func(*AssociatePrincipalWithPortfolioInput) AssociatePrincipalWithPortfolioRequest } // Send marshals and sends the AssociatePrincipalWithPortfolio API request. @@ -105,7 +107,7 @@ func (c *ServiceCatalog) AssociatePrincipalWithPortfolioRequest(input *Associate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociatePrincipalWithPortfolioRequest{Request: req, Input: input} + return AssociatePrincipalWithPortfolioRequest{Request: req, Input: input, Copy: c.AssociatePrincipalWithPortfolioRequest} } const opAssociateProductWithPortfolio = "AssociateProductWithPortfolio" @@ -114,6 +116,7 @@ const opAssociateProductWithPortfolio = "AssociateProductWithPortfolio" type AssociateProductWithPortfolioRequest struct { *aws.Request Input *AssociateProductWithPortfolioInput + Copy func(*AssociateProductWithPortfolioInput) AssociateProductWithPortfolioRequest } // Send marshals and sends the AssociateProductWithPortfolio API request. @@ -154,7 +157,7 @@ func (c *ServiceCatalog) AssociateProductWithPortfolioRequest(input *AssociatePr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateProductWithPortfolioRequest{Request: req, Input: input} + return AssociateProductWithPortfolioRequest{Request: req, Input: input, Copy: c.AssociateProductWithPortfolioRequest} } const opAssociateTagOptionWithResource = "AssociateTagOptionWithResource" @@ -163,6 +166,7 @@ const opAssociateTagOptionWithResource = "AssociateTagOptionWithResource" type AssociateTagOptionWithResourceRequest struct { *aws.Request Input *AssociateTagOptionWithResourceInput + Copy func(*AssociateTagOptionWithResourceInput) AssociateTagOptionWithResourceRequest } // Send marshals and sends the AssociateTagOptionWithResource API request. @@ -203,7 +207,7 @@ func (c *ServiceCatalog) AssociateTagOptionWithResourceRequest(input *AssociateT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateTagOptionWithResourceRequest{Request: req, Input: input} + return AssociateTagOptionWithResourceRequest{Request: req, Input: input, Copy: c.AssociateTagOptionWithResourceRequest} } const opCopyProduct = "CopyProduct" @@ -212,6 +216,7 @@ const opCopyProduct = "CopyProduct" type CopyProductRequest struct { *aws.Request Input *CopyProductInput + Copy func(*CopyProductInput) CopyProductRequest } // Send marshals and sends the CopyProduct API request. @@ -259,7 +264,7 @@ func (c *ServiceCatalog) CopyProductRequest(input *CopyProductInput) CopyProduct req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CopyProductRequest{Request: req, Input: input} + return CopyProductRequest{Request: req, Input: input, Copy: c.CopyProductRequest} } const opCreateConstraint = "CreateConstraint" @@ -268,6 +273,7 @@ const opCreateConstraint = "CreateConstraint" type CreateConstraintRequest struct { *aws.Request Input *CreateConstraintInput + Copy func(*CreateConstraintInput) CreateConstraintRequest } // Send marshals and sends the CreateConstraint API request. @@ -308,7 +314,7 @@ func (c *ServiceCatalog) CreateConstraintRequest(input *CreateConstraintInput) C req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateConstraintRequest{Request: req, Input: input} + return CreateConstraintRequest{Request: req, Input: input, Copy: c.CreateConstraintRequest} } const opCreatePortfolio = "CreatePortfolio" @@ -317,6 +323,7 @@ const opCreatePortfolio = "CreatePortfolio" type CreatePortfolioRequest struct { *aws.Request Input *CreatePortfolioInput + Copy func(*CreatePortfolioInput) CreatePortfolioRequest } // Send marshals and sends the CreatePortfolio API request. @@ -357,7 +364,7 @@ func (c *ServiceCatalog) CreatePortfolioRequest(input *CreatePortfolioInput) Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePortfolioRequest{Request: req, Input: input} + return CreatePortfolioRequest{Request: req, Input: input, Copy: c.CreatePortfolioRequest} } const opCreatePortfolioShare = "CreatePortfolioShare" @@ -366,6 +373,7 @@ const opCreatePortfolioShare = "CreatePortfolioShare" type CreatePortfolioShareRequest struct { *aws.Request Input *CreatePortfolioShareInput + Copy func(*CreatePortfolioShareInput) CreatePortfolioShareRequest } // Send marshals and sends the CreatePortfolioShare API request. @@ -406,7 +414,7 @@ func (c *ServiceCatalog) CreatePortfolioShareRequest(input *CreatePortfolioShare req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePortfolioShareRequest{Request: req, Input: input} + return CreatePortfolioShareRequest{Request: req, Input: input, Copy: c.CreatePortfolioShareRequest} } const opCreateProduct = "CreateProduct" @@ -415,6 +423,7 @@ const opCreateProduct = "CreateProduct" type CreateProductRequest struct { *aws.Request Input *CreateProductInput + Copy func(*CreateProductInput) CreateProductRequest } // Send marshals and sends the CreateProduct API request. @@ -455,7 +464,7 @@ func (c *ServiceCatalog) CreateProductRequest(input *CreateProductInput) CreateP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateProductRequest{Request: req, Input: input} + return CreateProductRequest{Request: req, Input: input, Copy: c.CreateProductRequest} } const opCreateProvisioningArtifact = "CreateProvisioningArtifact" @@ -464,6 +473,7 @@ const opCreateProvisioningArtifact = "CreateProvisioningArtifact" type CreateProvisioningArtifactRequest struct { *aws.Request Input *CreateProvisioningArtifactInput + Copy func(*CreateProvisioningArtifactInput) CreateProvisioningArtifactRequest } // Send marshals and sends the CreateProvisioningArtifact API request. @@ -508,7 +518,7 @@ func (c *ServiceCatalog) CreateProvisioningArtifactRequest(input *CreateProvisio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateProvisioningArtifactRequest{Request: req, Input: input} + return CreateProvisioningArtifactRequest{Request: req, Input: input, Copy: c.CreateProvisioningArtifactRequest} } const opCreateTagOption = "CreateTagOption" @@ -517,6 +527,7 @@ const opCreateTagOption = "CreateTagOption" type CreateTagOptionRequest struct { *aws.Request Input *CreateTagOptionInput + Copy func(*CreateTagOptionInput) CreateTagOptionRequest } // Send marshals and sends the CreateTagOption API request. @@ -557,7 +568,7 @@ func (c *ServiceCatalog) CreateTagOptionRequest(input *CreateTagOptionInput) Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTagOptionRequest{Request: req, Input: input} + return CreateTagOptionRequest{Request: req, Input: input, Copy: c.CreateTagOptionRequest} } const opDeleteConstraint = "DeleteConstraint" @@ -566,6 +577,7 @@ const opDeleteConstraint = "DeleteConstraint" type DeleteConstraintRequest struct { *aws.Request Input *DeleteConstraintInput + Copy func(*DeleteConstraintInput) DeleteConstraintRequest } // Send marshals and sends the DeleteConstraint API request. @@ -606,7 +618,7 @@ func (c *ServiceCatalog) DeleteConstraintRequest(input *DeleteConstraintInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteConstraintRequest{Request: req, Input: input} + return DeleteConstraintRequest{Request: req, Input: input, Copy: c.DeleteConstraintRequest} } const opDeletePortfolio = "DeletePortfolio" @@ -615,6 +627,7 @@ const opDeletePortfolio = "DeletePortfolio" type DeletePortfolioRequest struct { *aws.Request Input *DeletePortfolioInput + Copy func(*DeletePortfolioInput) DeletePortfolioRequest } // Send marshals and sends the DeletePortfolio API request. @@ -658,7 +671,7 @@ func (c *ServiceCatalog) DeletePortfolioRequest(input *DeletePortfolioInput) Del req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeletePortfolioRequest{Request: req, Input: input} + return DeletePortfolioRequest{Request: req, Input: input, Copy: c.DeletePortfolioRequest} } const opDeletePortfolioShare = "DeletePortfolioShare" @@ -667,6 +680,7 @@ const opDeletePortfolioShare = "DeletePortfolioShare" type DeletePortfolioShareRequest struct { *aws.Request Input *DeletePortfolioShareInput + Copy func(*DeletePortfolioShareInput) DeletePortfolioShareRequest } // Send marshals and sends the DeletePortfolioShare API request. @@ -707,7 +721,7 @@ func (c *ServiceCatalog) DeletePortfolioShareRequest(input *DeletePortfolioShare req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeletePortfolioShareRequest{Request: req, Input: input} + return DeletePortfolioShareRequest{Request: req, Input: input, Copy: c.DeletePortfolioShareRequest} } const opDeleteProduct = "DeleteProduct" @@ -716,6 +730,7 @@ const opDeleteProduct = "DeleteProduct" type DeleteProductRequest struct { *aws.Request Input *DeleteProductInput + Copy func(*DeleteProductInput) DeleteProductRequest } // Send marshals and sends the DeleteProduct API request. @@ -759,7 +774,7 @@ func (c *ServiceCatalog) DeleteProductRequest(input *DeleteProductInput) DeleteP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteProductRequest{Request: req, Input: input} + return DeleteProductRequest{Request: req, Input: input, Copy: c.DeleteProductRequest} } const opDeleteProvisioningArtifact = "DeleteProvisioningArtifact" @@ -768,6 +783,7 @@ const opDeleteProvisioningArtifact = "DeleteProvisioningArtifact" type DeleteProvisioningArtifactRequest struct { *aws.Request Input *DeleteProvisioningArtifactInput + Copy func(*DeleteProvisioningArtifactInput) DeleteProvisioningArtifactRequest } // Send marshals and sends the DeleteProvisioningArtifact API request. @@ -813,7 +829,7 @@ func (c *ServiceCatalog) DeleteProvisioningArtifactRequest(input *DeleteProvisio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteProvisioningArtifactRequest{Request: req, Input: input} + return DeleteProvisioningArtifactRequest{Request: req, Input: input, Copy: c.DeleteProvisioningArtifactRequest} } const opDescribeConstraint = "DescribeConstraint" @@ -822,6 +838,7 @@ const opDescribeConstraint = "DescribeConstraint" type DescribeConstraintRequest struct { *aws.Request Input *DescribeConstraintInput + Copy func(*DescribeConstraintInput) DescribeConstraintRequest } // Send marshals and sends the DescribeConstraint API request. @@ -862,7 +879,7 @@ func (c *ServiceCatalog) DescribeConstraintRequest(input *DescribeConstraintInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConstraintRequest{Request: req, Input: input} + return DescribeConstraintRequest{Request: req, Input: input, Copy: c.DescribeConstraintRequest} } const opDescribeCopyProductStatus = "DescribeCopyProductStatus" @@ -871,6 +888,7 @@ const opDescribeCopyProductStatus = "DescribeCopyProductStatus" type DescribeCopyProductStatusRequest struct { *aws.Request Input *DescribeCopyProductStatusInput + Copy func(*DescribeCopyProductStatusInput) DescribeCopyProductStatusRequest } // Send marshals and sends the DescribeCopyProductStatus API request. @@ -911,7 +929,7 @@ func (c *ServiceCatalog) DescribeCopyProductStatusRequest(input *DescribeCopyPro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCopyProductStatusRequest{Request: req, Input: input} + return DescribeCopyProductStatusRequest{Request: req, Input: input, Copy: c.DescribeCopyProductStatusRequest} } const opDescribePortfolio = "DescribePortfolio" @@ -920,6 +938,7 @@ const opDescribePortfolio = "DescribePortfolio" type DescribePortfolioRequest struct { *aws.Request Input *DescribePortfolioInput + Copy func(*DescribePortfolioInput) DescribePortfolioRequest } // Send marshals and sends the DescribePortfolio API request. @@ -960,7 +979,7 @@ func (c *ServiceCatalog) DescribePortfolioRequest(input *DescribePortfolioInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePortfolioRequest{Request: req, Input: input} + return DescribePortfolioRequest{Request: req, Input: input, Copy: c.DescribePortfolioRequest} } const opDescribeProduct = "DescribeProduct" @@ -969,6 +988,7 @@ const opDescribeProduct = "DescribeProduct" type DescribeProductRequest struct { *aws.Request Input *DescribeProductInput + Copy func(*DescribeProductInput) DescribeProductRequest } // Send marshals and sends the DescribeProduct API request. @@ -1009,7 +1029,7 @@ func (c *ServiceCatalog) DescribeProductRequest(input *DescribeProductInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeProductRequest{Request: req, Input: input} + return DescribeProductRequest{Request: req, Input: input, Copy: c.DescribeProductRequest} } const opDescribeProductAsAdmin = "DescribeProductAsAdmin" @@ -1018,6 +1038,7 @@ const opDescribeProductAsAdmin = "DescribeProductAsAdmin" type DescribeProductAsAdminRequest struct { *aws.Request Input *DescribeProductAsAdminInput + Copy func(*DescribeProductAsAdminInput) DescribeProductAsAdminRequest } // Send marshals and sends the DescribeProductAsAdmin API request. @@ -1059,7 +1080,7 @@ func (c *ServiceCatalog) DescribeProductAsAdminRequest(input *DescribeProductAsA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeProductAsAdminRequest{Request: req, Input: input} + return DescribeProductAsAdminRequest{Request: req, Input: input, Copy: c.DescribeProductAsAdminRequest} } const opDescribeProductView = "DescribeProductView" @@ -1068,6 +1089,7 @@ const opDescribeProductView = "DescribeProductView" type DescribeProductViewRequest struct { *aws.Request Input *DescribeProductViewInput + Copy func(*DescribeProductViewInput) DescribeProductViewRequest } // Send marshals and sends the DescribeProductView API request. @@ -1108,7 +1130,7 @@ func (c *ServiceCatalog) DescribeProductViewRequest(input *DescribeProductViewIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeProductViewRequest{Request: req, Input: input} + return DescribeProductViewRequest{Request: req, Input: input, Copy: c.DescribeProductViewRequest} } const opDescribeProvisionedProduct = "DescribeProvisionedProduct" @@ -1117,6 +1139,7 @@ const opDescribeProvisionedProduct = "DescribeProvisionedProduct" type DescribeProvisionedProductRequest struct { *aws.Request Input *DescribeProvisionedProductInput + Copy func(*DescribeProvisionedProductInput) DescribeProvisionedProductRequest } // Send marshals and sends the DescribeProvisionedProduct API request. @@ -1157,7 +1180,7 @@ func (c *ServiceCatalog) DescribeProvisionedProductRequest(input *DescribeProvis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeProvisionedProductRequest{Request: req, Input: input} + return DescribeProvisionedProductRequest{Request: req, Input: input, Copy: c.DescribeProvisionedProductRequest} } const opDescribeProvisioningArtifact = "DescribeProvisioningArtifact" @@ -1166,6 +1189,7 @@ const opDescribeProvisioningArtifact = "DescribeProvisioningArtifact" type DescribeProvisioningArtifactRequest struct { *aws.Request Input *DescribeProvisioningArtifactInput + Copy func(*DescribeProvisioningArtifactInput) DescribeProvisioningArtifactRequest } // Send marshals and sends the DescribeProvisioningArtifact API request. @@ -1207,7 +1231,7 @@ func (c *ServiceCatalog) DescribeProvisioningArtifactRequest(input *DescribeProv req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeProvisioningArtifactRequest{Request: req, Input: input} + return DescribeProvisioningArtifactRequest{Request: req, Input: input, Copy: c.DescribeProvisioningArtifactRequest} } const opDescribeProvisioningParameters = "DescribeProvisioningParameters" @@ -1216,6 +1240,7 @@ const opDescribeProvisioningParameters = "DescribeProvisioningParameters" type DescribeProvisioningParametersRequest struct { *aws.Request Input *DescribeProvisioningParametersInput + Copy func(*DescribeProvisioningParametersInput) DescribeProvisioningParametersRequest } // Send marshals and sends the DescribeProvisioningParameters API request. @@ -1264,7 +1289,7 @@ func (c *ServiceCatalog) DescribeProvisioningParametersRequest(input *DescribePr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeProvisioningParametersRequest{Request: req, Input: input} + return DescribeProvisioningParametersRequest{Request: req, Input: input, Copy: c.DescribeProvisioningParametersRequest} } const opDescribeRecord = "DescribeRecord" @@ -1273,6 +1298,7 @@ const opDescribeRecord = "DescribeRecord" type DescribeRecordRequest struct { *aws.Request Input *DescribeRecordInput + Copy func(*DescribeRecordInput) DescribeRecordRequest } // Send marshals and sends the DescribeRecord API request. @@ -1316,7 +1342,7 @@ func (c *ServiceCatalog) DescribeRecordRequest(input *DescribeRecordInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRecordRequest{Request: req, Input: input} + return DescribeRecordRequest{Request: req, Input: input, Copy: c.DescribeRecordRequest} } const opDescribeTagOption = "DescribeTagOption" @@ -1325,6 +1351,7 @@ const opDescribeTagOption = "DescribeTagOption" type DescribeTagOptionRequest struct { *aws.Request Input *DescribeTagOptionInput + Copy func(*DescribeTagOptionInput) DescribeTagOptionRequest } // Send marshals and sends the DescribeTagOption API request. @@ -1365,7 +1392,7 @@ func (c *ServiceCatalog) DescribeTagOptionRequest(input *DescribeTagOptionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagOptionRequest{Request: req, Input: input} + return DescribeTagOptionRequest{Request: req, Input: input, Copy: c.DescribeTagOptionRequest} } const opDisassociatePrincipalFromPortfolio = "DisassociatePrincipalFromPortfolio" @@ -1374,6 +1401,7 @@ const opDisassociatePrincipalFromPortfolio = "DisassociatePrincipalFromPortfolio type DisassociatePrincipalFromPortfolioRequest struct { *aws.Request Input *DisassociatePrincipalFromPortfolioInput + Copy func(*DisassociatePrincipalFromPortfolioInput) DisassociatePrincipalFromPortfolioRequest } // Send marshals and sends the DisassociatePrincipalFromPortfolio API request. @@ -1414,7 +1442,7 @@ func (c *ServiceCatalog) DisassociatePrincipalFromPortfolioRequest(input *Disass req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociatePrincipalFromPortfolioRequest{Request: req, Input: input} + return DisassociatePrincipalFromPortfolioRequest{Request: req, Input: input, Copy: c.DisassociatePrincipalFromPortfolioRequest} } const opDisassociateProductFromPortfolio = "DisassociateProductFromPortfolio" @@ -1423,6 +1451,7 @@ const opDisassociateProductFromPortfolio = "DisassociateProductFromPortfolio" type DisassociateProductFromPortfolioRequest struct { *aws.Request Input *DisassociateProductFromPortfolioInput + Copy func(*DisassociateProductFromPortfolioInput) DisassociateProductFromPortfolioRequest } // Send marshals and sends the DisassociateProductFromPortfolio API request. @@ -1463,7 +1492,7 @@ func (c *ServiceCatalog) DisassociateProductFromPortfolioRequest(input *Disassoc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateProductFromPortfolioRequest{Request: req, Input: input} + return DisassociateProductFromPortfolioRequest{Request: req, Input: input, Copy: c.DisassociateProductFromPortfolioRequest} } const opDisassociateTagOptionFromResource = "DisassociateTagOptionFromResource" @@ -1472,6 +1501,7 @@ const opDisassociateTagOptionFromResource = "DisassociateTagOptionFromResource" type DisassociateTagOptionFromResourceRequest struct { *aws.Request Input *DisassociateTagOptionFromResourceInput + Copy func(*DisassociateTagOptionFromResourceInput) DisassociateTagOptionFromResourceRequest } // Send marshals and sends the DisassociateTagOptionFromResource API request. @@ -1512,7 +1542,7 @@ func (c *ServiceCatalog) DisassociateTagOptionFromResourceRequest(input *Disasso req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateTagOptionFromResourceRequest{Request: req, Input: input} + return DisassociateTagOptionFromResourceRequest{Request: req, Input: input, Copy: c.DisassociateTagOptionFromResourceRequest} } const opListAcceptedPortfolioShares = "ListAcceptedPortfolioShares" @@ -1521,6 +1551,7 @@ const opListAcceptedPortfolioShares = "ListAcceptedPortfolioShares" type ListAcceptedPortfolioSharesRequest struct { *aws.Request Input *ListAcceptedPortfolioSharesInput + Copy func(*ListAcceptedPortfolioSharesInput) ListAcceptedPortfolioSharesRequest } // Send marshals and sends the ListAcceptedPortfolioShares API request. @@ -1567,57 +1598,53 @@ func (c *ServiceCatalog) ListAcceptedPortfolioSharesRequest(input *ListAcceptedP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAcceptedPortfolioSharesRequest{Request: req, Input: input} + return ListAcceptedPortfolioSharesRequest{Request: req, Input: input, Copy: c.ListAcceptedPortfolioSharesRequest} } -// ListAcceptedPortfolioSharesPages iterates over the pages of a ListAcceptedPortfolioShares operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAcceptedPortfolioShares method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAcceptedPortfolioSharesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAcceptedPortfolioShares operation. -// pageNum := 0 -// err := client.ListAcceptedPortfolioSharesPages(params, -// func(page *ListAcceptedPortfolioSharesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) ListAcceptedPortfolioSharesPages(input *ListAcceptedPortfolioSharesInput, fn func(*ListAcceptedPortfolioSharesOutput, bool) bool) error { - return c.ListAcceptedPortfolioSharesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAcceptedPortfolioSharesPagesWithContext same as ListAcceptedPortfolioSharesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) ListAcceptedPortfolioSharesPagesWithContext(ctx aws.Context, input *ListAcceptedPortfolioSharesInput, fn func(*ListAcceptedPortfolioSharesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAcceptedPortfolioSharesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAcceptedPortfolioSharesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAcceptedPortfolioSharesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAcceptedPortfolioSharesRequest) Paginate(opts ...aws.Option) ListAcceptedPortfolioSharesPager { + return ListAcceptedPortfolioSharesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAcceptedPortfolioSharesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAcceptedPortfolioSharesOutput), !p.HasNextPage()) - } - return p.Err() +// ListAcceptedPortfolioSharesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAcceptedPortfolioSharesPager struct { + aws.Pager +} + +func (p *ListAcceptedPortfolioSharesPager) CurrentPage() *ListAcceptedPortfolioSharesOutput { + return p.Pager.CurrentPage().(*ListAcceptedPortfolioSharesOutput) } const opListConstraintsForPortfolio = "ListConstraintsForPortfolio" @@ -1626,6 +1653,7 @@ const opListConstraintsForPortfolio = "ListConstraintsForPortfolio" type ListConstraintsForPortfolioRequest struct { *aws.Request Input *ListConstraintsForPortfolioInput + Copy func(*ListConstraintsForPortfolioInput) ListConstraintsForPortfolioRequest } // Send marshals and sends the ListConstraintsForPortfolio API request. @@ -1672,57 +1700,53 @@ func (c *ServiceCatalog) ListConstraintsForPortfolioRequest(input *ListConstrain req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListConstraintsForPortfolioRequest{Request: req, Input: input} + return ListConstraintsForPortfolioRequest{Request: req, Input: input, Copy: c.ListConstraintsForPortfolioRequest} } -// ListConstraintsForPortfolioPages iterates over the pages of a ListConstraintsForPortfolio operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListConstraintsForPortfolio method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListConstraintsForPortfolioRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListConstraintsForPortfolio operation. -// pageNum := 0 -// err := client.ListConstraintsForPortfolioPages(params, -// func(page *ListConstraintsForPortfolioOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) ListConstraintsForPortfolioPages(input *ListConstraintsForPortfolioInput, fn func(*ListConstraintsForPortfolioOutput, bool) bool) error { - return c.ListConstraintsForPortfolioPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListConstraintsForPortfolioPagesWithContext same as ListConstraintsForPortfolioPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) ListConstraintsForPortfolioPagesWithContext(ctx aws.Context, input *ListConstraintsForPortfolioInput, fn func(*ListConstraintsForPortfolioOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListConstraintsForPortfolioInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListConstraintsForPortfolioRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListConstraintsForPortfolioRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListConstraintsForPortfolioRequest) Paginate(opts ...aws.Option) ListConstraintsForPortfolioPager { + return ListConstraintsForPortfolioPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListConstraintsForPortfolioInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListConstraintsForPortfolioOutput), !p.HasNextPage()) - } - return p.Err() +// ListConstraintsForPortfolioPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListConstraintsForPortfolioPager struct { + aws.Pager +} + +func (p *ListConstraintsForPortfolioPager) CurrentPage() *ListConstraintsForPortfolioOutput { + return p.Pager.CurrentPage().(*ListConstraintsForPortfolioOutput) } const opListLaunchPaths = "ListLaunchPaths" @@ -1731,6 +1755,7 @@ const opListLaunchPaths = "ListLaunchPaths" type ListLaunchPathsRequest struct { *aws.Request Input *ListLaunchPathsInput + Copy func(*ListLaunchPathsInput) ListLaunchPathsRequest } // Send marshals and sends the ListLaunchPaths API request. @@ -1779,57 +1804,53 @@ func (c *ServiceCatalog) ListLaunchPathsRequest(input *ListLaunchPathsInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListLaunchPathsRequest{Request: req, Input: input} + return ListLaunchPathsRequest{Request: req, Input: input, Copy: c.ListLaunchPathsRequest} } -// ListLaunchPathsPages iterates over the pages of a ListLaunchPaths operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLaunchPaths method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListLaunchPathsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListLaunchPaths operation. -// pageNum := 0 -// err := client.ListLaunchPathsPages(params, -// func(page *ListLaunchPathsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) ListLaunchPathsPages(input *ListLaunchPathsInput, fn func(*ListLaunchPathsOutput, bool) bool) error { - return c.ListLaunchPathsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLaunchPathsPagesWithContext same as ListLaunchPathsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) ListLaunchPathsPagesWithContext(ctx aws.Context, input *ListLaunchPathsInput, fn func(*ListLaunchPathsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListLaunchPathsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListLaunchPathsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListLaunchPathsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListLaunchPathsRequest) Paginate(opts ...aws.Option) ListLaunchPathsPager { + return ListLaunchPathsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListLaunchPathsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListLaunchPathsOutput), !p.HasNextPage()) - } - return p.Err() +// ListLaunchPathsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListLaunchPathsPager struct { + aws.Pager +} + +func (p *ListLaunchPathsPager) CurrentPage() *ListLaunchPathsOutput { + return p.Pager.CurrentPage().(*ListLaunchPathsOutput) } const opListPortfolioAccess = "ListPortfolioAccess" @@ -1838,6 +1859,7 @@ const opListPortfolioAccess = "ListPortfolioAccess" type ListPortfolioAccessRequest struct { *aws.Request Input *ListPortfolioAccessInput + Copy func(*ListPortfolioAccessInput) ListPortfolioAccessRequest } // Send marshals and sends the ListPortfolioAccess API request. @@ -1878,7 +1900,7 @@ func (c *ServiceCatalog) ListPortfolioAccessRequest(input *ListPortfolioAccessIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPortfolioAccessRequest{Request: req, Input: input} + return ListPortfolioAccessRequest{Request: req, Input: input, Copy: c.ListPortfolioAccessRequest} } const opListPortfolios = "ListPortfolios" @@ -1887,6 +1909,7 @@ const opListPortfolios = "ListPortfolios" type ListPortfoliosRequest struct { *aws.Request Input *ListPortfoliosInput + Copy func(*ListPortfoliosInput) ListPortfoliosRequest } // Send marshals and sends the ListPortfolios API request. @@ -1933,57 +1956,53 @@ func (c *ServiceCatalog) ListPortfoliosRequest(input *ListPortfoliosInput) ListP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPortfoliosRequest{Request: req, Input: input} + return ListPortfoliosRequest{Request: req, Input: input, Copy: c.ListPortfoliosRequest} } -// ListPortfoliosPages iterates over the pages of a ListPortfolios operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPortfolios method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPortfoliosRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPortfolios operation. -// pageNum := 0 -// err := client.ListPortfoliosPages(params, -// func(page *ListPortfoliosOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) ListPortfoliosPages(input *ListPortfoliosInput, fn func(*ListPortfoliosOutput, bool) bool) error { - return c.ListPortfoliosPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPortfoliosPagesWithContext same as ListPortfoliosPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) ListPortfoliosPagesWithContext(ctx aws.Context, input *ListPortfoliosInput, fn func(*ListPortfoliosOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPortfoliosInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPortfoliosRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPortfoliosRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPortfoliosRequest) Paginate(opts ...aws.Option) ListPortfoliosPager { + return ListPortfoliosPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPortfoliosInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPortfoliosOutput), !p.HasNextPage()) - } - return p.Err() +// ListPortfoliosPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPortfoliosPager struct { + aws.Pager +} + +func (p *ListPortfoliosPager) CurrentPage() *ListPortfoliosOutput { + return p.Pager.CurrentPage().(*ListPortfoliosOutput) } const opListPortfoliosForProduct = "ListPortfoliosForProduct" @@ -1992,6 +2011,7 @@ const opListPortfoliosForProduct = "ListPortfoliosForProduct" type ListPortfoliosForProductRequest struct { *aws.Request Input *ListPortfoliosForProductInput + Copy func(*ListPortfoliosForProductInput) ListPortfoliosForProductRequest } // Send marshals and sends the ListPortfoliosForProduct API request. @@ -2038,57 +2058,53 @@ func (c *ServiceCatalog) ListPortfoliosForProductRequest(input *ListPortfoliosFo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPortfoliosForProductRequest{Request: req, Input: input} + return ListPortfoliosForProductRequest{Request: req, Input: input, Copy: c.ListPortfoliosForProductRequest} } -// ListPortfoliosForProductPages iterates over the pages of a ListPortfoliosForProduct operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPortfoliosForProduct method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPortfoliosForProductRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPortfoliosForProduct operation. -// pageNum := 0 -// err := client.ListPortfoliosForProductPages(params, -// func(page *ListPortfoliosForProductOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) ListPortfoliosForProductPages(input *ListPortfoliosForProductInput, fn func(*ListPortfoliosForProductOutput, bool) bool) error { - return c.ListPortfoliosForProductPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPortfoliosForProductPagesWithContext same as ListPortfoliosForProductPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) ListPortfoliosForProductPagesWithContext(ctx aws.Context, input *ListPortfoliosForProductInput, fn func(*ListPortfoliosForProductOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPortfoliosForProductInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPortfoliosForProductRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPortfoliosForProductRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPortfoliosForProductRequest) Paginate(opts ...aws.Option) ListPortfoliosForProductPager { + return ListPortfoliosForProductPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPortfoliosForProductInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPortfoliosForProductOutput), !p.HasNextPage()) - } - return p.Err() +// ListPortfoliosForProductPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPortfoliosForProductPager struct { + aws.Pager +} + +func (p *ListPortfoliosForProductPager) CurrentPage() *ListPortfoliosForProductOutput { + return p.Pager.CurrentPage().(*ListPortfoliosForProductOutput) } const opListPrincipalsForPortfolio = "ListPrincipalsForPortfolio" @@ -2097,6 +2113,7 @@ const opListPrincipalsForPortfolio = "ListPrincipalsForPortfolio" type ListPrincipalsForPortfolioRequest struct { *aws.Request Input *ListPrincipalsForPortfolioInput + Copy func(*ListPrincipalsForPortfolioInput) ListPrincipalsForPortfolioRequest } // Send marshals and sends the ListPrincipalsForPortfolio API request. @@ -2143,57 +2160,53 @@ func (c *ServiceCatalog) ListPrincipalsForPortfolioRequest(input *ListPrincipals req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPrincipalsForPortfolioRequest{Request: req, Input: input} + return ListPrincipalsForPortfolioRequest{Request: req, Input: input, Copy: c.ListPrincipalsForPortfolioRequest} } -// ListPrincipalsForPortfolioPages iterates over the pages of a ListPrincipalsForPortfolio operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPrincipalsForPortfolio method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPrincipalsForPortfolioRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPrincipalsForPortfolio operation. -// pageNum := 0 -// err := client.ListPrincipalsForPortfolioPages(params, -// func(page *ListPrincipalsForPortfolioOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) ListPrincipalsForPortfolioPages(input *ListPrincipalsForPortfolioInput, fn func(*ListPrincipalsForPortfolioOutput, bool) bool) error { - return c.ListPrincipalsForPortfolioPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPrincipalsForPortfolioPagesWithContext same as ListPrincipalsForPortfolioPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) ListPrincipalsForPortfolioPagesWithContext(ctx aws.Context, input *ListPrincipalsForPortfolioInput, fn func(*ListPrincipalsForPortfolioOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPrincipalsForPortfolioInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPrincipalsForPortfolioRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListPrincipalsForPortfolioRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListPrincipalsForPortfolioRequest) Paginate(opts ...aws.Option) ListPrincipalsForPortfolioPager { + return ListPrincipalsForPortfolioPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPrincipalsForPortfolioInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPrincipalsForPortfolioOutput), !p.HasNextPage()) - } - return p.Err() +// ListPrincipalsForPortfolioPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPrincipalsForPortfolioPager struct { + aws.Pager +} + +func (p *ListPrincipalsForPortfolioPager) CurrentPage() *ListPrincipalsForPortfolioOutput { + return p.Pager.CurrentPage().(*ListPrincipalsForPortfolioOutput) } const opListProvisioningArtifacts = "ListProvisioningArtifacts" @@ -2202,6 +2215,7 @@ const opListProvisioningArtifacts = "ListProvisioningArtifacts" type ListProvisioningArtifactsRequest struct { *aws.Request Input *ListProvisioningArtifactsInput + Copy func(*ListProvisioningArtifactsInput) ListProvisioningArtifactsRequest } // Send marshals and sends the ListProvisioningArtifacts API request. @@ -2243,7 +2257,7 @@ func (c *ServiceCatalog) ListProvisioningArtifactsRequest(input *ListProvisionin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListProvisioningArtifactsRequest{Request: req, Input: input} + return ListProvisioningArtifactsRequest{Request: req, Input: input, Copy: c.ListProvisioningArtifactsRequest} } const opListRecordHistory = "ListRecordHistory" @@ -2252,6 +2266,7 @@ const opListRecordHistory = "ListRecordHistory" type ListRecordHistoryRequest struct { *aws.Request Input *ListRecordHistoryInput + Copy func(*ListRecordHistoryInput) ListRecordHistoryRequest } // Send marshals and sends the ListRecordHistory API request. @@ -2292,7 +2307,7 @@ func (c *ServiceCatalog) ListRecordHistoryRequest(input *ListRecordHistoryInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRecordHistoryRequest{Request: req, Input: input} + return ListRecordHistoryRequest{Request: req, Input: input, Copy: c.ListRecordHistoryRequest} } const opListResourcesForTagOption = "ListResourcesForTagOption" @@ -2301,6 +2316,7 @@ const opListResourcesForTagOption = "ListResourcesForTagOption" type ListResourcesForTagOptionRequest struct { *aws.Request Input *ListResourcesForTagOptionInput + Copy func(*ListResourcesForTagOptionInput) ListResourcesForTagOptionRequest } // Send marshals and sends the ListResourcesForTagOption API request. @@ -2347,57 +2363,53 @@ func (c *ServiceCatalog) ListResourcesForTagOptionRequest(input *ListResourcesFo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourcesForTagOptionRequest{Request: req, Input: input} + return ListResourcesForTagOptionRequest{Request: req, Input: input, Copy: c.ListResourcesForTagOptionRequest} } -// ListResourcesForTagOptionPages iterates over the pages of a ListResourcesForTagOption operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListResourcesForTagOption method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListResourcesForTagOptionRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListResourcesForTagOption operation. -// pageNum := 0 -// err := client.ListResourcesForTagOptionPages(params, -// func(page *ListResourcesForTagOptionOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) ListResourcesForTagOptionPages(input *ListResourcesForTagOptionInput, fn func(*ListResourcesForTagOptionOutput, bool) bool) error { - return c.ListResourcesForTagOptionPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListResourcesForTagOptionPagesWithContext same as ListResourcesForTagOptionPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) ListResourcesForTagOptionPagesWithContext(ctx aws.Context, input *ListResourcesForTagOptionInput, fn func(*ListResourcesForTagOptionOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListResourcesForTagOptionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListResourcesForTagOptionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListResourcesForTagOptionRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListResourcesForTagOptionRequest) Paginate(opts ...aws.Option) ListResourcesForTagOptionPager { + return ListResourcesForTagOptionPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListResourcesForTagOptionInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResourcesForTagOptionOutput), !p.HasNextPage()) - } - return p.Err() +// ListResourcesForTagOptionPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListResourcesForTagOptionPager struct { + aws.Pager +} + +func (p *ListResourcesForTagOptionPager) CurrentPage() *ListResourcesForTagOptionOutput { + return p.Pager.CurrentPage().(*ListResourcesForTagOptionOutput) } const opListTagOptions = "ListTagOptions" @@ -2406,6 +2418,7 @@ const opListTagOptions = "ListTagOptions" type ListTagOptionsRequest struct { *aws.Request Input *ListTagOptionsInput + Copy func(*ListTagOptionsInput) ListTagOptionsRequest } // Send marshals and sends the ListTagOptions API request. @@ -2452,57 +2465,53 @@ func (c *ServiceCatalog) ListTagOptionsRequest(input *ListTagOptionsInput) ListT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagOptionsRequest{Request: req, Input: input} + return ListTagOptionsRequest{Request: req, Input: input, Copy: c.ListTagOptionsRequest} } -// ListTagOptionsPages iterates over the pages of a ListTagOptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTagOptions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTagOptionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTagOptions operation. -// pageNum := 0 -// err := client.ListTagOptionsPages(params, -// func(page *ListTagOptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) ListTagOptionsPages(input *ListTagOptionsInput, fn func(*ListTagOptionsOutput, bool) bool) error { - return c.ListTagOptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTagOptionsPagesWithContext same as ListTagOptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) ListTagOptionsPagesWithContext(ctx aws.Context, input *ListTagOptionsInput, fn func(*ListTagOptionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTagOptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTagOptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListTagOptionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListTagOptionsRequest) Paginate(opts ...aws.Option) ListTagOptionsPager { + return ListTagOptionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTagOptionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagOptionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListTagOptionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTagOptionsPager struct { + aws.Pager +} + +func (p *ListTagOptionsPager) CurrentPage() *ListTagOptionsOutput { + return p.Pager.CurrentPage().(*ListTagOptionsOutput) } const opProvisionProduct = "ProvisionProduct" @@ -2511,6 +2520,7 @@ const opProvisionProduct = "ProvisionProduct" type ProvisionProductRequest struct { *aws.Request Input *ProvisionProductInput + Copy func(*ProvisionProductInput) ProvisionProductRequest } // Send marshals and sends the ProvisionProduct API request. @@ -2561,7 +2571,7 @@ func (c *ServiceCatalog) ProvisionProductRequest(input *ProvisionProductInput) P req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ProvisionProductRequest{Request: req, Input: input} + return ProvisionProductRequest{Request: req, Input: input, Copy: c.ProvisionProductRequest} } const opRejectPortfolioShare = "RejectPortfolioShare" @@ -2570,6 +2580,7 @@ const opRejectPortfolioShare = "RejectPortfolioShare" type RejectPortfolioShareRequest struct { *aws.Request Input *RejectPortfolioShareInput + Copy func(*RejectPortfolioShareInput) RejectPortfolioShareRequest } // Send marshals and sends the RejectPortfolioShare API request. @@ -2610,7 +2621,7 @@ func (c *ServiceCatalog) RejectPortfolioShareRequest(input *RejectPortfolioShare req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RejectPortfolioShareRequest{Request: req, Input: input} + return RejectPortfolioShareRequest{Request: req, Input: input, Copy: c.RejectPortfolioShareRequest} } const opScanProvisionedProducts = "ScanProvisionedProducts" @@ -2619,6 +2630,7 @@ const opScanProvisionedProducts = "ScanProvisionedProducts" type ScanProvisionedProductsRequest struct { *aws.Request Input *ScanProvisionedProductsInput + Copy func(*ScanProvisionedProductsInput) ScanProvisionedProductsRequest } // Send marshals and sends the ScanProvisionedProducts API request. @@ -2659,7 +2671,7 @@ func (c *ServiceCatalog) ScanProvisionedProductsRequest(input *ScanProvisionedPr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ScanProvisionedProductsRequest{Request: req, Input: input} + return ScanProvisionedProductsRequest{Request: req, Input: input, Copy: c.ScanProvisionedProductsRequest} } const opSearchProducts = "SearchProducts" @@ -2668,6 +2680,7 @@ const opSearchProducts = "SearchProducts" type SearchProductsRequest struct { *aws.Request Input *SearchProductsInput + Copy func(*SearchProductsInput) SearchProductsRequest } // Send marshals and sends the SearchProducts API request. @@ -2714,57 +2727,53 @@ func (c *ServiceCatalog) SearchProductsRequest(input *SearchProductsInput) Searc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchProductsRequest{Request: req, Input: input} + return SearchProductsRequest{Request: req, Input: input, Copy: c.SearchProductsRequest} } -// SearchProductsPages iterates over the pages of a SearchProducts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchProducts method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SearchProductsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SearchProducts operation. -// pageNum := 0 -// err := client.SearchProductsPages(params, -// func(page *SearchProductsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) SearchProductsPages(input *SearchProductsInput, fn func(*SearchProductsOutput, bool) bool) error { - return c.SearchProductsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchProductsPagesWithContext same as SearchProductsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) SearchProductsPagesWithContext(ctx aws.Context, input *SearchProductsInput, fn func(*SearchProductsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SearchProductsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SearchProductsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.SearchProductsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *SearchProductsRequest) Paginate(opts ...aws.Option) SearchProductsPager { + return SearchProductsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SearchProductsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchProductsOutput), !p.HasNextPage()) - } - return p.Err() +// SearchProductsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SearchProductsPager struct { + aws.Pager +} + +func (p *SearchProductsPager) CurrentPage() *SearchProductsOutput { + return p.Pager.CurrentPage().(*SearchProductsOutput) } const opSearchProductsAsAdmin = "SearchProductsAsAdmin" @@ -2773,6 +2782,7 @@ const opSearchProductsAsAdmin = "SearchProductsAsAdmin" type SearchProductsAsAdminRequest struct { *aws.Request Input *SearchProductsAsAdminInput + Copy func(*SearchProductsAsAdminInput) SearchProductsAsAdminRequest } // Send marshals and sends the SearchProductsAsAdmin API request. @@ -2819,57 +2829,53 @@ func (c *ServiceCatalog) SearchProductsAsAdminRequest(input *SearchProductsAsAdm req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SearchProductsAsAdminRequest{Request: req, Input: input} + return SearchProductsAsAdminRequest{Request: req, Input: input, Copy: c.SearchProductsAsAdminRequest} } -// SearchProductsAsAdminPages iterates over the pages of a SearchProductsAsAdmin operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchProductsAsAdmin method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SearchProductsAsAdminRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a SearchProductsAsAdmin operation. -// pageNum := 0 -// err := client.SearchProductsAsAdminPages(params, -// func(page *SearchProductsAsAdminOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceCatalog) SearchProductsAsAdminPages(input *SearchProductsAsAdminInput, fn func(*SearchProductsAsAdminOutput, bool) bool) error { - return c.SearchProductsAsAdminPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchProductsAsAdminPagesWithContext same as SearchProductsAsAdminPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceCatalog) SearchProductsAsAdminPagesWithContext(ctx aws.Context, input *SearchProductsAsAdminInput, fn func(*SearchProductsAsAdminOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SearchProductsAsAdminInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SearchProductsAsAdminRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.SearchProductsAsAdminRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *SearchProductsAsAdminRequest) Paginate(opts ...aws.Option) SearchProductsAsAdminPager { + return SearchProductsAsAdminPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SearchProductsAsAdminInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchProductsAsAdminOutput), !p.HasNextPage()) - } - return p.Err() +// SearchProductsAsAdminPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SearchProductsAsAdminPager struct { + aws.Pager +} + +func (p *SearchProductsAsAdminPager) CurrentPage() *SearchProductsAsAdminOutput { + return p.Pager.CurrentPage().(*SearchProductsAsAdminOutput) } const opTerminateProvisionedProduct = "TerminateProvisionedProduct" @@ -2878,6 +2884,7 @@ const opTerminateProvisionedProduct = "TerminateProvisionedProduct" type TerminateProvisionedProductRequest struct { *aws.Request Input *TerminateProvisionedProductInput + Copy func(*TerminateProvisionedProductInput) TerminateProvisionedProductRequest } // Send marshals and sends the TerminateProvisionedProduct API request. @@ -2923,7 +2930,7 @@ func (c *ServiceCatalog) TerminateProvisionedProductRequest(input *TerminateProv req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TerminateProvisionedProductRequest{Request: req, Input: input} + return TerminateProvisionedProductRequest{Request: req, Input: input, Copy: c.TerminateProvisionedProductRequest} } const opUpdateConstraint = "UpdateConstraint" @@ -2932,6 +2939,7 @@ const opUpdateConstraint = "UpdateConstraint" type UpdateConstraintRequest struct { *aws.Request Input *UpdateConstraintInput + Copy func(*UpdateConstraintInput) UpdateConstraintRequest } // Send marshals and sends the UpdateConstraint API request. @@ -2972,7 +2980,7 @@ func (c *ServiceCatalog) UpdateConstraintRequest(input *UpdateConstraintInput) U req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateConstraintRequest{Request: req, Input: input} + return UpdateConstraintRequest{Request: req, Input: input, Copy: c.UpdateConstraintRequest} } const opUpdatePortfolio = "UpdatePortfolio" @@ -2981,6 +2989,7 @@ const opUpdatePortfolio = "UpdatePortfolio" type UpdatePortfolioRequest struct { *aws.Request Input *UpdatePortfolioInput + Copy func(*UpdatePortfolioInput) UpdatePortfolioRequest } // Send marshals and sends the UpdatePortfolio API request. @@ -3023,7 +3032,7 @@ func (c *ServiceCatalog) UpdatePortfolioRequest(input *UpdatePortfolioInput) Upd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePortfolioRequest{Request: req, Input: input} + return UpdatePortfolioRequest{Request: req, Input: input, Copy: c.UpdatePortfolioRequest} } const opUpdateProduct = "UpdateProduct" @@ -3032,6 +3041,7 @@ const opUpdateProduct = "UpdateProduct" type UpdateProductRequest struct { *aws.Request Input *UpdateProductInput + Copy func(*UpdateProductInput) UpdateProductRequest } // Send marshals and sends the UpdateProduct API request. @@ -3072,7 +3082,7 @@ func (c *ServiceCatalog) UpdateProductRequest(input *UpdateProductInput) UpdateP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateProductRequest{Request: req, Input: input} + return UpdateProductRequest{Request: req, Input: input, Copy: c.UpdateProductRequest} } const opUpdateProvisionedProduct = "UpdateProvisionedProduct" @@ -3081,6 +3091,7 @@ const opUpdateProvisionedProduct = "UpdateProvisionedProduct" type UpdateProvisionedProductRequest struct { *aws.Request Input *UpdateProvisionedProductInput + Copy func(*UpdateProvisionedProductInput) UpdateProvisionedProductRequest } // Send marshals and sends the UpdateProvisionedProduct API request. @@ -3128,7 +3139,7 @@ func (c *ServiceCatalog) UpdateProvisionedProductRequest(input *UpdateProvisione req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateProvisionedProductRequest{Request: req, Input: input} + return UpdateProvisionedProductRequest{Request: req, Input: input, Copy: c.UpdateProvisionedProductRequest} } const opUpdateProvisioningArtifact = "UpdateProvisioningArtifact" @@ -3137,6 +3148,7 @@ const opUpdateProvisioningArtifact = "UpdateProvisioningArtifact" type UpdateProvisioningArtifactRequest struct { *aws.Request Input *UpdateProvisioningArtifactInput + Copy func(*UpdateProvisioningArtifactInput) UpdateProvisioningArtifactRequest } // Send marshals and sends the UpdateProvisioningArtifact API request. @@ -3181,7 +3193,7 @@ func (c *ServiceCatalog) UpdateProvisioningArtifactRequest(input *UpdateProvisio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateProvisioningArtifactRequest{Request: req, Input: input} + return UpdateProvisioningArtifactRequest{Request: req, Input: input, Copy: c.UpdateProvisioningArtifactRequest} } const opUpdateTagOption = "UpdateTagOption" @@ -3190,6 +3202,7 @@ const opUpdateTagOption = "UpdateTagOption" type UpdateTagOptionRequest struct { *aws.Request Input *UpdateTagOptionInput + Copy func(*UpdateTagOptionInput) UpdateTagOptionRequest } // Send marshals and sends the UpdateTagOption API request. @@ -3230,7 +3243,7 @@ func (c *ServiceCatalog) UpdateTagOptionRequest(input *UpdateTagOptionInput) Upd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTagOptionRequest{Request: req, Input: input} + return UpdateTagOptionRequest{Request: req, Input: input, Copy: c.UpdateTagOptionRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AcceptPortfolioShareInput diff --git a/service/servicecatalog/servicecatalogiface/interface.go b/service/servicecatalog/servicecatalogiface/interface.go index dce34a5d5b0..25d6e00d283 100644 --- a/service/servicecatalog/servicecatalogiface/interface.go +++ b/service/servicecatalog/servicecatalogiface/interface.go @@ -9,7 +9,6 @@ package servicecatalogiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/servicecatalog" ) @@ -125,50 +124,26 @@ type ServiceCatalogAPI interface { ListAcceptedPortfolioSharesRequest(*servicecatalog.ListAcceptedPortfolioSharesInput) servicecatalog.ListAcceptedPortfolioSharesRequest - ListAcceptedPortfolioSharesPages(*servicecatalog.ListAcceptedPortfolioSharesInput, func(*servicecatalog.ListAcceptedPortfolioSharesOutput, bool) bool) error - ListAcceptedPortfolioSharesPagesWithContext(aws.Context, *servicecatalog.ListAcceptedPortfolioSharesInput, func(*servicecatalog.ListAcceptedPortfolioSharesOutput, bool) bool, ...aws.Option) error - ListConstraintsForPortfolioRequest(*servicecatalog.ListConstraintsForPortfolioInput) servicecatalog.ListConstraintsForPortfolioRequest - ListConstraintsForPortfolioPages(*servicecatalog.ListConstraintsForPortfolioInput, func(*servicecatalog.ListConstraintsForPortfolioOutput, bool) bool) error - ListConstraintsForPortfolioPagesWithContext(aws.Context, *servicecatalog.ListConstraintsForPortfolioInput, func(*servicecatalog.ListConstraintsForPortfolioOutput, bool) bool, ...aws.Option) error - ListLaunchPathsRequest(*servicecatalog.ListLaunchPathsInput) servicecatalog.ListLaunchPathsRequest - ListLaunchPathsPages(*servicecatalog.ListLaunchPathsInput, func(*servicecatalog.ListLaunchPathsOutput, bool) bool) error - ListLaunchPathsPagesWithContext(aws.Context, *servicecatalog.ListLaunchPathsInput, func(*servicecatalog.ListLaunchPathsOutput, bool) bool, ...aws.Option) error - ListPortfolioAccessRequest(*servicecatalog.ListPortfolioAccessInput) servicecatalog.ListPortfolioAccessRequest ListPortfoliosRequest(*servicecatalog.ListPortfoliosInput) servicecatalog.ListPortfoliosRequest - ListPortfoliosPages(*servicecatalog.ListPortfoliosInput, func(*servicecatalog.ListPortfoliosOutput, bool) bool) error - ListPortfoliosPagesWithContext(aws.Context, *servicecatalog.ListPortfoliosInput, func(*servicecatalog.ListPortfoliosOutput, bool) bool, ...aws.Option) error - ListPortfoliosForProductRequest(*servicecatalog.ListPortfoliosForProductInput) servicecatalog.ListPortfoliosForProductRequest - ListPortfoliosForProductPages(*servicecatalog.ListPortfoliosForProductInput, func(*servicecatalog.ListPortfoliosForProductOutput, bool) bool) error - ListPortfoliosForProductPagesWithContext(aws.Context, *servicecatalog.ListPortfoliosForProductInput, func(*servicecatalog.ListPortfoliosForProductOutput, bool) bool, ...aws.Option) error - ListPrincipalsForPortfolioRequest(*servicecatalog.ListPrincipalsForPortfolioInput) servicecatalog.ListPrincipalsForPortfolioRequest - ListPrincipalsForPortfolioPages(*servicecatalog.ListPrincipalsForPortfolioInput, func(*servicecatalog.ListPrincipalsForPortfolioOutput, bool) bool) error - ListPrincipalsForPortfolioPagesWithContext(aws.Context, *servicecatalog.ListPrincipalsForPortfolioInput, func(*servicecatalog.ListPrincipalsForPortfolioOutput, bool) bool, ...aws.Option) error - ListProvisioningArtifactsRequest(*servicecatalog.ListProvisioningArtifactsInput) servicecatalog.ListProvisioningArtifactsRequest ListRecordHistoryRequest(*servicecatalog.ListRecordHistoryInput) servicecatalog.ListRecordHistoryRequest ListResourcesForTagOptionRequest(*servicecatalog.ListResourcesForTagOptionInput) servicecatalog.ListResourcesForTagOptionRequest - ListResourcesForTagOptionPages(*servicecatalog.ListResourcesForTagOptionInput, func(*servicecatalog.ListResourcesForTagOptionOutput, bool) bool) error - ListResourcesForTagOptionPagesWithContext(aws.Context, *servicecatalog.ListResourcesForTagOptionInput, func(*servicecatalog.ListResourcesForTagOptionOutput, bool) bool, ...aws.Option) error - ListTagOptionsRequest(*servicecatalog.ListTagOptionsInput) servicecatalog.ListTagOptionsRequest - ListTagOptionsPages(*servicecatalog.ListTagOptionsInput, func(*servicecatalog.ListTagOptionsOutput, bool) bool) error - ListTagOptionsPagesWithContext(aws.Context, *servicecatalog.ListTagOptionsInput, func(*servicecatalog.ListTagOptionsOutput, bool) bool, ...aws.Option) error - ProvisionProductRequest(*servicecatalog.ProvisionProductInput) servicecatalog.ProvisionProductRequest RejectPortfolioShareRequest(*servicecatalog.RejectPortfolioShareInput) servicecatalog.RejectPortfolioShareRequest @@ -177,14 +152,8 @@ type ServiceCatalogAPI interface { SearchProductsRequest(*servicecatalog.SearchProductsInput) servicecatalog.SearchProductsRequest - SearchProductsPages(*servicecatalog.SearchProductsInput, func(*servicecatalog.SearchProductsOutput, bool) bool) error - SearchProductsPagesWithContext(aws.Context, *servicecatalog.SearchProductsInput, func(*servicecatalog.SearchProductsOutput, bool) bool, ...aws.Option) error - SearchProductsAsAdminRequest(*servicecatalog.SearchProductsAsAdminInput) servicecatalog.SearchProductsAsAdminRequest - SearchProductsAsAdminPages(*servicecatalog.SearchProductsAsAdminInput, func(*servicecatalog.SearchProductsAsAdminOutput, bool) bool) error - SearchProductsAsAdminPagesWithContext(aws.Context, *servicecatalog.SearchProductsAsAdminInput, func(*servicecatalog.SearchProductsAsAdminOutput, bool) bool, ...aws.Option) error - TerminateProvisionedProductRequest(*servicecatalog.TerminateProvisionedProductInput) servicecatalog.TerminateProvisionedProductRequest UpdateConstraintRequest(*servicecatalog.UpdateConstraintInput) servicecatalog.UpdateConstraintRequest diff --git a/service/servicediscovery/api.go b/service/servicediscovery/api.go index e2ea211ffa2..e6f2e4d5f1c 100644 --- a/service/servicediscovery/api.go +++ b/service/servicediscovery/api.go @@ -16,6 +16,7 @@ const opCreatePrivateDnsNamespace = "CreatePrivateDnsNamespace" type CreatePrivateDnsNamespaceRequest struct { *aws.Request Input *CreatePrivateDnsNamespaceInput + Copy func(*CreatePrivateDnsNamespaceInput) CreatePrivateDnsNamespaceRequest } // Send marshals and sends the CreatePrivateDnsNamespace API request. @@ -60,7 +61,7 @@ func (c *ServiceDiscovery) CreatePrivateDnsNamespaceRequest(input *CreatePrivate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePrivateDnsNamespaceRequest{Request: req, Input: input} + return CreatePrivateDnsNamespaceRequest{Request: req, Input: input, Copy: c.CreatePrivateDnsNamespaceRequest} } const opCreatePublicDnsNamespace = "CreatePublicDnsNamespace" @@ -69,6 +70,7 @@ const opCreatePublicDnsNamespace = "CreatePublicDnsNamespace" type CreatePublicDnsNamespaceRequest struct { *aws.Request Input *CreatePublicDnsNamespaceInput + Copy func(*CreatePublicDnsNamespaceInput) CreatePublicDnsNamespaceRequest } // Send marshals and sends the CreatePublicDnsNamespace API request. @@ -113,7 +115,7 @@ func (c *ServiceDiscovery) CreatePublicDnsNamespaceRequest(input *CreatePublicDn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePublicDnsNamespaceRequest{Request: req, Input: input} + return CreatePublicDnsNamespaceRequest{Request: req, Input: input, Copy: c.CreatePublicDnsNamespaceRequest} } const opCreateService = "CreateService" @@ -122,6 +124,7 @@ const opCreateService = "CreateService" type CreateServiceRequest struct { *aws.Request Input *CreateServiceInput + Copy func(*CreateServiceInput) CreateServiceRequest } // Send marshals and sends the CreateService API request. @@ -170,7 +173,7 @@ func (c *ServiceDiscovery) CreateServiceRequest(input *CreateServiceInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateServiceRequest{Request: req, Input: input} + return CreateServiceRequest{Request: req, Input: input, Copy: c.CreateServiceRequest} } const opDeleteNamespace = "DeleteNamespace" @@ -179,6 +182,7 @@ const opDeleteNamespace = "DeleteNamespace" type DeleteNamespaceRequest struct { *aws.Request Input *DeleteNamespaceInput + Copy func(*DeleteNamespaceInput) DeleteNamespaceRequest } // Send marshals and sends the DeleteNamespace API request. @@ -220,7 +224,7 @@ func (c *ServiceDiscovery) DeleteNamespaceRequest(input *DeleteNamespaceInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteNamespaceRequest{Request: req, Input: input} + return DeleteNamespaceRequest{Request: req, Input: input, Copy: c.DeleteNamespaceRequest} } const opDeleteService = "DeleteService" @@ -229,6 +233,7 @@ const opDeleteService = "DeleteService" type DeleteServiceRequest struct { *aws.Request Input *DeleteServiceInput + Copy func(*DeleteServiceInput) DeleteServiceRequest } // Send marshals and sends the DeleteService API request. @@ -270,7 +275,7 @@ func (c *ServiceDiscovery) DeleteServiceRequest(input *DeleteServiceInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteServiceRequest{Request: req, Input: input} + return DeleteServiceRequest{Request: req, Input: input, Copy: c.DeleteServiceRequest} } const opDeregisterInstance = "DeregisterInstance" @@ -279,6 +284,7 @@ const opDeregisterInstance = "DeregisterInstance" type DeregisterInstanceRequest struct { *aws.Request Input *DeregisterInstanceInput + Copy func(*DeregisterInstanceInput) DeregisterInstanceRequest } // Send marshals and sends the DeregisterInstance API request. @@ -320,7 +326,7 @@ func (c *ServiceDiscovery) DeregisterInstanceRequest(input *DeregisterInstanceIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterInstanceRequest{Request: req, Input: input} + return DeregisterInstanceRequest{Request: req, Input: input, Copy: c.DeregisterInstanceRequest} } const opGetInstance = "GetInstance" @@ -329,6 +335,7 @@ const opGetInstance = "GetInstance" type GetInstanceRequest struct { *aws.Request Input *GetInstanceInput + Copy func(*GetInstanceInput) GetInstanceRequest } // Send marshals and sends the GetInstance API request. @@ -369,7 +376,7 @@ func (c *ServiceDiscovery) GetInstanceRequest(input *GetInstanceInput) GetInstan req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstanceRequest{Request: req, Input: input} + return GetInstanceRequest{Request: req, Input: input, Copy: c.GetInstanceRequest} } const opGetInstancesHealthStatus = "GetInstancesHealthStatus" @@ -378,6 +385,7 @@ const opGetInstancesHealthStatus = "GetInstancesHealthStatus" type GetInstancesHealthStatusRequest struct { *aws.Request Input *GetInstancesHealthStatusInput + Copy func(*GetInstancesHealthStatusInput) GetInstancesHealthStatusRequest } // Send marshals and sends the GetInstancesHealthStatus API request. @@ -425,57 +433,53 @@ func (c *ServiceDiscovery) GetInstancesHealthStatusRequest(input *GetInstancesHe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInstancesHealthStatusRequest{Request: req, Input: input} + return GetInstancesHealthStatusRequest{Request: req, Input: input, Copy: c.GetInstancesHealthStatusRequest} } -// GetInstancesHealthStatusPages iterates over the pages of a GetInstancesHealthStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetInstancesHealthStatus method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetInstancesHealthStatusRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetInstancesHealthStatus operation. -// pageNum := 0 -// err := client.GetInstancesHealthStatusPages(params, -// func(page *GetInstancesHealthStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceDiscovery) GetInstancesHealthStatusPages(input *GetInstancesHealthStatusInput, fn func(*GetInstancesHealthStatusOutput, bool) bool) error { - return c.GetInstancesHealthStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetInstancesHealthStatusPagesWithContext same as GetInstancesHealthStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceDiscovery) GetInstancesHealthStatusPagesWithContext(ctx aws.Context, input *GetInstancesHealthStatusInput, fn func(*GetInstancesHealthStatusOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetInstancesHealthStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetInstancesHealthStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetInstancesHealthStatusRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetInstancesHealthStatusRequest) Paginate(opts ...aws.Option) GetInstancesHealthStatusPager { + return GetInstancesHealthStatusPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetInstancesHealthStatusInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetInstancesHealthStatusOutput), !p.HasNextPage()) - } - return p.Err() +// GetInstancesHealthStatusPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetInstancesHealthStatusPager struct { + aws.Pager +} + +func (p *GetInstancesHealthStatusPager) CurrentPage() *GetInstancesHealthStatusOutput { + return p.Pager.CurrentPage().(*GetInstancesHealthStatusOutput) } const opGetNamespace = "GetNamespace" @@ -484,6 +488,7 @@ const opGetNamespace = "GetNamespace" type GetNamespaceRequest struct { *aws.Request Input *GetNamespaceInput + Copy func(*GetNamespaceInput) GetNamespaceRequest } // Send marshals and sends the GetNamespace API request. @@ -524,7 +529,7 @@ func (c *ServiceDiscovery) GetNamespaceRequest(input *GetNamespaceInput) GetName req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetNamespaceRequest{Request: req, Input: input} + return GetNamespaceRequest{Request: req, Input: input, Copy: c.GetNamespaceRequest} } const opGetOperation = "GetOperation" @@ -533,6 +538,7 @@ const opGetOperation = "GetOperation" type GetOperationRequest struct { *aws.Request Input *GetOperationInput + Copy func(*GetOperationInput) GetOperationRequest } // Send marshals and sends the GetOperation API request. @@ -575,7 +581,7 @@ func (c *ServiceDiscovery) GetOperationRequest(input *GetOperationInput) GetOper req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetOperationRequest{Request: req, Input: input} + return GetOperationRequest{Request: req, Input: input, Copy: c.GetOperationRequest} } const opGetService = "GetService" @@ -584,6 +590,7 @@ const opGetService = "GetService" type GetServiceRequest struct { *aws.Request Input *GetServiceInput + Copy func(*GetServiceInput) GetServiceRequest } // Send marshals and sends the GetService API request. @@ -624,7 +631,7 @@ func (c *ServiceDiscovery) GetServiceRequest(input *GetServiceInput) GetServiceR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetServiceRequest{Request: req, Input: input} + return GetServiceRequest{Request: req, Input: input, Copy: c.GetServiceRequest} } const opListInstances = "ListInstances" @@ -633,6 +640,7 @@ const opListInstances = "ListInstances" type ListInstancesRequest struct { *aws.Request Input *ListInstancesInput + Copy func(*ListInstancesInput) ListInstancesRequest } // Send marshals and sends the ListInstances API request. @@ -680,57 +688,53 @@ func (c *ServiceDiscovery) ListInstancesRequest(input *ListInstancesInput) ListI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInstancesRequest{Request: req, Input: input} + return ListInstancesRequest{Request: req, Input: input, Copy: c.ListInstancesRequest} } -// ListInstancesPages iterates over the pages of a ListInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstances method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListInstancesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListInstances operation. -// pageNum := 0 -// err := client.ListInstancesPages(params, -// func(page *ListInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceDiscovery) ListInstancesPages(input *ListInstancesInput, fn func(*ListInstancesOutput, bool) bool) error { - return c.ListInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInstancesPagesWithContext same as ListInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceDiscovery) ListInstancesPagesWithContext(ctx aws.Context, input *ListInstancesInput, fn func(*ListInstancesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListInstancesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListInstancesRequest) Paginate(opts ...aws.Option) ListInstancesPager { + return ListInstancesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListInstancesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstancesOutput), !p.HasNextPage()) - } - return p.Err() +// ListInstancesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListInstancesPager struct { + aws.Pager +} + +func (p *ListInstancesPager) CurrentPage() *ListInstancesOutput { + return p.Pager.CurrentPage().(*ListInstancesOutput) } const opListNamespaces = "ListNamespaces" @@ -739,6 +743,7 @@ const opListNamespaces = "ListNamespaces" type ListNamespacesRequest struct { *aws.Request Input *ListNamespacesInput + Copy func(*ListNamespacesInput) ListNamespacesRequest } // Send marshals and sends the ListNamespaces API request. @@ -786,57 +791,53 @@ func (c *ServiceDiscovery) ListNamespacesRequest(input *ListNamespacesInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListNamespacesRequest{Request: req, Input: input} + return ListNamespacesRequest{Request: req, Input: input, Copy: c.ListNamespacesRequest} } -// ListNamespacesPages iterates over the pages of a ListNamespaces operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNamespaces method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListNamespacesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListNamespaces operation. -// pageNum := 0 -// err := client.ListNamespacesPages(params, -// func(page *ListNamespacesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceDiscovery) ListNamespacesPages(input *ListNamespacesInput, fn func(*ListNamespacesOutput, bool) bool) error { - return c.ListNamespacesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNamespacesPagesWithContext same as ListNamespacesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceDiscovery) ListNamespacesPagesWithContext(ctx aws.Context, input *ListNamespacesInput, fn func(*ListNamespacesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListNamespacesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListNamespacesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListNamespacesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListNamespacesRequest) Paginate(opts ...aws.Option) ListNamespacesPager { + return ListNamespacesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListNamespacesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNamespacesOutput), !p.HasNextPage()) - } - return p.Err() +// ListNamespacesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListNamespacesPager struct { + aws.Pager +} + +func (p *ListNamespacesPager) CurrentPage() *ListNamespacesOutput { + return p.Pager.CurrentPage().(*ListNamespacesOutput) } const opListOperations = "ListOperations" @@ -845,6 +846,7 @@ const opListOperations = "ListOperations" type ListOperationsRequest struct { *aws.Request Input *ListOperationsInput + Copy func(*ListOperationsInput) ListOperationsRequest } // Send marshals and sends the ListOperations API request. @@ -891,57 +893,53 @@ func (c *ServiceDiscovery) ListOperationsRequest(input *ListOperationsInput) Lis req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOperationsRequest{Request: req, Input: input} + return ListOperationsRequest{Request: req, Input: input, Copy: c.ListOperationsRequest} } -// ListOperationsPages iterates over the pages of a ListOperations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOperations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListOperationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListOperations operation. -// pageNum := 0 -// err := client.ListOperationsPages(params, -// func(page *ListOperationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceDiscovery) ListOperationsPages(input *ListOperationsInput, fn func(*ListOperationsOutput, bool) bool) error { - return c.ListOperationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOperationsPagesWithContext same as ListOperationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceDiscovery) ListOperationsPagesWithContext(ctx aws.Context, input *ListOperationsInput, fn func(*ListOperationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListOperationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListOperationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListOperationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListOperationsRequest) Paginate(opts ...aws.Option) ListOperationsPager { + return ListOperationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListOperationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOperationsOutput), !p.HasNextPage()) - } - return p.Err() +// ListOperationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListOperationsPager struct { + aws.Pager +} + +func (p *ListOperationsPager) CurrentPage() *ListOperationsOutput { + return p.Pager.CurrentPage().(*ListOperationsOutput) } const opListServices = "ListServices" @@ -950,6 +948,7 @@ const opListServices = "ListServices" type ListServicesRequest struct { *aws.Request Input *ListServicesInput + Copy func(*ListServicesInput) ListServicesRequest } // Send marshals and sends the ListServices API request. @@ -997,57 +996,53 @@ func (c *ServiceDiscovery) ListServicesRequest(input *ListServicesInput) ListSer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListServicesRequest{Request: req, Input: input} + return ListServicesRequest{Request: req, Input: input, Copy: c.ListServicesRequest} } -// ListServicesPages iterates over the pages of a ListServices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServices method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListServicesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListServices operation. -// pageNum := 0 -// err := client.ListServicesPages(params, -// func(page *ListServicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ServiceDiscovery) ListServicesPages(input *ListServicesInput, fn func(*ListServicesOutput, bool) bool) error { - return c.ListServicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListServicesPagesWithContext same as ListServicesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ServiceDiscovery) ListServicesPagesWithContext(ctx aws.Context, input *ListServicesInput, fn func(*ListServicesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListServicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListServicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListServicesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListServicesRequest) Paginate(opts ...aws.Option) ListServicesPager { + return ListServicesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListServicesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) - } - return p.Err() +// ListServicesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListServicesPager struct { + aws.Pager +} + +func (p *ListServicesPager) CurrentPage() *ListServicesOutput { + return p.Pager.CurrentPage().(*ListServicesOutput) } const opRegisterInstance = "RegisterInstance" @@ -1056,6 +1051,7 @@ const opRegisterInstance = "RegisterInstance" type RegisterInstanceRequest struct { *aws.Request Input *RegisterInstanceInput + Copy func(*RegisterInstanceInput) RegisterInstanceRequest } // Send marshals and sends the RegisterInstance API request. @@ -1123,7 +1119,7 @@ func (c *ServiceDiscovery) RegisterInstanceRequest(input *RegisterInstanceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterInstanceRequest{Request: req, Input: input} + return RegisterInstanceRequest{Request: req, Input: input, Copy: c.RegisterInstanceRequest} } const opUpdateService = "UpdateService" @@ -1132,6 +1128,7 @@ const opUpdateService = "UpdateService" type UpdateServiceRequest struct { *aws.Request Input *UpdateServiceInput + Copy func(*UpdateServiceInput) UpdateServiceRequest } // Send marshals and sends the UpdateService API request. @@ -1180,7 +1177,7 @@ func (c *ServiceDiscovery) UpdateServiceRequest(input *UpdateServiceInput) Updat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateServiceRequest{Request: req, Input: input} + return UpdateServiceRequest{Request: req, Input: input, Copy: c.UpdateServiceRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/CreatePrivateDnsNamespaceRequest diff --git a/service/servicediscovery/servicediscoveryiface/interface.go b/service/servicediscovery/servicediscoveryiface/interface.go index 4be4153c60d..cefbd67d838 100644 --- a/service/servicediscovery/servicediscoveryiface/interface.go +++ b/service/servicediscovery/servicediscoveryiface/interface.go @@ -9,7 +9,6 @@ package servicediscoveryiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/servicediscovery" ) @@ -79,9 +78,6 @@ type ServiceDiscoveryAPI interface { GetInstancesHealthStatusRequest(*servicediscovery.GetInstancesHealthStatusInput) servicediscovery.GetInstancesHealthStatusRequest - GetInstancesHealthStatusPages(*servicediscovery.GetInstancesHealthStatusInput, func(*servicediscovery.GetInstancesHealthStatusOutput, bool) bool) error - GetInstancesHealthStatusPagesWithContext(aws.Context, *servicediscovery.GetInstancesHealthStatusInput, func(*servicediscovery.GetInstancesHealthStatusOutput, bool) bool, ...aws.Option) error - GetNamespaceRequest(*servicediscovery.GetNamespaceInput) servicediscovery.GetNamespaceRequest GetOperationRequest(*servicediscovery.GetOperationInput) servicediscovery.GetOperationRequest @@ -90,24 +86,12 @@ type ServiceDiscoveryAPI interface { ListInstancesRequest(*servicediscovery.ListInstancesInput) servicediscovery.ListInstancesRequest - ListInstancesPages(*servicediscovery.ListInstancesInput, func(*servicediscovery.ListInstancesOutput, bool) bool) error - ListInstancesPagesWithContext(aws.Context, *servicediscovery.ListInstancesInput, func(*servicediscovery.ListInstancesOutput, bool) bool, ...aws.Option) error - ListNamespacesRequest(*servicediscovery.ListNamespacesInput) servicediscovery.ListNamespacesRequest - ListNamespacesPages(*servicediscovery.ListNamespacesInput, func(*servicediscovery.ListNamespacesOutput, bool) bool) error - ListNamespacesPagesWithContext(aws.Context, *servicediscovery.ListNamespacesInput, func(*servicediscovery.ListNamespacesOutput, bool) bool, ...aws.Option) error - ListOperationsRequest(*servicediscovery.ListOperationsInput) servicediscovery.ListOperationsRequest - ListOperationsPages(*servicediscovery.ListOperationsInput, func(*servicediscovery.ListOperationsOutput, bool) bool) error - ListOperationsPagesWithContext(aws.Context, *servicediscovery.ListOperationsInput, func(*servicediscovery.ListOperationsOutput, bool) bool, ...aws.Option) error - ListServicesRequest(*servicediscovery.ListServicesInput) servicediscovery.ListServicesRequest - ListServicesPages(*servicediscovery.ListServicesInput, func(*servicediscovery.ListServicesOutput, bool) bool) error - ListServicesPagesWithContext(aws.Context, *servicediscovery.ListServicesInput, func(*servicediscovery.ListServicesOutput, bool) bool, ...aws.Option) error - RegisterInstanceRequest(*servicediscovery.RegisterInstanceInput) servicediscovery.RegisterInstanceRequest UpdateServiceRequest(*servicediscovery.UpdateServiceInput) servicediscovery.UpdateServiceRequest diff --git a/service/ses/api.go b/service/ses/api.go index e5478eb3caa..704701ecd52 100644 --- a/service/ses/api.go +++ b/service/ses/api.go @@ -18,6 +18,7 @@ const opCloneReceiptRuleSet = "CloneReceiptRuleSet" type CloneReceiptRuleSetRequest struct { *aws.Request Input *CloneReceiptRuleSetInput + Copy func(*CloneReceiptRuleSetInput) CloneReceiptRuleSetRequest } // Send marshals and sends the CloneReceiptRuleSet API request. @@ -65,7 +66,7 @@ func (c *SES) CloneReceiptRuleSetRequest(input *CloneReceiptRuleSetInput) CloneR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CloneReceiptRuleSetRequest{Request: req, Input: input} + return CloneReceiptRuleSetRequest{Request: req, Input: input, Copy: c.CloneReceiptRuleSetRequest} } const opCreateConfigurationSet = "CreateConfigurationSet" @@ -74,6 +75,7 @@ const opCreateConfigurationSet = "CreateConfigurationSet" type CreateConfigurationSetRequest struct { *aws.Request Input *CreateConfigurationSetInput + Copy func(*CreateConfigurationSetInput) CreateConfigurationSetRequest } // Send marshals and sends the CreateConfigurationSet API request. @@ -119,7 +121,7 @@ func (c *SES) CreateConfigurationSetRequest(input *CreateConfigurationSetInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateConfigurationSetRequest{Request: req, Input: input} + return CreateConfigurationSetRequest{Request: req, Input: input, Copy: c.CreateConfigurationSetRequest} } const opCreateConfigurationSetEventDestination = "CreateConfigurationSetEventDestination" @@ -128,6 +130,7 @@ const opCreateConfigurationSetEventDestination = "CreateConfigurationSetEventDes type CreateConfigurationSetEventDestinationRequest struct { *aws.Request Input *CreateConfigurationSetEventDestinationInput + Copy func(*CreateConfigurationSetEventDestinationInput) CreateConfigurationSetEventDestinationRequest } // Send marshals and sends the CreateConfigurationSetEventDestination API request. @@ -178,7 +181,7 @@ func (c *SES) CreateConfigurationSetEventDestinationRequest(input *CreateConfigu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateConfigurationSetEventDestinationRequest{Request: req, Input: input} + return CreateConfigurationSetEventDestinationRequest{Request: req, Input: input, Copy: c.CreateConfigurationSetEventDestinationRequest} } const opCreateConfigurationSetTrackingOptions = "CreateConfigurationSetTrackingOptions" @@ -187,6 +190,7 @@ const opCreateConfigurationSetTrackingOptions = "CreateConfigurationSetTrackingO type CreateConfigurationSetTrackingOptionsRequest struct { *aws.Request Input *CreateConfigurationSetTrackingOptionsInput + Copy func(*CreateConfigurationSetTrackingOptionsInput) CreateConfigurationSetTrackingOptionsRequest } // Send marshals and sends the CreateConfigurationSetTrackingOptions API request. @@ -234,7 +238,7 @@ func (c *SES) CreateConfigurationSetTrackingOptionsRequest(input *CreateConfigur req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateConfigurationSetTrackingOptionsRequest{Request: req, Input: input} + return CreateConfigurationSetTrackingOptionsRequest{Request: req, Input: input, Copy: c.CreateConfigurationSetTrackingOptionsRequest} } const opCreateCustomVerificationEmailTemplate = "CreateCustomVerificationEmailTemplate" @@ -243,6 +247,7 @@ const opCreateCustomVerificationEmailTemplate = "CreateCustomVerificationEmailTe type CreateCustomVerificationEmailTemplateRequest struct { *aws.Request Input *CreateCustomVerificationEmailTemplateInput + Copy func(*CreateCustomVerificationEmailTemplateInput) CreateCustomVerificationEmailTemplateRequest } // Send marshals and sends the CreateCustomVerificationEmailTemplate API request. @@ -291,7 +296,7 @@ func (c *SES) CreateCustomVerificationEmailTemplateRequest(input *CreateCustomVe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateCustomVerificationEmailTemplateRequest{Request: req, Input: input} + return CreateCustomVerificationEmailTemplateRequest{Request: req, Input: input, Copy: c.CreateCustomVerificationEmailTemplateRequest} } const opCreateReceiptFilter = "CreateReceiptFilter" @@ -300,6 +305,7 @@ const opCreateReceiptFilter = "CreateReceiptFilter" type CreateReceiptFilterRequest struct { *aws.Request Input *CreateReceiptFilterInput + Copy func(*CreateReceiptFilterInput) CreateReceiptFilterRequest } // Send marshals and sends the CreateReceiptFilter API request. @@ -345,7 +351,7 @@ func (c *SES) CreateReceiptFilterRequest(input *CreateReceiptFilterInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReceiptFilterRequest{Request: req, Input: input} + return CreateReceiptFilterRequest{Request: req, Input: input, Copy: c.CreateReceiptFilterRequest} } const opCreateReceiptRule = "CreateReceiptRule" @@ -354,6 +360,7 @@ const opCreateReceiptRule = "CreateReceiptRule" type CreateReceiptRuleRequest struct { *aws.Request Input *CreateReceiptRuleInput + Copy func(*CreateReceiptRuleInput) CreateReceiptRuleRequest } // Send marshals and sends the CreateReceiptRule API request. @@ -399,7 +406,7 @@ func (c *SES) CreateReceiptRuleRequest(input *CreateReceiptRuleInput) CreateRece req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReceiptRuleRequest{Request: req, Input: input} + return CreateReceiptRuleRequest{Request: req, Input: input, Copy: c.CreateReceiptRuleRequest} } const opCreateReceiptRuleSet = "CreateReceiptRuleSet" @@ -408,6 +415,7 @@ const opCreateReceiptRuleSet = "CreateReceiptRuleSet" type CreateReceiptRuleSetRequest struct { *aws.Request Input *CreateReceiptRuleSetInput + Copy func(*CreateReceiptRuleSetInput) CreateReceiptRuleSetRequest } // Send marshals and sends the CreateReceiptRuleSet API request. @@ -453,7 +461,7 @@ func (c *SES) CreateReceiptRuleSetRequest(input *CreateReceiptRuleSetInput) Crea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReceiptRuleSetRequest{Request: req, Input: input} + return CreateReceiptRuleSetRequest{Request: req, Input: input, Copy: c.CreateReceiptRuleSetRequest} } const opCreateTemplate = "CreateTemplate" @@ -462,6 +470,7 @@ const opCreateTemplate = "CreateTemplate" type CreateTemplateRequest struct { *aws.Request Input *CreateTemplateInput + Copy func(*CreateTemplateInput) CreateTemplateRequest } // Send marshals and sends the CreateTemplate API request. @@ -506,7 +515,7 @@ func (c *SES) CreateTemplateRequest(input *CreateTemplateInput) CreateTemplateRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTemplateRequest{Request: req, Input: input} + return CreateTemplateRequest{Request: req, Input: input, Copy: c.CreateTemplateRequest} } const opDeleteConfigurationSet = "DeleteConfigurationSet" @@ -515,6 +524,7 @@ const opDeleteConfigurationSet = "DeleteConfigurationSet" type DeleteConfigurationSetRequest struct { *aws.Request Input *DeleteConfigurationSetInput + Copy func(*DeleteConfigurationSetInput) DeleteConfigurationSetRequest } // Send marshals and sends the DeleteConfigurationSet API request. @@ -559,7 +569,7 @@ func (c *SES) DeleteConfigurationSetRequest(input *DeleteConfigurationSetInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteConfigurationSetRequest{Request: req, Input: input} + return DeleteConfigurationSetRequest{Request: req, Input: input, Copy: c.DeleteConfigurationSetRequest} } const opDeleteConfigurationSetEventDestination = "DeleteConfigurationSetEventDestination" @@ -568,6 +578,7 @@ const opDeleteConfigurationSetEventDestination = "DeleteConfigurationSetEventDes type DeleteConfigurationSetEventDestinationRequest struct { *aws.Request Input *DeleteConfigurationSetEventDestinationInput + Copy func(*DeleteConfigurationSetEventDestinationInput) DeleteConfigurationSetEventDestinationRequest } // Send marshals and sends the DeleteConfigurationSetEventDestination API request. @@ -613,7 +624,7 @@ func (c *SES) DeleteConfigurationSetEventDestinationRequest(input *DeleteConfigu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteConfigurationSetEventDestinationRequest{Request: req, Input: input} + return DeleteConfigurationSetEventDestinationRequest{Request: req, Input: input, Copy: c.DeleteConfigurationSetEventDestinationRequest} } const opDeleteConfigurationSetTrackingOptions = "DeleteConfigurationSetTrackingOptions" @@ -622,6 +633,7 @@ const opDeleteConfigurationSetTrackingOptions = "DeleteConfigurationSetTrackingO type DeleteConfigurationSetTrackingOptionsRequest struct { *aws.Request Input *DeleteConfigurationSetTrackingOptionsInput + Copy func(*DeleteConfigurationSetTrackingOptionsInput) DeleteConfigurationSetTrackingOptionsRequest } // Send marshals and sends the DeleteConfigurationSetTrackingOptions API request. @@ -673,7 +685,7 @@ func (c *SES) DeleteConfigurationSetTrackingOptionsRequest(input *DeleteConfigur req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteConfigurationSetTrackingOptionsRequest{Request: req, Input: input} + return DeleteConfigurationSetTrackingOptionsRequest{Request: req, Input: input, Copy: c.DeleteConfigurationSetTrackingOptionsRequest} } const opDeleteCustomVerificationEmailTemplate = "DeleteCustomVerificationEmailTemplate" @@ -682,6 +694,7 @@ const opDeleteCustomVerificationEmailTemplate = "DeleteCustomVerificationEmailTe type DeleteCustomVerificationEmailTemplateRequest struct { *aws.Request Input *DeleteCustomVerificationEmailTemplateInput + Copy func(*DeleteCustomVerificationEmailTemplateInput) DeleteCustomVerificationEmailTemplateRequest } // Send marshals and sends the DeleteCustomVerificationEmailTemplate API request. @@ -730,7 +743,7 @@ func (c *SES) DeleteCustomVerificationEmailTemplateRequest(input *DeleteCustomVe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCustomVerificationEmailTemplateRequest{Request: req, Input: input} + return DeleteCustomVerificationEmailTemplateRequest{Request: req, Input: input, Copy: c.DeleteCustomVerificationEmailTemplateRequest} } const opDeleteIdentity = "DeleteIdentity" @@ -739,6 +752,7 @@ const opDeleteIdentity = "DeleteIdentity" type DeleteIdentityRequest struct { *aws.Request Input *DeleteIdentityInput + Copy func(*DeleteIdentityInput) DeleteIdentityRequest } // Send marshals and sends the DeleteIdentity API request. @@ -782,7 +796,7 @@ func (c *SES) DeleteIdentityRequest(input *DeleteIdentityInput) DeleteIdentityRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteIdentityRequest{Request: req, Input: input} + return DeleteIdentityRequest{Request: req, Input: input, Copy: c.DeleteIdentityRequest} } const opDeleteIdentityPolicy = "DeleteIdentityPolicy" @@ -791,6 +805,7 @@ const opDeleteIdentityPolicy = "DeleteIdentityPolicy" type DeleteIdentityPolicyRequest struct { *aws.Request Input *DeleteIdentityPolicyInput + Copy func(*DeleteIdentityPolicyInput) DeleteIdentityPolicyRequest } // Send marshals and sends the DeleteIdentityPolicy API request. @@ -842,7 +857,7 @@ func (c *SES) DeleteIdentityPolicyRequest(input *DeleteIdentityPolicyInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteIdentityPolicyRequest{Request: req, Input: input} + return DeleteIdentityPolicyRequest{Request: req, Input: input, Copy: c.DeleteIdentityPolicyRequest} } const opDeleteReceiptFilter = "DeleteReceiptFilter" @@ -851,6 +866,7 @@ const opDeleteReceiptFilter = "DeleteReceiptFilter" type DeleteReceiptFilterRequest struct { *aws.Request Input *DeleteReceiptFilterInput + Copy func(*DeleteReceiptFilterInput) DeleteReceiptFilterRequest } // Send marshals and sends the DeleteReceiptFilter API request. @@ -896,7 +912,7 @@ func (c *SES) DeleteReceiptFilterRequest(input *DeleteReceiptFilterInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReceiptFilterRequest{Request: req, Input: input} + return DeleteReceiptFilterRequest{Request: req, Input: input, Copy: c.DeleteReceiptFilterRequest} } const opDeleteReceiptRule = "DeleteReceiptRule" @@ -905,6 +921,7 @@ const opDeleteReceiptRule = "DeleteReceiptRule" type DeleteReceiptRuleRequest struct { *aws.Request Input *DeleteReceiptRuleInput + Copy func(*DeleteReceiptRuleInput) DeleteReceiptRuleRequest } // Send marshals and sends the DeleteReceiptRule API request. @@ -950,7 +967,7 @@ func (c *SES) DeleteReceiptRuleRequest(input *DeleteReceiptRuleInput) DeleteRece req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReceiptRuleRequest{Request: req, Input: input} + return DeleteReceiptRuleRequest{Request: req, Input: input, Copy: c.DeleteReceiptRuleRequest} } const opDeleteReceiptRuleSet = "DeleteReceiptRuleSet" @@ -959,6 +976,7 @@ const opDeleteReceiptRuleSet = "DeleteReceiptRuleSet" type DeleteReceiptRuleSetRequest struct { *aws.Request Input *DeleteReceiptRuleSetInput + Copy func(*DeleteReceiptRuleSetInput) DeleteReceiptRuleSetRequest } // Send marshals and sends the DeleteReceiptRuleSet API request. @@ -1006,7 +1024,7 @@ func (c *SES) DeleteReceiptRuleSetRequest(input *DeleteReceiptRuleSetInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReceiptRuleSetRequest{Request: req, Input: input} + return DeleteReceiptRuleSetRequest{Request: req, Input: input, Copy: c.DeleteReceiptRuleSetRequest} } const opDeleteTemplate = "DeleteTemplate" @@ -1015,6 +1033,7 @@ const opDeleteTemplate = "DeleteTemplate" type DeleteTemplateRequest struct { *aws.Request Input *DeleteTemplateInput + Copy func(*DeleteTemplateInput) DeleteTemplateRequest } // Send marshals and sends the DeleteTemplate API request. @@ -1057,7 +1076,7 @@ func (c *SES) DeleteTemplateRequest(input *DeleteTemplateInput) DeleteTemplateRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTemplateRequest{Request: req, Input: input} + return DeleteTemplateRequest{Request: req, Input: input, Copy: c.DeleteTemplateRequest} } const opDeleteVerifiedEmailAddress = "DeleteVerifiedEmailAddress" @@ -1066,6 +1085,7 @@ const opDeleteVerifiedEmailAddress = "DeleteVerifiedEmailAddress" type DeleteVerifiedEmailAddressRequest struct { *aws.Request Input *DeleteVerifiedEmailAddressInput + Copy func(*DeleteVerifiedEmailAddressInput) DeleteVerifiedEmailAddressRequest } // Send marshals and sends the DeleteVerifiedEmailAddress API request. @@ -1109,7 +1129,7 @@ func (c *SES) DeleteVerifiedEmailAddressRequest(input *DeleteVerifiedEmailAddres req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteVerifiedEmailAddressRequest{Request: req, Input: input} + return DeleteVerifiedEmailAddressRequest{Request: req, Input: input, Copy: c.DeleteVerifiedEmailAddressRequest} } const opDescribeActiveReceiptRuleSet = "DescribeActiveReceiptRuleSet" @@ -1118,6 +1138,7 @@ const opDescribeActiveReceiptRuleSet = "DescribeActiveReceiptRuleSet" type DescribeActiveReceiptRuleSetRequest struct { *aws.Request Input *DescribeActiveReceiptRuleSetInput + Copy func(*DescribeActiveReceiptRuleSetInput) DescribeActiveReceiptRuleSetRequest } // Send marshals and sends the DescribeActiveReceiptRuleSet API request. @@ -1164,7 +1185,7 @@ func (c *SES) DescribeActiveReceiptRuleSetRequest(input *DescribeActiveReceiptRu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeActiveReceiptRuleSetRequest{Request: req, Input: input} + return DescribeActiveReceiptRuleSetRequest{Request: req, Input: input, Copy: c.DescribeActiveReceiptRuleSetRequest} } const opDescribeConfigurationSet = "DescribeConfigurationSet" @@ -1173,6 +1194,7 @@ const opDescribeConfigurationSet = "DescribeConfigurationSet" type DescribeConfigurationSetRequest struct { *aws.Request Input *DescribeConfigurationSetInput + Copy func(*DescribeConfigurationSetInput) DescribeConfigurationSetRequest } // Send marshals and sends the DescribeConfigurationSet API request. @@ -1216,7 +1238,7 @@ func (c *SES) DescribeConfigurationSetRequest(input *DescribeConfigurationSetInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeConfigurationSetRequest{Request: req, Input: input} + return DescribeConfigurationSetRequest{Request: req, Input: input, Copy: c.DescribeConfigurationSetRequest} } const opDescribeReceiptRule = "DescribeReceiptRule" @@ -1225,6 +1247,7 @@ const opDescribeReceiptRule = "DescribeReceiptRule" type DescribeReceiptRuleRequest struct { *aws.Request Input *DescribeReceiptRuleInput + Copy func(*DescribeReceiptRuleInput) DescribeReceiptRuleRequest } // Send marshals and sends the DescribeReceiptRule API request. @@ -1270,7 +1293,7 @@ func (c *SES) DescribeReceiptRuleRequest(input *DescribeReceiptRuleInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReceiptRuleRequest{Request: req, Input: input} + return DescribeReceiptRuleRequest{Request: req, Input: input, Copy: c.DescribeReceiptRuleRequest} } const opDescribeReceiptRuleSet = "DescribeReceiptRuleSet" @@ -1279,6 +1302,7 @@ const opDescribeReceiptRuleSet = "DescribeReceiptRuleSet" type DescribeReceiptRuleSetRequest struct { *aws.Request Input *DescribeReceiptRuleSetInput + Copy func(*DescribeReceiptRuleSetInput) DescribeReceiptRuleSetRequest } // Send marshals and sends the DescribeReceiptRuleSet API request. @@ -1324,7 +1348,7 @@ func (c *SES) DescribeReceiptRuleSetRequest(input *DescribeReceiptRuleSetInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeReceiptRuleSetRequest{Request: req, Input: input} + return DescribeReceiptRuleSetRequest{Request: req, Input: input, Copy: c.DescribeReceiptRuleSetRequest} } const opGetAccountSendingEnabled = "GetAccountSendingEnabled" @@ -1333,6 +1357,7 @@ const opGetAccountSendingEnabled = "GetAccountSendingEnabled" type GetAccountSendingEnabledRequest struct { *aws.Request Input *GetAccountSendingEnabledInput + Copy func(*GetAccountSendingEnabledInput) GetAccountSendingEnabledRequest } // Send marshals and sends the GetAccountSendingEnabled API request. @@ -1375,7 +1400,7 @@ func (c *SES) GetAccountSendingEnabledRequest(input *GetAccountSendingEnabledInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAccountSendingEnabledRequest{Request: req, Input: input} + return GetAccountSendingEnabledRequest{Request: req, Input: input, Copy: c.GetAccountSendingEnabledRequest} } const opGetCustomVerificationEmailTemplate = "GetCustomVerificationEmailTemplate" @@ -1384,6 +1409,7 @@ const opGetCustomVerificationEmailTemplate = "GetCustomVerificationEmailTemplate type GetCustomVerificationEmailTemplateRequest struct { *aws.Request Input *GetCustomVerificationEmailTemplateInput + Copy func(*GetCustomVerificationEmailTemplateInput) GetCustomVerificationEmailTemplateRequest } // Send marshals and sends the GetCustomVerificationEmailTemplate API request. @@ -1431,7 +1457,7 @@ func (c *SES) GetCustomVerificationEmailTemplateRequest(input *GetCustomVerifica req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCustomVerificationEmailTemplateRequest{Request: req, Input: input} + return GetCustomVerificationEmailTemplateRequest{Request: req, Input: input, Copy: c.GetCustomVerificationEmailTemplateRequest} } const opGetIdentityDkimAttributes = "GetIdentityDkimAttributes" @@ -1440,6 +1466,7 @@ const opGetIdentityDkimAttributes = "GetIdentityDkimAttributes" type GetIdentityDkimAttributesRequest struct { *aws.Request Input *GetIdentityDkimAttributesInput + Copy func(*GetIdentityDkimAttributesInput) GetIdentityDkimAttributesRequest } // Send marshals and sends the GetIdentityDkimAttributes API request. @@ -1501,7 +1528,7 @@ func (c *SES) GetIdentityDkimAttributesRequest(input *GetIdentityDkimAttributesI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIdentityDkimAttributesRequest{Request: req, Input: input} + return GetIdentityDkimAttributesRequest{Request: req, Input: input, Copy: c.GetIdentityDkimAttributesRequest} } const opGetIdentityMailFromDomainAttributes = "GetIdentityMailFromDomainAttributes" @@ -1510,6 +1537,7 @@ const opGetIdentityMailFromDomainAttributes = "GetIdentityMailFromDomainAttribut type GetIdentityMailFromDomainAttributesRequest struct { *aws.Request Input *GetIdentityMailFromDomainAttributesInput + Copy func(*GetIdentityMailFromDomainAttributesInput) GetIdentityMailFromDomainAttributesRequest } // Send marshals and sends the GetIdentityMailFromDomainAttributes API request. @@ -1554,7 +1582,7 @@ func (c *SES) GetIdentityMailFromDomainAttributesRequest(input *GetIdentityMailF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIdentityMailFromDomainAttributesRequest{Request: req, Input: input} + return GetIdentityMailFromDomainAttributesRequest{Request: req, Input: input, Copy: c.GetIdentityMailFromDomainAttributesRequest} } const opGetIdentityNotificationAttributes = "GetIdentityNotificationAttributes" @@ -1563,6 +1591,7 @@ const opGetIdentityNotificationAttributes = "GetIdentityNotificationAttributes" type GetIdentityNotificationAttributesRequest struct { *aws.Request Input *GetIdentityNotificationAttributesInput + Copy func(*GetIdentityNotificationAttributesInput) GetIdentityNotificationAttributesRequest } // Send marshals and sends the GetIdentityNotificationAttributes API request. @@ -1610,7 +1639,7 @@ func (c *SES) GetIdentityNotificationAttributesRequest(input *GetIdentityNotific req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIdentityNotificationAttributesRequest{Request: req, Input: input} + return GetIdentityNotificationAttributesRequest{Request: req, Input: input, Copy: c.GetIdentityNotificationAttributesRequest} } const opGetIdentityPolicies = "GetIdentityPolicies" @@ -1619,6 +1648,7 @@ const opGetIdentityPolicies = "GetIdentityPolicies" type GetIdentityPoliciesRequest struct { *aws.Request Input *GetIdentityPoliciesInput + Copy func(*GetIdentityPoliciesInput) GetIdentityPoliciesRequest } // Send marshals and sends the GetIdentityPolicies API request. @@ -1671,7 +1701,7 @@ func (c *SES) GetIdentityPoliciesRequest(input *GetIdentityPoliciesInput) GetIde req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIdentityPoliciesRequest{Request: req, Input: input} + return GetIdentityPoliciesRequest{Request: req, Input: input, Copy: c.GetIdentityPoliciesRequest} } const opGetIdentityVerificationAttributes = "GetIdentityVerificationAttributes" @@ -1680,6 +1710,7 @@ const opGetIdentityVerificationAttributes = "GetIdentityVerificationAttributes" type GetIdentityVerificationAttributesRequest struct { *aws.Request Input *GetIdentityVerificationAttributesInput + Copy func(*GetIdentityVerificationAttributesInput) GetIdentityVerificationAttributesRequest } // Send marshals and sends the GetIdentityVerificationAttributes API request. @@ -1741,7 +1772,7 @@ func (c *SES) GetIdentityVerificationAttributesRequest(input *GetIdentityVerific req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIdentityVerificationAttributesRequest{Request: req, Input: input} + return GetIdentityVerificationAttributesRequest{Request: req, Input: input, Copy: c.GetIdentityVerificationAttributesRequest} } const opGetSendQuota = "GetSendQuota" @@ -1750,6 +1781,7 @@ const opGetSendQuota = "GetSendQuota" type GetSendQuotaRequest struct { *aws.Request Input *GetSendQuotaInput + Copy func(*GetSendQuotaInput) GetSendQuotaRequest } // Send marshals and sends the GetSendQuota API request. @@ -1792,7 +1824,7 @@ func (c *SES) GetSendQuotaRequest(input *GetSendQuotaInput) GetSendQuotaRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSendQuotaRequest{Request: req, Input: input} + return GetSendQuotaRequest{Request: req, Input: input, Copy: c.GetSendQuotaRequest} } const opGetSendStatistics = "GetSendStatistics" @@ -1801,6 +1833,7 @@ const opGetSendStatistics = "GetSendStatistics" type GetSendStatisticsRequest struct { *aws.Request Input *GetSendStatisticsInput + Copy func(*GetSendStatisticsInput) GetSendStatisticsRequest } // Send marshals and sends the GetSendStatistics API request. @@ -1845,7 +1878,7 @@ func (c *SES) GetSendStatisticsRequest(input *GetSendStatisticsInput) GetSendSta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSendStatisticsRequest{Request: req, Input: input} + return GetSendStatisticsRequest{Request: req, Input: input, Copy: c.GetSendStatisticsRequest} } const opGetTemplate = "GetTemplate" @@ -1854,6 +1887,7 @@ const opGetTemplate = "GetTemplate" type GetTemplateRequest struct { *aws.Request Input *GetTemplateInput + Copy func(*GetTemplateInput) GetTemplateRequest } // Send marshals and sends the GetTemplate API request. @@ -1897,7 +1931,7 @@ func (c *SES) GetTemplateRequest(input *GetTemplateInput) GetTemplateRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTemplateRequest{Request: req, Input: input} + return GetTemplateRequest{Request: req, Input: input, Copy: c.GetTemplateRequest} } const opListConfigurationSets = "ListConfigurationSets" @@ -1906,6 +1940,7 @@ const opListConfigurationSets = "ListConfigurationSets" type ListConfigurationSetsRequest struct { *aws.Request Input *ListConfigurationSetsInput + Copy func(*ListConfigurationSetsInput) ListConfigurationSetsRequest } // Send marshals and sends the ListConfigurationSets API request. @@ -1956,7 +1991,7 @@ func (c *SES) ListConfigurationSetsRequest(input *ListConfigurationSetsInput) Li req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListConfigurationSetsRequest{Request: req, Input: input} + return ListConfigurationSetsRequest{Request: req, Input: input, Copy: c.ListConfigurationSetsRequest} } const opListCustomVerificationEmailTemplates = "ListCustomVerificationEmailTemplates" @@ -1965,6 +2000,7 @@ const opListCustomVerificationEmailTemplates = "ListCustomVerificationEmailTempl type ListCustomVerificationEmailTemplatesRequest struct { *aws.Request Input *ListCustomVerificationEmailTemplatesInput + Copy func(*ListCustomVerificationEmailTemplatesInput) ListCustomVerificationEmailTemplatesRequest } // Send marshals and sends the ListCustomVerificationEmailTemplates API request. @@ -2017,57 +2053,53 @@ func (c *SES) ListCustomVerificationEmailTemplatesRequest(input *ListCustomVerif req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCustomVerificationEmailTemplatesRequest{Request: req, Input: input} + return ListCustomVerificationEmailTemplatesRequest{Request: req, Input: input, Copy: c.ListCustomVerificationEmailTemplatesRequest} } -// ListCustomVerificationEmailTemplatesPages iterates over the pages of a ListCustomVerificationEmailTemplates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCustomVerificationEmailTemplates method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListCustomVerificationEmailTemplatesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListCustomVerificationEmailTemplates operation. -// pageNum := 0 -// err := client.ListCustomVerificationEmailTemplatesPages(params, -// func(page *ListCustomVerificationEmailTemplatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SES) ListCustomVerificationEmailTemplatesPages(input *ListCustomVerificationEmailTemplatesInput, fn func(*ListCustomVerificationEmailTemplatesOutput, bool) bool) error { - return c.ListCustomVerificationEmailTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCustomVerificationEmailTemplatesPagesWithContext same as ListCustomVerificationEmailTemplatesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SES) ListCustomVerificationEmailTemplatesPagesWithContext(ctx aws.Context, input *ListCustomVerificationEmailTemplatesInput, fn func(*ListCustomVerificationEmailTemplatesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListCustomVerificationEmailTemplatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListCustomVerificationEmailTemplatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListCustomVerificationEmailTemplatesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListCustomVerificationEmailTemplatesRequest) Paginate(opts ...aws.Option) ListCustomVerificationEmailTemplatesPager { + return ListCustomVerificationEmailTemplatesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListCustomVerificationEmailTemplatesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCustomVerificationEmailTemplatesOutput), !p.HasNextPage()) - } - return p.Err() +// ListCustomVerificationEmailTemplatesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListCustomVerificationEmailTemplatesPager struct { + aws.Pager +} + +func (p *ListCustomVerificationEmailTemplatesPager) CurrentPage() *ListCustomVerificationEmailTemplatesOutput { + return p.Pager.CurrentPage().(*ListCustomVerificationEmailTemplatesOutput) } const opListIdentities = "ListIdentities" @@ -2076,6 +2108,7 @@ const opListIdentities = "ListIdentities" type ListIdentitiesRequest struct { *aws.Request Input *ListIdentitiesInput + Copy func(*ListIdentitiesInput) ListIdentitiesRequest } // Send marshals and sends the ListIdentities API request. @@ -2125,57 +2158,53 @@ func (c *SES) ListIdentitiesRequest(input *ListIdentitiesInput) ListIdentitiesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIdentitiesRequest{Request: req, Input: input} + return ListIdentitiesRequest{Request: req, Input: input, Copy: c.ListIdentitiesRequest} } -// ListIdentitiesPages iterates over the pages of a ListIdentities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIdentities method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListIdentitiesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListIdentities operation. -// pageNum := 0 -// err := client.ListIdentitiesPages(params, -// func(page *ListIdentitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SES) ListIdentitiesPages(input *ListIdentitiesInput, fn func(*ListIdentitiesOutput, bool) bool) error { - return c.ListIdentitiesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIdentitiesPagesWithContext same as ListIdentitiesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SES) ListIdentitiesPagesWithContext(ctx aws.Context, input *ListIdentitiesInput, fn func(*ListIdentitiesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListIdentitiesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListIdentitiesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListIdentitiesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListIdentitiesRequest) Paginate(opts ...aws.Option) ListIdentitiesPager { + return ListIdentitiesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListIdentitiesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListIdentitiesOutput), !p.HasNextPage()) - } - return p.Err() +// ListIdentitiesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListIdentitiesPager struct { + aws.Pager +} + +func (p *ListIdentitiesPager) CurrentPage() *ListIdentitiesOutput { + return p.Pager.CurrentPage().(*ListIdentitiesOutput) } const opListIdentityPolicies = "ListIdentityPolicies" @@ -2184,6 +2213,7 @@ const opListIdentityPolicies = "ListIdentityPolicies" type ListIdentityPoliciesRequest struct { *aws.Request Input *ListIdentityPoliciesInput + Copy func(*ListIdentityPoliciesInput) ListIdentityPoliciesRequest } // Send marshals and sends the ListIdentityPolicies API request. @@ -2235,7 +2265,7 @@ func (c *SES) ListIdentityPoliciesRequest(input *ListIdentityPoliciesInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIdentityPoliciesRequest{Request: req, Input: input} + return ListIdentityPoliciesRequest{Request: req, Input: input, Copy: c.ListIdentityPoliciesRequest} } const opListReceiptFilters = "ListReceiptFilters" @@ -2244,6 +2274,7 @@ const opListReceiptFilters = "ListReceiptFilters" type ListReceiptFiltersRequest struct { *aws.Request Input *ListReceiptFiltersInput + Copy func(*ListReceiptFiltersInput) ListReceiptFiltersRequest } // Send marshals and sends the ListReceiptFilters API request. @@ -2289,7 +2320,7 @@ func (c *SES) ListReceiptFiltersRequest(input *ListReceiptFiltersInput) ListRece req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListReceiptFiltersRequest{Request: req, Input: input} + return ListReceiptFiltersRequest{Request: req, Input: input, Copy: c.ListReceiptFiltersRequest} } const opListReceiptRuleSets = "ListReceiptRuleSets" @@ -2298,6 +2329,7 @@ const opListReceiptRuleSets = "ListReceiptRuleSets" type ListReceiptRuleSetsRequest struct { *aws.Request Input *ListReceiptRuleSetsInput + Copy func(*ListReceiptRuleSetsInput) ListReceiptRuleSetsRequest } // Send marshals and sends the ListReceiptRuleSets API request. @@ -2346,7 +2378,7 @@ func (c *SES) ListReceiptRuleSetsRequest(input *ListReceiptRuleSetsInput) ListRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListReceiptRuleSetsRequest{Request: req, Input: input} + return ListReceiptRuleSetsRequest{Request: req, Input: input, Copy: c.ListReceiptRuleSetsRequest} } const opListTemplates = "ListTemplates" @@ -2355,6 +2387,7 @@ const opListTemplates = "ListTemplates" type ListTemplatesRequest struct { *aws.Request Input *ListTemplatesInput + Copy func(*ListTemplatesInput) ListTemplatesRequest } // Send marshals and sends the ListTemplates API request. @@ -2397,7 +2430,7 @@ func (c *SES) ListTemplatesRequest(input *ListTemplatesInput) ListTemplatesReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTemplatesRequest{Request: req, Input: input} + return ListTemplatesRequest{Request: req, Input: input, Copy: c.ListTemplatesRequest} } const opListVerifiedEmailAddresses = "ListVerifiedEmailAddresses" @@ -2406,6 +2439,7 @@ const opListVerifiedEmailAddresses = "ListVerifiedEmailAddresses" type ListVerifiedEmailAddressesRequest struct { *aws.Request Input *ListVerifiedEmailAddressesInput + Copy func(*ListVerifiedEmailAddressesInput) ListVerifiedEmailAddressesRequest } // Send marshals and sends the ListVerifiedEmailAddresses API request. @@ -2447,7 +2481,7 @@ func (c *SES) ListVerifiedEmailAddressesRequest(input *ListVerifiedEmailAddresse req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListVerifiedEmailAddressesRequest{Request: req, Input: input} + return ListVerifiedEmailAddressesRequest{Request: req, Input: input, Copy: c.ListVerifiedEmailAddressesRequest} } const opPutIdentityPolicy = "PutIdentityPolicy" @@ -2456,6 +2490,7 @@ const opPutIdentityPolicy = "PutIdentityPolicy" type PutIdentityPolicyRequest struct { *aws.Request Input *PutIdentityPolicyInput + Copy func(*PutIdentityPolicyInput) PutIdentityPolicyRequest } // Send marshals and sends the PutIdentityPolicy API request. @@ -2506,7 +2541,7 @@ func (c *SES) PutIdentityPolicyRequest(input *PutIdentityPolicyInput) PutIdentit req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutIdentityPolicyRequest{Request: req, Input: input} + return PutIdentityPolicyRequest{Request: req, Input: input, Copy: c.PutIdentityPolicyRequest} } const opReorderReceiptRuleSet = "ReorderReceiptRuleSet" @@ -2515,6 +2550,7 @@ const opReorderReceiptRuleSet = "ReorderReceiptRuleSet" type ReorderReceiptRuleSetRequest struct { *aws.Request Input *ReorderReceiptRuleSetInput + Copy func(*ReorderReceiptRuleSetInput) ReorderReceiptRuleSetRequest } // Send marshals and sends the ReorderReceiptRuleSet API request. @@ -2564,7 +2600,7 @@ func (c *SES) ReorderReceiptRuleSetRequest(input *ReorderReceiptRuleSetInput) Re req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReorderReceiptRuleSetRequest{Request: req, Input: input} + return ReorderReceiptRuleSetRequest{Request: req, Input: input, Copy: c.ReorderReceiptRuleSetRequest} } const opSendBounce = "SendBounce" @@ -2573,6 +2609,7 @@ const opSendBounce = "SendBounce" type SendBounceRequest struct { *aws.Request Input *SendBounceInput + Copy func(*SendBounceInput) SendBounceRequest } // Send marshals and sends the SendBounce API request. @@ -2623,7 +2660,7 @@ func (c *SES) SendBounceRequest(input *SendBounceInput) SendBounceRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendBounceRequest{Request: req, Input: input} + return SendBounceRequest{Request: req, Input: input, Copy: c.SendBounceRequest} } const opSendBulkTemplatedEmail = "SendBulkTemplatedEmail" @@ -2632,6 +2669,7 @@ const opSendBulkTemplatedEmail = "SendBulkTemplatedEmail" type SendBulkTemplatedEmailRequest struct { *aws.Request Input *SendBulkTemplatedEmailInput + Copy func(*SendBulkTemplatedEmailInput) SendBulkTemplatedEmailRequest } // Send marshals and sends the SendBulkTemplatedEmail API request. @@ -2697,7 +2735,7 @@ func (c *SES) SendBulkTemplatedEmailRequest(input *SendBulkTemplatedEmailInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendBulkTemplatedEmailRequest{Request: req, Input: input} + return SendBulkTemplatedEmailRequest{Request: req, Input: input, Copy: c.SendBulkTemplatedEmailRequest} } const opSendCustomVerificationEmail = "SendCustomVerificationEmail" @@ -2706,6 +2744,7 @@ const opSendCustomVerificationEmail = "SendCustomVerificationEmail" type SendCustomVerificationEmailRequest struct { *aws.Request Input *SendCustomVerificationEmailInput + Copy func(*SendCustomVerificationEmailInput) SendCustomVerificationEmailRequest } // Send marshals and sends the SendCustomVerificationEmail API request. @@ -2755,7 +2794,7 @@ func (c *SES) SendCustomVerificationEmailRequest(input *SendCustomVerificationEm req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendCustomVerificationEmailRequest{Request: req, Input: input} + return SendCustomVerificationEmailRequest{Request: req, Input: input, Copy: c.SendCustomVerificationEmailRequest} } const opSendEmail = "SendEmail" @@ -2764,6 +2803,7 @@ const opSendEmail = "SendEmail" type SendEmailRequest struct { *aws.Request Input *SendEmailInput + Copy func(*SendEmailInput) SendEmailRequest } // Send marshals and sends the SendEmail API request. @@ -2838,7 +2878,7 @@ func (c *SES) SendEmailRequest(input *SendEmailInput) SendEmailRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendEmailRequest{Request: req, Input: input} + return SendEmailRequest{Request: req, Input: input, Copy: c.SendEmailRequest} } const opSendRawEmail = "SendRawEmail" @@ -2847,6 +2887,7 @@ const opSendRawEmail = "SendRawEmail" type SendRawEmailRequest struct { *aws.Request Input *SendRawEmailInput + Copy func(*SendRawEmailInput) SendRawEmailRequest } // Send marshals and sends the SendRawEmail API request. @@ -2957,7 +2998,7 @@ func (c *SES) SendRawEmailRequest(input *SendRawEmailInput) SendRawEmailRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendRawEmailRequest{Request: req, Input: input} + return SendRawEmailRequest{Request: req, Input: input, Copy: c.SendRawEmailRequest} } const opSendTemplatedEmail = "SendTemplatedEmail" @@ -2966,6 +3007,7 @@ const opSendTemplatedEmail = "SendTemplatedEmail" type SendTemplatedEmailRequest struct { *aws.Request Input *SendTemplatedEmailInput + Copy func(*SendTemplatedEmailInput) SendTemplatedEmailRequest } // Send marshals and sends the SendTemplatedEmail API request. @@ -3036,7 +3078,7 @@ func (c *SES) SendTemplatedEmailRequest(input *SendTemplatedEmailInput) SendTemp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendTemplatedEmailRequest{Request: req, Input: input} + return SendTemplatedEmailRequest{Request: req, Input: input, Copy: c.SendTemplatedEmailRequest} } const opSetActiveReceiptRuleSet = "SetActiveReceiptRuleSet" @@ -3045,6 +3087,7 @@ const opSetActiveReceiptRuleSet = "SetActiveReceiptRuleSet" type SetActiveReceiptRuleSetRequest struct { *aws.Request Input *SetActiveReceiptRuleSetInput + Copy func(*SetActiveReceiptRuleSetInput) SetActiveReceiptRuleSetRequest } // Send marshals and sends the SetActiveReceiptRuleSet API request. @@ -3093,7 +3136,7 @@ func (c *SES) SetActiveReceiptRuleSetRequest(input *SetActiveReceiptRuleSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetActiveReceiptRuleSetRequest{Request: req, Input: input} + return SetActiveReceiptRuleSetRequest{Request: req, Input: input, Copy: c.SetActiveReceiptRuleSetRequest} } const opSetIdentityDkimEnabled = "SetIdentityDkimEnabled" @@ -3102,6 +3145,7 @@ const opSetIdentityDkimEnabled = "SetIdentityDkimEnabled" type SetIdentityDkimEnabledRequest struct { *aws.Request Input *SetIdentityDkimEnabledInput + Copy func(*SetIdentityDkimEnabledInput) SetIdentityDkimEnabledRequest } // Send marshals and sends the SetIdentityDkimEnabled API request. @@ -3159,7 +3203,7 @@ func (c *SES) SetIdentityDkimEnabledRequest(input *SetIdentityDkimEnabledInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetIdentityDkimEnabledRequest{Request: req, Input: input} + return SetIdentityDkimEnabledRequest{Request: req, Input: input, Copy: c.SetIdentityDkimEnabledRequest} } const opSetIdentityFeedbackForwardingEnabled = "SetIdentityFeedbackForwardingEnabled" @@ -3168,6 +3212,7 @@ const opSetIdentityFeedbackForwardingEnabled = "SetIdentityFeedbackForwardingEna type SetIdentityFeedbackForwardingEnabledRequest struct { *aws.Request Input *SetIdentityFeedbackForwardingEnabledInput + Copy func(*SetIdentityFeedbackForwardingEnabledInput) SetIdentityFeedbackForwardingEnabledRequest } // Send marshals and sends the SetIdentityFeedbackForwardingEnabled API request. @@ -3219,7 +3264,7 @@ func (c *SES) SetIdentityFeedbackForwardingEnabledRequest(input *SetIdentityFeed req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetIdentityFeedbackForwardingEnabledRequest{Request: req, Input: input} + return SetIdentityFeedbackForwardingEnabledRequest{Request: req, Input: input, Copy: c.SetIdentityFeedbackForwardingEnabledRequest} } const opSetIdentityHeadersInNotificationsEnabled = "SetIdentityHeadersInNotificationsEnabled" @@ -3228,6 +3273,7 @@ const opSetIdentityHeadersInNotificationsEnabled = "SetIdentityHeadersInNotifica type SetIdentityHeadersInNotificationsEnabledRequest struct { *aws.Request Input *SetIdentityHeadersInNotificationsEnabledInput + Copy func(*SetIdentityHeadersInNotificationsEnabledInput) SetIdentityHeadersInNotificationsEnabledRequest } // Send marshals and sends the SetIdentityHeadersInNotificationsEnabled API request. @@ -3275,7 +3321,7 @@ func (c *SES) SetIdentityHeadersInNotificationsEnabledRequest(input *SetIdentity req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetIdentityHeadersInNotificationsEnabledRequest{Request: req, Input: input} + return SetIdentityHeadersInNotificationsEnabledRequest{Request: req, Input: input, Copy: c.SetIdentityHeadersInNotificationsEnabledRequest} } const opSetIdentityMailFromDomain = "SetIdentityMailFromDomain" @@ -3284,6 +3330,7 @@ const opSetIdentityMailFromDomain = "SetIdentityMailFromDomain" type SetIdentityMailFromDomainRequest struct { *aws.Request Input *SetIdentityMailFromDomainInput + Copy func(*SetIdentityMailFromDomainInput) SetIdentityMailFromDomainRequest } // Send marshals and sends the SetIdentityMailFromDomain API request. @@ -3332,7 +3379,7 @@ func (c *SES) SetIdentityMailFromDomainRequest(input *SetIdentityMailFromDomainI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetIdentityMailFromDomainRequest{Request: req, Input: input} + return SetIdentityMailFromDomainRequest{Request: req, Input: input, Copy: c.SetIdentityMailFromDomainRequest} } const opSetIdentityNotificationTopic = "SetIdentityNotificationTopic" @@ -3341,6 +3388,7 @@ const opSetIdentityNotificationTopic = "SetIdentityNotificationTopic" type SetIdentityNotificationTopicRequest struct { *aws.Request Input *SetIdentityNotificationTopicInput + Copy func(*SetIdentityNotificationTopicInput) SetIdentityNotificationTopicRequest } // Send marshals and sends the SetIdentityNotificationTopic API request. @@ -3392,7 +3440,7 @@ func (c *SES) SetIdentityNotificationTopicRequest(input *SetIdentityNotification req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetIdentityNotificationTopicRequest{Request: req, Input: input} + return SetIdentityNotificationTopicRequest{Request: req, Input: input, Copy: c.SetIdentityNotificationTopicRequest} } const opSetReceiptRulePosition = "SetReceiptRulePosition" @@ -3401,6 +3449,7 @@ const opSetReceiptRulePosition = "SetReceiptRulePosition" type SetReceiptRulePositionRequest struct { *aws.Request Input *SetReceiptRulePositionInput + Copy func(*SetReceiptRulePositionInput) SetReceiptRulePositionRequest } // Send marshals and sends the SetReceiptRulePosition API request. @@ -3446,7 +3495,7 @@ func (c *SES) SetReceiptRulePositionRequest(input *SetReceiptRulePositionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetReceiptRulePositionRequest{Request: req, Input: input} + return SetReceiptRulePositionRequest{Request: req, Input: input, Copy: c.SetReceiptRulePositionRequest} } const opTestRenderTemplate = "TestRenderTemplate" @@ -3455,6 +3504,7 @@ const opTestRenderTemplate = "TestRenderTemplate" type TestRenderTemplateRequest struct { *aws.Request Input *TestRenderTemplateInput + Copy func(*TestRenderTemplateInput) TestRenderTemplateRequest } // Send marshals and sends the TestRenderTemplate API request. @@ -3498,7 +3548,7 @@ func (c *SES) TestRenderTemplateRequest(input *TestRenderTemplateInput) TestRend req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TestRenderTemplateRequest{Request: req, Input: input} + return TestRenderTemplateRequest{Request: req, Input: input, Copy: c.TestRenderTemplateRequest} } const opUpdateAccountSendingEnabled = "UpdateAccountSendingEnabled" @@ -3507,6 +3557,7 @@ const opUpdateAccountSendingEnabled = "UpdateAccountSendingEnabled" type UpdateAccountSendingEnabledRequest struct { *aws.Request Input *UpdateAccountSendingEnabledInput + Copy func(*UpdateAccountSendingEnabledInput) UpdateAccountSendingEnabledRequest } // Send marshals and sends the UpdateAccountSendingEnabled API request. @@ -3554,7 +3605,7 @@ func (c *SES) UpdateAccountSendingEnabledRequest(input *UpdateAccountSendingEnab req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateAccountSendingEnabledRequest{Request: req, Input: input} + return UpdateAccountSendingEnabledRequest{Request: req, Input: input, Copy: c.UpdateAccountSendingEnabledRequest} } const opUpdateConfigurationSetEventDestination = "UpdateConfigurationSetEventDestination" @@ -3563,6 +3614,7 @@ const opUpdateConfigurationSetEventDestination = "UpdateConfigurationSetEventDes type UpdateConfigurationSetEventDestinationRequest struct { *aws.Request Input *UpdateConfigurationSetEventDestinationInput + Copy func(*UpdateConfigurationSetEventDestinationInput) UpdateConfigurationSetEventDestinationRequest } // Send marshals and sends the UpdateConfigurationSetEventDestination API request. @@ -3614,7 +3666,7 @@ func (c *SES) UpdateConfigurationSetEventDestinationRequest(input *UpdateConfigu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateConfigurationSetEventDestinationRequest{Request: req, Input: input} + return UpdateConfigurationSetEventDestinationRequest{Request: req, Input: input, Copy: c.UpdateConfigurationSetEventDestinationRequest} } const opUpdateConfigurationSetReputationMetricsEnabled = "UpdateConfigurationSetReputationMetricsEnabled" @@ -3623,6 +3675,7 @@ const opUpdateConfigurationSetReputationMetricsEnabled = "UpdateConfigurationSet type UpdateConfigurationSetReputationMetricsEnabledRequest struct { *aws.Request Input *UpdateConfigurationSetReputationMetricsEnabledInput + Copy func(*UpdateConfigurationSetReputationMetricsEnabledInput) UpdateConfigurationSetReputationMetricsEnabledRequest } // Send marshals and sends the UpdateConfigurationSetReputationMetricsEnabled API request. @@ -3671,7 +3724,7 @@ func (c *SES) UpdateConfigurationSetReputationMetricsEnabledRequest(input *Updat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateConfigurationSetReputationMetricsEnabledRequest{Request: req, Input: input} + return UpdateConfigurationSetReputationMetricsEnabledRequest{Request: req, Input: input, Copy: c.UpdateConfigurationSetReputationMetricsEnabledRequest} } const opUpdateConfigurationSetSendingEnabled = "UpdateConfigurationSetSendingEnabled" @@ -3680,6 +3733,7 @@ const opUpdateConfigurationSetSendingEnabled = "UpdateConfigurationSetSendingEna type UpdateConfigurationSetSendingEnabledRequest struct { *aws.Request Input *UpdateConfigurationSetSendingEnabledInput + Copy func(*UpdateConfigurationSetSendingEnabledInput) UpdateConfigurationSetSendingEnabledRequest } // Send marshals and sends the UpdateConfigurationSetSendingEnabled API request. @@ -3728,7 +3782,7 @@ func (c *SES) UpdateConfigurationSetSendingEnabledRequest(input *UpdateConfigura req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateConfigurationSetSendingEnabledRequest{Request: req, Input: input} + return UpdateConfigurationSetSendingEnabledRequest{Request: req, Input: input, Copy: c.UpdateConfigurationSetSendingEnabledRequest} } const opUpdateConfigurationSetTrackingOptions = "UpdateConfigurationSetTrackingOptions" @@ -3737,6 +3791,7 @@ const opUpdateConfigurationSetTrackingOptions = "UpdateConfigurationSetTrackingO type UpdateConfigurationSetTrackingOptionsRequest struct { *aws.Request Input *UpdateConfigurationSetTrackingOptionsInput + Copy func(*UpdateConfigurationSetTrackingOptionsInput) UpdateConfigurationSetTrackingOptionsRequest } // Send marshals and sends the UpdateConfigurationSetTrackingOptions API request. @@ -3784,7 +3839,7 @@ func (c *SES) UpdateConfigurationSetTrackingOptionsRequest(input *UpdateConfigur req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateConfigurationSetTrackingOptionsRequest{Request: req, Input: input} + return UpdateConfigurationSetTrackingOptionsRequest{Request: req, Input: input, Copy: c.UpdateConfigurationSetTrackingOptionsRequest} } const opUpdateCustomVerificationEmailTemplate = "UpdateCustomVerificationEmailTemplate" @@ -3793,6 +3848,7 @@ const opUpdateCustomVerificationEmailTemplate = "UpdateCustomVerificationEmailTe type UpdateCustomVerificationEmailTemplateRequest struct { *aws.Request Input *UpdateCustomVerificationEmailTemplateInput + Copy func(*UpdateCustomVerificationEmailTemplateInput) UpdateCustomVerificationEmailTemplateRequest } // Send marshals and sends the UpdateCustomVerificationEmailTemplate API request. @@ -3841,7 +3897,7 @@ func (c *SES) UpdateCustomVerificationEmailTemplateRequest(input *UpdateCustomVe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateCustomVerificationEmailTemplateRequest{Request: req, Input: input} + return UpdateCustomVerificationEmailTemplateRequest{Request: req, Input: input, Copy: c.UpdateCustomVerificationEmailTemplateRequest} } const opUpdateReceiptRule = "UpdateReceiptRule" @@ -3850,6 +3906,7 @@ const opUpdateReceiptRule = "UpdateReceiptRule" type UpdateReceiptRuleRequest struct { *aws.Request Input *UpdateReceiptRuleInput + Copy func(*UpdateReceiptRuleInput) UpdateReceiptRuleRequest } // Send marshals and sends the UpdateReceiptRule API request. @@ -3895,7 +3952,7 @@ func (c *SES) UpdateReceiptRuleRequest(input *UpdateReceiptRuleInput) UpdateRece req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateReceiptRuleRequest{Request: req, Input: input} + return UpdateReceiptRuleRequest{Request: req, Input: input, Copy: c.UpdateReceiptRuleRequest} } const opUpdateTemplate = "UpdateTemplate" @@ -3904,6 +3961,7 @@ const opUpdateTemplate = "UpdateTemplate" type UpdateTemplateRequest struct { *aws.Request Input *UpdateTemplateInput + Copy func(*UpdateTemplateInput) UpdateTemplateRequest } // Send marshals and sends the UpdateTemplate API request. @@ -3948,7 +4006,7 @@ func (c *SES) UpdateTemplateRequest(input *UpdateTemplateInput) UpdateTemplateRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateTemplateRequest{Request: req, Input: input} + return UpdateTemplateRequest{Request: req, Input: input, Copy: c.UpdateTemplateRequest} } const opVerifyDomainDkim = "VerifyDomainDkim" @@ -3957,6 +4015,7 @@ const opVerifyDomainDkim = "VerifyDomainDkim" type VerifyDomainDkimRequest struct { *aws.Request Input *VerifyDomainDkimInput + Copy func(*VerifyDomainDkimInput) VerifyDomainDkimRequest } // Send marshals and sends the VerifyDomainDkim API request. @@ -4011,7 +4070,7 @@ func (c *SES) VerifyDomainDkimRequest(input *VerifyDomainDkimInput) VerifyDomain req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return VerifyDomainDkimRequest{Request: req, Input: input} + return VerifyDomainDkimRequest{Request: req, Input: input, Copy: c.VerifyDomainDkimRequest} } const opVerifyDomainIdentity = "VerifyDomainIdentity" @@ -4020,6 +4079,7 @@ const opVerifyDomainIdentity = "VerifyDomainIdentity" type VerifyDomainIdentityRequest struct { *aws.Request Input *VerifyDomainIdentityInput + Copy func(*VerifyDomainIdentityInput) VerifyDomainIdentityRequest } // Send marshals and sends the VerifyDomainIdentity API request. @@ -4065,7 +4125,7 @@ func (c *SES) VerifyDomainIdentityRequest(input *VerifyDomainIdentityInput) Veri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return VerifyDomainIdentityRequest{Request: req, Input: input} + return VerifyDomainIdentityRequest{Request: req, Input: input, Copy: c.VerifyDomainIdentityRequest} } const opVerifyEmailAddress = "VerifyEmailAddress" @@ -4074,6 +4134,7 @@ const opVerifyEmailAddress = "VerifyEmailAddress" type VerifyEmailAddressRequest struct { *aws.Request Input *VerifyEmailAddressInput + Copy func(*VerifyEmailAddressInput) VerifyEmailAddressRequest } // Send marshals and sends the VerifyEmailAddress API request. @@ -4116,7 +4177,7 @@ func (c *SES) VerifyEmailAddressRequest(input *VerifyEmailAddressInput) VerifyEm req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return VerifyEmailAddressRequest{Request: req, Input: input} + return VerifyEmailAddressRequest{Request: req, Input: input, Copy: c.VerifyEmailAddressRequest} } const opVerifyEmailIdentity = "VerifyEmailIdentity" @@ -4125,6 +4186,7 @@ const opVerifyEmailIdentity = "VerifyEmailIdentity" type VerifyEmailIdentityRequest struct { *aws.Request Input *VerifyEmailIdentityInput + Copy func(*VerifyEmailIdentityInput) VerifyEmailIdentityRequest } // Send marshals and sends the VerifyEmailIdentity API request. @@ -4169,7 +4231,7 @@ func (c *SES) VerifyEmailIdentityRequest(input *VerifyEmailIdentityInput) Verify req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return VerifyEmailIdentityRequest{Request: req, Input: input} + return VerifyEmailIdentityRequest{Request: req, Input: input, Copy: c.VerifyEmailIdentityRequest} } // When included in a receipt rule, this action adds a header to the received diff --git a/service/ses/sesiface/interface.go b/service/ses/sesiface/interface.go index c1efdfe9dea..508963781dd 100644 --- a/service/ses/sesiface/interface.go +++ b/service/ses/sesiface/interface.go @@ -135,14 +135,8 @@ type SESAPI interface { ListCustomVerificationEmailTemplatesRequest(*ses.ListCustomVerificationEmailTemplatesInput) ses.ListCustomVerificationEmailTemplatesRequest - ListCustomVerificationEmailTemplatesPages(*ses.ListCustomVerificationEmailTemplatesInput, func(*ses.ListCustomVerificationEmailTemplatesOutput, bool) bool) error - ListCustomVerificationEmailTemplatesPagesWithContext(aws.Context, *ses.ListCustomVerificationEmailTemplatesInput, func(*ses.ListCustomVerificationEmailTemplatesOutput, bool) bool, ...aws.Option) error - ListIdentitiesRequest(*ses.ListIdentitiesInput) ses.ListIdentitiesRequest - ListIdentitiesPages(*ses.ListIdentitiesInput, func(*ses.ListIdentitiesOutput, bool) bool) error - ListIdentitiesPagesWithContext(aws.Context, *ses.ListIdentitiesInput, func(*ses.ListIdentitiesOutput, bool) bool, ...aws.Option) error - ListIdentityPoliciesRequest(*ses.ListIdentityPoliciesInput) ses.ListIdentityPoliciesRequest ListReceiptFiltersRequest(*ses.ListReceiptFiltersInput) ses.ListReceiptFiltersRequest diff --git a/service/sfn/api.go b/service/sfn/api.go index 61b1fee67c8..6c3a88b5219 100644 --- a/service/sfn/api.go +++ b/service/sfn/api.go @@ -15,6 +15,7 @@ const opCreateActivity = "CreateActivity" type CreateActivityRequest struct { *aws.Request Input *CreateActivityInput + Copy func(*CreateActivityInput) CreateActivityRequest } // Send marshals and sends the CreateActivity API request. @@ -60,7 +61,7 @@ func (c *SFN) CreateActivityRequest(input *CreateActivityInput) CreateActivityRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateActivityRequest{Request: req, Input: input} + return CreateActivityRequest{Request: req, Input: input, Copy: c.CreateActivityRequest} } const opCreateStateMachine = "CreateStateMachine" @@ -69,6 +70,7 @@ const opCreateStateMachine = "CreateStateMachine" type CreateStateMachineRequest struct { *aws.Request Input *CreateStateMachineInput + Copy func(*CreateStateMachineInput) CreateStateMachineRequest } // Send marshals and sends the CreateStateMachine API request. @@ -112,7 +114,7 @@ func (c *SFN) CreateStateMachineRequest(input *CreateStateMachineInput) CreateSt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStateMachineRequest{Request: req, Input: input} + return CreateStateMachineRequest{Request: req, Input: input, Copy: c.CreateStateMachineRequest} } const opDeleteActivity = "DeleteActivity" @@ -121,6 +123,7 @@ const opDeleteActivity = "DeleteActivity" type DeleteActivityRequest struct { *aws.Request Input *DeleteActivityInput + Copy func(*DeleteActivityInput) DeleteActivityRequest } // Send marshals and sends the DeleteActivity API request. @@ -161,7 +164,7 @@ func (c *SFN) DeleteActivityRequest(input *DeleteActivityInput) DeleteActivityRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteActivityRequest{Request: req, Input: input} + return DeleteActivityRequest{Request: req, Input: input, Copy: c.DeleteActivityRequest} } const opDeleteStateMachine = "DeleteStateMachine" @@ -170,6 +173,7 @@ const opDeleteStateMachine = "DeleteStateMachine" type DeleteStateMachineRequest struct { *aws.Request Input *DeleteStateMachineInput + Copy func(*DeleteStateMachineInput) DeleteStateMachineRequest } // Send marshals and sends the DeleteStateMachine API request. @@ -215,7 +219,7 @@ func (c *SFN) DeleteStateMachineRequest(input *DeleteStateMachineInput) DeleteSt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteStateMachineRequest{Request: req, Input: input} + return DeleteStateMachineRequest{Request: req, Input: input, Copy: c.DeleteStateMachineRequest} } const opDescribeActivity = "DescribeActivity" @@ -224,6 +228,7 @@ const opDescribeActivity = "DescribeActivity" type DescribeActivityRequest struct { *aws.Request Input *DescribeActivityInput + Copy func(*DescribeActivityInput) DescribeActivityRequest } // Send marshals and sends the DescribeActivity API request. @@ -264,7 +269,7 @@ func (c *SFN) DescribeActivityRequest(input *DescribeActivityInput) DescribeActi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeActivityRequest{Request: req, Input: input} + return DescribeActivityRequest{Request: req, Input: input, Copy: c.DescribeActivityRequest} } const opDescribeExecution = "DescribeExecution" @@ -273,6 +278,7 @@ const opDescribeExecution = "DescribeExecution" type DescribeExecutionRequest struct { *aws.Request Input *DescribeExecutionInput + Copy func(*DescribeExecutionInput) DescribeExecutionRequest } // Send marshals and sends the DescribeExecution API request. @@ -313,7 +319,7 @@ func (c *SFN) DescribeExecutionRequest(input *DescribeExecutionInput) DescribeEx req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeExecutionRequest{Request: req, Input: input} + return DescribeExecutionRequest{Request: req, Input: input, Copy: c.DescribeExecutionRequest} } const opDescribeStateMachine = "DescribeStateMachine" @@ -322,6 +328,7 @@ const opDescribeStateMachine = "DescribeStateMachine" type DescribeStateMachineRequest struct { *aws.Request Input *DescribeStateMachineInput + Copy func(*DescribeStateMachineInput) DescribeStateMachineRequest } // Send marshals and sends the DescribeStateMachine API request. @@ -362,7 +369,7 @@ func (c *SFN) DescribeStateMachineRequest(input *DescribeStateMachineInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStateMachineRequest{Request: req, Input: input} + return DescribeStateMachineRequest{Request: req, Input: input, Copy: c.DescribeStateMachineRequest} } const opDescribeStateMachineForExecution = "DescribeStateMachineForExecution" @@ -371,6 +378,7 @@ const opDescribeStateMachineForExecution = "DescribeStateMachineForExecution" type DescribeStateMachineForExecutionRequest struct { *aws.Request Input *DescribeStateMachineForExecutionInput + Copy func(*DescribeStateMachineForExecutionInput) DescribeStateMachineForExecutionRequest } // Send marshals and sends the DescribeStateMachineForExecution API request. @@ -411,7 +419,7 @@ func (c *SFN) DescribeStateMachineForExecutionRequest(input *DescribeStateMachin req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStateMachineForExecutionRequest{Request: req, Input: input} + return DescribeStateMachineForExecutionRequest{Request: req, Input: input, Copy: c.DescribeStateMachineForExecutionRequest} } const opGetActivityTask = "GetActivityTask" @@ -420,6 +428,7 @@ const opGetActivityTask = "GetActivityTask" type GetActivityTaskRequest struct { *aws.Request Input *GetActivityTaskInput + Copy func(*GetActivityTaskInput) GetActivityTaskRequest } // Send marshals and sends the GetActivityTask API request. @@ -469,7 +478,7 @@ func (c *SFN) GetActivityTaskRequest(input *GetActivityTaskInput) GetActivityTas req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetActivityTaskRequest{Request: req, Input: input} + return GetActivityTaskRequest{Request: req, Input: input, Copy: c.GetActivityTaskRequest} } const opGetExecutionHistory = "GetExecutionHistory" @@ -478,6 +487,7 @@ const opGetExecutionHistory = "GetExecutionHistory" type GetExecutionHistoryRequest struct { *aws.Request Input *GetExecutionHistoryInput + Copy func(*GetExecutionHistoryInput) GetExecutionHistoryRequest } // Send marshals and sends the GetExecutionHistory API request. @@ -530,57 +540,53 @@ func (c *SFN) GetExecutionHistoryRequest(input *GetExecutionHistoryInput) GetExe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetExecutionHistoryRequest{Request: req, Input: input} + return GetExecutionHistoryRequest{Request: req, Input: input, Copy: c.GetExecutionHistoryRequest} } -// GetExecutionHistoryPages iterates over the pages of a GetExecutionHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetExecutionHistory method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetExecutionHistoryRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetExecutionHistory operation. -// pageNum := 0 -// err := client.GetExecutionHistoryPages(params, -// func(page *GetExecutionHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SFN) GetExecutionHistoryPages(input *GetExecutionHistoryInput, fn func(*GetExecutionHistoryOutput, bool) bool) error { - return c.GetExecutionHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetExecutionHistoryPagesWithContext same as GetExecutionHistoryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SFN) GetExecutionHistoryPagesWithContext(ctx aws.Context, input *GetExecutionHistoryInput, fn func(*GetExecutionHistoryOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetExecutionHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetExecutionHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetExecutionHistoryRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetExecutionHistoryRequest) Paginate(opts ...aws.Option) GetExecutionHistoryPager { + return GetExecutionHistoryPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetExecutionHistoryInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetExecutionHistoryOutput), !p.HasNextPage()) - } - return p.Err() +// GetExecutionHistoryPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetExecutionHistoryPager struct { + aws.Pager +} + +func (p *GetExecutionHistoryPager) CurrentPage() *GetExecutionHistoryOutput { + return p.Pager.CurrentPage().(*GetExecutionHistoryOutput) } const opListActivities = "ListActivities" @@ -589,6 +595,7 @@ const opListActivities = "ListActivities" type ListActivitiesRequest struct { *aws.Request Input *ListActivitiesInput + Copy func(*ListActivitiesInput) ListActivitiesRequest } // Send marshals and sends the ListActivities API request. @@ -639,57 +646,53 @@ func (c *SFN) ListActivitiesRequest(input *ListActivitiesInput) ListActivitiesRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListActivitiesRequest{Request: req, Input: input} + return ListActivitiesRequest{Request: req, Input: input, Copy: c.ListActivitiesRequest} } -// ListActivitiesPages iterates over the pages of a ListActivities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListActivities method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListActivitiesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListActivities operation. -// pageNum := 0 -// err := client.ListActivitiesPages(params, -// func(page *ListActivitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SFN) ListActivitiesPages(input *ListActivitiesInput, fn func(*ListActivitiesOutput, bool) bool) error { - return c.ListActivitiesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListActivitiesPagesWithContext same as ListActivitiesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SFN) ListActivitiesPagesWithContext(ctx aws.Context, input *ListActivitiesInput, fn func(*ListActivitiesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListActivitiesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListActivitiesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListActivitiesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListActivitiesRequest) Paginate(opts ...aws.Option) ListActivitiesPager { + return ListActivitiesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListActivitiesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListActivitiesOutput), !p.HasNextPage()) - } - return p.Err() +// ListActivitiesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListActivitiesPager struct { + aws.Pager +} + +func (p *ListActivitiesPager) CurrentPage() *ListActivitiesOutput { + return p.Pager.CurrentPage().(*ListActivitiesOutput) } const opListExecutions = "ListExecutions" @@ -698,6 +701,7 @@ const opListExecutions = "ListExecutions" type ListExecutionsRequest struct { *aws.Request Input *ListExecutionsInput + Copy func(*ListExecutionsInput) ListExecutionsRequest } // Send marshals and sends the ListExecutions API request. @@ -748,57 +752,53 @@ func (c *SFN) ListExecutionsRequest(input *ListExecutionsInput) ListExecutionsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListExecutionsRequest{Request: req, Input: input} + return ListExecutionsRequest{Request: req, Input: input, Copy: c.ListExecutionsRequest} } -// ListExecutionsPages iterates over the pages of a ListExecutions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListExecutions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListExecutionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListExecutions operation. -// pageNum := 0 -// err := client.ListExecutionsPages(params, -// func(page *ListExecutionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SFN) ListExecutionsPages(input *ListExecutionsInput, fn func(*ListExecutionsOutput, bool) bool) error { - return c.ListExecutionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListExecutionsPagesWithContext same as ListExecutionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SFN) ListExecutionsPagesWithContext(ctx aws.Context, input *ListExecutionsInput, fn func(*ListExecutionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListExecutionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListExecutionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListExecutionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListExecutionsRequest) Paginate(opts ...aws.Option) ListExecutionsPager { + return ListExecutionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListExecutionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListExecutionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListExecutionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListExecutionsPager struct { + aws.Pager +} + +func (p *ListExecutionsPager) CurrentPage() *ListExecutionsOutput { + return p.Pager.CurrentPage().(*ListExecutionsOutput) } const opListStateMachines = "ListStateMachines" @@ -807,6 +807,7 @@ const opListStateMachines = "ListStateMachines" type ListStateMachinesRequest struct { *aws.Request Input *ListStateMachinesInput + Copy func(*ListStateMachinesInput) ListStateMachinesRequest } // Send marshals and sends the ListStateMachines API request. @@ -857,57 +858,53 @@ func (c *SFN) ListStateMachinesRequest(input *ListStateMachinesInput) ListStateM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListStateMachinesRequest{Request: req, Input: input} + return ListStateMachinesRequest{Request: req, Input: input, Copy: c.ListStateMachinesRequest} } -// ListStateMachinesPages iterates over the pages of a ListStateMachines operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStateMachines method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListStateMachinesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListStateMachines operation. -// pageNum := 0 -// err := client.ListStateMachinesPages(params, -// func(page *ListStateMachinesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SFN) ListStateMachinesPages(input *ListStateMachinesInput, fn func(*ListStateMachinesOutput, bool) bool) error { - return c.ListStateMachinesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStateMachinesPagesWithContext same as ListStateMachinesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SFN) ListStateMachinesPagesWithContext(ctx aws.Context, input *ListStateMachinesInput, fn func(*ListStateMachinesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListStateMachinesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListStateMachinesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListStateMachinesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListStateMachinesRequest) Paginate(opts ...aws.Option) ListStateMachinesPager { + return ListStateMachinesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListStateMachinesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStateMachinesOutput), !p.HasNextPage()) - } - return p.Err() +// ListStateMachinesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListStateMachinesPager struct { + aws.Pager +} + +func (p *ListStateMachinesPager) CurrentPage() *ListStateMachinesOutput { + return p.Pager.CurrentPage().(*ListStateMachinesOutput) } const opSendTaskFailure = "SendTaskFailure" @@ -916,6 +913,7 @@ const opSendTaskFailure = "SendTaskFailure" type SendTaskFailureRequest struct { *aws.Request Input *SendTaskFailureInput + Copy func(*SendTaskFailureInput) SendTaskFailureRequest } // Send marshals and sends the SendTaskFailure API request. @@ -956,7 +954,7 @@ func (c *SFN) SendTaskFailureRequest(input *SendTaskFailureInput) SendTaskFailur req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendTaskFailureRequest{Request: req, Input: input} + return SendTaskFailureRequest{Request: req, Input: input, Copy: c.SendTaskFailureRequest} } const opSendTaskHeartbeat = "SendTaskHeartbeat" @@ -965,6 +963,7 @@ const opSendTaskHeartbeat = "SendTaskHeartbeat" type SendTaskHeartbeatRequest struct { *aws.Request Input *SendTaskHeartbeatInput + Copy func(*SendTaskHeartbeatInput) SendTaskHeartbeatRequest } // Send marshals and sends the SendTaskHeartbeat API request. @@ -1017,7 +1016,7 @@ func (c *SFN) SendTaskHeartbeatRequest(input *SendTaskHeartbeatInput) SendTaskHe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendTaskHeartbeatRequest{Request: req, Input: input} + return SendTaskHeartbeatRequest{Request: req, Input: input, Copy: c.SendTaskHeartbeatRequest} } const opSendTaskSuccess = "SendTaskSuccess" @@ -1026,6 +1025,7 @@ const opSendTaskSuccess = "SendTaskSuccess" type SendTaskSuccessRequest struct { *aws.Request Input *SendTaskSuccessInput + Copy func(*SendTaskSuccessInput) SendTaskSuccessRequest } // Send marshals and sends the SendTaskSuccess API request. @@ -1067,7 +1067,7 @@ func (c *SFN) SendTaskSuccessRequest(input *SendTaskSuccessInput) SendTaskSucces req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendTaskSuccessRequest{Request: req, Input: input} + return SendTaskSuccessRequest{Request: req, Input: input, Copy: c.SendTaskSuccessRequest} } const opStartExecution = "StartExecution" @@ -1076,6 +1076,7 @@ const opStartExecution = "StartExecution" type StartExecutionRequest struct { *aws.Request Input *StartExecutionInput + Copy func(*StartExecutionInput) StartExecutionRequest } // Send marshals and sends the StartExecution API request. @@ -1116,7 +1117,7 @@ func (c *SFN) StartExecutionRequest(input *StartExecutionInput) StartExecutionRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartExecutionRequest{Request: req, Input: input} + return StartExecutionRequest{Request: req, Input: input, Copy: c.StartExecutionRequest} } const opStopExecution = "StopExecution" @@ -1125,6 +1126,7 @@ const opStopExecution = "StopExecution" type StopExecutionRequest struct { *aws.Request Input *StopExecutionInput + Copy func(*StopExecutionInput) StopExecutionRequest } // Send marshals and sends the StopExecution API request. @@ -1165,7 +1167,7 @@ func (c *SFN) StopExecutionRequest(input *StopExecutionInput) StopExecutionReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopExecutionRequest{Request: req, Input: input} + return StopExecutionRequest{Request: req, Input: input, Copy: c.StopExecutionRequest} } const opUpdateStateMachine = "UpdateStateMachine" @@ -1174,6 +1176,7 @@ const opUpdateStateMachine = "UpdateStateMachine" type UpdateStateMachineRequest struct { *aws.Request Input *UpdateStateMachineInput + Copy func(*UpdateStateMachineInput) UpdateStateMachineRequest } // Send marshals and sends the UpdateStateMachine API request. @@ -1221,7 +1224,7 @@ func (c *SFN) UpdateStateMachineRequest(input *UpdateStateMachineInput) UpdateSt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateStateMachineRequest{Request: req, Input: input} + return UpdateStateMachineRequest{Request: req, Input: input, Copy: c.UpdateStateMachineRequest} } // Contains details about an activity which failed during an execution. diff --git a/service/sfn/sfniface/interface.go b/service/sfn/sfniface/interface.go index 61db2eaa05c..5149a3e308c 100644 --- a/service/sfn/sfniface/interface.go +++ b/service/sfn/sfniface/interface.go @@ -9,7 +9,6 @@ package sfniface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sfn" ) @@ -83,24 +82,12 @@ type SFNAPI interface { GetExecutionHistoryRequest(*sfn.GetExecutionHistoryInput) sfn.GetExecutionHistoryRequest - GetExecutionHistoryPages(*sfn.GetExecutionHistoryInput, func(*sfn.GetExecutionHistoryOutput, bool) bool) error - GetExecutionHistoryPagesWithContext(aws.Context, *sfn.GetExecutionHistoryInput, func(*sfn.GetExecutionHistoryOutput, bool) bool, ...aws.Option) error - ListActivitiesRequest(*sfn.ListActivitiesInput) sfn.ListActivitiesRequest - ListActivitiesPages(*sfn.ListActivitiesInput, func(*sfn.ListActivitiesOutput, bool) bool) error - ListActivitiesPagesWithContext(aws.Context, *sfn.ListActivitiesInput, func(*sfn.ListActivitiesOutput, bool) bool, ...aws.Option) error - ListExecutionsRequest(*sfn.ListExecutionsInput) sfn.ListExecutionsRequest - ListExecutionsPages(*sfn.ListExecutionsInput, func(*sfn.ListExecutionsOutput, bool) bool) error - ListExecutionsPagesWithContext(aws.Context, *sfn.ListExecutionsInput, func(*sfn.ListExecutionsOutput, bool) bool, ...aws.Option) error - ListStateMachinesRequest(*sfn.ListStateMachinesInput) sfn.ListStateMachinesRequest - ListStateMachinesPages(*sfn.ListStateMachinesInput, func(*sfn.ListStateMachinesOutput, bool) bool) error - ListStateMachinesPagesWithContext(aws.Context, *sfn.ListStateMachinesInput, func(*sfn.ListStateMachinesOutput, bool) bool, ...aws.Option) error - SendTaskFailureRequest(*sfn.SendTaskFailureInput) sfn.SendTaskFailureRequest SendTaskHeartbeatRequest(*sfn.SendTaskHeartbeatInput) sfn.SendTaskHeartbeatRequest diff --git a/service/shield/api.go b/service/shield/api.go index 607f319235e..e80fe5835c0 100644 --- a/service/shield/api.go +++ b/service/shield/api.go @@ -15,6 +15,7 @@ const opCreateProtection = "CreateProtection" type CreateProtectionRequest struct { *aws.Request Input *CreateProtectionInput + Copy func(*CreateProtectionInput) CreateProtectionRequest } // Send marshals and sends the CreateProtection API request. @@ -57,7 +58,7 @@ func (c *Shield) CreateProtectionRequest(input *CreateProtectionInput) CreatePro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateProtectionRequest{Request: req, Input: input} + return CreateProtectionRequest{Request: req, Input: input, Copy: c.CreateProtectionRequest} } const opCreateSubscription = "CreateSubscription" @@ -66,6 +67,7 @@ const opCreateSubscription = "CreateSubscription" type CreateSubscriptionRequest struct { *aws.Request Input *CreateSubscriptionInput + Copy func(*CreateSubscriptionInput) CreateSubscriptionRequest } // Send marshals and sends the CreateSubscription API request. @@ -106,7 +108,7 @@ func (c *Shield) CreateSubscriptionRequest(input *CreateSubscriptionInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSubscriptionRequest{Request: req, Input: input} + return CreateSubscriptionRequest{Request: req, Input: input, Copy: c.CreateSubscriptionRequest} } const opDeleteProtection = "DeleteProtection" @@ -115,6 +117,7 @@ const opDeleteProtection = "DeleteProtection" type DeleteProtectionRequest struct { *aws.Request Input *DeleteProtectionInput + Copy func(*DeleteProtectionInput) DeleteProtectionRequest } // Send marshals and sends the DeleteProtection API request. @@ -155,7 +158,7 @@ func (c *Shield) DeleteProtectionRequest(input *DeleteProtectionInput) DeletePro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteProtectionRequest{Request: req, Input: input} + return DeleteProtectionRequest{Request: req, Input: input, Copy: c.DeleteProtectionRequest} } const opDeleteSubscription = "DeleteSubscription" @@ -164,6 +167,7 @@ const opDeleteSubscription = "DeleteSubscription" type DeleteSubscriptionRequest struct { *aws.Request Input *DeleteSubscriptionInput + Copy func(*DeleteSubscriptionInput) DeleteSubscriptionRequest } // Send marshals and sends the DeleteSubscription API request. @@ -206,7 +210,7 @@ func (c *Shield) DeleteSubscriptionRequest(input *DeleteSubscriptionInput) Delet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSubscriptionRequest{Request: req, Input: input} + return DeleteSubscriptionRequest{Request: req, Input: input, Copy: c.DeleteSubscriptionRequest} } const opDescribeAttack = "DescribeAttack" @@ -215,6 +219,7 @@ const opDescribeAttack = "DescribeAttack" type DescribeAttackRequest struct { *aws.Request Input *DescribeAttackInput + Copy func(*DescribeAttackInput) DescribeAttackRequest } // Send marshals and sends the DescribeAttack API request. @@ -255,7 +260,7 @@ func (c *Shield) DescribeAttackRequest(input *DescribeAttackInput) DescribeAttac req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAttackRequest{Request: req, Input: input} + return DescribeAttackRequest{Request: req, Input: input, Copy: c.DescribeAttackRequest} } const opDescribeProtection = "DescribeProtection" @@ -264,6 +269,7 @@ const opDescribeProtection = "DescribeProtection" type DescribeProtectionRequest struct { *aws.Request Input *DescribeProtectionInput + Copy func(*DescribeProtectionInput) DescribeProtectionRequest } // Send marshals and sends the DescribeProtection API request. @@ -304,7 +310,7 @@ func (c *Shield) DescribeProtectionRequest(input *DescribeProtectionInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeProtectionRequest{Request: req, Input: input} + return DescribeProtectionRequest{Request: req, Input: input, Copy: c.DescribeProtectionRequest} } const opDescribeSubscription = "DescribeSubscription" @@ -313,6 +319,7 @@ const opDescribeSubscription = "DescribeSubscription" type DescribeSubscriptionRequest struct { *aws.Request Input *DescribeSubscriptionInput + Copy func(*DescribeSubscriptionInput) DescribeSubscriptionRequest } // Send marshals and sends the DescribeSubscription API request. @@ -353,7 +360,7 @@ func (c *Shield) DescribeSubscriptionRequest(input *DescribeSubscriptionInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSubscriptionRequest{Request: req, Input: input} + return DescribeSubscriptionRequest{Request: req, Input: input, Copy: c.DescribeSubscriptionRequest} } const opGetSubscriptionState = "GetSubscriptionState" @@ -362,6 +369,7 @@ const opGetSubscriptionState = "GetSubscriptionState" type GetSubscriptionStateRequest struct { *aws.Request Input *GetSubscriptionStateInput + Copy func(*GetSubscriptionStateInput) GetSubscriptionStateRequest } // Send marshals and sends the GetSubscriptionState API request. @@ -402,7 +410,7 @@ func (c *Shield) GetSubscriptionStateRequest(input *GetSubscriptionStateInput) G req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSubscriptionStateRequest{Request: req, Input: input} + return GetSubscriptionStateRequest{Request: req, Input: input, Copy: c.GetSubscriptionStateRequest} } const opListAttacks = "ListAttacks" @@ -411,6 +419,7 @@ const opListAttacks = "ListAttacks" type ListAttacksRequest struct { *aws.Request Input *ListAttacksInput + Copy func(*ListAttacksInput) ListAttacksRequest } // Send marshals and sends the ListAttacks API request. @@ -452,7 +461,7 @@ func (c *Shield) ListAttacksRequest(input *ListAttacksInput) ListAttacksRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAttacksRequest{Request: req, Input: input} + return ListAttacksRequest{Request: req, Input: input, Copy: c.ListAttacksRequest} } const opListProtections = "ListProtections" @@ -461,6 +470,7 @@ const opListProtections = "ListProtections" type ListProtectionsRequest struct { *aws.Request Input *ListProtectionsInput + Copy func(*ListProtectionsInput) ListProtectionsRequest } // Send marshals and sends the ListProtections API request. @@ -501,7 +511,7 @@ func (c *Shield) ListProtectionsRequest(input *ListProtectionsInput) ListProtect req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListProtectionsRequest{Request: req, Input: input} + return ListProtectionsRequest{Request: req, Input: input, Copy: c.ListProtectionsRequest} } // The details of a DDoS attack. diff --git a/service/simpledb/api.go b/service/simpledb/api.go index 6692226b1d3..fddf4334a0d 100644 --- a/service/simpledb/api.go +++ b/service/simpledb/api.go @@ -17,6 +17,7 @@ const opBatchDeleteAttributes = "BatchDeleteAttributes" type BatchDeleteAttributesRequest struct { *aws.Request Input *BatchDeleteAttributesInput + Copy func(*BatchDeleteAttributesInput) BatchDeleteAttributesRequest } // Send marshals and sends the BatchDeleteAttributes API request. @@ -80,7 +81,7 @@ func (c *SimpleDB) BatchDeleteAttributesRequest(input *BatchDeleteAttributesInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return BatchDeleteAttributesRequest{Request: req, Input: input} + return BatchDeleteAttributesRequest{Request: req, Input: input, Copy: c.BatchDeleteAttributesRequest} } const opBatchPutAttributes = "BatchPutAttributes" @@ -89,6 +90,7 @@ const opBatchPutAttributes = "BatchPutAttributes" type BatchPutAttributesRequest struct { *aws.Request Input *BatchPutAttributesInput + Copy func(*BatchPutAttributesInput) BatchPutAttributesRequest } // Send marshals and sends the BatchPutAttributes API request. @@ -171,7 +173,7 @@ func (c *SimpleDB) BatchPutAttributesRequest(input *BatchPutAttributesInput) Bat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return BatchPutAttributesRequest{Request: req, Input: input} + return BatchPutAttributesRequest{Request: req, Input: input, Copy: c.BatchPutAttributesRequest} } const opCreateDomain = "CreateDomain" @@ -180,6 +182,7 @@ const opCreateDomain = "CreateDomain" type CreateDomainRequest struct { *aws.Request Input *CreateDomainInput + Copy func(*CreateDomainInput) CreateDomainRequest } // Send marshals and sends the CreateDomain API request. @@ -228,7 +231,7 @@ func (c *SimpleDB) CreateDomainRequest(input *CreateDomainInput) CreateDomainReq req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return CreateDomainRequest{Request: req, Input: input} + return CreateDomainRequest{Request: req, Input: input, Copy: c.CreateDomainRequest} } const opDeleteAttributes = "DeleteAttributes" @@ -237,6 +240,7 @@ const opDeleteAttributes = "DeleteAttributes" type DeleteAttributesRequest struct { *aws.Request Input *DeleteAttributesInput + Copy func(*DeleteAttributesInput) DeleteAttributesRequest } // Send marshals and sends the DeleteAttributes API request. @@ -287,7 +291,7 @@ func (c *SimpleDB) DeleteAttributesRequest(input *DeleteAttributesInput) DeleteA req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteAttributesRequest{Request: req, Input: input} + return DeleteAttributesRequest{Request: req, Input: input, Copy: c.DeleteAttributesRequest} } const opDeleteDomain = "DeleteDomain" @@ -296,6 +300,7 @@ const opDeleteDomain = "DeleteDomain" type DeleteDomainRequest struct { *aws.Request Input *DeleteDomainInput + Copy func(*DeleteDomainInput) DeleteDomainRequest } // Send marshals and sends the DeleteDomain API request. @@ -341,7 +346,7 @@ func (c *SimpleDB) DeleteDomainRequest(input *DeleteDomainInput) DeleteDomainReq req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDomainRequest{Request: req, Input: input} + return DeleteDomainRequest{Request: req, Input: input, Copy: c.DeleteDomainRequest} } const opDomainMetadata = "DomainMetadata" @@ -350,6 +355,7 @@ const opDomainMetadata = "DomainMetadata" type DomainMetadataRequest struct { *aws.Request Input *DomainMetadataInput + Copy func(*DomainMetadataInput) DomainMetadataRequest } // Send marshals and sends the DomainMetadata API request. @@ -390,7 +396,7 @@ func (c *SimpleDB) DomainMetadataRequest(input *DomainMetadataInput) DomainMetad req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DomainMetadataRequest{Request: req, Input: input} + return DomainMetadataRequest{Request: req, Input: input, Copy: c.DomainMetadataRequest} } const opGetAttributes = "GetAttributes" @@ -399,6 +405,7 @@ const opGetAttributes = "GetAttributes" type GetAttributesRequest struct { *aws.Request Input *GetAttributesInput + Copy func(*GetAttributesInput) GetAttributesRequest } // Send marshals and sends the GetAttributes API request. @@ -446,7 +453,7 @@ func (c *SimpleDB) GetAttributesRequest(input *GetAttributesInput) GetAttributes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAttributesRequest{Request: req, Input: input} + return GetAttributesRequest{Request: req, Input: input, Copy: c.GetAttributesRequest} } const opListDomains = "ListDomains" @@ -455,6 +462,7 @@ const opListDomains = "ListDomains" type ListDomainsRequest struct { *aws.Request Input *ListDomainsInput + Copy func(*ListDomainsInput) ListDomainsRequest } // Send marshals and sends the ListDomains API request. @@ -504,57 +512,53 @@ func (c *SimpleDB) ListDomainsRequest(input *ListDomainsInput) ListDomainsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDomainsRequest{Request: req, Input: input} + return ListDomainsRequest{Request: req, Input: input, Copy: c.ListDomainsRequest} } -// ListDomainsPages iterates over the pages of a ListDomains operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDomains method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDomainsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDomains operation. -// pageNum := 0 -// err := client.ListDomainsPages(params, -// func(page *ListDomainsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListDomainsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SimpleDB) ListDomainsPages(input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool) error { - return c.ListDomainsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDomainsPagesWithContext same as ListDomainsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SimpleDB) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDomainsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDomainsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListDomainsRequest) Paginate(opts ...aws.Option) ListDomainsPager { + return ListDomainsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDomainsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDomainsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDomainsPager struct { + aws.Pager +} + +func (p *ListDomainsPager) CurrentPage() *ListDomainsOutput { + return p.Pager.CurrentPage().(*ListDomainsOutput) } const opPutAttributes = "PutAttributes" @@ -563,6 +567,7 @@ const opPutAttributes = "PutAttributes" type PutAttributesRequest struct { *aws.Request Input *PutAttributesInput + Copy func(*PutAttributesInput) PutAttributesRequest } // Send marshals and sends the PutAttributes API request. @@ -633,7 +638,7 @@ func (c *SimpleDB) PutAttributesRequest(input *PutAttributesInput) PutAttributes req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PutAttributesRequest{Request: req, Input: input} + return PutAttributesRequest{Request: req, Input: input, Copy: c.PutAttributesRequest} } const opSelect = "Select" @@ -642,6 +647,7 @@ const opSelect = "Select" type SelectRequest struct { *aws.Request Input *SelectInput + Copy func(*SelectInput) SelectRequest } // Send marshals and sends the Select API request. @@ -696,57 +702,53 @@ func (c *SimpleDB) SelectRequest(input *SelectInput) SelectRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SelectRequest{Request: req, Input: input} + return SelectRequest{Request: req, Input: input, Copy: c.SelectRequest} } -// SelectPages iterates over the pages of a Select operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Select method for more information on how to use this operation. +// Paginate pages iterates over the pages of a SelectRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a Select operation. -// pageNum := 0 -// err := client.SelectPages(params, -// func(page *SelectOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.SelectRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SimpleDB) SelectPages(input *SelectInput, fn func(*SelectOutput, bool) bool) error { - return c.SelectPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SelectPagesWithContext same as SelectPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SimpleDB) SelectPagesWithContext(ctx aws.Context, input *SelectInput, fn func(*SelectOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *SelectInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.SelectRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *SelectRequest) Paginate(opts ...aws.Option) SelectPager { + return SelectPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *SelectInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SelectOutput), !p.HasNextPage()) - } - return p.Err() +// SelectPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type SelectPager struct { + aws.Pager +} + +func (p *SelectPager) CurrentPage() *SelectOutput { + return p.Pager.CurrentPage().(*SelectOutput) } type Attribute struct { diff --git a/service/simpledb/simpledbiface/interface.go b/service/simpledb/simpledbiface/interface.go index e82bd85b07f..1bc0da70f1c 100644 --- a/service/simpledb/simpledbiface/interface.go +++ b/service/simpledb/simpledbiface/interface.go @@ -9,7 +9,6 @@ package simpledbiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/simpledb" ) @@ -79,15 +78,9 @@ type SimpleDBAPI interface { ListDomainsRequest(*simpledb.ListDomainsInput) simpledb.ListDomainsRequest - ListDomainsPages(*simpledb.ListDomainsInput, func(*simpledb.ListDomainsOutput, bool) bool) error - ListDomainsPagesWithContext(aws.Context, *simpledb.ListDomainsInput, func(*simpledb.ListDomainsOutput, bool) bool, ...aws.Option) error - PutAttributesRequest(*simpledb.PutAttributesInput) simpledb.PutAttributesRequest SelectRequest(*simpledb.SelectInput) simpledb.SelectRequest - - SelectPages(*simpledb.SelectInput, func(*simpledb.SelectOutput, bool) bool) error - SelectPagesWithContext(aws.Context, *simpledb.SelectInput, func(*simpledb.SelectOutput, bool) bool, ...aws.Option) error } var _ SimpleDBAPI = (*simpledb.SimpleDB)(nil) diff --git a/service/sms/api.go b/service/sms/api.go index c15031ebb0d..c9ce14d8664 100644 --- a/service/sms/api.go +++ b/service/sms/api.go @@ -15,6 +15,7 @@ const opCreateReplicationJob = "CreateReplicationJob" type CreateReplicationJobRequest struct { *aws.Request Input *CreateReplicationJobInput + Copy func(*CreateReplicationJobInput) CreateReplicationJobRequest } // Send marshals and sends the CreateReplicationJob API request. @@ -58,7 +59,7 @@ func (c *SMS) CreateReplicationJobRequest(input *CreateReplicationJobInput) Crea req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateReplicationJobRequest{Request: req, Input: input} + return CreateReplicationJobRequest{Request: req, Input: input, Copy: c.CreateReplicationJobRequest} } const opDeleteReplicationJob = "DeleteReplicationJob" @@ -67,6 +68,7 @@ const opDeleteReplicationJob = "DeleteReplicationJob" type DeleteReplicationJobRequest struct { *aws.Request Input *DeleteReplicationJobInput + Copy func(*DeleteReplicationJobInput) DeleteReplicationJobRequest } // Send marshals and sends the DeleteReplicationJob API request. @@ -110,7 +112,7 @@ func (c *SMS) DeleteReplicationJobRequest(input *DeleteReplicationJobInput) Dele req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteReplicationJobRequest{Request: req, Input: input} + return DeleteReplicationJobRequest{Request: req, Input: input, Copy: c.DeleteReplicationJobRequest} } const opDeleteServerCatalog = "DeleteServerCatalog" @@ -119,6 +121,7 @@ const opDeleteServerCatalog = "DeleteServerCatalog" type DeleteServerCatalogRequest struct { *aws.Request Input *DeleteServerCatalogInput + Copy func(*DeleteServerCatalogInput) DeleteServerCatalogRequest } // Send marshals and sends the DeleteServerCatalog API request. @@ -161,7 +164,7 @@ func (c *SMS) DeleteServerCatalogRequest(input *DeleteServerCatalogInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteServerCatalogRequest{Request: req, Input: input} + return DeleteServerCatalogRequest{Request: req, Input: input, Copy: c.DeleteServerCatalogRequest} } const opDisassociateConnector = "DisassociateConnector" @@ -170,6 +173,7 @@ const opDisassociateConnector = "DisassociateConnector" type DisassociateConnectorRequest struct { *aws.Request Input *DisassociateConnectorInput + Copy func(*DisassociateConnectorInput) DisassociateConnectorRequest } // Send marshals and sends the DisassociateConnector API request. @@ -211,7 +215,7 @@ func (c *SMS) DisassociateConnectorRequest(input *DisassociateConnectorInput) Di req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateConnectorRequest{Request: req, Input: input} + return DisassociateConnectorRequest{Request: req, Input: input, Copy: c.DisassociateConnectorRequest} } const opGetConnectors = "GetConnectors" @@ -220,6 +224,7 @@ const opGetConnectors = "GetConnectors" type GetConnectorsRequest struct { *aws.Request Input *GetConnectorsInput + Copy func(*GetConnectorsInput) GetConnectorsRequest } // Send marshals and sends the GetConnectors API request. @@ -267,57 +272,53 @@ func (c *SMS) GetConnectorsRequest(input *GetConnectorsInput) GetConnectorsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetConnectorsRequest{Request: req, Input: input} + return GetConnectorsRequest{Request: req, Input: input, Copy: c.GetConnectorsRequest} } -// GetConnectorsPages iterates over the pages of a GetConnectors operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetConnectors method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetConnectorsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetConnectors operation. -// pageNum := 0 -// err := client.GetConnectorsPages(params, -// func(page *GetConnectorsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetConnectorsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SMS) GetConnectorsPages(input *GetConnectorsInput, fn func(*GetConnectorsOutput, bool) bool) error { - return c.GetConnectorsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetConnectorsPagesWithContext same as GetConnectorsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SMS) GetConnectorsPagesWithContext(ctx aws.Context, input *GetConnectorsInput, fn func(*GetConnectorsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetConnectorsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetConnectorsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetConnectorsRequest) Paginate(opts ...aws.Option) GetConnectorsPager { + return GetConnectorsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetConnectorsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetConnectorsOutput), !p.HasNextPage()) - } - return p.Err() +// GetConnectorsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetConnectorsPager struct { + aws.Pager +} + +func (p *GetConnectorsPager) CurrentPage() *GetConnectorsOutput { + return p.Pager.CurrentPage().(*GetConnectorsOutput) } const opGetReplicationJobs = "GetReplicationJobs" @@ -326,6 +327,7 @@ const opGetReplicationJobs = "GetReplicationJobs" type GetReplicationJobsRequest struct { *aws.Request Input *GetReplicationJobsInput + Copy func(*GetReplicationJobsInput) GetReplicationJobsRequest } // Send marshals and sends the GetReplicationJobs API request. @@ -374,57 +376,53 @@ func (c *SMS) GetReplicationJobsRequest(input *GetReplicationJobsInput) GetRepli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetReplicationJobsRequest{Request: req, Input: input} + return GetReplicationJobsRequest{Request: req, Input: input, Copy: c.GetReplicationJobsRequest} } -// GetReplicationJobsPages iterates over the pages of a GetReplicationJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetReplicationJobs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetReplicationJobsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetReplicationJobs operation. -// pageNum := 0 -// err := client.GetReplicationJobsPages(params, -// func(page *GetReplicationJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetReplicationJobsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SMS) GetReplicationJobsPages(input *GetReplicationJobsInput, fn func(*GetReplicationJobsOutput, bool) bool) error { - return c.GetReplicationJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetReplicationJobsPagesWithContext same as GetReplicationJobsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SMS) GetReplicationJobsPagesWithContext(ctx aws.Context, input *GetReplicationJobsInput, fn func(*GetReplicationJobsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetReplicationJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetReplicationJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetReplicationJobsRequest) Paginate(opts ...aws.Option) GetReplicationJobsPager { + return GetReplicationJobsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetReplicationJobsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetReplicationJobsOutput), !p.HasNextPage()) - } - return p.Err() +// GetReplicationJobsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetReplicationJobsPager struct { + aws.Pager +} + +func (p *GetReplicationJobsPager) CurrentPage() *GetReplicationJobsOutput { + return p.Pager.CurrentPage().(*GetReplicationJobsOutput) } const opGetReplicationRuns = "GetReplicationRuns" @@ -433,6 +431,7 @@ const opGetReplicationRuns = "GetReplicationRuns" type GetReplicationRunsRequest struct { *aws.Request Input *GetReplicationRunsInput + Copy func(*GetReplicationRunsInput) GetReplicationRunsRequest } // Send marshals and sends the GetReplicationRuns API request. @@ -481,57 +480,53 @@ func (c *SMS) GetReplicationRunsRequest(input *GetReplicationRunsInput) GetRepli req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetReplicationRunsRequest{Request: req, Input: input} + return GetReplicationRunsRequest{Request: req, Input: input, Copy: c.GetReplicationRunsRequest} } -// GetReplicationRunsPages iterates over the pages of a GetReplicationRuns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetReplicationRuns method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetReplicationRunsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetReplicationRuns operation. -// pageNum := 0 -// err := client.GetReplicationRunsPages(params, -// func(page *GetReplicationRunsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetReplicationRunsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SMS) GetReplicationRunsPages(input *GetReplicationRunsInput, fn func(*GetReplicationRunsOutput, bool) bool) error { - return c.GetReplicationRunsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetReplicationRunsPagesWithContext same as GetReplicationRunsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SMS) GetReplicationRunsPagesWithContext(ctx aws.Context, input *GetReplicationRunsInput, fn func(*GetReplicationRunsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetReplicationRunsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetReplicationRunsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetReplicationRunsRequest) Paginate(opts ...aws.Option) GetReplicationRunsPager { + return GetReplicationRunsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetReplicationRunsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetReplicationRunsOutput), !p.HasNextPage()) - } - return p.Err() +// GetReplicationRunsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetReplicationRunsPager struct { + aws.Pager +} + +func (p *GetReplicationRunsPager) CurrentPage() *GetReplicationRunsOutput { + return p.Pager.CurrentPage().(*GetReplicationRunsOutput) } const opGetServers = "GetServers" @@ -540,6 +535,7 @@ const opGetServers = "GetServers" type GetServersRequest struct { *aws.Request Input *GetServersInput + Copy func(*GetServersInput) GetServersRequest } // Send marshals and sends the GetServers API request. @@ -587,57 +583,53 @@ func (c *SMS) GetServersRequest(input *GetServersInput) GetServersRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetServersRequest{Request: req, Input: input} + return GetServersRequest{Request: req, Input: input, Copy: c.GetServersRequest} } -// GetServersPages iterates over the pages of a GetServers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetServers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetServersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetServers operation. -// pageNum := 0 -// err := client.GetServersPages(params, -// func(page *GetServersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetServersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SMS) GetServersPages(input *GetServersInput, fn func(*GetServersOutput, bool) bool) error { - return c.GetServersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetServersPagesWithContext same as GetServersPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SMS) GetServersPagesWithContext(ctx aws.Context, input *GetServersInput, fn func(*GetServersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetServersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetServersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetServersRequest) Paginate(opts ...aws.Option) GetServersPager { + return GetServersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetServersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetServersOutput), !p.HasNextPage()) - } - return p.Err() +// GetServersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetServersPager struct { + aws.Pager +} + +func (p *GetServersPager) CurrentPage() *GetServersOutput { + return p.Pager.CurrentPage().(*GetServersOutput) } const opImportServerCatalog = "ImportServerCatalog" @@ -646,6 +638,7 @@ const opImportServerCatalog = "ImportServerCatalog" type ImportServerCatalogRequest struct { *aws.Request Input *ImportServerCatalogInput + Copy func(*ImportServerCatalogInput) ImportServerCatalogRequest } // Send marshals and sends the ImportServerCatalog API request. @@ -689,7 +682,7 @@ func (c *SMS) ImportServerCatalogRequest(input *ImportServerCatalogInput) Import req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ImportServerCatalogRequest{Request: req, Input: input} + return ImportServerCatalogRequest{Request: req, Input: input, Copy: c.ImportServerCatalogRequest} } const opStartOnDemandReplicationRun = "StartOnDemandReplicationRun" @@ -698,6 +691,7 @@ const opStartOnDemandReplicationRun = "StartOnDemandReplicationRun" type StartOnDemandReplicationRunRequest struct { *aws.Request Input *StartOnDemandReplicationRunInput + Copy func(*StartOnDemandReplicationRunInput) StartOnDemandReplicationRunRequest } // Send marshals and sends the StartOnDemandReplicationRun API request. @@ -742,7 +736,7 @@ func (c *SMS) StartOnDemandReplicationRunRequest(input *StartOnDemandReplication req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartOnDemandReplicationRunRequest{Request: req, Input: input} + return StartOnDemandReplicationRunRequest{Request: req, Input: input, Copy: c.StartOnDemandReplicationRunRequest} } const opUpdateReplicationJob = "UpdateReplicationJob" @@ -751,6 +745,7 @@ const opUpdateReplicationJob = "UpdateReplicationJob" type UpdateReplicationJobRequest struct { *aws.Request Input *UpdateReplicationJobInput + Copy func(*UpdateReplicationJobInput) UpdateReplicationJobRequest } // Send marshals and sends the UpdateReplicationJob API request. @@ -793,7 +788,7 @@ func (c *SMS) UpdateReplicationJobRequest(input *UpdateReplicationJobInput) Upda req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateReplicationJobRequest{Request: req, Input: input} + return UpdateReplicationJobRequest{Request: req, Input: input, Copy: c.UpdateReplicationJobRequest} } // Object representing a Connector diff --git a/service/sms/smsiface/interface.go b/service/sms/smsiface/interface.go index cdd0da0967a..dacbb95fc78 100644 --- a/service/sms/smsiface/interface.go +++ b/service/sms/smsiface/interface.go @@ -9,7 +9,6 @@ package smsiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sms" ) @@ -73,24 +72,12 @@ type SMSAPI interface { GetConnectorsRequest(*sms.GetConnectorsInput) sms.GetConnectorsRequest - GetConnectorsPages(*sms.GetConnectorsInput, func(*sms.GetConnectorsOutput, bool) bool) error - GetConnectorsPagesWithContext(aws.Context, *sms.GetConnectorsInput, func(*sms.GetConnectorsOutput, bool) bool, ...aws.Option) error - GetReplicationJobsRequest(*sms.GetReplicationJobsInput) sms.GetReplicationJobsRequest - GetReplicationJobsPages(*sms.GetReplicationJobsInput, func(*sms.GetReplicationJobsOutput, bool) bool) error - GetReplicationJobsPagesWithContext(aws.Context, *sms.GetReplicationJobsInput, func(*sms.GetReplicationJobsOutput, bool) bool, ...aws.Option) error - GetReplicationRunsRequest(*sms.GetReplicationRunsInput) sms.GetReplicationRunsRequest - GetReplicationRunsPages(*sms.GetReplicationRunsInput, func(*sms.GetReplicationRunsOutput, bool) bool) error - GetReplicationRunsPagesWithContext(aws.Context, *sms.GetReplicationRunsInput, func(*sms.GetReplicationRunsOutput, bool) bool, ...aws.Option) error - GetServersRequest(*sms.GetServersInput) sms.GetServersRequest - GetServersPages(*sms.GetServersInput, func(*sms.GetServersOutput, bool) bool) error - GetServersPagesWithContext(aws.Context, *sms.GetServersInput, func(*sms.GetServersOutput, bool) bool, ...aws.Option) error - ImportServerCatalogRequest(*sms.ImportServerCatalogInput) sms.ImportServerCatalogRequest StartOnDemandReplicationRunRequest(*sms.StartOnDemandReplicationRunInput) sms.StartOnDemandReplicationRunRequest diff --git a/service/snowball/api.go b/service/snowball/api.go index 4e15aaf2a6d..637823397e4 100644 --- a/service/snowball/api.go +++ b/service/snowball/api.go @@ -16,6 +16,7 @@ const opCancelCluster = "CancelCluster" type CancelClusterRequest struct { *aws.Request Input *CancelClusterInput + Copy func(*CancelClusterInput) CancelClusterRequest } // Send marshals and sends the CancelCluster API request. @@ -58,7 +59,7 @@ func (c *Snowball) CancelClusterRequest(input *CancelClusterInput) CancelCluster req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelClusterRequest{Request: req, Input: input} + return CancelClusterRequest{Request: req, Input: input, Copy: c.CancelClusterRequest} } const opCancelJob = "CancelJob" @@ -67,6 +68,7 @@ const opCancelJob = "CancelJob" type CancelJobRequest struct { *aws.Request Input *CancelJobInput + Copy func(*CancelJobInput) CancelJobRequest } // Send marshals and sends the CancelJob API request. @@ -110,7 +112,7 @@ func (c *Snowball) CancelJobRequest(input *CancelJobInput) CancelJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelJobRequest{Request: req, Input: input} + return CancelJobRequest{Request: req, Input: input, Copy: c.CancelJobRequest} } const opCreateAddress = "CreateAddress" @@ -119,6 +121,7 @@ const opCreateAddress = "CreateAddress" type CreateAddressRequest struct { *aws.Request Input *CreateAddressInput + Copy func(*CreateAddressInput) CreateAddressRequest } // Send marshals and sends the CreateAddress API request. @@ -162,7 +165,7 @@ func (c *Snowball) CreateAddressRequest(input *CreateAddressInput) CreateAddress req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAddressRequest{Request: req, Input: input} + return CreateAddressRequest{Request: req, Input: input, Copy: c.CreateAddressRequest} } const opCreateCluster = "CreateCluster" @@ -171,6 +174,7 @@ const opCreateCluster = "CreateCluster" type CreateClusterRequest struct { *aws.Request Input *CreateClusterInput + Copy func(*CreateClusterInput) CreateClusterRequest } // Send marshals and sends the CreateCluster API request. @@ -213,7 +217,7 @@ func (c *Snowball) CreateClusterRequest(input *CreateClusterInput) CreateCluster req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateClusterRequest{Request: req, Input: input} + return CreateClusterRequest{Request: req, Input: input, Copy: c.CreateClusterRequest} } const opCreateJob = "CreateJob" @@ -222,6 +226,7 @@ const opCreateJob = "CreateJob" type CreateJobRequest struct { *aws.Request Input *CreateJobInput + Copy func(*CreateJobInput) CreateJobRequest } // Send marshals and sends the CreateJob API request. @@ -266,7 +271,7 @@ func (c *Snowball) CreateJobRequest(input *CreateJobInput) CreateJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateJobRequest{Request: req, Input: input} + return CreateJobRequest{Request: req, Input: input, Copy: c.CreateJobRequest} } const opDescribeAddress = "DescribeAddress" @@ -275,6 +280,7 @@ const opDescribeAddress = "DescribeAddress" type DescribeAddressRequest struct { *aws.Request Input *DescribeAddressInput + Copy func(*DescribeAddressInput) DescribeAddressRequest } // Send marshals and sends the DescribeAddress API request. @@ -316,7 +322,7 @@ func (c *Snowball) DescribeAddressRequest(input *DescribeAddressInput) DescribeA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAddressRequest{Request: req, Input: input} + return DescribeAddressRequest{Request: req, Input: input, Copy: c.DescribeAddressRequest} } const opDescribeAddresses = "DescribeAddresses" @@ -325,6 +331,7 @@ const opDescribeAddresses = "DescribeAddresses" type DescribeAddressesRequest struct { *aws.Request Input *DescribeAddressesInput + Copy func(*DescribeAddressesInput) DescribeAddressesRequest } // Send marshals and sends the DescribeAddresses API request. @@ -373,57 +380,53 @@ func (c *Snowball) DescribeAddressesRequest(input *DescribeAddressesInput) Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAddressesRequest{Request: req, Input: input} + return DescribeAddressesRequest{Request: req, Input: input, Copy: c.DescribeAddressesRequest} } -// DescribeAddressesPages iterates over the pages of a DescribeAddresses operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAddresses method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeAddressesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeAddresses operation. -// pageNum := 0 -// err := client.DescribeAddressesPages(params, -// func(page *DescribeAddressesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Snowball) DescribeAddressesPages(input *DescribeAddressesInput, fn func(*DescribeAddressesOutput, bool) bool) error { - return c.DescribeAddressesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeAddressesPagesWithContext same as DescribeAddressesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Snowball) DescribeAddressesPagesWithContext(ctx aws.Context, input *DescribeAddressesInput, fn func(*DescribeAddressesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeAddressesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeAddressesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeAddressesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeAddressesRequest) Paginate(opts ...aws.Option) DescribeAddressesPager { + return DescribeAddressesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeAddressesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAddressesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeAddressesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeAddressesPager struct { + aws.Pager +} + +func (p *DescribeAddressesPager) CurrentPage() *DescribeAddressesOutput { + return p.Pager.CurrentPage().(*DescribeAddressesOutput) } const opDescribeCluster = "DescribeCluster" @@ -432,6 +435,7 @@ const opDescribeCluster = "DescribeCluster" type DescribeClusterRequest struct { *aws.Request Input *DescribeClusterInput + Copy func(*DescribeClusterInput) DescribeClusterRequest } // Send marshals and sends the DescribeCluster API request. @@ -473,7 +477,7 @@ func (c *Snowball) DescribeClusterRequest(input *DescribeClusterInput) DescribeC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeClusterRequest{Request: req, Input: input} + return DescribeClusterRequest{Request: req, Input: input, Copy: c.DescribeClusterRequest} } const opDescribeJob = "DescribeJob" @@ -482,6 +486,7 @@ const opDescribeJob = "DescribeJob" type DescribeJobRequest struct { *aws.Request Input *DescribeJobInput + Copy func(*DescribeJobInput) DescribeJobRequest } // Send marshals and sends the DescribeJob API request. @@ -523,7 +528,7 @@ func (c *Snowball) DescribeJobRequest(input *DescribeJobInput) DescribeJobReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeJobRequest{Request: req, Input: input} + return DescribeJobRequest{Request: req, Input: input, Copy: c.DescribeJobRequest} } const opGetJobManifest = "GetJobManifest" @@ -532,6 +537,7 @@ const opGetJobManifest = "GetJobManifest" type GetJobManifestRequest struct { *aws.Request Input *GetJobManifestInput + Copy func(*GetJobManifestInput) GetJobManifestRequest } // Send marshals and sends the GetJobManifest API request. @@ -589,7 +595,7 @@ func (c *Snowball) GetJobManifestRequest(input *GetJobManifestInput) GetJobManif req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobManifestRequest{Request: req, Input: input} + return GetJobManifestRequest{Request: req, Input: input, Copy: c.GetJobManifestRequest} } const opGetJobUnlockCode = "GetJobUnlockCode" @@ -598,6 +604,7 @@ const opGetJobUnlockCode = "GetJobUnlockCode" type GetJobUnlockCodeRequest struct { *aws.Request Input *GetJobUnlockCodeInput + Copy func(*GetJobUnlockCodeInput) GetJobUnlockCodeRequest } // Send marshals and sends the GetJobUnlockCode API request. @@ -650,7 +657,7 @@ func (c *Snowball) GetJobUnlockCodeRequest(input *GetJobUnlockCodeInput) GetJobU req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetJobUnlockCodeRequest{Request: req, Input: input} + return GetJobUnlockCodeRequest{Request: req, Input: input, Copy: c.GetJobUnlockCodeRequest} } const opGetSnowballUsage = "GetSnowballUsage" @@ -659,6 +666,7 @@ const opGetSnowballUsage = "GetSnowballUsage" type GetSnowballUsageRequest struct { *aws.Request Input *GetSnowballUsageInput + Copy func(*GetSnowballUsageInput) GetSnowballUsageRequest } // Send marshals and sends the GetSnowballUsage API request. @@ -703,7 +711,7 @@ func (c *Snowball) GetSnowballUsageRequest(input *GetSnowballUsageInput) GetSnow req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSnowballUsageRequest{Request: req, Input: input} + return GetSnowballUsageRequest{Request: req, Input: input, Copy: c.GetSnowballUsageRequest} } const opListClusterJobs = "ListClusterJobs" @@ -712,6 +720,7 @@ const opListClusterJobs = "ListClusterJobs" type ListClusterJobsRequest struct { *aws.Request Input *ListClusterJobsInput + Copy func(*ListClusterJobsInput) ListClusterJobsRequest } // Send marshals and sends the ListClusterJobs API request. @@ -754,7 +763,7 @@ func (c *Snowball) ListClusterJobsRequest(input *ListClusterJobsInput) ListClust req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListClusterJobsRequest{Request: req, Input: input} + return ListClusterJobsRequest{Request: req, Input: input, Copy: c.ListClusterJobsRequest} } const opListClusters = "ListClusters" @@ -763,6 +772,7 @@ const opListClusters = "ListClusters" type ListClustersRequest struct { *aws.Request Input *ListClustersInput + Copy func(*ListClustersInput) ListClustersRequest } // Send marshals and sends the ListClusters API request. @@ -805,7 +815,7 @@ func (c *Snowball) ListClustersRequest(input *ListClustersInput) ListClustersReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListClustersRequest{Request: req, Input: input} + return ListClustersRequest{Request: req, Input: input, Copy: c.ListClustersRequest} } const opListJobs = "ListJobs" @@ -814,6 +824,7 @@ const opListJobs = "ListJobs" type ListJobsRequest struct { *aws.Request Input *ListJobsInput + Copy func(*ListJobsInput) ListJobsRequest } // Send marshals and sends the ListJobs API request. @@ -864,57 +875,53 @@ func (c *Snowball) ListJobsRequest(input *ListJobsInput) ListJobsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListJobsRequest{Request: req, Input: input} + return ListJobsRequest{Request: req, Input: input, Copy: c.ListJobsRequest} } -// ListJobsPages iterates over the pages of a ListJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListJobs method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListJobsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListJobs operation. -// pageNum := 0 -// err := client.ListJobsPages(params, -// func(page *ListJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Snowball) ListJobsPages(input *ListJobsInput, fn func(*ListJobsOutput, bool) bool) error { - return c.ListJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListJobsPagesWithContext same as ListJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Snowball) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsInput, fn func(*ListJobsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListJobsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListJobsRequest) Paginate(opts ...aws.Option) ListJobsPager { + return ListJobsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListJobsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) - } - return p.Err() +// ListJobsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListJobsPager struct { + aws.Pager +} + +func (p *ListJobsPager) CurrentPage() *ListJobsOutput { + return p.Pager.CurrentPage().(*ListJobsOutput) } const opUpdateCluster = "UpdateCluster" @@ -923,6 +930,7 @@ const opUpdateCluster = "UpdateCluster" type UpdateClusterRequest struct { *aws.Request Input *UpdateClusterInput + Copy func(*UpdateClusterInput) UpdateClusterRequest } // Send marshals and sends the UpdateCluster API request. @@ -966,7 +974,7 @@ func (c *Snowball) UpdateClusterRequest(input *UpdateClusterInput) UpdateCluster req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateClusterRequest{Request: req, Input: input} + return UpdateClusterRequest{Request: req, Input: input, Copy: c.UpdateClusterRequest} } const opUpdateJob = "UpdateJob" @@ -975,6 +983,7 @@ const opUpdateJob = "UpdateJob" type UpdateJobRequest struct { *aws.Request Input *UpdateJobInput + Copy func(*UpdateJobInput) UpdateJobRequest } // Send marshals and sends the UpdateJob API request. @@ -1017,7 +1026,7 @@ func (c *Snowball) UpdateJobRequest(input *UpdateJobInput) UpdateJobRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateJobRequest{Request: req, Input: input} + return UpdateJobRequest{Request: req, Input: input, Copy: c.UpdateJobRequest} } // The address that you want the Snowball or Snowballs associated with a specific diff --git a/service/snowball/snowballiface/interface.go b/service/snowball/snowballiface/interface.go index 98ae75573c5..d01aeca4c17 100644 --- a/service/snowball/snowballiface/interface.go +++ b/service/snowball/snowballiface/interface.go @@ -9,7 +9,6 @@ package snowballiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/snowball" ) @@ -77,9 +76,6 @@ type SnowballAPI interface { DescribeAddressesRequest(*snowball.DescribeAddressesInput) snowball.DescribeAddressesRequest - DescribeAddressesPages(*snowball.DescribeAddressesInput, func(*snowball.DescribeAddressesOutput, bool) bool) error - DescribeAddressesPagesWithContext(aws.Context, *snowball.DescribeAddressesInput, func(*snowball.DescribeAddressesOutput, bool) bool, ...aws.Option) error - DescribeClusterRequest(*snowball.DescribeClusterInput) snowball.DescribeClusterRequest DescribeJobRequest(*snowball.DescribeJobInput) snowball.DescribeJobRequest @@ -96,9 +92,6 @@ type SnowballAPI interface { ListJobsRequest(*snowball.ListJobsInput) snowball.ListJobsRequest - ListJobsPages(*snowball.ListJobsInput, func(*snowball.ListJobsOutput, bool) bool) error - ListJobsPagesWithContext(aws.Context, *snowball.ListJobsInput, func(*snowball.ListJobsOutput, bool) bool, ...aws.Option) error - UpdateClusterRequest(*snowball.UpdateClusterInput) snowball.UpdateClusterRequest UpdateJobRequest(*snowball.UpdateJobInput) snowball.UpdateJobRequest diff --git a/service/sns/api.go b/service/sns/api.go index 2474d4adbd9..811313bd9e1 100644 --- a/service/sns/api.go +++ b/service/sns/api.go @@ -17,6 +17,7 @@ const opAddPermission = "AddPermission" type AddPermissionRequest struct { *aws.Request Input *AddPermissionInput + Copy func(*AddPermissionInput) AddPermissionRequest } // Send marshals and sends the AddPermission API request. @@ -60,7 +61,7 @@ func (c *SNS) AddPermissionRequest(input *AddPermissionInput) AddPermissionReque req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddPermissionRequest{Request: req, Input: input} + return AddPermissionRequest{Request: req, Input: input, Copy: c.AddPermissionRequest} } const opCheckIfPhoneNumberIsOptedOut = "CheckIfPhoneNumberIsOptedOut" @@ -69,6 +70,7 @@ const opCheckIfPhoneNumberIsOptedOut = "CheckIfPhoneNumberIsOptedOut" type CheckIfPhoneNumberIsOptedOutRequest struct { *aws.Request Input *CheckIfPhoneNumberIsOptedOutInput + Copy func(*CheckIfPhoneNumberIsOptedOutInput) CheckIfPhoneNumberIsOptedOutRequest } // Send marshals and sends the CheckIfPhoneNumberIsOptedOut API request. @@ -114,7 +116,7 @@ func (c *SNS) CheckIfPhoneNumberIsOptedOutRequest(input *CheckIfPhoneNumberIsOpt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CheckIfPhoneNumberIsOptedOutRequest{Request: req, Input: input} + return CheckIfPhoneNumberIsOptedOutRequest{Request: req, Input: input, Copy: c.CheckIfPhoneNumberIsOptedOutRequest} } const opConfirmSubscription = "ConfirmSubscription" @@ -123,6 +125,7 @@ const opConfirmSubscription = "ConfirmSubscription" type ConfirmSubscriptionRequest struct { *aws.Request Input *ConfirmSubscriptionInput + Copy func(*ConfirmSubscriptionInput) ConfirmSubscriptionRequest } // Send marshals and sends the ConfirmSubscription API request. @@ -167,7 +170,7 @@ func (c *SNS) ConfirmSubscriptionRequest(input *ConfirmSubscriptionInput) Confir req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ConfirmSubscriptionRequest{Request: req, Input: input} + return ConfirmSubscriptionRequest{Request: req, Input: input, Copy: c.ConfirmSubscriptionRequest} } const opCreatePlatformApplication = "CreatePlatformApplication" @@ -176,6 +179,7 @@ const opCreatePlatformApplication = "CreatePlatformApplication" type CreatePlatformApplicationRequest struct { *aws.Request Input *CreatePlatformApplicationInput + Copy func(*CreatePlatformApplicationInput) CreatePlatformApplicationRequest } // Send marshals and sends the CreatePlatformApplication API request. @@ -241,7 +245,7 @@ func (c *SNS) CreatePlatformApplicationRequest(input *CreatePlatformApplicationI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePlatformApplicationRequest{Request: req, Input: input} + return CreatePlatformApplicationRequest{Request: req, Input: input, Copy: c.CreatePlatformApplicationRequest} } const opCreatePlatformEndpoint = "CreatePlatformEndpoint" @@ -250,6 +254,7 @@ const opCreatePlatformEndpoint = "CreatePlatformEndpoint" type CreatePlatformEndpointRequest struct { *aws.Request Input *CreatePlatformEndpointInput + Copy func(*CreatePlatformEndpointInput) CreatePlatformEndpointRequest } // Send marshals and sends the CreatePlatformEndpoint API request. @@ -303,7 +308,7 @@ func (c *SNS) CreatePlatformEndpointRequest(input *CreatePlatformEndpointInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePlatformEndpointRequest{Request: req, Input: input} + return CreatePlatformEndpointRequest{Request: req, Input: input, Copy: c.CreatePlatformEndpointRequest} } const opCreateTopic = "CreateTopic" @@ -312,6 +317,7 @@ const opCreateTopic = "CreateTopic" type CreateTopicRequest struct { *aws.Request Input *CreateTopicInput + Copy func(*CreateTopicInput) CreateTopicRequest } // Send marshals and sends the CreateTopic API request. @@ -356,7 +362,7 @@ func (c *SNS) CreateTopicRequest(input *CreateTopicInput) CreateTopicRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTopicRequest{Request: req, Input: input} + return CreateTopicRequest{Request: req, Input: input, Copy: c.CreateTopicRequest} } const opDeleteEndpoint = "DeleteEndpoint" @@ -365,6 +371,7 @@ const opDeleteEndpoint = "DeleteEndpoint" type DeleteEndpointRequest struct { *aws.Request Input *DeleteEndpointInput + Copy func(*DeleteEndpointInput) DeleteEndpointRequest } // Send marshals and sends the DeleteEndpoint API request. @@ -412,7 +419,7 @@ func (c *SNS) DeleteEndpointRequest(input *DeleteEndpointInput) DeleteEndpointRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteEndpointRequest{Request: req, Input: input} + return DeleteEndpointRequest{Request: req, Input: input, Copy: c.DeleteEndpointRequest} } const opDeletePlatformApplication = "DeletePlatformApplication" @@ -421,6 +428,7 @@ const opDeletePlatformApplication = "DeletePlatformApplication" type DeletePlatformApplicationRequest struct { *aws.Request Input *DeletePlatformApplicationInput + Copy func(*DeletePlatformApplicationInput) DeletePlatformApplicationRequest } // Send marshals and sends the DeletePlatformApplication API request. @@ -465,7 +473,7 @@ func (c *SNS) DeletePlatformApplicationRequest(input *DeletePlatformApplicationI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeletePlatformApplicationRequest{Request: req, Input: input} + return DeletePlatformApplicationRequest{Request: req, Input: input, Copy: c.DeletePlatformApplicationRequest} } const opDeleteTopic = "DeleteTopic" @@ -474,6 +482,7 @@ const opDeleteTopic = "DeleteTopic" type DeleteTopicRequest struct { *aws.Request Input *DeleteTopicInput + Copy func(*DeleteTopicInput) DeleteTopicRequest } // Send marshals and sends the DeleteTopic API request. @@ -519,7 +528,7 @@ func (c *SNS) DeleteTopicRequest(input *DeleteTopicInput) DeleteTopicRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteTopicRequest{Request: req, Input: input} + return DeleteTopicRequest{Request: req, Input: input, Copy: c.DeleteTopicRequest} } const opGetEndpointAttributes = "GetEndpointAttributes" @@ -528,6 +537,7 @@ const opGetEndpointAttributes = "GetEndpointAttributes" type GetEndpointAttributesRequest struct { *aws.Request Input *GetEndpointAttributesInput + Copy func(*GetEndpointAttributesInput) GetEndpointAttributesRequest } // Send marshals and sends the GetEndpointAttributes API request. @@ -570,7 +580,7 @@ func (c *SNS) GetEndpointAttributesRequest(input *GetEndpointAttributesInput) Ge req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetEndpointAttributesRequest{Request: req, Input: input} + return GetEndpointAttributesRequest{Request: req, Input: input, Copy: c.GetEndpointAttributesRequest} } const opGetPlatformApplicationAttributes = "GetPlatformApplicationAttributes" @@ -579,6 +589,7 @@ const opGetPlatformApplicationAttributes = "GetPlatformApplicationAttributes" type GetPlatformApplicationAttributesRequest struct { *aws.Request Input *GetPlatformApplicationAttributesInput + Copy func(*GetPlatformApplicationAttributesInput) GetPlatformApplicationAttributesRequest } // Send marshals and sends the GetPlatformApplicationAttributes API request. @@ -621,7 +632,7 @@ func (c *SNS) GetPlatformApplicationAttributesRequest(input *GetPlatformApplicat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPlatformApplicationAttributesRequest{Request: req, Input: input} + return GetPlatformApplicationAttributesRequest{Request: req, Input: input, Copy: c.GetPlatformApplicationAttributesRequest} } const opGetSMSAttributes = "GetSMSAttributes" @@ -630,6 +641,7 @@ const opGetSMSAttributes = "GetSMSAttributes" type GetSMSAttributesRequest struct { *aws.Request Input *GetSMSAttributesInput + Copy func(*GetSMSAttributesInput) GetSMSAttributesRequest } // Send marshals and sends the GetSMSAttributes API request. @@ -672,7 +684,7 @@ func (c *SNS) GetSMSAttributesRequest(input *GetSMSAttributesInput) GetSMSAttrib req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSMSAttributesRequest{Request: req, Input: input} + return GetSMSAttributesRequest{Request: req, Input: input, Copy: c.GetSMSAttributesRequest} } const opGetSubscriptionAttributes = "GetSubscriptionAttributes" @@ -681,6 +693,7 @@ const opGetSubscriptionAttributes = "GetSubscriptionAttributes" type GetSubscriptionAttributesRequest struct { *aws.Request Input *GetSubscriptionAttributesInput + Copy func(*GetSubscriptionAttributesInput) GetSubscriptionAttributesRequest } // Send marshals and sends the GetSubscriptionAttributes API request. @@ -721,7 +734,7 @@ func (c *SNS) GetSubscriptionAttributesRequest(input *GetSubscriptionAttributesI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSubscriptionAttributesRequest{Request: req, Input: input} + return GetSubscriptionAttributesRequest{Request: req, Input: input, Copy: c.GetSubscriptionAttributesRequest} } const opGetTopicAttributes = "GetTopicAttributes" @@ -730,6 +743,7 @@ const opGetTopicAttributes = "GetTopicAttributes" type GetTopicAttributesRequest struct { *aws.Request Input *GetTopicAttributesInput + Copy func(*GetTopicAttributesInput) GetTopicAttributesRequest } // Send marshals and sends the GetTopicAttributes API request. @@ -771,7 +785,7 @@ func (c *SNS) GetTopicAttributesRequest(input *GetTopicAttributesInput) GetTopic req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTopicAttributesRequest{Request: req, Input: input} + return GetTopicAttributesRequest{Request: req, Input: input, Copy: c.GetTopicAttributesRequest} } const opListEndpointsByPlatformApplication = "ListEndpointsByPlatformApplication" @@ -780,6 +794,7 @@ const opListEndpointsByPlatformApplication = "ListEndpointsByPlatformApplication type ListEndpointsByPlatformApplicationRequest struct { *aws.Request Input *ListEndpointsByPlatformApplicationInput + Copy func(*ListEndpointsByPlatformApplicationInput) ListEndpointsByPlatformApplicationRequest } // Send marshals and sends the ListEndpointsByPlatformApplication API request. @@ -833,57 +848,53 @@ func (c *SNS) ListEndpointsByPlatformApplicationRequest(input *ListEndpointsByPl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListEndpointsByPlatformApplicationRequest{Request: req, Input: input} + return ListEndpointsByPlatformApplicationRequest{Request: req, Input: input, Copy: c.ListEndpointsByPlatformApplicationRequest} } -// ListEndpointsByPlatformApplicationPages iterates over the pages of a ListEndpointsByPlatformApplication operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEndpointsByPlatformApplication method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListEndpointsByPlatformApplicationRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListEndpointsByPlatformApplication operation. -// pageNum := 0 -// err := client.ListEndpointsByPlatformApplicationPages(params, -// func(page *ListEndpointsByPlatformApplicationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListEndpointsByPlatformApplicationRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SNS) ListEndpointsByPlatformApplicationPages(input *ListEndpointsByPlatformApplicationInput, fn func(*ListEndpointsByPlatformApplicationOutput, bool) bool) error { - return c.ListEndpointsByPlatformApplicationPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEndpointsByPlatformApplicationPagesWithContext same as ListEndpointsByPlatformApplicationPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SNS) ListEndpointsByPlatformApplicationPagesWithContext(ctx aws.Context, input *ListEndpointsByPlatformApplicationInput, fn func(*ListEndpointsByPlatformApplicationOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListEndpointsByPlatformApplicationInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListEndpointsByPlatformApplicationRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListEndpointsByPlatformApplicationRequest) Paginate(opts ...aws.Option) ListEndpointsByPlatformApplicationPager { + return ListEndpointsByPlatformApplicationPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListEndpointsByPlatformApplicationInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEndpointsByPlatformApplicationOutput), !p.HasNextPage()) - } - return p.Err() +// ListEndpointsByPlatformApplicationPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListEndpointsByPlatformApplicationPager struct { + aws.Pager +} + +func (p *ListEndpointsByPlatformApplicationPager) CurrentPage() *ListEndpointsByPlatformApplicationOutput { + return p.Pager.CurrentPage().(*ListEndpointsByPlatformApplicationOutput) } const opListPhoneNumbersOptedOut = "ListPhoneNumbersOptedOut" @@ -892,6 +903,7 @@ const opListPhoneNumbersOptedOut = "ListPhoneNumbersOptedOut" type ListPhoneNumbersOptedOutRequest struct { *aws.Request Input *ListPhoneNumbersOptedOutInput + Copy func(*ListPhoneNumbersOptedOutInput) ListPhoneNumbersOptedOutRequest } // Send marshals and sends the ListPhoneNumbersOptedOut API request. @@ -940,7 +952,7 @@ func (c *SNS) ListPhoneNumbersOptedOutRequest(input *ListPhoneNumbersOptedOutInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPhoneNumbersOptedOutRequest{Request: req, Input: input} + return ListPhoneNumbersOptedOutRequest{Request: req, Input: input, Copy: c.ListPhoneNumbersOptedOutRequest} } const opListPlatformApplications = "ListPlatformApplications" @@ -949,6 +961,7 @@ const opListPlatformApplications = "ListPlatformApplications" type ListPlatformApplicationsRequest struct { *aws.Request Input *ListPlatformApplicationsInput + Copy func(*ListPlatformApplicationsInput) ListPlatformApplicationsRequest } // Send marshals and sends the ListPlatformApplications API request. @@ -1002,57 +1015,53 @@ func (c *SNS) ListPlatformApplicationsRequest(input *ListPlatformApplicationsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListPlatformApplicationsRequest{Request: req, Input: input} + return ListPlatformApplicationsRequest{Request: req, Input: input, Copy: c.ListPlatformApplicationsRequest} } -// ListPlatformApplicationsPages iterates over the pages of a ListPlatformApplications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPlatformApplications method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListPlatformApplicationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListPlatformApplications operation. -// pageNum := 0 -// err := client.ListPlatformApplicationsPages(params, -// func(page *ListPlatformApplicationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListPlatformApplicationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SNS) ListPlatformApplicationsPages(input *ListPlatformApplicationsInput, fn func(*ListPlatformApplicationsOutput, bool) bool) error { - return c.ListPlatformApplicationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPlatformApplicationsPagesWithContext same as ListPlatformApplicationsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SNS) ListPlatformApplicationsPagesWithContext(ctx aws.Context, input *ListPlatformApplicationsInput, fn func(*ListPlatformApplicationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListPlatformApplicationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListPlatformApplicationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListPlatformApplicationsRequest) Paginate(opts ...aws.Option) ListPlatformApplicationsPager { + return ListPlatformApplicationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListPlatformApplicationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPlatformApplicationsOutput), !p.HasNextPage()) - } - return p.Err() +// ListPlatformApplicationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListPlatformApplicationsPager struct { + aws.Pager +} + +func (p *ListPlatformApplicationsPager) CurrentPage() *ListPlatformApplicationsOutput { + return p.Pager.CurrentPage().(*ListPlatformApplicationsOutput) } const opListSubscriptions = "ListSubscriptions" @@ -1061,6 +1070,7 @@ const opListSubscriptions = "ListSubscriptions" type ListSubscriptionsRequest struct { *aws.Request Input *ListSubscriptionsInput + Copy func(*ListSubscriptionsInput) ListSubscriptionsRequest } // Send marshals and sends the ListSubscriptions API request. @@ -1110,57 +1120,53 @@ func (c *SNS) ListSubscriptionsRequest(input *ListSubscriptionsInput) ListSubscr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSubscriptionsRequest{Request: req, Input: input} + return ListSubscriptionsRequest{Request: req, Input: input, Copy: c.ListSubscriptionsRequest} } -// ListSubscriptionsPages iterates over the pages of a ListSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscriptions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListSubscriptionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListSubscriptions operation. -// pageNum := 0 -// err := client.ListSubscriptionsPages(params, -// func(page *ListSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListSubscriptionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SNS) ListSubscriptionsPages(input *ListSubscriptionsInput, fn func(*ListSubscriptionsOutput, bool) bool) error { - return c.ListSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSubscriptionsPagesWithContext same as ListSubscriptionsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SNS) ListSubscriptionsPagesWithContext(ctx aws.Context, input *ListSubscriptionsInput, fn func(*ListSubscriptionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListSubscriptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListSubscriptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListSubscriptionsRequest) Paginate(opts ...aws.Option) ListSubscriptionsPager { + return ListSubscriptionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListSubscriptionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSubscriptionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListSubscriptionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListSubscriptionsPager struct { + aws.Pager +} + +func (p *ListSubscriptionsPager) CurrentPage() *ListSubscriptionsOutput { + return p.Pager.CurrentPage().(*ListSubscriptionsOutput) } const opListSubscriptionsByTopic = "ListSubscriptionsByTopic" @@ -1169,6 +1175,7 @@ const opListSubscriptionsByTopic = "ListSubscriptionsByTopic" type ListSubscriptionsByTopicRequest struct { *aws.Request Input *ListSubscriptionsByTopicInput + Copy func(*ListSubscriptionsByTopicInput) ListSubscriptionsByTopicRequest } // Send marshals and sends the ListSubscriptionsByTopic API request. @@ -1218,57 +1225,53 @@ func (c *SNS) ListSubscriptionsByTopicRequest(input *ListSubscriptionsByTopicInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSubscriptionsByTopicRequest{Request: req, Input: input} + return ListSubscriptionsByTopicRequest{Request: req, Input: input, Copy: c.ListSubscriptionsByTopicRequest} } -// ListSubscriptionsByTopicPages iterates over the pages of a ListSubscriptionsByTopic operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscriptionsByTopic method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListSubscriptionsByTopicRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListSubscriptionsByTopic operation. -// pageNum := 0 -// err := client.ListSubscriptionsByTopicPages(params, -// func(page *ListSubscriptionsByTopicOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListSubscriptionsByTopicRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SNS) ListSubscriptionsByTopicPages(input *ListSubscriptionsByTopicInput, fn func(*ListSubscriptionsByTopicOutput, bool) bool) error { - return c.ListSubscriptionsByTopicPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSubscriptionsByTopicPagesWithContext same as ListSubscriptionsByTopicPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SNS) ListSubscriptionsByTopicPagesWithContext(ctx aws.Context, input *ListSubscriptionsByTopicInput, fn func(*ListSubscriptionsByTopicOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListSubscriptionsByTopicInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListSubscriptionsByTopicRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListSubscriptionsByTopicRequest) Paginate(opts ...aws.Option) ListSubscriptionsByTopicPager { + return ListSubscriptionsByTopicPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListSubscriptionsByTopicInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSubscriptionsByTopicOutput), !p.HasNextPage()) - } - return p.Err() +// ListSubscriptionsByTopicPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListSubscriptionsByTopicPager struct { + aws.Pager +} + +func (p *ListSubscriptionsByTopicPager) CurrentPage() *ListSubscriptionsByTopicOutput { + return p.Pager.CurrentPage().(*ListSubscriptionsByTopicOutput) } const opListTopics = "ListTopics" @@ -1277,6 +1280,7 @@ const opListTopics = "ListTopics" type ListTopicsRequest struct { *aws.Request Input *ListTopicsInput + Copy func(*ListTopicsInput) ListTopicsRequest } // Send marshals and sends the ListTopics API request. @@ -1325,57 +1329,53 @@ func (c *SNS) ListTopicsRequest(input *ListTopicsInput) ListTopicsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTopicsRequest{Request: req, Input: input} + return ListTopicsRequest{Request: req, Input: input, Copy: c.ListTopicsRequest} } -// ListTopicsPages iterates over the pages of a ListTopics operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTopics method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListTopicsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListTopics operation. -// pageNum := 0 -// err := client.ListTopicsPages(params, -// func(page *ListTopicsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListTopicsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool) error { - return c.ListTopicsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTopicsPagesWithContext same as ListTopicsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SNS) ListTopicsPagesWithContext(ctx aws.Context, input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListTopicsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListTopicsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListTopicsRequest) Paginate(opts ...aws.Option) ListTopicsPager { + return ListTopicsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListTopicsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTopicsOutput), !p.HasNextPage()) - } - return p.Err() +// ListTopicsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListTopicsPager struct { + aws.Pager +} + +func (p *ListTopicsPager) CurrentPage() *ListTopicsOutput { + return p.Pager.CurrentPage().(*ListTopicsOutput) } const opOptInPhoneNumber = "OptInPhoneNumber" @@ -1384,6 +1384,7 @@ const opOptInPhoneNumber = "OptInPhoneNumber" type OptInPhoneNumberRequest struct { *aws.Request Input *OptInPhoneNumberInput + Copy func(*OptInPhoneNumberInput) OptInPhoneNumberRequest } // Send marshals and sends the OptInPhoneNumber API request. @@ -1427,7 +1428,7 @@ func (c *SNS) OptInPhoneNumberRequest(input *OptInPhoneNumberInput) OptInPhoneNu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return OptInPhoneNumberRequest{Request: req, Input: input} + return OptInPhoneNumberRequest{Request: req, Input: input, Copy: c.OptInPhoneNumberRequest} } const opPublish = "Publish" @@ -1436,6 +1437,7 @@ const opPublish = "Publish" type PublishRequest struct { *aws.Request Input *PublishInput + Copy func(*PublishInput) PublishRequest } // Send marshals and sends the Publish API request. @@ -1487,7 +1489,7 @@ func (c *SNS) PublishRequest(input *PublishInput) PublishRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PublishRequest{Request: req, Input: input} + return PublishRequest{Request: req, Input: input, Copy: c.PublishRequest} } const opRemovePermission = "RemovePermission" @@ -1496,6 +1498,7 @@ const opRemovePermission = "RemovePermission" type RemovePermissionRequest struct { *aws.Request Input *RemovePermissionInput + Copy func(*RemovePermissionInput) RemovePermissionRequest } // Send marshals and sends the RemovePermission API request. @@ -1538,7 +1541,7 @@ func (c *SNS) RemovePermissionRequest(input *RemovePermissionInput) RemovePermis req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemovePermissionRequest{Request: req, Input: input} + return RemovePermissionRequest{Request: req, Input: input, Copy: c.RemovePermissionRequest} } const opSetEndpointAttributes = "SetEndpointAttributes" @@ -1547,6 +1550,7 @@ const opSetEndpointAttributes = "SetEndpointAttributes" type SetEndpointAttributesRequest struct { *aws.Request Input *SetEndpointAttributesInput + Copy func(*SetEndpointAttributesInput) SetEndpointAttributesRequest } // Send marshals and sends the SetEndpointAttributes API request. @@ -1591,7 +1595,7 @@ func (c *SNS) SetEndpointAttributesRequest(input *SetEndpointAttributesInput) Se req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetEndpointAttributesRequest{Request: req, Input: input} + return SetEndpointAttributesRequest{Request: req, Input: input, Copy: c.SetEndpointAttributesRequest} } const opSetPlatformApplicationAttributes = "SetPlatformApplicationAttributes" @@ -1600,6 +1604,7 @@ const opSetPlatformApplicationAttributes = "SetPlatformApplicationAttributes" type SetPlatformApplicationAttributesRequest struct { *aws.Request Input *SetPlatformApplicationAttributesInput + Copy func(*SetPlatformApplicationAttributesInput) SetPlatformApplicationAttributesRequest } // Send marshals and sends the SetPlatformApplicationAttributes API request. @@ -1646,7 +1651,7 @@ func (c *SNS) SetPlatformApplicationAttributesRequest(input *SetPlatformApplicat req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetPlatformApplicationAttributesRequest{Request: req, Input: input} + return SetPlatformApplicationAttributesRequest{Request: req, Input: input, Copy: c.SetPlatformApplicationAttributesRequest} } const opSetSMSAttributes = "SetSMSAttributes" @@ -1655,6 +1660,7 @@ const opSetSMSAttributes = "SetSMSAttributes" type SetSMSAttributesRequest struct { *aws.Request Input *SetSMSAttributesInput + Copy func(*SetSMSAttributesInput) SetSMSAttributesRequest } // Send marshals and sends the SetSMSAttributes API request. @@ -1701,7 +1707,7 @@ func (c *SNS) SetSMSAttributesRequest(input *SetSMSAttributesInput) SetSMSAttrib req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetSMSAttributesRequest{Request: req, Input: input} + return SetSMSAttributesRequest{Request: req, Input: input, Copy: c.SetSMSAttributesRequest} } const opSetSubscriptionAttributes = "SetSubscriptionAttributes" @@ -1710,6 +1716,7 @@ const opSetSubscriptionAttributes = "SetSubscriptionAttributes" type SetSubscriptionAttributesRequest struct { *aws.Request Input *SetSubscriptionAttributesInput + Copy func(*SetSubscriptionAttributesInput) SetSubscriptionAttributesRequest } // Send marshals and sends the SetSubscriptionAttributes API request. @@ -1752,7 +1759,7 @@ func (c *SNS) SetSubscriptionAttributesRequest(input *SetSubscriptionAttributesI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetSubscriptionAttributesRequest{Request: req, Input: input} + return SetSubscriptionAttributesRequest{Request: req, Input: input, Copy: c.SetSubscriptionAttributesRequest} } const opSetTopicAttributes = "SetTopicAttributes" @@ -1761,6 +1768,7 @@ const opSetTopicAttributes = "SetTopicAttributes" type SetTopicAttributesRequest struct { *aws.Request Input *SetTopicAttributesInput + Copy func(*SetTopicAttributesInput) SetTopicAttributesRequest } // Send marshals and sends the SetTopicAttributes API request. @@ -1803,7 +1811,7 @@ func (c *SNS) SetTopicAttributesRequest(input *SetTopicAttributesInput) SetTopic req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetTopicAttributesRequest{Request: req, Input: input} + return SetTopicAttributesRequest{Request: req, Input: input, Copy: c.SetTopicAttributesRequest} } const opSubscribe = "Subscribe" @@ -1812,6 +1820,7 @@ const opSubscribe = "Subscribe" type SubscribeRequest struct { *aws.Request Input *SubscribeInput + Copy func(*SubscribeInput) SubscribeRequest } // Send marshals and sends the Subscribe API request. @@ -1855,7 +1864,7 @@ func (c *SNS) SubscribeRequest(input *SubscribeInput) SubscribeRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SubscribeRequest{Request: req, Input: input} + return SubscribeRequest{Request: req, Input: input, Copy: c.SubscribeRequest} } const opUnsubscribe = "Unsubscribe" @@ -1864,6 +1873,7 @@ const opUnsubscribe = "Unsubscribe" type UnsubscribeRequest struct { *aws.Request Input *UnsubscribeInput + Copy func(*UnsubscribeInput) UnsubscribeRequest } // Send marshals and sends the Unsubscribe API request. @@ -1911,7 +1921,7 @@ func (c *SNS) UnsubscribeRequest(input *UnsubscribeInput) UnsubscribeRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UnsubscribeRequest{Request: req, Input: input} + return UnsubscribeRequest{Request: req, Input: input, Copy: c.UnsubscribeRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/AddPermissionInput diff --git a/service/sns/snsiface/interface.go b/service/sns/snsiface/interface.go index 9f0eb059941..3dac285117b 100644 --- a/service/sns/snsiface/interface.go +++ b/service/sns/snsiface/interface.go @@ -9,7 +9,6 @@ package snsiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sns" ) @@ -93,31 +92,16 @@ type SNSAPI interface { ListEndpointsByPlatformApplicationRequest(*sns.ListEndpointsByPlatformApplicationInput) sns.ListEndpointsByPlatformApplicationRequest - ListEndpointsByPlatformApplicationPages(*sns.ListEndpointsByPlatformApplicationInput, func(*sns.ListEndpointsByPlatformApplicationOutput, bool) bool) error - ListEndpointsByPlatformApplicationPagesWithContext(aws.Context, *sns.ListEndpointsByPlatformApplicationInput, func(*sns.ListEndpointsByPlatformApplicationOutput, bool) bool, ...aws.Option) error - ListPhoneNumbersOptedOutRequest(*sns.ListPhoneNumbersOptedOutInput) sns.ListPhoneNumbersOptedOutRequest ListPlatformApplicationsRequest(*sns.ListPlatformApplicationsInput) sns.ListPlatformApplicationsRequest - ListPlatformApplicationsPages(*sns.ListPlatformApplicationsInput, func(*sns.ListPlatformApplicationsOutput, bool) bool) error - ListPlatformApplicationsPagesWithContext(aws.Context, *sns.ListPlatformApplicationsInput, func(*sns.ListPlatformApplicationsOutput, bool) bool, ...aws.Option) error - ListSubscriptionsRequest(*sns.ListSubscriptionsInput) sns.ListSubscriptionsRequest - ListSubscriptionsPages(*sns.ListSubscriptionsInput, func(*sns.ListSubscriptionsOutput, bool) bool) error - ListSubscriptionsPagesWithContext(aws.Context, *sns.ListSubscriptionsInput, func(*sns.ListSubscriptionsOutput, bool) bool, ...aws.Option) error - ListSubscriptionsByTopicRequest(*sns.ListSubscriptionsByTopicInput) sns.ListSubscriptionsByTopicRequest - ListSubscriptionsByTopicPages(*sns.ListSubscriptionsByTopicInput, func(*sns.ListSubscriptionsByTopicOutput, bool) bool) error - ListSubscriptionsByTopicPagesWithContext(aws.Context, *sns.ListSubscriptionsByTopicInput, func(*sns.ListSubscriptionsByTopicOutput, bool) bool, ...aws.Option) error - ListTopicsRequest(*sns.ListTopicsInput) sns.ListTopicsRequest - ListTopicsPages(*sns.ListTopicsInput, func(*sns.ListTopicsOutput, bool) bool) error - ListTopicsPagesWithContext(aws.Context, *sns.ListTopicsInput, func(*sns.ListTopicsOutput, bool) bool, ...aws.Option) error - OptInPhoneNumberRequest(*sns.OptInPhoneNumberInput) sns.OptInPhoneNumberRequest PublishRequest(*sns.PublishInput) sns.PublishRequest diff --git a/service/sqs/api.go b/service/sqs/api.go index 0967327614a..e1a3b57e1ae 100644 --- a/service/sqs/api.go +++ b/service/sqs/api.go @@ -17,6 +17,7 @@ const opAddPermission = "AddPermission" type AddPermissionRequest struct { *aws.Request Input *AddPermissionInput + Copy func(*AddPermissionInput) AddPermissionRequest } // Send marshals and sends the AddPermission API request. @@ -78,7 +79,7 @@ func (c *SQS) AddPermissionRequest(input *AddPermissionInput) AddPermissionReque req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AddPermissionRequest{Request: req, Input: input} + return AddPermissionRequest{Request: req, Input: input, Copy: c.AddPermissionRequest} } const opChangeMessageVisibility = "ChangeMessageVisibility" @@ -87,6 +88,7 @@ const opChangeMessageVisibility = "ChangeMessageVisibility" type ChangeMessageVisibilityRequest struct { *aws.Request Input *ChangeMessageVisibilityInput + Copy func(*ChangeMessageVisibilityInput) ChangeMessageVisibilityRequest } // Send marshals and sends the ChangeMessageVisibility API request. @@ -164,7 +166,7 @@ func (c *SQS) ChangeMessageVisibilityRequest(input *ChangeMessageVisibilityInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return ChangeMessageVisibilityRequest{Request: req, Input: input} + return ChangeMessageVisibilityRequest{Request: req, Input: input, Copy: c.ChangeMessageVisibilityRequest} } const opChangeMessageVisibilityBatch = "ChangeMessageVisibilityBatch" @@ -173,6 +175,7 @@ const opChangeMessageVisibilityBatch = "ChangeMessageVisibilityBatch" type ChangeMessageVisibilityBatchRequest struct { *aws.Request Input *ChangeMessageVisibilityBatchInput + Copy func(*ChangeMessageVisibilityBatchInput) ChangeMessageVisibilityBatchRequest } // Send marshals and sends the ChangeMessageVisibilityBatch API request. @@ -228,7 +231,7 @@ func (c *SQS) ChangeMessageVisibilityBatchRequest(input *ChangeMessageVisibility req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ChangeMessageVisibilityBatchRequest{Request: req, Input: input} + return ChangeMessageVisibilityBatchRequest{Request: req, Input: input, Copy: c.ChangeMessageVisibilityBatchRequest} } const opCreateQueue = "CreateQueue" @@ -237,6 +240,7 @@ const opCreateQueue = "CreateQueue" type CreateQueueRequest struct { *aws.Request Input *CreateQueueInput + Copy func(*CreateQueueInput) CreateQueueRequest } // Send marshals and sends the CreateQueue API request. @@ -316,7 +320,7 @@ func (c *SQS) CreateQueueRequest(input *CreateQueueInput) CreateQueueRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateQueueRequest{Request: req, Input: input} + return CreateQueueRequest{Request: req, Input: input, Copy: c.CreateQueueRequest} } const opDeleteMessage = "DeleteMessage" @@ -325,6 +329,7 @@ const opDeleteMessage = "DeleteMessage" type DeleteMessageRequest struct { *aws.Request Input *DeleteMessageInput + Copy func(*DeleteMessageInput) DeleteMessageRequest } // Send marshals and sends the DeleteMessage API request. @@ -386,7 +391,7 @@ func (c *SQS) DeleteMessageRequest(input *DeleteMessageInput) DeleteMessageReque req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteMessageRequest{Request: req, Input: input} + return DeleteMessageRequest{Request: req, Input: input, Copy: c.DeleteMessageRequest} } const opDeleteMessageBatch = "DeleteMessageBatch" @@ -395,6 +400,7 @@ const opDeleteMessageBatch = "DeleteMessageBatch" type DeleteMessageBatchRequest struct { *aws.Request Input *DeleteMessageBatchInput + Copy func(*DeleteMessageBatchInput) DeleteMessageBatchRequest } // Send marshals and sends the DeleteMessageBatch API request. @@ -449,7 +455,7 @@ func (c *SQS) DeleteMessageBatchRequest(input *DeleteMessageBatchInput) DeleteMe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteMessageBatchRequest{Request: req, Input: input} + return DeleteMessageBatchRequest{Request: req, Input: input, Copy: c.DeleteMessageBatchRequest} } const opDeleteQueue = "DeleteQueue" @@ -458,6 +464,7 @@ const opDeleteQueue = "DeleteQueue" type DeleteQueueRequest struct { *aws.Request Input *DeleteQueueInput + Copy func(*DeleteQueueInput) DeleteQueueRequest } // Send marshals and sends the DeleteQueue API request. @@ -512,7 +519,7 @@ func (c *SQS) DeleteQueueRequest(input *DeleteQueueInput) DeleteQueueRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteQueueRequest{Request: req, Input: input} + return DeleteQueueRequest{Request: req, Input: input, Copy: c.DeleteQueueRequest} } const opGetQueueAttributes = "GetQueueAttributes" @@ -521,6 +528,7 @@ const opGetQueueAttributes = "GetQueueAttributes" type GetQueueAttributesRequest struct { *aws.Request Input *GetQueueAttributesInput + Copy func(*GetQueueAttributesInput) GetQueueAttributesRequest } // Send marshals and sends the GetQueueAttributes API request. @@ -572,7 +580,7 @@ func (c *SQS) GetQueueAttributesRequest(input *GetQueueAttributesInput) GetQueue req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetQueueAttributesRequest{Request: req, Input: input} + return GetQueueAttributesRequest{Request: req, Input: input, Copy: c.GetQueueAttributesRequest} } const opGetQueueUrl = "GetQueueUrl" @@ -581,6 +589,7 @@ const opGetQueueUrl = "GetQueueUrl" type GetQueueUrlRequest struct { *aws.Request Input *GetQueueUrlInput + Copy func(*GetQueueUrlInput) GetQueueUrlRequest } // Send marshals and sends the GetQueueUrl API request. @@ -628,7 +637,7 @@ func (c *SQS) GetQueueUrlRequest(input *GetQueueUrlInput) GetQueueUrlRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetQueueUrlRequest{Request: req, Input: input} + return GetQueueUrlRequest{Request: req, Input: input, Copy: c.GetQueueUrlRequest} } const opListDeadLetterSourceQueues = "ListDeadLetterSourceQueues" @@ -637,6 +646,7 @@ const opListDeadLetterSourceQueues = "ListDeadLetterSourceQueues" type ListDeadLetterSourceQueuesRequest struct { *aws.Request Input *ListDeadLetterSourceQueuesInput + Copy func(*ListDeadLetterSourceQueuesInput) ListDeadLetterSourceQueuesRequest } // Send marshals and sends the ListDeadLetterSourceQueues API request. @@ -682,7 +692,7 @@ func (c *SQS) ListDeadLetterSourceQueuesRequest(input *ListDeadLetterSourceQueue req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDeadLetterSourceQueuesRequest{Request: req, Input: input} + return ListDeadLetterSourceQueuesRequest{Request: req, Input: input, Copy: c.ListDeadLetterSourceQueuesRequest} } const opListQueueTags = "ListQueueTags" @@ -691,6 +701,7 @@ const opListQueueTags = "ListQueueTags" type ListQueueTagsRequest struct { *aws.Request Input *ListQueueTagsInput + Copy func(*ListQueueTagsInput) ListQueueTagsRequest } // Send marshals and sends the ListQueueTags API request. @@ -751,7 +762,7 @@ func (c *SQS) ListQueueTagsRequest(input *ListQueueTagsInput) ListQueueTagsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListQueueTagsRequest{Request: req, Input: input} + return ListQueueTagsRequest{Request: req, Input: input, Copy: c.ListQueueTagsRequest} } const opListQueues = "ListQueues" @@ -760,6 +771,7 @@ const opListQueues = "ListQueues" type ListQueuesRequest struct { *aws.Request Input *ListQueuesInput + Copy func(*ListQueuesInput) ListQueuesRequest } // Send marshals and sends the ListQueues API request. @@ -802,7 +814,7 @@ func (c *SQS) ListQueuesRequest(input *ListQueuesInput) ListQueuesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListQueuesRequest{Request: req, Input: input} + return ListQueuesRequest{Request: req, Input: input, Copy: c.ListQueuesRequest} } const opPurgeQueue = "PurgeQueue" @@ -811,6 +823,7 @@ const opPurgeQueue = "PurgeQueue" type PurgeQueueRequest struct { *aws.Request Input *PurgeQueueInput + Copy func(*PurgeQueueInput) PurgeQueueRequest } // Send marshals and sends the PurgeQueue API request. @@ -862,7 +875,7 @@ func (c *SQS) PurgeQueueRequest(input *PurgeQueueInput) PurgeQueueRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return PurgeQueueRequest{Request: req, Input: input} + return PurgeQueueRequest{Request: req, Input: input, Copy: c.PurgeQueueRequest} } const opReceiveMessage = "ReceiveMessage" @@ -871,6 +884,7 @@ const opReceiveMessage = "ReceiveMessage" type ReceiveMessageRequest struct { *aws.Request Input *ReceiveMessageInput + Copy func(*ReceiveMessageInput) ReceiveMessageRequest } // Send marshals and sends the ReceiveMessage API request. @@ -957,7 +971,7 @@ func (c *SQS) ReceiveMessageRequest(input *ReceiveMessageInput) ReceiveMessageRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ReceiveMessageRequest{Request: req, Input: input} + return ReceiveMessageRequest{Request: req, Input: input, Copy: c.ReceiveMessageRequest} } const opRemovePermission = "RemovePermission" @@ -966,6 +980,7 @@ const opRemovePermission = "RemovePermission" type RemovePermissionRequest struct { *aws.Request Input *RemovePermissionInput + Copy func(*RemovePermissionInput) RemovePermissionRequest } // Send marshals and sends the RemovePermission API request. @@ -1009,7 +1024,7 @@ func (c *SQS) RemovePermissionRequest(input *RemovePermissionInput) RemovePermis req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemovePermissionRequest{Request: req, Input: input} + return RemovePermissionRequest{Request: req, Input: input, Copy: c.RemovePermissionRequest} } const opSendMessage = "SendMessage" @@ -1018,6 +1033,7 @@ const opSendMessage = "SendMessage" type SendMessageRequest struct { *aws.Request Input *SendMessageInput + Copy func(*SendMessageInput) SendMessageRequest } // Send marshals and sends the SendMessage API request. @@ -1066,7 +1082,7 @@ func (c *SQS) SendMessageRequest(input *SendMessageInput) SendMessageRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendMessageRequest{Request: req, Input: input} + return SendMessageRequest{Request: req, Input: input, Copy: c.SendMessageRequest} } const opSendMessageBatch = "SendMessageBatch" @@ -1075,6 +1091,7 @@ const opSendMessageBatch = "SendMessageBatch" type SendMessageBatchRequest struct { *aws.Request Input *SendMessageBatchInput + Copy func(*SendMessageBatchInput) SendMessageBatchRequest } // Send marshals and sends the SendMessageBatch API request. @@ -1145,7 +1162,7 @@ func (c *SQS) SendMessageBatchRequest(input *SendMessageBatchInput) SendMessageB req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendMessageBatchRequest{Request: req, Input: input} + return SendMessageBatchRequest{Request: req, Input: input, Copy: c.SendMessageBatchRequest} } const opSetQueueAttributes = "SetQueueAttributes" @@ -1154,6 +1171,7 @@ const opSetQueueAttributes = "SetQueueAttributes" type SetQueueAttributesRequest struct { *aws.Request Input *SetQueueAttributesInput + Copy func(*SetQueueAttributesInput) SetQueueAttributesRequest } // Send marshals and sends the SetQueueAttributes API request. @@ -1203,7 +1221,7 @@ func (c *SQS) SetQueueAttributesRequest(input *SetQueueAttributesInput) SetQueue req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SetQueueAttributesRequest{Request: req, Input: input} + return SetQueueAttributesRequest{Request: req, Input: input, Copy: c.SetQueueAttributesRequest} } const opTagQueue = "TagQueue" @@ -1212,6 +1230,7 @@ const opTagQueue = "TagQueue" type TagQueueRequest struct { *aws.Request Input *TagQueueInput + Copy func(*TagQueueInput) TagQueueRequest } // Send marshals and sends the TagQueue API request. @@ -1274,7 +1293,7 @@ func (c *SQS) TagQueueRequest(input *TagQueueInput) TagQueueRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TagQueueRequest{Request: req, Input: input} + return TagQueueRequest{Request: req, Input: input, Copy: c.TagQueueRequest} } const opUntagQueue = "UntagQueue" @@ -1283,6 +1302,7 @@ const opUntagQueue = "UntagQueue" type UntagQueueRequest struct { *aws.Request Input *UntagQueueInput + Copy func(*UntagQueueInput) UntagQueueRequest } // Send marshals and sends the UntagQueue API request. @@ -1345,7 +1365,7 @@ func (c *SQS) UntagQueueRequest(input *UntagQueueInput) UntagQueueRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UntagQueueRequest{Request: req, Input: input} + return UntagQueueRequest{Request: req, Input: input, Copy: c.UntagQueueRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermissionRequest diff --git a/service/ssm/api.go b/service/ssm/api.go index 90cdfd65404..300e8e967ea 100644 --- a/service/ssm/api.go +++ b/service/ssm/api.go @@ -16,6 +16,7 @@ const opAddTagsToResource = "AddTagsToResource" type AddTagsToResourceRequest struct { *aws.Request Input *AddTagsToResourceInput + Copy func(*AddTagsToResourceInput) AddTagsToResourceRequest } // Send marshals and sends the AddTagsToResource API request. @@ -75,7 +76,7 @@ func (c *SSM) AddTagsToResourceRequest(input *AddTagsToResourceInput) AddTagsToR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsToResourceRequest{Request: req, Input: input} + return AddTagsToResourceRequest{Request: req, Input: input, Copy: c.AddTagsToResourceRequest} } const opCancelCommand = "CancelCommand" @@ -84,6 +85,7 @@ const opCancelCommand = "CancelCommand" type CancelCommandRequest struct { *aws.Request Input *CancelCommandInput + Copy func(*CancelCommandInput) CancelCommandRequest } // Send marshals and sends the CancelCommand API request. @@ -125,7 +127,7 @@ func (c *SSM) CancelCommandRequest(input *CancelCommandInput) CancelCommandReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelCommandRequest{Request: req, Input: input} + return CancelCommandRequest{Request: req, Input: input, Copy: c.CancelCommandRequest} } const opCreateActivation = "CreateActivation" @@ -134,6 +136,7 @@ const opCreateActivation = "CreateActivation" type CreateActivationRequest struct { *aws.Request Input *CreateActivationInput + Copy func(*CreateActivationInput) CreateActivationRequest } // Send marshals and sends the CreateActivation API request. @@ -178,7 +181,7 @@ func (c *SSM) CreateActivationRequest(input *CreateActivationInput) CreateActiva req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateActivationRequest{Request: req, Input: input} + return CreateActivationRequest{Request: req, Input: input, Copy: c.CreateActivationRequest} } const opCreateAssociation = "CreateAssociation" @@ -187,6 +190,7 @@ const opCreateAssociation = "CreateAssociation" type CreateAssociationRequest struct { *aws.Request Input *CreateAssociationInput + Copy func(*CreateAssociationInput) CreateAssociationRequest } // Send marshals and sends the CreateAssociation API request. @@ -235,7 +239,7 @@ func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) CreateAsso req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAssociationRequest{Request: req, Input: input} + return CreateAssociationRequest{Request: req, Input: input, Copy: c.CreateAssociationRequest} } const opCreateAssociationBatch = "CreateAssociationBatch" @@ -244,6 +248,7 @@ const opCreateAssociationBatch = "CreateAssociationBatch" type CreateAssociationBatchRequest struct { *aws.Request Input *CreateAssociationBatchInput + Copy func(*CreateAssociationBatchInput) CreateAssociationBatchRequest } // Send marshals and sends the CreateAssociationBatch API request. @@ -292,7 +297,7 @@ func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAssociationBatchRequest{Request: req, Input: input} + return CreateAssociationBatchRequest{Request: req, Input: input, Copy: c.CreateAssociationBatchRequest} } const opCreateDocument = "CreateDocument" @@ -301,6 +306,7 @@ const opCreateDocument = "CreateDocument" type CreateDocumentRequest struct { *aws.Request Input *CreateDocumentInput + Copy func(*CreateDocumentInput) CreateDocumentRequest } // Send marshals and sends the CreateDocument API request. @@ -344,7 +350,7 @@ func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) CreateDocumentRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateDocumentRequest{Request: req, Input: input} + return CreateDocumentRequest{Request: req, Input: input, Copy: c.CreateDocumentRequest} } const opCreateMaintenanceWindow = "CreateMaintenanceWindow" @@ -353,6 +359,7 @@ const opCreateMaintenanceWindow = "CreateMaintenanceWindow" type CreateMaintenanceWindowRequest struct { *aws.Request Input *CreateMaintenanceWindowInput + Copy func(*CreateMaintenanceWindowInput) CreateMaintenanceWindowRequest } // Send marshals and sends the CreateMaintenanceWindow API request. @@ -393,7 +400,7 @@ func (c *SSM) CreateMaintenanceWindowRequest(input *CreateMaintenanceWindowInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateMaintenanceWindowRequest{Request: req, Input: input} + return CreateMaintenanceWindowRequest{Request: req, Input: input, Copy: c.CreateMaintenanceWindowRequest} } const opCreatePatchBaseline = "CreatePatchBaseline" @@ -402,6 +409,7 @@ const opCreatePatchBaseline = "CreatePatchBaseline" type CreatePatchBaselineRequest struct { *aws.Request Input *CreatePatchBaselineInput + Copy func(*CreatePatchBaselineInput) CreatePatchBaselineRequest } // Send marshals and sends the CreatePatchBaseline API request. @@ -445,7 +453,7 @@ func (c *SSM) CreatePatchBaselineRequest(input *CreatePatchBaselineInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreatePatchBaselineRequest{Request: req, Input: input} + return CreatePatchBaselineRequest{Request: req, Input: input, Copy: c.CreatePatchBaselineRequest} } const opCreateResourceDataSync = "CreateResourceDataSync" @@ -454,6 +462,7 @@ const opCreateResourceDataSync = "CreateResourceDataSync" type CreateResourceDataSyncRequest struct { *aws.Request Input *CreateResourceDataSyncInput + Copy func(*CreateResourceDataSyncInput) CreateResourceDataSyncRequest } // Send marshals and sends the CreateResourceDataSync API request. @@ -504,7 +513,7 @@ func (c *SSM) CreateResourceDataSyncRequest(input *CreateResourceDataSyncInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateResourceDataSyncRequest{Request: req, Input: input} + return CreateResourceDataSyncRequest{Request: req, Input: input, Copy: c.CreateResourceDataSyncRequest} } const opDeleteActivation = "DeleteActivation" @@ -513,6 +522,7 @@ const opDeleteActivation = "DeleteActivation" type DeleteActivationRequest struct { *aws.Request Input *DeleteActivationInput + Copy func(*DeleteActivationInput) DeleteActivationRequest } // Send marshals and sends the DeleteActivation API request. @@ -556,7 +566,7 @@ func (c *SSM) DeleteActivationRequest(input *DeleteActivationInput) DeleteActiva req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteActivationRequest{Request: req, Input: input} + return DeleteActivationRequest{Request: req, Input: input, Copy: c.DeleteActivationRequest} } const opDeleteAssociation = "DeleteAssociation" @@ -565,6 +575,7 @@ const opDeleteAssociation = "DeleteAssociation" type DeleteAssociationRequest struct { *aws.Request Input *DeleteAssociationInput + Copy func(*DeleteAssociationInput) DeleteAssociationRequest } // Send marshals and sends the DeleteAssociation API request. @@ -610,7 +621,7 @@ func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) DeleteAsso req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteAssociationRequest{Request: req, Input: input} + return DeleteAssociationRequest{Request: req, Input: input, Copy: c.DeleteAssociationRequest} } const opDeleteDocument = "DeleteDocument" @@ -619,6 +630,7 @@ const opDeleteDocument = "DeleteDocument" type DeleteDocumentRequest struct { *aws.Request Input *DeleteDocumentInput + Copy func(*DeleteDocumentInput) DeleteDocumentRequest } // Send marshals and sends the DeleteDocument API request. @@ -663,7 +675,7 @@ func (c *SSM) DeleteDocumentRequest(input *DeleteDocumentInput) DeleteDocumentRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteDocumentRequest{Request: req, Input: input} + return DeleteDocumentRequest{Request: req, Input: input, Copy: c.DeleteDocumentRequest} } const opDeleteMaintenanceWindow = "DeleteMaintenanceWindow" @@ -672,6 +684,7 @@ const opDeleteMaintenanceWindow = "DeleteMaintenanceWindow" type DeleteMaintenanceWindowRequest struct { *aws.Request Input *DeleteMaintenanceWindowInput + Copy func(*DeleteMaintenanceWindowInput) DeleteMaintenanceWindowRequest } // Send marshals and sends the DeleteMaintenanceWindow API request. @@ -712,7 +725,7 @@ func (c *SSM) DeleteMaintenanceWindowRequest(input *DeleteMaintenanceWindowInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteMaintenanceWindowRequest{Request: req, Input: input} + return DeleteMaintenanceWindowRequest{Request: req, Input: input, Copy: c.DeleteMaintenanceWindowRequest} } const opDeleteParameter = "DeleteParameter" @@ -721,6 +734,7 @@ const opDeleteParameter = "DeleteParameter" type DeleteParameterRequest struct { *aws.Request Input *DeleteParameterInput + Copy func(*DeleteParameterInput) DeleteParameterRequest } // Send marshals and sends the DeleteParameter API request. @@ -761,7 +775,7 @@ func (c *SSM) DeleteParameterRequest(input *DeleteParameterInput) DeleteParamete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteParameterRequest{Request: req, Input: input} + return DeleteParameterRequest{Request: req, Input: input, Copy: c.DeleteParameterRequest} } const opDeleteParameters = "DeleteParameters" @@ -770,6 +784,7 @@ const opDeleteParameters = "DeleteParameters" type DeleteParametersRequest struct { *aws.Request Input *DeleteParametersInput + Copy func(*DeleteParametersInput) DeleteParametersRequest } // Send marshals and sends the DeleteParameters API request. @@ -811,7 +826,7 @@ func (c *SSM) DeleteParametersRequest(input *DeleteParametersInput) DeleteParame req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteParametersRequest{Request: req, Input: input} + return DeleteParametersRequest{Request: req, Input: input, Copy: c.DeleteParametersRequest} } const opDeletePatchBaseline = "DeletePatchBaseline" @@ -820,6 +835,7 @@ const opDeletePatchBaseline = "DeletePatchBaseline" type DeletePatchBaselineRequest struct { *aws.Request Input *DeletePatchBaselineInput + Copy func(*DeletePatchBaselineInput) DeletePatchBaselineRequest } // Send marshals and sends the DeletePatchBaseline API request. @@ -860,7 +876,7 @@ func (c *SSM) DeletePatchBaselineRequest(input *DeletePatchBaselineInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeletePatchBaselineRequest{Request: req, Input: input} + return DeletePatchBaselineRequest{Request: req, Input: input, Copy: c.DeletePatchBaselineRequest} } const opDeleteResourceDataSync = "DeleteResourceDataSync" @@ -869,6 +885,7 @@ const opDeleteResourceDataSync = "DeleteResourceDataSync" type DeleteResourceDataSyncRequest struct { *aws.Request Input *DeleteResourceDataSyncInput + Copy func(*DeleteResourceDataSyncInput) DeleteResourceDataSyncRequest } // Send marshals and sends the DeleteResourceDataSync API request. @@ -912,7 +929,7 @@ func (c *SSM) DeleteResourceDataSyncRequest(input *DeleteResourceDataSyncInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteResourceDataSyncRequest{Request: req, Input: input} + return DeleteResourceDataSyncRequest{Request: req, Input: input, Copy: c.DeleteResourceDataSyncRequest} } const opDeregisterManagedInstance = "DeregisterManagedInstance" @@ -921,6 +938,7 @@ const opDeregisterManagedInstance = "DeregisterManagedInstance" type DeregisterManagedInstanceRequest struct { *aws.Request Input *DeregisterManagedInstanceInput + Copy func(*DeregisterManagedInstanceInput) DeregisterManagedInstanceRequest } // Send marshals and sends the DeregisterManagedInstance API request. @@ -963,7 +981,7 @@ func (c *SSM) DeregisterManagedInstanceRequest(input *DeregisterManagedInstanceI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterManagedInstanceRequest{Request: req, Input: input} + return DeregisterManagedInstanceRequest{Request: req, Input: input, Copy: c.DeregisterManagedInstanceRequest} } const opDeregisterPatchBaselineForPatchGroup = "DeregisterPatchBaselineForPatchGroup" @@ -972,6 +990,7 @@ const opDeregisterPatchBaselineForPatchGroup = "DeregisterPatchBaselineForPatchG type DeregisterPatchBaselineForPatchGroupRequest struct { *aws.Request Input *DeregisterPatchBaselineForPatchGroupInput + Copy func(*DeregisterPatchBaselineForPatchGroupInput) DeregisterPatchBaselineForPatchGroupRequest } // Send marshals and sends the DeregisterPatchBaselineForPatchGroup API request. @@ -1012,7 +1031,7 @@ func (c *SSM) DeregisterPatchBaselineForPatchGroupRequest(input *DeregisterPatch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterPatchBaselineForPatchGroupRequest{Request: req, Input: input} + return DeregisterPatchBaselineForPatchGroupRequest{Request: req, Input: input, Copy: c.DeregisterPatchBaselineForPatchGroupRequest} } const opDeregisterTargetFromMaintenanceWindow = "DeregisterTargetFromMaintenanceWindow" @@ -1021,6 +1040,7 @@ const opDeregisterTargetFromMaintenanceWindow = "DeregisterTargetFromMaintenance type DeregisterTargetFromMaintenanceWindowRequest struct { *aws.Request Input *DeregisterTargetFromMaintenanceWindowInput + Copy func(*DeregisterTargetFromMaintenanceWindowInput) DeregisterTargetFromMaintenanceWindowRequest } // Send marshals and sends the DeregisterTargetFromMaintenanceWindow API request. @@ -1061,7 +1081,7 @@ func (c *SSM) DeregisterTargetFromMaintenanceWindowRequest(input *DeregisterTarg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterTargetFromMaintenanceWindowRequest{Request: req, Input: input} + return DeregisterTargetFromMaintenanceWindowRequest{Request: req, Input: input, Copy: c.DeregisterTargetFromMaintenanceWindowRequest} } const opDeregisterTaskFromMaintenanceWindow = "DeregisterTaskFromMaintenanceWindow" @@ -1070,6 +1090,7 @@ const opDeregisterTaskFromMaintenanceWindow = "DeregisterTaskFromMaintenanceWind type DeregisterTaskFromMaintenanceWindowRequest struct { *aws.Request Input *DeregisterTaskFromMaintenanceWindowInput + Copy func(*DeregisterTaskFromMaintenanceWindowInput) DeregisterTaskFromMaintenanceWindowRequest } // Send marshals and sends the DeregisterTaskFromMaintenanceWindow API request. @@ -1110,7 +1131,7 @@ func (c *SSM) DeregisterTaskFromMaintenanceWindowRequest(input *DeregisterTaskFr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterTaskFromMaintenanceWindowRequest{Request: req, Input: input} + return DeregisterTaskFromMaintenanceWindowRequest{Request: req, Input: input, Copy: c.DeregisterTaskFromMaintenanceWindowRequest} } const opDescribeActivations = "DescribeActivations" @@ -1119,6 +1140,7 @@ const opDescribeActivations = "DescribeActivations" type DescribeActivationsRequest struct { *aws.Request Input *DescribeActivationsInput + Copy func(*DescribeActivationsInput) DescribeActivationsRequest } // Send marshals and sends the DescribeActivations API request. @@ -1167,57 +1189,53 @@ func (c *SSM) DescribeActivationsRequest(input *DescribeActivationsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeActivationsRequest{Request: req, Input: input} + return DescribeActivationsRequest{Request: req, Input: input, Copy: c.DescribeActivationsRequest} } -// DescribeActivationsPages iterates over the pages of a DescribeActivations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeActivations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeActivationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeActivations operation. -// pageNum := 0 -// err := client.DescribeActivationsPages(params, -// func(page *DescribeActivationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) DescribeActivationsPages(input *DescribeActivationsInput, fn func(*DescribeActivationsOutput, bool) bool) error { - return c.DescribeActivationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeActivationsPagesWithContext same as DescribeActivationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SSM) DescribeActivationsPagesWithContext(ctx aws.Context, input *DescribeActivationsInput, fn func(*DescribeActivationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeActivationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeActivationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeActivationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeActivationsRequest) Paginate(opts ...aws.Option) DescribeActivationsPager { + return DescribeActivationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeActivationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeActivationsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeActivationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeActivationsPager struct { + aws.Pager +} + +func (p *DescribeActivationsPager) CurrentPage() *DescribeActivationsOutput { + return p.Pager.CurrentPage().(*DescribeActivationsOutput) } const opDescribeAssociation = "DescribeAssociation" @@ -1226,6 +1244,7 @@ const opDescribeAssociation = "DescribeAssociation" type DescribeAssociationRequest struct { *aws.Request Input *DescribeAssociationInput + Copy func(*DescribeAssociationInput) DescribeAssociationRequest } // Send marshals and sends the DescribeAssociation API request. @@ -1270,7 +1289,7 @@ func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAssociationRequest{Request: req, Input: input} + return DescribeAssociationRequest{Request: req, Input: input, Copy: c.DescribeAssociationRequest} } const opDescribeAutomationExecutions = "DescribeAutomationExecutions" @@ -1279,6 +1298,7 @@ const opDescribeAutomationExecutions = "DescribeAutomationExecutions" type DescribeAutomationExecutionsRequest struct { *aws.Request Input *DescribeAutomationExecutionsInput + Copy func(*DescribeAutomationExecutionsInput) DescribeAutomationExecutionsRequest } // Send marshals and sends the DescribeAutomationExecutions API request. @@ -1319,7 +1339,7 @@ func (c *SSM) DescribeAutomationExecutionsRequest(input *DescribeAutomationExecu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAutomationExecutionsRequest{Request: req, Input: input} + return DescribeAutomationExecutionsRequest{Request: req, Input: input, Copy: c.DescribeAutomationExecutionsRequest} } const opDescribeAutomationStepExecutions = "DescribeAutomationStepExecutions" @@ -1328,6 +1348,7 @@ const opDescribeAutomationStepExecutions = "DescribeAutomationStepExecutions" type DescribeAutomationStepExecutionsRequest struct { *aws.Request Input *DescribeAutomationStepExecutionsInput + Copy func(*DescribeAutomationStepExecutionsInput) DescribeAutomationStepExecutionsRequest } // Send marshals and sends the DescribeAutomationStepExecutions API request. @@ -1369,7 +1390,7 @@ func (c *SSM) DescribeAutomationStepExecutionsRequest(input *DescribeAutomationS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAutomationStepExecutionsRequest{Request: req, Input: input} + return DescribeAutomationStepExecutionsRequest{Request: req, Input: input, Copy: c.DescribeAutomationStepExecutionsRequest} } const opDescribeAvailablePatches = "DescribeAvailablePatches" @@ -1378,6 +1399,7 @@ const opDescribeAvailablePatches = "DescribeAvailablePatches" type DescribeAvailablePatchesRequest struct { *aws.Request Input *DescribeAvailablePatchesInput + Copy func(*DescribeAvailablePatchesInput) DescribeAvailablePatchesRequest } // Send marshals and sends the DescribeAvailablePatches API request. @@ -1418,7 +1440,7 @@ func (c *SSM) DescribeAvailablePatchesRequest(input *DescribeAvailablePatchesInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAvailablePatchesRequest{Request: req, Input: input} + return DescribeAvailablePatchesRequest{Request: req, Input: input, Copy: c.DescribeAvailablePatchesRequest} } const opDescribeDocument = "DescribeDocument" @@ -1427,6 +1449,7 @@ const opDescribeDocument = "DescribeDocument" type DescribeDocumentRequest struct { *aws.Request Input *DescribeDocumentInput + Copy func(*DescribeDocumentInput) DescribeDocumentRequest } // Send marshals and sends the DescribeDocument API request. @@ -1467,7 +1490,7 @@ func (c *SSM) DescribeDocumentRequest(input *DescribeDocumentInput) DescribeDocu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDocumentRequest{Request: req, Input: input} + return DescribeDocumentRequest{Request: req, Input: input, Copy: c.DescribeDocumentRequest} } const opDescribeDocumentPermission = "DescribeDocumentPermission" @@ -1476,6 +1499,7 @@ const opDescribeDocumentPermission = "DescribeDocumentPermission" type DescribeDocumentPermissionRequest struct { *aws.Request Input *DescribeDocumentPermissionInput + Copy func(*DescribeDocumentPermissionInput) DescribeDocumentPermissionRequest } // Send marshals and sends the DescribeDocumentPermission API request. @@ -1518,7 +1542,7 @@ func (c *SSM) DescribeDocumentPermissionRequest(input *DescribeDocumentPermissio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDocumentPermissionRequest{Request: req, Input: input} + return DescribeDocumentPermissionRequest{Request: req, Input: input, Copy: c.DescribeDocumentPermissionRequest} } const opDescribeEffectiveInstanceAssociations = "DescribeEffectiveInstanceAssociations" @@ -1527,6 +1551,7 @@ const opDescribeEffectiveInstanceAssociations = "DescribeEffectiveInstanceAssoci type DescribeEffectiveInstanceAssociationsRequest struct { *aws.Request Input *DescribeEffectiveInstanceAssociationsInput + Copy func(*DescribeEffectiveInstanceAssociationsInput) DescribeEffectiveInstanceAssociationsRequest } // Send marshals and sends the DescribeEffectiveInstanceAssociations API request. @@ -1567,7 +1592,7 @@ func (c *SSM) DescribeEffectiveInstanceAssociationsRequest(input *DescribeEffect req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEffectiveInstanceAssociationsRequest{Request: req, Input: input} + return DescribeEffectiveInstanceAssociationsRequest{Request: req, Input: input, Copy: c.DescribeEffectiveInstanceAssociationsRequest} } const opDescribeEffectivePatchesForPatchBaseline = "DescribeEffectivePatchesForPatchBaseline" @@ -1576,6 +1601,7 @@ const opDescribeEffectivePatchesForPatchBaseline = "DescribeEffectivePatchesForP type DescribeEffectivePatchesForPatchBaselineRequest struct { *aws.Request Input *DescribeEffectivePatchesForPatchBaselineInput + Copy func(*DescribeEffectivePatchesForPatchBaselineInput) DescribeEffectivePatchesForPatchBaselineRequest } // Send marshals and sends the DescribeEffectivePatchesForPatchBaseline API request. @@ -1618,7 +1644,7 @@ func (c *SSM) DescribeEffectivePatchesForPatchBaselineRequest(input *DescribeEff req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeEffectivePatchesForPatchBaselineRequest{Request: req, Input: input} + return DescribeEffectivePatchesForPatchBaselineRequest{Request: req, Input: input, Copy: c.DescribeEffectivePatchesForPatchBaselineRequest} } const opDescribeInstanceAssociationsStatus = "DescribeInstanceAssociationsStatus" @@ -1627,6 +1653,7 @@ const opDescribeInstanceAssociationsStatus = "DescribeInstanceAssociationsStatus type DescribeInstanceAssociationsStatusRequest struct { *aws.Request Input *DescribeInstanceAssociationsStatusInput + Copy func(*DescribeInstanceAssociationsStatusInput) DescribeInstanceAssociationsStatusRequest } // Send marshals and sends the DescribeInstanceAssociationsStatus API request. @@ -1667,7 +1694,7 @@ func (c *SSM) DescribeInstanceAssociationsStatusRequest(input *DescribeInstanceA req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstanceAssociationsStatusRequest{Request: req, Input: input} + return DescribeInstanceAssociationsStatusRequest{Request: req, Input: input, Copy: c.DescribeInstanceAssociationsStatusRequest} } const opDescribeInstanceInformation = "DescribeInstanceInformation" @@ -1676,6 +1703,7 @@ const opDescribeInstanceInformation = "DescribeInstanceInformation" type DescribeInstanceInformationRequest struct { *aws.Request Input *DescribeInstanceInformationInput + Copy func(*DescribeInstanceInformationInput) DescribeInstanceInformationRequest } // Send marshals and sends the DescribeInstanceInformation API request. @@ -1727,57 +1755,53 @@ func (c *SSM) DescribeInstanceInformationRequest(input *DescribeInstanceInformat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstanceInformationRequest{Request: req, Input: input} + return DescribeInstanceInformationRequest{Request: req, Input: input, Copy: c.DescribeInstanceInformationRequest} } -// DescribeInstanceInformationPages iterates over the pages of a DescribeInstanceInformation operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeInstanceInformation method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeInstanceInformationRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeInstanceInformation operation. -// pageNum := 0 -// err := client.DescribeInstanceInformationPages(params, -// func(page *DescribeInstanceInformationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) DescribeInstanceInformationPages(input *DescribeInstanceInformationInput, fn func(*DescribeInstanceInformationOutput, bool) bool) error { - return c.DescribeInstanceInformationPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeInstanceInformationPagesWithContext same as DescribeInstanceInformationPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SSM) DescribeInstanceInformationPagesWithContext(ctx aws.Context, input *DescribeInstanceInformationInput, fn func(*DescribeInstanceInformationOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeInstanceInformationInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeInstanceInformationRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeInstanceInformationRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeInstanceInformationRequest) Paginate(opts ...aws.Option) DescribeInstanceInformationPager { + return DescribeInstanceInformationPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeInstanceInformationInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstanceInformationOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeInstanceInformationPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeInstanceInformationPager struct { + aws.Pager +} + +func (p *DescribeInstanceInformationPager) CurrentPage() *DescribeInstanceInformationOutput { + return p.Pager.CurrentPage().(*DescribeInstanceInformationOutput) } const opDescribeInstancePatchStates = "DescribeInstancePatchStates" @@ -1786,6 +1810,7 @@ const opDescribeInstancePatchStates = "DescribeInstancePatchStates" type DescribeInstancePatchStatesRequest struct { *aws.Request Input *DescribeInstancePatchStatesInput + Copy func(*DescribeInstancePatchStatesInput) DescribeInstancePatchStatesRequest } // Send marshals and sends the DescribeInstancePatchStates API request. @@ -1826,7 +1851,7 @@ func (c *SSM) DescribeInstancePatchStatesRequest(input *DescribeInstancePatchSta req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstancePatchStatesRequest{Request: req, Input: input} + return DescribeInstancePatchStatesRequest{Request: req, Input: input, Copy: c.DescribeInstancePatchStatesRequest} } const opDescribeInstancePatchStatesForPatchGroup = "DescribeInstancePatchStatesForPatchGroup" @@ -1835,6 +1860,7 @@ const opDescribeInstancePatchStatesForPatchGroup = "DescribeInstancePatchStatesF type DescribeInstancePatchStatesForPatchGroupRequest struct { *aws.Request Input *DescribeInstancePatchStatesForPatchGroupInput + Copy func(*DescribeInstancePatchStatesForPatchGroupInput) DescribeInstancePatchStatesForPatchGroupRequest } // Send marshals and sends the DescribeInstancePatchStatesForPatchGroup API request. @@ -1876,7 +1902,7 @@ func (c *SSM) DescribeInstancePatchStatesForPatchGroupRequest(input *DescribeIns req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstancePatchStatesForPatchGroupRequest{Request: req, Input: input} + return DescribeInstancePatchStatesForPatchGroupRequest{Request: req, Input: input, Copy: c.DescribeInstancePatchStatesForPatchGroupRequest} } const opDescribeInstancePatches = "DescribeInstancePatches" @@ -1885,6 +1911,7 @@ const opDescribeInstancePatches = "DescribeInstancePatches" type DescribeInstancePatchesRequest struct { *aws.Request Input *DescribeInstancePatchesInput + Copy func(*DescribeInstancePatchesInput) DescribeInstancePatchesRequest } // Send marshals and sends the DescribeInstancePatches API request. @@ -1926,7 +1953,7 @@ func (c *SSM) DescribeInstancePatchesRequest(input *DescribeInstancePatchesInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeInstancePatchesRequest{Request: req, Input: input} + return DescribeInstancePatchesRequest{Request: req, Input: input, Copy: c.DescribeInstancePatchesRequest} } const opDescribeMaintenanceWindowExecutionTaskInvocations = "DescribeMaintenanceWindowExecutionTaskInvocations" @@ -1935,6 +1962,7 @@ const opDescribeMaintenanceWindowExecutionTaskInvocations = "DescribeMaintenance type DescribeMaintenanceWindowExecutionTaskInvocationsRequest struct { *aws.Request Input *DescribeMaintenanceWindowExecutionTaskInvocationsInput + Copy func(*DescribeMaintenanceWindowExecutionTaskInvocationsInput) DescribeMaintenanceWindowExecutionTaskInvocationsRequest } // Send marshals and sends the DescribeMaintenanceWindowExecutionTaskInvocations API request. @@ -1976,7 +2004,7 @@ func (c *SSM) DescribeMaintenanceWindowExecutionTaskInvocationsRequest(input *De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMaintenanceWindowExecutionTaskInvocationsRequest{Request: req, Input: input} + return DescribeMaintenanceWindowExecutionTaskInvocationsRequest{Request: req, Input: input, Copy: c.DescribeMaintenanceWindowExecutionTaskInvocationsRequest} } const opDescribeMaintenanceWindowExecutionTasks = "DescribeMaintenanceWindowExecutionTasks" @@ -1985,6 +2013,7 @@ const opDescribeMaintenanceWindowExecutionTasks = "DescribeMaintenanceWindowExec type DescribeMaintenanceWindowExecutionTasksRequest struct { *aws.Request Input *DescribeMaintenanceWindowExecutionTasksInput + Copy func(*DescribeMaintenanceWindowExecutionTasksInput) DescribeMaintenanceWindowExecutionTasksRequest } // Send marshals and sends the DescribeMaintenanceWindowExecutionTasks API request. @@ -2025,7 +2054,7 @@ func (c *SSM) DescribeMaintenanceWindowExecutionTasksRequest(input *DescribeMain req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMaintenanceWindowExecutionTasksRequest{Request: req, Input: input} + return DescribeMaintenanceWindowExecutionTasksRequest{Request: req, Input: input, Copy: c.DescribeMaintenanceWindowExecutionTasksRequest} } const opDescribeMaintenanceWindowExecutions = "DescribeMaintenanceWindowExecutions" @@ -2034,6 +2063,7 @@ const opDescribeMaintenanceWindowExecutions = "DescribeMaintenanceWindowExecutio type DescribeMaintenanceWindowExecutionsRequest struct { *aws.Request Input *DescribeMaintenanceWindowExecutionsInput + Copy func(*DescribeMaintenanceWindowExecutionsInput) DescribeMaintenanceWindowExecutionsRequest } // Send marshals and sends the DescribeMaintenanceWindowExecutions API request. @@ -2076,7 +2106,7 @@ func (c *SSM) DescribeMaintenanceWindowExecutionsRequest(input *DescribeMaintena req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMaintenanceWindowExecutionsRequest{Request: req, Input: input} + return DescribeMaintenanceWindowExecutionsRequest{Request: req, Input: input, Copy: c.DescribeMaintenanceWindowExecutionsRequest} } const opDescribeMaintenanceWindowTargets = "DescribeMaintenanceWindowTargets" @@ -2085,6 +2115,7 @@ const opDescribeMaintenanceWindowTargets = "DescribeMaintenanceWindowTargets" type DescribeMaintenanceWindowTargetsRequest struct { *aws.Request Input *DescribeMaintenanceWindowTargetsInput + Copy func(*DescribeMaintenanceWindowTargetsInput) DescribeMaintenanceWindowTargetsRequest } // Send marshals and sends the DescribeMaintenanceWindowTargets API request. @@ -2125,7 +2156,7 @@ func (c *SSM) DescribeMaintenanceWindowTargetsRequest(input *DescribeMaintenance req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMaintenanceWindowTargetsRequest{Request: req, Input: input} + return DescribeMaintenanceWindowTargetsRequest{Request: req, Input: input, Copy: c.DescribeMaintenanceWindowTargetsRequest} } const opDescribeMaintenanceWindowTasks = "DescribeMaintenanceWindowTasks" @@ -2134,6 +2165,7 @@ const opDescribeMaintenanceWindowTasks = "DescribeMaintenanceWindowTasks" type DescribeMaintenanceWindowTasksRequest struct { *aws.Request Input *DescribeMaintenanceWindowTasksInput + Copy func(*DescribeMaintenanceWindowTasksInput) DescribeMaintenanceWindowTasksRequest } // Send marshals and sends the DescribeMaintenanceWindowTasks API request. @@ -2174,7 +2206,7 @@ func (c *SSM) DescribeMaintenanceWindowTasksRequest(input *DescribeMaintenanceWi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMaintenanceWindowTasksRequest{Request: req, Input: input} + return DescribeMaintenanceWindowTasksRequest{Request: req, Input: input, Copy: c.DescribeMaintenanceWindowTasksRequest} } const opDescribeMaintenanceWindows = "DescribeMaintenanceWindows" @@ -2183,6 +2215,7 @@ const opDescribeMaintenanceWindows = "DescribeMaintenanceWindows" type DescribeMaintenanceWindowsRequest struct { *aws.Request Input *DescribeMaintenanceWindowsInput + Copy func(*DescribeMaintenanceWindowsInput) DescribeMaintenanceWindowsRequest } // Send marshals and sends the DescribeMaintenanceWindows API request. @@ -2223,7 +2256,7 @@ func (c *SSM) DescribeMaintenanceWindowsRequest(input *DescribeMaintenanceWindow req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMaintenanceWindowsRequest{Request: req, Input: input} + return DescribeMaintenanceWindowsRequest{Request: req, Input: input, Copy: c.DescribeMaintenanceWindowsRequest} } const opDescribeParameters = "DescribeParameters" @@ -2232,6 +2265,7 @@ const opDescribeParameters = "DescribeParameters" type DescribeParametersRequest struct { *aws.Request Input *DescribeParametersInput + Copy func(*DescribeParametersInput) DescribeParametersRequest } // Send marshals and sends the DescribeParameters API request. @@ -2286,57 +2320,53 @@ func (c *SSM) DescribeParametersRequest(input *DescribeParametersInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeParametersRequest{Request: req, Input: input} + return DescribeParametersRequest{Request: req, Input: input, Copy: c.DescribeParametersRequest} } -// DescribeParametersPages iterates over the pages of a DescribeParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeParameters method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeParametersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeParameters operation. -// pageNum := 0 -// err := client.DescribeParametersPages(params, -// func(page *DescribeParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) DescribeParametersPages(input *DescribeParametersInput, fn func(*DescribeParametersOutput, bool) bool) error { - return c.DescribeParametersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeParametersPagesWithContext same as DescribeParametersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SSM) DescribeParametersPagesWithContext(ctx aws.Context, input *DescribeParametersInput, fn func(*DescribeParametersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeParametersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeParametersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeParametersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeParametersRequest) Paginate(opts ...aws.Option) DescribeParametersPager { + return DescribeParametersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeParametersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeParametersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeParametersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeParametersPager struct { + aws.Pager +} + +func (p *DescribeParametersPager) CurrentPage() *DescribeParametersOutput { + return p.Pager.CurrentPage().(*DescribeParametersOutput) } const opDescribePatchBaselines = "DescribePatchBaselines" @@ -2345,6 +2375,7 @@ const opDescribePatchBaselines = "DescribePatchBaselines" type DescribePatchBaselinesRequest struct { *aws.Request Input *DescribePatchBaselinesInput + Copy func(*DescribePatchBaselinesInput) DescribePatchBaselinesRequest } // Send marshals and sends the DescribePatchBaselines API request. @@ -2385,7 +2416,7 @@ func (c *SSM) DescribePatchBaselinesRequest(input *DescribePatchBaselinesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePatchBaselinesRequest{Request: req, Input: input} + return DescribePatchBaselinesRequest{Request: req, Input: input, Copy: c.DescribePatchBaselinesRequest} } const opDescribePatchGroupState = "DescribePatchGroupState" @@ -2394,6 +2425,7 @@ const opDescribePatchGroupState = "DescribePatchGroupState" type DescribePatchGroupStateRequest struct { *aws.Request Input *DescribePatchGroupStateInput + Copy func(*DescribePatchGroupStateInput) DescribePatchGroupStateRequest } // Send marshals and sends the DescribePatchGroupState API request. @@ -2434,7 +2466,7 @@ func (c *SSM) DescribePatchGroupStateRequest(input *DescribePatchGroupStateInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePatchGroupStateRequest{Request: req, Input: input} + return DescribePatchGroupStateRequest{Request: req, Input: input, Copy: c.DescribePatchGroupStateRequest} } const opDescribePatchGroups = "DescribePatchGroups" @@ -2443,6 +2475,7 @@ const opDescribePatchGroups = "DescribePatchGroups" type DescribePatchGroupsRequest struct { *aws.Request Input *DescribePatchGroupsInput + Copy func(*DescribePatchGroupsInput) DescribePatchGroupsRequest } // Send marshals and sends the DescribePatchGroups API request. @@ -2483,7 +2516,7 @@ func (c *SSM) DescribePatchGroupsRequest(input *DescribePatchGroupsInput) Descri req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribePatchGroupsRequest{Request: req, Input: input} + return DescribePatchGroupsRequest{Request: req, Input: input, Copy: c.DescribePatchGroupsRequest} } const opGetAutomationExecution = "GetAutomationExecution" @@ -2492,6 +2525,7 @@ const opGetAutomationExecution = "GetAutomationExecution" type GetAutomationExecutionRequest struct { *aws.Request Input *GetAutomationExecutionInput + Copy func(*GetAutomationExecutionInput) GetAutomationExecutionRequest } // Send marshals and sends the GetAutomationExecution API request. @@ -2532,7 +2566,7 @@ func (c *SSM) GetAutomationExecutionRequest(input *GetAutomationExecutionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetAutomationExecutionRequest{Request: req, Input: input} + return GetAutomationExecutionRequest{Request: req, Input: input, Copy: c.GetAutomationExecutionRequest} } const opGetCommandInvocation = "GetCommandInvocation" @@ -2541,6 +2575,7 @@ const opGetCommandInvocation = "GetCommandInvocation" type GetCommandInvocationRequest struct { *aws.Request Input *GetCommandInvocationInput + Copy func(*GetCommandInvocationInput) GetCommandInvocationRequest } // Send marshals and sends the GetCommandInvocation API request. @@ -2582,7 +2617,7 @@ func (c *SSM) GetCommandInvocationRequest(input *GetCommandInvocationInput) GetC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCommandInvocationRequest{Request: req, Input: input} + return GetCommandInvocationRequest{Request: req, Input: input, Copy: c.GetCommandInvocationRequest} } const opGetDefaultPatchBaseline = "GetDefaultPatchBaseline" @@ -2591,6 +2626,7 @@ const opGetDefaultPatchBaseline = "GetDefaultPatchBaseline" type GetDefaultPatchBaselineRequest struct { *aws.Request Input *GetDefaultPatchBaselineInput + Copy func(*GetDefaultPatchBaselineInput) GetDefaultPatchBaselineRequest } // Send marshals and sends the GetDefaultPatchBaseline API request. @@ -2633,7 +2669,7 @@ func (c *SSM) GetDefaultPatchBaselineRequest(input *GetDefaultPatchBaselineInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDefaultPatchBaselineRequest{Request: req, Input: input} + return GetDefaultPatchBaselineRequest{Request: req, Input: input, Copy: c.GetDefaultPatchBaselineRequest} } const opGetDeployablePatchSnapshotForInstance = "GetDeployablePatchSnapshotForInstance" @@ -2642,6 +2678,7 @@ const opGetDeployablePatchSnapshotForInstance = "GetDeployablePatchSnapshotForIn type GetDeployablePatchSnapshotForInstanceRequest struct { *aws.Request Input *GetDeployablePatchSnapshotForInstanceInput + Copy func(*GetDeployablePatchSnapshotForInstanceInput) GetDeployablePatchSnapshotForInstanceRequest } // Send marshals and sends the GetDeployablePatchSnapshotForInstance API request. @@ -2683,7 +2720,7 @@ func (c *SSM) GetDeployablePatchSnapshotForInstanceRequest(input *GetDeployableP req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDeployablePatchSnapshotForInstanceRequest{Request: req, Input: input} + return GetDeployablePatchSnapshotForInstanceRequest{Request: req, Input: input, Copy: c.GetDeployablePatchSnapshotForInstanceRequest} } const opGetDocument = "GetDocument" @@ -2692,6 +2729,7 @@ const opGetDocument = "GetDocument" type GetDocumentRequest struct { *aws.Request Input *GetDocumentInput + Copy func(*GetDocumentInput) GetDocumentRequest } // Send marshals and sends the GetDocument API request. @@ -2732,7 +2770,7 @@ func (c *SSM) GetDocumentRequest(input *GetDocumentInput) GetDocumentRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDocumentRequest{Request: req, Input: input} + return GetDocumentRequest{Request: req, Input: input, Copy: c.GetDocumentRequest} } const opGetInventory = "GetInventory" @@ -2741,6 +2779,7 @@ const opGetInventory = "GetInventory" type GetInventoryRequest struct { *aws.Request Input *GetInventoryInput + Copy func(*GetInventoryInput) GetInventoryRequest } // Send marshals and sends the GetInventory API request. @@ -2781,7 +2820,7 @@ func (c *SSM) GetInventoryRequest(input *GetInventoryInput) GetInventoryRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInventoryRequest{Request: req, Input: input} + return GetInventoryRequest{Request: req, Input: input, Copy: c.GetInventoryRequest} } const opGetInventorySchema = "GetInventorySchema" @@ -2790,6 +2829,7 @@ const opGetInventorySchema = "GetInventorySchema" type GetInventorySchemaRequest struct { *aws.Request Input *GetInventorySchemaInput + Copy func(*GetInventorySchemaInput) GetInventorySchemaRequest } // Send marshals and sends the GetInventorySchema API request. @@ -2831,7 +2871,7 @@ func (c *SSM) GetInventorySchemaRequest(input *GetInventorySchemaInput) GetInven req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetInventorySchemaRequest{Request: req, Input: input} + return GetInventorySchemaRequest{Request: req, Input: input, Copy: c.GetInventorySchemaRequest} } const opGetMaintenanceWindow = "GetMaintenanceWindow" @@ -2840,6 +2880,7 @@ const opGetMaintenanceWindow = "GetMaintenanceWindow" type GetMaintenanceWindowRequest struct { *aws.Request Input *GetMaintenanceWindowInput + Copy func(*GetMaintenanceWindowInput) GetMaintenanceWindowRequest } // Send marshals and sends the GetMaintenanceWindow API request. @@ -2880,7 +2921,7 @@ func (c *SSM) GetMaintenanceWindowRequest(input *GetMaintenanceWindowInput) GetM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMaintenanceWindowRequest{Request: req, Input: input} + return GetMaintenanceWindowRequest{Request: req, Input: input, Copy: c.GetMaintenanceWindowRequest} } const opGetMaintenanceWindowExecution = "GetMaintenanceWindowExecution" @@ -2889,6 +2930,7 @@ const opGetMaintenanceWindowExecution = "GetMaintenanceWindowExecution" type GetMaintenanceWindowExecutionRequest struct { *aws.Request Input *GetMaintenanceWindowExecutionInput + Copy func(*GetMaintenanceWindowExecutionInput) GetMaintenanceWindowExecutionRequest } // Send marshals and sends the GetMaintenanceWindowExecution API request. @@ -2930,7 +2972,7 @@ func (c *SSM) GetMaintenanceWindowExecutionRequest(input *GetMaintenanceWindowEx req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMaintenanceWindowExecutionRequest{Request: req, Input: input} + return GetMaintenanceWindowExecutionRequest{Request: req, Input: input, Copy: c.GetMaintenanceWindowExecutionRequest} } const opGetMaintenanceWindowExecutionTask = "GetMaintenanceWindowExecutionTask" @@ -2939,6 +2981,7 @@ const opGetMaintenanceWindowExecutionTask = "GetMaintenanceWindowExecutionTask" type GetMaintenanceWindowExecutionTaskRequest struct { *aws.Request Input *GetMaintenanceWindowExecutionTaskInput + Copy func(*GetMaintenanceWindowExecutionTaskInput) GetMaintenanceWindowExecutionTaskRequest } // Send marshals and sends the GetMaintenanceWindowExecutionTask API request. @@ -2980,7 +3023,7 @@ func (c *SSM) GetMaintenanceWindowExecutionTaskRequest(input *GetMaintenanceWind req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMaintenanceWindowExecutionTaskRequest{Request: req, Input: input} + return GetMaintenanceWindowExecutionTaskRequest{Request: req, Input: input, Copy: c.GetMaintenanceWindowExecutionTaskRequest} } const opGetMaintenanceWindowExecutionTaskInvocation = "GetMaintenanceWindowExecutionTaskInvocation" @@ -2989,6 +3032,7 @@ const opGetMaintenanceWindowExecutionTaskInvocation = "GetMaintenanceWindowExecu type GetMaintenanceWindowExecutionTaskInvocationRequest struct { *aws.Request Input *GetMaintenanceWindowExecutionTaskInvocationInput + Copy func(*GetMaintenanceWindowExecutionTaskInvocationInput) GetMaintenanceWindowExecutionTaskInvocationRequest } // Send marshals and sends the GetMaintenanceWindowExecutionTaskInvocation API request. @@ -3030,7 +3074,7 @@ func (c *SSM) GetMaintenanceWindowExecutionTaskInvocationRequest(input *GetMaint req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMaintenanceWindowExecutionTaskInvocationRequest{Request: req, Input: input} + return GetMaintenanceWindowExecutionTaskInvocationRequest{Request: req, Input: input, Copy: c.GetMaintenanceWindowExecutionTaskInvocationRequest} } const opGetMaintenanceWindowTask = "GetMaintenanceWindowTask" @@ -3039,6 +3083,7 @@ const opGetMaintenanceWindowTask = "GetMaintenanceWindowTask" type GetMaintenanceWindowTaskRequest struct { *aws.Request Input *GetMaintenanceWindowTaskInput + Copy func(*GetMaintenanceWindowTaskInput) GetMaintenanceWindowTaskRequest } // Send marshals and sends the GetMaintenanceWindowTask API request. @@ -3079,7 +3124,7 @@ func (c *SSM) GetMaintenanceWindowTaskRequest(input *GetMaintenanceWindowTaskInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetMaintenanceWindowTaskRequest{Request: req, Input: input} + return GetMaintenanceWindowTaskRequest{Request: req, Input: input, Copy: c.GetMaintenanceWindowTaskRequest} } const opGetParameter = "GetParameter" @@ -3088,6 +3133,7 @@ const opGetParameter = "GetParameter" type GetParameterRequest struct { *aws.Request Input *GetParameterInput + Copy func(*GetParameterInput) GetParameterRequest } // Send marshals and sends the GetParameter API request. @@ -3128,7 +3174,7 @@ func (c *SSM) GetParameterRequest(input *GetParameterInput) GetParameterRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetParameterRequest{Request: req, Input: input} + return GetParameterRequest{Request: req, Input: input, Copy: c.GetParameterRequest} } const opGetParameterHistory = "GetParameterHistory" @@ -3137,6 +3183,7 @@ const opGetParameterHistory = "GetParameterHistory" type GetParameterHistoryRequest struct { *aws.Request Input *GetParameterHistoryInput + Copy func(*GetParameterHistoryInput) GetParameterHistoryRequest } // Send marshals and sends the GetParameterHistory API request. @@ -3183,57 +3230,53 @@ func (c *SSM) GetParameterHistoryRequest(input *GetParameterHistoryInput) GetPar req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetParameterHistoryRequest{Request: req, Input: input} + return GetParameterHistoryRequest{Request: req, Input: input, Copy: c.GetParameterHistoryRequest} } -// GetParameterHistoryPages iterates over the pages of a GetParameterHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetParameterHistory method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetParameterHistoryRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetParameterHistory operation. -// pageNum := 0 -// err := client.GetParameterHistoryPages(params, -// func(page *GetParameterHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) GetParameterHistoryPages(input *GetParameterHistoryInput, fn func(*GetParameterHistoryOutput, bool) bool) error { - return c.GetParameterHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetParameterHistoryPagesWithContext same as GetParameterHistoryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SSM) GetParameterHistoryPagesWithContext(ctx aws.Context, input *GetParameterHistoryInput, fn func(*GetParameterHistoryOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetParameterHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetParameterHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetParameterHistoryRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetParameterHistoryRequest) Paginate(opts ...aws.Option) GetParameterHistoryPager { + return GetParameterHistoryPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetParameterHistoryInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetParameterHistoryOutput), !p.HasNextPage()) - } - return p.Err() +// GetParameterHistoryPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetParameterHistoryPager struct { + aws.Pager +} + +func (p *GetParameterHistoryPager) CurrentPage() *GetParameterHistoryOutput { + return p.Pager.CurrentPage().(*GetParameterHistoryOutput) } const opGetParameters = "GetParameters" @@ -3242,6 +3285,7 @@ const opGetParameters = "GetParameters" type GetParametersRequest struct { *aws.Request Input *GetParametersInput + Copy func(*GetParametersInput) GetParametersRequest } // Send marshals and sends the GetParameters API request. @@ -3282,7 +3326,7 @@ func (c *SSM) GetParametersRequest(input *GetParametersInput) GetParametersReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetParametersRequest{Request: req, Input: input} + return GetParametersRequest{Request: req, Input: input, Copy: c.GetParametersRequest} } const opGetParametersByPath = "GetParametersByPath" @@ -3291,6 +3335,7 @@ const opGetParametersByPath = "GetParametersByPath" type GetParametersByPathRequest struct { *aws.Request Input *GetParametersByPathInput + Copy func(*GetParametersByPathInput) GetParametersByPathRequest } // Send marshals and sends the GetParametersByPath API request. @@ -3348,57 +3393,53 @@ func (c *SSM) GetParametersByPathRequest(input *GetParametersByPathInput) GetPar req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetParametersByPathRequest{Request: req, Input: input} + return GetParametersByPathRequest{Request: req, Input: input, Copy: c.GetParametersByPathRequest} } -// GetParametersByPathPages iterates over the pages of a GetParametersByPath operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetParametersByPath method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetParametersByPathRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetParametersByPath operation. -// pageNum := 0 -// err := client.GetParametersByPathPages(params, -// func(page *GetParametersByPathOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) GetParametersByPathPages(input *GetParametersByPathInput, fn func(*GetParametersByPathOutput, bool) bool) error { - return c.GetParametersByPathPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetParametersByPathPagesWithContext same as GetParametersByPathPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SSM) GetParametersByPathPagesWithContext(ctx aws.Context, input *GetParametersByPathInput, fn func(*GetParametersByPathOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetParametersByPathInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetParametersByPathRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetParametersByPathRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetParametersByPathRequest) Paginate(opts ...aws.Option) GetParametersByPathPager { + return GetParametersByPathPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetParametersByPathInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetParametersByPathOutput), !p.HasNextPage()) - } - return p.Err() +// GetParametersByPathPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetParametersByPathPager struct { + aws.Pager +} + +func (p *GetParametersByPathPager) CurrentPage() *GetParametersByPathOutput { + return p.Pager.CurrentPage().(*GetParametersByPathOutput) } const opGetPatchBaseline = "GetPatchBaseline" @@ -3407,6 +3448,7 @@ const opGetPatchBaseline = "GetPatchBaseline" type GetPatchBaselineRequest struct { *aws.Request Input *GetPatchBaselineInput + Copy func(*GetPatchBaselineInput) GetPatchBaselineRequest } // Send marshals and sends the GetPatchBaseline API request. @@ -3447,7 +3489,7 @@ func (c *SSM) GetPatchBaselineRequest(input *GetPatchBaselineInput) GetPatchBase req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPatchBaselineRequest{Request: req, Input: input} + return GetPatchBaselineRequest{Request: req, Input: input, Copy: c.GetPatchBaselineRequest} } const opGetPatchBaselineForPatchGroup = "GetPatchBaselineForPatchGroup" @@ -3456,6 +3498,7 @@ const opGetPatchBaselineForPatchGroup = "GetPatchBaselineForPatchGroup" type GetPatchBaselineForPatchGroupRequest struct { *aws.Request Input *GetPatchBaselineForPatchGroupInput + Copy func(*GetPatchBaselineForPatchGroupInput) GetPatchBaselineForPatchGroupRequest } // Send marshals and sends the GetPatchBaselineForPatchGroup API request. @@ -3497,7 +3540,7 @@ func (c *SSM) GetPatchBaselineForPatchGroupRequest(input *GetPatchBaselineForPat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetPatchBaselineForPatchGroupRequest{Request: req, Input: input} + return GetPatchBaselineForPatchGroupRequest{Request: req, Input: input, Copy: c.GetPatchBaselineForPatchGroupRequest} } const opListAssociationVersions = "ListAssociationVersions" @@ -3506,6 +3549,7 @@ const opListAssociationVersions = "ListAssociationVersions" type ListAssociationVersionsRequest struct { *aws.Request Input *ListAssociationVersionsInput + Copy func(*ListAssociationVersionsInput) ListAssociationVersionsRequest } // Send marshals and sends the ListAssociationVersions API request. @@ -3546,7 +3590,7 @@ func (c *SSM) ListAssociationVersionsRequest(input *ListAssociationVersionsInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAssociationVersionsRequest{Request: req, Input: input} + return ListAssociationVersionsRequest{Request: req, Input: input, Copy: c.ListAssociationVersionsRequest} } const opListAssociations = "ListAssociations" @@ -3555,6 +3599,7 @@ const opListAssociations = "ListAssociations" type ListAssociationsRequest struct { *aws.Request Input *ListAssociationsInput + Copy func(*ListAssociationsInput) ListAssociationsRequest } // Send marshals and sends the ListAssociations API request. @@ -3601,57 +3646,53 @@ func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) ListAssociat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAssociationsRequest{Request: req, Input: input} + return ListAssociationsRequest{Request: req, Input: input, Copy: c.ListAssociationsRequest} } -// ListAssociationsPages iterates over the pages of a ListAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssociations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAssociationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAssociations operation. -// pageNum := 0 -// err := client.ListAssociationsPages(params, -// func(page *ListAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) ListAssociationsPages(input *ListAssociationsInput, fn func(*ListAssociationsOutput, bool) bool) error { - return c.ListAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssociationsPagesWithContext same as ListAssociationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SSM) ListAssociationsPagesWithContext(ctx aws.Context, input *ListAssociationsInput, fn func(*ListAssociationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAssociationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAssociationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListAssociationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListAssociationsRequest) Paginate(opts ...aws.Option) ListAssociationsPager { + return ListAssociationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAssociationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssociationsOutput), !p.HasNextPage()) - } - return p.Err() +// ListAssociationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAssociationsPager struct { + aws.Pager +} + +func (p *ListAssociationsPager) CurrentPage() *ListAssociationsOutput { + return p.Pager.CurrentPage().(*ListAssociationsOutput) } const opListCommandInvocations = "ListCommandInvocations" @@ -3660,6 +3701,7 @@ const opListCommandInvocations = "ListCommandInvocations" type ListCommandInvocationsRequest struct { *aws.Request Input *ListCommandInvocationsInput + Copy func(*ListCommandInvocationsInput) ListCommandInvocationsRequest } // Send marshals and sends the ListCommandInvocations API request. @@ -3710,57 +3752,53 @@ func (c *SSM) ListCommandInvocationsRequest(input *ListCommandInvocationsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCommandInvocationsRequest{Request: req, Input: input} + return ListCommandInvocationsRequest{Request: req, Input: input, Copy: c.ListCommandInvocationsRequest} } -// ListCommandInvocationsPages iterates over the pages of a ListCommandInvocations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCommandInvocations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListCommandInvocationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListCommandInvocations operation. -// pageNum := 0 -// err := client.ListCommandInvocationsPages(params, -// func(page *ListCommandInvocationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) ListCommandInvocationsPages(input *ListCommandInvocationsInput, fn func(*ListCommandInvocationsOutput, bool) bool) error { - return c.ListCommandInvocationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCommandInvocationsPagesWithContext same as ListCommandInvocationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SSM) ListCommandInvocationsPagesWithContext(ctx aws.Context, input *ListCommandInvocationsInput, fn func(*ListCommandInvocationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListCommandInvocationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListCommandInvocationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListCommandInvocationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListCommandInvocationsRequest) Paginate(opts ...aws.Option) ListCommandInvocationsPager { + return ListCommandInvocationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListCommandInvocationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCommandInvocationsOutput), !p.HasNextPage()) - } - return p.Err() +// ListCommandInvocationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListCommandInvocationsPager struct { + aws.Pager +} + +func (p *ListCommandInvocationsPager) CurrentPage() *ListCommandInvocationsOutput { + return p.Pager.CurrentPage().(*ListCommandInvocationsOutput) } const opListCommands = "ListCommands" @@ -3769,6 +3807,7 @@ const opListCommands = "ListCommands" type ListCommandsRequest struct { *aws.Request Input *ListCommandsInput + Copy func(*ListCommandsInput) ListCommandsRequest } // Send marshals and sends the ListCommands API request. @@ -3815,57 +3854,53 @@ func (c *SSM) ListCommandsRequest(input *ListCommandsInput) ListCommandsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListCommandsRequest{Request: req, Input: input} + return ListCommandsRequest{Request: req, Input: input, Copy: c.ListCommandsRequest} } -// ListCommandsPages iterates over the pages of a ListCommands operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCommands method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListCommandsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListCommands operation. -// pageNum := 0 -// err := client.ListCommandsPages(params, -// func(page *ListCommandsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) ListCommandsPages(input *ListCommandsInput, fn func(*ListCommandsOutput, bool) bool) error { - return c.ListCommandsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCommandsPagesWithContext same as ListCommandsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SSM) ListCommandsPagesWithContext(ctx aws.Context, input *ListCommandsInput, fn func(*ListCommandsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListCommandsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListCommandsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListCommandsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListCommandsRequest) Paginate(opts ...aws.Option) ListCommandsPager { + return ListCommandsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListCommandsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCommandsOutput), !p.HasNextPage()) - } - return p.Err() +// ListCommandsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListCommandsPager struct { + aws.Pager +} + +func (p *ListCommandsPager) CurrentPage() *ListCommandsOutput { + return p.Pager.CurrentPage().(*ListCommandsOutput) } const opListComplianceItems = "ListComplianceItems" @@ -3874,6 +3909,7 @@ const opListComplianceItems = "ListComplianceItems" type ListComplianceItemsRequest struct { *aws.Request Input *ListComplianceItemsInput + Copy func(*ListComplianceItemsInput) ListComplianceItemsRequest } // Send marshals and sends the ListComplianceItems API request. @@ -3917,7 +3953,7 @@ func (c *SSM) ListComplianceItemsRequest(input *ListComplianceItemsInput) ListCo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListComplianceItemsRequest{Request: req, Input: input} + return ListComplianceItemsRequest{Request: req, Input: input, Copy: c.ListComplianceItemsRequest} } const opListComplianceSummaries = "ListComplianceSummaries" @@ -3926,6 +3962,7 @@ const opListComplianceSummaries = "ListComplianceSummaries" type ListComplianceSummariesRequest struct { *aws.Request Input *ListComplianceSummariesInput + Copy func(*ListComplianceSummariesInput) ListComplianceSummariesRequest } // Send marshals and sends the ListComplianceSummaries API request. @@ -3968,7 +4005,7 @@ func (c *SSM) ListComplianceSummariesRequest(input *ListComplianceSummariesInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListComplianceSummariesRequest{Request: req, Input: input} + return ListComplianceSummariesRequest{Request: req, Input: input, Copy: c.ListComplianceSummariesRequest} } const opListDocumentVersions = "ListDocumentVersions" @@ -3977,6 +4014,7 @@ const opListDocumentVersions = "ListDocumentVersions" type ListDocumentVersionsRequest struct { *aws.Request Input *ListDocumentVersionsInput + Copy func(*ListDocumentVersionsInput) ListDocumentVersionsRequest } // Send marshals and sends the ListDocumentVersions API request. @@ -4017,7 +4055,7 @@ func (c *SSM) ListDocumentVersionsRequest(input *ListDocumentVersionsInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDocumentVersionsRequest{Request: req, Input: input} + return ListDocumentVersionsRequest{Request: req, Input: input, Copy: c.ListDocumentVersionsRequest} } const opListDocuments = "ListDocuments" @@ -4026,6 +4064,7 @@ const opListDocuments = "ListDocuments" type ListDocumentsRequest struct { *aws.Request Input *ListDocumentsInput + Copy func(*ListDocumentsInput) ListDocumentsRequest } // Send marshals and sends the ListDocuments API request. @@ -4072,57 +4111,53 @@ func (c *SSM) ListDocumentsRequest(input *ListDocumentsInput) ListDocumentsReque req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDocumentsRequest{Request: req, Input: input} + return ListDocumentsRequest{Request: req, Input: input, Copy: c.ListDocumentsRequest} } -// ListDocumentsPages iterates over the pages of a ListDocuments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDocuments method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDocumentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDocuments operation. -// pageNum := 0 -// err := client.ListDocumentsPages(params, -// func(page *ListDocumentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) ListDocumentsPages(input *ListDocumentsInput, fn func(*ListDocumentsOutput, bool) bool) error { - return c.ListDocumentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDocumentsPagesWithContext same as ListDocumentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SSM) ListDocumentsPagesWithContext(ctx aws.Context, input *ListDocumentsInput, fn func(*ListDocumentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDocumentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDocumentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDocumentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDocumentsRequest) Paginate(opts ...aws.Option) ListDocumentsPager { + return ListDocumentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDocumentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDocumentsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDocumentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDocumentsPager struct { + aws.Pager +} + +func (p *ListDocumentsPager) CurrentPage() *ListDocumentsOutput { + return p.Pager.CurrentPage().(*ListDocumentsOutput) } const opListInventoryEntries = "ListInventoryEntries" @@ -4131,6 +4166,7 @@ const opListInventoryEntries = "ListInventoryEntries" type ListInventoryEntriesRequest struct { *aws.Request Input *ListInventoryEntriesInput + Copy func(*ListInventoryEntriesInput) ListInventoryEntriesRequest } // Send marshals and sends the ListInventoryEntries API request. @@ -4171,7 +4207,7 @@ func (c *SSM) ListInventoryEntriesRequest(input *ListInventoryEntriesInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListInventoryEntriesRequest{Request: req, Input: input} + return ListInventoryEntriesRequest{Request: req, Input: input, Copy: c.ListInventoryEntriesRequest} } const opListResourceComplianceSummaries = "ListResourceComplianceSummaries" @@ -4180,6 +4216,7 @@ const opListResourceComplianceSummaries = "ListResourceComplianceSummaries" type ListResourceComplianceSummariesRequest struct { *aws.Request Input *ListResourceComplianceSummariesInput + Copy func(*ListResourceComplianceSummariesInput) ListResourceComplianceSummariesRequest } // Send marshals and sends the ListResourceComplianceSummaries API request. @@ -4222,7 +4259,7 @@ func (c *SSM) ListResourceComplianceSummariesRequest(input *ListResourceComplian req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourceComplianceSummariesRequest{Request: req, Input: input} + return ListResourceComplianceSummariesRequest{Request: req, Input: input, Copy: c.ListResourceComplianceSummariesRequest} } const opListResourceDataSync = "ListResourceDataSync" @@ -4231,6 +4268,7 @@ const opListResourceDataSync = "ListResourceDataSync" type ListResourceDataSyncRequest struct { *aws.Request Input *ListResourceDataSyncInput + Copy func(*ListResourceDataSyncInput) ListResourceDataSyncRequest } // Send marshals and sends the ListResourceDataSync API request. @@ -4280,7 +4318,7 @@ func (c *SSM) ListResourceDataSyncRequest(input *ListResourceDataSyncInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourceDataSyncRequest{Request: req, Input: input} + return ListResourceDataSyncRequest{Request: req, Input: input, Copy: c.ListResourceDataSyncRequest} } const opListTagsForResource = "ListTagsForResource" @@ -4289,6 +4327,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -4329,7 +4368,7 @@ func (c *SSM) ListTagsForResourceRequest(input *ListTagsForResourceInput) ListTa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opModifyDocumentPermission = "ModifyDocumentPermission" @@ -4338,6 +4377,7 @@ const opModifyDocumentPermission = "ModifyDocumentPermission" type ModifyDocumentPermissionRequest struct { *aws.Request Input *ModifyDocumentPermissionInput + Copy func(*ModifyDocumentPermissionInput) ModifyDocumentPermissionRequest } // Send marshals and sends the ModifyDocumentPermission API request. @@ -4381,7 +4421,7 @@ func (c *SSM) ModifyDocumentPermissionRequest(input *ModifyDocumentPermissionInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyDocumentPermissionRequest{Request: req, Input: input} + return ModifyDocumentPermissionRequest{Request: req, Input: input, Copy: c.ModifyDocumentPermissionRequest} } const opPutComplianceItems = "PutComplianceItems" @@ -4390,6 +4430,7 @@ const opPutComplianceItems = "PutComplianceItems" type PutComplianceItemsRequest struct { *aws.Request Input *PutComplianceItemsInput + Copy func(*PutComplianceItemsInput) PutComplianceItemsRequest } // Send marshals and sends the PutComplianceItems API request. @@ -4471,7 +4512,7 @@ func (c *SSM) PutComplianceItemsRequest(input *PutComplianceItemsInput) PutCompl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutComplianceItemsRequest{Request: req, Input: input} + return PutComplianceItemsRequest{Request: req, Input: input, Copy: c.PutComplianceItemsRequest} } const opPutInventory = "PutInventory" @@ -4480,6 +4521,7 @@ const opPutInventory = "PutInventory" type PutInventoryRequest struct { *aws.Request Input *PutInventoryInput + Copy func(*PutInventoryInput) PutInventoryRequest } // Send marshals and sends the PutInventory API request. @@ -4522,7 +4564,7 @@ func (c *SSM) PutInventoryRequest(input *PutInventoryInput) PutInventoryRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutInventoryRequest{Request: req, Input: input} + return PutInventoryRequest{Request: req, Input: input, Copy: c.PutInventoryRequest} } const opPutParameter = "PutParameter" @@ -4531,6 +4573,7 @@ const opPutParameter = "PutParameter" type PutParameterRequest struct { *aws.Request Input *PutParameterInput + Copy func(*PutParameterInput) PutParameterRequest } // Send marshals and sends the PutParameter API request. @@ -4571,7 +4614,7 @@ func (c *SSM) PutParameterRequest(input *PutParameterInput) PutParameterRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutParameterRequest{Request: req, Input: input} + return PutParameterRequest{Request: req, Input: input, Copy: c.PutParameterRequest} } const opRegisterDefaultPatchBaseline = "RegisterDefaultPatchBaseline" @@ -4580,6 +4623,7 @@ const opRegisterDefaultPatchBaseline = "RegisterDefaultPatchBaseline" type RegisterDefaultPatchBaselineRequest struct { *aws.Request Input *RegisterDefaultPatchBaselineInput + Copy func(*RegisterDefaultPatchBaselineInput) RegisterDefaultPatchBaselineRequest } // Send marshals and sends the RegisterDefaultPatchBaseline API request. @@ -4620,7 +4664,7 @@ func (c *SSM) RegisterDefaultPatchBaselineRequest(input *RegisterDefaultPatchBas req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterDefaultPatchBaselineRequest{Request: req, Input: input} + return RegisterDefaultPatchBaselineRequest{Request: req, Input: input, Copy: c.RegisterDefaultPatchBaselineRequest} } const opRegisterPatchBaselineForPatchGroup = "RegisterPatchBaselineForPatchGroup" @@ -4629,6 +4673,7 @@ const opRegisterPatchBaselineForPatchGroup = "RegisterPatchBaselineForPatchGroup type RegisterPatchBaselineForPatchGroupRequest struct { *aws.Request Input *RegisterPatchBaselineForPatchGroupInput + Copy func(*RegisterPatchBaselineForPatchGroupInput) RegisterPatchBaselineForPatchGroupRequest } // Send marshals and sends the RegisterPatchBaselineForPatchGroup API request. @@ -4669,7 +4714,7 @@ func (c *SSM) RegisterPatchBaselineForPatchGroupRequest(input *RegisterPatchBase req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterPatchBaselineForPatchGroupRequest{Request: req, Input: input} + return RegisterPatchBaselineForPatchGroupRequest{Request: req, Input: input, Copy: c.RegisterPatchBaselineForPatchGroupRequest} } const opRegisterTargetWithMaintenanceWindow = "RegisterTargetWithMaintenanceWindow" @@ -4678,6 +4723,7 @@ const opRegisterTargetWithMaintenanceWindow = "RegisterTargetWithMaintenanceWind type RegisterTargetWithMaintenanceWindowRequest struct { *aws.Request Input *RegisterTargetWithMaintenanceWindowInput + Copy func(*RegisterTargetWithMaintenanceWindowInput) RegisterTargetWithMaintenanceWindowRequest } // Send marshals and sends the RegisterTargetWithMaintenanceWindow API request. @@ -4718,7 +4764,7 @@ func (c *SSM) RegisterTargetWithMaintenanceWindowRequest(input *RegisterTargetWi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterTargetWithMaintenanceWindowRequest{Request: req, Input: input} + return RegisterTargetWithMaintenanceWindowRequest{Request: req, Input: input, Copy: c.RegisterTargetWithMaintenanceWindowRequest} } const opRegisterTaskWithMaintenanceWindow = "RegisterTaskWithMaintenanceWindow" @@ -4727,6 +4773,7 @@ const opRegisterTaskWithMaintenanceWindow = "RegisterTaskWithMaintenanceWindow" type RegisterTaskWithMaintenanceWindowRequest struct { *aws.Request Input *RegisterTaskWithMaintenanceWindowInput + Copy func(*RegisterTaskWithMaintenanceWindowInput) RegisterTaskWithMaintenanceWindowRequest } // Send marshals and sends the RegisterTaskWithMaintenanceWindow API request. @@ -4767,7 +4814,7 @@ func (c *SSM) RegisterTaskWithMaintenanceWindowRequest(input *RegisterTaskWithMa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterTaskWithMaintenanceWindowRequest{Request: req, Input: input} + return RegisterTaskWithMaintenanceWindowRequest{Request: req, Input: input, Copy: c.RegisterTaskWithMaintenanceWindowRequest} } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -4776,6 +4823,7 @@ const opRemoveTagsFromResource = "RemoveTagsFromResource" type RemoveTagsFromResourceRequest struct { *aws.Request Input *RemoveTagsFromResourceInput + Copy func(*RemoveTagsFromResourceInput) RemoveTagsFromResourceRequest } // Send marshals and sends the RemoveTagsFromResource API request. @@ -4816,7 +4864,7 @@ func (c *SSM) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromResourceRequest{Request: req, Input: input} + return RemoveTagsFromResourceRequest{Request: req, Input: input, Copy: c.RemoveTagsFromResourceRequest} } const opSendAutomationSignal = "SendAutomationSignal" @@ -4825,6 +4873,7 @@ const opSendAutomationSignal = "SendAutomationSignal" type SendAutomationSignalRequest struct { *aws.Request Input *SendAutomationSignalInput + Copy func(*SendAutomationSignalInput) SendAutomationSignalRequest } // Send marshals and sends the SendAutomationSignal API request. @@ -4866,7 +4915,7 @@ func (c *SSM) SendAutomationSignalRequest(input *SendAutomationSignalInput) Send req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendAutomationSignalRequest{Request: req, Input: input} + return SendAutomationSignalRequest{Request: req, Input: input, Copy: c.SendAutomationSignalRequest} } const opSendCommand = "SendCommand" @@ -4875,6 +4924,7 @@ const opSendCommand = "SendCommand" type SendCommandRequest struct { *aws.Request Input *SendCommandInput + Copy func(*SendCommandInput) SendCommandRequest } // Send marshals and sends the SendCommand API request. @@ -4915,7 +4965,7 @@ func (c *SSM) SendCommandRequest(input *SendCommandInput) SendCommandRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SendCommandRequest{Request: req, Input: input} + return SendCommandRequest{Request: req, Input: input, Copy: c.SendCommandRequest} } const opStartAutomationExecution = "StartAutomationExecution" @@ -4924,6 +4974,7 @@ const opStartAutomationExecution = "StartAutomationExecution" type StartAutomationExecutionRequest struct { *aws.Request Input *StartAutomationExecutionInput + Copy func(*StartAutomationExecutionInput) StartAutomationExecutionRequest } // Send marshals and sends the StartAutomationExecution API request. @@ -4964,7 +5015,7 @@ func (c *SSM) StartAutomationExecutionRequest(input *StartAutomationExecutionInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartAutomationExecutionRequest{Request: req, Input: input} + return StartAutomationExecutionRequest{Request: req, Input: input, Copy: c.StartAutomationExecutionRequest} } const opStopAutomationExecution = "StopAutomationExecution" @@ -4973,6 +5024,7 @@ const opStopAutomationExecution = "StopAutomationExecution" type StopAutomationExecutionRequest struct { *aws.Request Input *StopAutomationExecutionInput + Copy func(*StopAutomationExecutionInput) StopAutomationExecutionRequest } // Send marshals and sends the StopAutomationExecution API request. @@ -5013,7 +5065,7 @@ func (c *SSM) StopAutomationExecutionRequest(input *StopAutomationExecutionInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopAutomationExecutionRequest{Request: req, Input: input} + return StopAutomationExecutionRequest{Request: req, Input: input, Copy: c.StopAutomationExecutionRequest} } const opUpdateAssociation = "UpdateAssociation" @@ -5022,6 +5074,7 @@ const opUpdateAssociation = "UpdateAssociation" type UpdateAssociationRequest struct { *aws.Request Input *UpdateAssociationInput + Copy func(*UpdateAssociationInput) UpdateAssociationRequest } // Send marshals and sends the UpdateAssociation API request. @@ -5063,7 +5116,7 @@ func (c *SSM) UpdateAssociationRequest(input *UpdateAssociationInput) UpdateAsso req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAssociationRequest{Request: req, Input: input} + return UpdateAssociationRequest{Request: req, Input: input, Copy: c.UpdateAssociationRequest} } const opUpdateAssociationStatus = "UpdateAssociationStatus" @@ -5072,6 +5125,7 @@ const opUpdateAssociationStatus = "UpdateAssociationStatus" type UpdateAssociationStatusRequest struct { *aws.Request Input *UpdateAssociationStatusInput + Copy func(*UpdateAssociationStatusInput) UpdateAssociationStatusRequest } // Send marshals and sends the UpdateAssociationStatus API request. @@ -5113,7 +5167,7 @@ func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateAssociationStatusRequest{Request: req, Input: input} + return UpdateAssociationStatusRequest{Request: req, Input: input, Copy: c.UpdateAssociationStatusRequest} } const opUpdateDocument = "UpdateDocument" @@ -5122,6 +5176,7 @@ const opUpdateDocument = "UpdateDocument" type UpdateDocumentRequest struct { *aws.Request Input *UpdateDocumentInput + Copy func(*UpdateDocumentInput) UpdateDocumentRequest } // Send marshals and sends the UpdateDocument API request. @@ -5162,7 +5217,7 @@ func (c *SSM) UpdateDocumentRequest(input *UpdateDocumentInput) UpdateDocumentRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDocumentRequest{Request: req, Input: input} + return UpdateDocumentRequest{Request: req, Input: input, Copy: c.UpdateDocumentRequest} } const opUpdateDocumentDefaultVersion = "UpdateDocumentDefaultVersion" @@ -5171,6 +5226,7 @@ const opUpdateDocumentDefaultVersion = "UpdateDocumentDefaultVersion" type UpdateDocumentDefaultVersionRequest struct { *aws.Request Input *UpdateDocumentDefaultVersionInput + Copy func(*UpdateDocumentDefaultVersionInput) UpdateDocumentDefaultVersionRequest } // Send marshals and sends the UpdateDocumentDefaultVersion API request. @@ -5211,7 +5267,7 @@ func (c *SSM) UpdateDocumentDefaultVersionRequest(input *UpdateDocumentDefaultVe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateDocumentDefaultVersionRequest{Request: req, Input: input} + return UpdateDocumentDefaultVersionRequest{Request: req, Input: input, Copy: c.UpdateDocumentDefaultVersionRequest} } const opUpdateMaintenanceWindow = "UpdateMaintenanceWindow" @@ -5220,6 +5276,7 @@ const opUpdateMaintenanceWindow = "UpdateMaintenanceWindow" type UpdateMaintenanceWindowRequest struct { *aws.Request Input *UpdateMaintenanceWindowInput + Copy func(*UpdateMaintenanceWindowInput) UpdateMaintenanceWindowRequest } // Send marshals and sends the UpdateMaintenanceWindow API request. @@ -5260,7 +5317,7 @@ func (c *SSM) UpdateMaintenanceWindowRequest(input *UpdateMaintenanceWindowInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateMaintenanceWindowRequest{Request: req, Input: input} + return UpdateMaintenanceWindowRequest{Request: req, Input: input, Copy: c.UpdateMaintenanceWindowRequest} } const opUpdateMaintenanceWindowTarget = "UpdateMaintenanceWindowTarget" @@ -5269,6 +5326,7 @@ const opUpdateMaintenanceWindowTarget = "UpdateMaintenanceWindowTarget" type UpdateMaintenanceWindowTargetRequest struct { *aws.Request Input *UpdateMaintenanceWindowTargetInput + Copy func(*UpdateMaintenanceWindowTargetInput) UpdateMaintenanceWindowTargetRequest } // Send marshals and sends the UpdateMaintenanceWindowTarget API request. @@ -5325,7 +5383,7 @@ func (c *SSM) UpdateMaintenanceWindowTargetRequest(input *UpdateMaintenanceWindo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateMaintenanceWindowTargetRequest{Request: req, Input: input} + return UpdateMaintenanceWindowTargetRequest{Request: req, Input: input, Copy: c.UpdateMaintenanceWindowTargetRequest} } const opUpdateMaintenanceWindowTask = "UpdateMaintenanceWindowTask" @@ -5334,6 +5392,7 @@ const opUpdateMaintenanceWindowTask = "UpdateMaintenanceWindowTask" type UpdateMaintenanceWindowTaskRequest struct { *aws.Request Input *UpdateMaintenanceWindowTaskInput + Copy func(*UpdateMaintenanceWindowTaskInput) UpdateMaintenanceWindowTaskRequest } // Send marshals and sends the UpdateMaintenanceWindowTask API request. @@ -5393,7 +5452,7 @@ func (c *SSM) UpdateMaintenanceWindowTaskRequest(input *UpdateMaintenanceWindowT req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateMaintenanceWindowTaskRequest{Request: req, Input: input} + return UpdateMaintenanceWindowTaskRequest{Request: req, Input: input, Copy: c.UpdateMaintenanceWindowTaskRequest} } const opUpdateManagedInstanceRole = "UpdateManagedInstanceRole" @@ -5402,6 +5461,7 @@ const opUpdateManagedInstanceRole = "UpdateManagedInstanceRole" type UpdateManagedInstanceRoleRequest struct { *aws.Request Input *UpdateManagedInstanceRoleInput + Copy func(*UpdateManagedInstanceRoleInput) UpdateManagedInstanceRoleRequest } // Send marshals and sends the UpdateManagedInstanceRole API request. @@ -5443,7 +5503,7 @@ func (c *SSM) UpdateManagedInstanceRoleRequest(input *UpdateManagedInstanceRoleI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateManagedInstanceRoleRequest{Request: req, Input: input} + return UpdateManagedInstanceRoleRequest{Request: req, Input: input, Copy: c.UpdateManagedInstanceRoleRequest} } const opUpdatePatchBaseline = "UpdatePatchBaseline" @@ -5452,6 +5512,7 @@ const opUpdatePatchBaseline = "UpdatePatchBaseline" type UpdatePatchBaselineRequest struct { *aws.Request Input *UpdatePatchBaselineInput + Copy func(*UpdatePatchBaselineInput) UpdatePatchBaselineRequest } // Send marshals and sends the UpdatePatchBaseline API request. @@ -5496,7 +5557,7 @@ func (c *SSM) UpdatePatchBaselineRequest(input *UpdatePatchBaselineInput) Update req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePatchBaselineRequest{Request: req, Input: input} + return UpdatePatchBaselineRequest{Request: req, Input: input, Copy: c.UpdatePatchBaselineRequest} } // An activation registers one or more on-premises servers or virtual machines diff --git a/service/ssm/ssmiface/interface.go b/service/ssm/ssmiface/interface.go index f30430da78c..46561ad167d 100644 --- a/service/ssm/ssmiface/interface.go +++ b/service/ssm/ssmiface/interface.go @@ -9,7 +9,6 @@ package ssmiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ssm" ) @@ -107,9 +106,6 @@ type SSMAPI interface { DescribeActivationsRequest(*ssm.DescribeActivationsInput) ssm.DescribeActivationsRequest - DescribeActivationsPages(*ssm.DescribeActivationsInput, func(*ssm.DescribeActivationsOutput, bool) bool) error - DescribeActivationsPagesWithContext(aws.Context, *ssm.DescribeActivationsInput, func(*ssm.DescribeActivationsOutput, bool) bool, ...aws.Option) error - DescribeAssociationRequest(*ssm.DescribeAssociationInput) ssm.DescribeAssociationRequest DescribeAutomationExecutionsRequest(*ssm.DescribeAutomationExecutionsInput) ssm.DescribeAutomationExecutionsRequest @@ -130,9 +126,6 @@ type SSMAPI interface { DescribeInstanceInformationRequest(*ssm.DescribeInstanceInformationInput) ssm.DescribeInstanceInformationRequest - DescribeInstanceInformationPages(*ssm.DescribeInstanceInformationInput, func(*ssm.DescribeInstanceInformationOutput, bool) bool) error - DescribeInstanceInformationPagesWithContext(aws.Context, *ssm.DescribeInstanceInformationInput, func(*ssm.DescribeInstanceInformationOutput, bool) bool, ...aws.Option) error - DescribeInstancePatchStatesRequest(*ssm.DescribeInstancePatchStatesInput) ssm.DescribeInstancePatchStatesRequest DescribeInstancePatchStatesForPatchGroupRequest(*ssm.DescribeInstancePatchStatesForPatchGroupInput) ssm.DescribeInstancePatchStatesForPatchGroupRequest @@ -153,9 +146,6 @@ type SSMAPI interface { DescribeParametersRequest(*ssm.DescribeParametersInput) ssm.DescribeParametersRequest - DescribeParametersPages(*ssm.DescribeParametersInput, func(*ssm.DescribeParametersOutput, bool) bool) error - DescribeParametersPagesWithContext(aws.Context, *ssm.DescribeParametersInput, func(*ssm.DescribeParametersOutput, bool) bool, ...aws.Option) error - DescribePatchBaselinesRequest(*ssm.DescribePatchBaselinesInput) ssm.DescribePatchBaselinesRequest DescribePatchGroupStateRequest(*ssm.DescribePatchGroupStateInput) ssm.DescribePatchGroupStateRequest @@ -190,16 +180,10 @@ type SSMAPI interface { GetParameterHistoryRequest(*ssm.GetParameterHistoryInput) ssm.GetParameterHistoryRequest - GetParameterHistoryPages(*ssm.GetParameterHistoryInput, func(*ssm.GetParameterHistoryOutput, bool) bool) error - GetParameterHistoryPagesWithContext(aws.Context, *ssm.GetParameterHistoryInput, func(*ssm.GetParameterHistoryOutput, bool) bool, ...aws.Option) error - GetParametersRequest(*ssm.GetParametersInput) ssm.GetParametersRequest GetParametersByPathRequest(*ssm.GetParametersByPathInput) ssm.GetParametersByPathRequest - GetParametersByPathPages(*ssm.GetParametersByPathInput, func(*ssm.GetParametersByPathOutput, bool) bool) error - GetParametersByPathPagesWithContext(aws.Context, *ssm.GetParametersByPathInput, func(*ssm.GetParametersByPathOutput, bool) bool, ...aws.Option) error - GetPatchBaselineRequest(*ssm.GetPatchBaselineInput) ssm.GetPatchBaselineRequest GetPatchBaselineForPatchGroupRequest(*ssm.GetPatchBaselineForPatchGroupInput) ssm.GetPatchBaselineForPatchGroupRequest @@ -208,19 +192,10 @@ type SSMAPI interface { ListAssociationsRequest(*ssm.ListAssociationsInput) ssm.ListAssociationsRequest - ListAssociationsPages(*ssm.ListAssociationsInput, func(*ssm.ListAssociationsOutput, bool) bool) error - ListAssociationsPagesWithContext(aws.Context, *ssm.ListAssociationsInput, func(*ssm.ListAssociationsOutput, bool) bool, ...aws.Option) error - ListCommandInvocationsRequest(*ssm.ListCommandInvocationsInput) ssm.ListCommandInvocationsRequest - ListCommandInvocationsPages(*ssm.ListCommandInvocationsInput, func(*ssm.ListCommandInvocationsOutput, bool) bool) error - ListCommandInvocationsPagesWithContext(aws.Context, *ssm.ListCommandInvocationsInput, func(*ssm.ListCommandInvocationsOutput, bool) bool, ...aws.Option) error - ListCommandsRequest(*ssm.ListCommandsInput) ssm.ListCommandsRequest - ListCommandsPages(*ssm.ListCommandsInput, func(*ssm.ListCommandsOutput, bool) bool) error - ListCommandsPagesWithContext(aws.Context, *ssm.ListCommandsInput, func(*ssm.ListCommandsOutput, bool) bool, ...aws.Option) error - ListComplianceItemsRequest(*ssm.ListComplianceItemsInput) ssm.ListComplianceItemsRequest ListComplianceSummariesRequest(*ssm.ListComplianceSummariesInput) ssm.ListComplianceSummariesRequest @@ -229,9 +204,6 @@ type SSMAPI interface { ListDocumentsRequest(*ssm.ListDocumentsInput) ssm.ListDocumentsRequest - ListDocumentsPages(*ssm.ListDocumentsInput, func(*ssm.ListDocumentsOutput, bool) bool) error - ListDocumentsPagesWithContext(aws.Context, *ssm.ListDocumentsInput, func(*ssm.ListDocumentsOutput, bool) bool, ...aws.Option) error - ListInventoryEntriesRequest(*ssm.ListInventoryEntriesInput) ssm.ListInventoryEntriesRequest ListResourceComplianceSummariesRequest(*ssm.ListResourceComplianceSummariesInput) ssm.ListResourceComplianceSummariesRequest diff --git a/service/storagegateway/api.go b/service/storagegateway/api.go index 04710a0dfde..1da36d88a3f 100644 --- a/service/storagegateway/api.go +++ b/service/storagegateway/api.go @@ -16,6 +16,7 @@ const opActivateGateway = "ActivateGateway" type ActivateGatewayRequest struct { *aws.Request Input *ActivateGatewayInput + Copy func(*ActivateGatewayInput) ActivateGatewayRequest } // Send marshals and sends the ActivateGateway API request. @@ -64,7 +65,7 @@ func (c *StorageGateway) ActivateGatewayRequest(input *ActivateGatewayInput) Act req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ActivateGatewayRequest{Request: req, Input: input} + return ActivateGatewayRequest{Request: req, Input: input, Copy: c.ActivateGatewayRequest} } const opAddCache = "AddCache" @@ -73,6 +74,7 @@ const opAddCache = "AddCache" type AddCacheRequest struct { *aws.Request Input *AddCacheInput + Copy func(*AddCacheInput) AddCacheRequest } // Send marshals and sends the AddCache API request. @@ -119,7 +121,7 @@ func (c *StorageGateway) AddCacheRequest(input *AddCacheInput) AddCacheRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddCacheRequest{Request: req, Input: input} + return AddCacheRequest{Request: req, Input: input, Copy: c.AddCacheRequest} } const opAddTagsToResource = "AddTagsToResource" @@ -128,6 +130,7 @@ const opAddTagsToResource = "AddTagsToResource" type AddTagsToResourceRequest struct { *aws.Request Input *AddTagsToResourceInput + Copy func(*AddTagsToResourceInput) AddTagsToResourceRequest } // Send marshals and sends the AddTagsToResource API request. @@ -181,7 +184,7 @@ func (c *StorageGateway) AddTagsToResourceRequest(input *AddTagsToResourceInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddTagsToResourceRequest{Request: req, Input: input} + return AddTagsToResourceRequest{Request: req, Input: input, Copy: c.AddTagsToResourceRequest} } const opAddUploadBuffer = "AddUploadBuffer" @@ -190,6 +193,7 @@ const opAddUploadBuffer = "AddUploadBuffer" type AddUploadBufferRequest struct { *aws.Request Input *AddUploadBufferInput + Copy func(*AddUploadBufferInput) AddUploadBufferRequest } // Send marshals and sends the AddUploadBuffer API request. @@ -236,7 +240,7 @@ func (c *StorageGateway) AddUploadBufferRequest(input *AddUploadBufferInput) Add req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddUploadBufferRequest{Request: req, Input: input} + return AddUploadBufferRequest{Request: req, Input: input, Copy: c.AddUploadBufferRequest} } const opAddWorkingStorage = "AddWorkingStorage" @@ -245,6 +249,7 @@ const opAddWorkingStorage = "AddWorkingStorage" type AddWorkingStorageRequest struct { *aws.Request Input *AddWorkingStorageInput + Copy func(*AddWorkingStorageInput) AddWorkingStorageRequest } // Send marshals and sends the AddWorkingStorage API request. @@ -295,7 +300,7 @@ func (c *StorageGateway) AddWorkingStorageRequest(input *AddWorkingStorageInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddWorkingStorageRequest{Request: req, Input: input} + return AddWorkingStorageRequest{Request: req, Input: input, Copy: c.AddWorkingStorageRequest} } const opCancelArchival = "CancelArchival" @@ -304,6 +309,7 @@ const opCancelArchival = "CancelArchival" type CancelArchivalRequest struct { *aws.Request Input *CancelArchivalInput + Copy func(*CancelArchivalInput) CancelArchivalRequest } // Send marshals and sends the CancelArchival API request. @@ -346,7 +352,7 @@ func (c *StorageGateway) CancelArchivalRequest(input *CancelArchivalInput) Cance req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelArchivalRequest{Request: req, Input: input} + return CancelArchivalRequest{Request: req, Input: input, Copy: c.CancelArchivalRequest} } const opCancelRetrieval = "CancelRetrieval" @@ -355,6 +361,7 @@ const opCancelRetrieval = "CancelRetrieval" type CancelRetrievalRequest struct { *aws.Request Input *CancelRetrievalInput + Copy func(*CancelRetrievalInput) CancelRetrievalRequest } // Send marshals and sends the CancelRetrieval API request. @@ -397,7 +404,7 @@ func (c *StorageGateway) CancelRetrievalRequest(input *CancelRetrievalInput) Can req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CancelRetrievalRequest{Request: req, Input: input} + return CancelRetrievalRequest{Request: req, Input: input, Copy: c.CancelRetrievalRequest} } const opCreateCachediSCSIVolume = "CreateCachediSCSIVolume" @@ -406,6 +413,7 @@ const opCreateCachediSCSIVolume = "CreateCachediSCSIVolume" type CreateCachediSCSIVolumeRequest struct { *aws.Request Input *CreateCachediSCSIVolumeInput + Copy func(*CreateCachediSCSIVolumeInput) CreateCachediSCSIVolumeRequest } // Send marshals and sends the CreateCachediSCSIVolume API request. @@ -462,7 +470,7 @@ func (c *StorageGateway) CreateCachediSCSIVolumeRequest(input *CreateCachediSCSI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCachediSCSIVolumeRequest{Request: req, Input: input} + return CreateCachediSCSIVolumeRequest{Request: req, Input: input, Copy: c.CreateCachediSCSIVolumeRequest} } const opCreateNFSFileShare = "CreateNFSFileShare" @@ -471,6 +479,7 @@ const opCreateNFSFileShare = "CreateNFSFileShare" type CreateNFSFileShareRequest struct { *aws.Request Input *CreateNFSFileShareInput + Copy func(*CreateNFSFileShareInput) CreateNFSFileShareRequest } // Send marshals and sends the CreateNFSFileShare API request. @@ -523,7 +532,7 @@ func (c *StorageGateway) CreateNFSFileShareRequest(input *CreateNFSFileShareInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNFSFileShareRequest{Request: req, Input: input} + return CreateNFSFileShareRequest{Request: req, Input: input, Copy: c.CreateNFSFileShareRequest} } const opCreateSnapshot = "CreateSnapshot" @@ -532,6 +541,7 @@ const opCreateSnapshot = "CreateSnapshot" type CreateSnapshotRequest struct { *aws.Request Input *CreateSnapshotInput + Copy func(*CreateSnapshotInput) CreateSnapshotRequest } // Send marshals and sends the CreateSnapshot API request. @@ -595,7 +605,7 @@ func (c *StorageGateway) CreateSnapshotRequest(input *CreateSnapshotInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSnapshotRequest{Request: req, Input: input} + return CreateSnapshotRequest{Request: req, Input: input, Copy: c.CreateSnapshotRequest} } const opCreateSnapshotFromVolumeRecoveryPoint = "CreateSnapshotFromVolumeRecoveryPoint" @@ -604,6 +614,7 @@ const opCreateSnapshotFromVolumeRecoveryPoint = "CreateSnapshotFromVolumeRecover type CreateSnapshotFromVolumeRecoveryPointRequest struct { *aws.Request Input *CreateSnapshotFromVolumeRecoveryPointInput + Copy func(*CreateSnapshotFromVolumeRecoveryPointInput) CreateSnapshotFromVolumeRecoveryPointRequest } // Send marshals and sends the CreateSnapshotFromVolumeRecoveryPoint API request. @@ -660,7 +671,7 @@ func (c *StorageGateway) CreateSnapshotFromVolumeRecoveryPointRequest(input *Cre req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSnapshotFromVolumeRecoveryPointRequest{Request: req, Input: input} + return CreateSnapshotFromVolumeRecoveryPointRequest{Request: req, Input: input, Copy: c.CreateSnapshotFromVolumeRecoveryPointRequest} } const opCreateStorediSCSIVolume = "CreateStorediSCSIVolume" @@ -669,6 +680,7 @@ const opCreateStorediSCSIVolume = "CreateStorediSCSIVolume" type CreateStorediSCSIVolumeRequest struct { *aws.Request Input *CreateStorediSCSIVolumeInput + Copy func(*CreateStorediSCSIVolumeInput) CreateStorediSCSIVolumeRequest } // Send marshals and sends the CreateStorediSCSIVolume API request. @@ -721,7 +733,7 @@ func (c *StorageGateway) CreateStorediSCSIVolumeRequest(input *CreateStorediSCSI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateStorediSCSIVolumeRequest{Request: req, Input: input} + return CreateStorediSCSIVolumeRequest{Request: req, Input: input, Copy: c.CreateStorediSCSIVolumeRequest} } const opCreateTapeWithBarcode = "CreateTapeWithBarcode" @@ -730,6 +742,7 @@ const opCreateTapeWithBarcode = "CreateTapeWithBarcode" type CreateTapeWithBarcodeRequest struct { *aws.Request Input *CreateTapeWithBarcodeInput + Copy func(*CreateTapeWithBarcodeInput) CreateTapeWithBarcodeRequest } // Send marshals and sends the CreateTapeWithBarcode API request. @@ -776,7 +789,7 @@ func (c *StorageGateway) CreateTapeWithBarcodeRequest(input *CreateTapeWithBarco req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTapeWithBarcodeRequest{Request: req, Input: input} + return CreateTapeWithBarcodeRequest{Request: req, Input: input, Copy: c.CreateTapeWithBarcodeRequest} } const opCreateTapes = "CreateTapes" @@ -785,6 +798,7 @@ const opCreateTapes = "CreateTapes" type CreateTapesRequest struct { *aws.Request Input *CreateTapesInput + Copy func(*CreateTapesInput) CreateTapesRequest } // Send marshals and sends the CreateTapes API request. @@ -830,7 +844,7 @@ func (c *StorageGateway) CreateTapesRequest(input *CreateTapesInput) CreateTapes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTapesRequest{Request: req, Input: input} + return CreateTapesRequest{Request: req, Input: input, Copy: c.CreateTapesRequest} } const opDeleteBandwidthRateLimit = "DeleteBandwidthRateLimit" @@ -839,6 +853,7 @@ const opDeleteBandwidthRateLimit = "DeleteBandwidthRateLimit" type DeleteBandwidthRateLimitRequest struct { *aws.Request Input *DeleteBandwidthRateLimitInput + Copy func(*DeleteBandwidthRateLimitInput) DeleteBandwidthRateLimitRequest } // Send marshals and sends the DeleteBandwidthRateLimit API request. @@ -883,7 +898,7 @@ func (c *StorageGateway) DeleteBandwidthRateLimitRequest(input *DeleteBandwidthR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteBandwidthRateLimitRequest{Request: req, Input: input} + return DeleteBandwidthRateLimitRequest{Request: req, Input: input, Copy: c.DeleteBandwidthRateLimitRequest} } const opDeleteChapCredentials = "DeleteChapCredentials" @@ -892,6 +907,7 @@ const opDeleteChapCredentials = "DeleteChapCredentials" type DeleteChapCredentialsRequest struct { *aws.Request Input *DeleteChapCredentialsInput + Copy func(*DeleteChapCredentialsInput) DeleteChapCredentialsRequest } // Send marshals and sends the DeleteChapCredentials API request. @@ -933,7 +949,7 @@ func (c *StorageGateway) DeleteChapCredentialsRequest(input *DeleteChapCredentia req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteChapCredentialsRequest{Request: req, Input: input} + return DeleteChapCredentialsRequest{Request: req, Input: input, Copy: c.DeleteChapCredentialsRequest} } const opDeleteFileShare = "DeleteFileShare" @@ -942,6 +958,7 @@ const opDeleteFileShare = "DeleteFileShare" type DeleteFileShareRequest struct { *aws.Request Input *DeleteFileShareInput + Copy func(*DeleteFileShareInput) DeleteFileShareRequest } // Send marshals and sends the DeleteFileShare API request. @@ -983,7 +1000,7 @@ func (c *StorageGateway) DeleteFileShareRequest(input *DeleteFileShareInput) Del req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteFileShareRequest{Request: req, Input: input} + return DeleteFileShareRequest{Request: req, Input: input, Copy: c.DeleteFileShareRequest} } const opDeleteGateway = "DeleteGateway" @@ -992,6 +1009,7 @@ const opDeleteGateway = "DeleteGateway" type DeleteGatewayRequest struct { *aws.Request Input *DeleteGatewayInput + Copy func(*DeleteGatewayInput) DeleteGatewayRequest } // Send marshals and sends the DeleteGateway API request. @@ -1047,7 +1065,7 @@ func (c *StorageGateway) DeleteGatewayRequest(input *DeleteGatewayInput) DeleteG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGatewayRequest{Request: req, Input: input} + return DeleteGatewayRequest{Request: req, Input: input, Copy: c.DeleteGatewayRequest} } const opDeleteSnapshotSchedule = "DeleteSnapshotSchedule" @@ -1056,6 +1074,7 @@ const opDeleteSnapshotSchedule = "DeleteSnapshotSchedule" type DeleteSnapshotScheduleRequest struct { *aws.Request Input *DeleteSnapshotScheduleInput + Copy func(*DeleteSnapshotScheduleInput) DeleteSnapshotScheduleRequest } // Send marshals and sends the DeleteSnapshotSchedule API request. @@ -1106,7 +1125,7 @@ func (c *StorageGateway) DeleteSnapshotScheduleRequest(input *DeleteSnapshotSche req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSnapshotScheduleRequest{Request: req, Input: input} + return DeleteSnapshotScheduleRequest{Request: req, Input: input, Copy: c.DeleteSnapshotScheduleRequest} } const opDeleteTape = "DeleteTape" @@ -1115,6 +1134,7 @@ const opDeleteTape = "DeleteTape" type DeleteTapeRequest struct { *aws.Request Input *DeleteTapeInput + Copy func(*DeleteTapeInput) DeleteTapeRequest } // Send marshals and sends the DeleteTape API request. @@ -1156,7 +1176,7 @@ func (c *StorageGateway) DeleteTapeRequest(input *DeleteTapeInput) DeleteTapeReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTapeRequest{Request: req, Input: input} + return DeleteTapeRequest{Request: req, Input: input, Copy: c.DeleteTapeRequest} } const opDeleteTapeArchive = "DeleteTapeArchive" @@ -1165,6 +1185,7 @@ const opDeleteTapeArchive = "DeleteTapeArchive" type DeleteTapeArchiveRequest struct { *aws.Request Input *DeleteTapeArchiveInput + Copy func(*DeleteTapeArchiveInput) DeleteTapeArchiveRequest } // Send marshals and sends the DeleteTapeArchive API request. @@ -1206,7 +1227,7 @@ func (c *StorageGateway) DeleteTapeArchiveRequest(input *DeleteTapeArchiveInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTapeArchiveRequest{Request: req, Input: input} + return DeleteTapeArchiveRequest{Request: req, Input: input, Copy: c.DeleteTapeArchiveRequest} } const opDeleteVolume = "DeleteVolume" @@ -1215,6 +1236,7 @@ const opDeleteVolume = "DeleteVolume" type DeleteVolumeRequest struct { *aws.Request Input *DeleteVolumeInput + Copy func(*DeleteVolumeInput) DeleteVolumeRequest } // Send marshals and sends the DeleteVolume API request. @@ -1269,7 +1291,7 @@ func (c *StorageGateway) DeleteVolumeRequest(input *DeleteVolumeInput) DeleteVol req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteVolumeRequest{Request: req, Input: input} + return DeleteVolumeRequest{Request: req, Input: input, Copy: c.DeleteVolumeRequest} } const opDescribeBandwidthRateLimit = "DescribeBandwidthRateLimit" @@ -1278,6 +1300,7 @@ const opDescribeBandwidthRateLimit = "DescribeBandwidthRateLimit" type DescribeBandwidthRateLimitRequest struct { *aws.Request Input *DescribeBandwidthRateLimitInput + Copy func(*DescribeBandwidthRateLimitInput) DescribeBandwidthRateLimitRequest } // Send marshals and sends the DescribeBandwidthRateLimit API request. @@ -1324,7 +1347,7 @@ func (c *StorageGateway) DescribeBandwidthRateLimitRequest(input *DescribeBandwi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeBandwidthRateLimitRequest{Request: req, Input: input} + return DescribeBandwidthRateLimitRequest{Request: req, Input: input, Copy: c.DescribeBandwidthRateLimitRequest} } const opDescribeCache = "DescribeCache" @@ -1333,6 +1356,7 @@ const opDescribeCache = "DescribeCache" type DescribeCacheRequest struct { *aws.Request Input *DescribeCacheInput + Copy func(*DescribeCacheInput) DescribeCacheRequest } // Send marshals and sends the DescribeCache API request. @@ -1377,7 +1401,7 @@ func (c *StorageGateway) DescribeCacheRequest(input *DescribeCacheInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCacheRequest{Request: req, Input: input} + return DescribeCacheRequest{Request: req, Input: input, Copy: c.DescribeCacheRequest} } const opDescribeCachediSCSIVolumes = "DescribeCachediSCSIVolumes" @@ -1386,6 +1410,7 @@ const opDescribeCachediSCSIVolumes = "DescribeCachediSCSIVolumes" type DescribeCachediSCSIVolumesRequest struct { *aws.Request Input *DescribeCachediSCSIVolumesInput + Copy func(*DescribeCachediSCSIVolumesInput) DescribeCachediSCSIVolumesRequest } // Send marshals and sends the DescribeCachediSCSIVolumes API request. @@ -1431,7 +1456,7 @@ func (c *StorageGateway) DescribeCachediSCSIVolumesRequest(input *DescribeCached req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCachediSCSIVolumesRequest{Request: req, Input: input} + return DescribeCachediSCSIVolumesRequest{Request: req, Input: input, Copy: c.DescribeCachediSCSIVolumesRequest} } const opDescribeChapCredentials = "DescribeChapCredentials" @@ -1440,6 +1465,7 @@ const opDescribeChapCredentials = "DescribeChapCredentials" type DescribeChapCredentialsRequest struct { *aws.Request Input *DescribeChapCredentialsInput + Copy func(*DescribeChapCredentialsInput) DescribeChapCredentialsRequest } // Send marshals and sends the DescribeChapCredentials API request. @@ -1481,7 +1507,7 @@ func (c *StorageGateway) DescribeChapCredentialsRequest(input *DescribeChapCrede req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeChapCredentialsRequest{Request: req, Input: input} + return DescribeChapCredentialsRequest{Request: req, Input: input, Copy: c.DescribeChapCredentialsRequest} } const opDescribeGatewayInformation = "DescribeGatewayInformation" @@ -1490,6 +1516,7 @@ const opDescribeGatewayInformation = "DescribeGatewayInformation" type DescribeGatewayInformationRequest struct { *aws.Request Input *DescribeGatewayInformationInput + Copy func(*DescribeGatewayInformationInput) DescribeGatewayInformationRequest } // Send marshals and sends the DescribeGatewayInformation API request. @@ -1533,7 +1560,7 @@ func (c *StorageGateway) DescribeGatewayInformationRequest(input *DescribeGatewa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeGatewayInformationRequest{Request: req, Input: input} + return DescribeGatewayInformationRequest{Request: req, Input: input, Copy: c.DescribeGatewayInformationRequest} } const opDescribeMaintenanceStartTime = "DescribeMaintenanceStartTime" @@ -1542,6 +1569,7 @@ const opDescribeMaintenanceStartTime = "DescribeMaintenanceStartTime" type DescribeMaintenanceStartTimeRequest struct { *aws.Request Input *DescribeMaintenanceStartTimeInput + Copy func(*DescribeMaintenanceStartTimeInput) DescribeMaintenanceStartTimeRequest } // Send marshals and sends the DescribeMaintenanceStartTime API request. @@ -1583,7 +1611,7 @@ func (c *StorageGateway) DescribeMaintenanceStartTimeRequest(input *DescribeMain req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeMaintenanceStartTimeRequest{Request: req, Input: input} + return DescribeMaintenanceStartTimeRequest{Request: req, Input: input, Copy: c.DescribeMaintenanceStartTimeRequest} } const opDescribeNFSFileShares = "DescribeNFSFileShares" @@ -1592,6 +1620,7 @@ const opDescribeNFSFileShares = "DescribeNFSFileShares" type DescribeNFSFileSharesRequest struct { *aws.Request Input *DescribeNFSFileSharesInput + Copy func(*DescribeNFSFileSharesInput) DescribeNFSFileSharesRequest } // Send marshals and sends the DescribeNFSFileShares API request. @@ -1633,7 +1662,7 @@ func (c *StorageGateway) DescribeNFSFileSharesRequest(input *DescribeNFSFileShar req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNFSFileSharesRequest{Request: req, Input: input} + return DescribeNFSFileSharesRequest{Request: req, Input: input, Copy: c.DescribeNFSFileSharesRequest} } const opDescribeSnapshotSchedule = "DescribeSnapshotSchedule" @@ -1642,6 +1671,7 @@ const opDescribeSnapshotSchedule = "DescribeSnapshotSchedule" type DescribeSnapshotScheduleRequest struct { *aws.Request Input *DescribeSnapshotScheduleInput + Copy func(*DescribeSnapshotScheduleInput) DescribeSnapshotScheduleRequest } // Send marshals and sends the DescribeSnapshotSchedule API request. @@ -1685,7 +1715,7 @@ func (c *StorageGateway) DescribeSnapshotScheduleRequest(input *DescribeSnapshot req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSnapshotScheduleRequest{Request: req, Input: input} + return DescribeSnapshotScheduleRequest{Request: req, Input: input, Copy: c.DescribeSnapshotScheduleRequest} } const opDescribeStorediSCSIVolumes = "DescribeStorediSCSIVolumes" @@ -1694,6 +1724,7 @@ const opDescribeStorediSCSIVolumes = "DescribeStorediSCSIVolumes" type DescribeStorediSCSIVolumesRequest struct { *aws.Request Input *DescribeStorediSCSIVolumesInput + Copy func(*DescribeStorediSCSIVolumesInput) DescribeStorediSCSIVolumesRequest } // Send marshals and sends the DescribeStorediSCSIVolumes API request. @@ -1737,7 +1768,7 @@ func (c *StorageGateway) DescribeStorediSCSIVolumesRequest(input *DescribeStored req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeStorediSCSIVolumesRequest{Request: req, Input: input} + return DescribeStorediSCSIVolumesRequest{Request: req, Input: input, Copy: c.DescribeStorediSCSIVolumesRequest} } const opDescribeTapeArchives = "DescribeTapeArchives" @@ -1746,6 +1777,7 @@ const opDescribeTapeArchives = "DescribeTapeArchives" type DescribeTapeArchivesRequest struct { *aws.Request Input *DescribeTapeArchivesInput + Copy func(*DescribeTapeArchivesInput) DescribeTapeArchivesRequest } // Send marshals and sends the DescribeTapeArchives API request. @@ -1796,57 +1828,53 @@ func (c *StorageGateway) DescribeTapeArchivesRequest(input *DescribeTapeArchives req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTapeArchivesRequest{Request: req, Input: input} + return DescribeTapeArchivesRequest{Request: req, Input: input, Copy: c.DescribeTapeArchivesRequest} } -// DescribeTapeArchivesPages iterates over the pages of a DescribeTapeArchives operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTapeArchives method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeTapeArchivesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeTapeArchives operation. -// pageNum := 0 -// err := client.DescribeTapeArchivesPages(params, -// func(page *DescribeTapeArchivesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *StorageGateway) DescribeTapeArchivesPages(input *DescribeTapeArchivesInput, fn func(*DescribeTapeArchivesOutput, bool) bool) error { - return c.DescribeTapeArchivesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTapeArchivesPagesWithContext same as DescribeTapeArchivesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *StorageGateway) DescribeTapeArchivesPagesWithContext(ctx aws.Context, input *DescribeTapeArchivesInput, fn func(*DescribeTapeArchivesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeTapeArchivesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeTapeArchivesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeTapeArchivesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeTapeArchivesRequest) Paginate(opts ...aws.Option) DescribeTapeArchivesPager { + return DescribeTapeArchivesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeTapeArchivesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTapeArchivesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeTapeArchivesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeTapeArchivesPager struct { + aws.Pager +} + +func (p *DescribeTapeArchivesPager) CurrentPage() *DescribeTapeArchivesOutput { + return p.Pager.CurrentPage().(*DescribeTapeArchivesOutput) } const opDescribeTapeRecoveryPoints = "DescribeTapeRecoveryPoints" @@ -1855,6 +1883,7 @@ const opDescribeTapeRecoveryPoints = "DescribeTapeRecoveryPoints" type DescribeTapeRecoveryPointsRequest struct { *aws.Request Input *DescribeTapeRecoveryPointsInput + Copy func(*DescribeTapeRecoveryPointsInput) DescribeTapeRecoveryPointsRequest } // Send marshals and sends the DescribeTapeRecoveryPoints API request. @@ -1907,57 +1936,53 @@ func (c *StorageGateway) DescribeTapeRecoveryPointsRequest(input *DescribeTapeRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTapeRecoveryPointsRequest{Request: req, Input: input} + return DescribeTapeRecoveryPointsRequest{Request: req, Input: input, Copy: c.DescribeTapeRecoveryPointsRequest} } -// DescribeTapeRecoveryPointsPages iterates over the pages of a DescribeTapeRecoveryPoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTapeRecoveryPoints method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeTapeRecoveryPointsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeTapeRecoveryPoints operation. -// pageNum := 0 -// err := client.DescribeTapeRecoveryPointsPages(params, -// func(page *DescribeTapeRecoveryPointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *StorageGateway) DescribeTapeRecoveryPointsPages(input *DescribeTapeRecoveryPointsInput, fn func(*DescribeTapeRecoveryPointsOutput, bool) bool) error { - return c.DescribeTapeRecoveryPointsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTapeRecoveryPointsPagesWithContext same as DescribeTapeRecoveryPointsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *StorageGateway) DescribeTapeRecoveryPointsPagesWithContext(ctx aws.Context, input *DescribeTapeRecoveryPointsInput, fn func(*DescribeTapeRecoveryPointsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeTapeRecoveryPointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeTapeRecoveryPointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeTapeRecoveryPointsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeTapeRecoveryPointsRequest) Paginate(opts ...aws.Option) DescribeTapeRecoveryPointsPager { + return DescribeTapeRecoveryPointsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeTapeRecoveryPointsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTapeRecoveryPointsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeTapeRecoveryPointsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeTapeRecoveryPointsPager struct { + aws.Pager +} + +func (p *DescribeTapeRecoveryPointsPager) CurrentPage() *DescribeTapeRecoveryPointsOutput { + return p.Pager.CurrentPage().(*DescribeTapeRecoveryPointsOutput) } const opDescribeTapes = "DescribeTapes" @@ -1966,6 +1991,7 @@ const opDescribeTapes = "DescribeTapes" type DescribeTapesRequest struct { *aws.Request Input *DescribeTapesInput + Copy func(*DescribeTapesInput) DescribeTapesRequest } // Send marshals and sends the DescribeTapes API request. @@ -2015,57 +2041,53 @@ func (c *StorageGateway) DescribeTapesRequest(input *DescribeTapesInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTapesRequest{Request: req, Input: input} + return DescribeTapesRequest{Request: req, Input: input, Copy: c.DescribeTapesRequest} } -// DescribeTapesPages iterates over the pages of a DescribeTapes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTapes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeTapesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeTapes operation. -// pageNum := 0 -// err := client.DescribeTapesPages(params, -// func(page *DescribeTapesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *StorageGateway) DescribeTapesPages(input *DescribeTapesInput, fn func(*DescribeTapesOutput, bool) bool) error { - return c.DescribeTapesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTapesPagesWithContext same as DescribeTapesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *StorageGateway) DescribeTapesPagesWithContext(ctx aws.Context, input *DescribeTapesInput, fn func(*DescribeTapesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeTapesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeTapesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeTapesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeTapesRequest) Paginate(opts ...aws.Option) DescribeTapesPager { + return DescribeTapesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeTapesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTapesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeTapesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeTapesPager struct { + aws.Pager +} + +func (p *DescribeTapesPager) CurrentPage() *DescribeTapesOutput { + return p.Pager.CurrentPage().(*DescribeTapesOutput) } const opDescribeUploadBuffer = "DescribeUploadBuffer" @@ -2074,6 +2096,7 @@ const opDescribeUploadBuffer = "DescribeUploadBuffer" type DescribeUploadBufferRequest struct { *aws.Request Input *DescribeUploadBufferInput + Copy func(*DescribeUploadBufferInput) DescribeUploadBufferRequest } // Send marshals and sends the DescribeUploadBuffer API request. @@ -2118,7 +2141,7 @@ func (c *StorageGateway) DescribeUploadBufferRequest(input *DescribeUploadBuffer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUploadBufferRequest{Request: req, Input: input} + return DescribeUploadBufferRequest{Request: req, Input: input, Copy: c.DescribeUploadBufferRequest} } const opDescribeVTLDevices = "DescribeVTLDevices" @@ -2127,6 +2150,7 @@ const opDescribeVTLDevices = "DescribeVTLDevices" type DescribeVTLDevicesRequest struct { *aws.Request Input *DescribeVTLDevicesInput + Copy func(*DescribeVTLDevicesInput) DescribeVTLDevicesRequest } // Send marshals and sends the DescribeVTLDevices API request. @@ -2176,57 +2200,53 @@ func (c *StorageGateway) DescribeVTLDevicesRequest(input *DescribeVTLDevicesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeVTLDevicesRequest{Request: req, Input: input} + return DescribeVTLDevicesRequest{Request: req, Input: input, Copy: c.DescribeVTLDevicesRequest} } -// DescribeVTLDevicesPages iterates over the pages of a DescribeVTLDevices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeVTLDevices method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeVTLDevicesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeVTLDevices operation. -// pageNum := 0 -// err := client.DescribeVTLDevicesPages(params, -// func(page *DescribeVTLDevicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *StorageGateway) DescribeVTLDevicesPages(input *DescribeVTLDevicesInput, fn func(*DescribeVTLDevicesOutput, bool) bool) error { - return c.DescribeVTLDevicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeVTLDevicesPagesWithContext same as DescribeVTLDevicesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *StorageGateway) DescribeVTLDevicesPagesWithContext(ctx aws.Context, input *DescribeVTLDevicesInput, fn func(*DescribeVTLDevicesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeVTLDevicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeVTLDevicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeVTLDevicesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeVTLDevicesRequest) Paginate(opts ...aws.Option) DescribeVTLDevicesPager { + return DescribeVTLDevicesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeVTLDevicesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVTLDevicesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeVTLDevicesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeVTLDevicesPager struct { + aws.Pager +} + +func (p *DescribeVTLDevicesPager) CurrentPage() *DescribeVTLDevicesOutput { + return p.Pager.CurrentPage().(*DescribeVTLDevicesOutput) } const opDescribeWorkingStorage = "DescribeWorkingStorage" @@ -2235,6 +2255,7 @@ const opDescribeWorkingStorage = "DescribeWorkingStorage" type DescribeWorkingStorageRequest struct { *aws.Request Input *DescribeWorkingStorageInput + Copy func(*DescribeWorkingStorageInput) DescribeWorkingStorageRequest } // Send marshals and sends the DescribeWorkingStorage API request. @@ -2283,7 +2304,7 @@ func (c *StorageGateway) DescribeWorkingStorageRequest(input *DescribeWorkingSto req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeWorkingStorageRequest{Request: req, Input: input} + return DescribeWorkingStorageRequest{Request: req, Input: input, Copy: c.DescribeWorkingStorageRequest} } const opDisableGateway = "DisableGateway" @@ -2292,6 +2313,7 @@ const opDisableGateway = "DisableGateway" type DisableGatewayRequest struct { *aws.Request Input *DisableGatewayInput + Copy func(*DisableGatewayInput) DisableGatewayRequest } // Send marshals and sends the DisableGateway API request. @@ -2339,7 +2361,7 @@ func (c *StorageGateway) DisableGatewayRequest(input *DisableGatewayInput) Disab req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisableGatewayRequest{Request: req, Input: input} + return DisableGatewayRequest{Request: req, Input: input, Copy: c.DisableGatewayRequest} } const opListFileShares = "ListFileShares" @@ -2348,6 +2370,7 @@ const opListFileShares = "ListFileShares" type ListFileSharesRequest struct { *aws.Request Input *ListFileSharesInput + Copy func(*ListFileSharesInput) ListFileSharesRequest } // Send marshals and sends the ListFileShares API request. @@ -2390,7 +2413,7 @@ func (c *StorageGateway) ListFileSharesRequest(input *ListFileSharesInput) ListF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListFileSharesRequest{Request: req, Input: input} + return ListFileSharesRequest{Request: req, Input: input, Copy: c.ListFileSharesRequest} } const opListGateways = "ListGateways" @@ -2399,6 +2422,7 @@ const opListGateways = "ListGateways" type ListGatewaysRequest struct { *aws.Request Input *ListGatewaysInput + Copy func(*ListGatewaysInput) ListGatewaysRequest } // Send marshals and sends the ListGateways API request. @@ -2455,57 +2479,53 @@ func (c *StorageGateway) ListGatewaysRequest(input *ListGatewaysInput) ListGatew req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGatewaysRequest{Request: req, Input: input} + return ListGatewaysRequest{Request: req, Input: input, Copy: c.ListGatewaysRequest} } -// ListGatewaysPages iterates over the pages of a ListGateways operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGateways method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListGatewaysRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGateways operation. -// pageNum := 0 -// err := client.ListGatewaysPages(params, -// func(page *ListGatewaysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *StorageGateway) ListGatewaysPages(input *ListGatewaysInput, fn func(*ListGatewaysOutput, bool) bool) error { - return c.ListGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGatewaysPagesWithContext same as ListGatewaysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *StorageGateway) ListGatewaysPagesWithContext(ctx aws.Context, input *ListGatewaysInput, fn func(*ListGatewaysOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListGatewaysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListGatewaysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListGatewaysRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListGatewaysRequest) Paginate(opts ...aws.Option) ListGatewaysPager { + return ListGatewaysPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListGatewaysInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGatewaysOutput), !p.HasNextPage()) - } - return p.Err() +// ListGatewaysPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListGatewaysPager struct { + aws.Pager +} + +func (p *ListGatewaysPager) CurrentPage() *ListGatewaysOutput { + return p.Pager.CurrentPage().(*ListGatewaysOutput) } const opListLocalDisks = "ListLocalDisks" @@ -2514,6 +2534,7 @@ const opListLocalDisks = "ListLocalDisks" type ListLocalDisksRequest struct { *aws.Request Input *ListLocalDisksInput + Copy func(*ListLocalDisksInput) ListLocalDisksRequest } // Send marshals and sends the ListLocalDisks API request. @@ -2563,7 +2584,7 @@ func (c *StorageGateway) ListLocalDisksRequest(input *ListLocalDisksInput) ListL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListLocalDisksRequest{Request: req, Input: input} + return ListLocalDisksRequest{Request: req, Input: input, Copy: c.ListLocalDisksRequest} } const opListTagsForResource = "ListTagsForResource" @@ -2572,6 +2593,7 @@ const opListTagsForResource = "ListTagsForResource" type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput + Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. @@ -2613,7 +2635,7 @@ func (c *StorageGateway) ListTagsForResourceRequest(input *ListTagsForResourceIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTagsForResourceRequest{Request: req, Input: input} + return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } const opListTapes = "ListTapes" @@ -2622,6 +2644,7 @@ const opListTapes = "ListTapes" type ListTapesRequest struct { *aws.Request Input *ListTapesInput + Copy func(*ListTapesInput) ListTapesRequest } // Send marshals and sends the ListTapes API request. @@ -2672,7 +2695,7 @@ func (c *StorageGateway) ListTapesRequest(input *ListTapesInput) ListTapesReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListTapesRequest{Request: req, Input: input} + return ListTapesRequest{Request: req, Input: input, Copy: c.ListTapesRequest} } const opListVolumeInitiators = "ListVolumeInitiators" @@ -2681,6 +2704,7 @@ const opListVolumeInitiators = "ListVolumeInitiators" type ListVolumeInitiatorsRequest struct { *aws.Request Input *ListVolumeInitiatorsInput + Copy func(*ListVolumeInitiatorsInput) ListVolumeInitiatorsRequest } // Send marshals and sends the ListVolumeInitiators API request. @@ -2723,7 +2747,7 @@ func (c *StorageGateway) ListVolumeInitiatorsRequest(input *ListVolumeInitiators req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListVolumeInitiatorsRequest{Request: req, Input: input} + return ListVolumeInitiatorsRequest{Request: req, Input: input, Copy: c.ListVolumeInitiatorsRequest} } const opListVolumeRecoveryPoints = "ListVolumeRecoveryPoints" @@ -2732,6 +2756,7 @@ const opListVolumeRecoveryPoints = "ListVolumeRecoveryPoints" type ListVolumeRecoveryPointsRequest struct { *aws.Request Input *ListVolumeRecoveryPointsInput + Copy func(*ListVolumeRecoveryPointsInput) ListVolumeRecoveryPointsRequest } // Send marshals and sends the ListVolumeRecoveryPoints API request. @@ -2779,7 +2804,7 @@ func (c *StorageGateway) ListVolumeRecoveryPointsRequest(input *ListVolumeRecove req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListVolumeRecoveryPointsRequest{Request: req, Input: input} + return ListVolumeRecoveryPointsRequest{Request: req, Input: input, Copy: c.ListVolumeRecoveryPointsRequest} } const opListVolumes = "ListVolumes" @@ -2788,6 +2813,7 @@ const opListVolumes = "ListVolumes" type ListVolumesRequest struct { *aws.Request Input *ListVolumesInput + Copy func(*ListVolumesInput) ListVolumesRequest } // Send marshals and sends the ListVolumes API request. @@ -2845,57 +2871,53 @@ func (c *StorageGateway) ListVolumesRequest(input *ListVolumesInput) ListVolumes req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListVolumesRequest{Request: req, Input: input} + return ListVolumesRequest{Request: req, Input: input, Copy: c.ListVolumesRequest} } -// ListVolumesPages iterates over the pages of a ListVolumes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVolumes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListVolumesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListVolumes operation. -// pageNum := 0 -// err := client.ListVolumesPages(params, -// func(page *ListVolumesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *StorageGateway) ListVolumesPages(input *ListVolumesInput, fn func(*ListVolumesOutput, bool) bool) error { - return c.ListVolumesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVolumesPagesWithContext same as ListVolumesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *StorageGateway) ListVolumesPagesWithContext(ctx aws.Context, input *ListVolumesInput, fn func(*ListVolumesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListVolumesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListVolumesRequest) Paginate(opts ...aws.Option) ListVolumesPager { + return ListVolumesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListVolumesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVolumesOutput), !p.HasNextPage()) - } - return p.Err() +// ListVolumesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListVolumesPager struct { + aws.Pager +} + +func (p *ListVolumesPager) CurrentPage() *ListVolumesOutput { + return p.Pager.CurrentPage().(*ListVolumesOutput) } const opNotifyWhenUploaded = "NotifyWhenUploaded" @@ -2904,6 +2926,7 @@ const opNotifyWhenUploaded = "NotifyWhenUploaded" type NotifyWhenUploadedRequest struct { *aws.Request Input *NotifyWhenUploadedInput + Copy func(*NotifyWhenUploadedInput) NotifyWhenUploadedRequest } // Send marshals and sends the NotifyWhenUploaded API request. @@ -2954,7 +2977,7 @@ func (c *StorageGateway) NotifyWhenUploadedRequest(input *NotifyWhenUploadedInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return NotifyWhenUploadedRequest{Request: req, Input: input} + return NotifyWhenUploadedRequest{Request: req, Input: input, Copy: c.NotifyWhenUploadedRequest} } const opRefreshCache = "RefreshCache" @@ -2963,6 +2986,7 @@ const opRefreshCache = "RefreshCache" type RefreshCacheRequest struct { *aws.Request Input *RefreshCacheInput + Copy func(*RefreshCacheInput) RefreshCacheRequest } // Send marshals and sends the RefreshCache API request. @@ -3006,7 +3030,7 @@ func (c *StorageGateway) RefreshCacheRequest(input *RefreshCacheInput) RefreshCa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RefreshCacheRequest{Request: req, Input: input} + return RefreshCacheRequest{Request: req, Input: input, Copy: c.RefreshCacheRequest} } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -3015,6 +3039,7 @@ const opRemoveTagsFromResource = "RemoveTagsFromResource" type RemoveTagsFromResourceRequest struct { *aws.Request Input *RemoveTagsFromResourceInput + Copy func(*RemoveTagsFromResourceInput) RemoveTagsFromResourceRequest } // Send marshals and sends the RemoveTagsFromResource API request. @@ -3056,7 +3081,7 @@ func (c *StorageGateway) RemoveTagsFromResourceRequest(input *RemoveTagsFromReso req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RemoveTagsFromResourceRequest{Request: req, Input: input} + return RemoveTagsFromResourceRequest{Request: req, Input: input, Copy: c.RemoveTagsFromResourceRequest} } const opResetCache = "ResetCache" @@ -3065,6 +3090,7 @@ const opResetCache = "ResetCache" type ResetCacheRequest struct { *aws.Request Input *ResetCacheInput + Copy func(*ResetCacheInput) ResetCacheRequest } // Send marshals and sends the ResetCache API request. @@ -3117,7 +3143,7 @@ func (c *StorageGateway) ResetCacheRequest(input *ResetCacheInput) ResetCacheReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetCacheRequest{Request: req, Input: input} + return ResetCacheRequest{Request: req, Input: input, Copy: c.ResetCacheRequest} } const opRetrieveTapeArchive = "RetrieveTapeArchive" @@ -3126,6 +3152,7 @@ const opRetrieveTapeArchive = "RetrieveTapeArchive" type RetrieveTapeArchiveRequest struct { *aws.Request Input *RetrieveTapeArchiveInput + Copy func(*RetrieveTapeArchiveInput) RetrieveTapeArchiveRequest } // Send marshals and sends the RetrieveTapeArchive API request. @@ -3175,7 +3202,7 @@ func (c *StorageGateway) RetrieveTapeArchiveRequest(input *RetrieveTapeArchiveIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RetrieveTapeArchiveRequest{Request: req, Input: input} + return RetrieveTapeArchiveRequest{Request: req, Input: input, Copy: c.RetrieveTapeArchiveRequest} } const opRetrieveTapeRecoveryPoint = "RetrieveTapeRecoveryPoint" @@ -3184,6 +3211,7 @@ const opRetrieveTapeRecoveryPoint = "RetrieveTapeRecoveryPoint" type RetrieveTapeRecoveryPointRequest struct { *aws.Request Input *RetrieveTapeRecoveryPointInput + Copy func(*RetrieveTapeRecoveryPointInput) RetrieveTapeRecoveryPointRequest } // Send marshals and sends the RetrieveTapeRecoveryPoint API request. @@ -3233,7 +3261,7 @@ func (c *StorageGateway) RetrieveTapeRecoveryPointRequest(input *RetrieveTapeRec req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RetrieveTapeRecoveryPointRequest{Request: req, Input: input} + return RetrieveTapeRecoveryPointRequest{Request: req, Input: input, Copy: c.RetrieveTapeRecoveryPointRequest} } const opSetLocalConsolePassword = "SetLocalConsolePassword" @@ -3242,6 +3270,7 @@ const opSetLocalConsolePassword = "SetLocalConsolePassword" type SetLocalConsolePasswordRequest struct { *aws.Request Input *SetLocalConsolePasswordInput + Copy func(*SetLocalConsolePasswordInput) SetLocalConsolePasswordRequest } // Send marshals and sends the SetLocalConsolePassword API request. @@ -3285,7 +3314,7 @@ func (c *StorageGateway) SetLocalConsolePasswordRequest(input *SetLocalConsolePa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return SetLocalConsolePasswordRequest{Request: req, Input: input} + return SetLocalConsolePasswordRequest{Request: req, Input: input, Copy: c.SetLocalConsolePasswordRequest} } const opShutdownGateway = "ShutdownGateway" @@ -3294,6 +3323,7 @@ const opShutdownGateway = "ShutdownGateway" type ShutdownGatewayRequest struct { *aws.Request Input *ShutdownGatewayInput + Copy func(*ShutdownGatewayInput) ShutdownGatewayRequest } // Send marshals and sends the ShutdownGateway API request. @@ -3354,7 +3384,7 @@ func (c *StorageGateway) ShutdownGatewayRequest(input *ShutdownGatewayInput) Shu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ShutdownGatewayRequest{Request: req, Input: input} + return ShutdownGatewayRequest{Request: req, Input: input, Copy: c.ShutdownGatewayRequest} } const opStartGateway = "StartGateway" @@ -3363,6 +3393,7 @@ const opStartGateway = "StartGateway" type StartGatewayRequest struct { *aws.Request Input *StartGatewayInput + Copy func(*StartGatewayInput) StartGatewayRequest } // Send marshals and sends the StartGateway API request. @@ -3414,7 +3445,7 @@ func (c *StorageGateway) StartGatewayRequest(input *StartGatewayInput) StartGate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartGatewayRequest{Request: req, Input: input} + return StartGatewayRequest{Request: req, Input: input, Copy: c.StartGatewayRequest} } const opUpdateBandwidthRateLimit = "UpdateBandwidthRateLimit" @@ -3423,6 +3454,7 @@ const opUpdateBandwidthRateLimit = "UpdateBandwidthRateLimit" type UpdateBandwidthRateLimitRequest struct { *aws.Request Input *UpdateBandwidthRateLimitInput + Copy func(*UpdateBandwidthRateLimitInput) UpdateBandwidthRateLimitRequest } // Send marshals and sends the UpdateBandwidthRateLimit API request. @@ -3472,7 +3504,7 @@ func (c *StorageGateway) UpdateBandwidthRateLimitRequest(input *UpdateBandwidthR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateBandwidthRateLimitRequest{Request: req, Input: input} + return UpdateBandwidthRateLimitRequest{Request: req, Input: input, Copy: c.UpdateBandwidthRateLimitRequest} } const opUpdateChapCredentials = "UpdateChapCredentials" @@ -3481,6 +3513,7 @@ const opUpdateChapCredentials = "UpdateChapCredentials" type UpdateChapCredentialsRequest struct { *aws.Request Input *UpdateChapCredentialsInput + Copy func(*UpdateChapCredentialsInput) UpdateChapCredentialsRequest } // Send marshals and sends the UpdateChapCredentials API request. @@ -3526,7 +3559,7 @@ func (c *StorageGateway) UpdateChapCredentialsRequest(input *UpdateChapCredentia req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateChapCredentialsRequest{Request: req, Input: input} + return UpdateChapCredentialsRequest{Request: req, Input: input, Copy: c.UpdateChapCredentialsRequest} } const opUpdateGatewayInformation = "UpdateGatewayInformation" @@ -3535,6 +3568,7 @@ const opUpdateGatewayInformation = "UpdateGatewayInformation" type UpdateGatewayInformationRequest struct { *aws.Request Input *UpdateGatewayInformationInput + Copy func(*UpdateGatewayInformationInput) UpdateGatewayInformationRequest } // Send marshals and sends the UpdateGatewayInformation API request. @@ -3581,7 +3615,7 @@ func (c *StorageGateway) UpdateGatewayInformationRequest(input *UpdateGatewayInf req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGatewayInformationRequest{Request: req, Input: input} + return UpdateGatewayInformationRequest{Request: req, Input: input, Copy: c.UpdateGatewayInformationRequest} } const opUpdateGatewaySoftwareNow = "UpdateGatewaySoftwareNow" @@ -3590,6 +3624,7 @@ const opUpdateGatewaySoftwareNow = "UpdateGatewaySoftwareNow" type UpdateGatewaySoftwareNowRequest struct { *aws.Request Input *UpdateGatewaySoftwareNowInput + Copy func(*UpdateGatewaySoftwareNowInput) UpdateGatewaySoftwareNowRequest } // Send marshals and sends the UpdateGatewaySoftwareNow API request. @@ -3644,7 +3679,7 @@ func (c *StorageGateway) UpdateGatewaySoftwareNowRequest(input *UpdateGatewaySof req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGatewaySoftwareNowRequest{Request: req, Input: input} + return UpdateGatewaySoftwareNowRequest{Request: req, Input: input, Copy: c.UpdateGatewaySoftwareNowRequest} } const opUpdateMaintenanceStartTime = "UpdateMaintenanceStartTime" @@ -3653,6 +3688,7 @@ const opUpdateMaintenanceStartTime = "UpdateMaintenanceStartTime" type UpdateMaintenanceStartTimeRequest struct { *aws.Request Input *UpdateMaintenanceStartTimeInput + Copy func(*UpdateMaintenanceStartTimeInput) UpdateMaintenanceStartTimeRequest } // Send marshals and sends the UpdateMaintenanceStartTime API request. @@ -3695,7 +3731,7 @@ func (c *StorageGateway) UpdateMaintenanceStartTimeRequest(input *UpdateMaintena req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateMaintenanceStartTimeRequest{Request: req, Input: input} + return UpdateMaintenanceStartTimeRequest{Request: req, Input: input, Copy: c.UpdateMaintenanceStartTimeRequest} } const opUpdateNFSFileShare = "UpdateNFSFileShare" @@ -3704,6 +3740,7 @@ const opUpdateNFSFileShare = "UpdateNFSFileShare" type UpdateNFSFileShareRequest struct { *aws.Request Input *UpdateNFSFileShareInput + Copy func(*UpdateNFSFileShareInput) UpdateNFSFileShareRequest } // Send marshals and sends the UpdateNFSFileShare API request. @@ -3763,7 +3800,7 @@ func (c *StorageGateway) UpdateNFSFileShareRequest(input *UpdateNFSFileShareInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateNFSFileShareRequest{Request: req, Input: input} + return UpdateNFSFileShareRequest{Request: req, Input: input, Copy: c.UpdateNFSFileShareRequest} } const opUpdateSnapshotSchedule = "UpdateSnapshotSchedule" @@ -3772,6 +3809,7 @@ const opUpdateSnapshotSchedule = "UpdateSnapshotSchedule" type UpdateSnapshotScheduleRequest struct { *aws.Request Input *UpdateSnapshotScheduleInput + Copy func(*UpdateSnapshotScheduleInput) UpdateSnapshotScheduleRequest } // Send marshals and sends the UpdateSnapshotSchedule API request. @@ -3821,7 +3859,7 @@ func (c *StorageGateway) UpdateSnapshotScheduleRequest(input *UpdateSnapshotSche req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSnapshotScheduleRequest{Request: req, Input: input} + return UpdateSnapshotScheduleRequest{Request: req, Input: input, Copy: c.UpdateSnapshotScheduleRequest} } const opUpdateVTLDeviceType = "UpdateVTLDeviceType" @@ -3830,6 +3868,7 @@ const opUpdateVTLDeviceType = "UpdateVTLDeviceType" type UpdateVTLDeviceTypeRequest struct { *aws.Request Input *UpdateVTLDeviceTypeInput + Copy func(*UpdateVTLDeviceTypeInput) UpdateVTLDeviceTypeRequest } // Send marshals and sends the UpdateVTLDeviceType API request. @@ -3874,7 +3913,7 @@ func (c *StorageGateway) UpdateVTLDeviceTypeRequest(input *UpdateVTLDeviceTypeIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateVTLDeviceTypeRequest{Request: req, Input: input} + return UpdateVTLDeviceTypeRequest{Request: req, Input: input, Copy: c.UpdateVTLDeviceTypeRequest} } // A JSON object containing one or more of the following fields: diff --git a/service/storagegateway/storagegatewayiface/interface.go b/service/storagegateway/storagegatewayiface/interface.go index 6d5eb1c1320..fc8327bf53a 100644 --- a/service/storagegateway/storagegatewayiface/interface.go +++ b/service/storagegateway/storagegatewayiface/interface.go @@ -9,7 +9,6 @@ package storagegatewayiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/storagegateway" ) @@ -127,26 +126,14 @@ type StorageGatewayAPI interface { DescribeTapeArchivesRequest(*storagegateway.DescribeTapeArchivesInput) storagegateway.DescribeTapeArchivesRequest - DescribeTapeArchivesPages(*storagegateway.DescribeTapeArchivesInput, func(*storagegateway.DescribeTapeArchivesOutput, bool) bool) error - DescribeTapeArchivesPagesWithContext(aws.Context, *storagegateway.DescribeTapeArchivesInput, func(*storagegateway.DescribeTapeArchivesOutput, bool) bool, ...aws.Option) error - DescribeTapeRecoveryPointsRequest(*storagegateway.DescribeTapeRecoveryPointsInput) storagegateway.DescribeTapeRecoveryPointsRequest - DescribeTapeRecoveryPointsPages(*storagegateway.DescribeTapeRecoveryPointsInput, func(*storagegateway.DescribeTapeRecoveryPointsOutput, bool) bool) error - DescribeTapeRecoveryPointsPagesWithContext(aws.Context, *storagegateway.DescribeTapeRecoveryPointsInput, func(*storagegateway.DescribeTapeRecoveryPointsOutput, bool) bool, ...aws.Option) error - DescribeTapesRequest(*storagegateway.DescribeTapesInput) storagegateway.DescribeTapesRequest - DescribeTapesPages(*storagegateway.DescribeTapesInput, func(*storagegateway.DescribeTapesOutput, bool) bool) error - DescribeTapesPagesWithContext(aws.Context, *storagegateway.DescribeTapesInput, func(*storagegateway.DescribeTapesOutput, bool) bool, ...aws.Option) error - DescribeUploadBufferRequest(*storagegateway.DescribeUploadBufferInput) storagegateway.DescribeUploadBufferRequest DescribeVTLDevicesRequest(*storagegateway.DescribeVTLDevicesInput) storagegateway.DescribeVTLDevicesRequest - DescribeVTLDevicesPages(*storagegateway.DescribeVTLDevicesInput, func(*storagegateway.DescribeVTLDevicesOutput, bool) bool) error - DescribeVTLDevicesPagesWithContext(aws.Context, *storagegateway.DescribeVTLDevicesInput, func(*storagegateway.DescribeVTLDevicesOutput, bool) bool, ...aws.Option) error - DescribeWorkingStorageRequest(*storagegateway.DescribeWorkingStorageInput) storagegateway.DescribeWorkingStorageRequest DisableGatewayRequest(*storagegateway.DisableGatewayInput) storagegateway.DisableGatewayRequest @@ -155,9 +142,6 @@ type StorageGatewayAPI interface { ListGatewaysRequest(*storagegateway.ListGatewaysInput) storagegateway.ListGatewaysRequest - ListGatewaysPages(*storagegateway.ListGatewaysInput, func(*storagegateway.ListGatewaysOutput, bool) bool) error - ListGatewaysPagesWithContext(aws.Context, *storagegateway.ListGatewaysInput, func(*storagegateway.ListGatewaysOutput, bool) bool, ...aws.Option) error - ListLocalDisksRequest(*storagegateway.ListLocalDisksInput) storagegateway.ListLocalDisksRequest ListTagsForResourceRequest(*storagegateway.ListTagsForResourceInput) storagegateway.ListTagsForResourceRequest @@ -170,9 +154,6 @@ type StorageGatewayAPI interface { ListVolumesRequest(*storagegateway.ListVolumesInput) storagegateway.ListVolumesRequest - ListVolumesPages(*storagegateway.ListVolumesInput, func(*storagegateway.ListVolumesOutput, bool) bool) error - ListVolumesPagesWithContext(aws.Context, *storagegateway.ListVolumesInput, func(*storagegateway.ListVolumesOutput, bool) bool, ...aws.Option) error - NotifyWhenUploadedRequest(*storagegateway.NotifyWhenUploadedInput) storagegateway.NotifyWhenUploadedRequest RefreshCacheRequest(*storagegateway.RefreshCacheInput) storagegateway.RefreshCacheRequest diff --git a/service/sts/api.go b/service/sts/api.go index e0e56cbfa32..9093144693b 100644 --- a/service/sts/api.go +++ b/service/sts/api.go @@ -15,6 +15,7 @@ const opAssumeRole = "AssumeRole" type AssumeRoleRequest struct { *aws.Request Input *AssumeRoleInput + Copy func(*AssumeRoleInput) AssumeRoleRequest } // Send marshals and sends the AssumeRole API request. @@ -143,7 +144,7 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) AssumeRoleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssumeRoleRequest{Request: req, Input: input} + return AssumeRoleRequest{Request: req, Input: input, Copy: c.AssumeRoleRequest} } const opAssumeRoleWithSAML = "AssumeRoleWithSAML" @@ -152,6 +153,7 @@ const opAssumeRoleWithSAML = "AssumeRoleWithSAML" type AssumeRoleWithSAMLRequest struct { *aws.Request Input *AssumeRoleWithSAMLInput + Copy func(*AssumeRoleWithSAMLInput) AssumeRoleWithSAMLRequest } // Send marshals and sends the AssumeRoleWithSAML API request. @@ -258,7 +260,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) AssumeRo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssumeRoleWithSAMLRequest{Request: req, Input: input} + return AssumeRoleWithSAMLRequest{Request: req, Input: input, Copy: c.AssumeRoleWithSAMLRequest} } const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity" @@ -267,6 +269,7 @@ const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity" type AssumeRoleWithWebIdentityRequest struct { *aws.Request Input *AssumeRoleWithWebIdentityInput + Copy func(*AssumeRoleWithWebIdentityInput) AssumeRoleWithWebIdentityRequest } // Send marshals and sends the AssumeRoleWithWebIdentity API request. @@ -395,7 +398,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssumeRoleWithWebIdentityRequest{Request: req, Input: input} + return AssumeRoleWithWebIdentityRequest{Request: req, Input: input, Copy: c.AssumeRoleWithWebIdentityRequest} } const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage" @@ -404,6 +407,7 @@ const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage" type DecodeAuthorizationMessageRequest struct { *aws.Request Input *DecodeAuthorizationMessageInput + Copy func(*DecodeAuthorizationMessageInput) DecodeAuthorizationMessageRequest } // Send marshals and sends the DecodeAuthorizationMessage API request. @@ -475,7 +479,7 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DecodeAuthorizationMessageRequest{Request: req, Input: input} + return DecodeAuthorizationMessageRequest{Request: req, Input: input, Copy: c.DecodeAuthorizationMessageRequest} } const opGetCallerIdentity = "GetCallerIdentity" @@ -484,6 +488,7 @@ const opGetCallerIdentity = "GetCallerIdentity" type GetCallerIdentityRequest struct { *aws.Request Input *GetCallerIdentityInput + Copy func(*GetCallerIdentityInput) GetCallerIdentityRequest } // Send marshals and sends the GetCallerIdentity API request. @@ -525,7 +530,7 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) GetCallerI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCallerIdentityRequest{Request: req, Input: input} + return GetCallerIdentityRequest{Request: req, Input: input, Copy: c.GetCallerIdentityRequest} } const opGetFederationToken = "GetFederationToken" @@ -534,6 +539,7 @@ const opGetFederationToken = "GetFederationToken" type GetFederationTokenRequest struct { *aws.Request Input *GetFederationTokenInput + Copy func(*GetFederationTokenInput) GetFederationTokenRequest } // Send marshals and sends the GetFederationToken API request. @@ -651,7 +657,7 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) GetFeder req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFederationTokenRequest{Request: req, Input: input} + return GetFederationTokenRequest{Request: req, Input: input, Copy: c.GetFederationTokenRequest} } const opGetSessionToken = "GetSessionToken" @@ -660,6 +666,7 @@ const opGetSessionToken = "GetSessionToken" type GetSessionTokenRequest struct { *aws.Request Input *GetSessionTokenInput + Copy func(*GetSessionTokenInput) GetSessionTokenRequest } // Send marshals and sends the GetSessionToken API request. @@ -745,7 +752,7 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) GetSessionToke req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSessionTokenRequest{Request: req, Input: input} + return GetSessionTokenRequest{Request: req, Input: input, Copy: c.GetSessionTokenRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleRequest diff --git a/service/support/api.go b/service/support/api.go index 0b35b983a3f..2e378a7d62c 100644 --- a/service/support/api.go +++ b/service/support/api.go @@ -13,6 +13,7 @@ const opAddAttachmentsToSet = "AddAttachmentsToSet" type AddAttachmentsToSetRequest struct { *aws.Request Input *AddAttachmentsToSetInput + Copy func(*AddAttachmentsToSetInput) AddAttachmentsToSetRequest } // Send marshals and sends the AddAttachmentsToSet API request. @@ -62,7 +63,7 @@ func (c *Support) AddAttachmentsToSetRequest(input *AddAttachmentsToSetInput) Ad req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddAttachmentsToSetRequest{Request: req, Input: input} + return AddAttachmentsToSetRequest{Request: req, Input: input, Copy: c.AddAttachmentsToSetRequest} } const opAddCommunicationToCase = "AddCommunicationToCase" @@ -71,6 +72,7 @@ const opAddCommunicationToCase = "AddCommunicationToCase" type AddCommunicationToCaseRequest struct { *aws.Request Input *AddCommunicationToCaseInput + Copy func(*AddCommunicationToCaseInput) AddCommunicationToCaseRequest } // Send marshals and sends the AddCommunicationToCase API request. @@ -118,7 +120,7 @@ func (c *Support) AddCommunicationToCaseRequest(input *AddCommunicationToCaseInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddCommunicationToCaseRequest{Request: req, Input: input} + return AddCommunicationToCaseRequest{Request: req, Input: input, Copy: c.AddCommunicationToCaseRequest} } const opCreateCase = "CreateCase" @@ -127,6 +129,7 @@ const opCreateCase = "CreateCase" type CreateCaseRequest struct { *aws.Request Input *CreateCaseInput + Copy func(*CreateCaseInput) CreateCaseRequest } // Send marshals and sends the CreateCase API request. @@ -210,7 +213,7 @@ func (c *Support) CreateCaseRequest(input *CreateCaseInput) CreateCaseRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCaseRequest{Request: req, Input: input} + return CreateCaseRequest{Request: req, Input: input, Copy: c.CreateCaseRequest} } const opDescribeAttachment = "DescribeAttachment" @@ -219,6 +222,7 @@ const opDescribeAttachment = "DescribeAttachment" type DescribeAttachmentRequest struct { *aws.Request Input *DescribeAttachmentInput + Copy func(*DescribeAttachmentInput) DescribeAttachmentRequest } // Send marshals and sends the DescribeAttachment API request. @@ -262,7 +266,7 @@ func (c *Support) DescribeAttachmentRequest(input *DescribeAttachmentInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeAttachmentRequest{Request: req, Input: input} + return DescribeAttachmentRequest{Request: req, Input: input, Copy: c.DescribeAttachmentRequest} } const opDescribeCases = "DescribeCases" @@ -271,6 +275,7 @@ const opDescribeCases = "DescribeCases" type DescribeCasesRequest struct { *aws.Request Input *DescribeCasesInput + Copy func(*DescribeCasesInput) DescribeCasesRequest } // Send marshals and sends the DescribeCases API request. @@ -331,57 +336,53 @@ func (c *Support) DescribeCasesRequest(input *DescribeCasesInput) DescribeCasesR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCasesRequest{Request: req, Input: input} + return DescribeCasesRequest{Request: req, Input: input, Copy: c.DescribeCasesRequest} } -// DescribeCasesPages iterates over the pages of a DescribeCases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCases method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeCasesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCases operation. -// pageNum := 0 -// err := client.DescribeCasesPages(params, -// func(page *DescribeCasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Support) DescribeCasesPages(input *DescribeCasesInput, fn func(*DescribeCasesOutput, bool) bool) error { - return c.DescribeCasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeCasesPagesWithContext same as DescribeCasesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Support) DescribeCasesPagesWithContext(ctx aws.Context, input *DescribeCasesInput, fn func(*DescribeCasesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeCasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeCasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeCasesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeCasesRequest) Paginate(opts ...aws.Option) DescribeCasesPager { + return DescribeCasesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeCasesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCasesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeCasesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeCasesPager struct { + aws.Pager +} + +func (p *DescribeCasesPager) CurrentPage() *DescribeCasesOutput { + return p.Pager.CurrentPage().(*DescribeCasesOutput) } const opDescribeCommunications = "DescribeCommunications" @@ -390,6 +391,7 @@ const opDescribeCommunications = "DescribeCommunications" type DescribeCommunicationsRequest struct { *aws.Request Input *DescribeCommunicationsInput + Copy func(*DescribeCommunicationsInput) DescribeCommunicationsRequest } // Send marshals and sends the DescribeCommunications API request. @@ -445,57 +447,53 @@ func (c *Support) DescribeCommunicationsRequest(input *DescribeCommunicationsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCommunicationsRequest{Request: req, Input: input} + return DescribeCommunicationsRequest{Request: req, Input: input, Copy: c.DescribeCommunicationsRequest} } -// DescribeCommunicationsPages iterates over the pages of a DescribeCommunications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCommunications method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeCommunicationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCommunications operation. -// pageNum := 0 -// err := client.DescribeCommunicationsPages(params, -// func(page *DescribeCommunicationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Support) DescribeCommunicationsPages(input *DescribeCommunicationsInput, fn func(*DescribeCommunicationsOutput, bool) bool) error { - return c.DescribeCommunicationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeCommunicationsPagesWithContext same as DescribeCommunicationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Support) DescribeCommunicationsPagesWithContext(ctx aws.Context, input *DescribeCommunicationsInput, fn func(*DescribeCommunicationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeCommunicationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeCommunicationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeCommunicationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeCommunicationsRequest) Paginate(opts ...aws.Option) DescribeCommunicationsPager { + return DescribeCommunicationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeCommunicationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCommunicationsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeCommunicationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeCommunicationsPager struct { + aws.Pager +} + +func (p *DescribeCommunicationsPager) CurrentPage() *DescribeCommunicationsOutput { + return p.Pager.CurrentPage().(*DescribeCommunicationsOutput) } const opDescribeServices = "DescribeServices" @@ -504,6 +502,7 @@ const opDescribeServices = "DescribeServices" type DescribeServicesRequest struct { *aws.Request Input *DescribeServicesInput + Copy func(*DescribeServicesInput) DescribeServicesRequest } // Send marshals and sends the DescribeServices API request. @@ -554,7 +553,7 @@ func (c *Support) DescribeServicesRequest(input *DescribeServicesInput) Describe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeServicesRequest{Request: req, Input: input} + return DescribeServicesRequest{Request: req, Input: input, Copy: c.DescribeServicesRequest} } const opDescribeSeverityLevels = "DescribeSeverityLevels" @@ -563,6 +562,7 @@ const opDescribeSeverityLevels = "DescribeSeverityLevels" type DescribeSeverityLevelsRequest struct { *aws.Request Input *DescribeSeverityLevelsInput + Copy func(*DescribeSeverityLevelsInput) DescribeSeverityLevelsRequest } // Send marshals and sends the DescribeSeverityLevels API request. @@ -605,7 +605,7 @@ func (c *Support) DescribeSeverityLevelsRequest(input *DescribeSeverityLevelsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeSeverityLevelsRequest{Request: req, Input: input} + return DescribeSeverityLevelsRequest{Request: req, Input: input, Copy: c.DescribeSeverityLevelsRequest} } const opDescribeTrustedAdvisorCheckRefreshStatuses = "DescribeTrustedAdvisorCheckRefreshStatuses" @@ -614,6 +614,7 @@ const opDescribeTrustedAdvisorCheckRefreshStatuses = "DescribeTrustedAdvisorChec type DescribeTrustedAdvisorCheckRefreshStatusesRequest struct { *aws.Request Input *DescribeTrustedAdvisorCheckRefreshStatusesInput + Copy func(*DescribeTrustedAdvisorCheckRefreshStatusesInput) DescribeTrustedAdvisorCheckRefreshStatusesRequest } // Send marshals and sends the DescribeTrustedAdvisorCheckRefreshStatuses API request. @@ -659,7 +660,7 @@ func (c *Support) DescribeTrustedAdvisorCheckRefreshStatusesRequest(input *Descr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTrustedAdvisorCheckRefreshStatusesRequest{Request: req, Input: input} + return DescribeTrustedAdvisorCheckRefreshStatusesRequest{Request: req, Input: input, Copy: c.DescribeTrustedAdvisorCheckRefreshStatusesRequest} } const opDescribeTrustedAdvisorCheckResult = "DescribeTrustedAdvisorCheckResult" @@ -668,6 +669,7 @@ const opDescribeTrustedAdvisorCheckResult = "DescribeTrustedAdvisorCheckResult" type DescribeTrustedAdvisorCheckResultRequest struct { *aws.Request Input *DescribeTrustedAdvisorCheckResultInput + Copy func(*DescribeTrustedAdvisorCheckResultInput) DescribeTrustedAdvisorCheckResultRequest } // Send marshals and sends the DescribeTrustedAdvisorCheckResult API request. @@ -727,7 +729,7 @@ func (c *Support) DescribeTrustedAdvisorCheckResultRequest(input *DescribeTruste req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTrustedAdvisorCheckResultRequest{Request: req, Input: input} + return DescribeTrustedAdvisorCheckResultRequest{Request: req, Input: input, Copy: c.DescribeTrustedAdvisorCheckResultRequest} } const opDescribeTrustedAdvisorCheckSummaries = "DescribeTrustedAdvisorCheckSummaries" @@ -736,6 +738,7 @@ const opDescribeTrustedAdvisorCheckSummaries = "DescribeTrustedAdvisorCheckSumma type DescribeTrustedAdvisorCheckSummariesRequest struct { *aws.Request Input *DescribeTrustedAdvisorCheckSummariesInput + Copy func(*DescribeTrustedAdvisorCheckSummariesInput) DescribeTrustedAdvisorCheckSummariesRequest } // Send marshals and sends the DescribeTrustedAdvisorCheckSummaries API request. @@ -779,7 +782,7 @@ func (c *Support) DescribeTrustedAdvisorCheckSummariesRequest(input *DescribeTru req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTrustedAdvisorCheckSummariesRequest{Request: req, Input: input} + return DescribeTrustedAdvisorCheckSummariesRequest{Request: req, Input: input, Copy: c.DescribeTrustedAdvisorCheckSummariesRequest} } const opDescribeTrustedAdvisorChecks = "DescribeTrustedAdvisorChecks" @@ -788,6 +791,7 @@ const opDescribeTrustedAdvisorChecks = "DescribeTrustedAdvisorChecks" type DescribeTrustedAdvisorChecksRequest struct { *aws.Request Input *DescribeTrustedAdvisorChecksInput + Copy func(*DescribeTrustedAdvisorChecksInput) DescribeTrustedAdvisorChecksRequest } // Send marshals and sends the DescribeTrustedAdvisorChecks API request. @@ -831,7 +835,7 @@ func (c *Support) DescribeTrustedAdvisorChecksRequest(input *DescribeTrustedAdvi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTrustedAdvisorChecksRequest{Request: req, Input: input} + return DescribeTrustedAdvisorChecksRequest{Request: req, Input: input, Copy: c.DescribeTrustedAdvisorChecksRequest} } const opRefreshTrustedAdvisorCheck = "RefreshTrustedAdvisorCheck" @@ -840,6 +844,7 @@ const opRefreshTrustedAdvisorCheck = "RefreshTrustedAdvisorCheck" type RefreshTrustedAdvisorCheckRequest struct { *aws.Request Input *RefreshTrustedAdvisorCheckInput + Copy func(*RefreshTrustedAdvisorCheckInput) RefreshTrustedAdvisorCheckRequest } // Send marshals and sends the RefreshTrustedAdvisorCheck API request. @@ -896,7 +901,7 @@ func (c *Support) RefreshTrustedAdvisorCheckRequest(input *RefreshTrustedAdvisor req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RefreshTrustedAdvisorCheckRequest{Request: req, Input: input} + return RefreshTrustedAdvisorCheckRequest{Request: req, Input: input, Copy: c.RefreshTrustedAdvisorCheckRequest} } const opResolveCase = "ResolveCase" @@ -905,6 +910,7 @@ const opResolveCase = "ResolveCase" type ResolveCaseRequest struct { *aws.Request Input *ResolveCaseInput + Copy func(*ResolveCaseInput) ResolveCaseRequest } // Send marshals and sends the ResolveCase API request. @@ -946,7 +952,7 @@ func (c *Support) ResolveCaseRequest(input *ResolveCaseInput) ResolveCaseRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResolveCaseRequest{Request: req, Input: input} + return ResolveCaseRequest{Request: req, Input: input, Copy: c.ResolveCaseRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/support-2013-04-15/AddAttachmentsToSetRequest diff --git a/service/support/supportiface/interface.go b/service/support/supportiface/interface.go index b9899f15db3..2decd82a890 100644 --- a/service/support/supportiface/interface.go +++ b/service/support/supportiface/interface.go @@ -9,7 +9,6 @@ package supportiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/support" ) @@ -73,14 +72,8 @@ type SupportAPI interface { DescribeCasesRequest(*support.DescribeCasesInput) support.DescribeCasesRequest - DescribeCasesPages(*support.DescribeCasesInput, func(*support.DescribeCasesOutput, bool) bool) error - DescribeCasesPagesWithContext(aws.Context, *support.DescribeCasesInput, func(*support.DescribeCasesOutput, bool) bool, ...aws.Option) error - DescribeCommunicationsRequest(*support.DescribeCommunicationsInput) support.DescribeCommunicationsRequest - DescribeCommunicationsPages(*support.DescribeCommunicationsInput, func(*support.DescribeCommunicationsOutput, bool) bool) error - DescribeCommunicationsPagesWithContext(aws.Context, *support.DescribeCommunicationsInput, func(*support.DescribeCommunicationsOutput, bool) bool, ...aws.Option) error - DescribeServicesRequest(*support.DescribeServicesInput) support.DescribeServicesRequest DescribeSeverityLevelsRequest(*support.DescribeSeverityLevelsInput) support.DescribeSeverityLevelsRequest diff --git a/service/swf/api.go b/service/swf/api.go index 16f52b07468..ca2e355274f 100644 --- a/service/swf/api.go +++ b/service/swf/api.go @@ -18,6 +18,7 @@ const opCountClosedWorkflowExecutions = "CountClosedWorkflowExecutions" type CountClosedWorkflowExecutionsRequest struct { *aws.Request Input *CountClosedWorkflowExecutionsInput + Copy func(*CountClosedWorkflowExecutionsInput) CountClosedWorkflowExecutionsRequest } // Send marshals and sends the CountClosedWorkflowExecutions API request. @@ -86,7 +87,7 @@ func (c *SWF) CountClosedWorkflowExecutionsRequest(input *CountClosedWorkflowExe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CountClosedWorkflowExecutionsRequest{Request: req, Input: input} + return CountClosedWorkflowExecutionsRequest{Request: req, Input: input, Copy: c.CountClosedWorkflowExecutionsRequest} } const opCountOpenWorkflowExecutions = "CountOpenWorkflowExecutions" @@ -95,6 +96,7 @@ const opCountOpenWorkflowExecutions = "CountOpenWorkflowExecutions" type CountOpenWorkflowExecutionsRequest struct { *aws.Request Input *CountOpenWorkflowExecutionsInput + Copy func(*CountOpenWorkflowExecutionsInput) CountOpenWorkflowExecutionsRequest } // Send marshals and sends the CountOpenWorkflowExecutions API request. @@ -163,7 +165,7 @@ func (c *SWF) CountOpenWorkflowExecutionsRequest(input *CountOpenWorkflowExecuti req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CountOpenWorkflowExecutionsRequest{Request: req, Input: input} + return CountOpenWorkflowExecutionsRequest{Request: req, Input: input, Copy: c.CountOpenWorkflowExecutionsRequest} } const opCountPendingActivityTasks = "CountPendingActivityTasks" @@ -172,6 +174,7 @@ const opCountPendingActivityTasks = "CountPendingActivityTasks" type CountPendingActivityTasksRequest struct { *aws.Request Input *CountPendingActivityTasksInput + Copy func(*CountPendingActivityTasksInput) CountPendingActivityTasksRequest } // Send marshals and sends the CountPendingActivityTasks API request. @@ -234,7 +237,7 @@ func (c *SWF) CountPendingActivityTasksRequest(input *CountPendingActivityTasksI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CountPendingActivityTasksRequest{Request: req, Input: input} + return CountPendingActivityTasksRequest{Request: req, Input: input, Copy: c.CountPendingActivityTasksRequest} } const opCountPendingDecisionTasks = "CountPendingDecisionTasks" @@ -243,6 +246,7 @@ const opCountPendingDecisionTasks = "CountPendingDecisionTasks" type CountPendingDecisionTasksRequest struct { *aws.Request Input *CountPendingDecisionTasksInput + Copy func(*CountPendingDecisionTasksInput) CountPendingDecisionTasksRequest } // Send marshals and sends the CountPendingDecisionTasks API request. @@ -305,7 +309,7 @@ func (c *SWF) CountPendingDecisionTasksRequest(input *CountPendingDecisionTasksI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CountPendingDecisionTasksRequest{Request: req, Input: input} + return CountPendingDecisionTasksRequest{Request: req, Input: input, Copy: c.CountPendingDecisionTasksRequest} } const opDeprecateActivityType = "DeprecateActivityType" @@ -314,6 +318,7 @@ const opDeprecateActivityType = "DeprecateActivityType" type DeprecateActivityTypeRequest struct { *aws.Request Input *DeprecateActivityTypeInput + Copy func(*DeprecateActivityTypeInput) DeprecateActivityTypeRequest } // Send marshals and sends the DeprecateActivityType API request. @@ -383,7 +388,7 @@ func (c *SWF) DeprecateActivityTypeRequest(input *DeprecateActivityTypeInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeprecateActivityTypeRequest{Request: req, Input: input} + return DeprecateActivityTypeRequest{Request: req, Input: input, Copy: c.DeprecateActivityTypeRequest} } const opDeprecateDomain = "DeprecateDomain" @@ -392,6 +397,7 @@ const opDeprecateDomain = "DeprecateDomain" type DeprecateDomainRequest struct { *aws.Request Input *DeprecateDomainInput + Copy func(*DeprecateDomainInput) DeprecateDomainRequest } // Send marshals and sends the DeprecateDomain API request. @@ -459,7 +465,7 @@ func (c *SWF) DeprecateDomainRequest(input *DeprecateDomainInput) DeprecateDomai req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeprecateDomainRequest{Request: req, Input: input} + return DeprecateDomainRequest{Request: req, Input: input, Copy: c.DeprecateDomainRequest} } const opDeprecateWorkflowType = "DeprecateWorkflowType" @@ -468,6 +474,7 @@ const opDeprecateWorkflowType = "DeprecateWorkflowType" type DeprecateWorkflowTypeRequest struct { *aws.Request Input *DeprecateWorkflowTypeInput + Copy func(*DeprecateWorkflowTypeInput) DeprecateWorkflowTypeRequest } // Send marshals and sends the DeprecateWorkflowType API request. @@ -538,7 +545,7 @@ func (c *SWF) DeprecateWorkflowTypeRequest(input *DeprecateWorkflowTypeInput) De req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeprecateWorkflowTypeRequest{Request: req, Input: input} + return DeprecateWorkflowTypeRequest{Request: req, Input: input, Copy: c.DeprecateWorkflowTypeRequest} } const opDescribeActivityType = "DescribeActivityType" @@ -547,6 +554,7 @@ const opDescribeActivityType = "DescribeActivityType" type DescribeActivityTypeRequest struct { *aws.Request Input *DescribeActivityTypeInput + Copy func(*DescribeActivityTypeInput) DescribeActivityTypeRequest } // Send marshals and sends the DescribeActivityType API request. @@ -611,7 +619,7 @@ func (c *SWF) DescribeActivityTypeRequest(input *DescribeActivityTypeInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeActivityTypeRequest{Request: req, Input: input} + return DescribeActivityTypeRequest{Request: req, Input: input, Copy: c.DescribeActivityTypeRequest} } const opDescribeDomain = "DescribeDomain" @@ -620,6 +628,7 @@ const opDescribeDomain = "DescribeDomain" type DescribeDomainRequest struct { *aws.Request Input *DescribeDomainInput + Copy func(*DescribeDomainInput) DescribeDomainRequest } // Send marshals and sends the DescribeDomain API request. @@ -678,7 +687,7 @@ func (c *SWF) DescribeDomainRequest(input *DescribeDomainInput) DescribeDomainRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDomainRequest{Request: req, Input: input} + return DescribeDomainRequest{Request: req, Input: input, Copy: c.DescribeDomainRequest} } const opDescribeWorkflowExecution = "DescribeWorkflowExecution" @@ -687,6 +696,7 @@ const opDescribeWorkflowExecution = "DescribeWorkflowExecution" type DescribeWorkflowExecutionRequest struct { *aws.Request Input *DescribeWorkflowExecutionInput + Copy func(*DescribeWorkflowExecutionInput) DescribeWorkflowExecutionRequest } // Send marshals and sends the DescribeWorkflowExecution API request. @@ -748,7 +758,7 @@ func (c *SWF) DescribeWorkflowExecutionRequest(input *DescribeWorkflowExecutionI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeWorkflowExecutionRequest{Request: req, Input: input} + return DescribeWorkflowExecutionRequest{Request: req, Input: input, Copy: c.DescribeWorkflowExecutionRequest} } const opDescribeWorkflowType = "DescribeWorkflowType" @@ -757,6 +767,7 @@ const opDescribeWorkflowType = "DescribeWorkflowType" type DescribeWorkflowTypeRequest struct { *aws.Request Input *DescribeWorkflowTypeInput + Copy func(*DescribeWorkflowTypeInput) DescribeWorkflowTypeRequest } // Send marshals and sends the DescribeWorkflowType API request. @@ -821,7 +832,7 @@ func (c *SWF) DescribeWorkflowTypeRequest(input *DescribeWorkflowTypeInput) Desc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeWorkflowTypeRequest{Request: req, Input: input} + return DescribeWorkflowTypeRequest{Request: req, Input: input, Copy: c.DescribeWorkflowTypeRequest} } const opGetWorkflowExecutionHistory = "GetWorkflowExecutionHistory" @@ -830,6 +841,7 @@ const opGetWorkflowExecutionHistory = "GetWorkflowExecutionHistory" type GetWorkflowExecutionHistoryRequest struct { *aws.Request Input *GetWorkflowExecutionHistoryInput + Copy func(*GetWorkflowExecutionHistoryInput) GetWorkflowExecutionHistoryRequest } // Send marshals and sends the GetWorkflowExecutionHistory API request. @@ -898,57 +910,53 @@ func (c *SWF) GetWorkflowExecutionHistoryRequest(input *GetWorkflowExecutionHist req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetWorkflowExecutionHistoryRequest{Request: req, Input: input} + return GetWorkflowExecutionHistoryRequest{Request: req, Input: input, Copy: c.GetWorkflowExecutionHistoryRequest} } -// GetWorkflowExecutionHistoryPages iterates over the pages of a GetWorkflowExecutionHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetWorkflowExecutionHistory method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetWorkflowExecutionHistoryRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetWorkflowExecutionHistory operation. -// pageNum := 0 -// err := client.GetWorkflowExecutionHistoryPages(params, -// func(page *GetWorkflowExecutionHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SWF) GetWorkflowExecutionHistoryPages(input *GetWorkflowExecutionHistoryInput, fn func(*GetWorkflowExecutionHistoryOutput, bool) bool) error { - return c.GetWorkflowExecutionHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetWorkflowExecutionHistoryPagesWithContext same as GetWorkflowExecutionHistoryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SWF) GetWorkflowExecutionHistoryPagesWithContext(ctx aws.Context, input *GetWorkflowExecutionHistoryInput, fn func(*GetWorkflowExecutionHistoryOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetWorkflowExecutionHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetWorkflowExecutionHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.GetWorkflowExecutionHistoryRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *GetWorkflowExecutionHistoryRequest) Paginate(opts ...aws.Option) GetWorkflowExecutionHistoryPager { + return GetWorkflowExecutionHistoryPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetWorkflowExecutionHistoryInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetWorkflowExecutionHistoryOutput), !p.HasNextPage()) - } - return p.Err() +// GetWorkflowExecutionHistoryPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetWorkflowExecutionHistoryPager struct { + aws.Pager +} + +func (p *GetWorkflowExecutionHistoryPager) CurrentPage() *GetWorkflowExecutionHistoryOutput { + return p.Pager.CurrentPage().(*GetWorkflowExecutionHistoryOutput) } const opListActivityTypes = "ListActivityTypes" @@ -957,6 +965,7 @@ const opListActivityTypes = "ListActivityTypes" type ListActivityTypesRequest struct { *aws.Request Input *ListActivityTypesInput + Copy func(*ListActivityTypesInput) ListActivityTypesRequest } // Send marshals and sends the ListActivityTypes API request. @@ -1024,57 +1033,53 @@ func (c *SWF) ListActivityTypesRequest(input *ListActivityTypesInput) ListActivi req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListActivityTypesRequest{Request: req, Input: input} + return ListActivityTypesRequest{Request: req, Input: input, Copy: c.ListActivityTypesRequest} } -// ListActivityTypesPages iterates over the pages of a ListActivityTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListActivityTypes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListActivityTypesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListActivityTypes operation. -// pageNum := 0 -// err := client.ListActivityTypesPages(params, -// func(page *ListActivityTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SWF) ListActivityTypesPages(input *ListActivityTypesInput, fn func(*ListActivityTypesOutput, bool) bool) error { - return c.ListActivityTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListActivityTypesPagesWithContext same as ListActivityTypesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SWF) ListActivityTypesPagesWithContext(ctx aws.Context, input *ListActivityTypesInput, fn func(*ListActivityTypesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListActivityTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListActivityTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListActivityTypesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListActivityTypesRequest) Paginate(opts ...aws.Option) ListActivityTypesPager { + return ListActivityTypesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListActivityTypesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListActivityTypesOutput), !p.HasNextPage()) - } - return p.Err() +// ListActivityTypesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListActivityTypesPager struct { + aws.Pager +} + +func (p *ListActivityTypesPager) CurrentPage() *ListActivityTypesOutput { + return p.Pager.CurrentPage().(*ListActivityTypesOutput) } const opListClosedWorkflowExecutions = "ListClosedWorkflowExecutions" @@ -1083,6 +1088,7 @@ const opListClosedWorkflowExecutions = "ListClosedWorkflowExecutions" type ListClosedWorkflowExecutionsRequest struct { *aws.Request Input *ListClosedWorkflowExecutionsInput + Copy func(*ListClosedWorkflowExecutionsInput) ListClosedWorkflowExecutionsRequest } // Send marshals and sends the ListClosedWorkflowExecutions API request. @@ -1159,57 +1165,53 @@ func (c *SWF) ListClosedWorkflowExecutionsRequest(input *ListClosedWorkflowExecu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListClosedWorkflowExecutionsRequest{Request: req, Input: input} + return ListClosedWorkflowExecutionsRequest{Request: req, Input: input, Copy: c.ListClosedWorkflowExecutionsRequest} } -// ListClosedWorkflowExecutionsPages iterates over the pages of a ListClosedWorkflowExecutions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListClosedWorkflowExecutions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListClosedWorkflowExecutionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListClosedWorkflowExecutions operation. -// pageNum := 0 -// err := client.ListClosedWorkflowExecutionsPages(params, -// func(page *ListOpenWorkflowExecutionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SWF) ListClosedWorkflowExecutionsPages(input *ListClosedWorkflowExecutionsInput, fn func(*ListOpenWorkflowExecutionsOutput, bool) bool) error { - return c.ListClosedWorkflowExecutionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListClosedWorkflowExecutionsPagesWithContext same as ListClosedWorkflowExecutionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SWF) ListClosedWorkflowExecutionsPagesWithContext(ctx aws.Context, input *ListClosedWorkflowExecutionsInput, fn func(*ListOpenWorkflowExecutionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListClosedWorkflowExecutionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListClosedWorkflowExecutionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListClosedWorkflowExecutionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListClosedWorkflowExecutionsRequest) Paginate(opts ...aws.Option) ListClosedWorkflowExecutionsPager { + return ListClosedWorkflowExecutionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListClosedWorkflowExecutionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOpenWorkflowExecutionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListClosedWorkflowExecutionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListClosedWorkflowExecutionsPager struct { + aws.Pager +} + +func (p *ListClosedWorkflowExecutionsPager) CurrentPage() *ListOpenWorkflowExecutionsOutput { + return p.Pager.CurrentPage().(*ListOpenWorkflowExecutionsOutput) } const opListDomains = "ListDomains" @@ -1218,6 +1220,7 @@ const opListDomains = "ListDomains" type ListDomainsRequest struct { *aws.Request Input *ListDomainsInput + Copy func(*ListDomainsInput) ListDomainsRequest } // Send marshals and sends the ListDomains API request. @@ -1287,57 +1290,53 @@ func (c *SWF) ListDomainsRequest(input *ListDomainsInput) ListDomainsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListDomainsRequest{Request: req, Input: input} + return ListDomainsRequest{Request: req, Input: input, Copy: c.ListDomainsRequest} } -// ListDomainsPages iterates over the pages of a ListDomains operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDomains method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListDomainsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListDomains operation. -// pageNum := 0 -// err := client.ListDomainsPages(params, -// func(page *ListDomainsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SWF) ListDomainsPages(input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool) error { - return c.ListDomainsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDomainsPagesWithContext same as ListDomainsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SWF) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListDomainsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListDomainsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListDomainsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListDomainsRequest) Paginate(opts ...aws.Option) ListDomainsPager { + return ListDomainsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListDomainsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) - } - return p.Err() +// ListDomainsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListDomainsPager struct { + aws.Pager +} + +func (p *ListDomainsPager) CurrentPage() *ListDomainsOutput { + return p.Pager.CurrentPage().(*ListDomainsOutput) } const opListOpenWorkflowExecutions = "ListOpenWorkflowExecutions" @@ -1346,6 +1345,7 @@ const opListOpenWorkflowExecutions = "ListOpenWorkflowExecutions" type ListOpenWorkflowExecutionsRequest struct { *aws.Request Input *ListOpenWorkflowExecutionsInput + Copy func(*ListOpenWorkflowExecutionsInput) ListOpenWorkflowExecutionsRequest } // Send marshals and sends the ListOpenWorkflowExecutions API request. @@ -1422,57 +1422,53 @@ func (c *SWF) ListOpenWorkflowExecutionsRequest(input *ListOpenWorkflowExecution req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOpenWorkflowExecutionsRequest{Request: req, Input: input} + return ListOpenWorkflowExecutionsRequest{Request: req, Input: input, Copy: c.ListOpenWorkflowExecutionsRequest} } -// ListOpenWorkflowExecutionsPages iterates over the pages of a ListOpenWorkflowExecutions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOpenWorkflowExecutions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListOpenWorkflowExecutionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListOpenWorkflowExecutions operation. -// pageNum := 0 -// err := client.ListOpenWorkflowExecutionsPages(params, -// func(page *ListOpenWorkflowExecutionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SWF) ListOpenWorkflowExecutionsPages(input *ListOpenWorkflowExecutionsInput, fn func(*ListOpenWorkflowExecutionsOutput, bool) bool) error { - return c.ListOpenWorkflowExecutionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOpenWorkflowExecutionsPagesWithContext same as ListOpenWorkflowExecutionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SWF) ListOpenWorkflowExecutionsPagesWithContext(ctx aws.Context, input *ListOpenWorkflowExecutionsInput, fn func(*ListOpenWorkflowExecutionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListOpenWorkflowExecutionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListOpenWorkflowExecutionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListOpenWorkflowExecutionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListOpenWorkflowExecutionsRequest) Paginate(opts ...aws.Option) ListOpenWorkflowExecutionsPager { + return ListOpenWorkflowExecutionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListOpenWorkflowExecutionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOpenWorkflowExecutionsOutput), !p.HasNextPage()) - } - return p.Err() +// ListOpenWorkflowExecutionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListOpenWorkflowExecutionsPager struct { + aws.Pager +} + +func (p *ListOpenWorkflowExecutionsPager) CurrentPage() *ListOpenWorkflowExecutionsOutput { + return p.Pager.CurrentPage().(*ListOpenWorkflowExecutionsOutput) } const opListWorkflowTypes = "ListWorkflowTypes" @@ -1481,6 +1477,7 @@ const opListWorkflowTypes = "ListWorkflowTypes" type ListWorkflowTypesRequest struct { *aws.Request Input *ListWorkflowTypesInput + Copy func(*ListWorkflowTypesInput) ListWorkflowTypesRequest } // Send marshals and sends the ListWorkflowTypes API request. @@ -1546,57 +1543,53 @@ func (c *SWF) ListWorkflowTypesRequest(input *ListWorkflowTypesInput) ListWorkfl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListWorkflowTypesRequest{Request: req, Input: input} + return ListWorkflowTypesRequest{Request: req, Input: input, Copy: c.ListWorkflowTypesRequest} } -// ListWorkflowTypesPages iterates over the pages of a ListWorkflowTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkflowTypes method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListWorkflowTypesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListWorkflowTypes operation. -// pageNum := 0 -// err := client.ListWorkflowTypesPages(params, -// func(page *ListWorkflowTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SWF) ListWorkflowTypesPages(input *ListWorkflowTypesInput, fn func(*ListWorkflowTypesOutput, bool) bool) error { - return c.ListWorkflowTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkflowTypesPagesWithContext same as ListWorkflowTypesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SWF) ListWorkflowTypesPagesWithContext(ctx aws.Context, input *ListWorkflowTypesInput, fn func(*ListWorkflowTypesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListWorkflowTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListWorkflowTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.ListWorkflowTypesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *ListWorkflowTypesRequest) Paginate(opts ...aws.Option) ListWorkflowTypesPager { + return ListWorkflowTypesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListWorkflowTypesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWorkflowTypesOutput), !p.HasNextPage()) - } - return p.Err() +// ListWorkflowTypesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListWorkflowTypesPager struct { + aws.Pager +} + +func (p *ListWorkflowTypesPager) CurrentPage() *ListWorkflowTypesOutput { + return p.Pager.CurrentPage().(*ListWorkflowTypesOutput) } const opPollForActivityTask = "PollForActivityTask" @@ -1605,6 +1598,7 @@ const opPollForActivityTask = "PollForActivityTask" type PollForActivityTaskRequest struct { *aws.Request Input *PollForActivityTaskInput + Copy func(*PollForActivityTaskInput) PollForActivityTaskRequest } // Send marshals and sends the PollForActivityTask API request. @@ -1674,7 +1668,7 @@ func (c *SWF) PollForActivityTaskRequest(input *PollForActivityTaskInput) PollFo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PollForActivityTaskRequest{Request: req, Input: input} + return PollForActivityTaskRequest{Request: req, Input: input, Copy: c.PollForActivityTaskRequest} } const opPollForDecisionTask = "PollForDecisionTask" @@ -1683,6 +1677,7 @@ const opPollForDecisionTask = "PollForDecisionTask" type PollForDecisionTaskRequest struct { *aws.Request Input *PollForDecisionTaskInput + Copy func(*PollForDecisionTaskInput) PollForDecisionTaskRequest } // Send marshals and sends the PollForDecisionTask API request. @@ -1768,57 +1763,53 @@ func (c *SWF) PollForDecisionTaskRequest(input *PollForDecisionTaskInput) PollFo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PollForDecisionTaskRequest{Request: req, Input: input} + return PollForDecisionTaskRequest{Request: req, Input: input, Copy: c.PollForDecisionTaskRequest} } -// PollForDecisionTaskPages iterates over the pages of a PollForDecisionTask operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See PollForDecisionTask method for more information on how to use this operation. +// Paginate pages iterates over the pages of a PollForDecisionTaskRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a PollForDecisionTask operation. -// pageNum := 0 -// err := client.PollForDecisionTaskPages(params, -// func(page *PollForDecisionTaskOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SWF) PollForDecisionTaskPages(input *PollForDecisionTaskInput, fn func(*PollForDecisionTaskOutput, bool) bool) error { - return c.PollForDecisionTaskPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// PollForDecisionTaskPagesWithContext same as PollForDecisionTaskPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *SWF) PollForDecisionTaskPagesWithContext(ctx aws.Context, input *PollForDecisionTaskInput, fn func(*PollForDecisionTaskOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *PollForDecisionTaskInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.PollForDecisionTaskRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.PollForDecisionTaskRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *PollForDecisionTaskRequest) Paginate(opts ...aws.Option) PollForDecisionTaskPager { + return PollForDecisionTaskPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *PollForDecisionTaskInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*PollForDecisionTaskOutput), !p.HasNextPage()) - } - return p.Err() +// PollForDecisionTaskPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type PollForDecisionTaskPager struct { + aws.Pager +} + +func (p *PollForDecisionTaskPager) CurrentPage() *PollForDecisionTaskOutput { + return p.Pager.CurrentPage().(*PollForDecisionTaskOutput) } const opRecordActivityTaskHeartbeat = "RecordActivityTaskHeartbeat" @@ -1827,6 +1818,7 @@ const opRecordActivityTaskHeartbeat = "RecordActivityTaskHeartbeat" type RecordActivityTaskHeartbeatRequest struct { *aws.Request Input *RecordActivityTaskHeartbeatInput + Copy func(*RecordActivityTaskHeartbeatInput) RecordActivityTaskHeartbeatRequest } // Send marshals and sends the RecordActivityTaskHeartbeat API request. @@ -1909,7 +1901,7 @@ func (c *SWF) RecordActivityTaskHeartbeatRequest(input *RecordActivityTaskHeartb req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RecordActivityTaskHeartbeatRequest{Request: req, Input: input} + return RecordActivityTaskHeartbeatRequest{Request: req, Input: input, Copy: c.RecordActivityTaskHeartbeatRequest} } const opRegisterActivityType = "RegisterActivityType" @@ -1918,6 +1910,7 @@ const opRegisterActivityType = "RegisterActivityType" type RegisterActivityTypeRequest struct { *aws.Request Input *RegisterActivityTypeInput + Copy func(*RegisterActivityTypeInput) RegisterActivityTypeRequest } // Send marshals and sends the RegisterActivityType API request. @@ -1989,7 +1982,7 @@ func (c *SWF) RegisterActivityTypeRequest(input *RegisterActivityTypeInput) Regi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RegisterActivityTypeRequest{Request: req, Input: input} + return RegisterActivityTypeRequest{Request: req, Input: input, Copy: c.RegisterActivityTypeRequest} } const opRegisterDomain = "RegisterDomain" @@ -1998,6 +1991,7 @@ const opRegisterDomain = "RegisterDomain" type RegisterDomainRequest struct { *aws.Request Input *RegisterDomainInput + Copy func(*RegisterDomainInput) RegisterDomainRequest } // Send marshals and sends the RegisterDomain API request. @@ -2058,7 +2052,7 @@ func (c *SWF) RegisterDomainRequest(input *RegisterDomainInput) RegisterDomainRe req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RegisterDomainRequest{Request: req, Input: input} + return RegisterDomainRequest{Request: req, Input: input, Copy: c.RegisterDomainRequest} } const opRegisterWorkflowType = "RegisterWorkflowType" @@ -2067,6 +2061,7 @@ const opRegisterWorkflowType = "RegisterWorkflowType" type RegisterWorkflowTypeRequest struct { *aws.Request Input *RegisterWorkflowTypeInput + Copy func(*RegisterWorkflowTypeInput) RegisterWorkflowTypeRequest } // Send marshals and sends the RegisterWorkflowType API request. @@ -2141,7 +2136,7 @@ func (c *SWF) RegisterWorkflowTypeRequest(input *RegisterWorkflowTypeInput) Regi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RegisterWorkflowTypeRequest{Request: req, Input: input} + return RegisterWorkflowTypeRequest{Request: req, Input: input, Copy: c.RegisterWorkflowTypeRequest} } const opRequestCancelWorkflowExecution = "RequestCancelWorkflowExecution" @@ -2150,6 +2145,7 @@ const opRequestCancelWorkflowExecution = "RequestCancelWorkflowExecution" type RequestCancelWorkflowExecutionRequest struct { *aws.Request Input *RequestCancelWorkflowExecutionInput + Copy func(*RequestCancelWorkflowExecutionInput) RequestCancelWorkflowExecutionRequest } // Send marshals and sends the RequestCancelWorkflowExecution API request. @@ -2220,7 +2216,7 @@ func (c *SWF) RequestCancelWorkflowExecutionRequest(input *RequestCancelWorkflow req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RequestCancelWorkflowExecutionRequest{Request: req, Input: input} + return RequestCancelWorkflowExecutionRequest{Request: req, Input: input, Copy: c.RequestCancelWorkflowExecutionRequest} } const opRespondActivityTaskCanceled = "RespondActivityTaskCanceled" @@ -2229,6 +2225,7 @@ const opRespondActivityTaskCanceled = "RespondActivityTaskCanceled" type RespondActivityTaskCanceledRequest struct { *aws.Request Input *RespondActivityTaskCanceledInput + Copy func(*RespondActivityTaskCanceledInput) RespondActivityTaskCanceledRequest } // Send marshals and sends the RespondActivityTaskCanceled API request. @@ -2302,7 +2299,7 @@ func (c *SWF) RespondActivityTaskCanceledRequest(input *RespondActivityTaskCance req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RespondActivityTaskCanceledRequest{Request: req, Input: input} + return RespondActivityTaskCanceledRequest{Request: req, Input: input, Copy: c.RespondActivityTaskCanceledRequest} } const opRespondActivityTaskCompleted = "RespondActivityTaskCompleted" @@ -2311,6 +2308,7 @@ const opRespondActivityTaskCompleted = "RespondActivityTaskCompleted" type RespondActivityTaskCompletedRequest struct { *aws.Request Input *RespondActivityTaskCompletedInput + Copy func(*RespondActivityTaskCompletedInput) RespondActivityTaskCompletedRequest } // Send marshals and sends the RespondActivityTaskCompleted API request. @@ -2383,7 +2381,7 @@ func (c *SWF) RespondActivityTaskCompletedRequest(input *RespondActivityTaskComp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RespondActivityTaskCompletedRequest{Request: req, Input: input} + return RespondActivityTaskCompletedRequest{Request: req, Input: input, Copy: c.RespondActivityTaskCompletedRequest} } const opRespondActivityTaskFailed = "RespondActivityTaskFailed" @@ -2392,6 +2390,7 @@ const opRespondActivityTaskFailed = "RespondActivityTaskFailed" type RespondActivityTaskFailedRequest struct { *aws.Request Input *RespondActivityTaskFailedInput + Copy func(*RespondActivityTaskFailedInput) RespondActivityTaskFailedRequest } // Send marshals and sends the RespondActivityTaskFailed API request. @@ -2459,7 +2458,7 @@ func (c *SWF) RespondActivityTaskFailedRequest(input *RespondActivityTaskFailedI req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RespondActivityTaskFailedRequest{Request: req, Input: input} + return RespondActivityTaskFailedRequest{Request: req, Input: input, Copy: c.RespondActivityTaskFailedRequest} } const opRespondDecisionTaskCompleted = "RespondDecisionTaskCompleted" @@ -2468,6 +2467,7 @@ const opRespondDecisionTaskCompleted = "RespondDecisionTaskCompleted" type RespondDecisionTaskCompletedRequest struct { *aws.Request Input *RespondDecisionTaskCompletedInput + Copy func(*RespondDecisionTaskCompletedInput) RespondDecisionTaskCompletedRequest } // Send marshals and sends the RespondDecisionTaskCompleted API request. @@ -2524,7 +2524,7 @@ func (c *SWF) RespondDecisionTaskCompletedRequest(input *RespondDecisionTaskComp req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RespondDecisionTaskCompletedRequest{Request: req, Input: input} + return RespondDecisionTaskCompletedRequest{Request: req, Input: input, Copy: c.RespondDecisionTaskCompletedRequest} } const opSignalWorkflowExecution = "SignalWorkflowExecution" @@ -2533,6 +2533,7 @@ const opSignalWorkflowExecution = "SignalWorkflowExecution" type SignalWorkflowExecutionRequest struct { *aws.Request Input *SignalWorkflowExecutionInput + Copy func(*SignalWorkflowExecutionInput) SignalWorkflowExecutionRequest } // Send marshals and sends the SignalWorkflowExecution API request. @@ -2601,7 +2602,7 @@ func (c *SWF) SignalWorkflowExecutionRequest(input *SignalWorkflowExecutionInput req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return SignalWorkflowExecutionRequest{Request: req, Input: input} + return SignalWorkflowExecutionRequest{Request: req, Input: input, Copy: c.SignalWorkflowExecutionRequest} } const opStartWorkflowExecution = "StartWorkflowExecution" @@ -2610,6 +2611,7 @@ const opStartWorkflowExecution = "StartWorkflowExecution" type StartWorkflowExecutionRequest struct { *aws.Request Input *StartWorkflowExecutionInput + Copy func(*StartWorkflowExecutionInput) StartWorkflowExecutionRequest } // Send marshals and sends the StartWorkflowExecution API request. @@ -2687,7 +2689,7 @@ func (c *SWF) StartWorkflowExecutionRequest(input *StartWorkflowExecutionInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartWorkflowExecutionRequest{Request: req, Input: input} + return StartWorkflowExecutionRequest{Request: req, Input: input, Copy: c.StartWorkflowExecutionRequest} } const opTerminateWorkflowExecution = "TerminateWorkflowExecution" @@ -2696,6 +2698,7 @@ const opTerminateWorkflowExecution = "TerminateWorkflowExecution" type TerminateWorkflowExecutionRequest struct { *aws.Request Input *TerminateWorkflowExecutionInput + Copy func(*TerminateWorkflowExecutionInput) TerminateWorkflowExecutionRequest } // Send marshals and sends the TerminateWorkflowExecution API request. @@ -2769,7 +2772,7 @@ func (c *SWF) TerminateWorkflowExecutionRequest(input *TerminateWorkflowExecutio req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return TerminateWorkflowExecutionRequest{Request: req, Input: input} + return TerminateWorkflowExecutionRequest{Request: req, Input: input, Copy: c.TerminateWorkflowExecutionRequest} } // Provides the details of the ActivityTaskCancelRequested event. diff --git a/service/swf/swfiface/interface.go b/service/swf/swfiface/interface.go index 35487191649..b2b2e06904e 100644 --- a/service/swf/swfiface/interface.go +++ b/service/swf/swfiface/interface.go @@ -9,7 +9,6 @@ package swfiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/swf" ) @@ -87,41 +86,20 @@ type SWFAPI interface { GetWorkflowExecutionHistoryRequest(*swf.GetWorkflowExecutionHistoryInput) swf.GetWorkflowExecutionHistoryRequest - GetWorkflowExecutionHistoryPages(*swf.GetWorkflowExecutionHistoryInput, func(*swf.GetWorkflowExecutionHistoryOutput, bool) bool) error - GetWorkflowExecutionHistoryPagesWithContext(aws.Context, *swf.GetWorkflowExecutionHistoryInput, func(*swf.GetWorkflowExecutionHistoryOutput, bool) bool, ...aws.Option) error - ListActivityTypesRequest(*swf.ListActivityTypesInput) swf.ListActivityTypesRequest - ListActivityTypesPages(*swf.ListActivityTypesInput, func(*swf.ListActivityTypesOutput, bool) bool) error - ListActivityTypesPagesWithContext(aws.Context, *swf.ListActivityTypesInput, func(*swf.ListActivityTypesOutput, bool) bool, ...aws.Option) error - ListClosedWorkflowExecutionsRequest(*swf.ListClosedWorkflowExecutionsInput) swf.ListClosedWorkflowExecutionsRequest - ListClosedWorkflowExecutionsPages(*swf.ListClosedWorkflowExecutionsInput, func(*swf.ListOpenWorkflowExecutionsOutput, bool) bool) error - ListClosedWorkflowExecutionsPagesWithContext(aws.Context, *swf.ListClosedWorkflowExecutionsInput, func(*swf.ListOpenWorkflowExecutionsOutput, bool) bool, ...aws.Option) error - ListDomainsRequest(*swf.ListDomainsInput) swf.ListDomainsRequest - ListDomainsPages(*swf.ListDomainsInput, func(*swf.ListDomainsOutput, bool) bool) error - ListDomainsPagesWithContext(aws.Context, *swf.ListDomainsInput, func(*swf.ListDomainsOutput, bool) bool, ...aws.Option) error - ListOpenWorkflowExecutionsRequest(*swf.ListOpenWorkflowExecutionsInput) swf.ListOpenWorkflowExecutionsRequest - ListOpenWorkflowExecutionsPages(*swf.ListOpenWorkflowExecutionsInput, func(*swf.ListOpenWorkflowExecutionsOutput, bool) bool) error - ListOpenWorkflowExecutionsPagesWithContext(aws.Context, *swf.ListOpenWorkflowExecutionsInput, func(*swf.ListOpenWorkflowExecutionsOutput, bool) bool, ...aws.Option) error - ListWorkflowTypesRequest(*swf.ListWorkflowTypesInput) swf.ListWorkflowTypesRequest - ListWorkflowTypesPages(*swf.ListWorkflowTypesInput, func(*swf.ListWorkflowTypesOutput, bool) bool) error - ListWorkflowTypesPagesWithContext(aws.Context, *swf.ListWorkflowTypesInput, func(*swf.ListWorkflowTypesOutput, bool) bool, ...aws.Option) error - PollForActivityTaskRequest(*swf.PollForActivityTaskInput) swf.PollForActivityTaskRequest PollForDecisionTaskRequest(*swf.PollForDecisionTaskInput) swf.PollForDecisionTaskRequest - PollForDecisionTaskPages(*swf.PollForDecisionTaskInput, func(*swf.PollForDecisionTaskOutput, bool) bool) error - PollForDecisionTaskPagesWithContext(aws.Context, *swf.PollForDecisionTaskInput, func(*swf.PollForDecisionTaskOutput, bool) bool, ...aws.Option) error - RecordActivityTaskHeartbeatRequest(*swf.RecordActivityTaskHeartbeatInput) swf.RecordActivityTaskHeartbeatRequest RegisterActivityTypeRequest(*swf.RegisterActivityTypeInput) swf.RegisterActivityTypeRequest diff --git a/service/translate/api.go b/service/translate/api.go index 8993855fb5a..6a91eee68c2 100644 --- a/service/translate/api.go +++ b/service/translate/api.go @@ -13,6 +13,7 @@ const opText = "TranslateText" type TextRequest struct { *aws.Request Input *TextInput + Copy func(*TextInput) TextRequest } // Send marshals and sends the Text API request. @@ -67,7 +68,7 @@ func (c *Translate) TextRequest(input *TextInput) TextRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TextRequest{Request: req, Input: input} + return TextRequest{Request: req, Input: input, Copy: c.TextRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TextRequest diff --git a/service/waf/api.go b/service/waf/api.go index 706e0158f57..b52f66ad969 100644 --- a/service/waf/api.go +++ b/service/waf/api.go @@ -16,6 +16,7 @@ const opCreateByteMatchSet = "CreateByteMatchSet" type CreateByteMatchSetRequest struct { *aws.Request Input *CreateByteMatchSetInput + Copy func(*CreateByteMatchSetInput) CreateByteMatchSetRequest } // Send marshals and sends the CreateByteMatchSet API request. @@ -77,7 +78,7 @@ func (c *WAF) CreateByteMatchSetRequest(input *CreateByteMatchSetInput) CreateBy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateByteMatchSetRequest{Request: req, Input: input} + return CreateByteMatchSetRequest{Request: req, Input: input, Copy: c.CreateByteMatchSetRequest} } const opCreateGeoMatchSet = "CreateGeoMatchSet" @@ -86,6 +87,7 @@ const opCreateGeoMatchSet = "CreateGeoMatchSet" type CreateGeoMatchSetRequest struct { *aws.Request Input *CreateGeoMatchSetInput + Copy func(*CreateGeoMatchSetInput) CreateGeoMatchSetRequest } // Send marshals and sends the CreateGeoMatchSet API request. @@ -146,7 +148,7 @@ func (c *WAF) CreateGeoMatchSetRequest(input *CreateGeoMatchSetInput) CreateGeoM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGeoMatchSetRequest{Request: req, Input: input} + return CreateGeoMatchSetRequest{Request: req, Input: input, Copy: c.CreateGeoMatchSetRequest} } const opCreateIPSet = "CreateIPSet" @@ -155,6 +157,7 @@ const opCreateIPSet = "CreateIPSet" type CreateIPSetRequest struct { *aws.Request Input *CreateIPSetInput + Copy func(*CreateIPSetInput) CreateIPSetRequest } // Send marshals and sends the CreateIPSet API request. @@ -216,7 +219,7 @@ func (c *WAF) CreateIPSetRequest(input *CreateIPSetInput) CreateIPSetRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateIPSetRequest{Request: req, Input: input} + return CreateIPSetRequest{Request: req, Input: input, Copy: c.CreateIPSetRequest} } const opCreateRateBasedRule = "CreateRateBasedRule" @@ -225,6 +228,7 @@ const opCreateRateBasedRule = "CreateRateBasedRule" type CreateRateBasedRuleRequest struct { *aws.Request Input *CreateRateBasedRuleInput + Copy func(*CreateRateBasedRuleInput) CreateRateBasedRuleRequest } // Send marshals and sends the CreateRateBasedRule API request. @@ -325,7 +329,7 @@ func (c *WAF) CreateRateBasedRuleRequest(input *CreateRateBasedRuleInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRateBasedRuleRequest{Request: req, Input: input} + return CreateRateBasedRuleRequest{Request: req, Input: input, Copy: c.CreateRateBasedRuleRequest} } const opCreateRegexMatchSet = "CreateRegexMatchSet" @@ -334,6 +338,7 @@ const opCreateRegexMatchSet = "CreateRegexMatchSet" type CreateRegexMatchSetRequest struct { *aws.Request Input *CreateRegexMatchSetInput + Copy func(*CreateRegexMatchSetInput) CreateRegexMatchSetRequest } // Send marshals and sends the CreateRegexMatchSet API request. @@ -396,7 +401,7 @@ func (c *WAF) CreateRegexMatchSetRequest(input *CreateRegexMatchSetInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRegexMatchSetRequest{Request: req, Input: input} + return CreateRegexMatchSetRequest{Request: req, Input: input, Copy: c.CreateRegexMatchSetRequest} } const opCreateRegexPatternSet = "CreateRegexPatternSet" @@ -405,6 +410,7 @@ const opCreateRegexPatternSet = "CreateRegexPatternSet" type CreateRegexPatternSetRequest struct { *aws.Request Input *CreateRegexPatternSetInput + Copy func(*CreateRegexPatternSetInput) CreateRegexPatternSetRequest } // Send marshals and sends the CreateRegexPatternSet API request. @@ -463,7 +469,7 @@ func (c *WAF) CreateRegexPatternSetRequest(input *CreateRegexPatternSetInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRegexPatternSetRequest{Request: req, Input: input} + return CreateRegexPatternSetRequest{Request: req, Input: input, Copy: c.CreateRegexPatternSetRequest} } const opCreateRule = "CreateRule" @@ -472,6 +478,7 @@ const opCreateRule = "CreateRule" type CreateRuleRequest struct { *aws.Request Input *CreateRuleInput + Copy func(*CreateRuleInput) CreateRuleRequest } // Send marshals and sends the CreateRule API request. @@ -547,7 +554,7 @@ func (c *WAF) CreateRuleRequest(input *CreateRuleInput) CreateRuleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRuleRequest{Request: req, Input: input} + return CreateRuleRequest{Request: req, Input: input, Copy: c.CreateRuleRequest} } const opCreateRuleGroup = "CreateRuleGroup" @@ -556,6 +563,7 @@ const opCreateRuleGroup = "CreateRuleGroup" type CreateRuleGroupRequest struct { *aws.Request Input *CreateRuleGroupInput + Copy func(*CreateRuleGroupInput) CreateRuleGroupRequest } // Send marshals and sends the CreateRuleGroup API request. @@ -609,7 +617,7 @@ func (c *WAF) CreateRuleGroupRequest(input *CreateRuleGroupInput) CreateRuleGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRuleGroupRequest{Request: req, Input: input} + return CreateRuleGroupRequest{Request: req, Input: input, Copy: c.CreateRuleGroupRequest} } const opCreateSizeConstraintSet = "CreateSizeConstraintSet" @@ -618,6 +626,7 @@ const opCreateSizeConstraintSet = "CreateSizeConstraintSet" type CreateSizeConstraintSetRequest struct { *aws.Request Input *CreateSizeConstraintSetInput + Copy func(*CreateSizeConstraintSetInput) CreateSizeConstraintSetRequest } // Send marshals and sends the CreateSizeConstraintSet API request. @@ -680,7 +689,7 @@ func (c *WAF) CreateSizeConstraintSetRequest(input *CreateSizeConstraintSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSizeConstraintSetRequest{Request: req, Input: input} + return CreateSizeConstraintSetRequest{Request: req, Input: input, Copy: c.CreateSizeConstraintSetRequest} } const opCreateSqlInjectionMatchSet = "CreateSqlInjectionMatchSet" @@ -689,6 +698,7 @@ const opCreateSqlInjectionMatchSet = "CreateSqlInjectionMatchSet" type CreateSqlInjectionMatchSetRequest struct { *aws.Request Input *CreateSqlInjectionMatchSetInput + Copy func(*CreateSqlInjectionMatchSetInput) CreateSqlInjectionMatchSetRequest } // Send marshals and sends the CreateSqlInjectionMatchSet API request. @@ -747,7 +757,7 @@ func (c *WAF) CreateSqlInjectionMatchSetRequest(input *CreateSqlInjectionMatchSe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSqlInjectionMatchSetRequest{Request: req, Input: input} + return CreateSqlInjectionMatchSetRequest{Request: req, Input: input, Copy: c.CreateSqlInjectionMatchSetRequest} } const opCreateWebACL = "CreateWebACL" @@ -756,6 +766,7 @@ const opCreateWebACL = "CreateWebACL" type CreateWebACLRequest struct { *aws.Request Input *CreateWebACLInput + Copy func(*CreateWebACLInput) CreateWebACLRequest } // Send marshals and sends the CreateWebACL API request. @@ -826,7 +837,7 @@ func (c *WAF) CreateWebACLRequest(input *CreateWebACLInput) CreateWebACLRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateWebACLRequest{Request: req, Input: input} + return CreateWebACLRequest{Request: req, Input: input, Copy: c.CreateWebACLRequest} } const opCreateXssMatchSet = "CreateXssMatchSet" @@ -835,6 +846,7 @@ const opCreateXssMatchSet = "CreateXssMatchSet" type CreateXssMatchSetRequest struct { *aws.Request Input *CreateXssMatchSetInput + Copy func(*CreateXssMatchSetInput) CreateXssMatchSetRequest } // Send marshals and sends the CreateXssMatchSet API request. @@ -894,7 +906,7 @@ func (c *WAF) CreateXssMatchSetRequest(input *CreateXssMatchSetInput) CreateXssM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateXssMatchSetRequest{Request: req, Input: input} + return CreateXssMatchSetRequest{Request: req, Input: input, Copy: c.CreateXssMatchSetRequest} } const opDeleteByteMatchSet = "DeleteByteMatchSet" @@ -903,6 +915,7 @@ const opDeleteByteMatchSet = "DeleteByteMatchSet" type DeleteByteMatchSetRequest struct { *aws.Request Input *DeleteByteMatchSetInput + Copy func(*DeleteByteMatchSetInput) DeleteByteMatchSetRequest } // Send marshals and sends the DeleteByteMatchSet API request. @@ -957,7 +970,7 @@ func (c *WAF) DeleteByteMatchSetRequest(input *DeleteByteMatchSetInput) DeleteBy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteByteMatchSetRequest{Request: req, Input: input} + return DeleteByteMatchSetRequest{Request: req, Input: input, Copy: c.DeleteByteMatchSetRequest} } const opDeleteGeoMatchSet = "DeleteGeoMatchSet" @@ -966,6 +979,7 @@ const opDeleteGeoMatchSet = "DeleteGeoMatchSet" type DeleteGeoMatchSetRequest struct { *aws.Request Input *DeleteGeoMatchSetInput + Copy func(*DeleteGeoMatchSetInput) DeleteGeoMatchSetRequest } // Send marshals and sends the DeleteGeoMatchSet API request. @@ -1019,7 +1033,7 @@ func (c *WAF) DeleteGeoMatchSetRequest(input *DeleteGeoMatchSetInput) DeleteGeoM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGeoMatchSetRequest{Request: req, Input: input} + return DeleteGeoMatchSetRequest{Request: req, Input: input, Copy: c.DeleteGeoMatchSetRequest} } const opDeleteIPSet = "DeleteIPSet" @@ -1028,6 +1042,7 @@ const opDeleteIPSet = "DeleteIPSet" type DeleteIPSetRequest struct { *aws.Request Input *DeleteIPSetInput + Copy func(*DeleteIPSetInput) DeleteIPSetRequest } // Send marshals and sends the DeleteIPSet API request. @@ -1081,7 +1096,7 @@ func (c *WAF) DeleteIPSetRequest(input *DeleteIPSetInput) DeleteIPSetRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteIPSetRequest{Request: req, Input: input} + return DeleteIPSetRequest{Request: req, Input: input, Copy: c.DeleteIPSetRequest} } const opDeleteRateBasedRule = "DeleteRateBasedRule" @@ -1090,6 +1105,7 @@ const opDeleteRateBasedRule = "DeleteRateBasedRule" type DeleteRateBasedRuleRequest struct { *aws.Request Input *DeleteRateBasedRuleInput + Copy func(*DeleteRateBasedRuleInput) DeleteRateBasedRuleRequest } // Send marshals and sends the DeleteRateBasedRule API request. @@ -1145,7 +1161,7 @@ func (c *WAF) DeleteRateBasedRuleRequest(input *DeleteRateBasedRuleInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRateBasedRuleRequest{Request: req, Input: input} + return DeleteRateBasedRuleRequest{Request: req, Input: input, Copy: c.DeleteRateBasedRuleRequest} } const opDeleteRegexMatchSet = "DeleteRegexMatchSet" @@ -1154,6 +1170,7 @@ const opDeleteRegexMatchSet = "DeleteRegexMatchSet" type DeleteRegexMatchSetRequest struct { *aws.Request Input *DeleteRegexMatchSetInput + Copy func(*DeleteRegexMatchSetInput) DeleteRegexMatchSetRequest } // Send marshals and sends the DeleteRegexMatchSet API request. @@ -1208,7 +1225,7 @@ func (c *WAF) DeleteRegexMatchSetRequest(input *DeleteRegexMatchSetInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRegexMatchSetRequest{Request: req, Input: input} + return DeleteRegexMatchSetRequest{Request: req, Input: input, Copy: c.DeleteRegexMatchSetRequest} } const opDeleteRegexPatternSet = "DeleteRegexPatternSet" @@ -1217,6 +1234,7 @@ const opDeleteRegexPatternSet = "DeleteRegexPatternSet" type DeleteRegexPatternSetRequest struct { *aws.Request Input *DeleteRegexPatternSetInput + Copy func(*DeleteRegexPatternSetInput) DeleteRegexPatternSetRequest } // Send marshals and sends the DeleteRegexPatternSet API request. @@ -1259,7 +1277,7 @@ func (c *WAF) DeleteRegexPatternSetRequest(input *DeleteRegexPatternSetInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRegexPatternSetRequest{Request: req, Input: input} + return DeleteRegexPatternSetRequest{Request: req, Input: input, Copy: c.DeleteRegexPatternSetRequest} } const opDeleteRule = "DeleteRule" @@ -1268,6 +1286,7 @@ const opDeleteRule = "DeleteRule" type DeleteRuleRequest struct { *aws.Request Input *DeleteRuleInput + Copy func(*DeleteRuleInput) DeleteRuleRequest } // Send marshals and sends the DeleteRule API request. @@ -1321,7 +1340,7 @@ func (c *WAF) DeleteRuleRequest(input *DeleteRuleInput) DeleteRuleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRuleRequest{Request: req, Input: input} + return DeleteRuleRequest{Request: req, Input: input, Copy: c.DeleteRuleRequest} } const opDeleteRuleGroup = "DeleteRuleGroup" @@ -1330,6 +1349,7 @@ const opDeleteRuleGroup = "DeleteRuleGroup" type DeleteRuleGroupRequest struct { *aws.Request Input *DeleteRuleGroupInput + Copy func(*DeleteRuleGroupInput) DeleteRuleGroupRequest } // Send marshals and sends the DeleteRuleGroup API request. @@ -1382,7 +1402,7 @@ func (c *WAF) DeleteRuleGroupRequest(input *DeleteRuleGroupInput) DeleteRuleGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRuleGroupRequest{Request: req, Input: input} + return DeleteRuleGroupRequest{Request: req, Input: input, Copy: c.DeleteRuleGroupRequest} } const opDeleteSizeConstraintSet = "DeleteSizeConstraintSet" @@ -1391,6 +1411,7 @@ const opDeleteSizeConstraintSet = "DeleteSizeConstraintSet" type DeleteSizeConstraintSetRequest struct { *aws.Request Input *DeleteSizeConstraintSetInput + Copy func(*DeleteSizeConstraintSetInput) DeleteSizeConstraintSetRequest } // Send marshals and sends the DeleteSizeConstraintSet API request. @@ -1445,7 +1466,7 @@ func (c *WAF) DeleteSizeConstraintSetRequest(input *DeleteSizeConstraintSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSizeConstraintSetRequest{Request: req, Input: input} + return DeleteSizeConstraintSetRequest{Request: req, Input: input, Copy: c.DeleteSizeConstraintSetRequest} } const opDeleteSqlInjectionMatchSet = "DeleteSqlInjectionMatchSet" @@ -1454,6 +1475,7 @@ const opDeleteSqlInjectionMatchSet = "DeleteSqlInjectionMatchSet" type DeleteSqlInjectionMatchSetRequest struct { *aws.Request Input *DeleteSqlInjectionMatchSetInput + Copy func(*DeleteSqlInjectionMatchSetInput) DeleteSqlInjectionMatchSetRequest } // Send marshals and sends the DeleteSqlInjectionMatchSet API request. @@ -1509,7 +1531,7 @@ func (c *WAF) DeleteSqlInjectionMatchSetRequest(input *DeleteSqlInjectionMatchSe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSqlInjectionMatchSetRequest{Request: req, Input: input} + return DeleteSqlInjectionMatchSetRequest{Request: req, Input: input, Copy: c.DeleteSqlInjectionMatchSetRequest} } const opDeleteWebACL = "DeleteWebACL" @@ -1518,6 +1540,7 @@ const opDeleteWebACL = "DeleteWebACL" type DeleteWebACLRequest struct { *aws.Request Input *DeleteWebACLInput + Copy func(*DeleteWebACLInput) DeleteWebACLRequest } // Send marshals and sends the DeleteWebACL API request. @@ -1568,7 +1591,7 @@ func (c *WAF) DeleteWebACLRequest(input *DeleteWebACLInput) DeleteWebACLRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteWebACLRequest{Request: req, Input: input} + return DeleteWebACLRequest{Request: req, Input: input, Copy: c.DeleteWebACLRequest} } const opDeleteXssMatchSet = "DeleteXssMatchSet" @@ -1577,6 +1600,7 @@ const opDeleteXssMatchSet = "DeleteXssMatchSet" type DeleteXssMatchSetRequest struct { *aws.Request Input *DeleteXssMatchSetInput + Copy func(*DeleteXssMatchSetInput) DeleteXssMatchSetRequest } // Send marshals and sends the DeleteXssMatchSet API request. @@ -1631,7 +1655,7 @@ func (c *WAF) DeleteXssMatchSetRequest(input *DeleteXssMatchSetInput) DeleteXssM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteXssMatchSetRequest{Request: req, Input: input} + return DeleteXssMatchSetRequest{Request: req, Input: input, Copy: c.DeleteXssMatchSetRequest} } const opGetByteMatchSet = "GetByteMatchSet" @@ -1640,6 +1664,7 @@ const opGetByteMatchSet = "GetByteMatchSet" type GetByteMatchSetRequest struct { *aws.Request Input *GetByteMatchSetInput + Copy func(*GetByteMatchSetInput) GetByteMatchSetRequest } // Send marshals and sends the GetByteMatchSet API request. @@ -1680,7 +1705,7 @@ func (c *WAF) GetByteMatchSetRequest(input *GetByteMatchSetInput) GetByteMatchSe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetByteMatchSetRequest{Request: req, Input: input} + return GetByteMatchSetRequest{Request: req, Input: input, Copy: c.GetByteMatchSetRequest} } const opGetChangeToken = "GetChangeToken" @@ -1689,6 +1714,7 @@ const opGetChangeToken = "GetChangeToken" type GetChangeTokenRequest struct { *aws.Request Input *GetChangeTokenInput + Copy func(*GetChangeTokenInput) GetChangeTokenRequest } // Send marshals and sends the GetChangeToken API request. @@ -1743,7 +1769,7 @@ func (c *WAF) GetChangeTokenRequest(input *GetChangeTokenInput) GetChangeTokenRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetChangeTokenRequest{Request: req, Input: input} + return GetChangeTokenRequest{Request: req, Input: input, Copy: c.GetChangeTokenRequest} } const opGetChangeTokenStatus = "GetChangeTokenStatus" @@ -1752,6 +1778,7 @@ const opGetChangeTokenStatus = "GetChangeTokenStatus" type GetChangeTokenStatusRequest struct { *aws.Request Input *GetChangeTokenStatusInput + Copy func(*GetChangeTokenStatusInput) GetChangeTokenStatusRequest } // Send marshals and sends the GetChangeTokenStatus API request. @@ -1802,7 +1829,7 @@ func (c *WAF) GetChangeTokenStatusRequest(input *GetChangeTokenStatusInput) GetC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetChangeTokenStatusRequest{Request: req, Input: input} + return GetChangeTokenStatusRequest{Request: req, Input: input, Copy: c.GetChangeTokenStatusRequest} } const opGetGeoMatchSet = "GetGeoMatchSet" @@ -1811,6 +1838,7 @@ const opGetGeoMatchSet = "GetGeoMatchSet" type GetGeoMatchSetRequest struct { *aws.Request Input *GetGeoMatchSetInput + Copy func(*GetGeoMatchSetInput) GetGeoMatchSetRequest } // Send marshals and sends the GetGeoMatchSet API request. @@ -1851,7 +1879,7 @@ func (c *WAF) GetGeoMatchSetRequest(input *GetGeoMatchSetInput) GetGeoMatchSetRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGeoMatchSetRequest{Request: req, Input: input} + return GetGeoMatchSetRequest{Request: req, Input: input, Copy: c.GetGeoMatchSetRequest} } const opGetIPSet = "GetIPSet" @@ -1860,6 +1888,7 @@ const opGetIPSet = "GetIPSet" type GetIPSetRequest struct { *aws.Request Input *GetIPSetInput + Copy func(*GetIPSetInput) GetIPSetRequest } // Send marshals and sends the GetIPSet API request. @@ -1900,7 +1929,7 @@ func (c *WAF) GetIPSetRequest(input *GetIPSetInput) GetIPSetRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIPSetRequest{Request: req, Input: input} + return GetIPSetRequest{Request: req, Input: input, Copy: c.GetIPSetRequest} } const opGetRateBasedRule = "GetRateBasedRule" @@ -1909,6 +1938,7 @@ const opGetRateBasedRule = "GetRateBasedRule" type GetRateBasedRuleRequest struct { *aws.Request Input *GetRateBasedRuleInput + Copy func(*GetRateBasedRuleInput) GetRateBasedRuleRequest } // Send marshals and sends the GetRateBasedRule API request. @@ -1950,7 +1980,7 @@ func (c *WAF) GetRateBasedRuleRequest(input *GetRateBasedRuleInput) GetRateBased req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRateBasedRuleRequest{Request: req, Input: input} + return GetRateBasedRuleRequest{Request: req, Input: input, Copy: c.GetRateBasedRuleRequest} } const opGetRateBasedRuleManagedKeys = "GetRateBasedRuleManagedKeys" @@ -1959,6 +1989,7 @@ const opGetRateBasedRuleManagedKeys = "GetRateBasedRuleManagedKeys" type GetRateBasedRuleManagedKeysRequest struct { *aws.Request Input *GetRateBasedRuleManagedKeysInput + Copy func(*GetRateBasedRuleManagedKeysInput) GetRateBasedRuleManagedKeysRequest } // Send marshals and sends the GetRateBasedRuleManagedKeys API request. @@ -2002,7 +2033,7 @@ func (c *WAF) GetRateBasedRuleManagedKeysRequest(input *GetRateBasedRuleManagedK req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRateBasedRuleManagedKeysRequest{Request: req, Input: input} + return GetRateBasedRuleManagedKeysRequest{Request: req, Input: input, Copy: c.GetRateBasedRuleManagedKeysRequest} } const opGetRegexMatchSet = "GetRegexMatchSet" @@ -2011,6 +2042,7 @@ const opGetRegexMatchSet = "GetRegexMatchSet" type GetRegexMatchSetRequest struct { *aws.Request Input *GetRegexMatchSetInput + Copy func(*GetRegexMatchSetInput) GetRegexMatchSetRequest } // Send marshals and sends the GetRegexMatchSet API request. @@ -2051,7 +2083,7 @@ func (c *WAF) GetRegexMatchSetRequest(input *GetRegexMatchSetInput) GetRegexMatc req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRegexMatchSetRequest{Request: req, Input: input} + return GetRegexMatchSetRequest{Request: req, Input: input, Copy: c.GetRegexMatchSetRequest} } const opGetRegexPatternSet = "GetRegexPatternSet" @@ -2060,6 +2092,7 @@ const opGetRegexPatternSet = "GetRegexPatternSet" type GetRegexPatternSetRequest struct { *aws.Request Input *GetRegexPatternSetInput + Copy func(*GetRegexPatternSetInput) GetRegexPatternSetRequest } // Send marshals and sends the GetRegexPatternSet API request. @@ -2100,7 +2133,7 @@ func (c *WAF) GetRegexPatternSetRequest(input *GetRegexPatternSetInput) GetRegex req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRegexPatternSetRequest{Request: req, Input: input} + return GetRegexPatternSetRequest{Request: req, Input: input, Copy: c.GetRegexPatternSetRequest} } const opGetRule = "GetRule" @@ -2109,6 +2142,7 @@ const opGetRule = "GetRule" type GetRuleRequest struct { *aws.Request Input *GetRuleInput + Copy func(*GetRuleInput) GetRuleRequest } // Send marshals and sends the GetRule API request. @@ -2150,7 +2184,7 @@ func (c *WAF) GetRuleRequest(input *GetRuleInput) GetRuleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRuleRequest{Request: req, Input: input} + return GetRuleRequest{Request: req, Input: input, Copy: c.GetRuleRequest} } const opGetRuleGroup = "GetRuleGroup" @@ -2159,6 +2193,7 @@ const opGetRuleGroup = "GetRuleGroup" type GetRuleGroupRequest struct { *aws.Request Input *GetRuleGroupInput + Copy func(*GetRuleGroupInput) GetRuleGroupRequest } // Send marshals and sends the GetRuleGroup API request. @@ -2202,7 +2237,7 @@ func (c *WAF) GetRuleGroupRequest(input *GetRuleGroupInput) GetRuleGroupRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRuleGroupRequest{Request: req, Input: input} + return GetRuleGroupRequest{Request: req, Input: input, Copy: c.GetRuleGroupRequest} } const opGetSampledRequests = "GetSampledRequests" @@ -2211,6 +2246,7 @@ const opGetSampledRequests = "GetSampledRequests" type GetSampledRequestsRequest struct { *aws.Request Input *GetSampledRequestsInput + Copy func(*GetSampledRequestsInput) GetSampledRequestsRequest } // Send marshals and sends the GetSampledRequests API request. @@ -2261,7 +2297,7 @@ func (c *WAF) GetSampledRequestsRequest(input *GetSampledRequestsInput) GetSampl req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSampledRequestsRequest{Request: req, Input: input} + return GetSampledRequestsRequest{Request: req, Input: input, Copy: c.GetSampledRequestsRequest} } const opGetSizeConstraintSet = "GetSizeConstraintSet" @@ -2270,6 +2306,7 @@ const opGetSizeConstraintSet = "GetSizeConstraintSet" type GetSizeConstraintSetRequest struct { *aws.Request Input *GetSizeConstraintSetInput + Copy func(*GetSizeConstraintSetInput) GetSizeConstraintSetRequest } // Send marshals and sends the GetSizeConstraintSet API request. @@ -2310,7 +2347,7 @@ func (c *WAF) GetSizeConstraintSetRequest(input *GetSizeConstraintSetInput) GetS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSizeConstraintSetRequest{Request: req, Input: input} + return GetSizeConstraintSetRequest{Request: req, Input: input, Copy: c.GetSizeConstraintSetRequest} } const opGetSqlInjectionMatchSet = "GetSqlInjectionMatchSet" @@ -2319,6 +2356,7 @@ const opGetSqlInjectionMatchSet = "GetSqlInjectionMatchSet" type GetSqlInjectionMatchSetRequest struct { *aws.Request Input *GetSqlInjectionMatchSetInput + Copy func(*GetSqlInjectionMatchSetInput) GetSqlInjectionMatchSetRequest } // Send marshals and sends the GetSqlInjectionMatchSet API request. @@ -2359,7 +2397,7 @@ func (c *WAF) GetSqlInjectionMatchSetRequest(input *GetSqlInjectionMatchSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSqlInjectionMatchSetRequest{Request: req, Input: input} + return GetSqlInjectionMatchSetRequest{Request: req, Input: input, Copy: c.GetSqlInjectionMatchSetRequest} } const opGetWebACL = "GetWebACL" @@ -2368,6 +2406,7 @@ const opGetWebACL = "GetWebACL" type GetWebACLRequest struct { *aws.Request Input *GetWebACLInput + Copy func(*GetWebACLInput) GetWebACLRequest } // Send marshals and sends the GetWebACL API request. @@ -2408,7 +2447,7 @@ func (c *WAF) GetWebACLRequest(input *GetWebACLInput) GetWebACLRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetWebACLRequest{Request: req, Input: input} + return GetWebACLRequest{Request: req, Input: input, Copy: c.GetWebACLRequest} } const opGetXssMatchSet = "GetXssMatchSet" @@ -2417,6 +2456,7 @@ const opGetXssMatchSet = "GetXssMatchSet" type GetXssMatchSetRequest struct { *aws.Request Input *GetXssMatchSetInput + Copy func(*GetXssMatchSetInput) GetXssMatchSetRequest } // Send marshals and sends the GetXssMatchSet API request. @@ -2457,7 +2497,7 @@ func (c *WAF) GetXssMatchSetRequest(input *GetXssMatchSetInput) GetXssMatchSetRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetXssMatchSetRequest{Request: req, Input: input} + return GetXssMatchSetRequest{Request: req, Input: input, Copy: c.GetXssMatchSetRequest} } const opListActivatedRulesInRuleGroup = "ListActivatedRulesInRuleGroup" @@ -2466,6 +2506,7 @@ const opListActivatedRulesInRuleGroup = "ListActivatedRulesInRuleGroup" type ListActivatedRulesInRuleGroupRequest struct { *aws.Request Input *ListActivatedRulesInRuleGroupInput + Copy func(*ListActivatedRulesInRuleGroupInput) ListActivatedRulesInRuleGroupRequest } // Send marshals and sends the ListActivatedRulesInRuleGroup API request. @@ -2506,7 +2547,7 @@ func (c *WAF) ListActivatedRulesInRuleGroupRequest(input *ListActivatedRulesInRu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListActivatedRulesInRuleGroupRequest{Request: req, Input: input} + return ListActivatedRulesInRuleGroupRequest{Request: req, Input: input, Copy: c.ListActivatedRulesInRuleGroupRequest} } const opListByteMatchSets = "ListByteMatchSets" @@ -2515,6 +2556,7 @@ const opListByteMatchSets = "ListByteMatchSets" type ListByteMatchSetsRequest struct { *aws.Request Input *ListByteMatchSetsInput + Copy func(*ListByteMatchSetsInput) ListByteMatchSetsRequest } // Send marshals and sends the ListByteMatchSets API request. @@ -2555,7 +2597,7 @@ func (c *WAF) ListByteMatchSetsRequest(input *ListByteMatchSetsInput) ListByteMa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListByteMatchSetsRequest{Request: req, Input: input} + return ListByteMatchSetsRequest{Request: req, Input: input, Copy: c.ListByteMatchSetsRequest} } const opListGeoMatchSets = "ListGeoMatchSets" @@ -2564,6 +2606,7 @@ const opListGeoMatchSets = "ListGeoMatchSets" type ListGeoMatchSetsRequest struct { *aws.Request Input *ListGeoMatchSetsInput + Copy func(*ListGeoMatchSetsInput) ListGeoMatchSetsRequest } // Send marshals and sends the ListGeoMatchSets API request. @@ -2604,7 +2647,7 @@ func (c *WAF) ListGeoMatchSetsRequest(input *ListGeoMatchSetsInput) ListGeoMatch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGeoMatchSetsRequest{Request: req, Input: input} + return ListGeoMatchSetsRequest{Request: req, Input: input, Copy: c.ListGeoMatchSetsRequest} } const opListIPSets = "ListIPSets" @@ -2613,6 +2656,7 @@ const opListIPSets = "ListIPSets" type ListIPSetsRequest struct { *aws.Request Input *ListIPSetsInput + Copy func(*ListIPSetsInput) ListIPSetsRequest } // Send marshals and sends the ListIPSets API request. @@ -2653,7 +2697,7 @@ func (c *WAF) ListIPSetsRequest(input *ListIPSetsInput) ListIPSetsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIPSetsRequest{Request: req, Input: input} + return ListIPSetsRequest{Request: req, Input: input, Copy: c.ListIPSetsRequest} } const opListRateBasedRules = "ListRateBasedRules" @@ -2662,6 +2706,7 @@ const opListRateBasedRules = "ListRateBasedRules" type ListRateBasedRulesRequest struct { *aws.Request Input *ListRateBasedRulesInput + Copy func(*ListRateBasedRulesInput) ListRateBasedRulesRequest } // Send marshals and sends the ListRateBasedRules API request. @@ -2702,7 +2747,7 @@ func (c *WAF) ListRateBasedRulesRequest(input *ListRateBasedRulesInput) ListRate req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRateBasedRulesRequest{Request: req, Input: input} + return ListRateBasedRulesRequest{Request: req, Input: input, Copy: c.ListRateBasedRulesRequest} } const opListRegexMatchSets = "ListRegexMatchSets" @@ -2711,6 +2756,7 @@ const opListRegexMatchSets = "ListRegexMatchSets" type ListRegexMatchSetsRequest struct { *aws.Request Input *ListRegexMatchSetsInput + Copy func(*ListRegexMatchSetsInput) ListRegexMatchSetsRequest } // Send marshals and sends the ListRegexMatchSets API request. @@ -2751,7 +2797,7 @@ func (c *WAF) ListRegexMatchSetsRequest(input *ListRegexMatchSetsInput) ListRege req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRegexMatchSetsRequest{Request: req, Input: input} + return ListRegexMatchSetsRequest{Request: req, Input: input, Copy: c.ListRegexMatchSetsRequest} } const opListRegexPatternSets = "ListRegexPatternSets" @@ -2760,6 +2806,7 @@ const opListRegexPatternSets = "ListRegexPatternSets" type ListRegexPatternSetsRequest struct { *aws.Request Input *ListRegexPatternSetsInput + Copy func(*ListRegexPatternSetsInput) ListRegexPatternSetsRequest } // Send marshals and sends the ListRegexPatternSets API request. @@ -2800,7 +2847,7 @@ func (c *WAF) ListRegexPatternSetsRequest(input *ListRegexPatternSetsInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRegexPatternSetsRequest{Request: req, Input: input} + return ListRegexPatternSetsRequest{Request: req, Input: input, Copy: c.ListRegexPatternSetsRequest} } const opListRuleGroups = "ListRuleGroups" @@ -2809,6 +2856,7 @@ const opListRuleGroups = "ListRuleGroups" type ListRuleGroupsRequest struct { *aws.Request Input *ListRuleGroupsInput + Copy func(*ListRuleGroupsInput) ListRuleGroupsRequest } // Send marshals and sends the ListRuleGroups API request. @@ -2849,7 +2897,7 @@ func (c *WAF) ListRuleGroupsRequest(input *ListRuleGroupsInput) ListRuleGroupsRe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRuleGroupsRequest{Request: req, Input: input} + return ListRuleGroupsRequest{Request: req, Input: input, Copy: c.ListRuleGroupsRequest} } const opListRules = "ListRules" @@ -2858,6 +2906,7 @@ const opListRules = "ListRules" type ListRulesRequest struct { *aws.Request Input *ListRulesInput + Copy func(*ListRulesInput) ListRulesRequest } // Send marshals and sends the ListRules API request. @@ -2898,7 +2947,7 @@ func (c *WAF) ListRulesRequest(input *ListRulesInput) ListRulesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRulesRequest{Request: req, Input: input} + return ListRulesRequest{Request: req, Input: input, Copy: c.ListRulesRequest} } const opListSizeConstraintSets = "ListSizeConstraintSets" @@ -2907,6 +2956,7 @@ const opListSizeConstraintSets = "ListSizeConstraintSets" type ListSizeConstraintSetsRequest struct { *aws.Request Input *ListSizeConstraintSetsInput + Copy func(*ListSizeConstraintSetsInput) ListSizeConstraintSetsRequest } // Send marshals and sends the ListSizeConstraintSets API request. @@ -2947,7 +2997,7 @@ func (c *WAF) ListSizeConstraintSetsRequest(input *ListSizeConstraintSetsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSizeConstraintSetsRequest{Request: req, Input: input} + return ListSizeConstraintSetsRequest{Request: req, Input: input, Copy: c.ListSizeConstraintSetsRequest} } const opListSqlInjectionMatchSets = "ListSqlInjectionMatchSets" @@ -2956,6 +3006,7 @@ const opListSqlInjectionMatchSets = "ListSqlInjectionMatchSets" type ListSqlInjectionMatchSetsRequest struct { *aws.Request Input *ListSqlInjectionMatchSetsInput + Copy func(*ListSqlInjectionMatchSetsInput) ListSqlInjectionMatchSetsRequest } // Send marshals and sends the ListSqlInjectionMatchSets API request. @@ -2996,7 +3047,7 @@ func (c *WAF) ListSqlInjectionMatchSetsRequest(input *ListSqlInjectionMatchSetsI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSqlInjectionMatchSetsRequest{Request: req, Input: input} + return ListSqlInjectionMatchSetsRequest{Request: req, Input: input, Copy: c.ListSqlInjectionMatchSetsRequest} } const opListSubscribedRuleGroups = "ListSubscribedRuleGroups" @@ -3005,6 +3056,7 @@ const opListSubscribedRuleGroups = "ListSubscribedRuleGroups" type ListSubscribedRuleGroupsRequest struct { *aws.Request Input *ListSubscribedRuleGroupsInput + Copy func(*ListSubscribedRuleGroupsInput) ListSubscribedRuleGroupsRequest } // Send marshals and sends the ListSubscribedRuleGroups API request. @@ -3045,7 +3097,7 @@ func (c *WAF) ListSubscribedRuleGroupsRequest(input *ListSubscribedRuleGroupsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSubscribedRuleGroupsRequest{Request: req, Input: input} + return ListSubscribedRuleGroupsRequest{Request: req, Input: input, Copy: c.ListSubscribedRuleGroupsRequest} } const opListWebACLs = "ListWebACLs" @@ -3054,6 +3106,7 @@ const opListWebACLs = "ListWebACLs" type ListWebACLsRequest struct { *aws.Request Input *ListWebACLsInput + Copy func(*ListWebACLsInput) ListWebACLsRequest } // Send marshals and sends the ListWebACLs API request. @@ -3094,7 +3147,7 @@ func (c *WAF) ListWebACLsRequest(input *ListWebACLsInput) ListWebACLsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListWebACLsRequest{Request: req, Input: input} + return ListWebACLsRequest{Request: req, Input: input, Copy: c.ListWebACLsRequest} } const opListXssMatchSets = "ListXssMatchSets" @@ -3103,6 +3156,7 @@ const opListXssMatchSets = "ListXssMatchSets" type ListXssMatchSetsRequest struct { *aws.Request Input *ListXssMatchSetsInput + Copy func(*ListXssMatchSetsInput) ListXssMatchSetsRequest } // Send marshals and sends the ListXssMatchSets API request. @@ -3143,7 +3197,7 @@ func (c *WAF) ListXssMatchSetsRequest(input *ListXssMatchSetsInput) ListXssMatch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListXssMatchSetsRequest{Request: req, Input: input} + return ListXssMatchSetsRequest{Request: req, Input: input, Copy: c.ListXssMatchSetsRequest} } const opUpdateByteMatchSet = "UpdateByteMatchSet" @@ -3152,6 +3206,7 @@ const opUpdateByteMatchSet = "UpdateByteMatchSet" type UpdateByteMatchSetRequest struct { *aws.Request Input *UpdateByteMatchSetInput + Copy func(*UpdateByteMatchSetInput) UpdateByteMatchSetRequest } // Send marshals and sends the UpdateByteMatchSet API request. @@ -3228,7 +3283,7 @@ func (c *WAF) UpdateByteMatchSetRequest(input *UpdateByteMatchSetInput) UpdateBy req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateByteMatchSetRequest{Request: req, Input: input} + return UpdateByteMatchSetRequest{Request: req, Input: input, Copy: c.UpdateByteMatchSetRequest} } const opUpdateGeoMatchSet = "UpdateGeoMatchSet" @@ -3237,6 +3292,7 @@ const opUpdateGeoMatchSet = "UpdateGeoMatchSet" type UpdateGeoMatchSetRequest struct { *aws.Request Input *UpdateGeoMatchSetInput + Copy func(*UpdateGeoMatchSetInput) UpdateGeoMatchSetRequest } // Send marshals and sends the UpdateGeoMatchSet API request. @@ -3304,7 +3360,7 @@ func (c *WAF) UpdateGeoMatchSetRequest(input *UpdateGeoMatchSetInput) UpdateGeoM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGeoMatchSetRequest{Request: req, Input: input} + return UpdateGeoMatchSetRequest{Request: req, Input: input, Copy: c.UpdateGeoMatchSetRequest} } const opUpdateIPSet = "UpdateIPSet" @@ -3313,6 +3369,7 @@ const opUpdateIPSet = "UpdateIPSet" type UpdateIPSetRequest struct { *aws.Request Input *UpdateIPSetInput + Copy func(*UpdateIPSetInput) UpdateIPSetRequest } // Send marshals and sends the UpdateIPSet API request. @@ -3401,7 +3458,7 @@ func (c *WAF) UpdateIPSetRequest(input *UpdateIPSetInput) UpdateIPSetRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateIPSetRequest{Request: req, Input: input} + return UpdateIPSetRequest{Request: req, Input: input, Copy: c.UpdateIPSetRequest} } const opUpdateRateBasedRule = "UpdateRateBasedRule" @@ -3410,6 +3467,7 @@ const opUpdateRateBasedRule = "UpdateRateBasedRule" type UpdateRateBasedRuleRequest struct { *aws.Request Input *UpdateRateBasedRuleInput + Copy func(*UpdateRateBasedRuleInput) UpdateRateBasedRuleRequest } // Send marshals and sends the UpdateRateBasedRule API request. @@ -3487,7 +3545,7 @@ func (c *WAF) UpdateRateBasedRuleRequest(input *UpdateRateBasedRuleInput) Update req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRateBasedRuleRequest{Request: req, Input: input} + return UpdateRateBasedRuleRequest{Request: req, Input: input, Copy: c.UpdateRateBasedRuleRequest} } const opUpdateRegexMatchSet = "UpdateRegexMatchSet" @@ -3496,6 +3554,7 @@ const opUpdateRegexMatchSet = "UpdateRegexMatchSet" type UpdateRegexMatchSetRequest struct { *aws.Request Input *UpdateRegexMatchSetInput + Copy func(*UpdateRegexMatchSetInput) UpdateRegexMatchSetRequest } // Send marshals and sends the UpdateRegexMatchSet API request. @@ -3569,7 +3628,7 @@ func (c *WAF) UpdateRegexMatchSetRequest(input *UpdateRegexMatchSetInput) Update req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRegexMatchSetRequest{Request: req, Input: input} + return UpdateRegexMatchSetRequest{Request: req, Input: input, Copy: c.UpdateRegexMatchSetRequest} } const opUpdateRegexPatternSet = "UpdateRegexPatternSet" @@ -3578,6 +3637,7 @@ const opUpdateRegexPatternSet = "UpdateRegexPatternSet" type UpdateRegexPatternSetRequest struct { *aws.Request Input *UpdateRegexPatternSetInput + Copy func(*UpdateRegexPatternSetInput) UpdateRegexPatternSetRequest } // Send marshals and sends the UpdateRegexPatternSet API request. @@ -3648,7 +3708,7 @@ func (c *WAF) UpdateRegexPatternSetRequest(input *UpdateRegexPatternSetInput) Up req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRegexPatternSetRequest{Request: req, Input: input} + return UpdateRegexPatternSetRequest{Request: req, Input: input, Copy: c.UpdateRegexPatternSetRequest} } const opUpdateRule = "UpdateRule" @@ -3657,6 +3717,7 @@ const opUpdateRule = "UpdateRule" type UpdateRuleRequest struct { *aws.Request Input *UpdateRuleInput + Copy func(*UpdateRuleInput) UpdateRuleRequest } // Send marshals and sends the UpdateRule API request. @@ -3729,7 +3790,7 @@ func (c *WAF) UpdateRuleRequest(input *UpdateRuleInput) UpdateRuleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRuleRequest{Request: req, Input: input} + return UpdateRuleRequest{Request: req, Input: input, Copy: c.UpdateRuleRequest} } const opUpdateRuleGroup = "UpdateRuleGroup" @@ -3738,6 +3799,7 @@ const opUpdateRuleGroup = "UpdateRuleGroup" type UpdateRuleGroupRequest struct { *aws.Request Input *UpdateRuleGroupInput + Copy func(*UpdateRuleGroupInput) UpdateRuleGroupRequest } // Send marshals and sends the UpdateRuleGroup API request. @@ -3800,7 +3862,7 @@ func (c *WAF) UpdateRuleGroupRequest(input *UpdateRuleGroupInput) UpdateRuleGrou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRuleGroupRequest{Request: req, Input: input} + return UpdateRuleGroupRequest{Request: req, Input: input, Copy: c.UpdateRuleGroupRequest} } const opUpdateSizeConstraintSet = "UpdateSizeConstraintSet" @@ -3809,6 +3871,7 @@ const opUpdateSizeConstraintSet = "UpdateSizeConstraintSet" type UpdateSizeConstraintSetRequest struct { *aws.Request Input *UpdateSizeConstraintSetInput + Copy func(*UpdateSizeConstraintSetInput) UpdateSizeConstraintSetRequest } // Send marshals and sends the UpdateSizeConstraintSet API request. @@ -3887,7 +3950,7 @@ func (c *WAF) UpdateSizeConstraintSetRequest(input *UpdateSizeConstraintSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSizeConstraintSetRequest{Request: req, Input: input} + return UpdateSizeConstraintSetRequest{Request: req, Input: input, Copy: c.UpdateSizeConstraintSetRequest} } const opUpdateSqlInjectionMatchSet = "UpdateSqlInjectionMatchSet" @@ -3896,6 +3959,7 @@ const opUpdateSqlInjectionMatchSet = "UpdateSqlInjectionMatchSet" type UpdateSqlInjectionMatchSetRequest struct { *aws.Request Input *UpdateSqlInjectionMatchSetInput + Copy func(*UpdateSqlInjectionMatchSetInput) UpdateSqlInjectionMatchSetRequest } // Send marshals and sends the UpdateSqlInjectionMatchSet API request. @@ -3967,7 +4031,7 @@ func (c *WAF) UpdateSqlInjectionMatchSetRequest(input *UpdateSqlInjectionMatchSe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSqlInjectionMatchSetRequest{Request: req, Input: input} + return UpdateSqlInjectionMatchSetRequest{Request: req, Input: input, Copy: c.UpdateSqlInjectionMatchSetRequest} } const opUpdateWebACL = "UpdateWebACL" @@ -3976,6 +4040,7 @@ const opUpdateWebACL = "UpdateWebACL" type UpdateWebACLRequest struct { *aws.Request Input *UpdateWebACLInput + Copy func(*UpdateWebACLInput) UpdateWebACLRequest } // Send marshals and sends the UpdateWebACL API request. @@ -4063,7 +4128,7 @@ func (c *WAF) UpdateWebACLRequest(input *UpdateWebACLInput) UpdateWebACLRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateWebACLRequest{Request: req, Input: input} + return UpdateWebACLRequest{Request: req, Input: input, Copy: c.UpdateWebACLRequest} } const opUpdateXssMatchSet = "UpdateXssMatchSet" @@ -4072,6 +4137,7 @@ const opUpdateXssMatchSet = "UpdateXssMatchSet" type UpdateXssMatchSetRequest struct { *aws.Request Input *UpdateXssMatchSetInput + Copy func(*UpdateXssMatchSetInput) UpdateXssMatchSetRequest } // Send marshals and sends the UpdateXssMatchSet API request. @@ -4143,7 +4209,7 @@ func (c *WAF) UpdateXssMatchSetRequest(input *UpdateXssMatchSetInput) UpdateXssM req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateXssMatchSetRequest{Request: req, Input: input} + return UpdateXssMatchSetRequest{Request: req, Input: input, Copy: c.UpdateXssMatchSetRequest} } // The ActivatedRule object in an UpdateWebACL request specifies a Rule that diff --git a/service/wafregional/api.go b/service/wafregional/api.go index dde6d5ce9d2..5cc750b3099 100644 --- a/service/wafregional/api.go +++ b/service/wafregional/api.go @@ -16,6 +16,7 @@ const opAssociateWebACL = "AssociateWebACL" type AssociateWebACLRequest struct { *aws.Request Input *AssociateWebACLInput + Copy func(*AssociateWebACLInput) AssociateWebACLRequest } // Send marshals and sends the AssociateWebACL API request. @@ -56,7 +57,7 @@ func (c *WAFRegional) AssociateWebACLRequest(input *AssociateWebACLInput) Associ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateWebACLRequest{Request: req, Input: input} + return AssociateWebACLRequest{Request: req, Input: input, Copy: c.AssociateWebACLRequest} } const opCreateByteMatchSet = "CreateByteMatchSet" @@ -65,6 +66,7 @@ const opCreateByteMatchSet = "CreateByteMatchSet" type CreateByteMatchSetRequest struct { *aws.Request Input *CreateByteMatchSetInput + Copy func(*CreateByteMatchSetInput) CreateByteMatchSetRequest } // Send marshals and sends the CreateByteMatchSet API request. @@ -126,7 +128,7 @@ func (c *WAFRegional) CreateByteMatchSetRequest(input *CreateByteMatchSetInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateByteMatchSetRequest{Request: req, Input: input} + return CreateByteMatchSetRequest{Request: req, Input: input, Copy: c.CreateByteMatchSetRequest} } const opCreateGeoMatchSet = "CreateGeoMatchSet" @@ -135,6 +137,7 @@ const opCreateGeoMatchSet = "CreateGeoMatchSet" type CreateGeoMatchSetRequest struct { *aws.Request Input *CreateGeoMatchSetInput + Copy func(*CreateGeoMatchSetInput) CreateGeoMatchSetRequest } // Send marshals and sends the CreateGeoMatchSet API request. @@ -195,7 +198,7 @@ func (c *WAFRegional) CreateGeoMatchSetRequest(input *CreateGeoMatchSetInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGeoMatchSetRequest{Request: req, Input: input} + return CreateGeoMatchSetRequest{Request: req, Input: input, Copy: c.CreateGeoMatchSetRequest} } const opCreateIPSet = "CreateIPSet" @@ -204,6 +207,7 @@ const opCreateIPSet = "CreateIPSet" type CreateIPSetRequest struct { *aws.Request Input *CreateIPSetInput + Copy func(*CreateIPSetInput) CreateIPSetRequest } // Send marshals and sends the CreateIPSet API request. @@ -265,7 +269,7 @@ func (c *WAFRegional) CreateIPSetRequest(input *CreateIPSetInput) CreateIPSetReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateIPSetRequest{Request: req, Input: input} + return CreateIPSetRequest{Request: req, Input: input, Copy: c.CreateIPSetRequest} } const opCreateRateBasedRule = "CreateRateBasedRule" @@ -274,6 +278,7 @@ const opCreateRateBasedRule = "CreateRateBasedRule" type CreateRateBasedRuleRequest struct { *aws.Request Input *CreateRateBasedRuleInput + Copy func(*CreateRateBasedRuleInput) CreateRateBasedRuleRequest } // Send marshals and sends the CreateRateBasedRule API request. @@ -374,7 +379,7 @@ func (c *WAFRegional) CreateRateBasedRuleRequest(input *CreateRateBasedRuleInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRateBasedRuleRequest{Request: req, Input: input} + return CreateRateBasedRuleRequest{Request: req, Input: input, Copy: c.CreateRateBasedRuleRequest} } const opCreateRegexMatchSet = "CreateRegexMatchSet" @@ -383,6 +388,7 @@ const opCreateRegexMatchSet = "CreateRegexMatchSet" type CreateRegexMatchSetRequest struct { *aws.Request Input *CreateRegexMatchSetInput + Copy func(*CreateRegexMatchSetInput) CreateRegexMatchSetRequest } // Send marshals and sends the CreateRegexMatchSet API request. @@ -445,7 +451,7 @@ func (c *WAFRegional) CreateRegexMatchSetRequest(input *CreateRegexMatchSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRegexMatchSetRequest{Request: req, Input: input} + return CreateRegexMatchSetRequest{Request: req, Input: input, Copy: c.CreateRegexMatchSetRequest} } const opCreateRegexPatternSet = "CreateRegexPatternSet" @@ -454,6 +460,7 @@ const opCreateRegexPatternSet = "CreateRegexPatternSet" type CreateRegexPatternSetRequest struct { *aws.Request Input *CreateRegexPatternSetInput + Copy func(*CreateRegexPatternSetInput) CreateRegexPatternSetRequest } // Send marshals and sends the CreateRegexPatternSet API request. @@ -512,7 +519,7 @@ func (c *WAFRegional) CreateRegexPatternSetRequest(input *CreateRegexPatternSetI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRegexPatternSetRequest{Request: req, Input: input} + return CreateRegexPatternSetRequest{Request: req, Input: input, Copy: c.CreateRegexPatternSetRequest} } const opCreateRule = "CreateRule" @@ -521,6 +528,7 @@ const opCreateRule = "CreateRule" type CreateRuleRequest struct { *aws.Request Input *CreateRuleInput + Copy func(*CreateRuleInput) CreateRuleRequest } // Send marshals and sends the CreateRule API request. @@ -596,7 +604,7 @@ func (c *WAFRegional) CreateRuleRequest(input *CreateRuleInput) CreateRuleReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRuleRequest{Request: req, Input: input} + return CreateRuleRequest{Request: req, Input: input, Copy: c.CreateRuleRequest} } const opCreateRuleGroup = "CreateRuleGroup" @@ -605,6 +613,7 @@ const opCreateRuleGroup = "CreateRuleGroup" type CreateRuleGroupRequest struct { *aws.Request Input *CreateRuleGroupInput + Copy func(*CreateRuleGroupInput) CreateRuleGroupRequest } // Send marshals and sends the CreateRuleGroup API request. @@ -658,7 +667,7 @@ func (c *WAFRegional) CreateRuleGroupRequest(input *CreateRuleGroupInput) Create req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateRuleGroupRequest{Request: req, Input: input} + return CreateRuleGroupRequest{Request: req, Input: input, Copy: c.CreateRuleGroupRequest} } const opCreateSizeConstraintSet = "CreateSizeConstraintSet" @@ -667,6 +676,7 @@ const opCreateSizeConstraintSet = "CreateSizeConstraintSet" type CreateSizeConstraintSetRequest struct { *aws.Request Input *CreateSizeConstraintSetInput + Copy func(*CreateSizeConstraintSetInput) CreateSizeConstraintSetRequest } // Send marshals and sends the CreateSizeConstraintSet API request. @@ -729,7 +739,7 @@ func (c *WAFRegional) CreateSizeConstraintSetRequest(input *CreateSizeConstraint req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSizeConstraintSetRequest{Request: req, Input: input} + return CreateSizeConstraintSetRequest{Request: req, Input: input, Copy: c.CreateSizeConstraintSetRequest} } const opCreateSqlInjectionMatchSet = "CreateSqlInjectionMatchSet" @@ -738,6 +748,7 @@ const opCreateSqlInjectionMatchSet = "CreateSqlInjectionMatchSet" type CreateSqlInjectionMatchSetRequest struct { *aws.Request Input *CreateSqlInjectionMatchSetInput + Copy func(*CreateSqlInjectionMatchSetInput) CreateSqlInjectionMatchSetRequest } // Send marshals and sends the CreateSqlInjectionMatchSet API request. @@ -796,7 +807,7 @@ func (c *WAFRegional) CreateSqlInjectionMatchSetRequest(input *CreateSqlInjectio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateSqlInjectionMatchSetRequest{Request: req, Input: input} + return CreateSqlInjectionMatchSetRequest{Request: req, Input: input, Copy: c.CreateSqlInjectionMatchSetRequest} } const opCreateWebACL = "CreateWebACL" @@ -805,6 +816,7 @@ const opCreateWebACL = "CreateWebACL" type CreateWebACLRequest struct { *aws.Request Input *CreateWebACLInput + Copy func(*CreateWebACLInput) CreateWebACLRequest } // Send marshals and sends the CreateWebACL API request. @@ -875,7 +887,7 @@ func (c *WAFRegional) CreateWebACLRequest(input *CreateWebACLInput) CreateWebACL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateWebACLRequest{Request: req, Input: input} + return CreateWebACLRequest{Request: req, Input: input, Copy: c.CreateWebACLRequest} } const opCreateXssMatchSet = "CreateXssMatchSet" @@ -884,6 +896,7 @@ const opCreateXssMatchSet = "CreateXssMatchSet" type CreateXssMatchSetRequest struct { *aws.Request Input *CreateXssMatchSetInput + Copy func(*CreateXssMatchSetInput) CreateXssMatchSetRequest } // Send marshals and sends the CreateXssMatchSet API request. @@ -943,7 +956,7 @@ func (c *WAFRegional) CreateXssMatchSetRequest(input *CreateXssMatchSetInput) Cr req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateXssMatchSetRequest{Request: req, Input: input} + return CreateXssMatchSetRequest{Request: req, Input: input, Copy: c.CreateXssMatchSetRequest} } const opDeleteByteMatchSet = "DeleteByteMatchSet" @@ -952,6 +965,7 @@ const opDeleteByteMatchSet = "DeleteByteMatchSet" type DeleteByteMatchSetRequest struct { *aws.Request Input *DeleteByteMatchSetInput + Copy func(*DeleteByteMatchSetInput) DeleteByteMatchSetRequest } // Send marshals and sends the DeleteByteMatchSet API request. @@ -1006,7 +1020,7 @@ func (c *WAFRegional) DeleteByteMatchSetRequest(input *DeleteByteMatchSetInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteByteMatchSetRequest{Request: req, Input: input} + return DeleteByteMatchSetRequest{Request: req, Input: input, Copy: c.DeleteByteMatchSetRequest} } const opDeleteGeoMatchSet = "DeleteGeoMatchSet" @@ -1015,6 +1029,7 @@ const opDeleteGeoMatchSet = "DeleteGeoMatchSet" type DeleteGeoMatchSetRequest struct { *aws.Request Input *DeleteGeoMatchSetInput + Copy func(*DeleteGeoMatchSetInput) DeleteGeoMatchSetRequest } // Send marshals and sends the DeleteGeoMatchSet API request. @@ -1068,7 +1083,7 @@ func (c *WAFRegional) DeleteGeoMatchSetRequest(input *DeleteGeoMatchSetInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGeoMatchSetRequest{Request: req, Input: input} + return DeleteGeoMatchSetRequest{Request: req, Input: input, Copy: c.DeleteGeoMatchSetRequest} } const opDeleteIPSet = "DeleteIPSet" @@ -1077,6 +1092,7 @@ const opDeleteIPSet = "DeleteIPSet" type DeleteIPSetRequest struct { *aws.Request Input *DeleteIPSetInput + Copy func(*DeleteIPSetInput) DeleteIPSetRequest } // Send marshals and sends the DeleteIPSet API request. @@ -1130,7 +1146,7 @@ func (c *WAFRegional) DeleteIPSetRequest(input *DeleteIPSetInput) DeleteIPSetReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteIPSetRequest{Request: req, Input: input} + return DeleteIPSetRequest{Request: req, Input: input, Copy: c.DeleteIPSetRequest} } const opDeleteRateBasedRule = "DeleteRateBasedRule" @@ -1139,6 +1155,7 @@ const opDeleteRateBasedRule = "DeleteRateBasedRule" type DeleteRateBasedRuleRequest struct { *aws.Request Input *DeleteRateBasedRuleInput + Copy func(*DeleteRateBasedRuleInput) DeleteRateBasedRuleRequest } // Send marshals and sends the DeleteRateBasedRule API request. @@ -1194,7 +1211,7 @@ func (c *WAFRegional) DeleteRateBasedRuleRequest(input *DeleteRateBasedRuleInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRateBasedRuleRequest{Request: req, Input: input} + return DeleteRateBasedRuleRequest{Request: req, Input: input, Copy: c.DeleteRateBasedRuleRequest} } const opDeleteRegexMatchSet = "DeleteRegexMatchSet" @@ -1203,6 +1220,7 @@ const opDeleteRegexMatchSet = "DeleteRegexMatchSet" type DeleteRegexMatchSetRequest struct { *aws.Request Input *DeleteRegexMatchSetInput + Copy func(*DeleteRegexMatchSetInput) DeleteRegexMatchSetRequest } // Send marshals and sends the DeleteRegexMatchSet API request. @@ -1257,7 +1275,7 @@ func (c *WAFRegional) DeleteRegexMatchSetRequest(input *DeleteRegexMatchSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRegexMatchSetRequest{Request: req, Input: input} + return DeleteRegexMatchSetRequest{Request: req, Input: input, Copy: c.DeleteRegexMatchSetRequest} } const opDeleteRegexPatternSet = "DeleteRegexPatternSet" @@ -1266,6 +1284,7 @@ const opDeleteRegexPatternSet = "DeleteRegexPatternSet" type DeleteRegexPatternSetRequest struct { *aws.Request Input *DeleteRegexPatternSetInput + Copy func(*DeleteRegexPatternSetInput) DeleteRegexPatternSetRequest } // Send marshals and sends the DeleteRegexPatternSet API request. @@ -1308,7 +1327,7 @@ func (c *WAFRegional) DeleteRegexPatternSetRequest(input *DeleteRegexPatternSetI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRegexPatternSetRequest{Request: req, Input: input} + return DeleteRegexPatternSetRequest{Request: req, Input: input, Copy: c.DeleteRegexPatternSetRequest} } const opDeleteRule = "DeleteRule" @@ -1317,6 +1336,7 @@ const opDeleteRule = "DeleteRule" type DeleteRuleRequest struct { *aws.Request Input *DeleteRuleInput + Copy func(*DeleteRuleInput) DeleteRuleRequest } // Send marshals and sends the DeleteRule API request. @@ -1370,7 +1390,7 @@ func (c *WAFRegional) DeleteRuleRequest(input *DeleteRuleInput) DeleteRuleReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRuleRequest{Request: req, Input: input} + return DeleteRuleRequest{Request: req, Input: input, Copy: c.DeleteRuleRequest} } const opDeleteRuleGroup = "DeleteRuleGroup" @@ -1379,6 +1399,7 @@ const opDeleteRuleGroup = "DeleteRuleGroup" type DeleteRuleGroupRequest struct { *aws.Request Input *DeleteRuleGroupInput + Copy func(*DeleteRuleGroupInput) DeleteRuleGroupRequest } // Send marshals and sends the DeleteRuleGroup API request. @@ -1431,7 +1452,7 @@ func (c *WAFRegional) DeleteRuleGroupRequest(input *DeleteRuleGroupInput) Delete req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteRuleGroupRequest{Request: req, Input: input} + return DeleteRuleGroupRequest{Request: req, Input: input, Copy: c.DeleteRuleGroupRequest} } const opDeleteSizeConstraintSet = "DeleteSizeConstraintSet" @@ -1440,6 +1461,7 @@ const opDeleteSizeConstraintSet = "DeleteSizeConstraintSet" type DeleteSizeConstraintSetRequest struct { *aws.Request Input *DeleteSizeConstraintSetInput + Copy func(*DeleteSizeConstraintSetInput) DeleteSizeConstraintSetRequest } // Send marshals and sends the DeleteSizeConstraintSet API request. @@ -1494,7 +1516,7 @@ func (c *WAFRegional) DeleteSizeConstraintSetRequest(input *DeleteSizeConstraint req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSizeConstraintSetRequest{Request: req, Input: input} + return DeleteSizeConstraintSetRequest{Request: req, Input: input, Copy: c.DeleteSizeConstraintSetRequest} } const opDeleteSqlInjectionMatchSet = "DeleteSqlInjectionMatchSet" @@ -1503,6 +1525,7 @@ const opDeleteSqlInjectionMatchSet = "DeleteSqlInjectionMatchSet" type DeleteSqlInjectionMatchSetRequest struct { *aws.Request Input *DeleteSqlInjectionMatchSetInput + Copy func(*DeleteSqlInjectionMatchSetInput) DeleteSqlInjectionMatchSetRequest } // Send marshals and sends the DeleteSqlInjectionMatchSet API request. @@ -1558,7 +1581,7 @@ func (c *WAFRegional) DeleteSqlInjectionMatchSetRequest(input *DeleteSqlInjectio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteSqlInjectionMatchSetRequest{Request: req, Input: input} + return DeleteSqlInjectionMatchSetRequest{Request: req, Input: input, Copy: c.DeleteSqlInjectionMatchSetRequest} } const opDeleteWebACL = "DeleteWebACL" @@ -1567,6 +1590,7 @@ const opDeleteWebACL = "DeleteWebACL" type DeleteWebACLRequest struct { *aws.Request Input *DeleteWebACLInput + Copy func(*DeleteWebACLInput) DeleteWebACLRequest } // Send marshals and sends the DeleteWebACL API request. @@ -1617,7 +1641,7 @@ func (c *WAFRegional) DeleteWebACLRequest(input *DeleteWebACLInput) DeleteWebACL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteWebACLRequest{Request: req, Input: input} + return DeleteWebACLRequest{Request: req, Input: input, Copy: c.DeleteWebACLRequest} } const opDeleteXssMatchSet = "DeleteXssMatchSet" @@ -1626,6 +1650,7 @@ const opDeleteXssMatchSet = "DeleteXssMatchSet" type DeleteXssMatchSetRequest struct { *aws.Request Input *DeleteXssMatchSetInput + Copy func(*DeleteXssMatchSetInput) DeleteXssMatchSetRequest } // Send marshals and sends the DeleteXssMatchSet API request. @@ -1680,7 +1705,7 @@ func (c *WAFRegional) DeleteXssMatchSetRequest(input *DeleteXssMatchSetInput) De req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteXssMatchSetRequest{Request: req, Input: input} + return DeleteXssMatchSetRequest{Request: req, Input: input, Copy: c.DeleteXssMatchSetRequest} } const opDisassociateWebACL = "DisassociateWebACL" @@ -1689,6 +1714,7 @@ const opDisassociateWebACL = "DisassociateWebACL" type DisassociateWebACLRequest struct { *aws.Request Input *DisassociateWebACLInput + Copy func(*DisassociateWebACLInput) DisassociateWebACLRequest } // Send marshals and sends the DisassociateWebACL API request. @@ -1729,7 +1755,7 @@ func (c *WAFRegional) DisassociateWebACLRequest(input *DisassociateWebACLInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateWebACLRequest{Request: req, Input: input} + return DisassociateWebACLRequest{Request: req, Input: input, Copy: c.DisassociateWebACLRequest} } const opGetByteMatchSet = "GetByteMatchSet" @@ -1738,6 +1764,7 @@ const opGetByteMatchSet = "GetByteMatchSet" type GetByteMatchSetRequest struct { *aws.Request Input *GetByteMatchSetInput + Copy func(*GetByteMatchSetInput) GetByteMatchSetRequest } // Send marshals and sends the GetByteMatchSet API request. @@ -1778,7 +1805,7 @@ func (c *WAFRegional) GetByteMatchSetRequest(input *GetByteMatchSetInput) GetByt req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetByteMatchSetRequest{Request: req, Input: input} + return GetByteMatchSetRequest{Request: req, Input: input, Copy: c.GetByteMatchSetRequest} } const opGetChangeToken = "GetChangeToken" @@ -1787,6 +1814,7 @@ const opGetChangeToken = "GetChangeToken" type GetChangeTokenRequest struct { *aws.Request Input *GetChangeTokenInput + Copy func(*GetChangeTokenInput) GetChangeTokenRequest } // Send marshals and sends the GetChangeToken API request. @@ -1841,7 +1869,7 @@ func (c *WAFRegional) GetChangeTokenRequest(input *GetChangeTokenInput) GetChang req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetChangeTokenRequest{Request: req, Input: input} + return GetChangeTokenRequest{Request: req, Input: input, Copy: c.GetChangeTokenRequest} } const opGetChangeTokenStatus = "GetChangeTokenStatus" @@ -1850,6 +1878,7 @@ const opGetChangeTokenStatus = "GetChangeTokenStatus" type GetChangeTokenStatusRequest struct { *aws.Request Input *GetChangeTokenStatusInput + Copy func(*GetChangeTokenStatusInput) GetChangeTokenStatusRequest } // Send marshals and sends the GetChangeTokenStatus API request. @@ -1900,7 +1929,7 @@ func (c *WAFRegional) GetChangeTokenStatusRequest(input *GetChangeTokenStatusInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetChangeTokenStatusRequest{Request: req, Input: input} + return GetChangeTokenStatusRequest{Request: req, Input: input, Copy: c.GetChangeTokenStatusRequest} } const opGetGeoMatchSet = "GetGeoMatchSet" @@ -1909,6 +1938,7 @@ const opGetGeoMatchSet = "GetGeoMatchSet" type GetGeoMatchSetRequest struct { *aws.Request Input *GetGeoMatchSetInput + Copy func(*GetGeoMatchSetInput) GetGeoMatchSetRequest } // Send marshals and sends the GetGeoMatchSet API request. @@ -1949,7 +1979,7 @@ func (c *WAFRegional) GetGeoMatchSetRequest(input *GetGeoMatchSetInput) GetGeoMa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetGeoMatchSetRequest{Request: req, Input: input} + return GetGeoMatchSetRequest{Request: req, Input: input, Copy: c.GetGeoMatchSetRequest} } const opGetIPSet = "GetIPSet" @@ -1958,6 +1988,7 @@ const opGetIPSet = "GetIPSet" type GetIPSetRequest struct { *aws.Request Input *GetIPSetInput + Copy func(*GetIPSetInput) GetIPSetRequest } // Send marshals and sends the GetIPSet API request. @@ -1998,7 +2029,7 @@ func (c *WAFRegional) GetIPSetRequest(input *GetIPSetInput) GetIPSetRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetIPSetRequest{Request: req, Input: input} + return GetIPSetRequest{Request: req, Input: input, Copy: c.GetIPSetRequest} } const opGetRateBasedRule = "GetRateBasedRule" @@ -2007,6 +2038,7 @@ const opGetRateBasedRule = "GetRateBasedRule" type GetRateBasedRuleRequest struct { *aws.Request Input *GetRateBasedRuleInput + Copy func(*GetRateBasedRuleInput) GetRateBasedRuleRequest } // Send marshals and sends the GetRateBasedRule API request. @@ -2048,7 +2080,7 @@ func (c *WAFRegional) GetRateBasedRuleRequest(input *GetRateBasedRuleInput) GetR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRateBasedRuleRequest{Request: req, Input: input} + return GetRateBasedRuleRequest{Request: req, Input: input, Copy: c.GetRateBasedRuleRequest} } const opGetRateBasedRuleManagedKeys = "GetRateBasedRuleManagedKeys" @@ -2057,6 +2089,7 @@ const opGetRateBasedRuleManagedKeys = "GetRateBasedRuleManagedKeys" type GetRateBasedRuleManagedKeysRequest struct { *aws.Request Input *GetRateBasedRuleManagedKeysInput + Copy func(*GetRateBasedRuleManagedKeysInput) GetRateBasedRuleManagedKeysRequest } // Send marshals and sends the GetRateBasedRuleManagedKeys API request. @@ -2100,7 +2133,7 @@ func (c *WAFRegional) GetRateBasedRuleManagedKeysRequest(input *GetRateBasedRule req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRateBasedRuleManagedKeysRequest{Request: req, Input: input} + return GetRateBasedRuleManagedKeysRequest{Request: req, Input: input, Copy: c.GetRateBasedRuleManagedKeysRequest} } const opGetRegexMatchSet = "GetRegexMatchSet" @@ -2109,6 +2142,7 @@ const opGetRegexMatchSet = "GetRegexMatchSet" type GetRegexMatchSetRequest struct { *aws.Request Input *GetRegexMatchSetInput + Copy func(*GetRegexMatchSetInput) GetRegexMatchSetRequest } // Send marshals and sends the GetRegexMatchSet API request. @@ -2149,7 +2183,7 @@ func (c *WAFRegional) GetRegexMatchSetRequest(input *GetRegexMatchSetInput) GetR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRegexMatchSetRequest{Request: req, Input: input} + return GetRegexMatchSetRequest{Request: req, Input: input, Copy: c.GetRegexMatchSetRequest} } const opGetRegexPatternSet = "GetRegexPatternSet" @@ -2158,6 +2192,7 @@ const opGetRegexPatternSet = "GetRegexPatternSet" type GetRegexPatternSetRequest struct { *aws.Request Input *GetRegexPatternSetInput + Copy func(*GetRegexPatternSetInput) GetRegexPatternSetRequest } // Send marshals and sends the GetRegexPatternSet API request. @@ -2198,7 +2233,7 @@ func (c *WAFRegional) GetRegexPatternSetRequest(input *GetRegexPatternSetInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRegexPatternSetRequest{Request: req, Input: input} + return GetRegexPatternSetRequest{Request: req, Input: input, Copy: c.GetRegexPatternSetRequest} } const opGetRule = "GetRule" @@ -2207,6 +2242,7 @@ const opGetRule = "GetRule" type GetRuleRequest struct { *aws.Request Input *GetRuleInput + Copy func(*GetRuleInput) GetRuleRequest } // Send marshals and sends the GetRule API request. @@ -2248,7 +2284,7 @@ func (c *WAFRegional) GetRuleRequest(input *GetRuleInput) GetRuleRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRuleRequest{Request: req, Input: input} + return GetRuleRequest{Request: req, Input: input, Copy: c.GetRuleRequest} } const opGetRuleGroup = "GetRuleGroup" @@ -2257,6 +2293,7 @@ const opGetRuleGroup = "GetRuleGroup" type GetRuleGroupRequest struct { *aws.Request Input *GetRuleGroupInput + Copy func(*GetRuleGroupInput) GetRuleGroupRequest } // Send marshals and sends the GetRuleGroup API request. @@ -2300,7 +2337,7 @@ func (c *WAFRegional) GetRuleGroupRequest(input *GetRuleGroupInput) GetRuleGroup req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetRuleGroupRequest{Request: req, Input: input} + return GetRuleGroupRequest{Request: req, Input: input, Copy: c.GetRuleGroupRequest} } const opGetSampledRequests = "GetSampledRequests" @@ -2309,6 +2346,7 @@ const opGetSampledRequests = "GetSampledRequests" type GetSampledRequestsRequest struct { *aws.Request Input *GetSampledRequestsInput + Copy func(*GetSampledRequestsInput) GetSampledRequestsRequest } // Send marshals and sends the GetSampledRequests API request. @@ -2359,7 +2397,7 @@ func (c *WAFRegional) GetSampledRequestsRequest(input *GetSampledRequestsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSampledRequestsRequest{Request: req, Input: input} + return GetSampledRequestsRequest{Request: req, Input: input, Copy: c.GetSampledRequestsRequest} } const opGetSizeConstraintSet = "GetSizeConstraintSet" @@ -2368,6 +2406,7 @@ const opGetSizeConstraintSet = "GetSizeConstraintSet" type GetSizeConstraintSetRequest struct { *aws.Request Input *GetSizeConstraintSetInput + Copy func(*GetSizeConstraintSetInput) GetSizeConstraintSetRequest } // Send marshals and sends the GetSizeConstraintSet API request. @@ -2408,7 +2447,7 @@ func (c *WAFRegional) GetSizeConstraintSetRequest(input *GetSizeConstraintSetInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSizeConstraintSetRequest{Request: req, Input: input} + return GetSizeConstraintSetRequest{Request: req, Input: input, Copy: c.GetSizeConstraintSetRequest} } const opGetSqlInjectionMatchSet = "GetSqlInjectionMatchSet" @@ -2417,6 +2456,7 @@ const opGetSqlInjectionMatchSet = "GetSqlInjectionMatchSet" type GetSqlInjectionMatchSetRequest struct { *aws.Request Input *GetSqlInjectionMatchSetInput + Copy func(*GetSqlInjectionMatchSetInput) GetSqlInjectionMatchSetRequest } // Send marshals and sends the GetSqlInjectionMatchSet API request. @@ -2457,7 +2497,7 @@ func (c *WAFRegional) GetSqlInjectionMatchSetRequest(input *GetSqlInjectionMatch req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetSqlInjectionMatchSetRequest{Request: req, Input: input} + return GetSqlInjectionMatchSetRequest{Request: req, Input: input, Copy: c.GetSqlInjectionMatchSetRequest} } const opGetWebACL = "GetWebACL" @@ -2466,6 +2506,7 @@ const opGetWebACL = "GetWebACL" type GetWebACLRequest struct { *aws.Request Input *GetWebACLInput + Copy func(*GetWebACLInput) GetWebACLRequest } // Send marshals and sends the GetWebACL API request. @@ -2506,7 +2547,7 @@ func (c *WAFRegional) GetWebACLRequest(input *GetWebACLInput) GetWebACLRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetWebACLRequest{Request: req, Input: input} + return GetWebACLRequest{Request: req, Input: input, Copy: c.GetWebACLRequest} } const opGetWebACLForResource = "GetWebACLForResource" @@ -2515,6 +2556,7 @@ const opGetWebACLForResource = "GetWebACLForResource" type GetWebACLForResourceRequest struct { *aws.Request Input *GetWebACLForResourceInput + Copy func(*GetWebACLForResourceInput) GetWebACLForResourceRequest } // Send marshals and sends the GetWebACLForResource API request. @@ -2555,7 +2597,7 @@ func (c *WAFRegional) GetWebACLForResourceRequest(input *GetWebACLForResourceInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetWebACLForResourceRequest{Request: req, Input: input} + return GetWebACLForResourceRequest{Request: req, Input: input, Copy: c.GetWebACLForResourceRequest} } const opGetXssMatchSet = "GetXssMatchSet" @@ -2564,6 +2606,7 @@ const opGetXssMatchSet = "GetXssMatchSet" type GetXssMatchSetRequest struct { *aws.Request Input *GetXssMatchSetInput + Copy func(*GetXssMatchSetInput) GetXssMatchSetRequest } // Send marshals and sends the GetXssMatchSet API request. @@ -2604,7 +2647,7 @@ func (c *WAFRegional) GetXssMatchSetRequest(input *GetXssMatchSetInput) GetXssMa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetXssMatchSetRequest{Request: req, Input: input} + return GetXssMatchSetRequest{Request: req, Input: input, Copy: c.GetXssMatchSetRequest} } const opListActivatedRulesInRuleGroup = "ListActivatedRulesInRuleGroup" @@ -2613,6 +2656,7 @@ const opListActivatedRulesInRuleGroup = "ListActivatedRulesInRuleGroup" type ListActivatedRulesInRuleGroupRequest struct { *aws.Request Input *ListActivatedRulesInRuleGroupInput + Copy func(*ListActivatedRulesInRuleGroupInput) ListActivatedRulesInRuleGroupRequest } // Send marshals and sends the ListActivatedRulesInRuleGroup API request. @@ -2653,7 +2697,7 @@ func (c *WAFRegional) ListActivatedRulesInRuleGroupRequest(input *ListActivatedR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListActivatedRulesInRuleGroupRequest{Request: req, Input: input} + return ListActivatedRulesInRuleGroupRequest{Request: req, Input: input, Copy: c.ListActivatedRulesInRuleGroupRequest} } const opListByteMatchSets = "ListByteMatchSets" @@ -2662,6 +2706,7 @@ const opListByteMatchSets = "ListByteMatchSets" type ListByteMatchSetsRequest struct { *aws.Request Input *ListByteMatchSetsInput + Copy func(*ListByteMatchSetsInput) ListByteMatchSetsRequest } // Send marshals and sends the ListByteMatchSets API request. @@ -2702,7 +2747,7 @@ func (c *WAFRegional) ListByteMatchSetsRequest(input *ListByteMatchSetsInput) Li req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListByteMatchSetsRequest{Request: req, Input: input} + return ListByteMatchSetsRequest{Request: req, Input: input, Copy: c.ListByteMatchSetsRequest} } const opListGeoMatchSets = "ListGeoMatchSets" @@ -2711,6 +2756,7 @@ const opListGeoMatchSets = "ListGeoMatchSets" type ListGeoMatchSetsRequest struct { *aws.Request Input *ListGeoMatchSetsInput + Copy func(*ListGeoMatchSetsInput) ListGeoMatchSetsRequest } // Send marshals and sends the ListGeoMatchSets API request. @@ -2751,7 +2797,7 @@ func (c *WAFRegional) ListGeoMatchSetsRequest(input *ListGeoMatchSetsInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGeoMatchSetsRequest{Request: req, Input: input} + return ListGeoMatchSetsRequest{Request: req, Input: input, Copy: c.ListGeoMatchSetsRequest} } const opListIPSets = "ListIPSets" @@ -2760,6 +2806,7 @@ const opListIPSets = "ListIPSets" type ListIPSetsRequest struct { *aws.Request Input *ListIPSetsInput + Copy func(*ListIPSetsInput) ListIPSetsRequest } // Send marshals and sends the ListIPSets API request. @@ -2800,7 +2847,7 @@ func (c *WAFRegional) ListIPSetsRequest(input *ListIPSetsInput) ListIPSetsReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListIPSetsRequest{Request: req, Input: input} + return ListIPSetsRequest{Request: req, Input: input, Copy: c.ListIPSetsRequest} } const opListRateBasedRules = "ListRateBasedRules" @@ -2809,6 +2856,7 @@ const opListRateBasedRules = "ListRateBasedRules" type ListRateBasedRulesRequest struct { *aws.Request Input *ListRateBasedRulesInput + Copy func(*ListRateBasedRulesInput) ListRateBasedRulesRequest } // Send marshals and sends the ListRateBasedRules API request. @@ -2849,7 +2897,7 @@ func (c *WAFRegional) ListRateBasedRulesRequest(input *ListRateBasedRulesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRateBasedRulesRequest{Request: req, Input: input} + return ListRateBasedRulesRequest{Request: req, Input: input, Copy: c.ListRateBasedRulesRequest} } const opListRegexMatchSets = "ListRegexMatchSets" @@ -2858,6 +2906,7 @@ const opListRegexMatchSets = "ListRegexMatchSets" type ListRegexMatchSetsRequest struct { *aws.Request Input *ListRegexMatchSetsInput + Copy func(*ListRegexMatchSetsInput) ListRegexMatchSetsRequest } // Send marshals and sends the ListRegexMatchSets API request. @@ -2898,7 +2947,7 @@ func (c *WAFRegional) ListRegexMatchSetsRequest(input *ListRegexMatchSetsInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRegexMatchSetsRequest{Request: req, Input: input} + return ListRegexMatchSetsRequest{Request: req, Input: input, Copy: c.ListRegexMatchSetsRequest} } const opListRegexPatternSets = "ListRegexPatternSets" @@ -2907,6 +2956,7 @@ const opListRegexPatternSets = "ListRegexPatternSets" type ListRegexPatternSetsRequest struct { *aws.Request Input *ListRegexPatternSetsInput + Copy func(*ListRegexPatternSetsInput) ListRegexPatternSetsRequest } // Send marshals and sends the ListRegexPatternSets API request. @@ -2947,7 +2997,7 @@ func (c *WAFRegional) ListRegexPatternSetsRequest(input *ListRegexPatternSetsInp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRegexPatternSetsRequest{Request: req, Input: input} + return ListRegexPatternSetsRequest{Request: req, Input: input, Copy: c.ListRegexPatternSetsRequest} } const opListResourcesForWebACL = "ListResourcesForWebACL" @@ -2956,6 +3006,7 @@ const opListResourcesForWebACL = "ListResourcesForWebACL" type ListResourcesForWebACLRequest struct { *aws.Request Input *ListResourcesForWebACLInput + Copy func(*ListResourcesForWebACLInput) ListResourcesForWebACLRequest } // Send marshals and sends the ListResourcesForWebACL API request. @@ -2996,7 +3047,7 @@ func (c *WAFRegional) ListResourcesForWebACLRequest(input *ListResourcesForWebAC req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourcesForWebACLRequest{Request: req, Input: input} + return ListResourcesForWebACLRequest{Request: req, Input: input, Copy: c.ListResourcesForWebACLRequest} } const opListRuleGroups = "ListRuleGroups" @@ -3005,6 +3056,7 @@ const opListRuleGroups = "ListRuleGroups" type ListRuleGroupsRequest struct { *aws.Request Input *ListRuleGroupsInput + Copy func(*ListRuleGroupsInput) ListRuleGroupsRequest } // Send marshals and sends the ListRuleGroups API request. @@ -3045,7 +3097,7 @@ func (c *WAFRegional) ListRuleGroupsRequest(input *ListRuleGroupsInput) ListRule req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRuleGroupsRequest{Request: req, Input: input} + return ListRuleGroupsRequest{Request: req, Input: input, Copy: c.ListRuleGroupsRequest} } const opListRules = "ListRules" @@ -3054,6 +3106,7 @@ const opListRules = "ListRules" type ListRulesRequest struct { *aws.Request Input *ListRulesInput + Copy func(*ListRulesInput) ListRulesRequest } // Send marshals and sends the ListRules API request. @@ -3094,7 +3147,7 @@ func (c *WAFRegional) ListRulesRequest(input *ListRulesInput) ListRulesRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListRulesRequest{Request: req, Input: input} + return ListRulesRequest{Request: req, Input: input, Copy: c.ListRulesRequest} } const opListSizeConstraintSets = "ListSizeConstraintSets" @@ -3103,6 +3156,7 @@ const opListSizeConstraintSets = "ListSizeConstraintSets" type ListSizeConstraintSetsRequest struct { *aws.Request Input *ListSizeConstraintSetsInput + Copy func(*ListSizeConstraintSetsInput) ListSizeConstraintSetsRequest } // Send marshals and sends the ListSizeConstraintSets API request. @@ -3143,7 +3197,7 @@ func (c *WAFRegional) ListSizeConstraintSetsRequest(input *ListSizeConstraintSet req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSizeConstraintSetsRequest{Request: req, Input: input} + return ListSizeConstraintSetsRequest{Request: req, Input: input, Copy: c.ListSizeConstraintSetsRequest} } const opListSqlInjectionMatchSets = "ListSqlInjectionMatchSets" @@ -3152,6 +3206,7 @@ const opListSqlInjectionMatchSets = "ListSqlInjectionMatchSets" type ListSqlInjectionMatchSetsRequest struct { *aws.Request Input *ListSqlInjectionMatchSetsInput + Copy func(*ListSqlInjectionMatchSetsInput) ListSqlInjectionMatchSetsRequest } // Send marshals and sends the ListSqlInjectionMatchSets API request. @@ -3192,7 +3247,7 @@ func (c *WAFRegional) ListSqlInjectionMatchSetsRequest(input *ListSqlInjectionMa req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSqlInjectionMatchSetsRequest{Request: req, Input: input} + return ListSqlInjectionMatchSetsRequest{Request: req, Input: input, Copy: c.ListSqlInjectionMatchSetsRequest} } const opListSubscribedRuleGroups = "ListSubscribedRuleGroups" @@ -3201,6 +3256,7 @@ const opListSubscribedRuleGroups = "ListSubscribedRuleGroups" type ListSubscribedRuleGroupsRequest struct { *aws.Request Input *ListSubscribedRuleGroupsInput + Copy func(*ListSubscribedRuleGroupsInput) ListSubscribedRuleGroupsRequest } // Send marshals and sends the ListSubscribedRuleGroups API request. @@ -3241,7 +3297,7 @@ func (c *WAFRegional) ListSubscribedRuleGroupsRequest(input *ListSubscribedRuleG req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListSubscribedRuleGroupsRequest{Request: req, Input: input} + return ListSubscribedRuleGroupsRequest{Request: req, Input: input, Copy: c.ListSubscribedRuleGroupsRequest} } const opListWebACLs = "ListWebACLs" @@ -3250,6 +3306,7 @@ const opListWebACLs = "ListWebACLs" type ListWebACLsRequest struct { *aws.Request Input *ListWebACLsInput + Copy func(*ListWebACLsInput) ListWebACLsRequest } // Send marshals and sends the ListWebACLs API request. @@ -3290,7 +3347,7 @@ func (c *WAFRegional) ListWebACLsRequest(input *ListWebACLsInput) ListWebACLsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListWebACLsRequest{Request: req, Input: input} + return ListWebACLsRequest{Request: req, Input: input, Copy: c.ListWebACLsRequest} } const opListXssMatchSets = "ListXssMatchSets" @@ -3299,6 +3356,7 @@ const opListXssMatchSets = "ListXssMatchSets" type ListXssMatchSetsRequest struct { *aws.Request Input *ListXssMatchSetsInput + Copy func(*ListXssMatchSetsInput) ListXssMatchSetsRequest } // Send marshals and sends the ListXssMatchSets API request. @@ -3339,7 +3397,7 @@ func (c *WAFRegional) ListXssMatchSetsRequest(input *ListXssMatchSetsInput) List req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListXssMatchSetsRequest{Request: req, Input: input} + return ListXssMatchSetsRequest{Request: req, Input: input, Copy: c.ListXssMatchSetsRequest} } const opUpdateByteMatchSet = "UpdateByteMatchSet" @@ -3348,6 +3406,7 @@ const opUpdateByteMatchSet = "UpdateByteMatchSet" type UpdateByteMatchSetRequest struct { *aws.Request Input *UpdateByteMatchSetInput + Copy func(*UpdateByteMatchSetInput) UpdateByteMatchSetRequest } // Send marshals and sends the UpdateByteMatchSet API request. @@ -3424,7 +3483,7 @@ func (c *WAFRegional) UpdateByteMatchSetRequest(input *UpdateByteMatchSetInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateByteMatchSetRequest{Request: req, Input: input} + return UpdateByteMatchSetRequest{Request: req, Input: input, Copy: c.UpdateByteMatchSetRequest} } const opUpdateGeoMatchSet = "UpdateGeoMatchSet" @@ -3433,6 +3492,7 @@ const opUpdateGeoMatchSet = "UpdateGeoMatchSet" type UpdateGeoMatchSetRequest struct { *aws.Request Input *UpdateGeoMatchSetInput + Copy func(*UpdateGeoMatchSetInput) UpdateGeoMatchSetRequest } // Send marshals and sends the UpdateGeoMatchSet API request. @@ -3500,7 +3560,7 @@ func (c *WAFRegional) UpdateGeoMatchSetRequest(input *UpdateGeoMatchSetInput) Up req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateGeoMatchSetRequest{Request: req, Input: input} + return UpdateGeoMatchSetRequest{Request: req, Input: input, Copy: c.UpdateGeoMatchSetRequest} } const opUpdateIPSet = "UpdateIPSet" @@ -3509,6 +3569,7 @@ const opUpdateIPSet = "UpdateIPSet" type UpdateIPSetRequest struct { *aws.Request Input *UpdateIPSetInput + Copy func(*UpdateIPSetInput) UpdateIPSetRequest } // Send marshals and sends the UpdateIPSet API request. @@ -3597,7 +3658,7 @@ func (c *WAFRegional) UpdateIPSetRequest(input *UpdateIPSetInput) UpdateIPSetReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateIPSetRequest{Request: req, Input: input} + return UpdateIPSetRequest{Request: req, Input: input, Copy: c.UpdateIPSetRequest} } const opUpdateRateBasedRule = "UpdateRateBasedRule" @@ -3606,6 +3667,7 @@ const opUpdateRateBasedRule = "UpdateRateBasedRule" type UpdateRateBasedRuleRequest struct { *aws.Request Input *UpdateRateBasedRuleInput + Copy func(*UpdateRateBasedRuleInput) UpdateRateBasedRuleRequest } // Send marshals and sends the UpdateRateBasedRule API request. @@ -3683,7 +3745,7 @@ func (c *WAFRegional) UpdateRateBasedRuleRequest(input *UpdateRateBasedRuleInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRateBasedRuleRequest{Request: req, Input: input} + return UpdateRateBasedRuleRequest{Request: req, Input: input, Copy: c.UpdateRateBasedRuleRequest} } const opUpdateRegexMatchSet = "UpdateRegexMatchSet" @@ -3692,6 +3754,7 @@ const opUpdateRegexMatchSet = "UpdateRegexMatchSet" type UpdateRegexMatchSetRequest struct { *aws.Request Input *UpdateRegexMatchSetInput + Copy func(*UpdateRegexMatchSetInput) UpdateRegexMatchSetRequest } // Send marshals and sends the UpdateRegexMatchSet API request. @@ -3765,7 +3828,7 @@ func (c *WAFRegional) UpdateRegexMatchSetRequest(input *UpdateRegexMatchSetInput req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRegexMatchSetRequest{Request: req, Input: input} + return UpdateRegexMatchSetRequest{Request: req, Input: input, Copy: c.UpdateRegexMatchSetRequest} } const opUpdateRegexPatternSet = "UpdateRegexPatternSet" @@ -3774,6 +3837,7 @@ const opUpdateRegexPatternSet = "UpdateRegexPatternSet" type UpdateRegexPatternSetRequest struct { *aws.Request Input *UpdateRegexPatternSetInput + Copy func(*UpdateRegexPatternSetInput) UpdateRegexPatternSetRequest } // Send marshals and sends the UpdateRegexPatternSet API request. @@ -3844,7 +3908,7 @@ func (c *WAFRegional) UpdateRegexPatternSetRequest(input *UpdateRegexPatternSetI req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRegexPatternSetRequest{Request: req, Input: input} + return UpdateRegexPatternSetRequest{Request: req, Input: input, Copy: c.UpdateRegexPatternSetRequest} } const opUpdateRule = "UpdateRule" @@ -3853,6 +3917,7 @@ const opUpdateRule = "UpdateRule" type UpdateRuleRequest struct { *aws.Request Input *UpdateRuleInput + Copy func(*UpdateRuleInput) UpdateRuleRequest } // Send marshals and sends the UpdateRule API request. @@ -3925,7 +3990,7 @@ func (c *WAFRegional) UpdateRuleRequest(input *UpdateRuleInput) UpdateRuleReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRuleRequest{Request: req, Input: input} + return UpdateRuleRequest{Request: req, Input: input, Copy: c.UpdateRuleRequest} } const opUpdateRuleGroup = "UpdateRuleGroup" @@ -3934,6 +3999,7 @@ const opUpdateRuleGroup = "UpdateRuleGroup" type UpdateRuleGroupRequest struct { *aws.Request Input *UpdateRuleGroupInput + Copy func(*UpdateRuleGroupInput) UpdateRuleGroupRequest } // Send marshals and sends the UpdateRuleGroup API request. @@ -3996,7 +4062,7 @@ func (c *WAFRegional) UpdateRuleGroupRequest(input *UpdateRuleGroupInput) Update req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateRuleGroupRequest{Request: req, Input: input} + return UpdateRuleGroupRequest{Request: req, Input: input, Copy: c.UpdateRuleGroupRequest} } const opUpdateSizeConstraintSet = "UpdateSizeConstraintSet" @@ -4005,6 +4071,7 @@ const opUpdateSizeConstraintSet = "UpdateSizeConstraintSet" type UpdateSizeConstraintSetRequest struct { *aws.Request Input *UpdateSizeConstraintSetInput + Copy func(*UpdateSizeConstraintSetInput) UpdateSizeConstraintSetRequest } // Send marshals and sends the UpdateSizeConstraintSet API request. @@ -4083,7 +4150,7 @@ func (c *WAFRegional) UpdateSizeConstraintSetRequest(input *UpdateSizeConstraint req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSizeConstraintSetRequest{Request: req, Input: input} + return UpdateSizeConstraintSetRequest{Request: req, Input: input, Copy: c.UpdateSizeConstraintSetRequest} } const opUpdateSqlInjectionMatchSet = "UpdateSqlInjectionMatchSet" @@ -4092,6 +4159,7 @@ const opUpdateSqlInjectionMatchSet = "UpdateSqlInjectionMatchSet" type UpdateSqlInjectionMatchSetRequest struct { *aws.Request Input *UpdateSqlInjectionMatchSetInput + Copy func(*UpdateSqlInjectionMatchSetInput) UpdateSqlInjectionMatchSetRequest } // Send marshals and sends the UpdateSqlInjectionMatchSet API request. @@ -4163,7 +4231,7 @@ func (c *WAFRegional) UpdateSqlInjectionMatchSetRequest(input *UpdateSqlInjectio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateSqlInjectionMatchSetRequest{Request: req, Input: input} + return UpdateSqlInjectionMatchSetRequest{Request: req, Input: input, Copy: c.UpdateSqlInjectionMatchSetRequest} } const opUpdateWebACL = "UpdateWebACL" @@ -4172,6 +4240,7 @@ const opUpdateWebACL = "UpdateWebACL" type UpdateWebACLRequest struct { *aws.Request Input *UpdateWebACLInput + Copy func(*UpdateWebACLInput) UpdateWebACLRequest } // Send marshals and sends the UpdateWebACL API request. @@ -4259,7 +4328,7 @@ func (c *WAFRegional) UpdateWebACLRequest(input *UpdateWebACLInput) UpdateWebACL req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateWebACLRequest{Request: req, Input: input} + return UpdateWebACLRequest{Request: req, Input: input, Copy: c.UpdateWebACLRequest} } const opUpdateXssMatchSet = "UpdateXssMatchSet" @@ -4268,6 +4337,7 @@ const opUpdateXssMatchSet = "UpdateXssMatchSet" type UpdateXssMatchSetRequest struct { *aws.Request Input *UpdateXssMatchSetInput + Copy func(*UpdateXssMatchSetInput) UpdateXssMatchSetRequest } // Send marshals and sends the UpdateXssMatchSet API request. @@ -4339,7 +4409,7 @@ func (c *WAFRegional) UpdateXssMatchSetRequest(input *UpdateXssMatchSetInput) Up req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateXssMatchSetRequest{Request: req, Input: input} + return UpdateXssMatchSetRequest{Request: req, Input: input, Copy: c.UpdateXssMatchSetRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/AssociateWebACLRequest diff --git a/service/workdocs/api.go b/service/workdocs/api.go index f204be46413..89b2fb043ce 100644 --- a/service/workdocs/api.go +++ b/service/workdocs/api.go @@ -18,6 +18,7 @@ const opAbortDocumentVersionUpload = "AbortDocumentVersionUpload" type AbortDocumentVersionUploadRequest struct { *aws.Request Input *AbortDocumentVersionUploadInput + Copy func(*AbortDocumentVersionUploadInput) AbortDocumentVersionUploadRequest } // Send marshals and sends the AbortDocumentVersionUpload API request. @@ -62,7 +63,7 @@ func (c *WorkDocs) AbortDocumentVersionUploadRequest(input *AbortDocumentVersion req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return AbortDocumentVersionUploadRequest{Request: req, Input: input} + return AbortDocumentVersionUploadRequest{Request: req, Input: input, Copy: c.AbortDocumentVersionUploadRequest} } const opActivateUser = "ActivateUser" @@ -71,6 +72,7 @@ const opActivateUser = "ActivateUser" type ActivateUserRequest struct { *aws.Request Input *ActivateUserInput + Copy func(*ActivateUserInput) ActivateUserRequest } // Send marshals and sends the ActivateUser API request. @@ -111,7 +113,7 @@ func (c *WorkDocs) ActivateUserRequest(input *ActivateUserInput) ActivateUserReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ActivateUserRequest{Request: req, Input: input} + return ActivateUserRequest{Request: req, Input: input, Copy: c.ActivateUserRequest} } const opAddResourcePermissions = "AddResourcePermissions" @@ -120,6 +122,7 @@ const opAddResourcePermissions = "AddResourcePermissions" type AddResourcePermissionsRequest struct { *aws.Request Input *AddResourcePermissionsInput + Copy func(*AddResourcePermissionsInput) AddResourcePermissionsRequest } // Send marshals and sends the AddResourcePermissions API request. @@ -161,7 +164,7 @@ func (c *WorkDocs) AddResourcePermissionsRequest(input *AddResourcePermissionsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AddResourcePermissionsRequest{Request: req, Input: input} + return AddResourcePermissionsRequest{Request: req, Input: input, Copy: c.AddResourcePermissionsRequest} } const opCreateComment = "CreateComment" @@ -170,6 +173,7 @@ const opCreateComment = "CreateComment" type CreateCommentRequest struct { *aws.Request Input *CreateCommentInput + Copy func(*CreateCommentInput) CreateCommentRequest } // Send marshals and sends the CreateComment API request. @@ -210,7 +214,7 @@ func (c *WorkDocs) CreateCommentRequest(input *CreateCommentInput) CreateComment req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCommentRequest{Request: req, Input: input} + return CreateCommentRequest{Request: req, Input: input, Copy: c.CreateCommentRequest} } const opCreateCustomMetadata = "CreateCustomMetadata" @@ -219,6 +223,7 @@ const opCreateCustomMetadata = "CreateCustomMetadata" type CreateCustomMetadataRequest struct { *aws.Request Input *CreateCustomMetadataInput + Copy func(*CreateCustomMetadataInput) CreateCustomMetadataRequest } // Send marshals and sends the CreateCustomMetadata API request. @@ -260,7 +265,7 @@ func (c *WorkDocs) CreateCustomMetadataRequest(input *CreateCustomMetadataInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateCustomMetadataRequest{Request: req, Input: input} + return CreateCustomMetadataRequest{Request: req, Input: input, Copy: c.CreateCustomMetadataRequest} } const opCreateFolder = "CreateFolder" @@ -269,6 +274,7 @@ const opCreateFolder = "CreateFolder" type CreateFolderRequest struct { *aws.Request Input *CreateFolderInput + Copy func(*CreateFolderInput) CreateFolderRequest } // Send marshals and sends the CreateFolder API request. @@ -309,7 +315,7 @@ func (c *WorkDocs) CreateFolderRequest(input *CreateFolderInput) CreateFolderReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateFolderRequest{Request: req, Input: input} + return CreateFolderRequest{Request: req, Input: input, Copy: c.CreateFolderRequest} } const opCreateLabels = "CreateLabels" @@ -318,6 +324,7 @@ const opCreateLabels = "CreateLabels" type CreateLabelsRequest struct { *aws.Request Input *CreateLabelsInput + Copy func(*CreateLabelsInput) CreateLabelsRequest } // Send marshals and sends the CreateLabels API request. @@ -358,7 +365,7 @@ func (c *WorkDocs) CreateLabelsRequest(input *CreateLabelsInput) CreateLabelsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateLabelsRequest{Request: req, Input: input} + return CreateLabelsRequest{Request: req, Input: input, Copy: c.CreateLabelsRequest} } const opCreateNotificationSubscription = "CreateNotificationSubscription" @@ -367,6 +374,7 @@ const opCreateNotificationSubscription = "CreateNotificationSubscription" type CreateNotificationSubscriptionRequest struct { *aws.Request Input *CreateNotificationSubscriptionInput + Copy func(*CreateNotificationSubscriptionInput) CreateNotificationSubscriptionRequest } // Send marshals and sends the CreateNotificationSubscription API request. @@ -411,7 +419,7 @@ func (c *WorkDocs) CreateNotificationSubscriptionRequest(input *CreateNotificati req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateNotificationSubscriptionRequest{Request: req, Input: input} + return CreateNotificationSubscriptionRequest{Request: req, Input: input, Copy: c.CreateNotificationSubscriptionRequest} } const opCreateUser = "CreateUser" @@ -420,6 +428,7 @@ const opCreateUser = "CreateUser" type CreateUserRequest struct { *aws.Request Input *CreateUserInput + Copy func(*CreateUserInput) CreateUserRequest } // Send marshals and sends the CreateUser API request. @@ -461,7 +470,7 @@ func (c *WorkDocs) CreateUserRequest(input *CreateUserInput) CreateUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserRequest{Request: req, Input: input} + return CreateUserRequest{Request: req, Input: input, Copy: c.CreateUserRequest} } const opDeactivateUser = "DeactivateUser" @@ -470,6 +479,7 @@ const opDeactivateUser = "DeactivateUser" type DeactivateUserRequest struct { *aws.Request Input *DeactivateUserInput + Copy func(*DeactivateUserInput) DeactivateUserRequest } // Send marshals and sends the DeactivateUser API request. @@ -513,7 +523,7 @@ func (c *WorkDocs) DeactivateUserRequest(input *DeactivateUserInput) DeactivateU req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeactivateUserRequest{Request: req, Input: input} + return DeactivateUserRequest{Request: req, Input: input, Copy: c.DeactivateUserRequest} } const opDeleteComment = "DeleteComment" @@ -522,6 +532,7 @@ const opDeleteComment = "DeleteComment" type DeleteCommentRequest struct { *aws.Request Input *DeleteCommentInput + Copy func(*DeleteCommentInput) DeleteCommentRequest } // Send marshals and sends the DeleteComment API request. @@ -564,7 +575,7 @@ func (c *WorkDocs) DeleteCommentRequest(input *DeleteCommentInput) DeleteComment req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteCommentRequest{Request: req, Input: input} + return DeleteCommentRequest{Request: req, Input: input, Copy: c.DeleteCommentRequest} } const opDeleteCustomMetadata = "DeleteCustomMetadata" @@ -573,6 +584,7 @@ const opDeleteCustomMetadata = "DeleteCustomMetadata" type DeleteCustomMetadataRequest struct { *aws.Request Input *DeleteCustomMetadataInput + Copy func(*DeleteCustomMetadataInput) DeleteCustomMetadataRequest } // Send marshals and sends the DeleteCustomMetadata API request. @@ -613,7 +625,7 @@ func (c *WorkDocs) DeleteCustomMetadataRequest(input *DeleteCustomMetadataInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteCustomMetadataRequest{Request: req, Input: input} + return DeleteCustomMetadataRequest{Request: req, Input: input, Copy: c.DeleteCustomMetadataRequest} } const opDeleteDocument = "DeleteDocument" @@ -622,6 +634,7 @@ const opDeleteDocument = "DeleteDocument" type DeleteDocumentRequest struct { *aws.Request Input *DeleteDocumentInput + Copy func(*DeleteDocumentInput) DeleteDocumentRequest } // Send marshals and sends the DeleteDocument API request. @@ -664,7 +677,7 @@ func (c *WorkDocs) DeleteDocumentRequest(input *DeleteDocumentInput) DeleteDocum req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteDocumentRequest{Request: req, Input: input} + return DeleteDocumentRequest{Request: req, Input: input, Copy: c.DeleteDocumentRequest} } const opDeleteFolder = "DeleteFolder" @@ -673,6 +686,7 @@ const opDeleteFolder = "DeleteFolder" type DeleteFolderRequest struct { *aws.Request Input *DeleteFolderInput + Copy func(*DeleteFolderInput) DeleteFolderRequest } // Send marshals and sends the DeleteFolder API request. @@ -715,7 +729,7 @@ func (c *WorkDocs) DeleteFolderRequest(input *DeleteFolderInput) DeleteFolderReq req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteFolderRequest{Request: req, Input: input} + return DeleteFolderRequest{Request: req, Input: input, Copy: c.DeleteFolderRequest} } const opDeleteFolderContents = "DeleteFolderContents" @@ -724,6 +738,7 @@ const opDeleteFolderContents = "DeleteFolderContents" type DeleteFolderContentsRequest struct { *aws.Request Input *DeleteFolderContentsInput + Copy func(*DeleteFolderContentsInput) DeleteFolderContentsRequest } // Send marshals and sends the DeleteFolderContents API request. @@ -766,7 +781,7 @@ func (c *WorkDocs) DeleteFolderContentsRequest(input *DeleteFolderContentsInput) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteFolderContentsRequest{Request: req, Input: input} + return DeleteFolderContentsRequest{Request: req, Input: input, Copy: c.DeleteFolderContentsRequest} } const opDeleteLabels = "DeleteLabels" @@ -775,6 +790,7 @@ const opDeleteLabels = "DeleteLabels" type DeleteLabelsRequest struct { *aws.Request Input *DeleteLabelsInput + Copy func(*DeleteLabelsInput) DeleteLabelsRequest } // Send marshals and sends the DeleteLabels API request. @@ -815,7 +831,7 @@ func (c *WorkDocs) DeleteLabelsRequest(input *DeleteLabelsInput) DeleteLabelsReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteLabelsRequest{Request: req, Input: input} + return DeleteLabelsRequest{Request: req, Input: input, Copy: c.DeleteLabelsRequest} } const opDeleteNotificationSubscription = "DeleteNotificationSubscription" @@ -824,6 +840,7 @@ const opDeleteNotificationSubscription = "DeleteNotificationSubscription" type DeleteNotificationSubscriptionRequest struct { *aws.Request Input *DeleteNotificationSubscriptionInput + Copy func(*DeleteNotificationSubscriptionInput) DeleteNotificationSubscriptionRequest } // Send marshals and sends the DeleteNotificationSubscription API request. @@ -866,7 +883,7 @@ func (c *WorkDocs) DeleteNotificationSubscriptionRequest(input *DeleteNotificati req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteNotificationSubscriptionRequest{Request: req, Input: input} + return DeleteNotificationSubscriptionRequest{Request: req, Input: input, Copy: c.DeleteNotificationSubscriptionRequest} } const opDeleteUser = "DeleteUser" @@ -875,6 +892,7 @@ const opDeleteUser = "DeleteUser" type DeleteUserRequest struct { *aws.Request Input *DeleteUserInput + Copy func(*DeleteUserInput) DeleteUserRequest } // Send marshals and sends the DeleteUser API request. @@ -917,7 +935,7 @@ func (c *WorkDocs) DeleteUserRequest(input *DeleteUserInput) DeleteUserRequest { req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return DeleteUserRequest{Request: req, Input: input} + return DeleteUserRequest{Request: req, Input: input, Copy: c.DeleteUserRequest} } const opDescribeActivities = "DescribeActivities" @@ -926,6 +944,7 @@ const opDescribeActivities = "DescribeActivities" type DescribeActivitiesRequest struct { *aws.Request Input *DescribeActivitiesInput + Copy func(*DescribeActivitiesInput) DescribeActivitiesRequest } // Send marshals and sends the DescribeActivities API request. @@ -966,7 +985,7 @@ func (c *WorkDocs) DescribeActivitiesRequest(input *DescribeActivitiesInput) Des req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeActivitiesRequest{Request: req, Input: input} + return DescribeActivitiesRequest{Request: req, Input: input, Copy: c.DescribeActivitiesRequest} } const opDescribeComments = "DescribeComments" @@ -975,6 +994,7 @@ const opDescribeComments = "DescribeComments" type DescribeCommentsRequest struct { *aws.Request Input *DescribeCommentsInput + Copy func(*DescribeCommentsInput) DescribeCommentsRequest } // Send marshals and sends the DescribeComments API request. @@ -1015,7 +1035,7 @@ func (c *WorkDocs) DescribeCommentsRequest(input *DescribeCommentsInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeCommentsRequest{Request: req, Input: input} + return DescribeCommentsRequest{Request: req, Input: input, Copy: c.DescribeCommentsRequest} } const opDescribeDocumentVersions = "DescribeDocumentVersions" @@ -1024,6 +1044,7 @@ const opDescribeDocumentVersions = "DescribeDocumentVersions" type DescribeDocumentVersionsRequest struct { *aws.Request Input *DescribeDocumentVersionsInput + Copy func(*DescribeDocumentVersionsInput) DescribeDocumentVersionsRequest } // Send marshals and sends the DescribeDocumentVersions API request. @@ -1072,57 +1093,53 @@ func (c *WorkDocs) DescribeDocumentVersionsRequest(input *DescribeDocumentVersio req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeDocumentVersionsRequest{Request: req, Input: input} + return DescribeDocumentVersionsRequest{Request: req, Input: input, Copy: c.DescribeDocumentVersionsRequest} } -// DescribeDocumentVersionsPages iterates over the pages of a DescribeDocumentVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDocumentVersions method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeDocumentVersionsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeDocumentVersions operation. -// pageNum := 0 -// err := client.DescribeDocumentVersionsPages(params, -// func(page *DescribeDocumentVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *WorkDocs) DescribeDocumentVersionsPages(input *DescribeDocumentVersionsInput, fn func(*DescribeDocumentVersionsOutput, bool) bool) error { - return c.DescribeDocumentVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeDocumentVersionsPagesWithContext same as DescribeDocumentVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkDocs) DescribeDocumentVersionsPagesWithContext(ctx aws.Context, input *DescribeDocumentVersionsInput, fn func(*DescribeDocumentVersionsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeDocumentVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeDocumentVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeDocumentVersionsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeDocumentVersionsRequest) Paginate(opts ...aws.Option) DescribeDocumentVersionsPager { + return DescribeDocumentVersionsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeDocumentVersionsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDocumentVersionsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeDocumentVersionsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeDocumentVersionsPager struct { + aws.Pager +} + +func (p *DescribeDocumentVersionsPager) CurrentPage() *DescribeDocumentVersionsOutput { + return p.Pager.CurrentPage().(*DescribeDocumentVersionsOutput) } const opDescribeFolderContents = "DescribeFolderContents" @@ -1131,6 +1148,7 @@ const opDescribeFolderContents = "DescribeFolderContents" type DescribeFolderContentsRequest struct { *aws.Request Input *DescribeFolderContentsInput + Copy func(*DescribeFolderContentsInput) DescribeFolderContentsRequest } // Send marshals and sends the DescribeFolderContents API request. @@ -1183,57 +1201,53 @@ func (c *WorkDocs) DescribeFolderContentsRequest(input *DescribeFolderContentsIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeFolderContentsRequest{Request: req, Input: input} + return DescribeFolderContentsRequest{Request: req, Input: input, Copy: c.DescribeFolderContentsRequest} } -// DescribeFolderContentsPages iterates over the pages of a DescribeFolderContents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeFolderContents method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeFolderContentsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeFolderContents operation. -// pageNum := 0 -// err := client.DescribeFolderContentsPages(params, -// func(page *DescribeFolderContentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *WorkDocs) DescribeFolderContentsPages(input *DescribeFolderContentsInput, fn func(*DescribeFolderContentsOutput, bool) bool) error { - return c.DescribeFolderContentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeFolderContentsPagesWithContext same as DescribeFolderContentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkDocs) DescribeFolderContentsPagesWithContext(ctx aws.Context, input *DescribeFolderContentsInput, fn func(*DescribeFolderContentsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeFolderContentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeFolderContentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeFolderContentsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeFolderContentsRequest) Paginate(opts ...aws.Option) DescribeFolderContentsPager { + return DescribeFolderContentsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeFolderContentsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeFolderContentsOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeFolderContentsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeFolderContentsPager struct { + aws.Pager +} + +func (p *DescribeFolderContentsPager) CurrentPage() *DescribeFolderContentsOutput { + return p.Pager.CurrentPage().(*DescribeFolderContentsOutput) } const opDescribeGroups = "DescribeGroups" @@ -1242,6 +1256,7 @@ const opDescribeGroups = "DescribeGroups" type DescribeGroupsRequest struct { *aws.Request Input *DescribeGroupsInput + Copy func(*DescribeGroupsInput) DescribeGroupsRequest } // Send marshals and sends the DescribeGroups API request. @@ -1282,7 +1297,7 @@ func (c *WorkDocs) DescribeGroupsRequest(input *DescribeGroupsInput) DescribeGro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeGroupsRequest{Request: req, Input: input} + return DescribeGroupsRequest{Request: req, Input: input, Copy: c.DescribeGroupsRequest} } const opDescribeNotificationSubscriptions = "DescribeNotificationSubscriptions" @@ -1291,6 +1306,7 @@ const opDescribeNotificationSubscriptions = "DescribeNotificationSubscriptions" type DescribeNotificationSubscriptionsRequest struct { *aws.Request Input *DescribeNotificationSubscriptionsInput + Copy func(*DescribeNotificationSubscriptionsInput) DescribeNotificationSubscriptionsRequest } // Send marshals and sends the DescribeNotificationSubscriptions API request. @@ -1331,7 +1347,7 @@ func (c *WorkDocs) DescribeNotificationSubscriptionsRequest(input *DescribeNotif req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeNotificationSubscriptionsRequest{Request: req, Input: input} + return DescribeNotificationSubscriptionsRequest{Request: req, Input: input, Copy: c.DescribeNotificationSubscriptionsRequest} } const opDescribeResourcePermissions = "DescribeResourcePermissions" @@ -1340,6 +1356,7 @@ const opDescribeResourcePermissions = "DescribeResourcePermissions" type DescribeResourcePermissionsRequest struct { *aws.Request Input *DescribeResourcePermissionsInput + Copy func(*DescribeResourcePermissionsInput) DescribeResourcePermissionsRequest } // Send marshals and sends the DescribeResourcePermissions API request. @@ -1380,7 +1397,7 @@ func (c *WorkDocs) DescribeResourcePermissionsRequest(input *DescribeResourcePer req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeResourcePermissionsRequest{Request: req, Input: input} + return DescribeResourcePermissionsRequest{Request: req, Input: input, Copy: c.DescribeResourcePermissionsRequest} } const opDescribeRootFolders = "DescribeRootFolders" @@ -1389,6 +1406,7 @@ const opDescribeRootFolders = "DescribeRootFolders" type DescribeRootFoldersRequest struct { *aws.Request Input *DescribeRootFoldersInput + Copy func(*DescribeRootFoldersInput) DescribeRootFoldersRequest } // Send marshals and sends the DescribeRootFolders API request. @@ -1432,7 +1450,7 @@ func (c *WorkDocs) DescribeRootFoldersRequest(input *DescribeRootFoldersInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeRootFoldersRequest{Request: req, Input: input} + return DescribeRootFoldersRequest{Request: req, Input: input, Copy: c.DescribeRootFoldersRequest} } const opDescribeUsers = "DescribeUsers" @@ -1441,6 +1459,7 @@ const opDescribeUsers = "DescribeUsers" type DescribeUsersRequest struct { *aws.Request Input *DescribeUsersInput + Copy func(*DescribeUsersInput) DescribeUsersRequest } // Send marshals and sends the DescribeUsers API request. @@ -1492,57 +1511,53 @@ func (c *WorkDocs) DescribeUsersRequest(input *DescribeUsersInput) DescribeUsers req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUsersRequest{Request: req, Input: input} + return DescribeUsersRequest{Request: req, Input: input, Copy: c.DescribeUsersRequest} } -// DescribeUsersPages iterates over the pages of a DescribeUsers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeUsers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeUsersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeUsers operation. -// pageNum := 0 -// err := client.DescribeUsersPages(params, -// func(page *DescribeUsersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *WorkDocs) DescribeUsersPages(input *DescribeUsersInput, fn func(*DescribeUsersOutput, bool) bool) error { - return c.DescribeUsersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeUsersPagesWithContext same as DescribeUsersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkDocs) DescribeUsersPagesWithContext(ctx aws.Context, input *DescribeUsersInput, fn func(*DescribeUsersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeUsersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeUsersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeUsersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeUsersRequest) Paginate(opts ...aws.Option) DescribeUsersPager { + return DescribeUsersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeUsersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeUsersOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeUsersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeUsersPager struct { + aws.Pager +} + +func (p *DescribeUsersPager) CurrentPage() *DescribeUsersOutput { + return p.Pager.CurrentPage().(*DescribeUsersOutput) } const opGetCurrentUser = "GetCurrentUser" @@ -1551,6 +1566,7 @@ const opGetCurrentUser = "GetCurrentUser" type GetCurrentUserRequest struct { *aws.Request Input *GetCurrentUserInput + Copy func(*GetCurrentUserInput) GetCurrentUserRequest } // Send marshals and sends the GetCurrentUser API request. @@ -1592,7 +1608,7 @@ func (c *WorkDocs) GetCurrentUserRequest(input *GetCurrentUserInput) GetCurrentU req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetCurrentUserRequest{Request: req, Input: input} + return GetCurrentUserRequest{Request: req, Input: input, Copy: c.GetCurrentUserRequest} } const opGetDocument = "GetDocument" @@ -1601,6 +1617,7 @@ const opGetDocument = "GetDocument" type GetDocumentRequest struct { *aws.Request Input *GetDocumentInput + Copy func(*GetDocumentInput) GetDocumentRequest } // Send marshals and sends the GetDocument API request. @@ -1641,7 +1658,7 @@ func (c *WorkDocs) GetDocumentRequest(input *GetDocumentInput) GetDocumentReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDocumentRequest{Request: req, Input: input} + return GetDocumentRequest{Request: req, Input: input, Copy: c.GetDocumentRequest} } const opGetDocumentPath = "GetDocumentPath" @@ -1650,6 +1667,7 @@ const opGetDocumentPath = "GetDocumentPath" type GetDocumentPathRequest struct { *aws.Request Input *GetDocumentPathInput + Copy func(*GetDocumentPathInput) GetDocumentPathRequest } // Send marshals and sends the GetDocumentPath API request. @@ -1696,7 +1714,7 @@ func (c *WorkDocs) GetDocumentPathRequest(input *GetDocumentPathInput) GetDocume req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDocumentPathRequest{Request: req, Input: input} + return GetDocumentPathRequest{Request: req, Input: input, Copy: c.GetDocumentPathRequest} } const opGetDocumentVersion = "GetDocumentVersion" @@ -1705,6 +1723,7 @@ const opGetDocumentVersion = "GetDocumentVersion" type GetDocumentVersionRequest struct { *aws.Request Input *GetDocumentVersionInput + Copy func(*GetDocumentVersionInput) GetDocumentVersionRequest } // Send marshals and sends the GetDocumentVersion API request. @@ -1745,7 +1764,7 @@ func (c *WorkDocs) GetDocumentVersionRequest(input *GetDocumentVersionInput) Get req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetDocumentVersionRequest{Request: req, Input: input} + return GetDocumentVersionRequest{Request: req, Input: input, Copy: c.GetDocumentVersionRequest} } const opGetFolder = "GetFolder" @@ -1754,6 +1773,7 @@ const opGetFolder = "GetFolder" type GetFolderRequest struct { *aws.Request Input *GetFolderInput + Copy func(*GetFolderInput) GetFolderRequest } // Send marshals and sends the GetFolder API request. @@ -1794,7 +1814,7 @@ func (c *WorkDocs) GetFolderRequest(input *GetFolderInput) GetFolderRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFolderRequest{Request: req, Input: input} + return GetFolderRequest{Request: req, Input: input, Copy: c.GetFolderRequest} } const opGetFolderPath = "GetFolderPath" @@ -1803,6 +1823,7 @@ const opGetFolderPath = "GetFolderPath" type GetFolderPathRequest struct { *aws.Request Input *GetFolderPathInput + Copy func(*GetFolderPathInput) GetFolderPathRequest } // Send marshals and sends the GetFolderPath API request. @@ -1849,7 +1870,7 @@ func (c *WorkDocs) GetFolderPathRequest(input *GetFolderPathInput) GetFolderPath req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetFolderPathRequest{Request: req, Input: input} + return GetFolderPathRequest{Request: req, Input: input, Copy: c.GetFolderPathRequest} } const opInitiateDocumentVersionUpload = "InitiateDocumentVersionUpload" @@ -1858,6 +1879,7 @@ const opInitiateDocumentVersionUpload = "InitiateDocumentVersionUpload" type InitiateDocumentVersionUploadRequest struct { *aws.Request Input *InitiateDocumentVersionUploadInput + Copy func(*InitiateDocumentVersionUploadInput) InitiateDocumentVersionUploadRequest } // Send marshals and sends the InitiateDocumentVersionUpload API request. @@ -1905,7 +1927,7 @@ func (c *WorkDocs) InitiateDocumentVersionUploadRequest(input *InitiateDocumentV req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return InitiateDocumentVersionUploadRequest{Request: req, Input: input} + return InitiateDocumentVersionUploadRequest{Request: req, Input: input, Copy: c.InitiateDocumentVersionUploadRequest} } const opRemoveAllResourcePermissions = "RemoveAllResourcePermissions" @@ -1914,6 +1936,7 @@ const opRemoveAllResourcePermissions = "RemoveAllResourcePermissions" type RemoveAllResourcePermissionsRequest struct { *aws.Request Input *RemoveAllResourcePermissionsInput + Copy func(*RemoveAllResourcePermissionsInput) RemoveAllResourcePermissionsRequest } // Send marshals and sends the RemoveAllResourcePermissions API request. @@ -1956,7 +1979,7 @@ func (c *WorkDocs) RemoveAllResourcePermissionsRequest(input *RemoveAllResourceP req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveAllResourcePermissionsRequest{Request: req, Input: input} + return RemoveAllResourcePermissionsRequest{Request: req, Input: input, Copy: c.RemoveAllResourcePermissionsRequest} } const opRemoveResourcePermission = "RemoveResourcePermission" @@ -1965,6 +1988,7 @@ const opRemoveResourcePermission = "RemoveResourcePermission" type RemoveResourcePermissionRequest struct { *aws.Request Input *RemoveResourcePermissionInput + Copy func(*RemoveResourcePermissionInput) RemoveResourcePermissionRequest } // Send marshals and sends the RemoveResourcePermission API request. @@ -2007,7 +2031,7 @@ func (c *WorkDocs) RemoveResourcePermissionRequest(input *RemoveResourcePermissi req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return RemoveResourcePermissionRequest{Request: req, Input: input} + return RemoveResourcePermissionRequest{Request: req, Input: input, Copy: c.RemoveResourcePermissionRequest} } const opUpdateDocument = "UpdateDocument" @@ -2016,6 +2040,7 @@ const opUpdateDocument = "UpdateDocument" type UpdateDocumentRequest struct { *aws.Request Input *UpdateDocumentInput + Copy func(*UpdateDocumentInput) UpdateDocumentRequest } // Send marshals and sends the UpdateDocument API request. @@ -2059,7 +2084,7 @@ func (c *WorkDocs) UpdateDocumentRequest(input *UpdateDocumentInput) UpdateDocum req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateDocumentRequest{Request: req, Input: input} + return UpdateDocumentRequest{Request: req, Input: input, Copy: c.UpdateDocumentRequest} } const opUpdateDocumentVersion = "UpdateDocumentVersion" @@ -2068,6 +2093,7 @@ const opUpdateDocumentVersion = "UpdateDocumentVersion" type UpdateDocumentVersionRequest struct { *aws.Request Input *UpdateDocumentVersionInput + Copy func(*UpdateDocumentVersionInput) UpdateDocumentVersionRequest } // Send marshals and sends the UpdateDocumentVersion API request. @@ -2114,7 +2140,7 @@ func (c *WorkDocs) UpdateDocumentVersionRequest(input *UpdateDocumentVersionInpu req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateDocumentVersionRequest{Request: req, Input: input} + return UpdateDocumentVersionRequest{Request: req, Input: input, Copy: c.UpdateDocumentVersionRequest} } const opUpdateFolder = "UpdateFolder" @@ -2123,6 +2149,7 @@ const opUpdateFolder = "UpdateFolder" type UpdateFolderRequest struct { *aws.Request Input *UpdateFolderInput + Copy func(*UpdateFolderInput) UpdateFolderRequest } // Send marshals and sends the UpdateFolder API request. @@ -2166,7 +2193,7 @@ func (c *WorkDocs) UpdateFolderRequest(input *UpdateFolderInput) UpdateFolderReq req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) output.responseMetadata = aws.Response{Request: req} - return UpdateFolderRequest{Request: req, Input: input} + return UpdateFolderRequest{Request: req, Input: input, Copy: c.UpdateFolderRequest} } const opUpdateUser = "UpdateUser" @@ -2175,6 +2202,7 @@ const opUpdateUser = "UpdateUser" type UpdateUserRequest struct { *aws.Request Input *UpdateUserInput + Copy func(*UpdateUserInput) UpdateUserRequest } // Send marshals and sends the UpdateUser API request. @@ -2216,7 +2244,7 @@ func (c *WorkDocs) UpdateUserRequest(input *UpdateUserInput) UpdateUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateUserRequest{Request: req, Input: input} + return UpdateUserRequest{Request: req, Input: input, Copy: c.UpdateUserRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/workdocs-2016-05-01/AbortDocumentVersionUploadRequest diff --git a/service/workdocs/workdocsiface/interface.go b/service/workdocs/workdocsiface/interface.go index af99bd77068..0eeee192d89 100644 --- a/service/workdocs/workdocsiface/interface.go +++ b/service/workdocs/workdocsiface/interface.go @@ -9,7 +9,6 @@ package workdocsiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/workdocs" ) @@ -105,14 +104,8 @@ type WorkDocsAPI interface { DescribeDocumentVersionsRequest(*workdocs.DescribeDocumentVersionsInput) workdocs.DescribeDocumentVersionsRequest - DescribeDocumentVersionsPages(*workdocs.DescribeDocumentVersionsInput, func(*workdocs.DescribeDocumentVersionsOutput, bool) bool) error - DescribeDocumentVersionsPagesWithContext(aws.Context, *workdocs.DescribeDocumentVersionsInput, func(*workdocs.DescribeDocumentVersionsOutput, bool) bool, ...aws.Option) error - DescribeFolderContentsRequest(*workdocs.DescribeFolderContentsInput) workdocs.DescribeFolderContentsRequest - DescribeFolderContentsPages(*workdocs.DescribeFolderContentsInput, func(*workdocs.DescribeFolderContentsOutput, bool) bool) error - DescribeFolderContentsPagesWithContext(aws.Context, *workdocs.DescribeFolderContentsInput, func(*workdocs.DescribeFolderContentsOutput, bool) bool, ...aws.Option) error - DescribeGroupsRequest(*workdocs.DescribeGroupsInput) workdocs.DescribeGroupsRequest DescribeNotificationSubscriptionsRequest(*workdocs.DescribeNotificationSubscriptionsInput) workdocs.DescribeNotificationSubscriptionsRequest @@ -123,9 +116,6 @@ type WorkDocsAPI interface { DescribeUsersRequest(*workdocs.DescribeUsersInput) workdocs.DescribeUsersRequest - DescribeUsersPages(*workdocs.DescribeUsersInput, func(*workdocs.DescribeUsersOutput, bool) bool) error - DescribeUsersPagesWithContext(aws.Context, *workdocs.DescribeUsersInput, func(*workdocs.DescribeUsersOutput, bool) bool, ...aws.Option) error - GetCurrentUserRequest(*workdocs.GetCurrentUserInput) workdocs.GetCurrentUserRequest GetDocumentRequest(*workdocs.GetDocumentInput) workdocs.GetDocumentRequest diff --git a/service/workmail/api.go b/service/workmail/api.go index a11e4dc11a6..b8f49f706e6 100644 --- a/service/workmail/api.go +++ b/service/workmail/api.go @@ -15,6 +15,7 @@ const opAssociateDelegateToResource = "AssociateDelegateToResource" type AssociateDelegateToResourceRequest struct { *aws.Request Input *AssociateDelegateToResourceInput + Copy func(*AssociateDelegateToResourceInput) AssociateDelegateToResourceRequest } // Send marshals and sends the AssociateDelegateToResource API request. @@ -55,7 +56,7 @@ func (c *WorkMail) AssociateDelegateToResourceRequest(input *AssociateDelegateTo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateDelegateToResourceRequest{Request: req, Input: input} + return AssociateDelegateToResourceRequest{Request: req, Input: input, Copy: c.AssociateDelegateToResourceRequest} } const opAssociateMemberToGroup = "AssociateMemberToGroup" @@ -64,6 +65,7 @@ const opAssociateMemberToGroup = "AssociateMemberToGroup" type AssociateMemberToGroupRequest struct { *aws.Request Input *AssociateMemberToGroupInput + Copy func(*AssociateMemberToGroupInput) AssociateMemberToGroupRequest } // Send marshals and sends the AssociateMemberToGroup API request. @@ -104,7 +106,7 @@ func (c *WorkMail) AssociateMemberToGroupRequest(input *AssociateMemberToGroupIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return AssociateMemberToGroupRequest{Request: req, Input: input} + return AssociateMemberToGroupRequest{Request: req, Input: input, Copy: c.AssociateMemberToGroupRequest} } const opCreateAlias = "CreateAlias" @@ -113,6 +115,7 @@ const opCreateAlias = "CreateAlias" type CreateAliasRequest struct { *aws.Request Input *CreateAliasInput + Copy func(*CreateAliasInput) CreateAliasRequest } // Send marshals and sends the CreateAlias API request. @@ -153,7 +156,7 @@ func (c *WorkMail) CreateAliasRequest(input *CreateAliasInput) CreateAliasReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateAliasRequest{Request: req, Input: input} + return CreateAliasRequest{Request: req, Input: input, Copy: c.CreateAliasRequest} } const opCreateGroup = "CreateGroup" @@ -162,6 +165,7 @@ const opCreateGroup = "CreateGroup" type CreateGroupRequest struct { *aws.Request Input *CreateGroupInput + Copy func(*CreateGroupInput) CreateGroupRequest } // Send marshals and sends the CreateGroup API request. @@ -203,7 +207,7 @@ func (c *WorkMail) CreateGroupRequest(input *CreateGroupInput) CreateGroupReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateGroupRequest{Request: req, Input: input} + return CreateGroupRequest{Request: req, Input: input, Copy: c.CreateGroupRequest} } const opCreateResource = "CreateResource" @@ -212,6 +216,7 @@ const opCreateResource = "CreateResource" type CreateResourceRequest struct { *aws.Request Input *CreateResourceInput + Copy func(*CreateResourceInput) CreateResourceRequest } // Send marshals and sends the CreateResource API request. @@ -253,7 +258,7 @@ func (c *WorkMail) CreateResourceRequest(input *CreateResourceInput) CreateResou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateResourceRequest{Request: req, Input: input} + return CreateResourceRequest{Request: req, Input: input, Copy: c.CreateResourceRequest} } const opCreateUser = "CreateUser" @@ -262,6 +267,7 @@ const opCreateUser = "CreateUser" type CreateUserRequest struct { *aws.Request Input *CreateUserInput + Copy func(*CreateUserInput) CreateUserRequest } // Send marshals and sends the CreateUser API request. @@ -303,7 +309,7 @@ func (c *WorkMail) CreateUserRequest(input *CreateUserInput) CreateUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateUserRequest{Request: req, Input: input} + return CreateUserRequest{Request: req, Input: input, Copy: c.CreateUserRequest} } const opDeleteAlias = "DeleteAlias" @@ -312,6 +318,7 @@ const opDeleteAlias = "DeleteAlias" type DeleteAliasRequest struct { *aws.Request Input *DeleteAliasInput + Copy func(*DeleteAliasInput) DeleteAliasRequest } // Send marshals and sends the DeleteAlias API request. @@ -352,7 +359,7 @@ func (c *WorkMail) DeleteAliasRequest(input *DeleteAliasInput) DeleteAliasReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteAliasRequest{Request: req, Input: input} + return DeleteAliasRequest{Request: req, Input: input, Copy: c.DeleteAliasRequest} } const opDeleteGroup = "DeleteGroup" @@ -361,6 +368,7 @@ const opDeleteGroup = "DeleteGroup" type DeleteGroupRequest struct { *aws.Request Input *DeleteGroupInput + Copy func(*DeleteGroupInput) DeleteGroupRequest } // Send marshals and sends the DeleteGroup API request. @@ -401,7 +409,7 @@ func (c *WorkMail) DeleteGroupRequest(input *DeleteGroupInput) DeleteGroupReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteGroupRequest{Request: req, Input: input} + return DeleteGroupRequest{Request: req, Input: input, Copy: c.DeleteGroupRequest} } const opDeleteResource = "DeleteResource" @@ -410,6 +418,7 @@ const opDeleteResource = "DeleteResource" type DeleteResourceRequest struct { *aws.Request Input *DeleteResourceInput + Copy func(*DeleteResourceInput) DeleteResourceRequest } // Send marshals and sends the DeleteResource API request. @@ -450,7 +459,7 @@ func (c *WorkMail) DeleteResourceRequest(input *DeleteResourceInput) DeleteResou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteResourceRequest{Request: req, Input: input} + return DeleteResourceRequest{Request: req, Input: input, Copy: c.DeleteResourceRequest} } const opDeleteUser = "DeleteUser" @@ -459,6 +468,7 @@ const opDeleteUser = "DeleteUser" type DeleteUserRequest struct { *aws.Request Input *DeleteUserInput + Copy func(*DeleteUserInput) DeleteUserRequest } // Send marshals and sends the DeleteUser API request. @@ -501,7 +511,7 @@ func (c *WorkMail) DeleteUserRequest(input *DeleteUserInput) DeleteUserRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteUserRequest{Request: req, Input: input} + return DeleteUserRequest{Request: req, Input: input, Copy: c.DeleteUserRequest} } const opDeregisterFromWorkMail = "DeregisterFromWorkMail" @@ -510,6 +520,7 @@ const opDeregisterFromWorkMail = "DeregisterFromWorkMail" type DeregisterFromWorkMailRequest struct { *aws.Request Input *DeregisterFromWorkMailInput + Copy func(*DeregisterFromWorkMailInput) DeregisterFromWorkMailRequest } // Send marshals and sends the DeregisterFromWorkMail API request. @@ -553,7 +564,7 @@ func (c *WorkMail) DeregisterFromWorkMailRequest(input *DeregisterFromWorkMailIn req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeregisterFromWorkMailRequest{Request: req, Input: input} + return DeregisterFromWorkMailRequest{Request: req, Input: input, Copy: c.DeregisterFromWorkMailRequest} } const opDescribeGroup = "DescribeGroup" @@ -562,6 +573,7 @@ const opDescribeGroup = "DescribeGroup" type DescribeGroupRequest struct { *aws.Request Input *DescribeGroupInput + Copy func(*DescribeGroupInput) DescribeGroupRequest } // Send marshals and sends the DescribeGroup API request. @@ -602,7 +614,7 @@ func (c *WorkMail) DescribeGroupRequest(input *DescribeGroupInput) DescribeGroup req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeGroupRequest{Request: req, Input: input} + return DescribeGroupRequest{Request: req, Input: input, Copy: c.DescribeGroupRequest} } const opDescribeOrganization = "DescribeOrganization" @@ -611,6 +623,7 @@ const opDescribeOrganization = "DescribeOrganization" type DescribeOrganizationRequest struct { *aws.Request Input *DescribeOrganizationInput + Copy func(*DescribeOrganizationInput) DescribeOrganizationRequest } // Send marshals and sends the DescribeOrganization API request. @@ -651,7 +664,7 @@ func (c *WorkMail) DescribeOrganizationRequest(input *DescribeOrganizationInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeOrganizationRequest{Request: req, Input: input} + return DescribeOrganizationRequest{Request: req, Input: input, Copy: c.DescribeOrganizationRequest} } const opDescribeResource = "DescribeResource" @@ -660,6 +673,7 @@ const opDescribeResource = "DescribeResource" type DescribeResourceRequest struct { *aws.Request Input *DescribeResourceInput + Copy func(*DescribeResourceInput) DescribeResourceRequest } // Send marshals and sends the DescribeResource API request. @@ -700,7 +714,7 @@ func (c *WorkMail) DescribeResourceRequest(input *DescribeResourceInput) Describ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeResourceRequest{Request: req, Input: input} + return DescribeResourceRequest{Request: req, Input: input, Copy: c.DescribeResourceRequest} } const opDescribeUser = "DescribeUser" @@ -709,6 +723,7 @@ const opDescribeUser = "DescribeUser" type DescribeUserRequest struct { *aws.Request Input *DescribeUserInput + Copy func(*DescribeUserInput) DescribeUserRequest } // Send marshals and sends the DescribeUser API request. @@ -749,7 +764,7 @@ func (c *WorkMail) DescribeUserRequest(input *DescribeUserInput) DescribeUserReq req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeUserRequest{Request: req, Input: input} + return DescribeUserRequest{Request: req, Input: input, Copy: c.DescribeUserRequest} } const opDisassociateDelegateFromResource = "DisassociateDelegateFromResource" @@ -758,6 +773,7 @@ const opDisassociateDelegateFromResource = "DisassociateDelegateFromResource" type DisassociateDelegateFromResourceRequest struct { *aws.Request Input *DisassociateDelegateFromResourceInput + Copy func(*DisassociateDelegateFromResourceInput) DisassociateDelegateFromResourceRequest } // Send marshals and sends the DisassociateDelegateFromResource API request. @@ -798,7 +814,7 @@ func (c *WorkMail) DisassociateDelegateFromResourceRequest(input *DisassociateDe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateDelegateFromResourceRequest{Request: req, Input: input} + return DisassociateDelegateFromResourceRequest{Request: req, Input: input, Copy: c.DisassociateDelegateFromResourceRequest} } const opDisassociateMemberFromGroup = "DisassociateMemberFromGroup" @@ -807,6 +823,7 @@ const opDisassociateMemberFromGroup = "DisassociateMemberFromGroup" type DisassociateMemberFromGroupRequest struct { *aws.Request Input *DisassociateMemberFromGroupInput + Copy func(*DisassociateMemberFromGroupInput) DisassociateMemberFromGroupRequest } // Send marshals and sends the DisassociateMemberFromGroup API request. @@ -847,7 +864,7 @@ func (c *WorkMail) DisassociateMemberFromGroupRequest(input *DisassociateMemberF req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DisassociateMemberFromGroupRequest{Request: req, Input: input} + return DisassociateMemberFromGroupRequest{Request: req, Input: input, Copy: c.DisassociateMemberFromGroupRequest} } const opListAliases = "ListAliases" @@ -856,6 +873,7 @@ const opListAliases = "ListAliases" type ListAliasesRequest struct { *aws.Request Input *ListAliasesInput + Copy func(*ListAliasesInput) ListAliasesRequest } // Send marshals and sends the ListAliases API request. @@ -902,57 +920,53 @@ func (c *WorkMail) ListAliasesRequest(input *ListAliasesInput) ListAliasesReques req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListAliasesRequest{Request: req, Input: input} + return ListAliasesRequest{Request: req, Input: input, Copy: c.ListAliasesRequest} } -// ListAliasesPages iterates over the pages of a ListAliases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAliases method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListAliasesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAliases operation. -// pageNum := 0 -// err := client.ListAliasesPages(params, -// func(page *ListAliasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListAliasesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *WorkMail) ListAliasesPages(input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool) error { - return c.ListAliasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAliasesPagesWithContext same as ListAliasesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkMail) ListAliasesPagesWithContext(ctx aws.Context, input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListAliasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListAliasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListAliasesRequest) Paginate(opts ...aws.Option) ListAliasesPager { + return ListAliasesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListAliasesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) - } - return p.Err() +// ListAliasesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListAliasesPager struct { + aws.Pager +} + +func (p *ListAliasesPager) CurrentPage() *ListAliasesOutput { + return p.Pager.CurrentPage().(*ListAliasesOutput) } const opListGroupMembers = "ListGroupMembers" @@ -961,6 +975,7 @@ const opListGroupMembers = "ListGroupMembers" type ListGroupMembersRequest struct { *aws.Request Input *ListGroupMembersInput + Copy func(*ListGroupMembersInput) ListGroupMembersRequest } // Send marshals and sends the ListGroupMembers API request. @@ -1007,57 +1022,53 @@ func (c *WorkMail) ListGroupMembersRequest(input *ListGroupMembersInput) ListGro req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupMembersRequest{Request: req, Input: input} + return ListGroupMembersRequest{Request: req, Input: input, Copy: c.ListGroupMembersRequest} } -// ListGroupMembersPages iterates over the pages of a ListGroupMembers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroupMembers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListGroupMembersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGroupMembers operation. -// pageNum := 0 -// err := client.ListGroupMembersPages(params, -// func(page *ListGroupMembersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListGroupMembersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *WorkMail) ListGroupMembersPages(input *ListGroupMembersInput, fn func(*ListGroupMembersOutput, bool) bool) error { - return c.ListGroupMembersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGroupMembersPagesWithContext same as ListGroupMembersPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkMail) ListGroupMembersPagesWithContext(ctx aws.Context, input *ListGroupMembersInput, fn func(*ListGroupMembersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListGroupMembersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListGroupMembersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListGroupMembersRequest) Paginate(opts ...aws.Option) ListGroupMembersPager { + return ListGroupMembersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListGroupMembersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupMembersOutput), !p.HasNextPage()) - } - return p.Err() +// ListGroupMembersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListGroupMembersPager struct { + aws.Pager +} + +func (p *ListGroupMembersPager) CurrentPage() *ListGroupMembersOutput { + return p.Pager.CurrentPage().(*ListGroupMembersOutput) } const opListGroups = "ListGroups" @@ -1066,6 +1077,7 @@ const opListGroups = "ListGroups" type ListGroupsRequest struct { *aws.Request Input *ListGroupsInput + Copy func(*ListGroupsInput) ListGroupsRequest } // Send marshals and sends the ListGroups API request. @@ -1112,57 +1124,53 @@ func (c *WorkMail) ListGroupsRequest(input *ListGroupsInput) ListGroupsRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListGroupsRequest{Request: req, Input: input} + return ListGroupsRequest{Request: req, Input: input, Copy: c.ListGroupsRequest} } -// ListGroupsPages iterates over the pages of a ListGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroups method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListGroupsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGroups operation. -// pageNum := 0 -// err := client.ListGroupsPages(params, -// func(page *ListGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListGroupsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *WorkMail) ListGroupsPages(input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool) error { - return c.ListGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGroupsPagesWithContext same as ListGroupsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkMail) ListGroupsPagesWithContext(ctx aws.Context, input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListGroupsRequest) Paginate(opts ...aws.Option) ListGroupsPager { + return ListGroupsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListGroupsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) - } - return p.Err() +// ListGroupsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListGroupsPager struct { + aws.Pager +} + +func (p *ListGroupsPager) CurrentPage() *ListGroupsOutput { + return p.Pager.CurrentPage().(*ListGroupsOutput) } const opListOrganizations = "ListOrganizations" @@ -1171,6 +1179,7 @@ const opListOrganizations = "ListOrganizations" type ListOrganizationsRequest struct { *aws.Request Input *ListOrganizationsInput + Copy func(*ListOrganizationsInput) ListOrganizationsRequest } // Send marshals and sends the ListOrganizations API request. @@ -1217,57 +1226,53 @@ func (c *WorkMail) ListOrganizationsRequest(input *ListOrganizationsInput) ListO req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListOrganizationsRequest{Request: req, Input: input} + return ListOrganizationsRequest{Request: req, Input: input, Copy: c.ListOrganizationsRequest} } -// ListOrganizationsPages iterates over the pages of a ListOrganizations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOrganizations method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListOrganizationsRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListOrganizations operation. -// pageNum := 0 -// err := client.ListOrganizationsPages(params, -// func(page *ListOrganizationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListOrganizationsRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *WorkMail) ListOrganizationsPages(input *ListOrganizationsInput, fn func(*ListOrganizationsOutput, bool) bool) error { - return c.ListOrganizationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOrganizationsPagesWithContext same as ListOrganizationsPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkMail) ListOrganizationsPagesWithContext(ctx aws.Context, input *ListOrganizationsInput, fn func(*ListOrganizationsOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListOrganizationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListOrganizationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListOrganizationsRequest) Paginate(opts ...aws.Option) ListOrganizationsPager { + return ListOrganizationsPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListOrganizationsInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOrganizationsOutput), !p.HasNextPage()) - } - return p.Err() +// ListOrganizationsPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListOrganizationsPager struct { + aws.Pager +} + +func (p *ListOrganizationsPager) CurrentPage() *ListOrganizationsOutput { + return p.Pager.CurrentPage().(*ListOrganizationsOutput) } const opListResourceDelegates = "ListResourceDelegates" @@ -1276,6 +1281,7 @@ const opListResourceDelegates = "ListResourceDelegates" type ListResourceDelegatesRequest struct { *aws.Request Input *ListResourceDelegatesInput + Copy func(*ListResourceDelegatesInput) ListResourceDelegatesRequest } // Send marshals and sends the ListResourceDelegates API request. @@ -1317,7 +1323,7 @@ func (c *WorkMail) ListResourceDelegatesRequest(input *ListResourceDelegatesInpu req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourceDelegatesRequest{Request: req, Input: input} + return ListResourceDelegatesRequest{Request: req, Input: input, Copy: c.ListResourceDelegatesRequest} } const opListResources = "ListResources" @@ -1326,6 +1332,7 @@ const opListResources = "ListResources" type ListResourcesRequest struct { *aws.Request Input *ListResourcesInput + Copy func(*ListResourcesInput) ListResourcesRequest } // Send marshals and sends the ListResources API request. @@ -1372,57 +1379,53 @@ func (c *WorkMail) ListResourcesRequest(input *ListResourcesInput) ListResources req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListResourcesRequest{Request: req, Input: input} + return ListResourcesRequest{Request: req, Input: input, Copy: c.ListResourcesRequest} } -// ListResourcesPages iterates over the pages of a ListResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListResources method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListResourcesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListResources operation. -// pageNum := 0 -// err := client.ListResourcesPages(params, -// func(page *ListResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListResourcesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *WorkMail) ListResourcesPages(input *ListResourcesInput, fn func(*ListResourcesOutput, bool) bool) error { - return c.ListResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListResourcesPagesWithContext same as ListResourcesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkMail) ListResourcesPagesWithContext(ctx aws.Context, input *ListResourcesInput, fn func(*ListResourcesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListResourcesRequest) Paginate(opts ...aws.Option) ListResourcesPager { + return ListResourcesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListResourcesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResourcesOutput), !p.HasNextPage()) - } - return p.Err() +// ListResourcesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListResourcesPager struct { + aws.Pager +} + +func (p *ListResourcesPager) CurrentPage() *ListResourcesOutput { + return p.Pager.CurrentPage().(*ListResourcesOutput) } const opListUsers = "ListUsers" @@ -1431,6 +1434,7 @@ const opListUsers = "ListUsers" type ListUsersRequest struct { *aws.Request Input *ListUsersInput + Copy func(*ListUsersInput) ListUsersRequest } // Send marshals and sends the ListUsers API request. @@ -1477,57 +1481,53 @@ func (c *WorkMail) ListUsersRequest(input *ListUsersInput) ListUsersRequest { req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ListUsersRequest{Request: req, Input: input} + return ListUsersRequest{Request: req, Input: input, Copy: c.ListUsersRequest} } -// ListUsersPages iterates over the pages of a ListUsers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUsers method for more information on how to use this operation. +// Paginate pages iterates over the pages of a ListUsersRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListUsers operation. -// pageNum := 0 -// err := client.ListUsersPages(params, -// func(page *ListUsersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.ListUsersRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *WorkMail) ListUsersPages(input *ListUsersInput, fn func(*ListUsersOutput, bool) bool) error { - return c.ListUsersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListUsersPagesWithContext same as ListUsersPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkMail) ListUsersPagesWithContext(ctx aws.Context, input *ListUsersInput, fn func(*ListUsersOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *ListUsersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.ListUsersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *ListUsersRequest) Paginate(opts ...aws.Option) ListUsersPager { + return ListUsersPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *ListUsersInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) - } - return p.Err() +// ListUsersPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type ListUsersPager struct { + aws.Pager +} + +func (p *ListUsersPager) CurrentPage() *ListUsersOutput { + return p.Pager.CurrentPage().(*ListUsersOutput) } const opRegisterToWorkMail = "RegisterToWorkMail" @@ -1536,6 +1536,7 @@ const opRegisterToWorkMail = "RegisterToWorkMail" type RegisterToWorkMailRequest struct { *aws.Request Input *RegisterToWorkMailInput + Copy func(*RegisterToWorkMailInput) RegisterToWorkMailRequest } // Send marshals and sends the RegisterToWorkMail API request. @@ -1583,7 +1584,7 @@ func (c *WorkMail) RegisterToWorkMailRequest(input *RegisterToWorkMailInput) Reg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RegisterToWorkMailRequest{Request: req, Input: input} + return RegisterToWorkMailRequest{Request: req, Input: input, Copy: c.RegisterToWorkMailRequest} } const opResetPassword = "ResetPassword" @@ -1592,6 +1593,7 @@ const opResetPassword = "ResetPassword" type ResetPasswordRequest struct { *aws.Request Input *ResetPasswordInput + Copy func(*ResetPasswordInput) ResetPasswordRequest } // Send marshals and sends the ResetPassword API request. @@ -1632,7 +1634,7 @@ func (c *WorkMail) ResetPasswordRequest(input *ResetPasswordInput) ResetPassword req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ResetPasswordRequest{Request: req, Input: input} + return ResetPasswordRequest{Request: req, Input: input, Copy: c.ResetPasswordRequest} } const opUpdatePrimaryEmailAddress = "UpdatePrimaryEmailAddress" @@ -1641,6 +1643,7 @@ const opUpdatePrimaryEmailAddress = "UpdatePrimaryEmailAddress" type UpdatePrimaryEmailAddressRequest struct { *aws.Request Input *UpdatePrimaryEmailAddressInput + Copy func(*UpdatePrimaryEmailAddressInput) UpdatePrimaryEmailAddressRequest } // Send marshals and sends the UpdatePrimaryEmailAddress API request. @@ -1683,7 +1686,7 @@ func (c *WorkMail) UpdatePrimaryEmailAddressRequest(input *UpdatePrimaryEmailAdd req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdatePrimaryEmailAddressRequest{Request: req, Input: input} + return UpdatePrimaryEmailAddressRequest{Request: req, Input: input, Copy: c.UpdatePrimaryEmailAddressRequest} } const opUpdateResource = "UpdateResource" @@ -1692,6 +1695,7 @@ const opUpdateResource = "UpdateResource" type UpdateResourceRequest struct { *aws.Request Input *UpdateResourceInput + Copy func(*UpdateResourceInput) UpdateResourceRequest } // Send marshals and sends the UpdateResource API request. @@ -1734,7 +1738,7 @@ func (c *WorkMail) UpdateResourceRequest(input *UpdateResourceInput) UpdateResou req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return UpdateResourceRequest{Request: req, Input: input} + return UpdateResourceRequest{Request: req, Input: input, Copy: c.UpdateResourceRequest} } // Please also see https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/AssociateDelegateToResourceRequest diff --git a/service/workmail/workmailiface/interface.go b/service/workmail/workmailiface/interface.go index 4a1cc7d5613..52d23112de3 100644 --- a/service/workmail/workmailiface/interface.go +++ b/service/workmail/workmailiface/interface.go @@ -9,7 +9,6 @@ package workmailiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/workmail" ) @@ -99,36 +98,18 @@ type WorkMailAPI interface { ListAliasesRequest(*workmail.ListAliasesInput) workmail.ListAliasesRequest - ListAliasesPages(*workmail.ListAliasesInput, func(*workmail.ListAliasesOutput, bool) bool) error - ListAliasesPagesWithContext(aws.Context, *workmail.ListAliasesInput, func(*workmail.ListAliasesOutput, bool) bool, ...aws.Option) error - ListGroupMembersRequest(*workmail.ListGroupMembersInput) workmail.ListGroupMembersRequest - ListGroupMembersPages(*workmail.ListGroupMembersInput, func(*workmail.ListGroupMembersOutput, bool) bool) error - ListGroupMembersPagesWithContext(aws.Context, *workmail.ListGroupMembersInput, func(*workmail.ListGroupMembersOutput, bool) bool, ...aws.Option) error - ListGroupsRequest(*workmail.ListGroupsInput) workmail.ListGroupsRequest - ListGroupsPages(*workmail.ListGroupsInput, func(*workmail.ListGroupsOutput, bool) bool) error - ListGroupsPagesWithContext(aws.Context, *workmail.ListGroupsInput, func(*workmail.ListGroupsOutput, bool) bool, ...aws.Option) error - ListOrganizationsRequest(*workmail.ListOrganizationsInput) workmail.ListOrganizationsRequest - ListOrganizationsPages(*workmail.ListOrganizationsInput, func(*workmail.ListOrganizationsOutput, bool) bool) error - ListOrganizationsPagesWithContext(aws.Context, *workmail.ListOrganizationsInput, func(*workmail.ListOrganizationsOutput, bool) bool, ...aws.Option) error - ListResourceDelegatesRequest(*workmail.ListResourceDelegatesInput) workmail.ListResourceDelegatesRequest ListResourcesRequest(*workmail.ListResourcesInput) workmail.ListResourcesRequest - ListResourcesPages(*workmail.ListResourcesInput, func(*workmail.ListResourcesOutput, bool) bool) error - ListResourcesPagesWithContext(aws.Context, *workmail.ListResourcesInput, func(*workmail.ListResourcesOutput, bool) bool, ...aws.Option) error - ListUsersRequest(*workmail.ListUsersInput) workmail.ListUsersRequest - ListUsersPages(*workmail.ListUsersInput, func(*workmail.ListUsersOutput, bool) bool) error - ListUsersPagesWithContext(aws.Context, *workmail.ListUsersInput, func(*workmail.ListUsersOutput, bool) bool, ...aws.Option) error - RegisterToWorkMailRequest(*workmail.RegisterToWorkMailInput) workmail.RegisterToWorkMailRequest ResetPasswordRequest(*workmail.ResetPasswordInput) workmail.ResetPasswordRequest diff --git a/service/workspaces/api.go b/service/workspaces/api.go index 96c625be303..ae882be25ae 100644 --- a/service/workspaces/api.go +++ b/service/workspaces/api.go @@ -16,6 +16,7 @@ const opCreateTags = "CreateTags" type CreateTagsRequest struct { *aws.Request Input *CreateTagsInput + Copy func(*CreateTagsInput) CreateTagsRequest } // Send marshals and sends the CreateTags API request. @@ -56,7 +57,7 @@ func (c *WorkSpaces) CreateTagsRequest(input *CreateTagsInput) CreateTagsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateTagsRequest{Request: req, Input: input} + return CreateTagsRequest{Request: req, Input: input, Copy: c.CreateTagsRequest} } const opCreateWorkspaces = "CreateWorkspaces" @@ -65,6 +66,7 @@ const opCreateWorkspaces = "CreateWorkspaces" type CreateWorkspacesRequest struct { *aws.Request Input *CreateWorkspacesInput + Copy func(*CreateWorkspacesInput) CreateWorkspacesRequest } // Send marshals and sends the CreateWorkspaces API request. @@ -107,7 +109,7 @@ func (c *WorkSpaces) CreateWorkspacesRequest(input *CreateWorkspacesInput) Creat req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return CreateWorkspacesRequest{Request: req, Input: input} + return CreateWorkspacesRequest{Request: req, Input: input, Copy: c.CreateWorkspacesRequest} } const opDeleteTags = "DeleteTags" @@ -116,6 +118,7 @@ const opDeleteTags = "DeleteTags" type DeleteTagsRequest struct { *aws.Request Input *DeleteTagsInput + Copy func(*DeleteTagsInput) DeleteTagsRequest } // Send marshals and sends the DeleteTags API request. @@ -156,7 +159,7 @@ func (c *WorkSpaces) DeleteTagsRequest(input *DeleteTagsInput) DeleteTagsRequest req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DeleteTagsRequest{Request: req, Input: input} + return DeleteTagsRequest{Request: req, Input: input, Copy: c.DeleteTagsRequest} } const opDescribeTags = "DescribeTags" @@ -165,6 +168,7 @@ const opDescribeTags = "DescribeTags" type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. @@ -205,7 +209,7 @@ func (c *WorkSpaces) DescribeTagsRequest(input *DescribeTagsInput) DescribeTagsR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeTagsRequest{Request: req, Input: input} + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } const opDescribeWorkspaceBundles = "DescribeWorkspaceBundles" @@ -214,6 +218,7 @@ const opDescribeWorkspaceBundles = "DescribeWorkspaceBundles" type DescribeWorkspaceBundlesRequest struct { *aws.Request Input *DescribeWorkspaceBundlesInput + Copy func(*DescribeWorkspaceBundlesInput) DescribeWorkspaceBundlesRequest } // Send marshals and sends the DescribeWorkspaceBundles API request. @@ -262,57 +267,53 @@ func (c *WorkSpaces) DescribeWorkspaceBundlesRequest(input *DescribeWorkspaceBun req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeWorkspaceBundlesRequest{Request: req, Input: input} + return DescribeWorkspaceBundlesRequest{Request: req, Input: input, Copy: c.DescribeWorkspaceBundlesRequest} } -// DescribeWorkspaceBundlesPages iterates over the pages of a DescribeWorkspaceBundles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeWorkspaceBundles method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeWorkspaceBundlesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeWorkspaceBundles operation. -// pageNum := 0 -// err := client.DescribeWorkspaceBundlesPages(params, -// func(page *DescribeWorkspaceBundlesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *WorkSpaces) DescribeWorkspaceBundlesPages(input *DescribeWorkspaceBundlesInput, fn func(*DescribeWorkspaceBundlesOutput, bool) bool) error { - return c.DescribeWorkspaceBundlesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeWorkspaceBundlesPagesWithContext same as DescribeWorkspaceBundlesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkSpaces) DescribeWorkspaceBundlesPagesWithContext(ctx aws.Context, input *DescribeWorkspaceBundlesInput, fn func(*DescribeWorkspaceBundlesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeWorkspaceBundlesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeWorkspaceBundlesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeWorkspaceBundlesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeWorkspaceBundlesRequest) Paginate(opts ...aws.Option) DescribeWorkspaceBundlesPager { + return DescribeWorkspaceBundlesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeWorkspaceBundlesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeWorkspaceBundlesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeWorkspaceBundlesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeWorkspaceBundlesPager struct { + aws.Pager +} + +func (p *DescribeWorkspaceBundlesPager) CurrentPage() *DescribeWorkspaceBundlesOutput { + return p.Pager.CurrentPage().(*DescribeWorkspaceBundlesOutput) } const opDescribeWorkspaceDirectories = "DescribeWorkspaceDirectories" @@ -321,6 +322,7 @@ const opDescribeWorkspaceDirectories = "DescribeWorkspaceDirectories" type DescribeWorkspaceDirectoriesRequest struct { *aws.Request Input *DescribeWorkspaceDirectoriesInput + Copy func(*DescribeWorkspaceDirectoriesInput) DescribeWorkspaceDirectoriesRequest } // Send marshals and sends the DescribeWorkspaceDirectories API request. @@ -368,57 +370,53 @@ func (c *WorkSpaces) DescribeWorkspaceDirectoriesRequest(input *DescribeWorkspac req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeWorkspaceDirectoriesRequest{Request: req, Input: input} + return DescribeWorkspaceDirectoriesRequest{Request: req, Input: input, Copy: c.DescribeWorkspaceDirectoriesRequest} } -// DescribeWorkspaceDirectoriesPages iterates over the pages of a DescribeWorkspaceDirectories operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeWorkspaceDirectories method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeWorkspaceDirectoriesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeWorkspaceDirectories operation. -// pageNum := 0 -// err := client.DescribeWorkspaceDirectoriesPages(params, -// func(page *DescribeWorkspaceDirectoriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *WorkSpaces) DescribeWorkspaceDirectoriesPages(input *DescribeWorkspaceDirectoriesInput, fn func(*DescribeWorkspaceDirectoriesOutput, bool) bool) error { - return c.DescribeWorkspaceDirectoriesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeWorkspaceDirectoriesPagesWithContext same as DescribeWorkspaceDirectoriesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkSpaces) DescribeWorkspaceDirectoriesPagesWithContext(ctx aws.Context, input *DescribeWorkspaceDirectoriesInput, fn func(*DescribeWorkspaceDirectoriesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeWorkspaceDirectoriesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeWorkspaceDirectoriesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeWorkspaceDirectoriesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeWorkspaceDirectoriesRequest) Paginate(opts ...aws.Option) DescribeWorkspaceDirectoriesPager { + return DescribeWorkspaceDirectoriesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeWorkspaceDirectoriesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeWorkspaceDirectoriesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeWorkspaceDirectoriesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeWorkspaceDirectoriesPager struct { + aws.Pager +} + +func (p *DescribeWorkspaceDirectoriesPager) CurrentPage() *DescribeWorkspaceDirectoriesOutput { + return p.Pager.CurrentPage().(*DescribeWorkspaceDirectoriesOutput) } const opDescribeWorkspaces = "DescribeWorkspaces" @@ -427,6 +425,7 @@ const opDescribeWorkspaces = "DescribeWorkspaces" type DescribeWorkspacesRequest struct { *aws.Request Input *DescribeWorkspacesInput + Copy func(*DescribeWorkspacesInput) DescribeWorkspacesRequest } // Send marshals and sends the DescribeWorkspaces API request. @@ -476,57 +475,53 @@ func (c *WorkSpaces) DescribeWorkspacesRequest(input *DescribeWorkspacesInput) D req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeWorkspacesRequest{Request: req, Input: input} + return DescribeWorkspacesRequest{Request: req, Input: input, Copy: c.DescribeWorkspacesRequest} } -// DescribeWorkspacesPages iterates over the pages of a DescribeWorkspaces operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeWorkspaces method for more information on how to use this operation. +// Paginate pages iterates over the pages of a DescribeWorkspacesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeWorkspaces operation. -// pageNum := 0 -// err := client.DescribeWorkspacesPages(params, -// func(page *DescribeWorkspacesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *WorkSpaces) DescribeWorkspacesPages(input *DescribeWorkspacesInput, fn func(*DescribeWorkspacesOutput, bool) bool) error { - return c.DescribeWorkspacesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeWorkspacesPagesWithContext same as DescribeWorkspacesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WorkSpaces) DescribeWorkspacesPagesWithContext(ctx aws.Context, input *DescribeWorkspacesInput, fn func(*DescribeWorkspacesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *DescribeWorkspacesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.DescribeWorkspacesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +// req := client.DescribeWorkspacesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func (p *DescribeWorkspacesRequest) Paginate(opts ...aws.Option) DescribeWorkspacesPager { + return DescribeWorkspacesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *DescribeWorkspacesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeWorkspacesOutput), !p.HasNextPage()) - } - return p.Err() +// DescribeWorkspacesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeWorkspacesPager struct { + aws.Pager +} + +func (p *DescribeWorkspacesPager) CurrentPage() *DescribeWorkspacesOutput { + return p.Pager.CurrentPage().(*DescribeWorkspacesOutput) } const opDescribeWorkspacesConnectionStatus = "DescribeWorkspacesConnectionStatus" @@ -535,6 +530,7 @@ const opDescribeWorkspacesConnectionStatus = "DescribeWorkspacesConnectionStatus type DescribeWorkspacesConnectionStatusRequest struct { *aws.Request Input *DescribeWorkspacesConnectionStatusInput + Copy func(*DescribeWorkspacesConnectionStatusInput) DescribeWorkspacesConnectionStatusRequest } // Send marshals and sends the DescribeWorkspacesConnectionStatus API request. @@ -575,7 +571,7 @@ func (c *WorkSpaces) DescribeWorkspacesConnectionStatusRequest(input *DescribeWo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return DescribeWorkspacesConnectionStatusRequest{Request: req, Input: input} + return DescribeWorkspacesConnectionStatusRequest{Request: req, Input: input, Copy: c.DescribeWorkspacesConnectionStatusRequest} } const opModifyWorkspaceProperties = "ModifyWorkspaceProperties" @@ -584,6 +580,7 @@ const opModifyWorkspaceProperties = "ModifyWorkspaceProperties" type ModifyWorkspacePropertiesRequest struct { *aws.Request Input *ModifyWorkspacePropertiesInput + Copy func(*ModifyWorkspacePropertiesInput) ModifyWorkspacePropertiesRequest } // Send marshals and sends the ModifyWorkspaceProperties API request. @@ -624,7 +621,7 @@ func (c *WorkSpaces) ModifyWorkspacePropertiesRequest(input *ModifyWorkspaceProp req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return ModifyWorkspacePropertiesRequest{Request: req, Input: input} + return ModifyWorkspacePropertiesRequest{Request: req, Input: input, Copy: c.ModifyWorkspacePropertiesRequest} } const opRebootWorkspaces = "RebootWorkspaces" @@ -633,6 +630,7 @@ const opRebootWorkspaces = "RebootWorkspaces" type RebootWorkspacesRequest struct { *aws.Request Input *RebootWorkspacesInput + Copy func(*RebootWorkspacesInput) RebootWorkspacesRequest } // Send marshals and sends the RebootWorkspaces API request. @@ -678,7 +676,7 @@ func (c *WorkSpaces) RebootWorkspacesRequest(input *RebootWorkspacesInput) Reboo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RebootWorkspacesRequest{Request: req, Input: input} + return RebootWorkspacesRequest{Request: req, Input: input, Copy: c.RebootWorkspacesRequest} } const opRebuildWorkspaces = "RebuildWorkspaces" @@ -687,6 +685,7 @@ const opRebuildWorkspaces = "RebuildWorkspaces" type RebuildWorkspacesRequest struct { *aws.Request Input *RebuildWorkspacesInput + Copy func(*RebuildWorkspacesInput) RebuildWorkspacesRequest } // Send marshals and sends the RebuildWorkspaces API request. @@ -735,7 +734,7 @@ func (c *WorkSpaces) RebuildWorkspacesRequest(input *RebuildWorkspacesInput) Reb req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return RebuildWorkspacesRequest{Request: req, Input: input} + return RebuildWorkspacesRequest{Request: req, Input: input, Copy: c.RebuildWorkspacesRequest} } const opStartWorkspaces = "StartWorkspaces" @@ -744,6 +743,7 @@ const opStartWorkspaces = "StartWorkspaces" type StartWorkspacesRequest struct { *aws.Request Input *StartWorkspacesInput + Copy func(*StartWorkspacesInput) StartWorkspacesRequest } // Send marshals and sends the StartWorkspaces API request. @@ -787,7 +787,7 @@ func (c *WorkSpaces) StartWorkspacesRequest(input *StartWorkspacesInput) StartWo req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StartWorkspacesRequest{Request: req, Input: input} + return StartWorkspacesRequest{Request: req, Input: input, Copy: c.StartWorkspacesRequest} } const opStopWorkspaces = "StopWorkspaces" @@ -796,6 +796,7 @@ const opStopWorkspaces = "StopWorkspaces" type StopWorkspacesRequest struct { *aws.Request Input *StopWorkspacesInput + Copy func(*StopWorkspacesInput) StopWorkspacesRequest } // Send marshals and sends the StopWorkspaces API request. @@ -839,7 +840,7 @@ func (c *WorkSpaces) StopWorkspacesRequest(input *StopWorkspacesInput) StopWorks req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return StopWorkspacesRequest{Request: req, Input: input} + return StopWorkspacesRequest{Request: req, Input: input, Copy: c.StopWorkspacesRequest} } const opTerminateWorkspaces = "TerminateWorkspaces" @@ -848,6 +849,7 @@ const opTerminateWorkspaces = "TerminateWorkspaces" type TerminateWorkspacesRequest struct { *aws.Request Input *TerminateWorkspacesInput + Copy func(*TerminateWorkspacesInput) TerminateWorkspacesRequest } // Send marshals and sends the TerminateWorkspaces API request. @@ -897,7 +899,7 @@ func (c *WorkSpaces) TerminateWorkspacesRequest(input *TerminateWorkspacesInput) req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return TerminateWorkspacesRequest{Request: req, Input: input} + return TerminateWorkspacesRequest{Request: req, Input: input, Copy: c.TerminateWorkspacesRequest} } // Information about the compute type. diff --git a/service/workspaces/workspacesiface/interface.go b/service/workspaces/workspacesiface/interface.go index 85c6c2ee26f..5154323aff0 100644 --- a/service/workspaces/workspacesiface/interface.go +++ b/service/workspaces/workspacesiface/interface.go @@ -9,7 +9,6 @@ package workspacesiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/workspaces" ) @@ -73,19 +72,10 @@ type WorkSpacesAPI interface { DescribeWorkspaceBundlesRequest(*workspaces.DescribeWorkspaceBundlesInput) workspaces.DescribeWorkspaceBundlesRequest - DescribeWorkspaceBundlesPages(*workspaces.DescribeWorkspaceBundlesInput, func(*workspaces.DescribeWorkspaceBundlesOutput, bool) bool) error - DescribeWorkspaceBundlesPagesWithContext(aws.Context, *workspaces.DescribeWorkspaceBundlesInput, func(*workspaces.DescribeWorkspaceBundlesOutput, bool) bool, ...aws.Option) error - DescribeWorkspaceDirectoriesRequest(*workspaces.DescribeWorkspaceDirectoriesInput) workspaces.DescribeWorkspaceDirectoriesRequest - DescribeWorkspaceDirectoriesPages(*workspaces.DescribeWorkspaceDirectoriesInput, func(*workspaces.DescribeWorkspaceDirectoriesOutput, bool) bool) error - DescribeWorkspaceDirectoriesPagesWithContext(aws.Context, *workspaces.DescribeWorkspaceDirectoriesInput, func(*workspaces.DescribeWorkspaceDirectoriesOutput, bool) bool, ...aws.Option) error - DescribeWorkspacesRequest(*workspaces.DescribeWorkspacesInput) workspaces.DescribeWorkspacesRequest - DescribeWorkspacesPages(*workspaces.DescribeWorkspacesInput, func(*workspaces.DescribeWorkspacesOutput, bool) bool) error - DescribeWorkspacesPagesWithContext(aws.Context, *workspaces.DescribeWorkspacesInput, func(*workspaces.DescribeWorkspacesOutput, bool) bool, ...aws.Option) error - DescribeWorkspacesConnectionStatusRequest(*workspaces.DescribeWorkspacesConnectionStatusInput) workspaces.DescribeWorkspacesConnectionStatusRequest ModifyWorkspacePropertiesRequest(*workspaces.ModifyWorkspacePropertiesInput) workspaces.ModifyWorkspacePropertiesRequest diff --git a/service/xray/api.go b/service/xray/api.go index 1550cfb57d3..889be5cb594 100644 --- a/service/xray/api.go +++ b/service/xray/api.go @@ -17,6 +17,7 @@ const opBatchGetTraces = "BatchGetTraces" type BatchGetTracesRequest struct { *aws.Request Input *BatchGetTracesInput + Copy func(*BatchGetTracesInput) BatchGetTracesRequest } // Send marshals and sends the BatchGetTraces API request. @@ -65,57 +66,53 @@ func (c *XRay) BatchGetTracesRequest(input *BatchGetTracesInput) BatchGetTracesR req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return BatchGetTracesRequest{Request: req, Input: input} + return BatchGetTracesRequest{Request: req, Input: input, Copy: c.BatchGetTracesRequest} } -// BatchGetTracesPages iterates over the pages of a BatchGetTraces operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See BatchGetTraces method for more information on how to use this operation. +// Paginate pages iterates over the pages of a BatchGetTracesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a BatchGetTraces operation. -// pageNum := 0 -// err := client.BatchGetTracesPages(params, -// func(page *BatchGetTracesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.BatchGetTracesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *XRay) BatchGetTracesPages(input *BatchGetTracesInput, fn func(*BatchGetTracesOutput, bool) bool) error { - return c.BatchGetTracesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// BatchGetTracesPagesWithContext same as BatchGetTracesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) BatchGetTracesPagesWithContext(ctx aws.Context, input *BatchGetTracesInput, fn func(*BatchGetTracesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *BatchGetTracesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.BatchGetTracesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *BatchGetTracesRequest) Paginate(opts ...aws.Option) BatchGetTracesPager { + return BatchGetTracesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *BatchGetTracesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*BatchGetTracesOutput), !p.HasNextPage()) - } - return p.Err() +// BatchGetTracesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type BatchGetTracesPager struct { + aws.Pager +} + +func (p *BatchGetTracesPager) CurrentPage() *BatchGetTracesOutput { + return p.Pager.CurrentPage().(*BatchGetTracesOutput) } const opGetServiceGraph = "GetServiceGraph" @@ -124,6 +121,7 @@ const opGetServiceGraph = "GetServiceGraph" type GetServiceGraphRequest struct { *aws.Request Input *GetServiceGraphInput + Copy func(*GetServiceGraphInput) GetServiceGraphRequest } // Send marshals and sends the GetServiceGraph API request. @@ -174,57 +172,53 @@ func (c *XRay) GetServiceGraphRequest(input *GetServiceGraphInput) GetServiceGra req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetServiceGraphRequest{Request: req, Input: input} + return GetServiceGraphRequest{Request: req, Input: input, Copy: c.GetServiceGraphRequest} } -// GetServiceGraphPages iterates over the pages of a GetServiceGraph operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetServiceGraph method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetServiceGraphRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetServiceGraph operation. -// pageNum := 0 -// err := client.GetServiceGraphPages(params, -// func(page *GetServiceGraphOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetServiceGraphRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *XRay) GetServiceGraphPages(input *GetServiceGraphInput, fn func(*GetServiceGraphOutput, bool) bool) error { - return c.GetServiceGraphPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetServiceGraphPagesWithContext same as GetServiceGraphPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetServiceGraphPagesWithContext(ctx aws.Context, input *GetServiceGraphInput, fn func(*GetServiceGraphOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetServiceGraphInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetServiceGraphRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetServiceGraphRequest) Paginate(opts ...aws.Option) GetServiceGraphPager { + return GetServiceGraphPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetServiceGraphInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetServiceGraphOutput), !p.HasNextPage()) - } - return p.Err() +// GetServiceGraphPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetServiceGraphPager struct { + aws.Pager +} + +func (p *GetServiceGraphPager) CurrentPage() *GetServiceGraphOutput { + return p.Pager.CurrentPage().(*GetServiceGraphOutput) } const opGetTraceGraph = "GetTraceGraph" @@ -233,6 +227,7 @@ const opGetTraceGraph = "GetTraceGraph" type GetTraceGraphRequest struct { *aws.Request Input *GetTraceGraphInput + Copy func(*GetTraceGraphInput) GetTraceGraphRequest } // Send marshals and sends the GetTraceGraph API request. @@ -279,57 +274,53 @@ func (c *XRay) GetTraceGraphRequest(input *GetTraceGraphInput) GetTraceGraphRequ req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTraceGraphRequest{Request: req, Input: input} + return GetTraceGraphRequest{Request: req, Input: input, Copy: c.GetTraceGraphRequest} } -// GetTraceGraphPages iterates over the pages of a GetTraceGraph operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTraceGraph method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetTraceGraphRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetTraceGraph operation. -// pageNum := 0 -// err := client.GetTraceGraphPages(params, -// func(page *GetTraceGraphOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetTraceGraphRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *XRay) GetTraceGraphPages(input *GetTraceGraphInput, fn func(*GetTraceGraphOutput, bool) bool) error { - return c.GetTraceGraphPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTraceGraphPagesWithContext same as GetTraceGraphPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetTraceGraphPagesWithContext(ctx aws.Context, input *GetTraceGraphInput, fn func(*GetTraceGraphOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetTraceGraphInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetTraceGraphRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetTraceGraphRequest) Paginate(opts ...aws.Option) GetTraceGraphPager { + return GetTraceGraphPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetTraceGraphInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTraceGraphOutput), !p.HasNextPage()) - } - return p.Err() +// GetTraceGraphPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetTraceGraphPager struct { + aws.Pager +} + +func (p *GetTraceGraphPager) CurrentPage() *GetTraceGraphOutput { + return p.Pager.CurrentPage().(*GetTraceGraphOutput) } const opGetTraceSummaries = "GetTraceSummaries" @@ -338,6 +329,7 @@ const opGetTraceSummaries = "GetTraceSummaries" type GetTraceSummariesRequest struct { *aws.Request Input *GetTraceSummariesInput + Copy func(*GetTraceSummariesInput) GetTraceSummariesRequest } // Send marshals and sends the GetTraceSummaries API request. @@ -400,57 +392,53 @@ func (c *XRay) GetTraceSummariesRequest(input *GetTraceSummariesInput) GetTraceS req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return GetTraceSummariesRequest{Request: req, Input: input} + return GetTraceSummariesRequest{Request: req, Input: input, Copy: c.GetTraceSummariesRequest} } -// GetTraceSummariesPages iterates over the pages of a GetTraceSummaries operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTraceSummaries method for more information on how to use this operation. +// Paginate pages iterates over the pages of a GetTraceSummariesRequest operation, +// calling the Next method for each page. Using the paginators Next +// method will depict whether or not there are more pages. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a GetTraceSummaries operation. -// pageNum := 0 -// err := client.GetTraceSummariesPages(params, -// func(page *GetTraceSummariesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// req := client.GetTraceSummariesRequest(input) +// p := req.Paginate() +// for p.Next() { +// page := p.CurrentPage() +// } // -func (c *XRay) GetTraceSummariesPages(input *GetTraceSummariesInput, fn func(*GetTraceSummariesOutput, bool) bool) error { - return c.GetTraceSummariesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTraceSummariesPagesWithContext same as GetTraceSummariesPages except -// it takes a Context and allows setting request options on the pages. +// if err := p.Err(); err != nil { +// return err +// } // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetTraceSummariesPagesWithContext(ctx aws.Context, input *GetTraceSummariesInput, fn func(*GetTraceSummariesOutput, bool) bool, opts ...aws.Option) error { - p := aws.Pagination{ - NewRequest: func() (*aws.Request, error) { - var inCpy *GetTraceSummariesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req := c.GetTraceSummariesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req.Request, nil +func (p *GetTraceSummariesRequest) Paginate(opts ...aws.Option) GetTraceSummariesPager { + return GetTraceSummariesPager{ + Pager: aws.Pager{ + NewRequest: func() (*aws.Request, error) { + var inCpy *GetTraceSummariesInput + if p.Input != nil { + tmp := *p.Input + inCpy = &tmp + } + + req := p.Copy(inCpy) + req.ApplyOptions(opts...) + + return req.Request, nil + }, }, } +} - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTraceSummariesOutput), !p.HasNextPage()) - } - return p.Err() +// GetTraceSummariesPager is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type GetTraceSummariesPager struct { + aws.Pager +} + +func (p *GetTraceSummariesPager) CurrentPage() *GetTraceSummariesOutput { + return p.Pager.CurrentPage().(*GetTraceSummariesOutput) } const opPutTelemetryRecords = "PutTelemetryRecords" @@ -459,6 +447,7 @@ const opPutTelemetryRecords = "PutTelemetryRecords" type PutTelemetryRecordsRequest struct { *aws.Request Input *PutTelemetryRecordsInput + Copy func(*PutTelemetryRecordsInput) PutTelemetryRecordsRequest } // Send marshals and sends the PutTelemetryRecords API request. @@ -499,7 +488,7 @@ func (c *XRay) PutTelemetryRecordsRequest(input *PutTelemetryRecordsInput) PutTe req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutTelemetryRecordsRequest{Request: req, Input: input} + return PutTelemetryRecordsRequest{Request: req, Input: input, Copy: c.PutTelemetryRecordsRequest} } const opPutTraceSegments = "PutTraceSegments" @@ -508,6 +497,7 @@ const opPutTraceSegments = "PutTraceSegments" type PutTraceSegmentsRequest struct { *aws.Request Input *PutTraceSegmentsInput + Copy func(*PutTraceSegmentsInput) PutTraceSegmentsRequest } // Send marshals and sends the PutTraceSegments API request. @@ -593,7 +583,7 @@ func (c *XRay) PutTraceSegmentsRequest(input *PutTraceSegmentsInput) PutTraceSeg req := c.newRequest(op, input, output) output.responseMetadata = aws.Response{Request: req} - return PutTraceSegmentsRequest{Request: req, Input: input} + return PutTraceSegmentsRequest{Request: req, Input: input, Copy: c.PutTraceSegmentsRequest} } // An alias for an edge. diff --git a/service/xray/xrayiface/interface.go b/service/xray/xrayiface/interface.go index 836b1c6c21c..6973488d108 100644 --- a/service/xray/xrayiface/interface.go +++ b/service/xray/xrayiface/interface.go @@ -9,7 +9,6 @@ package xrayiface import ( - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/xray" ) @@ -65,24 +64,12 @@ import ( type XRayAPI interface { BatchGetTracesRequest(*xray.BatchGetTracesInput) xray.BatchGetTracesRequest - BatchGetTracesPages(*xray.BatchGetTracesInput, func(*xray.BatchGetTracesOutput, bool) bool) error - BatchGetTracesPagesWithContext(aws.Context, *xray.BatchGetTracesInput, func(*xray.BatchGetTracesOutput, bool) bool, ...aws.Option) error - GetServiceGraphRequest(*xray.GetServiceGraphInput) xray.GetServiceGraphRequest - GetServiceGraphPages(*xray.GetServiceGraphInput, func(*xray.GetServiceGraphOutput, bool) bool) error - GetServiceGraphPagesWithContext(aws.Context, *xray.GetServiceGraphInput, func(*xray.GetServiceGraphOutput, bool) bool, ...aws.Option) error - GetTraceGraphRequest(*xray.GetTraceGraphInput) xray.GetTraceGraphRequest - GetTraceGraphPages(*xray.GetTraceGraphInput, func(*xray.GetTraceGraphOutput, bool) bool) error - GetTraceGraphPagesWithContext(aws.Context, *xray.GetTraceGraphInput, func(*xray.GetTraceGraphOutput, bool) bool, ...aws.Option) error - GetTraceSummariesRequest(*xray.GetTraceSummariesInput) xray.GetTraceSummariesRequest - GetTraceSummariesPages(*xray.GetTraceSummariesInput, func(*xray.GetTraceSummariesOutput, bool) bool) error - GetTraceSummariesPagesWithContext(aws.Context, *xray.GetTraceSummariesInput, func(*xray.GetTraceSummariesOutput, bool) bool, ...aws.Option) error - PutTelemetryRecordsRequest(*xray.PutTelemetryRecordsInput) xray.PutTelemetryRecordsRequest PutTraceSegmentsRequest(*xray.PutTraceSegmentsInput) xray.PutTraceSegmentsRequest