diff --git a/CHANGELOG.md b/CHANGELOG.md index 58b8a70fb..9be92c79e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ FEATURES: * **New Resource:** `aws_lightsail_static_ip` [GH-13175] * **New Resource:** `aws_lightsail_static_ip_attachment` [GH-13207] * **New Resource:** `aws_ses_domain_identity` [GH-13098] + * **New Resource**: `azurerm_managed_disk` [GH-12455] * **New Resource:** `kubernetes_secret` [GH-12960] * **New Data Source:** `aws_iam_role` [GH-13213] @@ -31,15 +32,22 @@ IMPROVEMENTS: * provider/aws: Update caller_identity data source [GH-13092] * provider/aws: `aws_subnet_ids` data source for getting a list of subnet ids matching certain criteria [GH-13188] * provider/aws: Support ip_address_type for aws_alb [GH-13227] + * provider/aws: Migrate `aws_dms_*` resources away from AWS waiters [GH-13291] + * provider/aws: Add support for treat_missing_data to cloudwatch_metric_alarm [GH-13358] + * provider/aws: Add support for evaluate_low_sample_count_percentiles to cloudwatch_metric_alarm [GH-13371] + * provider/aws: Fix `aws_s3_bucket` drift detection of logging options [GH-13281] + * provider/bitbucket: Improved error handling [GH-13390] + * provider/cloudstack: Do not force a new resource when updating `cloudstack_loadbalancer_rule` members [GH-11786] * provider/github: Handle the case when issue labels already exist [GH-13182] * provider/google: Mark `google_container_cluster`'s `client_key` & `password` inside `master_auth` as sensitive [GH-13148] * provider/triton: Move to joyent/triton-go [GH-13225] - + BUG FIXES: * core: Escaped interpolation-like sequences (like `$${foo}`) now permitted in variable defaults [GH-13137] * core: Fix strange issues with computed values in provider configuration that were worked around with `-input=false` [GH-11264], [GH-13264] * core: Fix crash when providing nested maps as variable values in a `module` block [GH-13343] + * core: `connection` block attributes are now subject to basic validation of attribute names during validate walk [GH-13400] * provider/aws: Add Support for maintenance_window and back_window to rds_cluster_instance [GH-13134] * provider/aws: Increase timeout for AMI registration [GH-13159] * provider/aws: Increase timeouts for ELB [GH-13161] @@ -55,8 +63,15 @@ BUG FIXES: * provider/aws: Set stickiness to computed in alb_target_group [GH-13278] * provider/aws: Increase timeout for deploying `cloudfront_distribution` from 40 to 70 mins [GH-13319] * provider/aws: Increase AMI retry timeouts [GH-13324] + * provider/aws: Increase subnet deletion timeout [GH-13356] + * provider/aws: Increase launch_configuration creation timeout [GH-13357] + * provider/aws: Increase Beanstalk env 'ready' timeout [GH-13359] * provider/aws: Recreate opsworks_stack on change of service_role_arn [GH-13325] + * provider/aws: Fix KMS Key reading with Exists method [GH-13348] * provider/azurerm: Network Security Group - ignoring protocol casing at Import time [GH-13153] + * provider/azurerm: Fix crash when importing Local Network Gateways [GH-13261] + * provider/bitbucket: Fixed issue where provider would fail with an "EOF" error on some operations [GH-13390] + * provider/openstack: Refresh volume_attachment from state if NotFound [GH-13342] * provider/profitbricks: Changed output type of ips variable of ip_block ProfitBricks resource [GH-13290] ## 0.9.2 (March 28, 2017) diff --git a/backend/remote-state/consul/client.go b/backend/remote-state/consul/client.go index cd5971163..b11f31ba1 100644 --- a/backend/remote-state/consul/client.go +++ b/backend/remote-state/consul/client.go @@ -121,16 +121,15 @@ func (c *RemoteClient) Lock(info *state.LockInfo) (string, error) { default: if c.lockCh != nil { // we have an active lock already - return "", nil + return "", fmt.Errorf("state %q already locked", c.Path) } } if c.consulLock == nil { opts := &consulapi.LockOptions{ Key: c.Path + lockSuffix, - // We currently don't procide any options to block terraform and - // retry lock acquisition, but we can wait briefly in case the - // lock is about to be freed. + // only wait briefly, so terraform has the choice to fail fast or + // retry as needed. LockWaitTime: time.Second, LockTryOnce: true, } @@ -191,6 +190,10 @@ func (c *RemoteClient) Unlock(id string) error { err := c.consulLock.Unlock() c.lockCh = nil + // This is only cleanup, and will fail if the lock was immediately taken by + // another client, so we don't report an error to the user here. + c.consulLock.Destroy() + kv := c.Client.KV() _, delErr := kv.Delete(c.Path+lockInfoSuffix, nil) if delErr != nil { diff --git a/backend/remote-state/consul/client_test.go b/backend/remote-state/consul/client_test.go index 57b7c452e..dc7988135 100644 --- a/backend/remote-state/consul/client_test.go +++ b/backend/remote-state/consul/client_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/hashicorp/terraform/backend" + "github.com/hashicorp/terraform/state" "github.com/hashicorp/terraform/state/remote" ) @@ -98,3 +99,43 @@ func TestConsul_stateLock(t *testing.T) { remote.TestRemoteLocks(t, sA.(*remote.State).Client, sB.(*remote.State).Client) } + +func TestConsul_destroyLock(t *testing.T) { + srv := newConsulTestServer(t) + defer srv.Stop() + + // Get the backend + b := backend.TestBackendConfig(t, New(), map[string]interface{}{ + "address": srv.HTTPAddr, + "path": fmt.Sprintf("tf-unit/%s", time.Now().String()), + }) + + // Grab the client + s, err := b.State(backend.DefaultStateName) + if err != nil { + t.Fatalf("err: %s", err) + } + + c := s.(*remote.State).Client.(*RemoteClient) + + info := state.NewLockInfo() + id, err := c.Lock(info) + if err != nil { + t.Fatal(err) + } + + lockPath := c.Path + lockSuffix + + if err := c.Unlock(id); err != nil { + t.Fatal(err) + } + + // get the lock val + pair, _, err := c.Client.KV().Get(lockPath, nil) + if err != nil { + t.Fatal(err) + } + if pair != nil { + t.Fatalf("lock key not cleaned up at: %s", pair.Key) + } +} diff --git a/backend/remote-state/s3/backend.go b/backend/remote-state/s3/backend.go index a1d9c1f9a..846746b98 100644 --- a/backend/remote-state/s3/backend.go +++ b/backend/remote-state/s3/backend.go @@ -2,15 +2,9 @@ package s3 import ( "context" - "fmt" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/aws/aws-sdk-go/service/s3" - cleanhttp "github.com/hashicorp/go-cleanhttp" - multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform/backend" "github.com/hashicorp/terraform/helper/schema" @@ -175,48 +169,27 @@ func (b *Backend) configure(ctx context.Context) error { b.kmsKeyID = data.Get("kms_key_id").(string) b.lockTable = data.Get("lock_table").(string) - var errs []error - creds, err := terraformAWS.GetCredentials(&terraformAWS.Config{ + cfg := &terraformAWS.Config{ AccessKey: data.Get("access_key").(string), - SecretKey: data.Get("secret_key").(string), - Token: data.Get("token").(string), - Profile: data.Get("profile").(string), - CredsFilename: data.Get("shared_credentials_file").(string), AssumeRoleARN: data.Get("role_arn").(string), - AssumeRoleSessionName: data.Get("session_name").(string), AssumeRoleExternalID: data.Get("external_id").(string), AssumeRolePolicy: data.Get("assume_role_policy").(string), - }) + AssumeRoleSessionName: data.Get("session_name").(string), + CredsFilename: data.Get("shared_credentials_file").(string), + Profile: data.Get("profile").(string), + Region: data.Get("region").(string), + S3Endpoint: data.Get("endpoint").(string), + SecretKey: data.Get("secret_key").(string), + Token: data.Get("token").(string), + } + + client, err := cfg.Client() if err != nil { return err } - // Call Get to check for credential provider. If nothing found, we'll get an - // error, and we can present it nicely to the user - _, err = creds.Get() - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoCredentialProviders" { - errs = append(errs, fmt.Errorf(`No valid credential sources found for AWS S3 remote. -Please see https://www.terraform.io/docs/state/remote/s3.html for more information on -providing credentials for the AWS S3 remote`)) - } else { - errs = append(errs, fmt.Errorf("Error loading credentials for AWS S3 remote: %s", err)) - } - return &multierror.Error{Errors: errs} - } - - endpoint := data.Get("endpoint").(string) - region := data.Get("region").(string) - - awsConfig := &aws.Config{ - Credentials: creds, - Endpoint: aws.String(endpoint), - Region: aws.String(region), - HTTPClient: cleanhttp.DefaultClient(), - } - sess := session.New(awsConfig) - b.s3Client = s3.New(sess) - b.dynClient = dynamodb.New(sess) + b.s3Client = client.(*terraformAWS.AWSClient).S3() + b.dynClient = client.(*terraformAWS.AWSClient).DynamoDB() return nil } diff --git a/backend/remote-state/s3/backend_test.go b/backend/remote-state/s3/backend_test.go index f8b664b80..44987683f 100644 --- a/backend/remote-state/s3/backend_test.go +++ b/backend/remote-state/s3/backend_test.go @@ -29,16 +29,12 @@ func TestBackend_impl(t *testing.T) { } func TestBackendConfig(t *testing.T) { - // This test just instantiates the client. Shouldn't make any actual - // requests nor incur any costs. - + testACC(t) config := map[string]interface{}{ "region": "us-west-1", "bucket": "tf-test", "key": "state", "encrypt": true, - "access_key": "ACCESS_KEY", - "secret_key": "SECRET_KEY", "lock_table": "dynamoTable", } @@ -58,11 +54,11 @@ func TestBackendConfig(t *testing.T) { if err != nil { t.Fatalf("Error when requesting credentials") } - if credentials.AccessKeyID != "ACCESS_KEY" { - t.Fatalf("Incorrect Access Key Id was populated") + if credentials.AccessKeyID == "" { + t.Fatalf("No Access Key Id was populated") } - if credentials.SecretAccessKey != "SECRET_KEY" { - t.Fatalf("Incorrect Secret Access Key was populated") + if credentials.SecretAccessKey == "" { + t.Fatalf("No Secret Access Key was populated") } } diff --git a/backend/remote-state/s3/client.go b/backend/remote-state/s3/client.go index 735180ba9..d7603e4bf 100644 --- a/backend/remote-state/s3/client.go +++ b/backend/remote-state/s3/client.go @@ -113,8 +113,7 @@ func (c *RemoteClient) Lock(info *state.LockInfo) (string, error) { return "", nil } - stateName := fmt.Sprintf("%s/%s", c.bucketName, c.path) - info.Path = stateName + info.Path = c.lockPath() if info.ID == "" { lockID, err := uuid.GenerateUUID() @@ -127,7 +126,7 @@ func (c *RemoteClient) Lock(info *state.LockInfo) (string, error) { putParams := &dynamodb.PutItemInput{ Item: map[string]*dynamodb.AttributeValue{ - "LockID": {S: aws.String(stateName)}, + "LockID": {S: aws.String(c.lockPath())}, "Info": {S: aws.String(string(info.Marshal()))}, }, TableName: aws.String(c.lockTable), @@ -153,7 +152,7 @@ func (c *RemoteClient) Lock(info *state.LockInfo) (string, error) { func (c *RemoteClient) getLockInfo() (*state.LockInfo, error) { getParams := &dynamodb.GetItemInput{ Key: map[string]*dynamodb.AttributeValue{ - "LockID": {S: aws.String(fmt.Sprintf("%s/%s", c.bucketName, c.path))}, + "LockID": {S: aws.String(c.lockPath())}, }, ProjectionExpression: aws.String("LockID, Info"), TableName: aws.String(c.lockTable), @@ -202,7 +201,7 @@ func (c *RemoteClient) Unlock(id string) error { params := &dynamodb.DeleteItemInput{ Key: map[string]*dynamodb.AttributeValue{ - "LockID": {S: aws.String(fmt.Sprintf("%s/%s", c.bucketName, c.path))}, + "LockID": {S: aws.String(c.lockPath())}, }, TableName: aws.String(c.lockTable), } @@ -214,3 +213,7 @@ func (c *RemoteClient) Unlock(id string) error { } return nil } + +func (c *RemoteClient) lockPath() string { + return fmt.Sprintf("%s/%s", c.bucketName, c.path) +} diff --git a/builtin/providers/aws/config.go b/builtin/providers/aws/config.go index 1cfda12b7..a65bf93e5 100644 --- a/builtin/providers/aws/config.go +++ b/builtin/providers/aws/config.go @@ -160,6 +160,14 @@ type AWSClient struct { wafconn *waf.WAF } +func (c *AWSClient) S3() *s3.S3 { + return c.s3conn +} + +func (c *AWSClient) DynamoDB() *dynamodb.DynamoDB { + return c.dynamodbconn +} + // Client configures and returns a fully initialized AWSClient func (c *Config) Client() (interface{}, error) { // Get the auth and region. This can fail if keys/regions were not diff --git a/builtin/providers/aws/data_source_aws_ecs_task_definition_test.go b/builtin/providers/aws/data_source_aws_ecs_task_definition_test.go index 545da0714..6d6ffa35a 100644 --- a/builtin/providers/aws/data_source_aws_ecs_task_definition_test.go +++ b/builtin/providers/aws/data_source_aws_ecs_task_definition_test.go @@ -15,10 +15,10 @@ func TestAccAWSEcsDataSource_ecsTaskDefinition(t *testing.T) { resource.TestStep{ Config: testAccCheckAwsEcsTaskDefinitionDataSourceConfig, Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("data.aws_ecs_task_definition.mongo", "id", regexp.MustCompile("^arn:aws:ecs:us-west-2:[0-9]{12}:task-definition/mongodb:[1-9]*[0-9]$")), + resource.TestMatchResourceAttr("data.aws_ecs_task_definition.mongo", "id", regexp.MustCompile("^arn:aws:ecs:us-west-2:[0-9]{12}:task-definition/mongodb:[1-9][0-9]*$")), resource.TestCheckResourceAttr("data.aws_ecs_task_definition.mongo", "family", "mongodb"), resource.TestCheckResourceAttr("data.aws_ecs_task_definition.mongo", "network_mode", "bridge"), - resource.TestMatchResourceAttr("data.aws_ecs_task_definition.mongo", "revision", regexp.MustCompile("^[1-9]*[0-9]$")), + resource.TestMatchResourceAttr("data.aws_ecs_task_definition.mongo", "revision", regexp.MustCompile("^[1-9][0-9]*$")), resource.TestCheckResourceAttr("data.aws_ecs_task_definition.mongo", "status", "ACTIVE"), resource.TestMatchResourceAttr("data.aws_ecs_task_definition.mongo", "task_role_arn", regexp.MustCompile("^arn:aws:iam::[0-9]{12}:role/mongo_role$")), ), diff --git a/builtin/providers/aws/import_aws_cloudwatch_metric_alarm_test.go b/builtin/providers/aws/import_aws_cloudwatch_metric_alarm_test.go index bc7a82647..1cb30254c 100644 --- a/builtin/providers/aws/import_aws_cloudwatch_metric_alarm_test.go +++ b/builtin/providers/aws/import_aws_cloudwatch_metric_alarm_test.go @@ -3,10 +3,12 @@ package aws import ( "testing" + "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" ) func TestAccAWSCloudWatchMetricAlarm_importBasic(t *testing.T) { + rInt := acctest.RandInt() resourceName := "aws_cloudwatch_metric_alarm.foobar" resource.Test(t, resource.TestCase{ @@ -14,11 +16,11 @@ func TestAccAWSCloudWatchMetricAlarm_importBasic(t *testing.T) { Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ - resource.TestStep{ - Config: testAccAWSCloudWatchMetricAlarmConfig, + { + Config: testAccAWSCloudWatchMetricAlarmConfig(rInt), }, - resource.TestStep{ + { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, diff --git a/builtin/providers/aws/import_aws_elasticache_parameter_group_test.go b/builtin/providers/aws/import_aws_elasticache_parameter_group_test.go index 8754b8181..11c9334ed 100644 --- a/builtin/providers/aws/import_aws_elasticache_parameter_group_test.go +++ b/builtin/providers/aws/import_aws_elasticache_parameter_group_test.go @@ -1,13 +1,16 @@ package aws import ( + "fmt" "testing" + "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" ) func TestAccAWSElasticacheParameterGroup_importBasic(t *testing.T) { resourceName := "aws_elasticache_parameter_group.bar" + rName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -15,7 +18,7 @@ func TestAccAWSElasticacheParameterGroup_importBasic(t *testing.T) { CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccAWSElasticacheParameterGroupConfig, + Config: testAccAWSElasticacheParameterGroupConfig(rName), }, resource.TestStep{ diff --git a/builtin/providers/aws/resource_aws_autoscaling_group.go b/builtin/providers/aws/resource_aws_autoscaling_group.go index a5e10e034..ef21f2492 100644 --- a/builtin/providers/aws/resource_aws_autoscaling_group.go +++ b/builtin/providers/aws/resource_aws_autoscaling_group.go @@ -446,7 +446,6 @@ func resourceAwsAutoscalingGroupRead(d *schema.ResourceData, meta interface{}) e d.Set("health_check_type", g.HealthCheckType) d.Set("launch_configuration", g.LaunchConfigurationName) d.Set("load_balancers", flattenStringList(g.LoadBalancerNames)) - d.Set("target_group_arns", flattenStringList(g.TargetGroupARNs)) if err := d.Set("suspended_processes", flattenAsgSuspendedProcesses(g.SuspendedProcesses)); err != nil { log.Printf("[WARN] Error setting suspended_processes for %q: %s", d.Id(), err) diff --git a/builtin/providers/aws/resource_aws_autoscaling_group_test.go b/builtin/providers/aws/resource_aws_autoscaling_group_test.go index 1c310433f..ee17f8844 100644 --- a/builtin/providers/aws/resource_aws_autoscaling_group_test.go +++ b/builtin/providers/aws/resource_aws_autoscaling_group_test.go @@ -445,15 +445,6 @@ func TestAccAWSAutoScalingGroup_ALB_TargetGroups(t *testing.T) { "aws_autoscaling_group.bar", "target_group_arns.#", "1"), ), }, - - resource.TestStep{ - Config: testAccAWSAutoScalingGroupConfig_ALB_TargetGroup_pre, - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group), - resource.TestCheckResourceAttr( - "aws_autoscaling_group.bar", "target_group_arns.#", "0"), - ), - }, }, }) } diff --git a/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter_test.go b/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter_test.go index 741ff20b2..bf121b203 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter_test.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter_test.go @@ -103,7 +103,7 @@ func testAccAWSCloudwatchLogSubscriptionFilterConfig(rstring string) string { return fmt.Sprintf(` resource "aws_cloudwatch_log_subscription_filter" "test_lambdafunction_logfilter" { name = "test_lambdafunction_logfilter_%s" - log_group_name = "example_lambda_name" + log_group_name = "${aws_cloudwatch_log_group.logs.name}" filter_pattern = "logtype test" destination_arn = "${aws_lambda_function.test_lambdafunction.arn}" } diff --git a/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm.go b/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm.go index 95153030e..8eef4ebee 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm.go @@ -8,14 +8,18 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatch" + "github.com/hashicorp/terraform/helper/validation" ) func resourceAwsCloudWatchMetricAlarm() *schema.Resource { return &schema.Resource{ - Create: resourceAwsCloudWatchMetricAlarmCreate, - Read: resourceAwsCloudWatchMetricAlarmRead, - Update: resourceAwsCloudWatchMetricAlarmUpdate, - Delete: resourceAwsCloudWatchMetricAlarmDelete, + Create: resourceAwsCloudWatchMetricAlarmCreate, + Read: resourceAwsCloudWatchMetricAlarmRead, + Update: resourceAwsCloudWatchMetricAlarmUpdate, + Delete: resourceAwsCloudWatchMetricAlarmDelete, + SchemaVersion: 1, + MigrateState: resourceAwsCloudWatchMetricAlarmMigrateState, + Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -95,6 +99,18 @@ func resourceAwsCloudWatchMetricAlarm() *schema.Resource { Optional: true, ConflictsWith: []string{"statistic"}, }, + "treat_missing_data": { + Type: schema.TypeString, + Optional: true, + Default: "missing", + ValidateFunc: validation.StringInSlice([]string{"breaching", "notBreaching", "ignore", "missing"}, true), + }, + "evaluate_low_sample_count_percentiles": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{"evaluate", "ignore"}, true), + }, }, } } @@ -161,6 +177,8 @@ func resourceAwsCloudWatchMetricAlarmRead(d *schema.ResourceData, meta interface d.Set("threshold", a.Threshold) d.Set("unit", a.Unit) d.Set("extended_statistic", a.ExtendedStatistic) + d.Set("treat_missing_data", a.TreatMissingData) + d.Set("evaluate_low_sample_count_percentiles", a.EvaluateLowSampleCountPercentile) return nil } @@ -214,6 +232,7 @@ func getAwsCloudWatchPutMetricAlarmInput(d *schema.ResourceData) cloudwatch.PutM Namespace: aws.String(d.Get("namespace").(string)), Period: aws.Int64(int64(d.Get("period").(int))), Threshold: aws.Float64(d.Get("threshold").(float64)), + TreatMissingData: aws.String(d.Get("treat_missing_data").(string)), } if v := d.Get("actions_enabled"); v != nil { @@ -236,6 +255,10 @@ func getAwsCloudWatchPutMetricAlarmInput(d *schema.ResourceData) cloudwatch.PutM params.ExtendedStatistic = aws.String(v.(string)) } + if v, ok := d.GetOk("evaluate_low_sample_count_percentiles"); ok { + params.EvaluateLowSampleCountPercentile = aws.String(v.(string)) + } + var alarmActions []*string if v := d.Get("alarm_actions"); v != nil { for _, v := range v.(*schema.Set).List() { diff --git a/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_migrate.go b/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_migrate.go new file mode 100644 index 000000000..0ebd7f80d --- /dev/null +++ b/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_migrate.go @@ -0,0 +1,33 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/hashicorp/terraform/terraform" +) + +func resourceAwsCloudWatchMetricAlarmMigrateState( + v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { + switch v { + case 0: + log.Println("[INFO] Found AWS CloudWatch Metric Alarm State v0; migrating to v1") + return migrateCloudWatchMetricAlarmStateV0toV1(is) + default: + return is, fmt.Errorf("Unexpected schema version: %d", v) + } +} + +func migrateCloudWatchMetricAlarmStateV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { + if is.Empty() { + log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") + return is, nil + } + + log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) + + is.Attributes["treat_missing_data"] = "missing" + + log.Printf("[DEBUG] Attributes after migration: %#v", is.Attributes) + return is, nil +} diff --git a/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_migrate_test.go b/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_migrate_test.go new file mode 100644 index 000000000..fbb17a522 --- /dev/null +++ b/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_migrate_test.go @@ -0,0 +1,41 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/terraform" +) + +func TestAWSCloudWatchMetricAlarmMigrateState(t *testing.T) { + cases := map[string]struct { + StateVersion int + ID string + Attributes map[string]string + Expected string + Meta interface{} + }{ + "v0_1": { + StateVersion: 0, + ID: "some_id", + Attributes: map[string]string{}, + Expected: "missing", + }, + } + + for tn, tc := range cases { + is := &terraform.InstanceState{ + ID: tc.ID, + Attributes: tc.Attributes, + } + is, err := resourceAwsCloudWatchMetricAlarmMigrateState( + tc.StateVersion, is, tc.Meta) + + if err != nil { + t.Fatalf("bad: %s, err: %#v", tn, err) + } + + if is.Attributes["treat_missing_data"] != tc.Expected { + t.Fatalf("bad Cloudwatch Metric Alarm Migrate: %s\n\n expected: %s", is.Attributes["treat_missing_data"], tc.Expected) + } + } +} diff --git a/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_test.go b/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_test.go index a3f902c4d..6e266c03b 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_test.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm_test.go @@ -7,20 +7,21 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatch" + "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) func TestAccAWSCloudWatchMetricAlarm_basic(t *testing.T) { var alarm cloudwatch.MetricAlarm - + rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfig, + Config: testAccAWSCloudWatchMetricAlarmConfig(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "metric_name", "CPUUtilization"), @@ -33,8 +34,9 @@ func TestAccAWSCloudWatchMetricAlarm_basic(t *testing.T) { }) } -func TestAccAWSCloudWatchMetricAlarm_extendedStatistic(t *testing.T) { +func TestAccAWSCloudWatchMetricAlarm_treatMissingData(t *testing.T) { var alarm cloudwatch.MetricAlarm + rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -42,7 +44,61 @@ func TestAccAWSCloudWatchMetricAlarm_extendedStatistic(t *testing.T) { CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfigExtendedStatistic, + Config: testAccAWSCloudWatchMetricAlarmConfigTreatMissingData(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), + resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "treat_missing_data", "missing"), + ), + }, + { + Config: testAccAWSCloudWatchMetricAlarmConfigTreatMissingDataUpdate(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), + resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "treat_missing_data", "breaching"), + ), + }, + }, + }) +} + +func TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles(t *testing.T) { + var alarm cloudwatch.MetricAlarm + rInt := acctest.RandInt() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentiles(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), + resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "evaluate_low_sample_count_percentiles", "evaluate"), + ), + }, + { + Config: testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentilesUpdated(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), + resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "evaluate_low_sample_count_percentiles", "ignore"), + ), + }, + }, + }) +} + +func TestAccAWSCloudWatchMetricAlarm_extendedStatistic(t *testing.T) { + var alarm cloudwatch.MetricAlarm + rInt := acctest.RandInt() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCloudWatchMetricAlarmConfigExtendedStatistic(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "extended_statistic", "p88.0"), @@ -53,13 +109,14 @@ func TestAccAWSCloudWatchMetricAlarm_extendedStatistic(t *testing.T) { } func TestAccAWSCloudWatchMetricAlarm_missingStatistic(t *testing.T) { + rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfigMissingStatistic, + Config: testAccAWSCloudWatchMetricAlarmConfigMissingStatistic(rInt), ExpectError: regexp.MustCompile("One of `statistic` or `extended_statistic` must be set for a cloudwatch metric alarm"), }, }, @@ -133,9 +190,10 @@ func testAccCheckAWSCloudWatchMetricAlarmDestroy(s *terraform.State) error { return nil } -var testAccAWSCloudWatchMetricAlarmConfig = fmt.Sprintf(` +func testAccAWSCloudWatchMetricAlarmConfig(rInt int) string { + return fmt.Sprintf(` resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar5" + alarm_name = "terraform-test-foobar%d" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -148,12 +206,93 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { dimensions { InstanceId = "i-abc123" } +}`, rInt) } -`) -var testAccAWSCloudWatchMetricAlarmConfigExtendedStatistic = fmt.Sprintf(` +func testAccAWSCloudWatchMetricAlarmConfigTreatMissingData(rInt int) string { + return fmt.Sprintf(` resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar6" + alarm_name = "terraform-test-foobar%d" + comparison_operator = "GreaterThanOrEqualToThreshold" + evaluation_periods = "2" + metric_name = "CPUUtilization" + namespace = "AWS/EC2" + period = "120" + statistic = "Average" + threshold = "80" + alarm_description = "This metric monitors ec2 cpu utilization" + treat_missing_data = "missing" + insufficient_data_actions = [] + dimensions { + InstanceId = "i-abc123" + } +}`, rInt) +} + +func testAccAWSCloudWatchMetricAlarmConfigTreatMissingDataUpdate(rInt int) string { + return fmt.Sprintf(` +resource "aws_cloudwatch_metric_alarm" "foobar" { + alarm_name = "terraform-test-foobar%d" + comparison_operator = "GreaterThanOrEqualToThreshold" + evaluation_periods = "2" + metric_name = "CPUUtilization" + namespace = "AWS/EC2" + period = "120" + statistic = "Average" + threshold = "80" + alarm_description = "This metric monitors ec2 cpu utilization" + treat_missing_data = "breaching" + insufficient_data_actions = [] + dimensions { + InstanceId = "i-abc123" + } +}`, rInt) +} + +func testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentiles(rInt int) string { + return fmt.Sprintf(` +resource "aws_cloudwatch_metric_alarm" "foobar" { + alarm_name = "terraform-test-foobar%d" + comparison_operator = "GreaterThanOrEqualToThreshold" + evaluation_periods = "2" + metric_name = "CPUUtilization" + namespace = "AWS/EC2" + period = "120" + extended_statistic = "p88.0" + threshold = "80" + alarm_description = "This metric monitors ec2 cpu utilization" + evaluate_low_sample_count_percentiles = "evaluate" + insufficient_data_actions = [] + dimensions { + InstanceId = "i-abc123" + } +}`, rInt) +} + +func testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentilesUpdated(rInt int) string { + return fmt.Sprintf(` +resource "aws_cloudwatch_metric_alarm" "foobar" { + alarm_name = "terraform-test-foobar%d" + comparison_operator = "GreaterThanOrEqualToThreshold" + evaluation_periods = "2" + metric_name = "CPUUtilization" + namespace = "AWS/EC2" + period = "120" + extended_statistic = "p88.0" + threshold = "80" + alarm_description = "This metric monitors ec2 cpu utilization" + evaluate_low_sample_count_percentiles = "ignore" + insufficient_data_actions = [] + dimensions { + InstanceId = "i-abc123" + } +}`, rInt) +} + +func testAccAWSCloudWatchMetricAlarmConfigExtendedStatistic(rInt int) string { + return fmt.Sprintf(` +resource "aws_cloudwatch_metric_alarm" "foobar" { + alarm_name = "terraform-test-foobar%d" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -166,12 +305,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { dimensions { InstanceId = "i-abc123" } +}`, rInt) } -`) -var testAccAWSCloudWatchMetricAlarmConfigMissingStatistic = fmt.Sprintf(` +func testAccAWSCloudWatchMetricAlarmConfigMissingStatistic(rInt int) string { + return fmt.Sprintf(` resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar6" + alarm_name = "terraform-test-foobar%d" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -183,5 +323,5 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { dimensions { InstanceId = "i-abc123" } +}`, rInt) } -`) diff --git a/builtin/providers/aws/resource_aws_dms_endpoint.go b/builtin/providers/aws/resource_aws_dms_endpoint.go index 07cd7a272..586ed9f7c 100644 --- a/builtin/providers/aws/resource_aws_dms_endpoint.go +++ b/builtin/providers/aws/resource_aws_dms_endpoint.go @@ -6,7 +6,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/private/waiter" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" @@ -168,6 +167,7 @@ func resourceAwsDmsEndpointRead(d *schema.ResourceData, meta interface{}) error }) if err != nil { if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { + log.Printf("[DEBUG] DMS Replication Endpoint %q Not Found", d.Id()) d.SetId("") return nil } @@ -283,11 +283,6 @@ func resourceAwsDmsEndpointDelete(d *schema.ResourceData, meta interface{}) erro return err } - waitErr := waitForEndpointDelete(conn, d.Get("endpoint_id").(string), 30, 20) - if waitErr != nil { - return waitErr - } - return nil } @@ -310,36 +305,3 @@ func resourceAwsDmsEndpointSetState(d *schema.ResourceData, endpoint *dms.Endpoi return nil } - -func waitForEndpointDelete(client *dms.DatabaseMigrationService, endpointId string, delay int, maxAttempts int) error { - input := &dms.DescribeEndpointsInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("endpoint-id"), - Values: []*string{aws.String(endpointId)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeEndpoints", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(Endpoints[]) > `0`", - Expected: false, - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() -} diff --git a/builtin/providers/aws/resource_aws_dms_endpoint_test.go b/builtin/providers/aws/resource_aws_dms_endpoint_test.go index 6f8662283..59c3d87c7 100644 --- a/builtin/providers/aws/resource_aws_dms_endpoint_test.go +++ b/builtin/providers/aws/resource_aws_dms_endpoint_test.go @@ -8,7 +8,6 @@ import ( dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/terraform" ) @@ -67,11 +66,6 @@ func dmsEndpointDestroy(s *terraform.State) error { } func checkDmsEndpointExists(n string) resource.TestCheckFunc { - providers := []*schema.Provider{testAccProvider} - return checkDmsEndpointExistsWithProviders(n, &providers) -} - -func checkDmsEndpointExistsWithProviders(n string, providers *[]*schema.Provider) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -81,29 +75,26 @@ func checkDmsEndpointExistsWithProviders(n string, providers *[]*schema.Provider if rs.Primary.ID == "" { return fmt.Errorf("No ID is set") } - for _, provider := range *providers { - // Ignore if Meta is empty, this can happen for validation providers - if provider.Meta() == nil { - continue - } - conn := provider.Meta().(*AWSClient).dmsconn - _, err := conn.DescribeEndpoints(&dms.DescribeEndpointsInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("endpoint-id"), - Values: []*string{aws.String(rs.Primary.ID)}, - }, + conn := testAccProvider.Meta().(*AWSClient).dmsconn + resp, err := conn.DescribeEndpoints(&dms.DescribeEndpointsInput{ + Filters: []*dms.Filter{ + { + Name: aws.String("endpoint-id"), + Values: []*string{aws.String(rs.Primary.ID)}, }, - }) + }, + }) - if err != nil { - return fmt.Errorf("DMS endpoint error: %v", err) - } - return nil + if err != nil { + return fmt.Errorf("DMS endpoint error: %v", err) } - return fmt.Errorf("DMS endpoint not found") + if resp.Endpoints == nil { + return fmt.Errorf("DMS endpoint not found") + } + + return nil } } diff --git a/builtin/providers/aws/resource_aws_dms_replication_instance.go b/builtin/providers/aws/resource_aws_dms_replication_instance.go index 63552d28e..2b6948936 100644 --- a/builtin/providers/aws/resource_aws_dms_replication_instance.go +++ b/builtin/providers/aws/resource_aws_dms_replication_instance.go @@ -3,11 +3,12 @@ package aws import ( "fmt" "log" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/private/waiter" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" + "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" ) @@ -174,12 +175,23 @@ func resourceAwsDmsReplicationInstanceCreate(d *schema.ResourceData, meta interf return err } - err = waitForInstanceCreated(conn, d.Get("replication_instance_id").(string), 30, 20) + d.SetId(d.Get("replication_instance_id").(string)) + + stateConf := &resource.StateChangeConf{ + Pending: []string{"creating"}, + Target: []string{"available"}, + Refresh: resourceAwsDmsReplicationInstanceStateRefreshFunc(d, meta), + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, // Wait 30 secs before starting + } + + // Wait, catching any errors + _, err = stateConf.WaitForState() if err != nil { return err } - d.SetId(d.Get("replication_instance_id").(string)) return resourceAwsDmsReplicationInstanceRead(d, meta) } @@ -196,6 +208,7 @@ func resourceAwsDmsReplicationInstanceRead(d *schema.ResourceData, meta interfac }) if err != nil { if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { + log.Printf("[DEBUG] DMS Replication Instance %q Not Found", d.Id()) d.SetId("") return nil } @@ -287,6 +300,21 @@ func resourceAwsDmsReplicationInstanceUpdate(d *schema.ResourceData, meta interf return err } + stateConf := &resource.StateChangeConf{ + Pending: []string{"modifying"}, + Target: []string{"available"}, + Refresh: resourceAwsDmsReplicationInstanceStateRefreshFunc(d, meta), + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, // Wait 30 secs before starting + } + + // Wait, catching any errors + _, err = stateConf.WaitForState() + if err != nil { + return err + } + return resourceAwsDmsReplicationInstanceRead(d, meta) } @@ -307,9 +335,19 @@ func resourceAwsDmsReplicationInstanceDelete(d *schema.ResourceData, meta interf return err } - waitErr := waitForInstanceDeleted(conn, d.Get("replication_instance_id").(string), 30, 20) - if waitErr != nil { - return waitErr + stateConf := &resource.StateChangeConf{ + Pending: []string{"deleting"}, + Target: []string{}, + Refresh: resourceAwsDmsReplicationInstanceStateRefreshFunc(d, meta), + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, // Wait 30 secs before starting + } + + // Wait, catching any errors + _, err = stateConf.WaitForState() + if err != nil { + return err } return nil @@ -355,68 +393,35 @@ func resourceAwsDmsReplicationInstanceSetState(d *schema.ResourceData, instance return nil } -func waitForInstanceCreated(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationInstancesInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-instance-id"), - Values: []*string{aws.String(id)}, +func resourceAwsDmsReplicationInstanceStateRefreshFunc( + d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + conn := meta.(*AWSClient).dmsconn + + v, err := conn.DescribeReplicationInstances(&dms.DescribeReplicationInstancesInput{ + Filters: []*dms.Filter{ + { + Name: aws.String("replication-instance-id"), + Values: []*string{aws.String(d.Id())}, // Must use d.Id() to work with import. + }, }, - }, - } + }) + if err != nil { + if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { + return nil, "", nil + } + log.Printf("Error on retrieving DMS Replication Instance when waiting: %s", err) + return nil, "", err + } - config := waiter.Config{ - Operation: "DescribeReplicationInstances", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationInstances[].ReplicationInstanceStatus", - Expected: "available", - }, - }, - } + if v == nil { + return nil, "", nil + } - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } + if v.ReplicationInstances == nil { + return nil, "", fmt.Errorf("Error on retrieving DMS Replication Instance when waiting for State") + } - return w.Wait() -} - -func waitForInstanceDeleted(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationInstancesInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-instance-id"), - Values: []*string{aws.String(id)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeReplicationInstances", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(ReplicationInstances[]) > `0`", - Expected: false, - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() + return v, *v.ReplicationInstances[0].ReplicationInstanceStatus, nil + } } diff --git a/builtin/providers/aws/resource_aws_dms_replication_instance_test.go b/builtin/providers/aws/resource_aws_dms_replication_instance_test.go index 3b6bb0d0e..0cb8a37d5 100644 --- a/builtin/providers/aws/resource_aws_dms_replication_instance_test.go +++ b/builtin/providers/aws/resource_aws_dms_replication_instance_test.go @@ -8,7 +8,6 @@ import ( dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/terraform" ) @@ -47,11 +46,6 @@ func TestAccAwsDmsReplicationInstanceBasic(t *testing.T) { } func checkDmsReplicationInstanceExists(n string) resource.TestCheckFunc { - providers := []*schema.Provider{testAccProvider} - return checkDmsReplicationInstanceExistsWithProviders(n, &providers) -} - -func checkDmsReplicationInstanceExistsWithProviders(n string, providers *[]*schema.Provider) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -61,29 +55,24 @@ func checkDmsReplicationInstanceExistsWithProviders(n string, providers *[]*sche if rs.Primary.ID == "" { return fmt.Errorf("No ID is set") } - for _, provider := range *providers { - // Ignore if Meta is empty, this can happen for validation providers - if provider.Meta() == nil { - continue - } - - conn := provider.Meta().(*AWSClient).dmsconn - _, err := conn.DescribeReplicationInstances(&dms.DescribeReplicationInstancesInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-instance-id"), - Values: []*string{aws.String(rs.Primary.ID)}, - }, + conn := testAccProvider.Meta().(*AWSClient).dmsconn + resp, err := conn.DescribeReplicationInstances(&dms.DescribeReplicationInstancesInput{ + Filters: []*dms.Filter{ + { + Name: aws.String("replication-instance-id"), + Values: []*string{aws.String(rs.Primary.ID)}, }, - }) + }, + }) - if err != nil { - return fmt.Errorf("DMS replication instance error: %v", err) - } - return nil + if err != nil { + return fmt.Errorf("DMS replication instance error: %v", err) + } + if resp.ReplicationInstances == nil { + return fmt.Errorf("DMS replication instance not found") } - return fmt.Errorf("DMS replication instance not found") + return nil } } @@ -104,22 +93,11 @@ func dmsReplicationInstanceDestroy(s *terraform.State) error { func dmsReplicationInstanceConfig(randId string) string { return fmt.Sprintf(` -resource "aws_iam_role" "dms_iam_role" { - name = "dms-vpc-role" - assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"dms.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}" -} - -resource "aws_iam_role_policy_attachment" "dms_iam_role_policy" { - role = "${aws_iam_role.dms_iam_role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonDMSVPCManagementRole" -} - resource "aws_vpc" "dms_vpc" { cidr_block = "10.1.0.0/16" tags { Name = "tf-test-dms-vpc-%[1]s" } - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_subnet" "dms_subnet_1" { @@ -146,7 +124,6 @@ resource "aws_dms_replication_subnet_group" "dms_replication_subnet_group" { replication_subnet_group_id = "tf-test-dms-replication-subnet-group-%[1]s" replication_subnet_group_description = "terraform test for replication subnet group" subnet_ids = ["${aws_subnet.dms_subnet_1.id}", "${aws_subnet.dms_subnet_2.id}"] - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_dms_replication_instance" "dms_replication_instance" { @@ -168,22 +145,11 @@ resource "aws_dms_replication_instance" "dms_replication_instance" { func dmsReplicationInstanceConfigUpdate(randId string) string { return fmt.Sprintf(` -resource "aws_iam_role" "dms_iam_role" { - name = "dms-vpc-role-%[1]s" - assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"dms.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}" -} - -resource "aws_iam_role_policy_attachment" "dms_iam_role_policy" { - role = "${aws_iam_role.dms_iam_role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonDMSVPCManagementRole" -} - resource "aws_vpc" "dms_vpc" { cidr_block = "10.1.0.0/16" tags { Name = "tf-test-dms-vpc-%[1]s" } - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_subnet" "dms_subnet_1" { @@ -210,7 +176,6 @@ resource "aws_dms_replication_subnet_group" "dms_replication_subnet_group" { replication_subnet_group_id = "tf-test-dms-replication-subnet-group-%[1]s" replication_subnet_group_description = "terraform test for replication subnet group" subnet_ids = ["${aws_subnet.dms_subnet_1.id}", "${aws_subnet.dms_subnet_2.id}"] - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_dms_replication_instance" "dms_replication_instance" { diff --git a/builtin/providers/aws/resource_aws_dms_replication_subnet_group_test.go b/builtin/providers/aws/resource_aws_dms_replication_subnet_group_test.go index a6da50c9c..608382ccc 100644 --- a/builtin/providers/aws/resource_aws_dms_replication_subnet_group_test.go +++ b/builtin/providers/aws/resource_aws_dms_replication_subnet_group_test.go @@ -101,22 +101,11 @@ func dmsReplicationSubnetGroupDestroy(s *terraform.State) error { func dmsReplicationSubnetGroupConfig(randId string) string { return fmt.Sprintf(` -resource "aws_iam_role" "dms_iam_role" { - name = "dms-vpc-role-%[1]s" - assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"dms.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}" -} - -resource "aws_iam_role_policy_attachment" "dms_iam_role_policy" { - role = "${aws_iam_role.dms_iam_role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonDMSVPCManagementRole" -} - resource "aws_vpc" "dms_vpc" { cidr_block = "10.1.0.0/16" tags { Name = "tf-test-dms-vpc-%[1]s" } - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_subnet" "dms_subnet_1" { @@ -164,22 +153,11 @@ resource "aws_dms_replication_subnet_group" "dms_replication_subnet_group" { func dmsReplicationSubnetGroupConfigUpdate(randId string) string { return fmt.Sprintf(` -resource "aws_iam_role" "dms_iam_role" { - name = "dms-vpc-role" - assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"dms.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}" -} - -resource "aws_iam_role_policy_attachment" "dms_iam_role_policy" { - role = "${aws_iam_role.dms_iam_role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonDMSVPCManagementRole" -} - resource "aws_vpc" "dms_vpc" { cidr_block = "10.1.0.0/16" tags { Name = "tf-test-dms-vpc-%[1]s" } - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_subnet" "dms_subnet_1" { diff --git a/builtin/providers/aws/resource_aws_dms_replication_task.go b/builtin/providers/aws/resource_aws_dms_replication_task.go index a9ab72ce4..f137c186c 100644 --- a/builtin/providers/aws/resource_aws_dms_replication_task.go +++ b/builtin/providers/aws/resource_aws_dms_replication_task.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/private/waiter" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" + "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" ) @@ -121,13 +121,23 @@ func resourceAwsDmsReplicationTaskCreate(d *schema.ResourceData, meta interface{ } taskId := d.Get("replication_task_id").(string) + d.SetId(taskId) - err = waitForTaskCreated(conn, taskId, 30, 10) + stateConf := &resource.StateChangeConf{ + Pending: []string{"creating"}, + Target: []string{"ready"}, + Refresh: resourceAwsDmsReplicationTaskStateRefreshFunc(d, meta), + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, // Wait 30 secs before starting + } + + // Wait, catching any errors + _, err = stateConf.WaitForState() if err != nil { return err } - d.SetId(taskId) return resourceAwsDmsReplicationTaskRead(d, meta) } @@ -144,6 +154,7 @@ func resourceAwsDmsReplicationTaskRead(d *schema.ResourceData, meta interface{}) }) if err != nil { if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { + log.Printf("[DEBUG] DMS Replication Task %q Not Found", d.Id()) d.SetId("") return nil } @@ -213,7 +224,17 @@ func resourceAwsDmsReplicationTaskUpdate(d *schema.ResourceData, meta interface{ return err } - err = waitForTaskUpdated(conn, d.Get("replication_task_id").(string), 30, 10) + stateConf := &resource.StateChangeConf{ + Pending: []string{"modifying"}, + Target: []string{"ready"}, + Refresh: resourceAwsDmsReplicationTaskStateRefreshFunc(d, meta), + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, // Wait 30 secs before starting + } + + // Wait, catching any errors + _, err = stateConf.WaitForState() if err != nil { return err } @@ -235,12 +256,27 @@ func resourceAwsDmsReplicationTaskDelete(d *schema.ResourceData, meta interface{ _, err := conn.DeleteReplicationTask(request) if err != nil { + if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { + log.Printf("[DEBUG] DMS Replication Task %q Not Found", d.Id()) + d.SetId("") + return nil + } return err } - waitErr := waitForTaskDeleted(conn, d.Get("replication_task_id").(string), 30, 10) - if waitErr != nil { - return waitErr + stateConf := &resource.StateChangeConf{ + Pending: []string{"deleting"}, + Target: []string{}, + Refresh: resourceAwsDmsReplicationTaskStateRefreshFunc(d, meta), + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, // Wait 30 secs before starting + } + + // Wait, catching any errors + _, err = stateConf.WaitForState() + if err != nil { + return err } return nil @@ -261,119 +297,35 @@ func resourceAwsDmsReplicationTaskSetState(d *schema.ResourceData, task *dms.Rep return nil } -func waitForTaskCreated(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationTasksInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-task-id"), - Values: []*string{aws.String(id)}, - }, - }, - } +func resourceAwsDmsReplicationTaskStateRefreshFunc( + d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + conn := meta.(*AWSClient).dmsconn - config := waiter.Config{ - Operation: "DescribeReplicationTasks", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "retry", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "creating", + v, err := conn.DescribeReplicationTasks(&dms.DescribeReplicationTasksInput{ + Filters: []*dms.Filter{ + { + Name: aws.String("replication-task-id"), + Values: []*string{aws.String(d.Id())}, // Must use d.Id() to work with import. + }, }, - { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "ready", - }, - }, - } + }) + if err != nil { + if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { + return nil, "", nil + } + log.Printf("Error on retrieving DMS Replication Task when waiting: %s", err) + return nil, "", err + } - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } + if v == nil { + return nil, "", nil + } - return w.Wait() -} - -func waitForTaskUpdated(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationTasksInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-task-id"), - Values: []*string{aws.String(id)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeReplicationTasks", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "retry", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "modifying", - }, - { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "ready", - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() -} - -func waitForTaskDeleted(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationTasksInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-task-id"), - Values: []*string{aws.String(id)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeReplicationTasks", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "retry", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "deleting", - }, - { - State: "success", - Matcher: "path", - Argument: "length(ReplicationTasks[]) > `0`", - Expected: false, - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() + if v.ReplicationTasks != nil { + log.Printf("[DEBUG] DMS Replication Task status for instance %s: %s", d.Id(), *v.ReplicationTasks[0].Status) + } + + return v, *v.ReplicationTasks[0].Status, nil + } } diff --git a/builtin/providers/aws/resource_aws_dms_replication_task_test.go b/builtin/providers/aws/resource_aws_dms_replication_task_test.go index 8b20abf86..9105a3109 100644 --- a/builtin/providers/aws/resource_aws_dms_replication_task_test.go +++ b/builtin/providers/aws/resource_aws_dms_replication_task_test.go @@ -8,7 +8,6 @@ import ( dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/terraform" ) @@ -44,11 +43,6 @@ func TestAccAwsDmsReplicationTaskBasic(t *testing.T) { } func checkDmsReplicationTaskExists(n string) resource.TestCheckFunc { - providers := []*schema.Provider{testAccProvider} - return checkDmsReplicationTaskExistsWithProviders(n, &providers) -} - -func checkDmsReplicationTaskExistsWithProviders(n string, providers *[]*schema.Provider) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -58,29 +52,25 @@ func checkDmsReplicationTaskExistsWithProviders(n string, providers *[]*schema.P if rs.Primary.ID == "" { return fmt.Errorf("No ID is set") } - for _, provider := range *providers { - // Ignore if Meta is empty, this can happen for validation providers - if provider.Meta() == nil { - continue - } - conn := provider.Meta().(*AWSClient).dmsconn - _, err := conn.DescribeReplicationTasks(&dms.DescribeReplicationTasksInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-task-id"), - Values: []*string{aws.String(rs.Primary.ID)}, - }, + conn := testAccProvider.Meta().(*AWSClient).dmsconn + resp, err := conn.DescribeReplicationTasks(&dms.DescribeReplicationTasksInput{ + Filters: []*dms.Filter{ + { + Name: aws.String("replication-task-id"), + Values: []*string{aws.String(rs.Primary.ID)}, }, - }) + }, + }) - if err != nil { - return fmt.Errorf("DMS replication subnet group error: %v", err) - } - return nil + if err != nil { + return err } - return fmt.Errorf("DMS replication subnet group not found") + if resp.ReplicationTasks == nil { + return fmt.Errorf("DMS replication task error: %v", err) + } + return nil } } @@ -90,9 +80,22 @@ func dmsReplicationTaskDestroy(s *terraform.State) error { continue } - err := checkDmsReplicationTaskExists(rs.Primary.ID) - if err == nil { - return fmt.Errorf("Found replication subnet group that was not destroyed: %s", rs.Primary.ID) + conn := testAccProvider.Meta().(*AWSClient).dmsconn + resp, err := conn.DescribeReplicationTasks(&dms.DescribeReplicationTasksInput{ + Filters: []*dms.Filter{ + { + Name: aws.String("replication-task-id"), + Values: []*string{aws.String(rs.Primary.ID)}, + }, + }, + }) + + if err != nil { + return nil + } + + if resp != nil && len(resp.ReplicationTasks) > 0 { + return fmt.Errorf("DMS replication task still exists: %v", err) } } @@ -101,22 +104,11 @@ func dmsReplicationTaskDestroy(s *terraform.State) error { func dmsReplicationTaskConfig(randId string) string { return fmt.Sprintf(` -resource "aws_iam_role" "dms_iam_role" { - name = "dms-vpc-role-%[1]s" - assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"dms.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}" -} - -resource "aws_iam_role_policy_attachment" "dms_iam_role_policy" { - role = "${aws_iam_role.dms_iam_role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonDMSVPCManagementRole" -} - resource "aws_vpc" "dms_vpc" { cidr_block = "10.1.0.0/16" tags { Name = "tf-test-dms-vpc-%[1]s" } - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_subnet" "dms_subnet_1" { @@ -148,7 +140,6 @@ resource "aws_dms_endpoint" "dms_endpoint_source" { port = 3306 username = "tftest" password = "tftest" - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_dms_endpoint" "dms_endpoint_target" { @@ -160,14 +151,12 @@ resource "aws_dms_endpoint" "dms_endpoint_target" { port = 3306 username = "tftest" password = "tftest" - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_dms_replication_subnet_group" "dms_replication_subnet_group" { replication_subnet_group_id = "tf-test-dms-replication-subnet-group-%[1]s" replication_subnet_group_description = "terraform test for replication subnet group" subnet_ids = ["${aws_subnet.dms_subnet_1.id}", "${aws_subnet.dms_subnet_2.id}"] - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_dms_replication_instance" "dms_replication_instance" { @@ -199,22 +188,11 @@ resource "aws_dms_replication_task" "dms_replication_task" { func dmsReplicationTaskConfigUpdate(randId string) string { return fmt.Sprintf(` -resource "aws_iam_role" "dms_iam_role" { - name = "dms-vpc-role" - assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"dms.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}" -} - -resource "aws_iam_role_policy_attachment" "dms_iam_role_policy" { - role = "${aws_iam_role.dms_iam_role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonDMSVPCManagementRole" -} - resource "aws_vpc" "dms_vpc" { cidr_block = "10.1.0.0/16" tags { Name = "tf-test-dms-vpc-%[1]s" } - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_subnet" "dms_subnet_1" { @@ -246,7 +224,6 @@ resource "aws_dms_endpoint" "dms_endpoint_source" { port = 3306 username = "tftest" password = "tftest" - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_dms_endpoint" "dms_endpoint_target" { @@ -258,14 +235,12 @@ resource "aws_dms_endpoint" "dms_endpoint_target" { port = 3306 username = "tftest" password = "tftest" - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_dms_replication_subnet_group" "dms_replication_subnet_group" { replication_subnet_group_id = "tf-test-dms-replication-subnet-group-%[1]s" replication_subnet_group_description = "terraform test for replication subnet group" subnet_ids = ["${aws_subnet.dms_subnet_1.id}", "${aws_subnet.dms_subnet_2.id}"] - depends_on = ["aws_iam_role_policy_attachment.dms_iam_role_policy"] } resource "aws_dms_replication_instance" "dms_replication_instance" { diff --git a/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go b/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go index 382813f10..fa1e2562b 100644 --- a/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go +++ b/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go @@ -125,7 +125,7 @@ func resourceAwsElasticBeanstalkEnvironment() *schema.Resource { "wait_for_ready_timeout": &schema.Schema{ Type: schema.TypeString, Optional: true, - Default: "10m", + Default: "20m", ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { value := v.(string) duration, err := time.ParseDuration(value) diff --git a/builtin/providers/aws/resource_aws_elasticache_parameter_group_test.go b/builtin/providers/aws/resource_aws_elasticache_parameter_group_test.go index 2bc81c385..201d6d524 100644 --- a/builtin/providers/aws/resource_aws_elasticache_parameter_group_test.go +++ b/builtin/providers/aws/resource_aws_elasticache_parameter_group_test.go @@ -7,12 +7,14 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/elasticache" + "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) func TestAccAWSElasticacheParameterGroup_basic(t *testing.T) { var v elasticache.CacheParameterGroup + rName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -20,12 +22,12 @@ func TestAccAWSElasticacheParameterGroup_basic(t *testing.T) { CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccAWSElasticacheParameterGroupConfig, + Config: testAccAWSElasticacheParameterGroupConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheParameterGroupExists("aws_elasticache_parameter_group.bar", &v), - testAccCheckAWSElasticacheParameterGroupAttributes(&v), + testAccCheckAWSElasticacheParameterGroupAttributes(&v, rName), resource.TestCheckResourceAttr( - "aws_elasticache_parameter_group.bar", "name", "parameter-group-test-terraform"), + "aws_elasticache_parameter_group.bar", "name", rName), resource.TestCheckResourceAttr( "aws_elasticache_parameter_group.bar", "family", "redis2.8"), resource.TestCheckResourceAttr( @@ -37,12 +39,12 @@ func TestAccAWSElasticacheParameterGroup_basic(t *testing.T) { ), }, resource.TestStep{ - Config: testAccAWSElasticacheParameterGroupAddParametersConfig, + Config: testAccAWSElasticacheParameterGroupAddParametersConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheParameterGroupExists("aws_elasticache_parameter_group.bar", &v), - testAccCheckAWSElasticacheParameterGroupAttributes(&v), + testAccCheckAWSElasticacheParameterGroupAttributes(&v, rName), resource.TestCheckResourceAttr( - "aws_elasticache_parameter_group.bar", "name", "parameter-group-test-terraform"), + "aws_elasticache_parameter_group.bar", "name", rName), resource.TestCheckResourceAttr( "aws_elasticache_parameter_group.bar", "family", "redis2.8"), resource.TestCheckResourceAttr( @@ -63,6 +65,7 @@ func TestAccAWSElasticacheParameterGroup_basic(t *testing.T) { func TestAccAWSElasticacheParameterGroupOnly(t *testing.T) { var v elasticache.CacheParameterGroup + rName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -70,12 +73,12 @@ func TestAccAWSElasticacheParameterGroupOnly(t *testing.T) { CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccAWSElasticacheParameterGroupOnlyConfig, + Config: testAccAWSElasticacheParameterGroupOnlyConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheParameterGroupExists("aws_elasticache_parameter_group.bar", &v), - testAccCheckAWSElasticacheParameterGroupAttributes(&v), + testAccCheckAWSElasticacheParameterGroupAttributes(&v, rName), resource.TestCheckResourceAttr( - "aws_elasticache_parameter_group.bar", "name", "parameter-group-test-terraform"), + "aws_elasticache_parameter_group.bar", "name", rName), resource.TestCheckResourceAttr( "aws_elasticache_parameter_group.bar", "family", "redis2.8"), ), @@ -118,10 +121,10 @@ func testAccCheckAWSElasticacheParameterGroupDestroy(s *terraform.State) error { return nil } -func testAccCheckAWSElasticacheParameterGroupAttributes(v *elasticache.CacheParameterGroup) resource.TestCheckFunc { +func testAccCheckAWSElasticacheParameterGroupAttributes(v *elasticache.CacheParameterGroup, rName string) resource.TestCheckFunc { return func(s *terraform.State) error { - if *v.CacheParameterGroupName != "parameter-group-test-terraform" { + if *v.CacheParameterGroupName != rName { return fmt.Errorf("bad name: %#v", v.CacheParameterGroupName) } @@ -167,20 +170,22 @@ func testAccCheckAWSElasticacheParameterGroupExists(n string, v *elasticache.Cac } } -const testAccAWSElasticacheParameterGroupConfig = ` +func testAccAWSElasticacheParameterGroupConfig(rName string) string { + return fmt.Sprintf(` resource "aws_elasticache_parameter_group" "bar" { - name = "parameter-group-test-terraform" + name = "%s" family = "redis2.8" parameter { name = "appendonly" value = "yes" } +}`, rName) } -` -const testAccAWSElasticacheParameterGroupAddParametersConfig = ` +func testAccAWSElasticacheParameterGroupAddParametersConfig(rName string) string { + return fmt.Sprintf(` resource "aws_elasticache_parameter_group" "bar" { - name = "parameter-group-test-terraform" + name = "%s" family = "redis2.8" description = "Test parameter group for terraform" parameter { @@ -191,13 +196,14 @@ resource "aws_elasticache_parameter_group" "bar" { name = "appendfsync" value = "always" } +}`, rName) } -` -const testAccAWSElasticacheParameterGroupOnlyConfig = ` +func testAccAWSElasticacheParameterGroupOnlyConfig(rName string) string { + return fmt.Sprintf(` resource "aws_elasticache_parameter_group" "bar" { - name = "parameter-group-test-terraform" + name = "%s" family = "redis2.8" description = "Test parameter group for terraform" +}`, rName) } -` diff --git a/builtin/providers/aws/resource_aws_elasticsearch_domain_test.go b/builtin/providers/aws/resource_aws_elasticsearch_domain_test.go index e5bf282de..0424ba604 100644 --- a/builtin/providers/aws/resource_aws_elasticsearch_domain_test.go +++ b/builtin/providers/aws/resource_aws_elasticsearch_domain_test.go @@ -228,10 +228,6 @@ func testAccESDomainConfig_complex(randInt int) string { resource "aws_elasticsearch_domain" "example" { domain_name = "tf-test-%d" - cluster_config { - instance_type = "r3.large.elasticsearch" - } - advanced_options { "indices.fielddata.cache.size" = 80 } @@ -243,6 +239,7 @@ resource "aws_elasticsearch_domain" "example" { cluster_config { instance_count = 2 zone_awareness_enabled = true + instance_type = "r3.large.elasticsearch" } snapshot_options { diff --git a/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream_test.go b/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream_test.go index 040040e67..d971da2c9 100644 --- a/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream_test.go +++ b/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream_test.go @@ -487,6 +487,7 @@ resource "aws_redshift_cluster" "test_cluster" { master_password = "T3stPass" node_type = "dc1.large" cluster_type = "single-node" + skip_final_snapshot = true }` var testAccKinesisFirehoseDeliveryStreamConfig_RedshiftBasic = testAccKinesisFirehoseDeliveryStreamBaseRedshiftConfig + ` diff --git a/builtin/providers/aws/resource_aws_kms_key.go b/builtin/providers/aws/resource_aws_kms_key.go index 4c8343062..2fa8e3287 100644 --- a/builtin/providers/aws/resource_aws_kms_key.go +++ b/builtin/providers/aws/resource_aws_kms_key.go @@ -6,6 +6,7 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/kms" "github.com/hashicorp/errwrap" "github.com/hashicorp/terraform/helper/resource" @@ -18,6 +19,7 @@ func resourceAwsKmsKey() *schema.Resource { Read: resourceAwsKmsKeyRead, Update: resourceAwsKmsKeyUpdate, Delete: resourceAwsKmsKeyDelete, + Exists: resourceAwsKmsKeyExists, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, @@ -368,6 +370,30 @@ func updateKmsKeyRotationStatus(conn *kms.KMS, d *schema.ResourceData) error { return nil } +func resourceAwsKmsKeyExists(d *schema.ResourceData, meta interface{}) (bool, error) { + conn := meta.(*AWSClient).kmsconn + + req := &kms.DescribeKeyInput{ + KeyId: aws.String(d.Id()), + } + resp, err := conn.DescribeKey(req) + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + if awsErr.Code() == "NotFoundException" { + return false, nil + } + } + return false, err + } + metadata := resp.KeyMetadata + + if *metadata.KeyState == "PendingDeletion" { + return false, nil + } + + return true, nil +} + func resourceAwsKmsKeyDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).kmsconn keyId := d.Get("key_id").(string) diff --git a/builtin/providers/aws/resource_aws_kms_key_test.go b/builtin/providers/aws/resource_aws_kms_key_test.go index 86cabe4ed..b184fa30c 100644 --- a/builtin/providers/aws/resource_aws_kms_key_test.go +++ b/builtin/providers/aws/resource_aws_kms_key_test.go @@ -37,6 +37,29 @@ func TestAccAWSKmsKey_basic(t *testing.T) { }) } +func TestAccAWSKmsKey_disappears(t *testing.T) { + var key kms.KeyMetadata + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSKmsKeyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSKmsKey, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSKmsKeyExists("aws_kms_key.foo", &key), + ), + }, + { + Config: testAccAWSKmsKey_other_region, + PlanOnly: true, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func TestAccAWSKmsKey_policy(t *testing.T) { var key kms.KeyMetadata expectedPolicyText := `{"Version":"2012-10-17","Id":"kms-tf-1","Statement":[{"Sid":"Enable IAM User Permissions","Effect":"Allow","Principal":{"AWS":"*"},"Action":"kms:*","Resource":"*"}]}` @@ -238,6 +261,32 @@ resource "aws_kms_key" "foo" { POLICY }`, kmsTimestamp) +var testAccAWSKmsKey_other_region = fmt.Sprintf(` +provider "aws" { + region = "us-east-1" +} +resource "aws_kms_key" "foo" { + description = "Terraform acc test %s" + deletion_window_in_days = 7 + policy = < 1023 { + errors = append(errors, fmt.Errorf( + "The `disk_size_gb` can only be between 1 and 1023")) + } + return +} + +func resourceArmManagedDiskCreate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*ArmClient) + diskClient := client.diskClient + + log.Printf("[INFO] preparing arguments for Azure ARM Managed Disk creation.") + + name := d.Get("name").(string) + location := d.Get("location").(string) + resGroup := d.Get("resource_group_name").(string) + tags := d.Get("tags").(map[string]interface{}) + expandedTags := expandTags(tags) + + createDisk := disk.Model{ + Name: &name, + Location: &location, + Tags: expandedTags, + } + + storageAccountType := d.Get("storage_account_type").(string) + osType := d.Get("os_type").(string) + + createDisk.Properties = &disk.Properties{ + AccountType: disk.StorageAccountTypes(storageAccountType), + OsType: disk.OperatingSystemTypes(osType), + } + + if v := d.Get("disk_size_gb"); v != 0 { + diskSize := int32(v.(int)) + createDisk.Properties.DiskSizeGB = &diskSize + } + createOption := d.Get("create_option").(string) + + creationData := &disk.CreationData{ + CreateOption: disk.CreateOption(createOption), + } + + if strings.EqualFold(createOption, string(disk.Import)) { + if sourceUri := d.Get("source_uri").(string); sourceUri != "" { + creationData.SourceURI = &sourceUri + } else { + return fmt.Errorf("[ERROR] source_uri must be specified when create_option is `%s`", disk.Import) + } + } else if strings.EqualFold(createOption, string(disk.Copy)) { + if sourceResourceId := d.Get("source_resource_id").(string); sourceResourceId != "" { + creationData.SourceResourceID = &sourceResourceId + } else { + return fmt.Errorf("[ERROR] source_resource_id must be specified when create_option is `%s`", disk.Copy) + } + } + + createDisk.CreationData = creationData + + _, diskErr := diskClient.CreateOrUpdate(resGroup, name, createDisk, make(chan struct{})) + if diskErr != nil { + return diskErr + } + + read, err := diskClient.Get(resGroup, name) + if err != nil { + return err + } + if read.ID == nil { + return fmt.Errorf("[ERROR] Cannot read Managed Disk %s (resource group %s) ID", name, resGroup) + } + + d.SetId(*read.ID) + + return resourceArmManagedDiskRead(d, meta) +} + +func resourceArmManagedDiskRead(d *schema.ResourceData, meta interface{}) error { + diskClient := meta.(*ArmClient).diskClient + + id, err := parseAzureResourceID(d.Id()) + if err != nil { + return err + } + resGroup := id.ResourceGroup + name := id.Path["disks"] + + resp, err := diskClient.Get(resGroup, name) + if err != nil { + if resp.StatusCode == http.StatusNotFound { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error making Read request on Azure Managed Disk %s (resource group %s): %s", name, resGroup, err) + } + + d.Set("name", resp.Name) + d.Set("resource_group_name", resGroup) + d.Set("location", resp.Location) + + if resp.Properties != nil { + flattenAzureRmManagedDiskProperties(d, resp.Properties) + } + + if resp.CreationData != nil { + flattenAzureRmManagedDiskCreationData(d, resp.CreationData) + } + + flattenAndSetTags(d, resp.Tags) + + return nil +} + +func resourceArmManagedDiskDelete(d *schema.ResourceData, meta interface{}) error { + diskClient := meta.(*ArmClient).diskClient + + id, err := parseAzureResourceID(d.Id()) + if err != nil { + return err + } + resGroup := id.ResourceGroup + name := id.Path["disks"] + + if _, err = diskClient.Delete(resGroup, name, make(chan struct{})); err != nil { + return err + } + + return nil +} + +func flattenAzureRmManagedDiskProperties(d *schema.ResourceData, properties *disk.Properties) { + d.Set("storage_account_type", string(properties.AccountType)) + if properties.DiskSizeGB != nil { + d.Set("disk_size_gb", *properties.DiskSizeGB) + } + if properties.OsType != "" { + d.Set("os_type", string(properties.OsType)) + } +} + +func flattenAzureRmManagedDiskCreationData(d *schema.ResourceData, creationData *disk.CreationData) { + d.Set("create_option", string(creationData.CreateOption)) + if creationData.SourceURI != nil { + d.Set("source_uri", *creationData.SourceURI) + } +} diff --git a/builtin/providers/azurerm/resource_arm_managed_disk_test.go b/builtin/providers/azurerm/resource_arm_managed_disk_test.go new file mode 100644 index 000000000..b7512e2a7 --- /dev/null +++ b/builtin/providers/azurerm/resource_arm_managed_disk_test.go @@ -0,0 +1,321 @@ +package azurerm + +import ( + "fmt" + "net/http" + "testing" + + "github.com/Azure/azure-sdk-for-go/arm/compute" + "github.com/Azure/azure-sdk-for-go/arm/disk" + "github.com/hashicorp/terraform/helper/acctest" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" +) + +func TestAccAzureRMManagedDisk_empty(t *testing.T) { + var d disk.Model + ri := acctest.RandInt() + config := fmt.Sprintf(testAccAzureRMManagedDisk_empty, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMManagedDiskDestroy, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMManagedDiskExists("azurerm_managed_disk.test", &d, true), + ), + }, + }, + }) +} + +func TestAccAzureRMManagedDisk_import(t *testing.T) { + var d disk.Model + var vm compute.VirtualMachine + ri := acctest.RandInt() + vmConfig := fmt.Sprintf(testAccAzureRMVirtualMachine_basicLinuxMachine, ri, ri, ri, ri, ri, ri, ri) + config := fmt.Sprintf(testAccAzureRMManagedDisk_import, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMManagedDiskDestroy, + Steps: []resource.TestStep{ + { + //need to create a vm and then delete it so we can use the vhd to test import + Config: vmConfig, + Destroy: false, + ExpectNonEmptyPlan: true, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), + testDeleteAzureRMVirtualMachine("azurerm_virtual_machine.test"), + ), + }, + { + Config: config, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMManagedDiskExists("azurerm_managed_disk.test", &d, true), + ), + }, + }, + }) +} + +func TestAccAzureRMManagedDisk_copy(t *testing.T) { + var d disk.Model + ri := acctest.RandInt() + config := fmt.Sprintf(testAccAzureRMManagedDisk_copy, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMManagedDiskDestroy, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMManagedDiskExists("azurerm_managed_disk.test", &d, true), + ), + }, + }, + }) +} + +func TestAccAzureRMManagedDisk_update(t *testing.T) { + var d disk.Model + + ri := acctest.RandInt() + preConfig := fmt.Sprintf(testAccAzureRMManagedDisk_empty, ri, ri) + postConfig := fmt.Sprintf(testAccAzureRMManagedDisk_empty_updated, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMManagedDiskDestroy, + Steps: []resource.TestStep{ + { + Config: preConfig, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMManagedDiskExists("azurerm_managed_disk.test", &d, true), + resource.TestCheckResourceAttr( + "azurerm_managed_disk.test", "tags.%", "2"), + resource.TestCheckResourceAttr( + "azurerm_managed_disk.test", "tags.environment", "acctest"), + resource.TestCheckResourceAttr( + "azurerm_managed_disk.test", "tags.cost-center", "ops"), + resource.TestCheckResourceAttr( + "azurerm_managed_disk.test", "disk_size_gb", "1"), + resource.TestCheckResourceAttr( + "azurerm_managed_disk.test", "storage_account_type", string(disk.StandardLRS)), + ), + }, + { + Config: postConfig, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMManagedDiskExists("azurerm_managed_disk.test", &d, true), + resource.TestCheckResourceAttr( + "azurerm_managed_disk.test", "tags.%", "1"), + resource.TestCheckResourceAttr( + "azurerm_managed_disk.test", "tags.environment", "acctest"), + resource.TestCheckResourceAttr( + "azurerm_managed_disk.test", "disk_size_gb", "2"), + resource.TestCheckResourceAttr( + "azurerm_managed_disk.test", "storage_account_type", string(disk.PremiumLRS)), + ), + }, + }, + }) +} + +func testCheckAzureRMManagedDiskExists(name string, d *disk.Model, shouldExist bool) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + + dName := rs.Primary.Attributes["name"] + resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"] + if !hasResourceGroup { + return fmt.Errorf("Bad: no resource group found in state for disk: %s", dName) + } + + conn := testAccProvider.Meta().(*ArmClient).diskClient + + resp, err := conn.Get(resourceGroup, dName) + if err != nil { + return fmt.Errorf("Bad: Get on diskClient: %s", err) + } + + if resp.StatusCode == http.StatusNotFound && shouldExist { + return fmt.Errorf("Bad: ManagedDisk %q (resource group %q) does not exist", dName, resourceGroup) + } + if resp.StatusCode != http.StatusNotFound && !shouldExist { + return fmt.Errorf("Bad: ManagedDisk %q (resource group %q) still exists", dName, resourceGroup) + } + + *d = resp + + return nil + } +} + +func testCheckAzureRMManagedDiskDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*ArmClient).diskClient + + for _, rs := range s.RootModule().Resources { + if rs.Type != "azurerm_managed_disk" { + continue + } + + name := rs.Primary.Attributes["name"] + resourceGroup := rs.Primary.Attributes["resource_group_name"] + + resp, err := conn.Get(resourceGroup, name) + + if err != nil { + return nil + } + + if resp.StatusCode != http.StatusNotFound { + return fmt.Errorf("Managed Disk still exists: \n%#v", resp.Properties) + } + } + + return nil +} + +func testDeleteAzureRMVirtualMachine(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + + vmName := rs.Primary.Attributes["name"] + resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"] + if !hasResourceGroup { + return fmt.Errorf("Bad: no resource group found in state for virtual machine: %s", vmName) + } + + conn := testAccProvider.Meta().(*ArmClient).vmClient + + _, err := conn.Delete(resourceGroup, vmName, make(chan struct{})) + if err != nil { + return fmt.Errorf("Bad: Delete on vmClient: %s", err) + } + + return nil + } +} + +var testAccAzureRMManagedDisk_empty = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_managed_disk" "test" { + name = "acctestd-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + storage_account_type = "Standard_LRS" + create_option = "Empty" + disk_size_gb = "1" + + tags { + environment = "acctest" + cost-center = "ops" + } +}` + +var testAccAzureRMManagedDisk_import = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_storage_account" "test" { + name = "accsa%d" + resource_group_name = "${azurerm_resource_group.test.name}" + location = "West US 2" + account_type = "Standard_LRS" + + tags { + environment = "staging" + } +} + +resource "azurerm_storage_container" "test" { + name = "vhds" + resource_group_name = "${azurerm_resource_group.test.name}" + storage_account_name = "${azurerm_storage_account.test.name}" + container_access_type = "private" +} + +resource "azurerm_managed_disk" "test" { + name = "acctestd-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + storage_account_type = "Standard_LRS" + create_option = "Import" + source_uri = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/myosdisk1.vhd" + disk_size_gb = "45" + + tags { + environment = "acctest" + } +}` + +var testAccAzureRMManagedDisk_copy = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_managed_disk" "source" { + name = "acctestd1-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + storage_account_type = "Standard_LRS" + create_option = "Empty" + disk_size_gb = "1" + + tags { + environment = "acctest" + cost-center = "ops" + } +} + +resource "azurerm_managed_disk" "test" { + name = "acctestd2-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + storage_account_type = "Standard_LRS" + create_option = "Copy" + source_resource_id = "${azurerm_managed_disk.source.id}" + disk_size_gb = "1" + + tags { + environment = "acctest" + cost-center = "ops" + } +}` + +var testAccAzureRMManagedDisk_empty_updated = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_managed_disk" "test" { + name = "acctestd-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + storage_account_type = "Premium_LRS" + create_option = "Empty" + disk_size_gb = "2" + + tags { + environment = "acctest" + } +}` diff --git a/builtin/providers/azurerm/resource_arm_storage_account.go b/builtin/providers/azurerm/resource_arm_storage_account.go index d47b089f4..721ab8097 100644 --- a/builtin/providers/azurerm/resource_arm_storage_account.go +++ b/builtin/providers/azurerm/resource_arm_storage_account.go @@ -1,7 +1,6 @@ package azurerm import ( - "context" "fmt" "log" "net/http" @@ -188,10 +187,8 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e } // Create - cancelCtx, cancelFunc := context.WithTimeout(client.StopContext, 1*time.Hour) _, createErr := storageClient.Create( - resourceGroupName, storageAccountName, opts, cancelCtx.Done()) - cancelFunc() + resourceGroupName, storageAccountName, opts, make(chan struct{})) // The only way to get the ID back apparently is to read the resource again read, err := storageClient.GetProperties(resourceGroupName, storageAccountName) diff --git a/builtin/providers/azurerm/resource_arm_virtual_machine.go b/builtin/providers/azurerm/resource_arm_virtual_machine.go index 9a1607472..e3fe29808 100644 --- a/builtin/providers/azurerm/resource_arm_virtual_machine.go +++ b/builtin/providers/azurerm/resource_arm_virtual_machine.go @@ -11,6 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/arm/compute" "github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform/helper/validation" riviera "github.com/jen20/riviera/azure" ) @@ -141,10 +142,29 @@ func resourceArmVirtualMachine() *schema.Resource { "vhd_uri": { Type: schema.TypeString, - Required: true, + Optional: true, ForceNew: true, }, + "managed_disk_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + ConflictsWith: []string{"storage_os_disk.vhd_uri"}, + }, + + "managed_disk_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ConflictsWith: []string{"storage_os_disk.vhd_uri"}, + ValidateFunc: validation.StringInSlice([]string{ + string(compute.PremiumLRS), + string(compute.StandardLRS), + }, true), + }, + "image_uri": { Type: schema.TypeString, Optional: true, @@ -189,7 +209,26 @@ func resourceArmVirtualMachine() *schema.Resource { "vhd_uri": { Type: schema.TypeString, - Required: true, + Optional: true, + }, + + "managed_disk_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + ConflictsWith: []string{"storage_data_disk.vhd_uri"}, + }, + + "managed_disk_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ConflictsWith: []string{"storage_data_disk.vhd_uri"}, + ValidateFunc: validation.StringInSlice([]string{ + string(compute.PremiumLRS), + string(compute.StandardLRS), + }, true), }, "create_option": { @@ -204,9 +243,10 @@ func resourceArmVirtualMachine() *schema.Resource { }, "disk_size_gb": { - Type: schema.TypeInt, - Optional: true, - Computed: true, + Type: schema.TypeInt, + Optional: true, + Computed: true, + ValidateFunc: validateDiskSizeGB, }, "lun": { @@ -453,15 +493,6 @@ func validateLicenseType(v interface{}, k string) (ws []string, errors []error) return } -func validateDiskSizeGB(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < 1 || value > 1023 { - errors = append(errors, fmt.Errorf( - "The `disk_size_gb` can only be between 1 and 1023")) - } - return -} - func resourceArmVirtualMachineCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*ArmClient) vmClient := client.vmClient @@ -685,21 +716,29 @@ func resourceArmVirtualMachineDelete(d *schema.ResourceData, meta interface{}) e // delete OS Disk if opted in if deleteOsDisk := d.Get("delete_os_disk_on_termination").(bool); deleteOsDisk { - log.Printf("[INFO] delete_os_disk_on_termination is enabled, deleting") + log.Printf("[INFO] delete_os_disk_on_termination is enabled, deleting disk from %s", name) osDisk, err := expandAzureRmVirtualMachineOsDisk(d) if err != nil { return fmt.Errorf("Error expanding OS Disk: %s", err) } - if err = resourceArmVirtualMachineDeleteVhd(*osDisk.Vhd.URI, meta); err != nil { - return fmt.Errorf("Error deleting OS Disk VHD: %s", err) + if osDisk.Vhd != nil { + if err = resourceArmVirtualMachineDeleteVhd(*osDisk.Vhd.URI, meta); err != nil { + return fmt.Errorf("Error deleting OS Disk VHD: %s", err) + } + } else if osDisk.ManagedDisk != nil { + if err = resourceArmVirtualMachineDeleteManagedDisk(*osDisk.ManagedDisk.ID, meta); err != nil { + return fmt.Errorf("Error deleting OS Managed Disk: %s", err) + } + } else { + return fmt.Errorf("Unable to locate OS managed disk properties from %s", name) } } // delete Data disks if opted in if deleteDataDisks := d.Get("delete_data_disks_on_termination").(bool); deleteDataDisks { - log.Printf("[INFO] delete_data_disks_on_termination is enabled, deleting each data disk") + log.Printf("[INFO] delete_data_disks_on_termination is enabled, deleting each data disk from %s", name) disks, err := expandAzureRmVirtualMachineDataDisk(d) if err != nil { @@ -707,8 +746,16 @@ func resourceArmVirtualMachineDelete(d *schema.ResourceData, meta interface{}) e } for _, disk := range disks { - if err = resourceArmVirtualMachineDeleteVhd(*disk.Vhd.URI, meta); err != nil { - return fmt.Errorf("Error deleting Data Disk VHD: %s", err) + if disk.Vhd != nil { + if err = resourceArmVirtualMachineDeleteVhd(*disk.Vhd.URI, meta); err != nil { + return fmt.Errorf("Error deleting Data Disk VHD: %s", err) + } + } else if disk.ManagedDisk != nil { + if err = resourceArmVirtualMachineDeleteManagedDisk(*disk.ManagedDisk.ID, meta); err != nil { + return fmt.Errorf("Error deleting Data Managed Disk: %s", err) + } + } else { + return fmt.Errorf("Unable to locate data managed disk properties from %s", name) } } } @@ -752,6 +799,24 @@ func resourceArmVirtualMachineDeleteVhd(uri string, meta interface{}) error { return nil } +func resourceArmVirtualMachineDeleteManagedDisk(managedDiskID string, meta interface{}) error { + diskClient := meta.(*ArmClient).diskClient + + id, err := parseAzureResourceID(managedDiskID) + if err != nil { + return err + } + resGroup := id.ResourceGroup + name := id.Path["disks"] + + _, err = diskClient.Delete(resGroup, name, make(chan struct{})) + if err != nil { + return fmt.Errorf("Error deleting Managed Disk (%s %s) %s", name, resGroup, err) + } + + return nil +} + func resourceArmVirtualMachinePlanHash(v interface{}) int { var buf bytes.Buffer m := v.(map[string]interface{}) @@ -784,8 +849,9 @@ func resourceArmVirtualMachineStorageOsDiskHash(v interface{}) int { var buf bytes.Buffer m := v.(map[string]interface{}) buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["vhd_uri"].(string))) - + if m["vhd_uri"] != nil { + buf.WriteString(fmt.Sprintf("%s-", m["vhd_uri"].(string))) + } return hashcode.String(buf.String()) } @@ -883,7 +949,13 @@ func flattenAzureRmVirtualMachineDataDisk(disks *[]compute.DataDisk) interface{} for i, disk := range *disks { l := make(map[string]interface{}) l["name"] = *disk.Name - l["vhd_uri"] = *disk.Vhd.URI + if disk.Vhd != nil { + l["vhd_uri"] = *disk.Vhd.URI + } + if disk.ManagedDisk != nil { + l["managed_disk_type"] = string(disk.ManagedDisk.StorageAccountType) + l["managed_disk_id"] = *disk.ManagedDisk.ID + } l["create_option"] = disk.CreateOption l["caching"] = string(disk.Caching) if disk.DiskSizeGB != nil { @@ -982,7 +1054,13 @@ func flattenAzureRmVirtualMachineOsProfileLinuxConfiguration(config *compute.Lin func flattenAzureRmVirtualMachineOsDisk(disk *compute.OSDisk) []interface{} { result := make(map[string]interface{}) result["name"] = *disk.Name - result["vhd_uri"] = *disk.Vhd.URI + if disk.Vhd != nil { + result["vhd_uri"] = *disk.Vhd.URI + } + if disk.ManagedDisk != nil { + result["managed_disk_type"] = string(disk.ManagedDisk.StorageAccountType) + result["managed_disk_id"] = *disk.ManagedDisk.ID + } result["create_option"] = disk.CreateOption result["caching"] = disk.Caching if disk.DiskSizeGB != nil { @@ -1157,22 +1235,22 @@ func expandAzureRmVirtualMachineOsProfileWindowsConfig(d *schema.ResourceData) ( if v := osProfileConfig["winrm"]; v != nil { winRm := v.([]interface{}) if len(winRm) > 0 { - winRmListners := make([]compute.WinRMListener, 0, len(winRm)) + winRmListeners := make([]compute.WinRMListener, 0, len(winRm)) for _, winRmConfig := range winRm { config := winRmConfig.(map[string]interface{}) protocol := config["protocol"].(string) - winRmListner := compute.WinRMListener{ + winRmListener := compute.WinRMListener{ Protocol: compute.ProtocolTypes(protocol), } if v := config["certificate_url"].(string); v != "" { - winRmListner.CertificateURL = &v + winRmListener.CertificateURL = &v } - winRmListners = append(winRmListners, winRmListner) + winRmListeners = append(winRmListeners, winRmListener) } config.WinRM = &compute.WinRMConfiguration{ - Listeners: &winRmListners, + Listeners: &winRmListeners, } } } @@ -1209,19 +1287,48 @@ func expandAzureRmVirtualMachineDataDisk(d *schema.ResourceData) ([]compute.Data config := disk_config.(map[string]interface{}) name := config["name"].(string) - vhd := config["vhd_uri"].(string) createOption := config["create_option"].(string) + vhdURI := config["vhd_uri"].(string) + managedDiskType := config["managed_disk_type"].(string) + managedDiskID := config["managed_disk_id"].(string) lun := int32(config["lun"].(int)) data_disk := compute.DataDisk{ - Name: &name, - Vhd: &compute.VirtualHardDisk{ - URI: &vhd, - }, + Name: &name, Lun: &lun, CreateOption: compute.DiskCreateOptionTypes(createOption), } + if vhdURI != "" { + data_disk.Vhd = &compute.VirtualHardDisk{ + URI: &vhdURI, + } + } + + managedDisk := &compute.ManagedDiskParameters{} + + if managedDiskType != "" { + managedDisk.StorageAccountType = compute.StorageAccountTypes(managedDiskType) + data_disk.ManagedDisk = managedDisk + } + + if managedDiskID != "" { + managedDisk.ID = &managedDiskID + data_disk.ManagedDisk = managedDisk + } + + //BEGIN: code to be removed after GH-13016 is merged + if vhdURI != "" && managedDiskID != "" { + return nil, fmt.Errorf("[ERROR] Conflict between `vhd_uri` and `managed_disk_id` (only one or the other can be used)") + } + if vhdURI != "" && managedDiskType != "" { + return nil, fmt.Errorf("[ERROR] Conflict between `vhd_uri` and `managed_disk_type` (only one or the other can be used)") + } + //END: code to be removed after GH-13016 is merged + if managedDiskID == "" && strings.EqualFold(string(data_disk.CreateOption), string(compute.Attach)) { + return nil, fmt.Errorf("[ERROR] Must specify which disk to attach") + } + if v := config["caching"].(string); v != "" { data_disk.Caching = compute.CachingTypes(v) } @@ -1303,28 +1410,57 @@ func expandAzureRmVirtualMachineNetworkProfile(d *schema.ResourceData) compute.N func expandAzureRmVirtualMachineOsDisk(d *schema.ResourceData) (*compute.OSDisk, error) { disks := d.Get("storage_os_disk").(*schema.Set).List() - disk := disks[0].(map[string]interface{}) + config := disks[0].(map[string]interface{}) - name := disk["name"].(string) - vhdURI := disk["vhd_uri"].(string) - imageURI := disk["image_uri"].(string) - createOption := disk["create_option"].(string) + name := config["name"].(string) + imageURI := config["image_uri"].(string) + createOption := config["create_option"].(string) + vhdURI := config["vhd_uri"].(string) + managedDiskType := config["managed_disk_type"].(string) + managedDiskID := config["managed_disk_id"].(string) osDisk := &compute.OSDisk{ - Name: &name, - Vhd: &compute.VirtualHardDisk{ - URI: &vhdURI, - }, + Name: &name, CreateOption: compute.DiskCreateOptionTypes(createOption), } - if v := disk["image_uri"].(string); v != "" { + if vhdURI != "" { + osDisk.Vhd = &compute.VirtualHardDisk{ + URI: &vhdURI, + } + } + + managedDisk := &compute.ManagedDiskParameters{} + + if managedDiskType != "" { + managedDisk.StorageAccountType = compute.StorageAccountTypes(managedDiskType) + osDisk.ManagedDisk = managedDisk + } + + if managedDiskID != "" { + managedDisk.ID = &managedDiskID + osDisk.ManagedDisk = managedDisk + } + + //BEGIN: code to be removed after GH-13016 is merged + if vhdURI != "" && managedDiskID != "" { + return nil, fmt.Errorf("[ERROR] Conflict between `vhd_uri` and `managed_disk_id` (only one or the other can be used)") + } + if vhdURI != "" && managedDiskType != "" { + return nil, fmt.Errorf("[ERROR] Conflict between `vhd_uri` and `managed_disk_type` (only one or the other can be used)") + } + //END: code to be removed after GH-13016 is merged + if managedDiskID == "" && strings.EqualFold(string(osDisk.CreateOption), string(compute.Attach)) { + return nil, fmt.Errorf("[ERROR] Must specify which disk to attach") + } + + if v := config["image_uri"].(string); v != "" { osDisk.Image = &compute.VirtualHardDisk{ URI: &imageURI, } } - if v := disk["os_type"].(string); v != "" { + if v := config["os_type"].(string); v != "" { if v == "linux" { osDisk.OsType = compute.Linux } else if v == "windows" { @@ -1334,11 +1470,11 @@ func expandAzureRmVirtualMachineOsDisk(d *schema.ResourceData) (*compute.OSDisk, } } - if v := disk["caching"].(string); v != "" { + if v := config["caching"].(string); v != "" { osDisk.Caching = compute.CachingTypes(v) } - if v := disk["disk_size_gb"].(int); v != 0 { + if v := config["disk_size_gb"].(int); v != 0 { diskSize := int32(v) osDisk.DiskSizeGB = &diskSize } diff --git a/builtin/providers/azurerm/resource_arm_virtual_machine_test.go b/builtin/providers/azurerm/resource_arm_virtual_machine_test.go index b3a42728a..71552b8cf 100644 --- a/builtin/providers/azurerm/resource_arm_virtual_machine_test.go +++ b/builtin/providers/azurerm/resource_arm_virtual_machine_test.go @@ -7,9 +7,11 @@ import ( "testing" "github.com/Azure/azure-sdk-for-go/arm/compute" + "github.com/Azure/azure-sdk-for-go/arm/disk" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" + "regexp" ) func TestAccAzureRMVirtualMachine_basicLinuxMachine(t *testing.T) { @@ -31,6 +33,63 @@ func TestAccAzureRMVirtualMachine_basicLinuxMachine(t *testing.T) { }) } +func TestAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_explicit(t *testing.T) { + var vm compute.VirtualMachine + ri := acctest.RandInt() + config := fmt.Sprintf(testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_explicit, ri, ri, ri, ri, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMVirtualMachineDestroy, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), + ), + }, + }, + }) +} + +func TestAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_implicit(t *testing.T) { + var vm compute.VirtualMachine + ri := acctest.RandInt() + config := fmt.Sprintf(testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_implicit, ri, ri, ri, ri, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMVirtualMachineDestroy, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), + ), + }, + }, + }) +} + +func TestAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_attach(t *testing.T) { + var vm compute.VirtualMachine + ri := acctest.RandInt() + config := fmt.Sprintf(testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_attach, ri, ri, ri, ri, ri, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMVirtualMachineDestroy, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), + ), + }, + }, + }) +} + func TestAccAzureRMVirtualMachine_basicLinuxMachine_disappears(t *testing.T) { var vm compute.VirtualMachine ri := acctest.RandInt() @@ -44,7 +103,7 @@ func TestAccAzureRMVirtualMachine_basicLinuxMachine_disappears(t *testing.T) { Config: config, Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), - testCheckAzureRMVirtualMachineDisappears("azurerm_virtual_machine.test", &vm), + testCheckAzureRMVirtualMachineDisappears("azurerm_virtual_machine.test"), ), ExpectNonEmptyPlan: true, }, @@ -72,6 +131,46 @@ func TestAccAzureRMVirtualMachine_withDataDisk(t *testing.T) { }) } +func TestAccAzureRMVirtualMachine_withDataDisk_managedDisk_explicit(t *testing.T) { + var vm compute.VirtualMachine + + ri := acctest.RandInt() + config := fmt.Sprintf(testAccAzureRMVirtualMachine_withDataDisk_managedDisk_explicit, ri, ri, ri, ri, ri, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMVirtualMachineDestroy, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), + ), + }, + }, + }) +} + +func TestAccAzureRMVirtualMachine_withDataDisk_managedDisk_implicit(t *testing.T) { + var vm compute.VirtualMachine + + ri := acctest.RandInt() + config := fmt.Sprintf(testAccAzureRMVirtualMachine_withDataDisk_managedDisk_implicit, ri, ri, ri, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMVirtualMachineDestroy, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), + ), + }, + }, + }) +} + func TestAccAzureRMVirtualMachine_tags(t *testing.T) { var vm compute.VirtualMachine @@ -128,7 +227,7 @@ func TestAccAzureRMVirtualMachine_updateMachineSize(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), resource.TestCheckResourceAttr( - "azurerm_virtual_machine.test", "vm_size", "Standard_A0"), + "azurerm_virtual_machine.test", "vm_size", "Standard_D1_v2"), ), }, { @@ -136,7 +235,7 @@ func TestAccAzureRMVirtualMachine_updateMachineSize(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), resource.TestCheckResourceAttr( - "azurerm_virtual_machine.test", "vm_size", "Standard_A1"), + "azurerm_virtual_machine.test", "vm_size", "Standard_D2_v2"), ), }, }, @@ -238,8 +337,40 @@ func TestAccAzureRMVirtualMachine_deleteVHDOptOut(t *testing.T) { { Config: postConfig, Check: resource.ComposeTestCheckFunc( - testCheckAzureRMVirtualMachineVHDExistance("myosdisk1.vhd", true), - testCheckAzureRMVirtualMachineVHDExistance("mydatadisk1.vhd", true), + testCheckAzureRMVirtualMachineVHDExistence("myosdisk1.vhd", true), + testCheckAzureRMVirtualMachineVHDExistence("mydatadisk1.vhd", true), + ), + }, + }, + }) +} + +func TestAccAzureRMVirtualMachine_deleteManagedDiskOptOut(t *testing.T) { + var vm compute.VirtualMachine + var osd string + var dtd string + ri := acctest.RandInt() + preConfig := fmt.Sprintf(testAccAzureRMVirtualMachine_withDataDisk_managedDisk_implicit, ri, ri, ri, ri, ri, ri) + postConfig := fmt.Sprintf(testAccAzureRMVirtualMachine_basicLinuxMachineDeleteVM_managedDisk, ri, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMVirtualMachineDestroy, + Steps: []resource.TestStep{ + { + Destroy: false, + Config: preConfig, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), + testLookupAzureRMVirtualMachineManagedDiskID(&vm, "myosdisk1", &osd), + testLookupAzureRMVirtualMachineManagedDiskID(&vm, "mydatadisk1", &dtd), + ), + }, + { + Config: postConfig, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineManagedDiskExists(&osd, true), + testCheckAzureRMVirtualMachineManagedDiskExists(&dtd, true), ), }, }, @@ -265,8 +396,40 @@ func TestAccAzureRMVirtualMachine_deleteVHDOptIn(t *testing.T) { { Config: postConfig, Check: resource.ComposeTestCheckFunc( - testCheckAzureRMVirtualMachineVHDExistance("myosdisk1.vhd", false), - testCheckAzureRMVirtualMachineVHDExistance("mydatadisk1.vhd", false), + testCheckAzureRMVirtualMachineVHDExistence("myosdisk1.vhd", false), + testCheckAzureRMVirtualMachineVHDExistence("mydatadisk1.vhd", false), + ), + }, + }, + }) +} + +func TestAccAzureRMVirtualMachine_deleteManagedDiskOptIn(t *testing.T) { + var vm compute.VirtualMachine + var osd string + var dtd string + ri := acctest.RandInt() + preConfig := fmt.Sprintf(testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_DestroyDisksBefore, ri, ri, ri, ri, ri, ri) + postConfig := fmt.Sprintf(testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_DestroyDisksAfter, ri, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMVirtualMachineDestroy, + Steps: []resource.TestStep{ + { + Destroy: false, + Config: preConfig, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &vm), + testLookupAzureRMVirtualMachineManagedDiskID(&vm, "myosdisk1", &osd), + testLookupAzureRMVirtualMachineManagedDiskID(&vm, "mydatadisk1", &dtd), + ), + }, + { + Config: postConfig, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualMachineManagedDiskExists(&osd, false), + testCheckAzureRMVirtualMachineManagedDiskExists(&dtd, false), ), }, }, @@ -284,14 +447,14 @@ func TestAccAzureRMVirtualMachine_ChangeComputerName(t *testing.T) { Providers: testAccProviders, CheckDestroy: testCheckAzureRMVirtualMachineDestroy, Steps: []resource.TestStep{ - resource.TestStep{ + { Config: preConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &afterCreate), ), }, - resource.TestStep{ + { Config: postConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &afterUpdate), @@ -303,7 +466,7 @@ func TestAccAzureRMVirtualMachine_ChangeComputerName(t *testing.T) { }) } -func TestAccAzureRMVirtualMachine_ChangeAvailbilitySet(t *testing.T) { +func TestAccAzureRMVirtualMachine_ChangeAvailabilitySet(t *testing.T) { var afterCreate, afterUpdate compute.VirtualMachine ri := acctest.RandInt() @@ -314,14 +477,14 @@ func TestAccAzureRMVirtualMachine_ChangeAvailbilitySet(t *testing.T) { Providers: testAccProviders, CheckDestroy: testCheckAzureRMVirtualMachineDestroy, Steps: []resource.TestStep{ - resource.TestStep{ + { Config: preConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &afterCreate), ), }, - resource.TestStep{ + { Config: postConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &afterUpdate), @@ -344,14 +507,14 @@ func TestAccAzureRMVirtualMachine_changeStorageImageReference(t *testing.T) { Providers: testAccProviders, CheckDestroy: testCheckAzureRMVirtualMachineDestroy, Steps: []resource.TestStep{ - resource.TestStep{ + { Config: preConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &afterCreate), ), }, - resource.TestStep{ + { Config: postConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &afterUpdate), @@ -374,14 +537,14 @@ func TestAccAzureRMVirtualMachine_changeOSDiskVhdUri(t *testing.T) { Providers: testAccProviders, CheckDestroy: testCheckAzureRMVirtualMachineDestroy, Steps: []resource.TestStep{ - resource.TestStep{ + { Config: preConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &afterCreate), ), }, - resource.TestStep{ + { Config: postConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureRMVirtualMachineExists("azurerm_virtual_machine.test", &afterUpdate), @@ -438,6 +601,42 @@ func TestAccAzureRMVirtualMachine_changeSSHKey(t *testing.T) { }) } +func TestAccAzureRMVirtualMachine_osDiskTypeConflict(t *testing.T) { + ri := acctest.RandInt() + config := fmt.Sprintf(testAccAzureRMVirtualMachine_osDiskTypeConflict, ri, ri, ri, ri, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMVirtualMachineDestroy, + Steps: []resource.TestStep{ + { + Config: config, + ExpectError: regexp.MustCompile("Conflict between `vhd_uri`"), + //Use below code instead once GH-13019 has been merged + //ExpectError: regexp.MustCompile("conflicts with storage_os_disk.0.vhd_uri"), + }, + }, + }) +} + +func TestAccAzureRMVirtualMachine_dataDiskTypeConflict(t *testing.T) { + ri := acctest.RandInt() + config := fmt.Sprintf(testAccAzureRMVirtualMachine_dataDiskTypeConflict, ri, ri, ri, ri, ri, ri, ri) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMVirtualMachineDestroy, + Steps: []resource.TestStep{ + { + Config: config, + ExpectError: regexp.MustCompile("Conflict between `vhd_uri`"), + //Use below code instead once GH-13019 has been merged + //ExpectError: regexp.MustCompile("conflicts with storage_data_disk.1.vhd_uri"), + }, + }, + }) +} + func testCheckAzureRMVirtualMachineExists(name string, vm *compute.VirtualMachine) resource.TestCheckFunc { return func(s *terraform.State) error { // Ensure we have enough information in state to look up in API @@ -469,6 +668,23 @@ func testCheckAzureRMVirtualMachineExists(name string, vm *compute.VirtualMachin } } +func testCheckAzureRMVirtualMachineManagedDiskExists(managedDiskID *string, shouldExist bool) resource.TestCheckFunc { + return func(s *terraform.State) error { + d, err := testGetAzureRMVirtualMachineManagedDisk(managedDiskID) + if err != nil { + return fmt.Errorf("Error trying to retrieve Managed Disk %s, %s", *managedDiskID, err) + } + if d.StatusCode == http.StatusNotFound && shouldExist { + return fmt.Errorf("Unable to find Managed Disk %s", *managedDiskID) + } + if d.StatusCode != http.StatusNotFound && !shouldExist { + return fmt.Errorf("Found unexpected Managed Disk %s", *managedDiskID) + } + + return nil + } +} + func testAccCheckVirtualMachineRecreated(t *testing.T, before, after *compute.VirtualMachine) resource.TestCheckFunc { return func(s *terraform.State) error { @@ -504,7 +720,7 @@ func testCheckAzureRMVirtualMachineDestroy(s *terraform.State) error { return nil } -func testCheckAzureRMVirtualMachineVHDExistance(name string, shouldExist bool) resource.TestCheckFunc { +func testCheckAzureRMVirtualMachineVHDExistence(name string, shouldExist bool) resource.TestCheckFunc { return func(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "azurerm_storage_container" { @@ -526,9 +742,9 @@ func testCheckAzureRMVirtualMachineVHDExistance(name string, shouldExist bool) r } if exists && !shouldExist { - return fmt.Errorf("Disk VHD Blob still exists") + return fmt.Errorf("Disk VHD Blob still exists %s %s", containerName, name) } else if !exists && shouldExist { - return fmt.Errorf("Disk VHD Blob should exist") + return fmt.Errorf("Disk VHD Blob should exist %s %s", containerName, name) } } @@ -536,7 +752,7 @@ func testCheckAzureRMVirtualMachineVHDExistance(name string, shouldExist bool) r } } -func testCheckAzureRMVirtualMachineDisappears(name string, vm *compute.VirtualMachine) resource.TestCheckFunc { +func testCheckAzureRMVirtualMachineDisappears(name string) resource.TestCheckFunc { return func(s *terraform.State) error { // Ensure we have enough information in state to look up in API rs, ok := s.RootModule().Resources[name] @@ -599,16 +815,76 @@ func TestAccAzureRMVirtualMachine_primaryNetworkInterfaceId(t *testing.T) { }) } +func testLookupAzureRMVirtualMachineManagedDiskID(vm *compute.VirtualMachine, diskName string, managedDiskID *string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if osd := vm.StorageProfile.OsDisk; osd != nil { + if strings.EqualFold(*osd.Name, diskName) { + if osd.ManagedDisk != nil { + id, err := findAzureRMVirtualMachineManagedDiskID(osd.ManagedDisk) + if err != nil { + return fmt.Errorf("Unable to parse Managed Disk ID for OS Disk %s, %s", diskName, err) + } + *managedDiskID = id + return nil + } + } + } + + for _, dataDisk := range *vm.StorageProfile.DataDisks { + if strings.EqualFold(*dataDisk.Name, diskName) { + if dataDisk.ManagedDisk != nil { + id, err := findAzureRMVirtualMachineManagedDiskID(dataDisk.ManagedDisk) + if err != nil { + return fmt.Errorf("Unable to parse Managed Disk ID for Data Disk %s, %s", diskName, err) + } + *managedDiskID = id + return nil + } + } + } + + return fmt.Errorf("Unable to locate disk %s on vm %s", diskName, *vm.Name) + } +} + +func findAzureRMVirtualMachineManagedDiskID(md *compute.ManagedDiskParameters) (string, error) { + _, err := parseAzureResourceID(*md.ID) + if err != nil { + return "", err + } + return *md.ID, nil +} + +func testGetAzureRMVirtualMachineManagedDisk(managedDiskID *string) (*disk.Model, error) { + armID, err := parseAzureResourceID(*managedDiskID) + if err != nil { + return nil, fmt.Errorf("Unable to parse Managed Disk ID %s, %s", *managedDiskID, err) + } + name := armID.Path["disks"] + resourceGroup := armID.ResourceGroup + conn := testAccProvider.Meta().(*ArmClient).diskClient + d, err := conn.Get(resourceGroup, name) + //check status first since sdk client returns error if not 200 + if d.Response.StatusCode == http.StatusNotFound { + return &d, nil + } + if err != nil { + return nil, err + } + + return &d, nil +} + var testAccAzureRMVirtualMachine_basicLinuxMachine = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -621,7 +897,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -634,7 +910,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -651,10 +927,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "Canonical" @@ -672,7 +948,236 @@ resource "azurerm_virtual_machine" "test" { } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" + admin_username = "testadmin" + admin_password = "Password1234!" + } + + os_profile_linux_config { + disable_password_authentication = false + } + + tags { + environment = "Production" + cost-center = "Ops" + } +} +` + +var testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_explicit = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} + +resource "azurerm_virtual_machine" "test" { + name = "acctvm-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + network_interface_ids = ["${azurerm_network_interface.test.id}"] + vm_size = "Standard_D1_v2" + + storage_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "14.04.2-LTS" + version = "latest" + } + + storage_os_disk { + name = "osd-%d" + caching = "ReadWrite" + create_option = "FromImage" + disk_size_gb = "10" + managed_disk_type = "Standard_LRS" + } + + os_profile { + computer_name = "hn%d" + admin_username = "testadmin" + admin_password = "Password1234!" + } + + os_profile_linux_config { + disable_password_authentication = false + } + + tags { + environment = "Production" + cost-center = "Ops" + } +} +` + +var testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_implicit = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} + +resource "azurerm_virtual_machine" "test" { + name = "acctvm-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + network_interface_ids = ["${azurerm_network_interface.test.id}"] + vm_size = "Standard_D1_v2" + + storage_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "14.04.2-LTS" + version = "latest" + } + + storage_os_disk { + name = "osd-%d" + caching = "ReadWrite" + create_option = "FromImage" + disk_size_gb = "10" + } + + os_profile { + computer_name = "hn%d" + admin_username = "testadmin" + admin_password = "Password1234!" + } + + os_profile_linux_config { + disable_password_authentication = false + } + + tags { + environment = "Production" + cost-center = "Ops" + } +} +` + +var testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_attach = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} + +resource "azurerm_managed_disk" "test" { + name = "acctmd-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + storage_account_type = "Standard_LRS" + create_option = "Empty" + disk_size_gb = "1" +} + +resource "azurerm_virtual_machine" "test" { + name = "acctvm-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + network_interface_ids = ["${azurerm_network_interface.test.id}"] + vm_size = "Standard_D1_v2" + + storage_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "14.04.2-LTS" + version = "latest" + } + + storage_os_disk { + name = "osd-%d" + caching = "ReadWrite" + create_option = "FromImage" + disk_size_gb = "10" + managed_disk_type = "Standard_LRS" + } + + storage_data_disk { + name = "${azurerm_managed_disk.test.name}" + create_option = "Attach" + disk_size_gb = "1" + lun = 0 + managed_disk_id = "${azurerm_managed_disk.test.id}" + } + + os_profile { + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -691,13 +1196,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_machineNameBeforeUpdate = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -710,7 +1215,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -723,7 +1228,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -740,10 +1245,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" delete_os_disk_on_termination = true storage_image_reference { @@ -761,7 +1266,7 @@ resource "azurerm_virtual_machine" "test" { } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -780,18 +1285,18 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_basicLinuxMachineDestroyDisksBefore = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_resource_group" "test-sa" { name = "acctestRG-sa-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -804,7 +1309,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -817,7 +1322,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test-sa.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -834,10 +1339,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "Canonical" @@ -858,7 +1363,7 @@ resource "azurerm_virtual_machine" "test" { storage_data_disk { name = "mydatadisk1" vhd_uri = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/mydatadisk1.vhd" - disk_size_gb = "1023" + disk_size_gb = "1" create_option = "Empty" lun = 0 } @@ -866,7 +1371,87 @@ resource "azurerm_virtual_machine" "test" { delete_data_disks_on_termination = true os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" + admin_username = "testadmin" + admin_password = "Password1234!" + } + + os_profile_linux_config { + disable_password_authentication = false + } + + tags { + environment = "Production" + cost-center = "Ops" + } +} +` + +var testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_DestroyDisksBefore = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} + +resource "azurerm_virtual_machine" "test" { + name = "acctvm-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + network_interface_ids = ["${azurerm_network_interface.test.id}"] + vm_size = "Standard_D1_v2" + + storage_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "14.04.2-LTS" + version = "latest" + } + + storage_os_disk { + name = "myosdisk1" + caching = "ReadWrite" + create_option = "FromImage" + } + + delete_os_disk_on_termination = true + + storage_data_disk { + name = "mydatadisk1" + disk_size_gb = "1" + create_option = "Empty" + lun = 0 + } + + delete_data_disks_on_termination = true + + os_profile { + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -885,18 +1470,18 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_basicLinuxMachineDestroyDisksAfter = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_resource_group" "test-sa" { name = "acctestRG-sa-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -909,7 +1494,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -922,7 +1507,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test-sa.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -938,16 +1523,49 @@ resource "azurerm_storage_container" "test" { } ` +var testAccAzureRMVirtualMachine_basicLinuxMachine_managedDisk_DestroyDisksAfter = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} +` + var testAccAzureRMVirtualMachine_basicLinuxMachineDeleteVM = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -960,7 +1578,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -973,7 +1591,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -989,16 +1607,16 @@ resource "azurerm_storage_container" "test" { } ` -var testAccAzureRMVirtualMachine_withDataDisk = ` +var testAccAzureRMVirtualMachine_basicLinuxMachineDeleteVM_managedDisk = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1011,7 +1629,40 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} +` + +var testAccAzureRMVirtualMachine_withDataDisk = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1024,7 +1675,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1041,10 +1692,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "Canonical" @@ -1063,14 +1714,170 @@ resource "azurerm_virtual_machine" "test" { storage_data_disk { name = "mydatadisk1" vhd_uri = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/mydatadisk1.vhd" - disk_size_gb = "1023" + disk_size_gb = "1" create_option = "Empty" caching = "ReadWrite" lun = 0 } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" + admin_username = "testadmin" + admin_password = "Password1234!" + } + + os_profile_linux_config { + disable_password_authentication = false + } + + tags { + environment = "Production" + cost-center = "Ops" + } +} +` + +var testAccAzureRMVirtualMachine_withDataDisk_managedDisk_explicit = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} + +resource "azurerm_virtual_machine" "test" { + name = "acctvm-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + network_interface_ids = ["${azurerm_network_interface.test.id}"] + vm_size = "Standard_D1_v2" + + storage_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "14.04.2-LTS" + version = "latest" + } + + storage_os_disk { + name = "osd-%d" + caching = "ReadWrite" + create_option = "FromImage" + managed_disk_type = "Standard_LRS" + } + + storage_data_disk { + name = "dtd-%d" + disk_size_gb = "1" + create_option = "Empty" + caching = "ReadWrite" + lun = 0 + managed_disk_type = "Standard_LRS" + } + + os_profile { + computer_name = "hn%d" + admin_username = "testadmin" + admin_password = "Password1234!" + } + + os_profile_linux_config { + disable_password_authentication = false + } + + tags { + environment = "Production" + cost-center = "Ops" + } +} +` + +var testAccAzureRMVirtualMachine_withDataDisk_managedDisk_implicit = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} + +resource "azurerm_virtual_machine" "test" { + name = "acctvm-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + network_interface_ids = ["${azurerm_network_interface.test.id}"] + vm_size = "Standard_D1_v2" + + storage_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "14.04.2-LTS" + version = "latest" + } + + storage_os_disk { + name = "myosdisk1" + caching = "ReadWrite" + create_option = "FromImage" + } + + storage_data_disk { + name = "mydatadisk1" + disk_size_gb = "1" + create_option = "Empty" + caching = "ReadWrite" + lun = 0 + } + + os_profile { + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -1089,13 +1896,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_basicLinuxMachineUpdated = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1108,7 +1915,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1121,7 +1928,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1138,10 +1945,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "Canonical" @@ -1158,7 +1965,7 @@ resource "azurerm_virtual_machine" "test" { } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -1176,13 +1983,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_updatedLinuxMachine = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1195,7 +2002,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1208,7 +2015,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1225,10 +2032,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A1" + vm_size = "Standard_D2_v2" storage_image_reference { publisher = "Canonical" @@ -1245,7 +2052,7 @@ resource "azurerm_virtual_machine" "test" { } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -1259,13 +2066,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_basicWindowsMachine = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1278,7 +2085,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1291,7 +2098,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1308,10 +2115,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "MicrosoftWindowsServer" @@ -1343,13 +2150,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_windowsUnattendedConfig = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1362,7 +2169,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1375,7 +2182,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1392,10 +2199,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "MicrosoftWindowsServer" @@ -1433,13 +2240,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_diagnosticsProfile = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1452,7 +2259,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1465,7 +2272,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1482,10 +2289,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "MicrosoftWindowsServer" @@ -1524,13 +2331,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_winRMConfig = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1543,7 +2350,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1556,7 +2363,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1573,10 +2380,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "MicrosoftWindowsServer" @@ -1609,13 +2416,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_withAvailabilitySet = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1628,7 +2435,7 @@ var testAccAzureRMVirtualMachine_withAvailabilitySet = ` resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1641,7 +2448,7 @@ var testAccAzureRMVirtualMachine_withAvailabilitySet = ` resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1651,7 +2458,7 @@ var testAccAzureRMVirtualMachine_withAvailabilitySet = ` resource "azurerm_availability_set" "test" { name = "availabilityset%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1664,10 +2471,10 @@ var testAccAzureRMVirtualMachine_withAvailabilitySet = ` resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" availability_set_id = "${azurerm_availability_set.test.id}" delete_os_disk_on_termination = true @@ -1686,7 +2493,7 @@ var testAccAzureRMVirtualMachine_withAvailabilitySet = ` } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -1700,13 +2507,13 @@ var testAccAzureRMVirtualMachine_withAvailabilitySet = ` var testAccAzureRMVirtualMachine_updateAvailabilitySet = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1719,7 +2526,7 @@ var testAccAzureRMVirtualMachine_updateAvailabilitySet = ` resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1732,7 +2539,7 @@ var testAccAzureRMVirtualMachine_updateAvailabilitySet = ` resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1742,7 +2549,7 @@ var testAccAzureRMVirtualMachine_updateAvailabilitySet = ` resource "azurerm_availability_set" "test" { name = "updatedAvailabilitySet%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1755,10 +2562,10 @@ var testAccAzureRMVirtualMachine_updateAvailabilitySet = ` resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" availability_set_id = "${azurerm_availability_set.test.id}" delete_os_disk_on_termination = true @@ -1777,7 +2584,7 @@ var testAccAzureRMVirtualMachine_updateAvailabilitySet = ` } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -1791,13 +2598,13 @@ var testAccAzureRMVirtualMachine_updateAvailabilitySet = ` var testAccAzureRMVirtualMachine_updateMachineName = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1810,7 +2617,7 @@ var testAccAzureRMVirtualMachine_updateMachineName = ` resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1823,7 +2630,7 @@ var testAccAzureRMVirtualMachine_updateMachineName = ` resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1840,10 +2647,10 @@ var testAccAzureRMVirtualMachine_updateMachineName = ` resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" delete_os_disk_on_termination = true storage_image_reference { @@ -1875,13 +2682,13 @@ var testAccAzureRMVirtualMachine_updateMachineName = ` var testAccAzureRMVirtualMachine_basicLinuxMachineStorageImageBefore = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1894,7 +2701,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1907,7 +2714,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -1924,10 +2731,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" delete_os_disk_on_termination = true storage_image_reference { @@ -1946,7 +2753,7 @@ resource "azurerm_virtual_machine" "test" { } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -1965,13 +2772,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_basicLinuxMachineStorageImageAfter = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -1984,7 +2791,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -1997,7 +2804,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -2014,10 +2821,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" delete_os_disk_on_termination = true storage_image_reference { @@ -2036,7 +2843,7 @@ resource "azurerm_virtual_machine" "test" { } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -2055,13 +2862,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_basicLinuxMachineWithOSDiskVhdUriChanged = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -2074,7 +2881,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -2087,7 +2894,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -2104,10 +2911,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "Canonical" @@ -2125,7 +2932,7 @@ resource "azurerm_virtual_machine" "test" { } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -2144,13 +2951,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_windowsLicenseType = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -2163,7 +2970,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -2176,7 +2983,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -2193,10 +3000,10 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" license_type = "Windows_Server" storage_image_reference { @@ -2229,13 +3036,13 @@ resource "azurerm_virtual_machine" "test" { var testAccAzureRMVirtualMachine_plan = ` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" - location = "West US" + location = "West US 2" } resource "azurerm_virtual_network" "test" { name = "acctvn-%d" address_space = ["10.0.0.0/16"] - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -2248,7 +3055,7 @@ resource "azurerm_subnet" "test" { resource "azurerm_network_interface" "test" { name = "acctni-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" ip_configuration { @@ -2261,7 +3068,7 @@ resource "azurerm_network_interface" "test" { resource "azurerm_storage_account" "test" { name = "accsa%d" resource_group_name = "${azurerm_resource_group.test.name}" - location = "westus" + location = "West US 2" account_type = "Standard_LRS" tags { @@ -2278,7 +3085,7 @@ resource "azurerm_storage_container" "test" { resource "azurerm_virtual_machine" "test" { name = "acctvm-%d" - location = "West US" + location = "West US 2" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] vm_size = "Standard_DS1_v2" @@ -2299,7 +3106,7 @@ resource "azurerm_virtual_machine" "test" { } os_profile { - computer_name = "hostname%d" + computer_name = "hn%d" admin_username = "testadmin" admin_password = "Password1234!" } @@ -2372,7 +3179,7 @@ resource "azurerm_virtual_machine" "test" { location = "southcentralus" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "Canonical" @@ -2456,7 +3263,7 @@ resource "azurerm_virtual_machine" "test" { location = "southcentralus" resource_group_name = "${azurerm_resource_group.test.name}" network_interface_ids = ["${azurerm_network_interface.test.id}"] - vm_size = "Standard_A0" + vm_size = "Standard_D1_v2" storage_image_reference { publisher = "Canonical" @@ -2484,6 +3291,176 @@ resource "azurerm_virtual_machine" "test" { } } ` +var testAccAzureRMVirtualMachine_osDiskTypeConflict = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} + +resource "azurerm_virtual_machine" "test" { + name = "acctvm-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + network_interface_ids = ["${azurerm_network_interface.test.id}"] + vm_size = "Standard_D1_v2" + + storage_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "14.04.2-LTS" + version = "latest" + } + + storage_os_disk { + name = "osd-%d" + caching = "ReadWrite" + create_option = "FromImage" + disk_size_gb = "10" + managed_disk_type = "Standard_LRS" + vhd_uri = "should_cause_conflict" + } + + storage_data_disk { + name = "mydatadisk1" + caching = "ReadWrite" + create_option = "Empty" + disk_size_gb = "45" + managed_disk_type = "Standard_LRS" + lun = "0" + } + + os_profile { + computer_name = "hn%d" + admin_username = "testadmin" + admin_password = "Password1234!" + } + + os_profile_linux_config { + disable_password_authentication = false + } + + tags { + environment = "Production" + cost-center = "Ops" + } +} +` + +var testAccAzureRMVirtualMachine_dataDiskTypeConflict = ` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "West US 2" +} + +resource "azurerm_virtual_network" "test" { + name = "acctvn-%d" + address_space = ["10.0.0.0/16"] + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctsub-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefix = "10.0.2.0/24" +} + +resource "azurerm_network_interface" "test" { + name = "acctni-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + + ip_configuration { + name = "testconfiguration1" + subnet_id = "${azurerm_subnet.test.id}" + private_ip_address_allocation = "dynamic" + } +} + +resource "azurerm_virtual_machine" "test" { + name = "acctvm-%d" + location = "West US 2" + resource_group_name = "${azurerm_resource_group.test.name}" + network_interface_ids = ["${azurerm_network_interface.test.id}"] + vm_size = "Standard_D1_v2" + + storage_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "14.04.2-LTS" + version = "latest" + } + + storage_os_disk { + name = "osd-%d" + caching = "ReadWrite" + create_option = "FromImage" + disk_size_gb = "10" + managed_disk_type = "Standard_LRS" + } + + storage_data_disk { + name = "mydatadisk1" + caching = "ReadWrite" + create_option = "Empty" + disk_size_gb = "45" + managed_disk_type = "Standard_LRS" + lun = "0" + } + + storage_data_disk { + name = "mydatadisk1" + vhd_uri = "should_cause_conflict" + caching = "ReadWrite" + create_option = "Empty" + disk_size_gb = "45" + managed_disk_type = "Standard_LRS" + lun = "1" + } + + os_profile { + computer_name = "hn%d" + admin_username = "testadmin" + admin_password = "Password1234!" + } + + os_profile_linux_config { + disable_password_authentication = false + } + + tags { + environment = "Production" + cost-center = "Ops" + } +} +` var testAccAzureRMVirtualMachine_primaryNetworkInterfaceId = ` resource "azurerm_resource_group" "test" { diff --git a/builtin/providers/bitbucket/client.go b/builtin/providers/bitbucket/client.go index 02b9ed0db..bd2cebcce 100644 --- a/builtin/providers/bitbucket/client.go +++ b/builtin/providers/bitbucket/client.go @@ -2,64 +2,107 @@ package bitbucket import ( "bytes" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "log" "net/http" ) +// Error represents a error from the bitbucket api. +type Error struct { + APIError struct { + Message string `json:"message,omitempty"` + } `json:"error,omitempty"` + Type string `json:"type,omitempty"` + StatusCode int + Endpoint string +} + +func (e Error) Error() string { + return fmt.Sprintf("API Error: %d %s %s", e.StatusCode, e.Endpoint, e.APIError.Message) +} + +const ( + // BitbucketEndpoint is the fqdn used to talk to bitbucket + BitbucketEndpoint string = "https://api.bitbucket.org/" +) + type BitbucketClient struct { - Username string - Password string + Username string + Password string + HTTPClient *http.Client +} + +func (c *BitbucketClient) Do(method, endpoint string, payload *bytes.Buffer) (*http.Response, error) { + + absoluteendpoint := BitbucketEndpoint + endpoint + log.Printf("[DEBUG] Sending request to %s %s", method, absoluteendpoint) + + var bodyreader io.Reader + + if payload != nil { + log.Printf("[DEBUG] With payload %s", payload.String()) + bodyreader = payload + } + + req, err := http.NewRequest(method, absoluteendpoint, bodyreader) + if err != nil { + return nil, err + } + + req.SetBasicAuth(c.Username, c.Password) + + if payload != nil { + // Can cause bad request when putting default reviews if set. + req.Header.Add("Content-Type", "application/json") + } + + req.Close = true + + resp, err := c.HTTPClient.Do(req) + log.Printf("[DEBUG] Resp: %v Err: %v", resp, err) + if resp.StatusCode >= 400 || resp.StatusCode < 200 { + apiError := Error{ + StatusCode: resp.StatusCode, + Endpoint: endpoint, + } + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + log.Printf("[DEBUG] Resp Body: %s", string(body)) + + err = json.Unmarshal(body, &apiError) + if err != nil { + apiError.APIError.Message = string(body) + } + + return resp, error(apiError) + + } + return resp, err } func (c *BitbucketClient) Get(endpoint string) (*http.Response, error) { - client := &http.Client{} - req, err := http.NewRequest("GET", "https://api.bitbucket.org/"+endpoint, nil) - if err != nil { - return nil, err - } - - req.SetBasicAuth(c.Username, c.Password) - return client.Do(req) - + return c.Do("GET", endpoint, nil) } func (c *BitbucketClient) Post(endpoint string, jsonpayload *bytes.Buffer) (*http.Response, error) { - client := &http.Client{} - req, err := http.NewRequest("POST", "https://api.bitbucket.org/"+endpoint, jsonpayload) - if err != nil { - return nil, err - } - req.SetBasicAuth(c.Username, c.Password) - req.Header.Add("content-type", "application/json") - return client.Do(req) + return c.Do("POST", endpoint, jsonpayload) } func (c *BitbucketClient) Put(endpoint string, jsonpayload *bytes.Buffer) (*http.Response, error) { - client := &http.Client{} - req, err := http.NewRequest("PUT", "https://api.bitbucket.org/"+endpoint, jsonpayload) - if err != nil { - return nil, err - } - req.SetBasicAuth(c.Username, c.Password) - req.Header.Add("content-type", "application/json") - return client.Do(req) + return c.Do("PUT", endpoint, jsonpayload) } func (c *BitbucketClient) PutOnly(endpoint string) (*http.Response, error) { - client := &http.Client{} - req, err := http.NewRequest("PUT", "https://api.bitbucket.org/"+endpoint, nil) - if err != nil { - return nil, err - } - req.SetBasicAuth(c.Username, c.Password) - return client.Do(req) + return c.Do("PUT", endpoint, nil) } func (c *BitbucketClient) Delete(endpoint string) (*http.Response, error) { - client := &http.Client{} - req, err := http.NewRequest("DELETE", "https://api.bitbucket.org/"+endpoint, nil) - if err != nil { - return nil, err - } - req.SetBasicAuth(c.Username, c.Password) - return client.Do(req) + return c.Do("DELETE", endpoint, nil) } diff --git a/builtin/providers/bitbucket/provider.go b/builtin/providers/bitbucket/provider.go index afeb71249..e50f9295f 100644 --- a/builtin/providers/bitbucket/provider.go +++ b/builtin/providers/bitbucket/provider.go @@ -1,6 +1,8 @@ package bitbucket import ( + "net/http" + "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/terraform" ) @@ -30,8 +32,9 @@ func Provider() terraform.ResourceProvider { func providerConfigure(d *schema.ResourceData) (interface{}, error) { client := &BitbucketClient{ - Username: d.Get("username").(string), - Password: d.Get("password").(string), + Username: d.Get("username").(string), + Password: d.Get("password").(string), + HTTPClient: &http.Client{}, } return client, nil diff --git a/builtin/providers/bitbucket/resource_default_reviewers.go b/builtin/providers/bitbucket/resource_default_reviewers.go index 37a0f5883..9fc5d1e0a 100644 --- a/builtin/providers/bitbucket/resource_default_reviewers.go +++ b/builtin/providers/bitbucket/resource_default_reviewers.go @@ -3,6 +3,7 @@ package bitbucket import ( "encoding/json" "fmt" + "github.com/hashicorp/terraform/helper/schema" ) @@ -49,7 +50,7 @@ func resourceDefaultReviewersCreate(d *schema.ResourceData, m interface{}) error client := m.(*BitbucketClient) for _, user := range d.Get("reviewers").(*schema.Set).List() { - reviewer_resp, err := client.PutOnly(fmt.Sprintf("2.0/repositories/%s/%s/default-reviewers/%s", + reviewerResp, err := client.PutOnly(fmt.Sprintf("2.0/repositories/%s/%s/default-reviewers/%s", d.Get("owner").(string), d.Get("repository").(string), user, @@ -59,11 +60,11 @@ func resourceDefaultReviewersCreate(d *schema.ResourceData, m interface{}) error return err } - if reviewer_resp.StatusCode != 200 { - return fmt.Errorf("Failed to create reviewer %s got code %d", user.(string), reviewer_resp.StatusCode) + if reviewerResp.StatusCode != 200 { + return fmt.Errorf("Failed to create reviewer %s got code %d", user.(string), reviewerResp.StatusCode) } - defer reviewer_resp.Body.Close() + defer reviewerResp.Body.Close() } d.SetId(fmt.Sprintf("%s/%s/reviewers", d.Get("owner").(string), d.Get("repository").(string))) @@ -72,26 +73,26 @@ func resourceDefaultReviewersCreate(d *schema.ResourceData, m interface{}) error func resourceDefaultReviewersRead(d *schema.ResourceData, m interface{}) error { client := m.(*BitbucketClient) - reviewers_response, err := client.Get(fmt.Sprintf("2.0/repositories/%s/%s/default-reviewers", + reviewersResponse, err := client.Get(fmt.Sprintf("2.0/repositories/%s/%s/default-reviewers", d.Get("owner").(string), d.Get("repository").(string), )) var reviewers PaginatedReviewers - decoder := json.NewDecoder(reviewers_response.Body) + decoder := json.NewDecoder(reviewersResponse.Body) err = decoder.Decode(&reviewers) if err != nil { return err } - terraform_reviewers := make([]string, 0, len(reviewers.Values)) + terraformReviewers := make([]string, 0, len(reviewers.Values)) for _, reviewer := range reviewers.Values { - terraform_reviewers = append(terraform_reviewers, reviewer.Username) + terraformReviewers = append(terraformReviewers, reviewer.Username) } - d.Set("reviewers", terraform_reviewers) + d.Set("reviewers", terraformReviewers) return nil } diff --git a/builtin/providers/bitbucket/resource_hook.go b/builtin/providers/bitbucket/resource_hook.go index c93862798..745292ad1 100644 --- a/builtin/providers/bitbucket/resource_hook.go +++ b/builtin/providers/bitbucket/resource_hook.go @@ -4,6 +4,10 @@ import ( "bytes" "encoding/json" "fmt" + "io/ioutil" + "log" + "net/url" + "github.com/hashicorp/terraform/helper/schema" ) @@ -81,86 +85,89 @@ func resourceHookCreate(d *schema.ResourceData, m interface{}) error { client := m.(*BitbucketClient) hook := createHook(d) - var jsonbuffer []byte - - jsonpayload := bytes.NewBuffer(jsonbuffer) - enc := json.NewEncoder(jsonpayload) - enc.Encode(hook) - - hook_req, err := client.Post(fmt.Sprintf("2.0/repositories/%s/%s/hooks", - d.Get("owner").(string), - d.Get("repository").(string), - ), jsonpayload) - - decoder := json.NewDecoder(hook_req.Body) - err = decoder.Decode(&hook) + payload, err := json.Marshal(hook) if err != nil { return err } + hook_req, err := client.Post(fmt.Sprintf("2.0/repositories/%s/%s/hooks", + d.Get("owner").(string), + d.Get("repository").(string), + ), bytes.NewBuffer(payload)) + + if err != nil { + return err + } + + body, readerr := ioutil.ReadAll(hook_req.Body) + if readerr != nil { + return readerr + } + + decodeerr := json.Unmarshal(body, &hook) + if decodeerr != nil { + return decodeerr + } + d.SetId(hook.Uuid) - d.Set("uuid", hook.Uuid) return resourceHookRead(d, m) } func resourceHookRead(d *schema.ResourceData, m interface{}) error { client := m.(*BitbucketClient) - hook_req, err := client.Get(fmt.Sprintf("2.0/repositories/%s/%s/hooks/%s", + + hook_req, _ := client.Get(fmt.Sprintf("2.0/repositories/%s/%s/hooks/%s", d.Get("owner").(string), d.Get("repository").(string), - d.Get("uuid").(string), + url.PathEscape(d.Id()), )) - if err != nil { - return err + log.Printf("ID: %s", url.PathEscape(d.Id())) + + if hook_req.StatusCode == 200 { + var hook Hook + + body, readerr := ioutil.ReadAll(hook_req.Body) + if readerr != nil { + return readerr + } + + decodeerr := json.Unmarshal(body, &hook) + if decodeerr != nil { + return decodeerr + } + + d.Set("uuid", hook.Uuid) + d.Set("description", hook.Description) + d.Set("active", hook.Active) + d.Set("url", hook.Url) + + eventsList := make([]string, 0, len(hook.Events)) + + for _, event := range hook.Events { + eventsList = append(eventsList, event) + } + + d.Set("events", eventsList) } - var hook Hook - - decoder := json.NewDecoder(hook_req.Body) - err = decoder.Decode(&hook) - if err != nil { - return err - } - - d.Set("uuid", hook.Uuid) - d.Set("description", hook.Description) - d.Set("active", hook.Active) - d.Set("url", hook.Url) - - eventsList := make([]string, 0, len(hook.Events)) - - for _, event := range hook.Events { - eventsList = append(eventsList, event) - } - - d.Set("events", eventsList) - return nil } func resourceHookUpdate(d *schema.ResourceData, m interface{}) error { client := m.(*BitbucketClient) hook := createHook(d) - - var jsonbuffer []byte - - jsonpayload := bytes.NewBuffer(jsonbuffer) - enc := json.NewEncoder(jsonpayload) - enc.Encode(hook) - - hook_req, err := client.Put(fmt.Sprintf("2.0/repositories/%s/%s/hooks/%s", - d.Get("owner").(string), - d.Get("repository").(string), - d.Get("uuid").(string), - ), jsonpayload) - + payload, err := json.Marshal(hook) if err != nil { return err } - decoder := json.NewDecoder(hook_req.Body) - err = decoder.Decode(&hook) + _, err = client.Put(fmt.Sprintf("2.0/repositories/%s/%s/hooks/%s", + d.Get("owner").(string), + d.Get("repository").(string), + url.PathEscape(d.Id()), + ), bytes.NewBuffer(payload)) + if err != nil { return err } @@ -174,7 +181,7 @@ func resourceHookExists(d *schema.ResourceData, m interface{}) (bool, error) { hook_req, err := client.Get(fmt.Sprintf("2.0/repositories/%s/%s/hooks/%s", d.Get("owner").(string), d.Get("repository").(string), - d.Get("uuid").(string), + url.PathEscape(d.Id()), )) if err != nil { @@ -182,15 +189,14 @@ func resourceHookExists(d *schema.ResourceData, m interface{}) (bool, error) { } if hook_req.StatusCode != 200 { - d.SetId("") - return false, nil + return false, err } return true, nil - } else { - return false, nil } + return false, nil + } func resourceHookDelete(d *schema.ResourceData, m interface{}) error { @@ -198,11 +204,9 @@ func resourceHookDelete(d *schema.ResourceData, m interface{}) error { _, err := client.Delete(fmt.Sprintf("2.0/repositories/%s/%s/hooks/%s", d.Get("owner").(string), d.Get("repository").(string), - d.Get("uuid").(string), + url.PathEscape(d.Id()), )) - if err != nil { - return err - } - return nil + return err + } diff --git a/builtin/providers/bitbucket/resource_hook_test.go b/builtin/providers/bitbucket/resource_hook_test.go index 178ebf27b..59a719b87 100644 --- a/builtin/providers/bitbucket/resource_hook_test.go +++ b/builtin/providers/bitbucket/resource_hook_test.go @@ -2,6 +2,7 @@ package bitbucket import ( "fmt" + "net/url" "os" "testing" @@ -16,7 +17,7 @@ func TestAccBitbucketHook_basic(t *testing.T) { testAccBitbucketHookConfig := fmt.Sprintf(` resource "bitbucket_repository" "test_repo" { owner = "%s" - name = "test-repo" + name = "test-repo-for-webhook-test" } resource "bitbucket_hook" "test_repo_hook" { owner = "%s" @@ -51,10 +52,10 @@ func testAccCheckBitbucketHookDestroy(s *terraform.State) error { return fmt.Errorf("Not found %s", "bitbucket_hook.test_repo_hook") } - response, err := client.Get(fmt.Sprintf("2.0/repositories/%s/%s/hooks/%s", rs.Primary.Attributes["owner"], rs.Primary.Attributes["repository"], rs.Primary.Attributes["uuid"])) + response, err := client.Get(fmt.Sprintf("2.0/repositories/%s/%s/hooks/%s", rs.Primary.Attributes["owner"], rs.Primary.Attributes["repository"], url.PathEscape(rs.Primary.Attributes["uuid"]))) - if err != nil { - return err + if err == nil { + return fmt.Errorf("The resource was found should have errored") } if response.StatusCode != 404 { diff --git a/builtin/providers/bitbucket/resource_repository.go b/builtin/providers/bitbucket/resource_repository.go index 050ddd9b2..f57db3ea8 100644 --- a/builtin/providers/bitbucket/resource_repository.go +++ b/builtin/providers/bitbucket/resource_repository.go @@ -4,8 +4,9 @@ import ( "bytes" "encoding/json" "fmt" + "io/ioutil" + "github.com/hashicorp/terraform/helper/schema" - "log" ) type CloneUrl struct { @@ -131,7 +132,7 @@ func resourceRepositoryUpdate(d *schema.ResourceData, m interface{}) error { enc := json.NewEncoder(jsonpayload) enc.Encode(repository) - repository_response, err := client.Put(fmt.Sprintf("2.0/repositories/%s/%s", + _, err := client.Put(fmt.Sprintf("2.0/repositories/%s/%s", d.Get("owner").(string), d.Get("name").(string), ), jsonpayload) @@ -140,16 +141,6 @@ func resourceRepositoryUpdate(d *schema.ResourceData, m interface{}) error { return err } - if repository_response.StatusCode == 200 { - decoder := json.NewDecoder(repository_response.Body) - err = decoder.Decode(&repository) - if err != nil { - return err - } - } else { - return fmt.Errorf("Failed to put: %d", repository_response.StatusCode) - } - return resourceRepositoryRead(d, m) } @@ -157,29 +148,19 @@ func resourceRepositoryCreate(d *schema.ResourceData, m interface{}) error { client := m.(*BitbucketClient) repo := newRepositoryFromResource(d) - var jsonbuffer []byte + bytedata, err := json.Marshal(repo) - jsonpayload := bytes.NewBuffer(jsonbuffer) - enc := json.NewEncoder(jsonpayload) - enc.Encode(repo) - - log.Printf("Sending %s \n", jsonpayload) - - repo_req, err := client.Post(fmt.Sprintf("2.0/repositories/%s/%s", - d.Get("owner").(string), - d.Get("name").(string), - ), jsonpayload) - - decoder := json.NewDecoder(repo_req.Body) - err = decoder.Decode(&repo) if err != nil { return err } - log.Printf("Received %s \n", repo_req.Body) + _, err = client.Post(fmt.Sprintf("2.0/repositories/%s/%s", + d.Get("owner").(string), + d.Get("name").(string), + ), bytes.NewBuffer(bytedata)) - if repo_req.StatusCode != 200 { - return fmt.Errorf("Failed to create repository got status code %d", repo_req.StatusCode) + if err != nil { + return err } d.SetId(string(fmt.Sprintf("%s/%s", d.Get("owner").(string), d.Get("name").(string)))) @@ -189,39 +170,42 @@ func resourceRepositoryCreate(d *schema.ResourceData, m interface{}) error { func resourceRepositoryRead(d *schema.ResourceData, m interface{}) error { client := m.(*BitbucketClient) - repo_req, err := client.Get(fmt.Sprintf("2.0/repositories/%s/%s", + repo_req, _ := client.Get(fmt.Sprintf("2.0/repositories/%s/%s", d.Get("owner").(string), d.Get("name").(string), )) - if err != nil { - return err - } + if repo_req.StatusCode == 200 { - var repo Repository + var repo Repository - decoder := json.NewDecoder(repo_req.Body) - err = decoder.Decode(&repo) - if err != nil { - return err - } + body, readerr := ioutil.ReadAll(repo_req.Body) + if readerr != nil { + return readerr + } - d.Set("scm", repo.SCM) - d.Set("is_private", repo.IsPrivate) - d.Set("has_wiki", repo.HasWiki) - d.Set("has_issues", repo.HasIssues) - d.Set("name", repo.Name) - d.Set("language", repo.Language) - d.Set("fork_policy", repo.ForkPolicy) - d.Set("website", repo.Website) - d.Set("description", repo.Description) - d.Set("project_key", repo.Project.Key) + decodeerr := json.Unmarshal(body, &repo) + if decodeerr != nil { + return decodeerr + } - for _, clone_url := range repo.Links.Clone { - if clone_url.Name == "https" { - d.Set("clone_https", clone_url.Href) - } else { - d.Set("clone_ssh", clone_url.Href) + d.Set("scm", repo.SCM) + d.Set("is_private", repo.IsPrivate) + d.Set("has_wiki", repo.HasWiki) + d.Set("has_issues", repo.HasIssues) + d.Set("name", repo.Name) + d.Set("language", repo.Language) + d.Set("fork_policy", repo.ForkPolicy) + d.Set("website", repo.Website) + d.Set("description", repo.Description) + d.Set("project_key", repo.Project.Key) + + for _, clone_url := range repo.Links.Clone { + if clone_url.Name == "https" { + d.Set("clone_https", clone_url.Href) + } else { + d.Set("clone_ssh", clone_url.Href) + } } } @@ -230,18 +214,10 @@ func resourceRepositoryRead(d *schema.ResourceData, m interface{}) error { func resourceRepositoryDelete(d *schema.ResourceData, m interface{}) error { client := m.(*BitbucketClient) - delete_response, err := client.Delete(fmt.Sprintf("2.0/repositories/%s/%s", + _, err := client.Delete(fmt.Sprintf("2.0/repositories/%s/%s", d.Get("owner").(string), d.Get("name").(string), )) - if err != nil { - return err - } - - if delete_response.StatusCode != 204 { - return fmt.Errorf("Failed to delete the repository got status code %d", delete_response.StatusCode) - } - - return nil + return err } diff --git a/builtin/providers/bitbucket/resource_repository_test.go b/builtin/providers/bitbucket/resource_repository_test.go index 47d4f4405..1fa47a71f 100644 --- a/builtin/providers/bitbucket/resource_repository_test.go +++ b/builtin/providers/bitbucket/resource_repository_test.go @@ -16,9 +16,9 @@ func TestAccBitbucketRepository_basic(t *testing.T) { testAccBitbucketRepositoryConfig := fmt.Sprintf(` resource "bitbucket_repository" "test_repo" { owner = "%s" - name = "%s" + name = "test-repo-for-repository-test" } - `, testUser, testRepo) + `, testUser) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -42,11 +42,7 @@ func testAccCheckBitbucketRepositoryDestroy(s *terraform.State) error { return fmt.Errorf("Not found %s", "bitbucket_repository.test_repo") } - response, err := client.Get(fmt.Sprintf("2.0/repositories/%s/%s", rs.Primary.Attributes["owner"], rs.Primary.Attributes["name"])) - - if err != nil { - return err - } + response, _ := client.Get(fmt.Sprintf("2.0/repositories/%s/%s", rs.Primary.Attributes["owner"], rs.Primary.Attributes["name"])) if response.StatusCode != 404 { return fmt.Errorf("Repository still exists") diff --git a/builtin/providers/cloudstack/resource_cloudstack_loadbalancer_rule.go b/builtin/providers/cloudstack/resource_cloudstack_loadbalancer_rule.go index 2c3c25334..d5a5ffe92 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_loadbalancer_rule.go +++ b/builtin/providers/cloudstack/resource_cloudstack_loadbalancer_rule.go @@ -58,10 +58,11 @@ func resourceCloudStackLoadBalancerRule() *schema.Resource { }, "member_ids": &schema.Schema{ - Type: schema.TypeList, + Type: schema.TypeSet, Required: true, - ForceNew: true, + ForceNew: false, Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, }, "project": &schema.Schema{ @@ -124,7 +125,7 @@ func resourceCloudStackLoadBalancerRuleCreate(d *schema.ResourceData, meta inter ap := cs.LoadBalancer.NewAssignToLoadBalancerRuleParams(r.Id) var mbs []string - for _, id := range d.Get("member_ids").([]interface{}) { + for _, id := range d.Get("member_ids").(*schema.Set).List() { mbs = append(mbs, id.(string)) } @@ -171,6 +172,18 @@ func resourceCloudStackLoadBalancerRuleRead(d *schema.ResourceData, meta interfa setValueOrID(d, "project", lb.Project, lb.Projectid) + p := cs.LoadBalancer.NewListLoadBalancerRuleInstancesParams(d.Id()) + l, err := cs.LoadBalancer.ListLoadBalancerRuleInstances(p) + if err != nil { + return err + } + + var mbs []string + for _, i := range l.LoadBalancerRuleInstances { + mbs = append(mbs, i.Id) + } + d.Set("member_ids", mbs) + return nil } @@ -215,6 +228,41 @@ func resourceCloudStackLoadBalancerRuleUpdate(d *schema.ResourceData, meta inter "Error updating load balancer rule %s", name) } } + + if d.HasChange("member_ids") { + o, n := d.GetChange("member_ids") + ombs, nmbs := o.(*schema.Set), n.(*schema.Set) + + setToStringList := func(s *schema.Set) []string { + l := make([]string, s.Len()) + for i, v := range s.List() { + l[i] = v.(string) + } + return l + } + + membersToAdd := setToStringList(nmbs.Difference(ombs)) + membersToRemove := setToStringList(ombs.Difference(nmbs)) + + log.Printf("[DEBUG] Members to add: %v, remove: %v", membersToAdd, membersToRemove) + + if len(membersToAdd) > 0 { + p := cs.LoadBalancer.NewAssignToLoadBalancerRuleParams(d.Id()) + p.SetVirtualmachineids(membersToAdd) + if _, err := cs.LoadBalancer.AssignToLoadBalancerRule(p); err != nil { + return err + } + } + + if len(membersToRemove) > 0 { + p := cs.LoadBalancer.NewRemoveFromLoadBalancerRuleParams(d.Id()) + p.SetVirtualmachineids(membersToRemove) + if _, err := cs.LoadBalancer.RemoveFromLoadBalancerRule(p); err != nil { + return err + } + } + } + return resourceCloudStackLoadBalancerRuleRead(d, meta) } diff --git a/builtin/providers/openstack/resource_openstack_compute_volume_attach_v2.go b/builtin/providers/openstack/resource_openstack_compute_volume_attach_v2.go index 1eb8506e6..4fa6cb812 100644 --- a/builtin/providers/openstack/resource_openstack_compute_volume_attach_v2.go +++ b/builtin/providers/openstack/resource_openstack_compute_volume_attach_v2.go @@ -121,7 +121,7 @@ func resourceComputeVolumeAttachV2Read(d *schema.ResourceData, meta interface{}) attachment, err := volumeattach.Get(computeClient, instanceId, attachmentId).Extract() if err != nil { - return err + return CheckDeleted(d, err, "compute_volume_attach") } log.Printf("[DEBUG] Retrieved volume attachment: %#v", attachment) diff --git a/command/init.go b/command/init.go index 6721b87a1..6b7fbaf21 100644 --- a/command/init.go +++ b/command/init.go @@ -237,7 +237,6 @@ Options: -force-copy Suppress prompts about copying state data. This is equivalent to providing a "yes" to all confirmation prompts. - ` return strings.TrimSpace(helpText) } diff --git a/command/meta.go b/command/meta.go index b1bfa4397..c494d9697 100644 --- a/command/meta.go +++ b/command/meta.go @@ -264,6 +264,10 @@ func (m *Meta) flagSet(n string) *flag.FlagSet { // Set the default Usage to empty f.Usage = func() {} + // command that bypass locking will supply their own flag on this var, but + // set the initial meta value to true as a failsafe. + m.stateLock = true + return f } diff --git a/command/meta_backend_migrate.go b/command/meta_backend_migrate.go index 9a0b05285..40d0d12cb 100644 --- a/command/meta_backend_migrate.go +++ b/command/meta_backend_migrate.go @@ -2,6 +2,7 @@ package command import ( "context" + "errors" "fmt" "io/ioutil" "os" @@ -53,7 +54,7 @@ func (m *Meta) backendMigrateState(opts *backendMigrateOpts) error { // Setup defaults opts.oneEnv = backend.DefaultStateName opts.twoEnv = backend.DefaultStateName - opts.force = false + opts.force = m.forceInitCopy // Determine migration behavior based on whether the source/destionation // supports multi-state. @@ -163,7 +164,7 @@ func (m *Meta) backendMigrateState_S_S(opts *backendMigrateOpts) error { func (m *Meta) backendMigrateState_S_s(opts *backendMigrateOpts) error { currentEnv := m.Env() - migrate := m.forceInitCopy + migrate := opts.force if !migrate { var err error // Ask the user if they want to migrate their existing remote state @@ -218,6 +219,19 @@ func (m *Meta) backendMigrateState_s_s(opts *backendMigrateOpts) error { errMigrateSingleLoadDefault), opts.TwoType, err) } + // Check if we need migration at all. + // This is before taking a lock, because they may also correspond to the same lock. + one := stateOne.State() + two := stateTwo.State() + + // no reason to migrate if the state is already there + if one.Equal(two) { + // Equal isn't identical; it doesn't check lineage. + if one != nil && two != nil && one.Lineage == two.Lineage { + return nil + } + } + if m.stateLock { lockCtx, cancel := context.WithTimeout(context.Background(), m.stateLockTimeout) defer cancel() @@ -241,10 +255,21 @@ func (m *Meta) backendMigrateState_s_s(opts *backendMigrateOpts) error { return fmt.Errorf("Error locking destination state: %s", err) } defer clistate.Unlock(stateTwo, lockIDTwo, m.Ui, m.Colorize()) - } - one := stateOne.State() - two := stateTwo.State() + // We now own a lock, so double check that we have the version + // corresponding to the lock. + if err := stateOne.RefreshState(); err != nil { + return fmt.Errorf(strings.TrimSpace( + errMigrateSingleLoadDefault), opts.OneType, err) + } + if err := stateTwo.RefreshState(); err != nil { + return fmt.Errorf(strings.TrimSpace( + errMigrateSingleLoadDefault), opts.OneType, err) + } + + one = stateOne.State() + two = stateTwo.State() + } // Clear the legacy remote state in both cases. If we're at the migration // step then this won't be used anymore. @@ -281,6 +306,11 @@ func (m *Meta) backendMigrateState_s_s(opts *backendMigrateOpts) error { } if !opts.force { + // Abort if we can't ask for input. + if !m.input { + return errors.New("error asking for state migration action: inptut disabled") + } + // Confirm with the user whether we want to copy state over confirm, err := confirmFunc(stateOne, stateTwo, opts) if err != nil { @@ -306,10 +336,6 @@ func (m *Meta) backendMigrateState_s_s(opts *backendMigrateOpts) error { } func (m *Meta) backendMigrateEmptyConfirm(one, two state.State, opts *backendMigrateOpts) (bool, error) { - if m.forceInitCopy { - return true, nil - } - inputOpts := &terraform.InputOpts{ Id: "backend-migrate-copy-to-empty", Query: fmt.Sprintf( @@ -372,10 +398,6 @@ func (m *Meta) backendMigrateNonEmptyConfirm( return false, fmt.Errorf("Error saving temporary state: %s", err) } - if m.forceInitCopy { - return true, nil - } - // Ask for confirmation inputOpts := &terraform.InputOpts{ Id: "backend-migrate-to-backend", diff --git a/command/meta_backend_test.go b/command/meta_backend_test.go index ea0085dba..ffb6e3b61 100644 --- a/command/meta_backend_test.go +++ b/command/meta_backend_test.go @@ -426,6 +426,57 @@ func TestMetaBackend_configureNewWithState(t *testing.T) { } } +// Newly configured backend with matching local and remote state doesn't prompt +// for copy. +func TestMetaBackend_configureNewWithoutCopy(t *testing.T) { + // Create a temporary working directory that is empty + td := tempDir(t) + copy.CopyDir(testFixturePath("backend-new-migrate"), td) + defer os.RemoveAll(td) + defer testChdir(t, td)() + + if err := copy.CopyFile(DefaultStateFilename, "local-state.tfstate"); err != nil { + t.Fatal(err) + } + + // Setup the meta + m := testMetaBackend(t, nil) + m.input = false + + // init the backend + _, err := m.Backend(&BackendOpts{Init: true}) + if err != nil { + t.Fatalf("bad: %s", err) + } + + // Verify the state is where we expect + f, err := os.Open("local-state.tfstate") + if err != nil { + t.Fatalf("err: %s", err) + } + actual, err := terraform.ReadState(f) + f.Close() + if err != nil { + t.Fatalf("err: %s", err) + } + + if actual.Lineage != "backend-new-migrate" { + t.Fatalf("incorrect state lineage: %q", actual.Lineage) + } + + // Verify the default paths don't exist + if !isEmptyState(DefaultStateFilename) { + data, _ := ioutil.ReadFile(DefaultStateFilename) + + t.Fatal("state should not exist, but contains:\n", string(data)) + } + + // Verify a backup does exist + if isEmptyState(DefaultStateFilename + DefaultBackupExtension) { + t.Fatal("backup state is empty or missing") + } +} + // Newly configured backend with prior local state and no remote state, // but opting to not migrate. func TestMetaBackend_configureNewWithStateNoMigrate(t *testing.T) { diff --git a/helper/schema/schema.go b/helper/schema/schema.go index f62c4d128..e3a7b1a44 100644 --- a/helper/schema/schema.go +++ b/helper/schema/schema.go @@ -62,10 +62,20 @@ type Schema struct { DiffSuppressFunc SchemaDiffSuppressFunc // If this is non-nil, then this will be a default value that is used - // when this item is not set in the configuration/state. + // when this item is not set in the configuration. // - // DefaultFunc can be specified if you want a dynamic default value. - // Only one of Default or DefaultFunc can be set. + // DefaultFunc can be specified to compute a dynamic default. + // Only one of Default or DefaultFunc can be set. If DefaultFunc is + // used then its return value should be stable to avoid generating + // confusing/perpetual diffs. + // + // Changing either Default or the return value of DefaultFunc can be + // a breaking change, especially if the attribute in question has + // ForceNew set. If a default needs to change to align with changing + // assumptions in an upstream API then it may be necessary to also use + // the MigrateState function on the resource to change the state to match, + // or have the Read function adjust the state value to align with the + // new default. // // If Required is true above, then Default cannot be set. DefaultFunc // can be set with Required. If the DefaultFunc returns nil, then there diff --git a/state/state.go b/state/state.go index f6c4f16d4..45163852b 100644 --- a/state/state.go +++ b/state/state.go @@ -94,9 +94,9 @@ func LockWithContext(ctx context.Context, s State, info *LockInfo) (string, erro return "", err } - if le.Info.ID == "" { - // the lock has no ID, something is wrong so don't keep trying - return "", fmt.Errorf("lock error missing ID: %s", err) + if le == nil || le.Info == nil || le.Info.ID == "" { + // If we dont' have a complete LockError, there's something wrong with the lock + return "", err } if postLockHook != nil { diff --git a/terraform/eval_validate.go b/terraform/eval_validate.go index a2c122d6a..478aa6400 100644 --- a/terraform/eval_validate.go +++ b/terraform/eval_validate.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform/config" + "github.com/mitchellh/mapstructure" ) // EvalValidateError is the error structure returned if there were @@ -85,12 +86,31 @@ func (n *EvalValidateProvider) Eval(ctx EvalContext) (interface{}, error) { type EvalValidateProvisioner struct { Provisioner *ResourceProvisioner Config **ResourceConfig + ConnConfig **ResourceConfig } func (n *EvalValidateProvisioner) Eval(ctx EvalContext) (interface{}, error) { provisioner := *n.Provisioner config := *n.Config - warns, errs := provisioner.Validate(config) + var warns []string + var errs []error + + { + // Validate the provisioner's own config first + w, e := provisioner.Validate(config) + warns = append(warns, w...) + errs = append(errs, e...) + } + + { + // Now validate the connection config, which might either be from + // the provisioner block itself or inherited from the resource's + // shared connection info. + w, e := n.validateConnConfig(*n.ConnConfig) + warns = append(warns, w...) + errs = append(errs, e...) + } + if len(warns) == 0 && len(errs) == 0 { return nil, nil } @@ -101,6 +121,64 @@ func (n *EvalValidateProvisioner) Eval(ctx EvalContext) (interface{}, error) { } } +func (n *EvalValidateProvisioner) validateConnConfig(connConfig *ResourceConfig) (warns []string, errs []error) { + // We can't comprehensively validate the connection config since its + // final structure is decided by the communicator and we can't instantiate + // that until we have a complete instance state. However, we *can* catch + // configuration keys that are not valid for *any* communicator, catching + // typos early rather than waiting until we actually try to run one of + // the resource's provisioners. + + type connConfigSuperset struct { + // All attribute types are interface{} here because at this point we + // may still have unresolved interpolation expressions, which will + // appear as strings regardless of the final goal type. + + Type interface{} `mapstructure:"type"` + User interface{} `mapstructure:"user"` + Password interface{} `mapstructure:"password"` + Host interface{} `mapstructure:"host"` + Port interface{} `mapstructure:"port"` + Timeout interface{} `mapstructure:"timeout"` + ScriptPath interface{} `mapstructure:"script_path"` + + // For type=ssh only (enforced in ssh communicator) + PrivateKey interface{} `mapstructure:"private_key"` + Agent interface{} `mapstructure:"agent"` + BastionHost interface{} `mapstructure:"bastion_host"` + BastionPort interface{} `mapstructure:"bastion_port"` + BastionUser interface{} `mapstructure:"bastion_user"` + BastionPassword interface{} `mapstructure:"bastion_password"` + BastionPrivateKey interface{} `mapstructure:"bastion_private_key"` + + // For type=winrm only (enforced in winrm communicator) + HTTPS interface{} `mapstructure:"https"` + Insecure interface{} `mapstructure:"insecure"` + CACert interface{} `mapstructure:"cacert"` + } + + var metadata mapstructure.Metadata + decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ + Metadata: &metadata, + Result: &connConfigSuperset{}, // result is disregarded; we only care about unused keys + }) + if err != nil { + // should never happen + errs = append(errs, err) + return + } + + if err := decoder.Decode(connConfig.Config); err != nil { + errs = append(errs, err) + return + } + + for _, attrName := range metadata.Unused { + errs = append(errs, fmt.Errorf("unknown 'connection' argument %q", attrName)) + } + return +} + // EvalValidateResource is an EvalNode implementation that validates // the configuration of a resource. type EvalValidateResource struct { diff --git a/terraform/eval_validate_test.go b/terraform/eval_validate_test.go index ac20f617c..0bde2a870 100644 --- a/terraform/eval_validate_test.go +++ b/terraform/eval_validate_test.go @@ -178,3 +178,117 @@ func TestEvalValidateResource_ignoreWarnings(t *testing.T) { t.Fatalf("Expected no error, got: %s", err) } } + +func TestEvalValidateProvisioner_valid(t *testing.T) { + mp := &MockResourceProvisioner{} + var p ResourceProvisioner = mp + ctx := &MockEvalContext{} + + cfg := &ResourceConfig{} + connInfo, err := config.NewRawConfig(map[string]interface{}{}) + if err != nil { + t.Fatalf("failed to make connInfo: %s", err) + } + connConfig := NewResourceConfig(connInfo) + + node := &EvalValidateProvisioner{ + Provisioner: &p, + Config: &cfg, + ConnConfig: &connConfig, + } + + result, err := node.Eval(ctx) + if err != nil { + t.Fatalf("node.Eval failed: %s", err) + } + if result != nil { + t.Errorf("node.Eval returned non-nil result") + } + + if !mp.ValidateCalled { + t.Fatalf("p.Config not called") + } + if mp.ValidateConfig != cfg { + t.Errorf("p.Config called with wrong config") + } +} + +func TestEvalValidateProvisioner_warning(t *testing.T) { + mp := &MockResourceProvisioner{} + var p ResourceProvisioner = mp + ctx := &MockEvalContext{} + + cfg := &ResourceConfig{} + connInfo, err := config.NewRawConfig(map[string]interface{}{}) + if err != nil { + t.Fatalf("failed to make connInfo: %s", err) + } + connConfig := NewResourceConfig(connInfo) + + node := &EvalValidateProvisioner{ + Provisioner: &p, + Config: &cfg, + ConnConfig: &connConfig, + } + + mp.ValidateReturnWarns = []string{"foo is deprecated"} + + _, err = node.Eval(ctx) + if err == nil { + t.Fatalf("node.Eval succeeded; want error") + } + + valErr, ok := err.(*EvalValidateError) + if !ok { + t.Fatalf("node.Eval error is %#v; want *EvalValidateError", valErr) + } + + warns := valErr.Warnings + if warns == nil || len(warns) != 1 { + t.Fatalf("wrong number of warnings in %#v; want one warning", warns) + } + if warns[0] != mp.ValidateReturnWarns[0] { + t.Fatalf("wrong warning %q; want %q", warns[0], mp.ValidateReturnWarns[0]) + } +} + +func TestEvalValidateProvisioner_connectionInvalid(t *testing.T) { + var p ResourceProvisioner = &MockResourceProvisioner{} + ctx := &MockEvalContext{} + + cfg := &ResourceConfig{} + connInfo, err := config.NewRawConfig(map[string]interface{}{ + "bananananananana": "foo", + "bazaz": "bar", + }) + if err != nil { + t.Fatalf("failed to make connInfo: %s", err) + } + connConfig := NewResourceConfig(connInfo) + + node := &EvalValidateProvisioner{ + Provisioner: &p, + Config: &cfg, + ConnConfig: &connConfig, + } + + _, err = node.Eval(ctx) + if err == nil { + t.Fatalf("node.Eval succeeded; want error") + } + + valErr, ok := err.(*EvalValidateError) + if !ok { + t.Fatalf("node.Eval error is %#v; want *EvalValidateError", valErr) + } + + errs := valErr.Errors + if errs == nil || len(errs) != 2 { + t.Fatalf("wrong number of errors in %#v; want two errors", errs) + } + + errStr := errs[0].Error() + if !(strings.Contains(errStr, "bananananananana") || strings.Contains(errStr, "bazaz")) { + t.Fatalf("wrong first error %q; want something about our invalid connInfo keys", errStr) + } +} diff --git a/terraform/node_resource_validate.go b/terraform/node_resource_validate.go index e01518de4..f528f24b1 100644 --- a/terraform/node_resource_validate.go +++ b/terraform/node_resource_validate.go @@ -129,17 +129,29 @@ func (n *NodeValidatableResourceInstance) EvalTree() EvalNode { // Validate all the provisioners for _, p := range n.Config.Provisioners { var provisioner ResourceProvisioner - seq.Nodes = append(seq.Nodes, &EvalGetProvisioner{ - Name: p.Type, - Output: &provisioner, - }, &EvalInterpolate{ - Config: p.RawConfig.Copy(), - Resource: resource, - Output: &config, - }, &EvalValidateProvisioner{ - Provisioner: &provisioner, - Config: &config, - }) + var connConfig *ResourceConfig + seq.Nodes = append( + seq.Nodes, + &EvalGetProvisioner{ + Name: p.Type, + Output: &provisioner, + }, + &EvalInterpolate{ + Config: p.RawConfig.Copy(), + Resource: resource, + Output: &config, + }, + &EvalInterpolate{ + Config: p.ConnInfo.Copy(), + Resource: resource, + Output: &connConfig, + }, + &EvalValidateProvisioner{ + Provisioner: &provisioner, + Config: &config, + ConnConfig: &connConfig, + }, + ) } return seq diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/client.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/client.go new file mode 100644 index 000000000..d64eb2287 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/client.go @@ -0,0 +1,58 @@ +// Package disk implements the Azure ARM Disk service API version +// 2016-04-30-preview. +// +// The Disk Resource Provider Client. +package disk + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // APIVersion is the version of the Disk + APIVersion = "2016-04-30-preview" + + // DefaultBaseURI is the default URI used for the service Disk + DefaultBaseURI = "https://management.azure.com" +) + +// ManagementClient is the base client for Disk. +type ManagementClient struct { + autorest.Client + BaseURI string + APIVersion string + SubscriptionID string +} + +// New creates an instance of the ManagementClient client. +func New(subscriptionID string) ManagementClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the ManagementClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient { + return ManagementClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + APIVersion: APIVersion, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/disks.go new file mode 100644 index 000000000..6fb03876f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/disks.go @@ -0,0 +1,638 @@ +package disk + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DisksClient is the the Disk Resource Provider Client. +type DisksClient struct { + ManagementClient +} + +// NewDisksClient creates an instance of the DisksClient client. +func NewDisksClient(subscriptionID string) DisksClient { + return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDisksClientWithBaseURI creates an instance of the DisksClient client. +func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient { + return DisksClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a disk. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. +// The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of +// the disk within the given subscription and resource group. diskParameter is +// disk object supplied in the body of the Put disk operation. +func (client DisksClient) CreateOrUpdate(resourceGroupName string, diskName string, diskParameter Model, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: diskParameter, + Constraints: []validation.Constraint{{Target: "diskParameter.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "diskParameter.Properties.CreationData", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "diskParameter.Properties.CreationData.ImageReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "diskParameter.Properties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "diskParameter.Properties.EncryptionSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "diskParameter.Properties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "diskParameter.Properties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "diskParameter.Properties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "diskParameter.Properties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "diskParameter.Properties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "diskParameter.Properties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "disk.DisksClient", "CreateOrUpdate") + } + + req, err := client.CreateOrUpdatePreparer(resourceGroupName, diskName, diskParameter, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "CreateOrUpdate", nil, "Failure preparing request") + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "CreateOrUpdate", resp, "Failure sending request") + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DisksClient) CreateOrUpdatePreparer(resourceGroupName string, diskName string, diskParameter Model, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithJSON(diskParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete deletes a disk. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to +// cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of +// the disk within the given subscription and resource group. +func (client DisksClient) Delete(resourceGroupName string, diskName string, cancel <-chan struct{}) (result autorest.Response, err error) { + req, err := client.DeletePreparer(resourceGroupName, diskName, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "Delete", nil, "Failure preparing request") + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "Delete", resp, "Failure sending request") + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DisksClient) DeletePreparer(resourceGroupName string, diskName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets information about a disk. +// +// resourceGroupName is the name of the resource group. diskName is the name of +// the disk within the given subscription and resource group. +func (client DisksClient) Get(resourceGroupName string, diskName string) (result Model, err error) { + req, err := client.GetPreparer(resourceGroupName, diskName) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "Get", nil, "Failure preparing request") + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "Get", resp, "Failure sending request") + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DisksClient) GetPreparer(resourceGroupName string, diskName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DisksClient) GetResponder(resp *http.Response) (result Model, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GrantAccess grants access to a disk. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel +// will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of +// the disk within the given subscription and resource group. grantAccessData +// is access data object supplied in the body of the get disk access operation. +func (client DisksClient) GrantAccess(resourceGroupName string, diskName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: grantAccessData, + Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "disk.DisksClient", "GrantAccess") + } + + req, err := client.GrantAccessPreparer(resourceGroupName, diskName, grantAccessData, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "GrantAccess", nil, "Failure preparing request") + } + + resp, err := client.GrantAccessSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "GrantAccess", resp, "Failure sending request") + } + + result, err = client.GrantAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "GrantAccess", resp, "Failure responding to request") + } + + return +} + +// GrantAccessPreparer prepares the GrantAccess request. +func (client DisksClient) GrantAccessPreparer(resourceGroupName string, diskName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters), + autorest.WithJSON(grantAccessData), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// GrantAccessSender sends the GrantAccess request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) GrantAccessSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// GrantAccessResponder handles the response to the GrantAccess request. The method always +// closes the http.Response Body. +func (client DisksClient) GrantAccessResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// List lists all the disks under a subscription. +func (client DisksClient) List() (result ListType, err error) { + req, err := client.ListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "List", nil, "Failure preparing request") + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "List", resp, "Failure sending request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DisksClient) ListPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DisksClient) ListResponder(resp *http.Response) (result ListType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client DisksClient) ListNextResults(lastResults ListType) (result ListType, err error) { + req, err := lastResults.ListTypePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListByResourceGroup lists all the disks under a resource group. +// +// resourceGroupName is the name of the resource group. +func (client DisksClient) ListByResourceGroup(resourceGroupName string) (result ListType, err error) { + req, err := client.ListByResourceGroupPreparer(resourceGroupName) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", nil, "Failure preparing request") + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", resp, "Failure sending request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DisksClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result ListType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroupNextResults retrieves the next set of results, if any. +func (client DisksClient) ListByResourceGroupNextResults(lastResults ListType) (result ListType, err error) { + req, err := lastResults.ListTypePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", resp, "Failure sending next results request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", resp, "Failure responding to next results request") + } + + return +} + +// RevokeAccess revokes access to a disk. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel +// will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of +// the disk within the given subscription and resource group. +func (client DisksClient) RevokeAccess(resourceGroupName string, diskName string, cancel <-chan struct{}) (result autorest.Response, err error) { + req, err := client.RevokeAccessPreparer(resourceGroupName, diskName, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "RevokeAccess", nil, "Failure preparing request") + } + + resp, err := client.RevokeAccessSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "RevokeAccess", resp, "Failure sending request") + } + + result, err = client.RevokeAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "RevokeAccess", resp, "Failure responding to request") + } + + return +} + +// RevokeAccessPreparer prepares the RevokeAccess request. +func (client DisksClient) RevokeAccessPreparer(resourceGroupName string, diskName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// RevokeAccessSender sends the RevokeAccess request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) RevokeAccessSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// RevokeAccessResponder handles the response to the RevokeAccess request. The method always +// closes the http.Response Body. +func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates (patches) a disk. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel +// will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of +// the disk within the given subscription and resource group. diskParameter is +// disk object supplied in the body of the Patch disk operation. +func (client DisksClient) Update(resourceGroupName string, diskName string, diskParameter UpdateType, cancel <-chan struct{}) (result autorest.Response, err error) { + req, err := client.UpdatePreparer(resourceGroupName, diskName, diskParameter, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "Update", nil, "Failure preparing request") + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.DisksClient", "Update", resp, "Failure sending request") + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.DisksClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DisksClient) UpdatePreparer(resourceGroupName string, diskName string, diskParameter UpdateType, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithJSON(diskParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DisksClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/models.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/models.go new file mode 100644 index 000000000..e8118696a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/models.go @@ -0,0 +1,278 @@ +package disk + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "net/http" +) + +// AccessLevel enumerates the values for access level. +type AccessLevel string + +const ( + // None specifies the none state for access level. + None AccessLevel = "None" + // Read specifies the read state for access level. + Read AccessLevel = "Read" +) + +// CreateOption enumerates the values for create option. +type CreateOption string + +const ( + // Attach specifies the attach state for create option. + Attach CreateOption = "Attach" + // Copy specifies the copy state for create option. + Copy CreateOption = "Copy" + // Empty specifies the empty state for create option. + Empty CreateOption = "Empty" + // FromImage specifies the from image state for create option. + FromImage CreateOption = "FromImage" + // Import specifies the import state for create option. + Import CreateOption = "Import" + // Restore specifies the restore state for create option. + Restore CreateOption = "Restore" +) + +// OperatingSystemTypes enumerates the values for operating system types. +type OperatingSystemTypes string + +const ( + // Linux specifies the linux state for operating system types. + Linux OperatingSystemTypes = "Linux" + // Windows specifies the windows state for operating system types. + Windows OperatingSystemTypes = "Windows" +) + +// StorageAccountTypes enumerates the values for storage account types. +type StorageAccountTypes string + +const ( + // PremiumLRS specifies the premium lrs state for storage account types. + PremiumLRS StorageAccountTypes = "Premium_LRS" + // StandardLRS specifies the standard lrs state for storage account types. + StandardLRS StorageAccountTypes = "Standard_LRS" +) + +// AccessURI is a disk access SAS uri. +type AccessURI struct { + autorest.Response `json:"-"` + *AccessURIOutput `json:"properties,omitempty"` +} + +// AccessURIOutput is azure properties, including output. +type AccessURIOutput struct { + *AccessURIRaw `json:"output,omitempty"` +} + +// AccessURIRaw is this object gets 'bubbled up' through flattening. +type AccessURIRaw struct { + AccessSAS *string `json:"accessSAS,omitempty"` +} + +// APIError is api error. +type APIError struct { + Details *[]APIErrorBase `json:"details,omitempty"` + Innererror *InnerError `json:"innererror,omitempty"` + Code *string `json:"code,omitempty"` + Target *string `json:"target,omitempty"` + Message *string `json:"message,omitempty"` +} + +// APIErrorBase is api error base. +type APIErrorBase struct { + Code *string `json:"code,omitempty"` + Target *string `json:"target,omitempty"` + Message *string `json:"message,omitempty"` +} + +// CreationData is data used when creating a disk. +type CreationData struct { + CreateOption CreateOption `json:"createOption,omitempty"` + StorageAccountID *string `json:"storageAccountId,omitempty"` + ImageReference *ImageDiskReference `json:"imageReference,omitempty"` + SourceURI *string `json:"sourceUri,omitempty"` + SourceResourceID *string `json:"sourceResourceId,omitempty"` +} + +// EncryptionSettings is encryption settings for disk or snapshot +type EncryptionSettings struct { + Enabled *bool `json:"enabled,omitempty"` + DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` + KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` +} + +// GrantAccessData is data used for requesting a SAS. +type GrantAccessData struct { + Access AccessLevel `json:"access,omitempty"` + DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` +} + +// ImageDiskReference is the source image used for creating the disk. +type ImageDiskReference struct { + ID *string `json:"id,omitempty"` + Lun *int32 `json:"lun,omitempty"` +} + +// InnerError is inner error details. +type InnerError struct { + Exceptiontype *string `json:"exceptiontype,omitempty"` + Errordetail *string `json:"errordetail,omitempty"` +} + +// KeyVaultAndKeyReference is key Vault Key Url and vault id of KeK, KeK is +// optional and when provided is used to unwrap the encryptionKey +type KeyVaultAndKeyReference struct { + SourceVault *SourceVault `json:"sourceVault,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` +} + +// KeyVaultAndSecretReference is key Vault Secret Url and vault id of the +// encryption key +type KeyVaultAndSecretReference struct { + SourceVault *SourceVault `json:"sourceVault,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` +} + +// ListType is the List Disks operation response. +type ListType struct { + autorest.Response `json:"-"` + Value *[]Model `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// ListTypePreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client ListType) ListTypePreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// Model is disk resource. +type Model struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *Properties `json:"properties,omitempty"` +} + +// OperationStatusResponse is operation status response +type OperationStatusResponse struct { + autorest.Response `json:"-"` + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` + StartTime *date.Time `json:"startTime,omitempty"` + EndTime *date.Time `json:"endTime,omitempty"` + Error *APIError `json:"error,omitempty"` +} + +// Properties is disk resource properties. +type Properties struct { + AccountType StorageAccountTypes `json:"accountType,omitempty"` + TimeCreated *date.Time `json:"timeCreated,omitempty"` + OsType OperatingSystemTypes `json:"osType,omitempty"` + CreationData *CreationData `json:"creationData,omitempty"` + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` + OwnerID *string `json:"ownerId,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// Resource is the Resource model definition. +type Resource struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` +} + +// ResourceUpdate is the Resource model definition. +type ResourceUpdate struct { + Tags *map[string]*string `json:"tags,omitempty"` +} + +// Snapshot is snapshot resource. +type Snapshot struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *Properties `json:"properties,omitempty"` +} + +// SnapshotList is the List Snapshots operation response. +type SnapshotList struct { + autorest.Response `json:"-"` + Value *[]Snapshot `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// SnapshotListPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client SnapshotList) SnapshotListPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// SnapshotUpdate is snapshot update resource. +type SnapshotUpdate struct { + Tags *map[string]*string `json:"tags,omitempty"` + *UpdateProperties `json:"properties,omitempty"` +} + +// SourceVault is the vault id is an Azure Resource Manager Resoure id in the +// form +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} +type SourceVault struct { + ID *string `json:"id,omitempty"` +} + +// UpdateProperties is disk resource update properties. +type UpdateProperties struct { + AccountType StorageAccountTypes `json:"accountType,omitempty"` + OsType OperatingSystemTypes `json:"osType,omitempty"` + CreationData *CreationData `json:"creationData,omitempty"` + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` +} + +// UpdateType is disk update resource. +type UpdateType struct { + Tags *map[string]*string `json:"tags,omitempty"` + *UpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/snapshots.go new file mode 100644 index 000000000..20e6ec758 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/snapshots.go @@ -0,0 +1,643 @@ +package disk + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SnapshotsClient is the the Disk Resource Provider Client. +type SnapshotsClient struct { + ManagementClient +} + +// NewSnapshotsClient creates an instance of the SnapshotsClient client. +func NewSnapshotsClient(subscriptionID string) SnapshotsClient { + return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient +// client. +func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { + return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a snapshot. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. +// The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the +// name of the snapshot within the given subscription and resource group. +// snapshot is snapshot object supplied in the body of the Put disk operation. +func (client SnapshotsClient) CreateOrUpdate(resourceGroupName string, snapshotName string, snapshot Snapshot, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: snapshot, + Constraints: []validation.Constraint{{Target: "snapshot.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.Properties.CreationData", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "snapshot.Properties.CreationData.ImageReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.Properties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "snapshot.Properties.EncryptionSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.Properties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.Properties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "snapshot.Properties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "snapshot.Properties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.Properties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "snapshot.Properties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "disk.SnapshotsClient", "CreateOrUpdate") + } + + req, err := client.CreateOrUpdatePreparer(resourceGroupName, snapshotName, snapshot, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request") + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "CreateOrUpdate", resp, "Failure sending request") + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SnapshotsClient) CreateOrUpdatePreparer(resourceGroupName string, snapshotName string, snapshot Snapshot, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(snapshot), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete deletes a snapshot. This method may poll for completion. Polling can +// be canceled by passing the cancel channel argument. The channel will be used +// to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the +// name of the snapshot within the given subscription and resource group. +func (client SnapshotsClient) Delete(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (result autorest.Response, err error) { + req, err := client.DeletePreparer(resourceGroupName, snapshotName, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Delete", nil, "Failure preparing request") + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Delete", resp, "Failure sending request") + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SnapshotsClient) DeletePreparer(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets information about a snapshot. +// +// resourceGroupName is the name of the resource group. snapshotName is the +// name of the snapshot within the given subscription and resource group. +func (client SnapshotsClient) Get(resourceGroupName string, snapshotName string) (result Snapshot, err error) { + req, err := client.GetPreparer(resourceGroupName, snapshotName) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Get", nil, "Failure preparing request") + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Get", resp, "Failure sending request") + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SnapshotsClient) GetPreparer(resourceGroupName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GrantAccess grants access to a snapshot. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. +// The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the +// name of the snapshot within the given subscription and resource group. +// grantAccessData is access data object supplied in the body of the get +// snapshot access operation. +func (client SnapshotsClient) GrantAccess(resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: grantAccessData, + Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "disk.SnapshotsClient", "GrantAccess") + } + + req, err := client.GrantAccessPreparer(resourceGroupName, snapshotName, grantAccessData, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "GrantAccess", nil, "Failure preparing request") + } + + resp, err := client.GrantAccessSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "GrantAccess", resp, "Failure sending request") + } + + result, err = client.GrantAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "GrantAccess", resp, "Failure responding to request") + } + + return +} + +// GrantAccessPreparer prepares the GrantAccess request. +func (client SnapshotsClient) GrantAccessPreparer(resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters), + autorest.WithJSON(grantAccessData), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// GrantAccessSender sends the GrantAccess request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) GrantAccessSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// GrantAccessResponder handles the response to the GrantAccess request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// List lists snapshots under a subscription. +func (client SnapshotsClient) List() (result SnapshotList, err error) { + req, err := client.ListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", nil, "Failure preparing request") + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", resp, "Failure sending request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SnapshotsClient) ListPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client SnapshotsClient) ListNextResults(lastResults SnapshotList) (result SnapshotList, err error) { + req, err := lastResults.SnapshotListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListByResourceGroup lists snapshots under a resource group. +// +// resourceGroupName is the name of the resource group. +func (client SnapshotsClient) ListByResourceGroup(resourceGroupName string) (result SnapshotList, err error) { + req, err := client.ListByResourceGroupPreparer(resourceGroupName) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request") + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SnapshotsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroupNextResults retrieves the next set of results, if any. +func (client SnapshotsClient) ListByResourceGroupNextResults(lastResults SnapshotList) (result SnapshotList, err error) { + req, err := lastResults.SnapshotListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending next results request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to next results request") + } + + return +} + +// RevokeAccess revokes access to a snapshot. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. +// The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the +// name of the snapshot within the given subscription and resource group. +func (client SnapshotsClient) RevokeAccess(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (result autorest.Response, err error) { + req, err := client.RevokeAccessPreparer(resourceGroupName, snapshotName, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request") + } + + resp, err := client.RevokeAccessSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "RevokeAccess", resp, "Failure sending request") + } + + result, err = client.RevokeAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "RevokeAccess", resp, "Failure responding to request") + } + + return +} + +// RevokeAccessPreparer prepares the RevokeAccess request. +func (client SnapshotsClient) RevokeAccessPreparer(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// RevokeAccessSender sends the RevokeAccess request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// RevokeAccessResponder handles the response to the RevokeAccess request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates (patches) a snapshot. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel +// will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the +// name of the snapshot within the given subscription and resource group. +// snapshot is snapshot object supplied in the body of the Patch snapshot +// operation. +func (client SnapshotsClient) Update(resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, cancel <-chan struct{}) (result autorest.Response, err error) { + req, err := client.UpdatePreparer(resourceGroupName, snapshotName, snapshot, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Update", nil, "Failure preparing request") + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Update", resp, "Failure sending request") + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SnapshotsClient) UpdatePreparer(resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(snapshot), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/version.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/version.go new file mode 100644 index 000000000..9b5497d54 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/version.go @@ -0,0 +1,60 @@ +package disk + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "bytes" + "fmt" + "strings" +) + +const ( + major = "8" + minor = "1" + patch = "0" + tag = "beta" + userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s" +) + +// cached results of UserAgent and Version to prevent repeated operations. +var ( + userAgent string + version string +) + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + if userAgent == "" { + userAgent = fmt.Sprintf(userAgentFormat, Version(), "disk", "2016-04-30-preview") + } + return userAgent +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + if version == "" { + versionBuilder := bytes.NewBufferString(fmt.Sprintf("%s.%s.%s", major, minor, patch)) + if tag != "" { + versionBuilder.WriteRune('-') + versionBuilder.WriteString(strings.TrimPrefix(tag, "-")) + } + version = string(versionBuilder.Bytes()) + } + return version +} diff --git a/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md index ebacd5ba4..698e38413 100644 --- a/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md @@ -1,3 +1,143 @@ +Release v1.8.8 (2017-04-04) +=== + +### Service Client Updates +* `service/cloudwatch`: Updates service API, documentation, and paginators + * Amazon Web Services announced the immediate availability of two additional alarm configuration rules for Amazon CloudWatch Alarms. The first rule is for configuring missing data treatment. Customers have the options to treat missing data as alarm threshold breached, alarm threshold not breached, maintain alarm state and the current default treatment. The second rule is for alarms based on percentiles metrics that can trigger unnecassarily if the percentile is calculated from a small number of samples. The new rule can treat percentiles with low sample counts as same as missing data. If the first rule is enabled, the same treatment will be applied when an alarm encounters a percentile with low sample counts. + +Release v1.8.7 (2017-04-03) +=== + +### Service Client Updates +* `service/lexruntimeservice`: Updates service API and documentation + * Adds support to PostContent for speech input + +### SDK Enhancements +* `aws/request`: Improve handler copy, push back, push front performance (#1171) + * Minor optimization to the handler list's handling of copying and pushing request handlers to the handler list. +* Update codegen header to use Go std wording (#1172) + * Go recently accepted the proposal for standard generated file header wording in, https://golang.org/s/generatedcode. + +### SDK Bugs +* `service/dynamodb`: Fix DynamoDB using custom retryer (#1170) + * Fixes (#1139) the DynamoDB service client clobbering any custom retryer that was passed into the service client or Session's config. +Release v1.8.6 (2017-04-01) +=== + +### Service Client Updates +* `service/clouddirectory`: Updates service API and documentation + * ListObjectAttributes now supports filtering by facet. +* `aws/endpoints`: Updated Regions and Endpoints metadata. + +Release v1.8.5 (2017-03-30) +=== + +### Service Client Updates +* `service/cloudformation`: Updates service waiters and paginators + * Adding paginators for ListExports and ListImports +* `service/cloudfront`: Adds new service + * Amazon CloudFront now supports user configurable HTTP Read and Keep-Alive Idle Timeouts for your Custom Origin Servers +* `service/configservice`: Updates service documentation +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/resourcegroupstaggingapi`: Adds new service +* `service/storagegateway`: Updates service API and documentation + * File gateway mode in AWS Storage gateway provides access to objects in S3 as files on a Network File System (NFS) mount point. Once a file share is created, any changes made externally to the S3 bucket will not be reflected by the gateway. Using the cache refresh feature in this update, the customer can trigger an on-demand scan of the keys in their S3 bucket and refresh the file namespace cached on the gateway. It takes as an input the fileShare ARN and refreshes the cache for only that file share. Additionally there is new functionality on file gateway that allows you configure what squash options they would like on their file share, this allows a customer to configure their gateway to not squash root permissions. This can be done by setting options in NfsOptions for CreateNfsFileShare and UpdateNfsFileShare APIs. + +Release v1.8.4 (2017-03-28) +=== + +### Service Client Updates +* `service/batch`: Updates service API, documentation, and paginators + * Customers can now provide a retryStrategy as part of the RegisterJobDefinition and SubmitJob API calls. The retryStrategy object has a number value for attempts. This is the number of non successful executions before a job is considered FAILED. In addition, the JobDetail object now has an attempts field and shows all execution attempts. +* `service/ec2`: Updates service API and documentation + * Customers can now tag their Amazon EC2 Instances and Amazon EBS Volumes at + the time of their creation. You can do this from the EC2 Instance launch + wizard or through the RunInstances or CreateVolume APIs. By tagging + resources at the time of creation, you can eliminate the need to run custom + tagging scripts after resource creation. In addition, you can now set + resource-level permissions on the CreateVolume, CreateTags, DeleteTags, and + the RunInstances APIs. This allows you to implement stronger security + policies by giving you more granular control over which users and groups + have access to these APIs. You can also enforce the use of tagging and + control what tag keys and values are set on your resources. When you combine + tag usage and resource-level IAM policies together, you can ensure your + instances and volumes are properly secured upon creation and achieve more + accurate cost allocation reporting. These new features are provided at no + additional cost. + +### SDK Enhancements +* `aws/request`: Add retry support for RequestTimeoutException (#1158) + * Adds support for retrying RequestTimeoutException error code that is returned by some services. + +### SDK Bugs +* `private/model/api`: Fix Waiter and Paginators panic on nil param inputs (#1157) + * Corrects the code generation for Paginators and waiters that caused a panic if nil input parameters were used with the operations. +Release v1.8.3 (2017-03-27) +=== + +## Service Client Updates +* `service/ssm`: Updates service API, documentation, and paginators + * Updated validation rules for SendCommand and RegisterTaskWithMaintenanceWindow APIs. +Release v1.8.2 (2017-03-24) +=== + +Service Client Updates +--- +* `service/applicationautoscaling`: Updates service API, documentation, and paginators + * Application AutoScaling is launching support for a new target resource (AppStream 2.0 Fleets) as a scalable target. +* `service/cloudtrail`: Updates service API and documentation + * Doc-only Update for CloudTrail: Add required parameters for GetEventSelectors and PutEventSelectors + +Release v1.8.1 (2017-03-23) +=== + +Service Client Updates +--- +* `service/applicationdiscoveryservice`: Updates service API, documentation, and paginators + * Adds export configuration options to the AWS Discovery Service API. +* `service/elbv2`: Updates waiters +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/lambda`: Updates service API and paginators + * Adds support for new runtime Node.js v6.10 for AWS Lambda service + +Release v1.8.0 (2017-03-22) +=== + +Service Client Updates +--- +* `service/codebuild`: Updates service documentation +* `service/directconnect`: Updates service API + * Deprecated DescribeConnectionLoa, DescribeInterconnectLoa, AllocateConnectionOnInterconnect and DescribeConnectionsOnInterconnect operations in favor of DescribeLoa, DescribeLoa, AllocateHostedConnection and DescribeHostedConnections respectively. +* `service/marketplacecommerceanalytics`: Updates service API, documentation, and paginators + * This update adds a new data set, us_sales_and_use_tax_records, which enables AWS Marketplace sellers to programmatically access to their U.S. Sales and Use Tax report data. +* `service/pinpoint`: Updates service API and documentation + * Amazon Pinpoint User Segmentation + * Added ability to segment endpoints by user attributes in addition to endpoint attributes. Amazon Pinpoint Event Stream Preview + * Added functionality to publish raw app analytics and campaign events data as events streams to Kinesis and Kinesis Firehose + * The feature provides developers with increased flexibility of exporting raw events to S3, Redshift, Elasticsearch using a Kinesis Firehose stream or enable real time event processing use cases using a Kinesis stream +* `service/rekognition`: Updates service documentation. + +SDK Features +--- +* `aws/request`: Add support for context.Context to SDK API operation requests (#1132) + * Adds support for context.Context to the SDK by adding `WithContext` methods for each API operation, Paginators and Waiters. e.g `PutObjectWithContext`. This change also adds the ability to provide request functional options to the method calls instead of requiring you to use the `Request` API operation method (e.g `PutObjectRequest`). + * Adds a `Complete` Request handler list that will be called ever time a request is completed. This includes both success and failure. Complete will only be called once per API operation request. + * `private/waiter` package moved from the private group to `aws/request/waiter` and made publicly available. + * Adds Context support to all API operations, Waiters(WaitUntil) and Paginators(Pages) methods. + * Adds Context support for s3manager and s3crypto clients. + +SDK Enhancements +--- +* `aws/signer/v4`: Adds support for unsigned payload signer config (#1130) + * Adds configuration option to the v4.Signer to specify the request's body should not be signed. This will only correclty function on services that support unsigned payload. e.g. S3, Glacier. + +SDK Bug Fixes +--- +* `service/s3`: Fix S3 HostID to be available in S3 request error message (#1131) + * Adds a new type s3.RequestFailure which exposes the S3 HostID value from a S3 API operation response. This is helpful when you have an error with S3, and need to contact support. Both RequestID and HostID are needed. +* `private/model/api`: Do not return a link if uid is empty (#1133) + * Fixes SDK's doc generation to not generate API reference doc links if the SDK us unable to create a valid link. +* `aws/request`: Optimization to handler list copy to prevent multiple alloc calls. (#1134) Release v1.7.9 (2017-03-13) === diff --git a/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md b/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md index e69de29bb..5c517dca8 100644 --- a/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md +++ b/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md @@ -0,0 +1,5 @@ +### SDK Features + +### SDK Enhancements + +### SDK Bugs diff --git a/vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md b/vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md index 81edbfaeb..7c0186f0c 100644 --- a/vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md +++ b/vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md @@ -64,6 +64,11 @@ Please be aware of the following notes prior to opening a pull request: SDK's test coverage percentage are unlikely to be merged until tests have been added. +5. The JSON files under the SDK's `models` folder are sourced from outside the SDK. + Such as `models/apis/ec2/2016-11-15/api.json`. We will not accept pull requests + directly on these models. If you discover an issue with the models please + create a Github [issue](issues) describing the issue. + ### Testing To run the tests locally, running the `make unit` command will `go get` the diff --git a/vendor/github.com/aws/aws-sdk-go/README.md b/vendor/github.com/aws/aws-sdk-go/README.md index 8247981b7..fefe453f3 100644 --- a/vendor/github.com/aws/aws-sdk-go/README.md +++ b/vendor/github.com/aws/aws-sdk-go/README.md @@ -1,11 +1,4 @@ -# AWS SDK for Go - - -[![API Reference](http://img.shields.io/badge/api-reference-blue.svg)](http://docs.aws.amazon.com/sdk-for-go/api) -[![Join the chat at https://gitter.im/aws/aws-sdk-go](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aws/aws-sdk-go?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://img.shields.io/travis/aws/aws-sdk-go.svg)](https://travis-ci.org/aws/aws-sdk-go) -[![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/aws/aws-sdk-go/blob/master/LICENSE.txt) - +# AWS SDK for Go [![API Reference](http://img.shields.io/badge/api-reference-blue.svg)](http://docs.aws.amazon.com/sdk-for-go/api) [![Join the chat at https://gitter.im/aws/aws-sdk-go](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aws/aws-sdk-go?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://img.shields.io/travis/aws/aws-sdk-go.svg)](https://travis-ci.org/aws/aws-sdk-go) [![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/aws/aws-sdk-go/blob/master/LICENSE.txt) aws-sdk-go is the official AWS SDK for the Go programming language. @@ -77,7 +70,7 @@ AWS_SECRET_ACCESS_KEY=MY-SECRET-KEY ``` ### AWS shared config file (`~/.aws/config`) -The AWS SDK for Go added support the shared config file in release [v1.3.0](https://github.com/aws/aws-sdk-go/releases/tag/v1.3.0). You can opt into enabling support for the shared config by setting the environment variable `AWS_SDK_LOAD_CONFIG` to a truthy value. See the [Session](https://github.com/aws/aws-sdk-go/wiki/sessions) wiki for more information about this feature. +The AWS SDK for Go added support the shared config file in release [v1.3.0](https://github.com/aws/aws-sdk-go/releases/tag/v1.3.0). You can opt into enabling support for the shared config by setting the environment variable `AWS_SDK_LOAD_CONFIG` to a truthy value. See the [Session](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/sessions.html) docs for more information about this feature. ## Using the Go SDK @@ -85,44 +78,77 @@ To use a service in the SDK, create a service variable by calling the `New()` function. Once you have a service client, you can call API operations which each return response data and a possible error. -To list a set of instance IDs from EC2, you could run: +For example the following code shows how to upload an object to Amazon S3 with a Context timeout. ```go package main import ( + "context" + "flag" "fmt" + "os" + "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/service/s3" ) +// Uploads a file to S3 given a bucket and object key. Also takes a duration +// value to terminate the update if it doesn't complete within that time. +// +// The AWS Region needs to be provided in the AWS shared config or on the +// environment variable as `AWS_REGION`. Credentials also must be provided +// Will default to shared config file, but can load from environment if provided. +// +// Usage: +// # Upload myfile.txt to myBucket/myKey. Must complete within 10 minutes or will fail +// go run withContext.go -b mybucket -k myKey -d 10m < myfile.txt func main() { - sess, err := session.NewSession() - if err != nil { - panic(err) + var bucket, key string + var timeout time.Duration + + flag.StringVar(&bucket, "b", "", "Bucket name.") + flag.StringVar(&key, "k", "", "Object key name.") + flag.DurationVar(&timeout, "d", 0, "Upload timeout.") + flag.Parse() + + sess := session.Must(session.NewSession()) + svc := s3.New(sess) + + // Create a context with a timeout that will abort the upload if it takes + // more than the passed in timeout. + ctx := context.Background() + var cancelFn func() + if timeout > 0 { + ctx, cancelFn = context.WithTimeout(ctx, timeout) } + // Ensure the context is canceled to prevent leaking. + // See context package for more information, https://golang.org/pkg/context/ + defer cancelFn() - // Create an EC2 service object in the "us-west-2" region - // Note that you can also configure your region globally by - // exporting the AWS_REGION environment variable - svc := ec2.New(sess, &aws.Config{Region: aws.String("us-west-2")}) - - // Call the DescribeInstances Operation - resp, err := svc.DescribeInstances(nil) + // Uploads the object to S3. The Context will interrupt the request if the + // timeout expires. + _, err := svc.PutObjectWithContext(ctx, &s3.PutObjectInput{ + Bucket: aws.String(bucket), + Key: aws.String(key), + Body: os.Stdin, + }) if err != nil { - panic(err) - } - - // resp has all of the response data, pull out instance IDs: - fmt.Println("> Number of reservation sets: ", len(resp.Reservations)) - for idx, res := range resp.Reservations { - fmt.Println(" > Number of instances: ", len(res.Instances)) - for _, inst := range resp.Reservations[idx].Instances { - fmt.Println(" - Instance ID: ", *inst.InstanceId) + if aerr, ok := err.(awserr.Error); ok && aerr.Code() == request.CanceledErrorCode { + // If the SDK can determine the request or retry delay was canceled + // by a context the CanceledErrorCode error code will be returned. + fmt.Fprintf(os.Stderr, "upload canceled due to timeout, %v\n", err) + } else { + fmt.Fprintf(os.Stderr, "failed to upload object, %v\n", err) } + os.Exit(1) } + + fmt.Printf("successfully uploaded file to %s/%s\n", bucket, key) } ``` diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go index f5a7c3792..948e0a679 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -187,6 +187,10 @@ type Config struct { // request delays. This value should only be used for testing. To adjust // the delay of a request see the aws/client.DefaultRetryer and // aws/request.Retryer. + // + // SleepDelay will prevent any Context from being used for canceling retry + // delay of an API operation. It is recommended to not use SleepDelay at all + // and specify a Retryer instead. SleepDelay func(time.Duration) // DisableRestProtocolURICleaning will not clean the URL path when making rest protocol requests. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context.go b/vendor/github.com/aws/aws-sdk-go/aws/context.go new file mode 100644 index 000000000..79f426853 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context.go @@ -0,0 +1,71 @@ +package aws + +import ( + "time" +) + +// Context is an copy of the Go v1.7 stdlib's context.Context interface. +// It is represented as a SDK interface to enable you to use the "WithContext" +// API methods with Go v1.6 and a Context type such as golang.org/x/net/context. +// +// See https://golang.org/pkg/context on how to use contexts. +type Context interface { + // Deadline returns the time when work done on behalf of this context + // should be canceled. Deadline returns ok==false when no deadline is + // set. Successive calls to Deadline return the same results. + Deadline() (deadline time.Time, ok bool) + + // Done returns a channel that's closed when work done on behalf of this + // context should be canceled. Done may return nil if this context can + // never be canceled. Successive calls to Done return the same value. + Done() <-chan struct{} + + // Err returns a non-nil error value after Done is closed. Err returns + // Canceled if the context was canceled or DeadlineExceeded if the + // context's deadline passed. No other values for Err are defined. + // After Done is closed, successive calls to Err return the same value. + Err() error + + // Value returns the value associated with this context for key, or nil + // if no value is associated with key. Successive calls to Value with + // the same key returns the same result. + // + // Use context values only for request-scoped data that transits + // processes and API boundaries, not for passing optional parameters to + // functions. + Value(key interface{}) interface{} +} + +// BackgroundContext returns a context that will never be canceled, has no +// values, and no deadline. This context is used by the SDK to provide +// backwards compatibility with non-context API operations and functionality. +// +// Go 1.6 and before: +// This context function is equivalent to context.Background in the Go stdlib. +// +// Go 1.7 and later: +// The context returned will be the value returned by context.Background() +// +// See https://golang.org/pkg/context for more information on Contexts. +func BackgroundContext() Context { + return backgroundCtx +} + +// SleepWithContext will wait for the timer duration to expire, or the context +// is canceled. Which ever happens first. If the context is canceled the Context's +// error will be returned. +// +// Expects Context to always return a non-nil error if the Done channel is closed. +func SleepWithContext(ctx Context, dur time.Duration) error { + t := time.NewTimer(dur) + defer t.Stop() + + select { + case <-t.C: + break + case <-ctx.Done(): + return ctx.Err() + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go new file mode 100644 index 000000000..e8cf93d26 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go @@ -0,0 +1,41 @@ +// +build !go1.7 + +package aws + +import "time" + +// An emptyCtx is a copy of the the Go 1.7 context.emptyCtx type. This +// is copied to provide a 1.6 and 1.5 safe version of context that is compatible +// with Go 1.7's Context. +// +// An emptyCtx is never canceled, has no values, and has no deadline. It is not +// struct{}, since vars of this type must have distinct addresses. +type emptyCtx int + +func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { + return +} + +func (*emptyCtx) Done() <-chan struct{} { + return nil +} + +func (*emptyCtx) Err() error { + return nil +} + +func (*emptyCtx) Value(key interface{}) interface{} { + return nil +} + +func (e *emptyCtx) String() string { + switch e { + case backgroundCtx: + return "aws.BackgroundContext" + } + return "unknown empty Context" +} + +var ( + backgroundCtx = new(emptyCtx) +) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go new file mode 100644 index 000000000..064f75c92 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go @@ -0,0 +1,9 @@ +// +build go1.7 + +package aws + +import "context" + +var ( + backgroundCtx = context.Background() +) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index 8a7bafc78..08a666590 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -134,6 +134,16 @@ var SendHandler = request.NamedHandler{Name: "core.SendHandler", Fn: func(r *req // Catch all other request errors. r.Error = awserr.New("RequestError", "send request failed", err) r.Retryable = aws.Bool(true) // network errors are retryable + + // Override the error with a context canceled error, if that was canceled. + ctx := r.Context() + select { + case <-ctx.Done(): + r.Error = awserr.New(request.CanceledErrorCode, + "request context canceled", ctx.Err()) + r.Retryable = aws.Bool(false) + default: + } } }} @@ -156,7 +166,16 @@ var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn: if r.WillRetry() { r.RetryDelay = r.RetryRules(r) - r.Config.SleepDelay(r.RetryDelay) + + if sleepFn := r.Config.SleepDelay; sleepFn != nil { + // Support SleepDelay for backwards compatibility and testing + sleepFn(r.RetryDelay) + } else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil { + r.Error = awserr.New(request.CanceledErrorCode, + "request context canceled", err) + r.Retryable = aws.Bool(false) + return + } // when the expired token exception occurs the credentials // need to be expired locally so that the next request to diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go index 7b8ebf5f9..c29baf001 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go @@ -88,7 +88,7 @@ type Value struct { // The Provider should not need to implement its own mutexes, because // that will be managed by Credentials. type Provider interface { - // Refresh returns nil if it successfully retrieved the value. + // Retrieve returns nil if it successfully retrieved the value. // Error is returned if the value were not obtainable, or empty. Retrieve() (Value, error) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go index 0ef55040a..110ca8367 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go @@ -56,7 +56,6 @@ func Config() *aws.Config { WithMaxRetries(aws.UseServiceDefaultRetries). WithLogger(aws.NewDefaultLogger()). WithLogLevel(aws.LogOff). - WithSleepDelay(time.Sleep). WithEndpointResolver(endpoints.DefaultResolver()) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 5f0f6dd37..4adca3a7f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. package endpoints @@ -131,6 +131,7 @@ const ( StsServiceID = "sts" // Sts. SupportServiceID = "support" // Support. SwfServiceID = "swf" // Swf. + TaggingServiceID = "tagging" // Tagging. WafServiceID = "waf" // Waf. WafRegionalServiceID = "waf-regional" // WafRegional. WorkdocsServiceID = "workdocs" // Workdocs. @@ -249,6 +250,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, @@ -435,10 +437,14 @@ var awsPartition = partition{ "codebuild": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "codecommit": service{ @@ -755,10 +761,11 @@ var awsPartition = partition{ "elasticfilesystem": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "elasticloadbalancing": service{ @@ -1022,6 +1029,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, @@ -1380,7 +1388,6 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-south-1": endpoint{}, "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, @@ -1567,6 +1574,25 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "tagging": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "waf": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, @@ -1678,6 +1704,12 @@ var awscnPartition = partition{ "cn-north-1": endpoint{}, }, }, + "codedeploy": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, "config": service{ Endpoints: endpoints{ @@ -1855,6 +1887,12 @@ var awscnPartition = partition{ }, "swf": service{ + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, + "tagging": service{ + Endpoints: endpoints{ "cn-north-1": endpoint{}, }, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go index 1e7369dbf..fc7eada77 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go @@ -158,7 +158,7 @@ var funcMap = template.FuncMap{ const v3Tmpl = ` {{ define "defaults" -}} -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. package endpoints diff --git a/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go b/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go new file mode 100644 index 000000000..a94f04107 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go @@ -0,0 +1,11 @@ +package aws + +// JSONValue is a representation of a grab bag type that will be marshaled +// into a json string. This type can be used just like any other map. +// +// Example: +// values := JSONValue{ +// "Foo": "Bar", +// } +// values["Baz"] = "Qux" +type JSONValue map[string]interface{} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go index 5279c19c0..edf55384d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go @@ -18,6 +18,7 @@ type Handlers struct { UnmarshalError HandlerList Retry HandlerList AfterRetry HandlerList + Complete HandlerList } // Copy returns of this handler's lists. @@ -33,6 +34,7 @@ func (h *Handlers) Copy() Handlers { UnmarshalMeta: h.UnmarshalMeta.copy(), Retry: h.Retry.copy(), AfterRetry: h.AfterRetry.copy(), + Complete: h.Complete.copy(), } } @@ -48,6 +50,7 @@ func (h *Handlers) Clear() { h.ValidateResponse.Clear() h.Retry.Clear() h.AfterRetry.Clear() + h.Complete.Clear() } // A HandlerListRunItem represents an entry in the HandlerList which @@ -85,13 +88,17 @@ func (l *HandlerList) copy() HandlerList { n := HandlerList{ AfterEachFn: l.AfterEachFn, } - n.list = append([]NamedHandler{}, l.list...) + if len(l.list) == 0 { + return n + } + + n.list = append(make([]NamedHandler, 0, len(l.list)), l.list...) return n } // Clear clears the handler list. func (l *HandlerList) Clear() { - l.list = []NamedHandler{} + l.list = l.list[0:0] } // Len returns the number of handlers in the list. @@ -101,33 +108,49 @@ func (l *HandlerList) Len() int { // PushBack pushes handler f to the back of the handler list. func (l *HandlerList) PushBack(f func(*Request)) { - l.list = append(l.list, NamedHandler{"__anonymous", f}) -} - -// PushFront pushes handler f to the front of the handler list. -func (l *HandlerList) PushFront(f func(*Request)) { - l.list = append([]NamedHandler{{"__anonymous", f}}, l.list...) + l.PushBackNamed(NamedHandler{"__anonymous", f}) } // PushBackNamed pushes named handler f to the back of the handler list. func (l *HandlerList) PushBackNamed(n NamedHandler) { + if cap(l.list) == 0 { + l.list = make([]NamedHandler, 0, 5) + } l.list = append(l.list, n) } +// PushFront pushes handler f to the front of the handler list. +func (l *HandlerList) PushFront(f func(*Request)) { + l.PushFrontNamed(NamedHandler{"__anonymous", f}) +} + // PushFrontNamed pushes named handler f to the front of the handler list. func (l *HandlerList) PushFrontNamed(n NamedHandler) { - l.list = append([]NamedHandler{n}, l.list...) + if cap(l.list) == len(l.list) { + // Allocating new list required + l.list = append([]NamedHandler{n}, l.list...) + } else { + // Enough room to prepend into list. + l.list = append(l.list, NamedHandler{}) + copy(l.list[1:], l.list) + l.list[0] = n + } } // Remove removes a NamedHandler n func (l *HandlerList) Remove(n NamedHandler) { - newlist := []NamedHandler{} - for _, m := range l.list { - if m.Name != n.Name { - newlist = append(newlist, m) + for i := 0; i < len(l.list); i++ { + m := l.list[i] + if m.Name == n.Name { + // Shift array preventing creating new arrays + copy(l.list[i:], l.list[i+1:]) + l.list[len(l.list)-1] = NamedHandler{} + l.list = l.list[:len(l.list)-1] + + // decrement list so next check to length is correct + i-- } } - l.list = newlist } // Run executes all handlers in the list with a given request object. @@ -163,6 +186,16 @@ func HandlerListStopOnError(item HandlerListRunItem) bool { return item.Request.Error == nil } +// WithAppendUserAgent will add a string to the user agent prefixed with a +// single white space. +func WithAppendUserAgent(s string) Option { + return func(r *Request) { + r.Handlers.Build.PushBack(func(r2 *Request) { + AddToUserAgent(r, s) + }) + } +} + // MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request // header. If the extra parameters are provided they will be added as metadata to the // name/version pair resulting in the following format. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go index 77312bb66..ca9eac44e 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go @@ -16,6 +16,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" ) +// CanceledErrorCode is the error code that will be returned by an +// API request that was canceled. Requests given a aws.Context may +// return this error when canceled. +const CanceledErrorCode = "RequestCanceled" + // A Request is the service request to be made. type Request struct { Config aws.Config @@ -41,12 +46,14 @@ type Request struct { SignedHeaderVals http.Header LastSignedAt time.Time + context aws.Context + built bool - // Need to persist an intermideant body betweend the input Body and HTTP + // Need to persist an intermediate body between the input Body and HTTP // request body because the HTTP Client's transport can maintain a reference // to the HTTP request's body after the client has returned. This value is - // safe to use concurrently and rewraps the input Body for each HTTP request. + // safe to use concurrently and wrap the input Body for each HTTP request. safeBody *offsetReader } @@ -60,14 +67,6 @@ type Operation struct { BeforePresignFn func(r *Request) error } -// Paginator keeps track of pagination configuration for an API operation. -type Paginator struct { - InputTokens []string - OutputTokens []string - LimitToken string - TruncationToken string -} - // New returns a new Request pointer for the service API // operation and parameters. // @@ -111,6 +110,94 @@ func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, return r } +// A Option is a functional option that can augment or modify a request when +// using a WithContext API operation method. +type Option func(*Request) + +// WithGetResponseHeader builds a request Option which will retrieve a single +// header value from the HTTP Response. If there are multiple values for the +// header key use WithGetResponseHeaders instead to access the http.Header +// map directly. The passed in val pointer must be non-nil. +// +// This Option can be used multiple times with a single API operation. +// +// var id2, versionID string +// svc.PutObjectWithContext(ctx, params, +// request.WithGetResponseHeader("x-amz-id-2", &id2), +// request.WithGetResponseHeader("x-amz-version-id", &versionID), +// ) +func WithGetResponseHeader(key string, val *string) Option { + return func(r *Request) { + r.Handlers.Complete.PushBack(func(req *Request) { + *val = req.HTTPResponse.Header.Get(key) + }) + } +} + +// WithGetResponseHeaders builds a request Option which will retrieve the +// headers from the HTTP response and assign them to the passed in headers +// variable. The passed in headers pointer must be non-nil. +// +// var headers http.Header +// svc.PutObjectWithContext(ctx, params, request.WithGetResponseHeaders(&headers)) +func WithGetResponseHeaders(headers *http.Header) Option { + return func(r *Request) { + r.Handlers.Complete.PushBack(func(req *Request) { + *headers = req.HTTPResponse.Header + }) + } +} + +// WithLogLevel is a request option that will set the request to use a specific +// log level when the request is made. +// +// svc.PutObjectWithContext(ctx, params, request.WithLogLevel(aws.LogDebugWithHTTPBody) +func WithLogLevel(l aws.LogLevelType) Option { + return func(r *Request) { + r.Config.LogLevel = aws.LogLevel(l) + } +} + +// ApplyOptions will apply each option to the request calling them in the order +// the were provided. +func (r *Request) ApplyOptions(opts ...Option) { + for _, opt := range opts { + opt(r) + } +} + +// Context will always returns a non-nil context. If Request does not have a +// context aws.BackgroundContext will be returned. +func (r *Request) Context() aws.Context { + if r.context != nil { + return r.context + } + return aws.BackgroundContext() +} + +// SetContext adds a Context to the current request that can be used to cancel +// a in-flight request. The Context value must not be nil, or this method will +// panic. +// +// Unlike http.Request.WithContext, SetContext does not return a copy of the +// Request. It is not safe to use use a single Request value for multiple +// requests. A new Request should be created for each API operation request. +// +// Go 1.6 and below: +// The http.Request's Cancel field will be set to the Done() value of +// the context. This will overwrite the Cancel field's value. +// +// Go 1.7 and above: +// The http.Request.WithContext will be used to set the context on the underlying +// http.Request. This will create a shallow copy of the http.Request. The SDK +// may create sub contexts in the future for nested requests such as retries. +func (r *Request) SetContext(ctx aws.Context) { + if ctx == nil { + panic("context cannot be nil") + } + setRequestContext(r, ctx) +} + // WillRetry returns if the request's can be retried. func (r *Request) WillRetry() bool { return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() @@ -344,6 +431,12 @@ func (r *Request) GetBody() io.ReadSeeker { // // Send will not close the request.Request's body. func (r *Request) Send() error { + defer func() { + // Regardless of success or failure of the request trigger the Complete + // request handlers. + r.Handlers.Complete.Run(r) + }() + for { if aws.BoolValue(r.Retryable) { if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { @@ -446,6 +539,9 @@ func shouldRetryCancel(r *Request) bool { timeoutErr := false errStr := r.Error.Error() if ok { + if awsErr.Code() == CanceledErrorCode { + return false + } err := awsErr.OrigErr() netErr, netOK := err.(net.Error) timeoutErr = netOK && netErr.Temporary() diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go new file mode 100644 index 000000000..a7365cd1e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go @@ -0,0 +1,14 @@ +// +build go1.7 + +package request + +import "github.com/aws/aws-sdk-go/aws" + +// setContext updates the Request to use the passed in context for cancellation. +// Context will also be used for request retry delay. +// +// Creates shallow copy of the http.Request with the WithContext method. +func setRequestContext(r *Request, ctx aws.Context) { + r.context = ctx + r.HTTPRequest = r.HTTPRequest.WithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go new file mode 100644 index 000000000..307fa0705 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go @@ -0,0 +1,14 @@ +// +build !go1.7 + +package request + +import "github.com/aws/aws-sdk-go/aws" + +// setContext updates the Request to use the passed in context for cancellation. +// Context will also be used for request retry delay. +// +// Creates shallow copy of the http.Request with the WithContext method. +func setRequestContext(r *Request, ctx aws.Context) { + r.context = ctx + r.HTTPRequest.Cancel = ctx.Done() +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go index 2939ec473..59de6736b 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go @@ -2,29 +2,125 @@ package request import ( "reflect" + "sync/atomic" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" ) -//type Paginater interface { -// HasNextPage() bool -// NextPage() *Request -// EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error -//} +// A Pagination 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 +// 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) +// // 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 { + // 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 + // returned. + // + // NewRequest should always be built from the same API operations. It is + // undefined if different API operations are returned on subsequent calls. + NewRequest func() (*Request, error) -// HasNextPage returns true if this request has more pages of data available. -func (r *Request) HasNextPage() bool { - return len(r.nextPageTokens()) > 0 + started bool + nextTokens []interface{} + + err error + curPage interface{} } -// nextPageTokens returns the tokens to use when asking for the next page of -// data. +// HasNextPage will return true if Pagination 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 { + return !(p.started && len(p.nextTokens) == 0) +} + +// Err returns the error Pagination encountered when retrieving the next page. +func (p *Pagination) Err() error { + return p.err +} + +// Page 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{} { + return p.curPage +} + +// Next will attempt to retrieve the next page for the API operation. When a page +// is retrieved true will be returned. If the page cannot be retrieved, or there +// are no more pages false will be returned. +// +// Use the Page method to retrieve the current page data. The data will need +// 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() { + return false + } + + req, err := p.NewRequest() + if err != nil { + p.err = err + return false + } + + if p.started { + for i, intok := range req.Operation.InputTokens { + awsutil.SetValueAtPath(req.Params, intok, p.nextTokens[i]) + } + } + p.started = true + + err = req.Send() + if err != nil { + p.err = err + return false + } + + p.nextTokens = req.nextPageTokens() + p.curPage = req.Data + + return true +} + +// A Paginator is the configuration data that defines how an API operation +// 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 +// is only used to store the token metadata the SDK should use for performing +// pagination. +type Paginator struct { + InputTokens []string + OutputTokens []string + LimitToken string + TruncationToken string +} + +// nextPageTokens returns the tokens to use when asking for the next page of data. func (r *Request) nextPageTokens() []interface{} { if r.Operation.Paginator == nil { return nil } - if r.Operation.TruncationToken != "" { tr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken) if len(tr) == 0 { @@ -61,9 +157,40 @@ func (r *Request) nextPageTokens() []interface{} { return tokens } +// Ensure a deprecated item is only logged once instead of each time its used. +func logDeprecatedf(logger aws.Logger, flag *int32, msg string) { + if logger == nil { + return + } + if atomic.CompareAndSwapInt32(flag, 0, 1) { + logger.Log(msg) + } +} + +var ( + logDeprecatedHasNextPage int32 + 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 @@ -90,7 +217,12 @@ func (r *Request) NextPage() *Request { // 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 diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go index ebd60ccc4..1d5ad8c1d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go @@ -26,8 +26,9 @@ func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { // retryableCodes is a collection of service response codes which are retry-able // without any further action. var retryableCodes = map[string]struct{}{ - "RequestError": {}, - "RequestTimeout": {}, + "RequestError": {}, + "RequestTimeout": {}, + "RequestTimeoutException": {}, // Glacier's flavor of RequestTimeout } var throttleCodes = map[string]struct{}{ diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go new file mode 100644 index 000000000..354c3812e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go @@ -0,0 +1,293 @@ +package request + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/awsutil" +) + +// WaiterResourceNotReadyErrorCode is the error code returned by a waiter when +// the waiter's max attempts have been exhausted. +const WaiterResourceNotReadyErrorCode = "ResourceNotReady" + +// A WaiterOption is a function that will update the Waiter value's fields to +// configure the waiter. +type WaiterOption func(*Waiter) + +// WithWaiterMaxAttempts returns the maximum number of times the waiter should +// attempt to check the resource for the target state. +func WithWaiterMaxAttempts(max int) WaiterOption { + return func(w *Waiter) { + w.MaxAttempts = max + } +} + +// WaiterDelay will return a delay the waiter should pause between attempts to +// check the resource state. The passed in attempt is the number of times the +// Waiter has checked the resource state. +// +// Attempt is the number of attempts the Waiter has made checking the resource +// state. +type WaiterDelay func(attempt int) time.Duration + +// ConstantWaiterDelay returns a WaiterDelay that will always return a constant +// delay the waiter should use between attempts. It ignores the number of +// attempts made. +func ConstantWaiterDelay(delay time.Duration) WaiterDelay { + return func(attempt int) time.Duration { + return delay + } +} + +// WithWaiterDelay will set the Waiter to use the WaiterDelay passed in. +func WithWaiterDelay(delayer WaiterDelay) WaiterOption { + return func(w *Waiter) { + w.Delay = delayer + } +} + +// WithWaiterLogger returns a waiter option to set the logger a waiter +// should use to log warnings and errors to. +func WithWaiterLogger(logger aws.Logger) WaiterOption { + return func(w *Waiter) { + w.Logger = logger + } +} + +// WithWaiterRequestOptions returns a waiter option setting the request +// options for each request the waiter makes. Appends to waiter's request +// options already set. +func WithWaiterRequestOptions(opts ...Option) WaiterOption { + return func(w *Waiter) { + w.RequestOptions = append(w.RequestOptions, opts...) + } +} + +// A Waiter provides the functionality to performing blocking call which will +// wait for an resource state to be satisfied a service. +// +// This type should not be used directly. The API operations provided in the +// service packages prefixed with "WaitUntil" should be used instead. +type Waiter struct { + Name string + Acceptors []WaiterAcceptor + Logger aws.Logger + + MaxAttempts int + Delay WaiterDelay + + RequestOptions []Option + NewRequest func([]Option) (*Request, error) +} + +// ApplyOptions updates the waiter with the list of waiter options provided. +func (w *Waiter) ApplyOptions(opts ...WaiterOption) { + for _, fn := range opts { + fn(w) + } +} + +// WaiterState are states the waiter uses based on WaiterAcceptor definitions +// to identify if the resource state the waiter is waiting on has occurred. +type WaiterState int + +// String returns the string representation of the waiter state. +func (s WaiterState) String() string { + switch s { + case SuccessWaiterState: + return "success" + case FailureWaiterState: + return "failure" + case RetryWaiterState: + return "retry" + default: + return "unknown waiter state" + } +} + +// States the waiter acceptors will use to identify target resource states. +const ( + SuccessWaiterState WaiterState = iota // waiter successful + FailureWaiterState // waiter failed + RetryWaiterState // waiter needs to be retried +) + +// WaiterMatchMode is the mode that the waiter will use to match the WaiterAcceptor +// definition's Expected attribute. +type WaiterMatchMode int + +// Modes the waiter will use when inspecting API response to identify target +// resource states. +const ( + PathAllWaiterMatch WaiterMatchMode = iota // match on all paths + PathWaiterMatch // match on specific path + PathAnyWaiterMatch // match on any path + PathListWaiterMatch // match on list of paths + StatusWaiterMatch // match on status code + ErrorWaiterMatch // match on error +) + +// String returns the string representation of the waiter match mode. +func (m WaiterMatchMode) String() string { + switch m { + case PathAllWaiterMatch: + return "pathAll" + case PathWaiterMatch: + return "path" + case PathAnyWaiterMatch: + return "pathAny" + case PathListWaiterMatch: + return "pathList" + case StatusWaiterMatch: + return "status" + case ErrorWaiterMatch: + return "error" + default: + return "unknown waiter match mode" + } +} + +// WaitWithContext will make requests for the API operation using NewRequest to +// build API requests. The request's response will be compared against the +// Waiter's Acceptors to determine the successful state of the resource the +// waiter is inspecting. +// +// The passed in context must not be nil. If it is nil a panic will occur. The +// Context will be used to cancel the waiter's pending requests and retry delays. +// Use aws.BackgroundContext if no context is available. +// +// The waiter will continue until the target state defined by the Acceptors, +// or the max attempts expires. +// +// Will return the WaiterResourceNotReadyErrorCode error code if the waiter's +// retryer ShouldRetry returns false. This normally will happen when the max +// wait attempts expires. +func (w Waiter) WaitWithContext(ctx aws.Context) error { + + for attempt := 1; ; attempt++ { + req, err := w.NewRequest(w.RequestOptions) + if err != nil { + waiterLogf(w.Logger, "unable to create request %v", err) + return err + } + req.Handlers.Build.PushBack(MakeAddToUserAgentFreeFormHandler("Waiter")) + err = req.Send() + + // See if any of the acceptors match the request's response, or error + for _, a := range w.Acceptors { + var matched bool + matched, err = a.match(w.Name, w.Logger, req, err) + if err != nil { + // Error occurred during current waiter call + return err + } else if matched { + // Match was found can stop here and return + return nil + } + } + + // The Waiter should only check the resource state MaxAttempts times + // This is here instead of in the for loop above to prevent delaying + // unnecessary when the waiter will not retry. + if attempt == w.MaxAttempts { + break + } + + // Delay to wait before inspecting the resource again + delay := w.Delay(attempt) + if sleepFn := req.Config.SleepDelay; sleepFn != nil { + // Support SleepDelay for backwards compatibility and testing + sleepFn(delay) + } else if err := aws.SleepWithContext(ctx, delay); err != nil { + return awserr.New(CanceledErrorCode, "waiter context canceled", err) + } + } + + return awserr.New(WaiterResourceNotReadyErrorCode, "exceeded wait attempts", nil) +} + +// A WaiterAcceptor provides the information needed to wait for an API operation +// to complete. +type WaiterAcceptor struct { + State WaiterState + Matcher WaiterMatchMode + Argument string + Expected interface{} +} + +// match returns if the acceptor found a match with the passed in request +// or error. True is returned if the acceptor made a match, error is returned +// if there was an error attempting to perform the match. +func (a *WaiterAcceptor) match(name string, l aws.Logger, req *Request, err error) (bool, error) { + result := false + var vals []interface{} + + switch a.Matcher { + case PathAllWaiterMatch, PathWaiterMatch: + // Require all matches to be equal for result to match + vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) + if len(vals) == 0 { + break + } + result = true + for _, val := range vals { + if !awsutil.DeepEqual(val, a.Expected) { + result = false + break + } + } + case PathAnyWaiterMatch: + // Only a single match needs to equal for the result to match + vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) + for _, val := range vals { + if awsutil.DeepEqual(val, a.Expected) { + result = true + break + } + } + case PathListWaiterMatch: + // ignored matcher + case StatusWaiterMatch: + s := a.Expected.(int) + result = s == req.HTTPResponse.StatusCode + case ErrorWaiterMatch: + if aerr, ok := err.(awserr.Error); ok { + result = aerr.Code() == a.Expected.(string) + } + default: + waiterLogf(l, "WARNING: Waiter %s encountered unexpected matcher: %s", + name, a.Matcher) + } + + if !result { + // If there was no matching result found there is nothing more to do + // for this response, retry the request. + return false, nil + } + + switch a.State { + case SuccessWaiterState: + // waiter completed + return true, nil + case FailureWaiterState: + // Waiter failure state triggered + return false, awserr.New("ResourceNotReady", + "failed waiting for successful resource state", err) + case RetryWaiterState: + // clear the error and retry the operation + return false, nil + default: + waiterLogf(l, "WARNING: Waiter %s encountered unexpected state: %s", + name, a.State) + return false, nil + } +} + +func waiterLogf(logger aws.Logger, msg string, args ...interface{}) { + if logger != nil { + logger.Log(fmt.Sprintf(msg, args...)) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go new file mode 100644 index 000000000..6aa2ed241 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go @@ -0,0 +1,7 @@ +package v4 + +// WithUnsignedPayload will enable and set the UnsignedPayload field to +// true of the signer. +func WithUnsignedPayload(v4 *Signer) { + v4.UnsignedPayload = true +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go index 98bfe742b..434ac872d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go @@ -194,6 +194,10 @@ type Signer struct { // This value should only be used for testing. If it is nil the default // time.Now will be used. currentTimeFn func() time.Time + + // UnsignedPayload will prevent signing of the payload. This will only + // work for services that have support for this. + UnsignedPayload bool } // NewSigner returns a Signer pointer configured with the credentials and optional @@ -227,6 +231,7 @@ type signingCtx struct { isPresign bool formattedTime string formattedShortTime string + unsignedPayload bool bodyDigest string signedHeaders string @@ -317,6 +322,7 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi ServiceName: service, Region: region, DisableURIPathEscaping: v4.DisableURIPathEscaping, + unsignedPayload: v4.UnsignedPayload, } for key := range ctx.Query { @@ -409,7 +415,18 @@ var SignRequestHandler = request.NamedHandler{ func SignSDKRequest(req *request.Request) { signSDKRequestWithCurrTime(req, time.Now) } -func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time) { + +// BuildNamedHandler will build a generic handler for signing. +func BuildNamedHandler(name string, opts ...func(*Signer)) request.NamedHandler { + return request.NamedHandler{ + Name: name, + Fn: func(req *request.Request) { + signSDKRequestWithCurrTime(req, time.Now, opts...) + }, + } +} + +func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) { // If the request does not need to be signed ignore the signing of the // request if the AnonymousCredentials object is used. if req.Config.Credentials == credentials.AnonymousCredentials { @@ -441,6 +458,10 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time v4.DisableRequestBodyOverwrite = true }) + for _, opt := range opts { + opt(v4) + } + signingTime := req.Time if !req.LastSignedAt.IsZero() { signingTime = req.LastSignedAt @@ -634,14 +655,14 @@ func (ctx *signingCtx) buildSignature() { func (ctx *signingCtx) buildBodyDigest() { hash := ctx.Request.Header.Get("X-Amz-Content-Sha256") if hash == "" { - if ctx.isPresign && ctx.ServiceName == "s3" { + if ctx.unsignedPayload || (ctx.isPresign && ctx.ServiceName == "s3") { hash = "UNSIGNED-PAYLOAD" } else if ctx.Body == nil { hash = emptyStringSHA256 } else { hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) } - if ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" { + if ctx.unsignedPayload || ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" { ctx.Request.Header.Set("X-Amz-Content-Sha256", hash) } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index 438506bf4..f8531cf93 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.7.9" +const SDKVersion = "1.8.8" diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go index 20a41d462..716183564 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go @@ -4,6 +4,7 @@ package rest import ( "bytes" "encoding/base64" + "encoding/json" "fmt" "io" "net/http" @@ -82,8 +83,12 @@ func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bo if name == "" { name = field.Name } - if m.Kind() == reflect.Ptr { + if kind := m.Kind(); kind == reflect.Ptr { m = m.Elem() + } else if kind == reflect.Interface { + if !m.Elem().IsValid() { + continue + } } if !m.IsValid() { continue @@ -95,16 +100,16 @@ func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bo var err error switch field.Tag.Get("location") { case "headers": // header maps - err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag.Get("locationName")) + err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag) case "header": - err = buildHeader(&r.HTTPRequest.Header, m, name) + err = buildHeader(&r.HTTPRequest.Header, m, name, field.Tag) case "uri": - err = buildURI(r.HTTPRequest.URL, m, name) + err = buildURI(r.HTTPRequest.URL, m, name, field.Tag) case "querystring": - err = buildQueryString(query, m, name) + err = buildQueryString(query, m, name, field.Tag) default: if buildGETQuery { - err = buildQueryString(query, m, name) + err = buildQueryString(query, m, name, field.Tag) } } r.Error = err @@ -145,8 +150,8 @@ func buildBody(r *request.Request, v reflect.Value) { } } -func buildHeader(header *http.Header, v reflect.Value, name string) error { - str, err := convertType(v) +func buildHeader(header *http.Header, v reflect.Value, name string, tag reflect.StructTag) error { + str, err := convertType(v, tag) if err == errValueNotSet { return nil } else if err != nil { @@ -158,9 +163,10 @@ func buildHeader(header *http.Header, v reflect.Value, name string) error { return nil } -func buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error { +func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag) error { + prefix := tag.Get("locationName") for _, key := range v.MapKeys() { - str, err := convertType(v.MapIndex(key)) + str, err := convertType(v.MapIndex(key), tag) if err == errValueNotSet { continue } else if err != nil { @@ -173,8 +179,8 @@ func buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error { return nil } -func buildURI(u *url.URL, v reflect.Value, name string) error { - value, err := convertType(v) +func buildURI(u *url.URL, v reflect.Value, name string, tag reflect.StructTag) error { + value, err := convertType(v, tag) if err == errValueNotSet { return nil } else if err != nil { @@ -190,7 +196,7 @@ func buildURI(u *url.URL, v reflect.Value, name string) error { return nil } -func buildQueryString(query url.Values, v reflect.Value, name string) error { +func buildQueryString(query url.Values, v reflect.Value, name string, tag reflect.StructTag) error { switch value := v.Interface().(type) { case []*string: for _, item := range value { @@ -207,7 +213,7 @@ func buildQueryString(query url.Values, v reflect.Value, name string) error { } } default: - str, err := convertType(v) + str, err := convertType(v, tag) if err == errValueNotSet { return nil } else if err != nil { @@ -246,7 +252,7 @@ func EscapePath(path string, encodeSep bool) string { return buf.String() } -func convertType(v reflect.Value) (string, error) { +func convertType(v reflect.Value, tag reflect.StructTag) (string, error) { v = reflect.Indirect(v) if !v.IsValid() { return "", errValueNotSet @@ -266,6 +272,16 @@ func convertType(v reflect.Value) (string, error) { str = strconv.FormatFloat(value, 'f', -1, 64) case time.Time: str = value.UTC().Format(RFC822) + case aws.JSONValue: + b, err := json.Marshal(value) + if err != nil { + return "", err + } + if tag.Get("location") == "header" { + str = base64.StdEncoding.EncodeToString(b) + } else { + str = string(b) + } default: err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) return "", err diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go index 9c00921c0..7a779ee22 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go @@ -3,6 +3,7 @@ package rest import ( "bytes" "encoding/base64" + "encoding/json" "fmt" "io" "io/ioutil" @@ -12,6 +13,7 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" ) @@ -111,7 +113,7 @@ func unmarshalLocationElements(r *request.Request, v reflect.Value) { case "statusCode": unmarshalStatusCode(m, r.HTTPResponse.StatusCode) case "header": - err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name)) + err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name), field.Tag) if err != nil { r.Error = awserr.New("SerializationError", "failed to decode REST response", err) break @@ -158,8 +160,13 @@ func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) err return nil } -func unmarshalHeader(v reflect.Value, header string) error { - if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { +func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) error { + isJSONValue := tag.Get("type") == "jsonvalue" + if isJSONValue { + if len(header) == 0 { + return nil + } + } else if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { return nil } @@ -196,6 +203,22 @@ func unmarshalHeader(v reflect.Value, header string) error { return err } v.Set(reflect.ValueOf(&t)) + case aws.JSONValue: + b := []byte(header) + var err error + if tag.Get("location") == "header" { + b, err = base64.StdEncoding.DecodeString(header) + if err != nil { + return err + } + } + + m := aws.JSONValue{} + err = json.Unmarshal(b, &m) + if err != nil { + return err + } + v.Set(reflect.ValueOf(m)) default: err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) return err diff --git a/vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go b/vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go deleted file mode 100644 index b51e9449c..000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go +++ /dev/null @@ -1,134 +0,0 @@ -package waiter - -import ( - "fmt" - "reflect" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -// A Config provides a collection of configuration values to setup a generated -// waiter code with. -type Config struct { - Name string - Delay int - MaxAttempts int - Operation string - Acceptors []WaitAcceptor -} - -// A WaitAcceptor provides the information needed to wait for an API operation -// to complete. -type WaitAcceptor struct { - Expected interface{} - Matcher string - State string - Argument string -} - -// A Waiter provides waiting for an operation to complete. -type Waiter struct { - Config - Client interface{} - Input interface{} -} - -// Wait waits for an operation to complete, expire max attempts, or fail. Error -// is returned if the operation fails. -func (w *Waiter) Wait() error { - client := reflect.ValueOf(w.Client) - in := reflect.ValueOf(w.Input) - method := client.MethodByName(w.Config.Operation + "Request") - - for i := 0; i < w.MaxAttempts; i++ { - res := method.Call([]reflect.Value{in}) - req := res[0].Interface().(*request.Request) - req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Waiter")) - - err := req.Send() - for _, a := range w.Acceptors { - result := false - var vals []interface{} - switch a.Matcher { - case "pathAll", "path": - // Require all matches to be equal for result to match - vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) - if len(vals) == 0 { - break - } - result = true - for _, val := range vals { - if !awsutil.DeepEqual(val, a.Expected) { - result = false - break - } - } - case "pathAny": - // Only a single match needs to equal for the result to match - vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) - for _, val := range vals { - if awsutil.DeepEqual(val, a.Expected) { - result = true - break - } - } - case "status": - s := a.Expected.(int) - result = s == req.HTTPResponse.StatusCode - case "error": - if aerr, ok := err.(awserr.Error); ok { - result = aerr.Code() == a.Expected.(string) - } - case "pathList": - // ignored matcher - default: - logf(client, "WARNING: Waiter for %s encountered unexpected matcher: %s", - w.Config.Operation, a.Matcher) - } - - if !result { - // If there was no matching result found there is nothing more to do - // for this response, retry the request. - continue - } - - switch a.State { - case "success": - // waiter completed - return nil - case "failure": - // Waiter failure state triggered - return awserr.New("ResourceNotReady", - fmt.Sprintf("failed waiting for successful resource state"), err) - case "retry": - // clear the error and retry the operation - err = nil - default: - logf(client, "WARNING: Waiter for %s encountered unexpected state: %s", - w.Config.Operation, a.State) - } - } - if err != nil { - return err - } - - time.Sleep(time.Second * time.Duration(w.Delay)) - } - - return awserr.New("ResourceNotReady", - fmt.Sprintf("exceeded %d wait attempts", w.MaxAttempts), nil) -} - -func logf(client reflect.Value, msg string, args ...interface{}) { - cfgVal := client.FieldByName("Config") - if !cfgVal.IsValid() { - return - } - if cfg, ok := cfgVal.Interface().(*aws.Config); ok && cfg.Logger != nil { - cfg.Logger.Log(fmt.Sprintf(msg, args...)) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/acm/api.go b/vendor/github.com/aws/aws-sdk-go/service/acm/api.go index d17990db4..c1dfaf9ea 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/acm/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/acm/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package acm provides a client for AWS Certificate Manager. package acm @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -103,8 +104,23 @@ func (c *ACM) AddTagsToCertificateRequest(input *AddTagsToCertificateInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/AddTagsToCertificate func (c *ACM) AddTagsToCertificate(input *AddTagsToCertificateInput) (*AddTagsToCertificateOutput, error) { req, out := c.AddTagsToCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsToCertificateWithContext is the same as AddTagsToCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See AddTagsToCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsToCertificateWithContext(ctx aws.Context, input *AddTagsToCertificateInput, opts ...request.Option) (*AddTagsToCertificateOutput, error) { + req, out := c.AddTagsToCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCertificate = "DeleteCertificate" @@ -186,8 +202,23 @@ func (c *ACM) DeleteCertificateRequest(input *DeleteCertificateInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DeleteCertificate func (c *ACM) DeleteCertificate(input *DeleteCertificateInput) (*DeleteCertificateOutput, error) { req, out := c.DeleteCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteCertificateWithContext is the same as DeleteCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteCertificateWithContext(ctx aws.Context, input *DeleteCertificateInput, opts ...request.Option) (*DeleteCertificateOutput, error) { + req, out := c.DeleteCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeCertificate = "DescribeCertificate" @@ -255,8 +286,23 @@ func (c *ACM) DescribeCertificateRequest(input *DescribeCertificateInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DescribeCertificate func (c *ACM) DescribeCertificate(input *DescribeCertificateInput) (*DescribeCertificateOutput, error) { req, out := c.DescribeCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCertificateWithContext is the same as DescribeCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCertificateWithContext(ctx aws.Context, input *DescribeCertificateInput, opts ...request.Option) (*DescribeCertificateOutput, error) { + req, out := c.DescribeCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetCertificate = "GetCertificate" @@ -336,8 +382,23 @@ func (c *ACM) GetCertificateRequest(input *GetCertificateInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/GetCertificate func (c *ACM) GetCertificate(input *GetCertificateInput) (*GetCertificateOutput, error) { req, out := c.GetCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetCertificateWithContext is the same as GetCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See GetCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetCertificateWithContext(ctx aws.Context, input *GetCertificateInput, opts ...request.Option) (*GetCertificateOutput, error) { + req, out := c.GetCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportCertificate = "ImportCertificate" @@ -434,8 +495,23 @@ func (c *ACM) ImportCertificateRequest(input *ImportCertificateInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ImportCertificate func (c *ACM) ImportCertificate(input *ImportCertificateInput) (*ImportCertificateOutput, error) { req, out := c.ImportCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportCertificateWithContext is the same as ImportCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See ImportCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportCertificateWithContext(ctx aws.Context, input *ImportCertificateInput, opts ...request.Option) (*ImportCertificateOutput, error) { + req, out := c.ImportCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListCertificates = "ListCertificates" @@ -502,8 +578,23 @@ func (c *ACM) ListCertificatesRequest(input *ListCertificatesInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListCertificates func (c *ACM) ListCertificates(input *ListCertificatesInput) (*ListCertificatesOutput, error) { req, out := c.ListCertificatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListCertificatesWithContext is the same as ListCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See ListCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListCertificatesWithContext(ctx aws.Context, input *ListCertificatesInput, opts ...request.Option) (*ListCertificatesOutput, error) { + req, out := c.ListCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListCertificatesPages iterates over the pages of a ListCertificates operation, @@ -523,12 +614,37 @@ func (c *ACM) ListCertificates(input *ListCertificatesInput) (*ListCertificatesO // return pageNum <= 3 // }) // -func (c *ACM) ListCertificatesPages(input *ListCertificatesInput, fn func(p *ListCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListCertificatesOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListCertificatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListCertificatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListCertificatesOutput), !p.HasNextPage()) + } + return p.Err() } const opListTagsForCertificate = "ListTagsForCertificate" @@ -599,8 +715,23 @@ func (c *ACM) ListTagsForCertificateRequest(input *ListTagsForCertificateInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListTagsForCertificate func (c *ACM) ListTagsForCertificate(input *ListTagsForCertificateInput) (*ListTagsForCertificateOutput, error) { req, out := c.ListTagsForCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForCertificateWithContext is the same as ListTagsForCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForCertificateWithContext(ctx aws.Context, input *ListTagsForCertificateInput, opts ...request.Option) (*ListTagsForCertificateOutput, error) { + req, out := c.ListTagsForCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTagsFromCertificate = "RemoveTagsFromCertificate" @@ -681,8 +812,23 @@ func (c *ACM) RemoveTagsFromCertificateRequest(input *RemoveTagsFromCertificateI // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RemoveTagsFromCertificate func (c *ACM) RemoveTagsFromCertificate(input *RemoveTagsFromCertificateInput) (*RemoveTagsFromCertificateOutput, error) { req, out := c.RemoveTagsFromCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsFromCertificateWithContext is the same as RemoveTagsFromCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTagsFromCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsFromCertificateWithContext(ctx aws.Context, input *RemoveTagsFromCertificateInput, opts ...request.Option) (*RemoveTagsFromCertificateOutput, error) { + req, out := c.RemoveTagsFromCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRequestCertificate = "RequestCertificate" @@ -759,8 +905,23 @@ func (c *ACM) RequestCertificateRequest(input *RequestCertificateInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RequestCertificate func (c *ACM) RequestCertificate(input *RequestCertificateInput) (*RequestCertificateOutput, error) { req, out := c.RequestCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RequestCertificateWithContext is the same as RequestCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See RequestCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RequestCertificateWithContext(ctx aws.Context, input *RequestCertificateInput, opts ...request.Option) (*RequestCertificateOutput, error) { + req, out := c.RequestCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResendValidationEmail = "ResendValidationEmail" @@ -847,8 +1008,23 @@ func (c *ACM) ResendValidationEmailRequest(input *ResendValidationEmailInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ResendValidationEmail func (c *ACM) ResendValidationEmail(input *ResendValidationEmailInput) (*ResendValidationEmailOutput, error) { req, out := c.ResendValidationEmailRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResendValidationEmailWithContext is the same as ResendValidationEmail with the addition of +// the ability to pass a context and additional request options. +// +// See ResendValidationEmail for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResendValidationEmailWithContext(ctx aws.Context, input *ResendValidationEmailInput, opts ...request.Option) (*ResendValidationEmailOutput, error) { + req, out := c.ResendValidationEmailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/AddTagsToCertificateRequest diff --git a/vendor/github.com/aws/aws-sdk-go/service/acm/errors.go b/vendor/github.com/aws/aws-sdk-go/service/acm/errors.go index 73093d1c5..d09bda760 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/acm/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/acm/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package acm diff --git a/vendor/github.com/aws/aws-sdk-go/service/acm/service.go b/vendor/github.com/aws/aws-sdk-go/service/acm/service.go index 0c1d69a59..299438ea0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/acm/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/acm/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package acm diff --git a/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go b/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go index e0af3861b..dd18497a9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package apigateway provides a client for Amazon API Gateway. package apigateway @@ -6,6 +6,7 @@ package apigateway import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -81,8 +82,23 @@ func (c *APIGateway) CreateApiKeyRequest(input *CreateApiKeyInput) (req *request // func (c *APIGateway) CreateApiKey(input *CreateApiKeyInput) (*ApiKey, error) { req, out := c.CreateApiKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateApiKeyWithContext is the same as CreateApiKey with the addition of +// the ability to pass a context and additional request options. +// +// See CreateApiKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateApiKeyWithContext(ctx aws.Context, input *CreateApiKeyInput, opts ...request.Option) (*ApiKey, error) { + req, out := c.CreateApiKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAuthorizer = "CreateAuthorizer" @@ -152,8 +168,23 @@ func (c *APIGateway) CreateAuthorizerRequest(input *CreateAuthorizerInput) (req // func (c *APIGateway) CreateAuthorizer(input *CreateAuthorizerInput) (*Authorizer, error) { req, out := c.CreateAuthorizerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAuthorizerWithContext is the same as CreateAuthorizer with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAuthorizer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAuthorizerWithContext(ctx aws.Context, input *CreateAuthorizerInput, opts ...request.Option) (*Authorizer, error) { + req, out := c.CreateAuthorizerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateBasePathMapping = "CreateBasePathMapping" @@ -221,8 +252,23 @@ func (c *APIGateway) CreateBasePathMappingRequest(input *CreateBasePathMappingIn // func (c *APIGateway) CreateBasePathMapping(input *CreateBasePathMappingInput) (*BasePathMapping, error) { req, out := c.CreateBasePathMappingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateBasePathMappingWithContext is the same as CreateBasePathMapping with the addition of +// the ability to pass a context and additional request options. +// +// See CreateBasePathMapping for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateBasePathMappingWithContext(ctx aws.Context, input *CreateBasePathMappingInput, opts ...request.Option) (*BasePathMapping, error) { + req, out := c.CreateBasePathMappingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDeployment = "CreateDeployment" @@ -295,8 +341,23 @@ func (c *APIGateway) CreateDeploymentRequest(input *CreateDeploymentInput) (req // func (c *APIGateway) CreateDeployment(input *CreateDeploymentInput) (*Deployment, error) { req, out := c.CreateDeploymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDeploymentWithContext is the same as CreateDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDeploymentWithContext(ctx aws.Context, input *CreateDeploymentInput, opts ...request.Option) (*Deployment, error) { + req, out := c.CreateDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDocumentationPart = "CreateDocumentationPart" @@ -364,8 +425,23 @@ func (c *APIGateway) CreateDocumentationPartRequest(input *CreateDocumentationPa // func (c *APIGateway) CreateDocumentationPart(input *CreateDocumentationPartInput) (*DocumentationPart, error) { req, out := c.CreateDocumentationPartRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDocumentationPartWithContext is the same as CreateDocumentationPart with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDocumentationPart for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDocumentationPartWithContext(ctx aws.Context, input *CreateDocumentationPartInput, opts ...request.Option) (*DocumentationPart, error) { + req, out := c.CreateDocumentationPartRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDocumentationVersion = "CreateDocumentationVersion" @@ -433,8 +509,23 @@ func (c *APIGateway) CreateDocumentationVersionRequest(input *CreateDocumentatio // func (c *APIGateway) CreateDocumentationVersion(input *CreateDocumentationVersionInput) (*DocumentationVersion, error) { req, out := c.CreateDocumentationVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDocumentationVersionWithContext is the same as CreateDocumentationVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDocumentationVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDocumentationVersionWithContext(ctx aws.Context, input *CreateDocumentationVersionInput, opts ...request.Option) (*DocumentationVersion, error) { + req, out := c.CreateDocumentationVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDomainName = "CreateDomainName" @@ -500,8 +591,23 @@ func (c *APIGateway) CreateDomainNameRequest(input *CreateDomainNameInput) (req // func (c *APIGateway) CreateDomainName(input *CreateDomainNameInput) (*DomainName, error) { req, out := c.CreateDomainNameRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDomainNameWithContext is the same as CreateDomainName with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDomainName for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDomainNameWithContext(ctx aws.Context, input *CreateDomainNameInput, opts ...request.Option) (*DomainName, error) { + req, out := c.CreateDomainNameRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateModel = "CreateModel" @@ -571,8 +677,23 @@ func (c *APIGateway) CreateModelRequest(input *CreateModelInput) (req *request.R // func (c *APIGateway) CreateModel(input *CreateModelInput) (*Model, error) { req, out := c.CreateModelRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateModelWithContext is the same as CreateModel with the addition of +// the ability to pass a context and additional request options. +// +// See CreateModel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateModelWithContext(ctx aws.Context, input *CreateModelInput, opts ...request.Option) (*Model, error) { + req, out := c.CreateModelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateResource = "CreateResource" @@ -642,8 +763,23 @@ func (c *APIGateway) CreateResourceRequest(input *CreateResourceInput) (req *req // func (c *APIGateway) CreateResource(input *CreateResourceInput) (*Resource, error) { req, out := c.CreateResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateResourceWithContext is the same as CreateResource with the addition of +// the ability to pass a context and additional request options. +// +// See CreateResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateResourceWithContext(ctx aws.Context, input *CreateResourceInput, opts ...request.Option) (*Resource, error) { + req, out := c.CreateResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateRestApi = "CreateRestApi" @@ -709,8 +845,23 @@ func (c *APIGateway) CreateRestApiRequest(input *CreateRestApiInput) (req *reque // func (c *APIGateway) CreateRestApi(input *CreateRestApiInput) (*RestApi, error) { req, out := c.CreateRestApiRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateRestApiWithContext is the same as CreateRestApi with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRestApi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateRestApiWithContext(ctx aws.Context, input *CreateRestApiInput, opts ...request.Option) (*RestApi, error) { + req, out := c.CreateRestApiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateStage = "CreateStage" @@ -781,8 +932,23 @@ func (c *APIGateway) CreateStageRequest(input *CreateStageInput) (req *request.R // func (c *APIGateway) CreateStage(input *CreateStageInput) (*Stage, error) { req, out := c.CreateStageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateStageWithContext is the same as CreateStage with the addition of +// the ability to pass a context and additional request options. +// +// See CreateStage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateStageWithContext(ctx aws.Context, input *CreateStageInput, opts ...request.Option) (*Stage, error) { + req, out := c.CreateStageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateUsagePlan = "CreateUsagePlan" @@ -853,8 +1019,23 @@ func (c *APIGateway) CreateUsagePlanRequest(input *CreateUsagePlanInput) (req *r // func (c *APIGateway) CreateUsagePlan(input *CreateUsagePlanInput) (*UsagePlan, error) { req, out := c.CreateUsagePlanRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateUsagePlanWithContext is the same as CreateUsagePlan with the addition of +// the ability to pass a context and additional request options. +// +// See CreateUsagePlan for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateUsagePlanWithContext(ctx aws.Context, input *CreateUsagePlanInput, opts ...request.Option) (*UsagePlan, error) { + req, out := c.CreateUsagePlanRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateUsagePlanKey = "CreateUsagePlanKey" @@ -922,8 +1103,23 @@ func (c *APIGateway) CreateUsagePlanKeyRequest(input *CreateUsagePlanKeyInput) ( // func (c *APIGateway) CreateUsagePlanKey(input *CreateUsagePlanKeyInput) (*UsagePlanKey, error) { req, out := c.CreateUsagePlanKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateUsagePlanKeyWithContext is the same as CreateUsagePlanKey with the addition of +// the ability to pass a context and additional request options. +// +// See CreateUsagePlanKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateUsagePlanKeyWithContext(ctx aws.Context, input *CreateUsagePlanKeyInput, opts ...request.Option) (*UsagePlanKey, error) { + req, out := c.CreateUsagePlanKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteApiKey = "DeleteApiKey" @@ -989,8 +1185,23 @@ func (c *APIGateway) DeleteApiKeyRequest(input *DeleteApiKeyInput) (req *request // func (c *APIGateway) DeleteApiKey(input *DeleteApiKeyInput) (*DeleteApiKeyOutput, error) { req, out := c.DeleteApiKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteApiKeyWithContext is the same as DeleteApiKey with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteApiKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteApiKeyWithContext(ctx aws.Context, input *DeleteApiKeyInput, opts ...request.Option) (*DeleteApiKeyOutput, error) { + req, out := c.DeleteApiKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAuthorizer = "DeleteAuthorizer" @@ -1062,8 +1273,23 @@ func (c *APIGateway) DeleteAuthorizerRequest(input *DeleteAuthorizerInput) (req // func (c *APIGateway) DeleteAuthorizer(input *DeleteAuthorizerInput) (*DeleteAuthorizerOutput, error) { req, out := c.DeleteAuthorizerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAuthorizerWithContext is the same as DeleteAuthorizer with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAuthorizer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAuthorizerWithContext(ctx aws.Context, input *DeleteAuthorizerInput, opts ...request.Option) (*DeleteAuthorizerOutput, error) { + req, out := c.DeleteAuthorizerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBasePathMapping = "DeleteBasePathMapping" @@ -1129,8 +1355,23 @@ func (c *APIGateway) DeleteBasePathMappingRequest(input *DeleteBasePathMappingIn // func (c *APIGateway) DeleteBasePathMapping(input *DeleteBasePathMappingInput) (*DeleteBasePathMappingOutput, error) { req, out := c.DeleteBasePathMappingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBasePathMappingWithContext is the same as DeleteBasePathMapping with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBasePathMapping for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBasePathMappingWithContext(ctx aws.Context, input *DeleteBasePathMappingInput, opts ...request.Option) (*DeleteBasePathMappingOutput, error) { + req, out := c.DeleteBasePathMappingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteClientCertificate = "DeleteClientCertificate" @@ -1198,8 +1439,23 @@ func (c *APIGateway) DeleteClientCertificateRequest(input *DeleteClientCertifica // func (c *APIGateway) DeleteClientCertificate(input *DeleteClientCertificateInput) (*DeleteClientCertificateOutput, error) { req, out := c.DeleteClientCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteClientCertificateWithContext is the same as DeleteClientCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteClientCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteClientCertificateWithContext(ctx aws.Context, input *DeleteClientCertificateInput, opts ...request.Option) (*DeleteClientCertificateOutput, error) { + req, out := c.DeleteClientCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDeployment = "DeleteDeployment" @@ -1268,8 +1524,23 @@ func (c *APIGateway) DeleteDeploymentRequest(input *DeleteDeploymentInput) (req // func (c *APIGateway) DeleteDeployment(input *DeleteDeploymentInput) (*DeleteDeploymentOutput, error) { req, out := c.DeleteDeploymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDeploymentWithContext is the same as DeleteDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDeploymentWithContext(ctx aws.Context, input *DeleteDeploymentInput, opts ...request.Option) (*DeleteDeploymentOutput, error) { + req, out := c.DeleteDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDocumentationPart = "DeleteDocumentationPart" @@ -1337,8 +1608,23 @@ func (c *APIGateway) DeleteDocumentationPartRequest(input *DeleteDocumentationPa // func (c *APIGateway) DeleteDocumentationPart(input *DeleteDocumentationPartInput) (*DeleteDocumentationPartOutput, error) { req, out := c.DeleteDocumentationPartRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDocumentationPartWithContext is the same as DeleteDocumentationPart with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDocumentationPart for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDocumentationPartWithContext(ctx aws.Context, input *DeleteDocumentationPartInput, opts ...request.Option) (*DeleteDocumentationPartOutput, error) { + req, out := c.DeleteDocumentationPartRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDocumentationVersion = "DeleteDocumentationVersion" @@ -1406,8 +1692,23 @@ func (c *APIGateway) DeleteDocumentationVersionRequest(input *DeleteDocumentatio // func (c *APIGateway) DeleteDocumentationVersion(input *DeleteDocumentationVersionInput) (*DeleteDocumentationVersionOutput, error) { req, out := c.DeleteDocumentationVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDocumentationVersionWithContext is the same as DeleteDocumentationVersion with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDocumentationVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDocumentationVersionWithContext(ctx aws.Context, input *DeleteDocumentationVersionInput, opts ...request.Option) (*DeleteDocumentationVersionOutput, error) { + req, out := c.DeleteDocumentationVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDomainName = "DeleteDomainName" @@ -1473,8 +1774,23 @@ func (c *APIGateway) DeleteDomainNameRequest(input *DeleteDomainNameInput) (req // func (c *APIGateway) DeleteDomainName(input *DeleteDomainNameInput) (*DeleteDomainNameOutput, error) { req, out := c.DeleteDomainNameRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDomainNameWithContext is the same as DeleteDomainName with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDomainName for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDomainNameWithContext(ctx aws.Context, input *DeleteDomainNameInput, opts ...request.Option) (*DeleteDomainNameOutput, error) { + req, out := c.DeleteDomainNameRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteIntegration = "DeleteIntegration" @@ -1542,8 +1858,23 @@ func (c *APIGateway) DeleteIntegrationRequest(input *DeleteIntegrationInput) (re // func (c *APIGateway) DeleteIntegration(input *DeleteIntegrationInput) (*DeleteIntegrationOutput, error) { req, out := c.DeleteIntegrationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteIntegrationWithContext is the same as DeleteIntegration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteIntegration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteIntegrationWithContext(ctx aws.Context, input *DeleteIntegrationInput, opts ...request.Option) (*DeleteIntegrationOutput, error) { + req, out := c.DeleteIntegrationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteIntegrationResponse = "DeleteIntegrationResponse" @@ -1613,8 +1944,23 @@ func (c *APIGateway) DeleteIntegrationResponseRequest(input *DeleteIntegrationRe // func (c *APIGateway) DeleteIntegrationResponse(input *DeleteIntegrationResponseInput) (*DeleteIntegrationResponseOutput, error) { req, out := c.DeleteIntegrationResponseRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteIntegrationResponseWithContext is the same as DeleteIntegrationResponse with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteIntegrationResponse for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteIntegrationResponseWithContext(ctx aws.Context, input *DeleteIntegrationResponseInput, opts ...request.Option) (*DeleteIntegrationResponseOutput, error) { + req, out := c.DeleteIntegrationResponseRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteMethod = "DeleteMethod" @@ -1682,8 +2028,23 @@ func (c *APIGateway) DeleteMethodRequest(input *DeleteMethodInput) (req *request // func (c *APIGateway) DeleteMethod(input *DeleteMethodInput) (*DeleteMethodOutput, error) { req, out := c.DeleteMethodRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteMethodWithContext is the same as DeleteMethod with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMethod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteMethodWithContext(ctx aws.Context, input *DeleteMethodInput, opts ...request.Option) (*DeleteMethodOutput, error) { + req, out := c.DeleteMethodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteMethodResponse = "DeleteMethodResponse" @@ -1753,8 +2114,23 @@ func (c *APIGateway) DeleteMethodResponseRequest(input *DeleteMethodResponseInpu // func (c *APIGateway) DeleteMethodResponse(input *DeleteMethodResponseInput) (*DeleteMethodResponseOutput, error) { req, out := c.DeleteMethodResponseRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteMethodResponseWithContext is the same as DeleteMethodResponse with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMethodResponse for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteMethodResponseWithContext(ctx aws.Context, input *DeleteMethodResponseInput, opts ...request.Option) (*DeleteMethodResponseOutput, error) { + req, out := c.DeleteMethodResponseRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteModel = "DeleteModel" @@ -1824,8 +2200,23 @@ func (c *APIGateway) DeleteModelRequest(input *DeleteModelInput) (req *request.R // func (c *APIGateway) DeleteModel(input *DeleteModelInput) (*DeleteModelOutput, error) { req, out := c.DeleteModelRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteModelWithContext is the same as DeleteModel with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteModel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteModelWithContext(ctx aws.Context, input *DeleteModelInput, opts ...request.Option) (*DeleteModelOutput, error) { + req, out := c.DeleteModelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteResource = "DeleteResource" @@ -1895,8 +2286,23 @@ func (c *APIGateway) DeleteResourceRequest(input *DeleteResourceInput) (req *req // func (c *APIGateway) DeleteResource(input *DeleteResourceInput) (*DeleteResourceOutput, error) { req, out := c.DeleteResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteResourceWithContext is the same as DeleteResource with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteResourceWithContext(ctx aws.Context, input *DeleteResourceInput, opts ...request.Option) (*DeleteResourceOutput, error) { + req, out := c.DeleteResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRestApi = "DeleteRestApi" @@ -1964,8 +2370,23 @@ func (c *APIGateway) DeleteRestApiRequest(input *DeleteRestApiInput) (req *reque // func (c *APIGateway) DeleteRestApi(input *DeleteRestApiInput) (*DeleteRestApiOutput, error) { req, out := c.DeleteRestApiRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRestApiWithContext is the same as DeleteRestApi with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRestApi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRestApiWithContext(ctx aws.Context, input *DeleteRestApiInput, opts ...request.Option) (*DeleteRestApiOutput, error) { + req, out := c.DeleteRestApiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteStage = "DeleteStage" @@ -2033,8 +2454,23 @@ func (c *APIGateway) DeleteStageRequest(input *DeleteStageInput) (req *request.R // func (c *APIGateway) DeleteStage(input *DeleteStageInput) (*DeleteStageOutput, error) { req, out := c.DeleteStageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteStageWithContext is the same as DeleteStage with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteStage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteStageWithContext(ctx aws.Context, input *DeleteStageInput, opts ...request.Option) (*DeleteStageOutput, error) { + req, out := c.DeleteStageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteUsagePlan = "DeleteUsagePlan" @@ -2102,8 +2538,23 @@ func (c *APIGateway) DeleteUsagePlanRequest(input *DeleteUsagePlanInput) (req *r // func (c *APIGateway) DeleteUsagePlan(input *DeleteUsagePlanInput) (*DeleteUsagePlanOutput, error) { req, out := c.DeleteUsagePlanRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteUsagePlanWithContext is the same as DeleteUsagePlan with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUsagePlan for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteUsagePlanWithContext(ctx aws.Context, input *DeleteUsagePlanInput, opts ...request.Option) (*DeleteUsagePlanOutput, error) { + req, out := c.DeleteUsagePlanRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteUsagePlanKey = "DeleteUsagePlanKey" @@ -2174,8 +2625,23 @@ func (c *APIGateway) DeleteUsagePlanKeyRequest(input *DeleteUsagePlanKeyInput) ( // func (c *APIGateway) DeleteUsagePlanKey(input *DeleteUsagePlanKeyInput) (*DeleteUsagePlanKeyOutput, error) { req, out := c.DeleteUsagePlanKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteUsagePlanKeyWithContext is the same as DeleteUsagePlanKey with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUsagePlanKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteUsagePlanKeyWithContext(ctx aws.Context, input *DeleteUsagePlanKeyInput, opts ...request.Option) (*DeleteUsagePlanKeyOutput, error) { + req, out := c.DeleteUsagePlanKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opFlushStageAuthorizersCache = "FlushStageAuthorizersCache" @@ -2243,8 +2709,23 @@ func (c *APIGateway) FlushStageAuthorizersCacheRequest(input *FlushStageAuthoriz // func (c *APIGateway) FlushStageAuthorizersCache(input *FlushStageAuthorizersCacheInput) (*FlushStageAuthorizersCacheOutput, error) { req, out := c.FlushStageAuthorizersCacheRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// FlushStageAuthorizersCacheWithContext is the same as FlushStageAuthorizersCache with the addition of +// the ability to pass a context and additional request options. +// +// See FlushStageAuthorizersCache for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) FlushStageAuthorizersCacheWithContext(ctx aws.Context, input *FlushStageAuthorizersCacheInput, opts ...request.Option) (*FlushStageAuthorizersCacheOutput, error) { + req, out := c.FlushStageAuthorizersCacheRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opFlushStageCache = "FlushStageCache" @@ -2312,8 +2793,23 @@ func (c *APIGateway) FlushStageCacheRequest(input *FlushStageCacheInput) (req *r // func (c *APIGateway) FlushStageCache(input *FlushStageCacheInput) (*FlushStageCacheOutput, error) { req, out := c.FlushStageCacheRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// FlushStageCacheWithContext is the same as FlushStageCache with the addition of +// the ability to pass a context and additional request options. +// +// See FlushStageCache for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) FlushStageCacheWithContext(ctx aws.Context, input *FlushStageCacheInput, opts ...request.Option) (*FlushStageCacheOutput, error) { + req, out := c.FlushStageCacheRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGenerateClientCertificate = "GenerateClientCertificate" @@ -2377,8 +2873,23 @@ func (c *APIGateway) GenerateClientCertificateRequest(input *GenerateClientCerti // func (c *APIGateway) GenerateClientCertificate(input *GenerateClientCertificateInput) (*ClientCertificate, error) { req, out := c.GenerateClientCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GenerateClientCertificateWithContext is the same as GenerateClientCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See GenerateClientCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GenerateClientCertificateWithContext(ctx aws.Context, input *GenerateClientCertificateInput, opts ...request.Option) (*ClientCertificate, error) { + req, out := c.GenerateClientCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetAccount = "GetAccount" @@ -2442,8 +2953,23 @@ func (c *APIGateway) GetAccountRequest(input *GetAccountInput) (req *request.Req // func (c *APIGateway) GetAccount(input *GetAccountInput) (*Account, error) { req, out := c.GetAccountRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAccountWithContext is the same as GetAccount with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAccountWithContext(ctx aws.Context, input *GetAccountInput, opts ...request.Option) (*Account, error) { + req, out := c.GetAccountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetApiKey = "GetApiKey" @@ -2507,8 +3033,23 @@ func (c *APIGateway) GetApiKeyRequest(input *GetApiKeyInput) (req *request.Reque // func (c *APIGateway) GetApiKey(input *GetApiKeyInput) (*ApiKey, error) { req, out := c.GetApiKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetApiKeyWithContext is the same as GetApiKey with the addition of +// the ability to pass a context and additional request options. +// +// See GetApiKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetApiKeyWithContext(ctx aws.Context, input *GetApiKeyInput, opts ...request.Option) (*ApiKey, error) { + req, out := c.GetApiKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetApiKeys = "GetApiKeys" @@ -2578,8 +3119,23 @@ func (c *APIGateway) GetApiKeysRequest(input *GetApiKeysInput) (req *request.Req // func (c *APIGateway) GetApiKeys(input *GetApiKeysInput) (*GetApiKeysOutput, error) { req, out := c.GetApiKeysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetApiKeysWithContext is the same as GetApiKeys with the addition of +// the ability to pass a context and additional request options. +// +// See GetApiKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetApiKeysWithContext(ctx aws.Context, input *GetApiKeysInput, opts ...request.Option) (*GetApiKeysOutput, error) { + req, out := c.GetApiKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetApiKeysPages iterates over the pages of a GetApiKeys operation, @@ -2599,12 +3155,37 @@ func (c *APIGateway) GetApiKeys(input *GetApiKeysInput) (*GetApiKeysOutput, erro // return pageNum <= 3 // }) // -func (c *APIGateway) GetApiKeysPages(input *GetApiKeysInput, fn func(p *GetApiKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetApiKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetApiKeysOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetApiKeysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetApiKeysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetApiKeysOutput), !p.HasNextPage()) + } + return p.Err() } const opGetAuthorizer = "GetAuthorizer" @@ -2670,8 +3251,23 @@ func (c *APIGateway) GetAuthorizerRequest(input *GetAuthorizerInput) (req *reque // func (c *APIGateway) GetAuthorizer(input *GetAuthorizerInput) (*Authorizer, error) { req, out := c.GetAuthorizerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAuthorizerWithContext is the same as GetAuthorizer with the addition of +// the ability to pass a context and additional request options. +// +// See GetAuthorizer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAuthorizerWithContext(ctx aws.Context, input *GetAuthorizerInput, opts ...request.Option) (*Authorizer, error) { + req, out := c.GetAuthorizerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetAuthorizers = "GetAuthorizers" @@ -2739,8 +3335,23 @@ func (c *APIGateway) GetAuthorizersRequest(input *GetAuthorizersInput) (req *req // func (c *APIGateway) GetAuthorizers(input *GetAuthorizersInput) (*GetAuthorizersOutput, error) { req, out := c.GetAuthorizersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAuthorizersWithContext is the same as GetAuthorizers with the addition of +// the ability to pass a context and additional request options. +// +// See GetAuthorizers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAuthorizersWithContext(ctx aws.Context, input *GetAuthorizersInput, opts ...request.Option) (*GetAuthorizersOutput, error) { + req, out := c.GetAuthorizersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBasePathMapping = "GetBasePathMapping" @@ -2804,8 +3415,23 @@ func (c *APIGateway) GetBasePathMappingRequest(input *GetBasePathMappingInput) ( // func (c *APIGateway) GetBasePathMapping(input *GetBasePathMappingInput) (*BasePathMapping, error) { req, out := c.GetBasePathMappingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBasePathMappingWithContext is the same as GetBasePathMapping with the addition of +// the ability to pass a context and additional request options. +// +// See GetBasePathMapping for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBasePathMappingWithContext(ctx aws.Context, input *GetBasePathMappingInput, opts ...request.Option) (*BasePathMapping, error) { + req, out := c.GetBasePathMappingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBasePathMappings = "GetBasePathMappings" @@ -2875,8 +3501,23 @@ func (c *APIGateway) GetBasePathMappingsRequest(input *GetBasePathMappingsInput) // func (c *APIGateway) GetBasePathMappings(input *GetBasePathMappingsInput) (*GetBasePathMappingsOutput, error) { req, out := c.GetBasePathMappingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBasePathMappingsWithContext is the same as GetBasePathMappings with the addition of +// the ability to pass a context and additional request options. +// +// See GetBasePathMappings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBasePathMappingsWithContext(ctx aws.Context, input *GetBasePathMappingsInput, opts ...request.Option) (*GetBasePathMappingsOutput, error) { + req, out := c.GetBasePathMappingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetBasePathMappingsPages iterates over the pages of a GetBasePathMappings operation, @@ -2896,12 +3537,37 @@ func (c *APIGateway) GetBasePathMappings(input *GetBasePathMappingsInput) (*GetB // return pageNum <= 3 // }) // -func (c *APIGateway) GetBasePathMappingsPages(input *GetBasePathMappingsInput, fn func(p *GetBasePathMappingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetBasePathMappingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetBasePathMappingsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetBasePathMappingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetBasePathMappingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetBasePathMappingsOutput), !p.HasNextPage()) + } + return p.Err() } const opGetClientCertificate = "GetClientCertificate" @@ -2965,8 +3631,23 @@ func (c *APIGateway) GetClientCertificateRequest(input *GetClientCertificateInpu // func (c *APIGateway) GetClientCertificate(input *GetClientCertificateInput) (*ClientCertificate, error) { req, out := c.GetClientCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetClientCertificateWithContext is the same as GetClientCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See GetClientCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetClientCertificateWithContext(ctx aws.Context, input *GetClientCertificateInput, opts ...request.Option) (*ClientCertificate, error) { + req, out := c.GetClientCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetClientCertificates = "GetClientCertificates" @@ -3036,8 +3717,23 @@ func (c *APIGateway) GetClientCertificatesRequest(input *GetClientCertificatesIn // func (c *APIGateway) GetClientCertificates(input *GetClientCertificatesInput) (*GetClientCertificatesOutput, error) { req, out := c.GetClientCertificatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetClientCertificatesWithContext is the same as GetClientCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See GetClientCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetClientCertificatesWithContext(ctx aws.Context, input *GetClientCertificatesInput, opts ...request.Option) (*GetClientCertificatesOutput, error) { + req, out := c.GetClientCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetClientCertificatesPages iterates over the pages of a GetClientCertificates operation, @@ -3057,12 +3753,37 @@ func (c *APIGateway) GetClientCertificates(input *GetClientCertificatesInput) (* // return pageNum <= 3 // }) // -func (c *APIGateway) GetClientCertificatesPages(input *GetClientCertificatesInput, fn func(p *GetClientCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetClientCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetClientCertificatesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetClientCertificatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetClientCertificatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetClientCertificatesOutput), !p.HasNextPage()) + } + return p.Err() } const opGetDeployment = "GetDeployment" @@ -3128,8 +3849,23 @@ func (c *APIGateway) GetDeploymentRequest(input *GetDeploymentInput) (req *reque // func (c *APIGateway) GetDeployment(input *GetDeploymentInput) (*Deployment, error) { req, out := c.GetDeploymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDeploymentWithContext is the same as GetDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDeploymentWithContext(ctx aws.Context, input *GetDeploymentInput, opts ...request.Option) (*Deployment, error) { + req, out := c.GetDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDeployments = "GetDeployments" @@ -3201,8 +3937,23 @@ func (c *APIGateway) GetDeploymentsRequest(input *GetDeploymentsInput) (req *req // func (c *APIGateway) GetDeployments(input *GetDeploymentsInput) (*GetDeploymentsOutput, error) { req, out := c.GetDeploymentsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDeploymentsWithContext is the same as GetDeployments with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeployments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDeploymentsWithContext(ctx aws.Context, input *GetDeploymentsInput, opts ...request.Option) (*GetDeploymentsOutput, error) { + req, out := c.GetDeploymentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetDeploymentsPages iterates over the pages of a GetDeployments operation, @@ -3222,12 +3973,37 @@ func (c *APIGateway) GetDeployments(input *GetDeploymentsInput) (*GetDeployments // return pageNum <= 3 // }) // -func (c *APIGateway) GetDeploymentsPages(input *GetDeploymentsInput, fn func(p *GetDeploymentsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetDeploymentsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetDeploymentsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetDeploymentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetDeploymentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetDeploymentsOutput), !p.HasNextPage()) + } + return p.Err() } const opGetDocumentationPart = "GetDocumentationPart" @@ -3289,8 +4065,23 @@ func (c *APIGateway) GetDocumentationPartRequest(input *GetDocumentationPartInpu // func (c *APIGateway) GetDocumentationPart(input *GetDocumentationPartInput) (*DocumentationPart, error) { req, out := c.GetDocumentationPartRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDocumentationPartWithContext is the same as GetDocumentationPart with the addition of +// the ability to pass a context and additional request options. +// +// See GetDocumentationPart for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDocumentationPartWithContext(ctx aws.Context, input *GetDocumentationPartInput, opts ...request.Option) (*DocumentationPart, error) { + req, out := c.GetDocumentationPartRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDocumentationParts = "GetDocumentationParts" @@ -3354,8 +4145,23 @@ func (c *APIGateway) GetDocumentationPartsRequest(input *GetDocumentationPartsIn // func (c *APIGateway) GetDocumentationParts(input *GetDocumentationPartsInput) (*GetDocumentationPartsOutput, error) { req, out := c.GetDocumentationPartsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDocumentationPartsWithContext is the same as GetDocumentationParts with the addition of +// the ability to pass a context and additional request options. +// +// See GetDocumentationParts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDocumentationPartsWithContext(ctx aws.Context, input *GetDocumentationPartsInput, opts ...request.Option) (*GetDocumentationPartsOutput, error) { + req, out := c.GetDocumentationPartsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDocumentationVersion = "GetDocumentationVersion" @@ -3417,8 +4223,23 @@ func (c *APIGateway) GetDocumentationVersionRequest(input *GetDocumentationVersi // func (c *APIGateway) GetDocumentationVersion(input *GetDocumentationVersionInput) (*DocumentationVersion, error) { req, out := c.GetDocumentationVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDocumentationVersionWithContext is the same as GetDocumentationVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetDocumentationVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDocumentationVersionWithContext(ctx aws.Context, input *GetDocumentationVersionInput, opts ...request.Option) (*DocumentationVersion, error) { + req, out := c.GetDocumentationVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDocumentationVersions = "GetDocumentationVersions" @@ -3482,8 +4303,23 @@ func (c *APIGateway) GetDocumentationVersionsRequest(input *GetDocumentationVers // func (c *APIGateway) GetDocumentationVersions(input *GetDocumentationVersionsInput) (*GetDocumentationVersionsOutput, error) { req, out := c.GetDocumentationVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDocumentationVersionsWithContext is the same as GetDocumentationVersions with the addition of +// the ability to pass a context and additional request options. +// +// See GetDocumentationVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDocumentationVersionsWithContext(ctx aws.Context, input *GetDocumentationVersionsInput, opts ...request.Option) (*GetDocumentationVersionsOutput, error) { + req, out := c.GetDocumentationVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDomainName = "GetDomainName" @@ -3550,8 +4386,23 @@ func (c *APIGateway) GetDomainNameRequest(input *GetDomainNameInput) (req *reque // func (c *APIGateway) GetDomainName(input *GetDomainNameInput) (*DomainName, error) { req, out := c.GetDomainNameRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDomainNameWithContext is the same as GetDomainName with the addition of +// the ability to pass a context and additional request options. +// +// See GetDomainName for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDomainNameWithContext(ctx aws.Context, input *GetDomainNameInput, opts ...request.Option) (*DomainName, error) { + req, out := c.GetDomainNameRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDomainNames = "GetDomainNames" @@ -3621,8 +4472,23 @@ func (c *APIGateway) GetDomainNamesRequest(input *GetDomainNamesInput) (req *req // func (c *APIGateway) GetDomainNames(input *GetDomainNamesInput) (*GetDomainNamesOutput, error) { req, out := c.GetDomainNamesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDomainNamesWithContext is the same as GetDomainNames with the addition of +// the ability to pass a context and additional request options. +// +// See GetDomainNames for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDomainNamesWithContext(ctx aws.Context, input *GetDomainNamesInput, opts ...request.Option) (*GetDomainNamesOutput, error) { + req, out := c.GetDomainNamesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetDomainNamesPages iterates over the pages of a GetDomainNames operation, @@ -3642,12 +4508,37 @@ func (c *APIGateway) GetDomainNames(input *GetDomainNamesInput) (*GetDomainNames // return pageNum <= 3 // }) // -func (c *APIGateway) GetDomainNamesPages(input *GetDomainNamesInput, fn func(p *GetDomainNamesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetDomainNamesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetDomainNamesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetDomainNamesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetDomainNamesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetDomainNamesOutput), !p.HasNextPage()) + } + return p.Err() } const opGetExport = "GetExport" @@ -3713,8 +4604,23 @@ func (c *APIGateway) GetExportRequest(input *GetExportInput) (req *request.Reque // func (c *APIGateway) GetExport(input *GetExportInput) (*GetExportOutput, error) { req, out := c.GetExportRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetExportWithContext is the same as GetExport with the addition of +// the ability to pass a context and additional request options. +// +// See GetExport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetExportWithContext(ctx aws.Context, input *GetExportInput, opts ...request.Option) (*GetExportOutput, error) { + req, out := c.GetExportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetIntegration = "GetIntegration" @@ -3778,8 +4684,23 @@ func (c *APIGateway) GetIntegrationRequest(input *GetIntegrationInput) (req *req // func (c *APIGateway) GetIntegration(input *GetIntegrationInput) (*Integration, error) { req, out := c.GetIntegrationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetIntegrationWithContext is the same as GetIntegration with the addition of +// the ability to pass a context and additional request options. +// +// See GetIntegration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetIntegrationWithContext(ctx aws.Context, input *GetIntegrationInput, opts ...request.Option) (*Integration, error) { + req, out := c.GetIntegrationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetIntegrationResponse = "GetIntegrationResponse" @@ -3843,8 +4764,23 @@ func (c *APIGateway) GetIntegrationResponseRequest(input *GetIntegrationResponse // func (c *APIGateway) GetIntegrationResponse(input *GetIntegrationResponseInput) (*IntegrationResponse, error) { req, out := c.GetIntegrationResponseRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetIntegrationResponseWithContext is the same as GetIntegrationResponse with the addition of +// the ability to pass a context and additional request options. +// +// See GetIntegrationResponse for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetIntegrationResponseWithContext(ctx aws.Context, input *GetIntegrationResponseInput, opts ...request.Option) (*IntegrationResponse, error) { + req, out := c.GetIntegrationResponseRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetMethod = "GetMethod" @@ -3908,8 +4844,23 @@ func (c *APIGateway) GetMethodRequest(input *GetMethodInput) (req *request.Reque // func (c *APIGateway) GetMethod(input *GetMethodInput) (*Method, error) { req, out := c.GetMethodRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetMethodWithContext is the same as GetMethod with the addition of +// the ability to pass a context and additional request options. +// +// See GetMethod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetMethodWithContext(ctx aws.Context, input *GetMethodInput, opts ...request.Option) (*Method, error) { + req, out := c.GetMethodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetMethodResponse = "GetMethodResponse" @@ -3973,8 +4924,23 @@ func (c *APIGateway) GetMethodResponseRequest(input *GetMethodResponseInput) (re // func (c *APIGateway) GetMethodResponse(input *GetMethodResponseInput) (*MethodResponse, error) { req, out := c.GetMethodResponseRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetMethodResponseWithContext is the same as GetMethodResponse with the addition of +// the ability to pass a context and additional request options. +// +// See GetMethodResponse for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetMethodResponseWithContext(ctx aws.Context, input *GetMethodResponseInput, opts ...request.Option) (*MethodResponse, error) { + req, out := c.GetMethodResponseRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetModel = "GetModel" @@ -4038,8 +5004,23 @@ func (c *APIGateway) GetModelRequest(input *GetModelInput) (req *request.Request // func (c *APIGateway) GetModel(input *GetModelInput) (*Model, error) { req, out := c.GetModelRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetModelWithContext is the same as GetModel with the addition of +// the ability to pass a context and additional request options. +// +// See GetModel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetModelWithContext(ctx aws.Context, input *GetModelInput, opts ...request.Option) (*Model, error) { + req, out := c.GetModelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetModelTemplate = "GetModelTemplate" @@ -4106,8 +5087,23 @@ func (c *APIGateway) GetModelTemplateRequest(input *GetModelTemplateInput) (req // func (c *APIGateway) GetModelTemplate(input *GetModelTemplateInput) (*GetModelTemplateOutput, error) { req, out := c.GetModelTemplateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetModelTemplateWithContext is the same as GetModelTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See GetModelTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetModelTemplateWithContext(ctx aws.Context, input *GetModelTemplateInput, opts ...request.Option) (*GetModelTemplateOutput, error) { + req, out := c.GetModelTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetModels = "GetModels" @@ -4179,8 +5175,23 @@ func (c *APIGateway) GetModelsRequest(input *GetModelsInput) (req *request.Reque // func (c *APIGateway) GetModels(input *GetModelsInput) (*GetModelsOutput, error) { req, out := c.GetModelsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetModelsWithContext is the same as GetModels with the addition of +// the ability to pass a context and additional request options. +// +// See GetModels for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetModelsWithContext(ctx aws.Context, input *GetModelsInput, opts ...request.Option) (*GetModelsOutput, error) { + req, out := c.GetModelsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetModelsPages iterates over the pages of a GetModels operation, @@ -4200,12 +5211,37 @@ func (c *APIGateway) GetModels(input *GetModelsInput) (*GetModelsOutput, error) // return pageNum <= 3 // }) // -func (c *APIGateway) GetModelsPages(input *GetModelsInput, fn func(p *GetModelsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetModelsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetModelsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetModelsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetModelsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetModelsOutput), !p.HasNextPage()) + } + return p.Err() } const opGetResource = "GetResource" @@ -4269,8 +5305,23 @@ func (c *APIGateway) GetResourceRequest(input *GetResourceInput) (req *request.R // func (c *APIGateway) GetResource(input *GetResourceInput) (*Resource, error) { req, out := c.GetResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetResourceWithContext is the same as GetResource with the addition of +// the ability to pass a context and additional request options. +// +// See GetResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetResourceWithContext(ctx aws.Context, input *GetResourceInput, opts ...request.Option) (*Resource, error) { + req, out := c.GetResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetResources = "GetResources" @@ -4342,8 +5393,23 @@ func (c *APIGateway) GetResourcesRequest(input *GetResourcesInput) (req *request // func (c *APIGateway) GetResources(input *GetResourcesInput) (*GetResourcesOutput, error) { req, out := c.GetResourcesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetResourcesWithContext is the same as GetResources with the addition of +// the ability to pass a context and additional request options. +// +// See GetResources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetResourcesWithContext(ctx aws.Context, input *GetResourcesInput, opts ...request.Option) (*GetResourcesOutput, error) { + req, out := c.GetResourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetResourcesPages iterates over the pages of a GetResources operation, @@ -4363,12 +5429,37 @@ func (c *APIGateway) GetResources(input *GetResourcesInput) (*GetResourcesOutput // return pageNum <= 3 // }) // -func (c *APIGateway) GetResourcesPages(input *GetResourcesInput, fn func(p *GetResourcesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetResourcesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetResourcesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetResourcesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetResourcesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetResourcesOutput), !p.HasNextPage()) + } + return p.Err() } const opGetRestApi = "GetRestApi" @@ -4432,8 +5523,23 @@ func (c *APIGateway) GetRestApiRequest(input *GetRestApiInput) (req *request.Req // func (c *APIGateway) GetRestApi(input *GetRestApiInput) (*RestApi, error) { req, out := c.GetRestApiRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRestApiWithContext is the same as GetRestApi with the addition of +// the ability to pass a context and additional request options. +// +// See GetRestApi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetRestApiWithContext(ctx aws.Context, input *GetRestApiInput, opts ...request.Option) (*RestApi, error) { + req, out := c.GetRestApiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetRestApis = "GetRestApis" @@ -4503,8 +5609,23 @@ func (c *APIGateway) GetRestApisRequest(input *GetRestApisInput) (req *request.R // func (c *APIGateway) GetRestApis(input *GetRestApisInput) (*GetRestApisOutput, error) { req, out := c.GetRestApisRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRestApisWithContext is the same as GetRestApis with the addition of +// the ability to pass a context and additional request options. +// +// See GetRestApis for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetRestApisWithContext(ctx aws.Context, input *GetRestApisInput, opts ...request.Option) (*GetRestApisOutput, error) { + req, out := c.GetRestApisRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetRestApisPages iterates over the pages of a GetRestApis operation, @@ -4524,12 +5645,37 @@ func (c *APIGateway) GetRestApis(input *GetRestApisInput) (*GetRestApisOutput, e // return pageNum <= 3 // }) // -func (c *APIGateway) GetRestApisPages(input *GetRestApisInput, fn func(p *GetRestApisOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetRestApisRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetRestApisOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetRestApisInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetRestApisRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetRestApisOutput), !p.HasNextPage()) + } + return p.Err() } const opGetSdk = "GetSdk" @@ -4595,8 +5741,23 @@ func (c *APIGateway) GetSdkRequest(input *GetSdkInput) (req *request.Request, ou // func (c *APIGateway) GetSdk(input *GetSdkInput) (*GetSdkOutput, error) { req, out := c.GetSdkRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSdkWithContext is the same as GetSdk with the addition of +// the ability to pass a context and additional request options. +// +// See GetSdk for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSdkWithContext(ctx aws.Context, input *GetSdkInput, opts ...request.Option) (*GetSdkOutput, error) { + req, out := c.GetSdkRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSdkType = "GetSdkType" @@ -4658,8 +5819,23 @@ func (c *APIGateway) GetSdkTypeRequest(input *GetSdkTypeInput) (req *request.Req // func (c *APIGateway) GetSdkType(input *GetSdkTypeInput) (*SdkType, error) { req, out := c.GetSdkTypeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSdkTypeWithContext is the same as GetSdkType with the addition of +// the ability to pass a context and additional request options. +// +// See GetSdkType for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSdkTypeWithContext(ctx aws.Context, input *GetSdkTypeInput, opts ...request.Option) (*SdkType, error) { + req, out := c.GetSdkTypeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSdkTypes = "GetSdkTypes" @@ -4719,8 +5895,23 @@ func (c *APIGateway) GetSdkTypesRequest(input *GetSdkTypesInput) (req *request.R // func (c *APIGateway) GetSdkTypes(input *GetSdkTypesInput) (*GetSdkTypesOutput, error) { req, out := c.GetSdkTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSdkTypesWithContext is the same as GetSdkTypes with the addition of +// the ability to pass a context and additional request options. +// +// See GetSdkTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSdkTypesWithContext(ctx aws.Context, input *GetSdkTypesInput, opts ...request.Option) (*GetSdkTypesOutput, error) { + req, out := c.GetSdkTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetStage = "GetStage" @@ -4784,8 +5975,23 @@ func (c *APIGateway) GetStageRequest(input *GetStageInput) (req *request.Request // func (c *APIGateway) GetStage(input *GetStageInput) (*Stage, error) { req, out := c.GetStageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetStageWithContext is the same as GetStage with the addition of +// the ability to pass a context and additional request options. +// +// See GetStage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetStageWithContext(ctx aws.Context, input *GetStageInput, opts ...request.Option) (*Stage, error) { + req, out := c.GetStageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetStages = "GetStages" @@ -4849,8 +6055,23 @@ func (c *APIGateway) GetStagesRequest(input *GetStagesInput) (req *request.Reque // func (c *APIGateway) GetStages(input *GetStagesInput) (*GetStagesOutput, error) { req, out := c.GetStagesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetStagesWithContext is the same as GetStages with the addition of +// the ability to pass a context and additional request options. +// +// See GetStages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetStagesWithContext(ctx aws.Context, input *GetStagesInput, opts ...request.Option) (*GetStagesOutput, error) { + req, out := c.GetStagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetUsage = "GetUsage" @@ -4922,8 +6143,23 @@ func (c *APIGateway) GetUsageRequest(input *GetUsageInput) (req *request.Request // func (c *APIGateway) GetUsage(input *GetUsageInput) (*Usage, error) { req, out := c.GetUsageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetUsageWithContext is the same as GetUsage with the addition of +// the ability to pass a context and additional request options. +// +// See GetUsage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetUsageWithContext(ctx aws.Context, input *GetUsageInput, opts ...request.Option) (*Usage, error) { + req, out := c.GetUsageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetUsagePages iterates over the pages of a GetUsage operation, @@ -4943,12 +6179,37 @@ func (c *APIGateway) GetUsage(input *GetUsageInput) (*Usage, error) { // return pageNum <= 3 // }) // -func (c *APIGateway) GetUsagePages(input *GetUsageInput, fn func(p *Usage, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetUsageRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*Usage), lastPage) - }) +func (c *APIGateway) GetUsagePages(input *GetUsageInput, fn func(*Usage, 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(*Usage, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetUsageInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetUsageRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*Usage), !p.HasNextPage()) + } + return p.Err() } const opGetUsagePlan = "GetUsagePlan" @@ -5014,8 +6275,23 @@ func (c *APIGateway) GetUsagePlanRequest(input *GetUsagePlanInput) (req *request // func (c *APIGateway) GetUsagePlan(input *GetUsagePlanInput) (*UsagePlan, error) { req, out := c.GetUsagePlanRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetUsagePlanWithContext is the same as GetUsagePlan with the addition of +// the ability to pass a context and additional request options. +// +// See GetUsagePlan for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetUsagePlanWithContext(ctx aws.Context, input *GetUsagePlanInput, opts ...request.Option) (*UsagePlan, error) { + req, out := c.GetUsagePlanRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetUsagePlanKey = "GetUsagePlanKey" @@ -5081,8 +6357,23 @@ func (c *APIGateway) GetUsagePlanKeyRequest(input *GetUsagePlanKeyInput) (req *r // func (c *APIGateway) GetUsagePlanKey(input *GetUsagePlanKeyInput) (*UsagePlanKey, error) { req, out := c.GetUsagePlanKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetUsagePlanKeyWithContext is the same as GetUsagePlanKey with the addition of +// the ability to pass a context and additional request options. +// +// See GetUsagePlanKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetUsagePlanKeyWithContext(ctx aws.Context, input *GetUsagePlanKeyInput, opts ...request.Option) (*UsagePlanKey, error) { + req, out := c.GetUsagePlanKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetUsagePlanKeys = "GetUsagePlanKeys" @@ -5155,8 +6446,23 @@ func (c *APIGateway) GetUsagePlanKeysRequest(input *GetUsagePlanKeysInput) (req // func (c *APIGateway) GetUsagePlanKeys(input *GetUsagePlanKeysInput) (*GetUsagePlanKeysOutput, error) { req, out := c.GetUsagePlanKeysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetUsagePlanKeysWithContext is the same as GetUsagePlanKeys with the addition of +// the ability to pass a context and additional request options. +// +// See GetUsagePlanKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetUsagePlanKeysWithContext(ctx aws.Context, input *GetUsagePlanKeysInput, opts ...request.Option) (*GetUsagePlanKeysOutput, error) { + req, out := c.GetUsagePlanKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetUsagePlanKeysPages iterates over the pages of a GetUsagePlanKeys operation, @@ -5176,12 +6482,37 @@ func (c *APIGateway) GetUsagePlanKeys(input *GetUsagePlanKeysInput) (*GetUsagePl // return pageNum <= 3 // }) // -func (c *APIGateway) GetUsagePlanKeysPages(input *GetUsagePlanKeysInput, fn func(p *GetUsagePlanKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetUsagePlanKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetUsagePlanKeysOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetUsagePlanKeysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetUsagePlanKeysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetUsagePlanKeysOutput), !p.HasNextPage()) + } + return p.Err() } const opGetUsagePlans = "GetUsagePlans" @@ -5255,8 +6586,23 @@ func (c *APIGateway) GetUsagePlansRequest(input *GetUsagePlansInput) (req *reque // func (c *APIGateway) GetUsagePlans(input *GetUsagePlansInput) (*GetUsagePlansOutput, error) { req, out := c.GetUsagePlansRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetUsagePlansWithContext is the same as GetUsagePlans with the addition of +// the ability to pass a context and additional request options. +// +// See GetUsagePlans for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetUsagePlansWithContext(ctx aws.Context, input *GetUsagePlansInput, opts ...request.Option) (*GetUsagePlansOutput, error) { + req, out := c.GetUsagePlansRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetUsagePlansPages iterates over the pages of a GetUsagePlans operation, @@ -5276,12 +6622,37 @@ func (c *APIGateway) GetUsagePlans(input *GetUsagePlansInput) (*GetUsagePlansOut // return pageNum <= 3 // }) // -func (c *APIGateway) GetUsagePlansPages(input *GetUsagePlansInput, fn func(p *GetUsagePlansOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetUsagePlansRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetUsagePlansOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetUsagePlansInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetUsagePlansRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetUsagePlansOutput), !p.HasNextPage()) + } + return p.Err() } const opImportApiKeys = "ImportApiKeys" @@ -5351,8 +6722,23 @@ func (c *APIGateway) ImportApiKeysRequest(input *ImportApiKeysInput) (req *reque // func (c *APIGateway) ImportApiKeys(input *ImportApiKeysInput) (*ImportApiKeysOutput, error) { req, out := c.ImportApiKeysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportApiKeysWithContext is the same as ImportApiKeys with the addition of +// the ability to pass a context and additional request options. +// +// See ImportApiKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportApiKeysWithContext(ctx aws.Context, input *ImportApiKeysInput, opts ...request.Option) (*ImportApiKeysOutput, error) { + req, out := c.ImportApiKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportDocumentationParts = "ImportDocumentationParts" @@ -5418,8 +6804,23 @@ func (c *APIGateway) ImportDocumentationPartsRequest(input *ImportDocumentationP // func (c *APIGateway) ImportDocumentationParts(input *ImportDocumentationPartsInput) (*ImportDocumentationPartsOutput, error) { req, out := c.ImportDocumentationPartsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportDocumentationPartsWithContext is the same as ImportDocumentationParts with the addition of +// the ability to pass a context and additional request options. +// +// See ImportDocumentationParts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportDocumentationPartsWithContext(ctx aws.Context, input *ImportDocumentationPartsInput, opts ...request.Option) (*ImportDocumentationPartsOutput, error) { + req, out := c.ImportDocumentationPartsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportRestApi = "ImportRestApi" @@ -5488,8 +6889,23 @@ func (c *APIGateway) ImportRestApiRequest(input *ImportRestApiInput) (req *reque // func (c *APIGateway) ImportRestApi(input *ImportRestApiInput) (*RestApi, error) { req, out := c.ImportRestApiRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportRestApiWithContext is the same as ImportRestApi with the addition of +// the ability to pass a context and additional request options. +// +// See ImportRestApi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportRestApiWithContext(ctx aws.Context, input *ImportRestApiInput, opts ...request.Option) (*RestApi, error) { + req, out := c.ImportRestApiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutIntegration = "PutIntegration" @@ -5557,8 +6973,23 @@ func (c *APIGateway) PutIntegrationRequest(input *PutIntegrationInput) (req *req // func (c *APIGateway) PutIntegration(input *PutIntegrationInput) (*Integration, error) { req, out := c.PutIntegrationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutIntegrationWithContext is the same as PutIntegration with the addition of +// the ability to pass a context and additional request options. +// +// See PutIntegration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutIntegrationWithContext(ctx aws.Context, input *PutIntegrationInput, opts ...request.Option) (*Integration, error) { + req, out := c.PutIntegrationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutIntegrationResponse = "PutIntegrationResponse" @@ -5628,8 +7059,23 @@ func (c *APIGateway) PutIntegrationResponseRequest(input *PutIntegrationResponse // func (c *APIGateway) PutIntegrationResponse(input *PutIntegrationResponseInput) (*IntegrationResponse, error) { req, out := c.PutIntegrationResponseRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutIntegrationResponseWithContext is the same as PutIntegrationResponse with the addition of +// the ability to pass a context and additional request options. +// +// See PutIntegrationResponse for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutIntegrationResponseWithContext(ctx aws.Context, input *PutIntegrationResponseInput, opts ...request.Option) (*IntegrationResponse, error) { + req, out := c.PutIntegrationResponseRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutMethod = "PutMethod" @@ -5699,8 +7145,23 @@ func (c *APIGateway) PutMethodRequest(input *PutMethodInput) (req *request.Reque // func (c *APIGateway) PutMethod(input *PutMethodInput) (*Method, error) { req, out := c.PutMethodRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutMethodWithContext is the same as PutMethod with the addition of +// the ability to pass a context and additional request options. +// +// See PutMethod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutMethodWithContext(ctx aws.Context, input *PutMethodInput, opts ...request.Option) (*Method, error) { + req, out := c.PutMethodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutMethodResponse = "PutMethodResponse" @@ -5770,8 +7231,23 @@ func (c *APIGateway) PutMethodResponseRequest(input *PutMethodResponseInput) (re // func (c *APIGateway) PutMethodResponse(input *PutMethodResponseInput) (*MethodResponse, error) { req, out := c.PutMethodResponseRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutMethodResponseWithContext is the same as PutMethodResponse with the addition of +// the ability to pass a context and additional request options. +// +// See PutMethodResponse for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutMethodResponseWithContext(ctx aws.Context, input *PutMethodResponseInput, opts ...request.Option) (*MethodResponse, error) { + req, out := c.PutMethodResponseRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutRestApi = "PutRestApi" @@ -5844,8 +7320,23 @@ func (c *APIGateway) PutRestApiRequest(input *PutRestApiInput) (req *request.Req // func (c *APIGateway) PutRestApi(input *PutRestApiInput) (*RestApi, error) { req, out := c.PutRestApiRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutRestApiWithContext is the same as PutRestApi with the addition of +// the ability to pass a context and additional request options. +// +// See PutRestApi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutRestApiWithContext(ctx aws.Context, input *PutRestApiInput, opts ...request.Option) (*RestApi, error) { + req, out := c.PutRestApiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTestInvokeAuthorizer = "TestInvokeAuthorizer" @@ -5914,8 +7405,23 @@ func (c *APIGateway) TestInvokeAuthorizerRequest(input *TestInvokeAuthorizerInpu // func (c *APIGateway) TestInvokeAuthorizer(input *TestInvokeAuthorizerInput) (*TestInvokeAuthorizerOutput, error) { req, out := c.TestInvokeAuthorizerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TestInvokeAuthorizerWithContext is the same as TestInvokeAuthorizer with the addition of +// the ability to pass a context and additional request options. +// +// See TestInvokeAuthorizer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TestInvokeAuthorizerWithContext(ctx aws.Context, input *TestInvokeAuthorizerInput, opts ...request.Option) (*TestInvokeAuthorizerOutput, error) { + req, out := c.TestInvokeAuthorizerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTestInvokeMethod = "TestInvokeMethod" @@ -5982,8 +7488,23 @@ func (c *APIGateway) TestInvokeMethodRequest(input *TestInvokeMethodInput) (req // func (c *APIGateway) TestInvokeMethod(input *TestInvokeMethodInput) (*TestInvokeMethodOutput, error) { req, out := c.TestInvokeMethodRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TestInvokeMethodWithContext is the same as TestInvokeMethod with the addition of +// the ability to pass a context and additional request options. +// +// See TestInvokeMethod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TestInvokeMethodWithContext(ctx aws.Context, input *TestInvokeMethodInput, opts ...request.Option) (*TestInvokeMethodOutput, error) { + req, out := c.TestInvokeMethodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAccount = "UpdateAccount" @@ -6049,8 +7570,23 @@ func (c *APIGateway) UpdateAccountRequest(input *UpdateAccountInput) (req *reque // func (c *APIGateway) UpdateAccount(input *UpdateAccountInput) (*Account, error) { req, out := c.UpdateAccountRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAccountWithContext is the same as UpdateAccount with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAccount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAccountWithContext(ctx aws.Context, input *UpdateAccountInput, opts ...request.Option) (*Account, error) { + req, out := c.UpdateAccountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateApiKey = "UpdateApiKey" @@ -6118,8 +7654,23 @@ func (c *APIGateway) UpdateApiKeyRequest(input *UpdateApiKeyInput) (req *request // func (c *APIGateway) UpdateApiKey(input *UpdateApiKeyInput) (*ApiKey, error) { req, out := c.UpdateApiKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateApiKeyWithContext is the same as UpdateApiKey with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApiKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateApiKeyWithContext(ctx aws.Context, input *UpdateApiKeyInput, opts ...request.Option) (*ApiKey, error) { + req, out := c.UpdateApiKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAuthorizer = "UpdateAuthorizer" @@ -6187,8 +7738,23 @@ func (c *APIGateway) UpdateAuthorizerRequest(input *UpdateAuthorizerInput) (req // func (c *APIGateway) UpdateAuthorizer(input *UpdateAuthorizerInput) (*Authorizer, error) { req, out := c.UpdateAuthorizerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAuthorizerWithContext is the same as UpdateAuthorizer with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAuthorizer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAuthorizerWithContext(ctx aws.Context, input *UpdateAuthorizerInput, opts ...request.Option) (*Authorizer, error) { + req, out := c.UpdateAuthorizerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateBasePathMapping = "UpdateBasePathMapping" @@ -6256,8 +7822,23 @@ func (c *APIGateway) UpdateBasePathMappingRequest(input *UpdateBasePathMappingIn // func (c *APIGateway) UpdateBasePathMapping(input *UpdateBasePathMappingInput) (*BasePathMapping, error) { req, out := c.UpdateBasePathMappingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateBasePathMappingWithContext is the same as UpdateBasePathMapping with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateBasePathMapping for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateBasePathMappingWithContext(ctx aws.Context, input *UpdateBasePathMappingInput, opts ...request.Option) (*BasePathMapping, error) { + req, out := c.UpdateBasePathMappingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateClientCertificate = "UpdateClientCertificate" @@ -6323,8 +7904,23 @@ func (c *APIGateway) UpdateClientCertificateRequest(input *UpdateClientCertifica // func (c *APIGateway) UpdateClientCertificate(input *UpdateClientCertificateInput) (*ClientCertificate, error) { req, out := c.UpdateClientCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateClientCertificateWithContext is the same as UpdateClientCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateClientCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateClientCertificateWithContext(ctx aws.Context, input *UpdateClientCertificateInput, opts ...request.Option) (*ClientCertificate, error) { + req, out := c.UpdateClientCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDeployment = "UpdateDeployment" @@ -6392,8 +7988,23 @@ func (c *APIGateway) UpdateDeploymentRequest(input *UpdateDeploymentInput) (req // func (c *APIGateway) UpdateDeployment(input *UpdateDeploymentInput) (*Deployment, error) { req, out := c.UpdateDeploymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDeploymentWithContext is the same as UpdateDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateDeploymentWithContext(ctx aws.Context, input *UpdateDeploymentInput, opts ...request.Option) (*Deployment, error) { + req, out := c.UpdateDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDocumentationPart = "UpdateDocumentationPart" @@ -6461,8 +8072,23 @@ func (c *APIGateway) UpdateDocumentationPartRequest(input *UpdateDocumentationPa // func (c *APIGateway) UpdateDocumentationPart(input *UpdateDocumentationPartInput) (*DocumentationPart, error) { req, out := c.UpdateDocumentationPartRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDocumentationPartWithContext is the same as UpdateDocumentationPart with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDocumentationPart for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateDocumentationPartWithContext(ctx aws.Context, input *UpdateDocumentationPartInput, opts ...request.Option) (*DocumentationPart, error) { + req, out := c.UpdateDocumentationPartRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDocumentationVersion = "UpdateDocumentationVersion" @@ -6528,8 +8154,23 @@ func (c *APIGateway) UpdateDocumentationVersionRequest(input *UpdateDocumentatio // func (c *APIGateway) UpdateDocumentationVersion(input *UpdateDocumentationVersionInput) (*DocumentationVersion, error) { req, out := c.UpdateDocumentationVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDocumentationVersionWithContext is the same as UpdateDocumentationVersion with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDocumentationVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateDocumentationVersionWithContext(ctx aws.Context, input *UpdateDocumentationVersionInput, opts ...request.Option) (*DocumentationVersion, error) { + req, out := c.UpdateDocumentationVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDomainName = "UpdateDomainName" @@ -6597,8 +8238,23 @@ func (c *APIGateway) UpdateDomainNameRequest(input *UpdateDomainNameInput) (req // func (c *APIGateway) UpdateDomainName(input *UpdateDomainNameInput) (*DomainName, error) { req, out := c.UpdateDomainNameRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDomainNameWithContext is the same as UpdateDomainName with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDomainName for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateDomainNameWithContext(ctx aws.Context, input *UpdateDomainNameInput, opts ...request.Option) (*DomainName, error) { + req, out := c.UpdateDomainNameRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateIntegration = "UpdateIntegration" @@ -6666,8 +8322,23 @@ func (c *APIGateway) UpdateIntegrationRequest(input *UpdateIntegrationInput) (re // func (c *APIGateway) UpdateIntegration(input *UpdateIntegrationInput) (*Integration, error) { req, out := c.UpdateIntegrationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateIntegrationWithContext is the same as UpdateIntegration with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateIntegration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateIntegrationWithContext(ctx aws.Context, input *UpdateIntegrationInput, opts ...request.Option) (*Integration, error) { + req, out := c.UpdateIntegrationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateIntegrationResponse = "UpdateIntegrationResponse" @@ -6735,8 +8406,23 @@ func (c *APIGateway) UpdateIntegrationResponseRequest(input *UpdateIntegrationRe // func (c *APIGateway) UpdateIntegrationResponse(input *UpdateIntegrationResponseInput) (*IntegrationResponse, error) { req, out := c.UpdateIntegrationResponseRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateIntegrationResponseWithContext is the same as UpdateIntegrationResponse with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateIntegrationResponse for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateIntegrationResponseWithContext(ctx aws.Context, input *UpdateIntegrationResponseInput, opts ...request.Option) (*IntegrationResponse, error) { + req, out := c.UpdateIntegrationResponseRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateMethod = "UpdateMethod" @@ -6804,8 +8490,23 @@ func (c *APIGateway) UpdateMethodRequest(input *UpdateMethodInput) (req *request // func (c *APIGateway) UpdateMethod(input *UpdateMethodInput) (*Method, error) { req, out := c.UpdateMethodRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateMethodWithContext is the same as UpdateMethod with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateMethod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateMethodWithContext(ctx aws.Context, input *UpdateMethodInput, opts ...request.Option) (*Method, error) { + req, out := c.UpdateMethodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateMethodResponse = "UpdateMethodResponse" @@ -6875,8 +8576,23 @@ func (c *APIGateway) UpdateMethodResponseRequest(input *UpdateMethodResponseInpu // func (c *APIGateway) UpdateMethodResponse(input *UpdateMethodResponseInput) (*MethodResponse, error) { req, out := c.UpdateMethodResponseRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateMethodResponseWithContext is the same as UpdateMethodResponse with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateMethodResponse for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateMethodResponseWithContext(ctx aws.Context, input *UpdateMethodResponseInput, opts ...request.Option) (*MethodResponse, error) { + req, out := c.UpdateMethodResponseRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateModel = "UpdateModel" @@ -6944,8 +8660,23 @@ func (c *APIGateway) UpdateModelRequest(input *UpdateModelInput) (req *request.R // func (c *APIGateway) UpdateModel(input *UpdateModelInput) (*Model, error) { req, out := c.UpdateModelRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateModelWithContext is the same as UpdateModel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateModel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateModelWithContext(ctx aws.Context, input *UpdateModelInput, opts ...request.Option) (*Model, error) { + req, out := c.UpdateModelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateResource = "UpdateResource" @@ -7013,8 +8744,23 @@ func (c *APIGateway) UpdateResourceRequest(input *UpdateResourceInput) (req *req // func (c *APIGateway) UpdateResource(input *UpdateResourceInput) (*Resource, error) { req, out := c.UpdateResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateResourceWithContext is the same as UpdateResource with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateResourceWithContext(ctx aws.Context, input *UpdateResourceInput, opts ...request.Option) (*Resource, error) { + req, out := c.UpdateResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateRestApi = "UpdateRestApi" @@ -7082,8 +8828,23 @@ func (c *APIGateway) UpdateRestApiRequest(input *UpdateRestApiInput) (req *reque // func (c *APIGateway) UpdateRestApi(input *UpdateRestApiInput) (*RestApi, error) { req, out := c.UpdateRestApiRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateRestApiWithContext is the same as UpdateRestApi with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRestApi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateRestApiWithContext(ctx aws.Context, input *UpdateRestApiInput, opts ...request.Option) (*RestApi, error) { + req, out := c.UpdateRestApiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateStage = "UpdateStage" @@ -7151,8 +8912,23 @@ func (c *APIGateway) UpdateStageRequest(input *UpdateStageInput) (req *request.R // func (c *APIGateway) UpdateStage(input *UpdateStageInput) (*Stage, error) { req, out := c.UpdateStageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateStageWithContext is the same as UpdateStage with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateStageWithContext(ctx aws.Context, input *UpdateStageInput, opts ...request.Option) (*Stage, error) { + req, out := c.UpdateStageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateUsage = "UpdateUsage" @@ -7219,8 +8995,23 @@ func (c *APIGateway) UpdateUsageRequest(input *UpdateUsageInput) (req *request.R // func (c *APIGateway) UpdateUsage(input *UpdateUsageInput) (*Usage, error) { req, out := c.UpdateUsageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateUsageWithContext is the same as UpdateUsage with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateUsage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateUsageWithContext(ctx aws.Context, input *UpdateUsageInput, opts ...request.Option) (*Usage, error) { + req, out := c.UpdateUsageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateUsagePlan = "UpdateUsagePlan" @@ -7288,8 +9079,23 @@ func (c *APIGateway) UpdateUsagePlanRequest(input *UpdateUsagePlanInput) (req *r // func (c *APIGateway) UpdateUsagePlan(input *UpdateUsagePlanInput) (*UsagePlan, error) { req, out := c.UpdateUsagePlanRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateUsagePlanWithContext is the same as UpdateUsagePlan with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateUsagePlan for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateUsagePlanWithContext(ctx aws.Context, input *UpdateUsagePlanInput, opts ...request.Option) (*UsagePlan, error) { + req, out := c.UpdateUsagePlanRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Represents an AWS account that is associated with Amazon API Gateway. diff --git a/vendor/github.com/aws/aws-sdk-go/service/apigateway/errors.go b/vendor/github.com/aws/aws-sdk-go/service/apigateway/errors.go index b06644b71..b8f2efc29 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/apigateway/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package apigateway diff --git a/vendor/github.com/aws/aws-sdk-go/service/apigateway/service.go b/vendor/github.com/aws/aws-sdk-go/service/apigateway/service.go index 052f84a69..c544015c4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/apigateway/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package apigateway diff --git a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/api.go b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/api.go index ba6abe54f..24e9f5be3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package applicationautoscaling provides a client for Application Auto Scaling. package applicationautoscaling @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -94,8 +95,23 @@ func (c *ApplicationAutoScaling) DeleteScalingPolicyRequest(input *DeleteScaling // Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScalingPolicy func (c *ApplicationAutoScaling) DeleteScalingPolicy(input *DeleteScalingPolicyInput) (*DeleteScalingPolicyOutput, error) { req, out := c.DeleteScalingPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteScalingPolicyWithContext is the same as DeleteScalingPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteScalingPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteScalingPolicyWithContext(ctx aws.Context, input *DeleteScalingPolicyInput, opts ...request.Option) (*DeleteScalingPolicyOutput, error) { + req, out := c.DeleteScalingPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterScalableTarget = "DeregisterScalableTarget" @@ -180,8 +196,23 @@ func (c *ApplicationAutoScaling) DeregisterScalableTargetRequest(input *Deregist // Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeregisterScalableTarget func (c *ApplicationAutoScaling) DeregisterScalableTarget(input *DeregisterScalableTargetInput) (*DeregisterScalableTargetOutput, error) { req, out := c.DeregisterScalableTargetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterScalableTargetWithContext is the same as DeregisterScalableTarget with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterScalableTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterScalableTargetWithContext(ctx aws.Context, input *DeregisterScalableTargetInput, opts ...request.Option) (*DeregisterScalableTargetOutput, error) { + req, out := c.DeregisterScalableTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeScalableTargets = "DescribeScalableTargets" @@ -269,8 +300,23 @@ func (c *ApplicationAutoScaling) DescribeScalableTargetsRequest(input *DescribeS // Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalableTargets func (c *ApplicationAutoScaling) DescribeScalableTargets(input *DescribeScalableTargetsInput) (*DescribeScalableTargetsOutput, error) { req, out := c.DescribeScalableTargetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeScalableTargetsWithContext is the same as DescribeScalableTargets with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScalableTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeScalableTargetsWithContext(ctx aws.Context, input *DescribeScalableTargetsInput, opts ...request.Option) (*DescribeScalableTargetsOutput, error) { + req, out := c.DescribeScalableTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeScalableTargetsPages iterates over the pages of a DescribeScalableTargets operation, @@ -290,12 +336,37 @@ func (c *ApplicationAutoScaling) DescribeScalableTargets(input *DescribeScalable // return pageNum <= 3 // }) // -func (c *ApplicationAutoScaling) DescribeScalableTargetsPages(input *DescribeScalableTargetsInput, fn func(p *DescribeScalableTargetsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScalableTargetsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScalableTargetsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScalableTargetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScalableTargetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScalableTargetsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeScalingActivities = "DescribeScalingActivities" @@ -384,8 +455,23 @@ func (c *ApplicationAutoScaling) DescribeScalingActivitiesRequest(input *Describ // Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingActivities func (c *ApplicationAutoScaling) DescribeScalingActivities(input *DescribeScalingActivitiesInput) (*DescribeScalingActivitiesOutput, error) { req, out := c.DescribeScalingActivitiesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeScalingActivitiesWithContext is the same as DescribeScalingActivities with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScalingActivities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeScalingActivitiesWithContext(ctx aws.Context, input *DescribeScalingActivitiesInput, opts ...request.Option) (*DescribeScalingActivitiesOutput, error) { + req, out := c.DescribeScalingActivitiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeScalingActivitiesPages iterates over the pages of a DescribeScalingActivities operation, @@ -405,12 +491,37 @@ func (c *ApplicationAutoScaling) DescribeScalingActivities(input *DescribeScalin // return pageNum <= 3 // }) // -func (c *ApplicationAutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActivitiesInput, fn func(p *DescribeScalingActivitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScalingActivitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScalingActivitiesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScalingActivitiesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScalingActivitiesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeScalingPolicies = "DescribeScalingPolicies" @@ -507,8 +618,23 @@ func (c *ApplicationAutoScaling) DescribeScalingPoliciesRequest(input *DescribeS // Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingPolicies func (c *ApplicationAutoScaling) DescribeScalingPolicies(input *DescribeScalingPoliciesInput) (*DescribeScalingPoliciesOutput, error) { req, out := c.DescribeScalingPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeScalingPoliciesWithContext is the same as DescribeScalingPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScalingPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeScalingPoliciesWithContext(ctx aws.Context, input *DescribeScalingPoliciesInput, opts ...request.Option) (*DescribeScalingPoliciesOutput, error) { + req, out := c.DescribeScalingPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeScalingPoliciesPages iterates over the pages of a DescribeScalingPolicies operation, @@ -528,12 +654,37 @@ func (c *ApplicationAutoScaling) DescribeScalingPolicies(input *DescribeScalingP // return pageNum <= 3 // }) // -func (c *ApplicationAutoScaling) DescribeScalingPoliciesPages(input *DescribeScalingPoliciesInput, fn func(p *DescribeScalingPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScalingPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScalingPoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScalingPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScalingPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScalingPoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opPutScalingPolicy = "PutScalingPolicy" @@ -630,8 +781,23 @@ func (c *ApplicationAutoScaling) PutScalingPolicyRequest(input *PutScalingPolicy // Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScalingPolicy func (c *ApplicationAutoScaling) PutScalingPolicy(input *PutScalingPolicyInput) (*PutScalingPolicyOutput, error) { req, out := c.PutScalingPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutScalingPolicyWithContext is the same as PutScalingPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutScalingPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutScalingPolicyWithContext(ctx aws.Context, input *PutScalingPolicyInput, opts ...request.Option) (*PutScalingPolicyOutput, error) { + req, out := c.PutScalingPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterScalableTarget = "RegisterScalableTarget" @@ -716,8 +882,23 @@ func (c *ApplicationAutoScaling) RegisterScalableTargetRequest(input *RegisterSc // Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/RegisterScalableTarget func (c *ApplicationAutoScaling) RegisterScalableTarget(input *RegisterScalableTargetInput) (*RegisterScalableTargetOutput, error) { req, out := c.RegisterScalableTargetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterScalableTargetWithContext is the same as RegisterScalableTarget with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterScalableTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterScalableTargetWithContext(ctx aws.Context, input *RegisterScalableTargetInput, opts ...request.Option) (*RegisterScalableTargetOutput, error) { + req, out := c.RegisterScalableTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Represents a CloudWatch alarm associated with a scaling policy. @@ -779,6 +960,9 @@ type DeleteScalingPolicyInput struct { // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -793,6 +977,9 @@ type DeleteScalingPolicyInput struct { // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -897,6 +1084,9 @@ type DeregisterScalableTargetInput struct { // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -911,6 +1101,9 @@ type DeregisterScalableTargetInput struct { // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -1015,6 +1208,9 @@ type DescribeScalableTargetsInput struct { // // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. + // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. ResourceIds []*string `type:"list"` // The scalable dimension associated with the scalable target. This string consists @@ -1028,6 +1224,9 @@ type DescribeScalableTargetsInput struct { // // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. + // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. ScalableDimension *string `type:"string" enum:"ScalableDimension"` // The namespace of the AWS service. For more information, see AWS Service Namespaces @@ -1153,6 +1352,9 @@ type DescribeScalingActivitiesInput struct { // // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. + // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. ResourceId *string `min:"1" type:"string"` // The scalable dimension. This string consists of the service namespace, resource @@ -1166,6 +1368,9 @@ type DescribeScalingActivitiesInput struct { // // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. + // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. ScalableDimension *string `type:"string" enum:"ScalableDimension"` // The namespace of the AWS service. For more information, see AWS Service Namespaces @@ -1297,6 +1502,9 @@ type DescribeScalingPoliciesInput struct { // // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. + // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. ResourceId *string `min:"1" type:"string"` // The scalable dimension. This string consists of the service namespace, resource @@ -1310,6 +1518,9 @@ type DescribeScalingPoliciesInput struct { // // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. + // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. ScalableDimension *string `type:"string" enum:"ScalableDimension"` // The namespace of the AWS service. For more information, see AWS Service Namespaces @@ -1441,6 +1652,9 @@ type PutScalingPolicyInput struct { // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -1455,6 +1669,9 @@ type PutScalingPolicyInput struct { // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -1603,6 +1820,9 @@ type RegisterScalableTargetInput struct { // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -1622,6 +1842,9 @@ type RegisterScalableTargetInput struct { // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -1751,6 +1974,9 @@ type ScalableTarget struct { // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -1771,6 +1997,9 @@ type ScalableTarget struct { // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -1872,6 +2101,9 @@ type ScalingActivity struct { // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -1886,6 +2118,9 @@ type ScalingActivity struct { // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -2026,6 +2261,9 @@ type ScalingPolicy struct { // * EMR cluster - The resource type is instancegroup and the unique identifier // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. // + // * AppStream 2.0 fleet - The resource type is fleet and the unique identifier + // is the fleet name. Example: fleet/sample-fleet. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -2040,6 +2278,9 @@ type ScalingPolicy struct { // * elasticmapreduce:instancegroup:InstanceCount - The instance count of // an EMR Instance Group. // + // * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream + // 2.0 fleet. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -2358,6 +2599,9 @@ const ( // ScalableDimensionElasticmapreduceInstancegroupInstanceCount is a ScalableDimension enum value ScalableDimensionElasticmapreduceInstancegroupInstanceCount = "elasticmapreduce:instancegroup:InstanceCount" + + // ScalableDimensionAppstreamFleetDesiredCapacity is a ScalableDimension enum value + ScalableDimensionAppstreamFleetDesiredCapacity = "appstream:fleet:DesiredCapacity" ) const ( @@ -2389,4 +2633,7 @@ const ( // ServiceNamespaceEc2 is a ServiceNamespace enum value ServiceNamespaceEc2 = "ec2" + + // ServiceNamespaceAppstream is a ServiceNamespace enum value + ServiceNamespaceAppstream = "appstream" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/errors.go b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/errors.go index 019a4bfc4..a028955cc 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package applicationautoscaling diff --git a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/service.go b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/service.go index 80a749856..4ce02860e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package applicationautoscaling @@ -35,6 +35,10 @@ import ( // in Amazon EMR (http://docs.aws.amazon.com/ElasticMapReduce/latest/ManagementGuide/emr-automatic-scaling.html) // in the Amazon EMR Management Guide. // +// * AppStream 2.0 fleets. For more information, see Autoscaling Amazon AppStream +// 2.0 Resources (http://docs.aws.amazon.com/appstream2/latest/developerguide/autoscaling.html) +// in the Amazon AppStream 2.0 Developer Guide. +// // For a list of supported regions, see AWS Regions and Endpoints: Application // Auto Scaling (http://docs.aws.amazon.com/general/latest/gr/rande.html#as-app_region) // in the AWS General Reference. diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go index 64bb6017f..a4512f989 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package autoscaling provides a client for Auto Scaling. package autoscaling @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -91,8 +92,23 @@ func (c *AutoScaling) AttachInstancesRequest(input *AttachInstancesInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachInstances func (c *AutoScaling) AttachInstances(input *AttachInstancesInput) (*AttachInstancesOutput, error) { req, out := c.AttachInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachInstancesWithContext is the same as AttachInstances with the addition of +// the ability to pass a context and additional request options. +// +// See AttachInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachInstancesWithContext(ctx aws.Context, input *AttachInstancesInput, opts ...request.Option) (*AttachInstancesOutput, error) { + req, out := c.AttachInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachLoadBalancerTargetGroups = "AttachLoadBalancerTargetGroups" @@ -164,8 +180,23 @@ func (c *AutoScaling) AttachLoadBalancerTargetGroupsRequest(input *AttachLoadBal // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancerTargetGroups func (c *AutoScaling) AttachLoadBalancerTargetGroups(input *AttachLoadBalancerTargetGroupsInput) (*AttachLoadBalancerTargetGroupsOutput, error) { req, out := c.AttachLoadBalancerTargetGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachLoadBalancerTargetGroupsWithContext is the same as AttachLoadBalancerTargetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See AttachLoadBalancerTargetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachLoadBalancerTargetGroupsWithContext(ctx aws.Context, input *AttachLoadBalancerTargetGroupsInput, opts ...request.Option) (*AttachLoadBalancerTargetGroupsOutput, error) { + req, out := c.AttachLoadBalancerTargetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachLoadBalancers = "AttachLoadBalancers" @@ -240,8 +271,23 @@ func (c *AutoScaling) AttachLoadBalancersRequest(input *AttachLoadBalancersInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancers func (c *AutoScaling) AttachLoadBalancers(input *AttachLoadBalancersInput) (*AttachLoadBalancersOutput, error) { req, out := c.AttachLoadBalancersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachLoadBalancersWithContext is the same as AttachLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See AttachLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachLoadBalancersWithContext(ctx aws.Context, input *AttachLoadBalancersInput, opts ...request.Option) (*AttachLoadBalancersOutput, error) { + req, out := c.AttachLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCompleteLifecycleAction = "CompleteLifecycleAction" @@ -328,8 +374,23 @@ func (c *AutoScaling) CompleteLifecycleActionRequest(input *CompleteLifecycleAct // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CompleteLifecycleAction func (c *AutoScaling) CompleteLifecycleAction(input *CompleteLifecycleActionInput) (*CompleteLifecycleActionOutput, error) { req, out := c.CompleteLifecycleActionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CompleteLifecycleActionWithContext is the same as CompleteLifecycleAction with the addition of +// the ability to pass a context and additional request options. +// +// See CompleteLifecycleAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CompleteLifecycleActionWithContext(ctx aws.Context, input *CompleteLifecycleActionInput, opts ...request.Option) (*CompleteLifecycleActionOutput, error) { + req, out := c.CompleteLifecycleActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAutoScalingGroup = "CreateAutoScalingGroup" @@ -412,8 +473,23 @@ func (c *AutoScaling) CreateAutoScalingGroupRequest(input *CreateAutoScalingGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateAutoScalingGroup func (c *AutoScaling) CreateAutoScalingGroup(input *CreateAutoScalingGroupInput) (*CreateAutoScalingGroupOutput, error) { req, out := c.CreateAutoScalingGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAutoScalingGroupWithContext is the same as CreateAutoScalingGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAutoScalingGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAutoScalingGroupWithContext(ctx aws.Context, input *CreateAutoScalingGroupInput, opts ...request.Option) (*CreateAutoScalingGroupOutput, error) { + req, out := c.CreateAutoScalingGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLaunchConfiguration = "CreateLaunchConfiguration" @@ -496,8 +572,23 @@ func (c *AutoScaling) CreateLaunchConfigurationRequest(input *CreateLaunchConfig // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateLaunchConfiguration func (c *AutoScaling) CreateLaunchConfiguration(input *CreateLaunchConfigurationInput) (*CreateLaunchConfigurationOutput, error) { req, out := c.CreateLaunchConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLaunchConfigurationWithContext is the same as CreateLaunchConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLaunchConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLaunchConfigurationWithContext(ctx aws.Context, input *CreateLaunchConfigurationInput, opts ...request.Option) (*CreateLaunchConfigurationOutput, error) { + req, out := c.CreateLaunchConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateOrUpdateTags = "CreateOrUpdateTags" @@ -579,8 +670,23 @@ func (c *AutoScaling) CreateOrUpdateTagsRequest(input *CreateOrUpdateTagsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*CreateOrUpdateTagsOutput, error) { req, out := c.CreateOrUpdateTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateOrUpdateTagsWithContext is the same as CreateOrUpdateTags with the addition of +// the ability to pass a context and additional request options. +// +// See CreateOrUpdateTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateOrUpdateTagsWithContext(ctx aws.Context, input *CreateOrUpdateTagsInput, opts ...request.Option) (*CreateOrUpdateTagsOutput, error) { + req, out := c.CreateOrUpdateTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAutoScalingGroup = "DeleteAutoScalingGroup" @@ -668,8 +774,23 @@ func (c *AutoScaling) DeleteAutoScalingGroupRequest(input *DeleteAutoScalingGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteAutoScalingGroup func (c *AutoScaling) DeleteAutoScalingGroup(input *DeleteAutoScalingGroupInput) (*DeleteAutoScalingGroupOutput, error) { req, out := c.DeleteAutoScalingGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAutoScalingGroupWithContext is the same as DeleteAutoScalingGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAutoScalingGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAutoScalingGroupWithContext(ctx aws.Context, input *DeleteAutoScalingGroupInput, opts ...request.Option) (*DeleteAutoScalingGroupOutput, error) { + req, out := c.DeleteAutoScalingGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLaunchConfiguration = "DeleteLaunchConfiguration" @@ -743,8 +864,23 @@ func (c *AutoScaling) DeleteLaunchConfigurationRequest(input *DeleteLaunchConfig // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLaunchConfiguration func (c *AutoScaling) DeleteLaunchConfiguration(input *DeleteLaunchConfigurationInput) (*DeleteLaunchConfigurationOutput, error) { req, out := c.DeleteLaunchConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLaunchConfigurationWithContext is the same as DeleteLaunchConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLaunchConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLaunchConfigurationWithContext(ctx aws.Context, input *DeleteLaunchConfigurationInput, opts ...request.Option) (*DeleteLaunchConfigurationOutput, error) { + req, out := c.DeleteLaunchConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLifecycleHook = "DeleteLifecycleHook" @@ -812,8 +948,23 @@ func (c *AutoScaling) DeleteLifecycleHookRequest(input *DeleteLifecycleHookInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLifecycleHook func (c *AutoScaling) DeleteLifecycleHook(input *DeleteLifecycleHookInput) (*DeleteLifecycleHookOutput, error) { req, out := c.DeleteLifecycleHookRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLifecycleHookWithContext is the same as DeleteLifecycleHook with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLifecycleHook for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLifecycleHookWithContext(ctx aws.Context, input *DeleteLifecycleHookInput, opts ...request.Option) (*DeleteLifecycleHookOutput, error) { + req, out := c.DeleteLifecycleHookRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteNotificationConfiguration = "DeleteNotificationConfiguration" @@ -880,8 +1031,23 @@ func (c *AutoScaling) DeleteNotificationConfigurationRequest(input *DeleteNotifi // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteNotificationConfiguration func (c *AutoScaling) DeleteNotificationConfiguration(input *DeleteNotificationConfigurationInput) (*DeleteNotificationConfigurationOutput, error) { req, out := c.DeleteNotificationConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteNotificationConfigurationWithContext is the same as DeleteNotificationConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteNotificationConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteNotificationConfigurationWithContext(ctx aws.Context, input *DeleteNotificationConfigurationInput, opts ...request.Option) (*DeleteNotificationConfigurationOutput, error) { + req, out := c.DeleteNotificationConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePolicy = "DeletePolicy" @@ -951,8 +1117,23 @@ func (c *AutoScaling) DeletePolicyRequest(input *DeletePolicyInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeletePolicy func (c *AutoScaling) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { req, out := c.DeletePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePolicyWithContext is the same as DeletePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeletePolicyWithContext(ctx aws.Context, input *DeletePolicyInput, opts ...request.Option) (*DeletePolicyOutput, error) { + req, out := c.DeletePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteScheduledAction = "DeleteScheduledAction" @@ -1019,8 +1200,23 @@ func (c *AutoScaling) DeleteScheduledActionRequest(input *DeleteScheduledActionI // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteScheduledAction func (c *AutoScaling) DeleteScheduledAction(input *DeleteScheduledActionInput) (*DeleteScheduledActionOutput, error) { req, out := c.DeleteScheduledActionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteScheduledActionWithContext is the same as DeleteScheduledAction with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteScheduledAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteScheduledActionWithContext(ctx aws.Context, input *DeleteScheduledActionInput, opts ...request.Option) (*DeleteScheduledActionOutput, error) { + req, out := c.DeleteScheduledActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTags = "DeleteTags" @@ -1087,8 +1283,23 @@ func (c *AutoScaling) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteTags func (c *AutoScaling) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { req, out := c.DeleteTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTagsWithContext is the same as DeleteTags with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { + req, out := c.DeleteTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAccountLimits = "DescribeAccountLimits" @@ -1157,8 +1368,23 @@ func (c *AutoScaling) DescribeAccountLimitsRequest(input *DescribeAccountLimitsI // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAccountLimits func (c *AutoScaling) DescribeAccountLimits(input *DescribeAccountLimitsInput) (*DescribeAccountLimitsOutput, error) { req, out := c.DescribeAccountLimitsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAccountLimitsWithContext is the same as DescribeAccountLimits with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAccountLimits for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAccountLimitsWithContext(ctx aws.Context, input *DescribeAccountLimitsInput, opts ...request.Option) (*DescribeAccountLimitsOutput, error) { + req, out := c.DescribeAccountLimitsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAdjustmentTypes = "DescribeAdjustmentTypes" @@ -1223,8 +1449,23 @@ func (c *AutoScaling) DescribeAdjustmentTypesRequest(input *DescribeAdjustmentTy // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAdjustmentTypes func (c *AutoScaling) DescribeAdjustmentTypes(input *DescribeAdjustmentTypesInput) (*DescribeAdjustmentTypesOutput, error) { req, out := c.DescribeAdjustmentTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAdjustmentTypesWithContext is the same as DescribeAdjustmentTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAdjustmentTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAdjustmentTypesWithContext(ctx aws.Context, input *DescribeAdjustmentTypesInput, opts ...request.Option) (*DescribeAdjustmentTypesOutput, error) { + req, out := c.DescribeAdjustmentTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAutoScalingGroups = "DescribeAutoScalingGroups" @@ -1298,8 +1539,23 @@ func (c *AutoScaling) DescribeAutoScalingGroupsRequest(input *DescribeAutoScalin // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingGroups func (c *AutoScaling) DescribeAutoScalingGroups(input *DescribeAutoScalingGroupsInput) (*DescribeAutoScalingGroupsOutput, error) { req, out := c.DescribeAutoScalingGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAutoScalingGroupsWithContext is the same as DescribeAutoScalingGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAutoScalingGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAutoScalingGroupsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.Option) (*DescribeAutoScalingGroupsOutput, error) { + req, out := c.DescribeAutoScalingGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeAutoScalingGroupsPages iterates over the pages of a DescribeAutoScalingGroups operation, @@ -1319,12 +1575,37 @@ func (c *AutoScaling) DescribeAutoScalingGroups(input *DescribeAutoScalingGroups // return pageNum <= 3 // }) // -func (c *AutoScaling) DescribeAutoScalingGroupsPages(input *DescribeAutoScalingGroupsInput, fn func(p *DescribeAutoScalingGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeAutoScalingGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeAutoScalingGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeAutoScalingGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeAutoScalingGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeAutoScalingInstances = "DescribeAutoScalingInstances" @@ -1398,8 +1679,23 @@ func (c *AutoScaling) DescribeAutoScalingInstancesRequest(input *DescribeAutoSca // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingInstances func (c *AutoScaling) DescribeAutoScalingInstances(input *DescribeAutoScalingInstancesInput) (*DescribeAutoScalingInstancesOutput, error) { req, out := c.DescribeAutoScalingInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAutoScalingInstancesWithContext is the same as DescribeAutoScalingInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAutoScalingInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAutoScalingInstancesWithContext(ctx aws.Context, input *DescribeAutoScalingInstancesInput, opts ...request.Option) (*DescribeAutoScalingInstancesOutput, error) { + req, out := c.DescribeAutoScalingInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeAutoScalingInstancesPages iterates over the pages of a DescribeAutoScalingInstances operation, @@ -1419,12 +1715,37 @@ func (c *AutoScaling) DescribeAutoScalingInstances(input *DescribeAutoScalingIns // return pageNum <= 3 // }) // -func (c *AutoScaling) DescribeAutoScalingInstancesPages(input *DescribeAutoScalingInstancesInput, fn func(p *DescribeAutoScalingInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeAutoScalingInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeAutoScalingInstancesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeAutoScalingInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeAutoScalingInstancesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeAutoScalingNotificationTypes = "DescribeAutoScalingNotificationTypes" @@ -1489,8 +1810,23 @@ func (c *AutoScaling) DescribeAutoScalingNotificationTypesRequest(input *Describ // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingNotificationTypes func (c *AutoScaling) DescribeAutoScalingNotificationTypes(input *DescribeAutoScalingNotificationTypesInput) (*DescribeAutoScalingNotificationTypesOutput, error) { req, out := c.DescribeAutoScalingNotificationTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAutoScalingNotificationTypesWithContext is the same as DescribeAutoScalingNotificationTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAutoScalingNotificationTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAutoScalingNotificationTypesWithContext(ctx aws.Context, input *DescribeAutoScalingNotificationTypesInput, opts ...request.Option) (*DescribeAutoScalingNotificationTypesOutput, error) { + req, out := c.DescribeAutoScalingNotificationTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLaunchConfigurations = "DescribeLaunchConfigurations" @@ -1564,8 +1900,23 @@ func (c *AutoScaling) DescribeLaunchConfigurationsRequest(input *DescribeLaunchC // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLaunchConfigurations func (c *AutoScaling) DescribeLaunchConfigurations(input *DescribeLaunchConfigurationsInput) (*DescribeLaunchConfigurationsOutput, error) { req, out := c.DescribeLaunchConfigurationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLaunchConfigurationsWithContext is the same as DescribeLaunchConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLaunchConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLaunchConfigurationsWithContext(ctx aws.Context, input *DescribeLaunchConfigurationsInput, opts ...request.Option) (*DescribeLaunchConfigurationsOutput, error) { + req, out := c.DescribeLaunchConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeLaunchConfigurationsPages iterates over the pages of a DescribeLaunchConfigurations operation, @@ -1585,12 +1936,37 @@ func (c *AutoScaling) DescribeLaunchConfigurations(input *DescribeLaunchConfigur // return pageNum <= 3 // }) // -func (c *AutoScaling) DescribeLaunchConfigurationsPages(input *DescribeLaunchConfigurationsInput, fn func(p *DescribeLaunchConfigurationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLaunchConfigurationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLaunchConfigurationsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLaunchConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLaunchConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLaunchConfigurationsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeLifecycleHookTypes = "DescribeLifecycleHookTypes" @@ -1655,8 +2031,23 @@ func (c *AutoScaling) DescribeLifecycleHookTypesRequest(input *DescribeLifecycle // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHookTypes func (c *AutoScaling) DescribeLifecycleHookTypes(input *DescribeLifecycleHookTypesInput) (*DescribeLifecycleHookTypesOutput, error) { req, out := c.DescribeLifecycleHookTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLifecycleHookTypesWithContext is the same as DescribeLifecycleHookTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLifecycleHookTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLifecycleHookTypesWithContext(ctx aws.Context, input *DescribeLifecycleHookTypesInput, opts ...request.Option) (*DescribeLifecycleHookTypesOutput, error) { + req, out := c.DescribeLifecycleHookTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLifecycleHooks = "DescribeLifecycleHooks" @@ -1721,8 +2112,23 @@ func (c *AutoScaling) DescribeLifecycleHooksRequest(input *DescribeLifecycleHook // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHooks func (c *AutoScaling) DescribeLifecycleHooks(input *DescribeLifecycleHooksInput) (*DescribeLifecycleHooksOutput, error) { req, out := c.DescribeLifecycleHooksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLifecycleHooksWithContext is the same as DescribeLifecycleHooks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLifecycleHooks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLifecycleHooksWithContext(ctx aws.Context, input *DescribeLifecycleHooksInput, opts ...request.Option) (*DescribeLifecycleHooksOutput, error) { + req, out := c.DescribeLifecycleHooksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLoadBalancerTargetGroups = "DescribeLoadBalancerTargetGroups" @@ -1787,8 +2193,23 @@ func (c *AutoScaling) DescribeLoadBalancerTargetGroupsRequest(input *DescribeLoa // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancerTargetGroups func (c *AutoScaling) DescribeLoadBalancerTargetGroups(input *DescribeLoadBalancerTargetGroupsInput) (*DescribeLoadBalancerTargetGroupsOutput, error) { req, out := c.DescribeLoadBalancerTargetGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoadBalancerTargetGroupsWithContext is the same as DescribeLoadBalancerTargetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancerTargetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoadBalancerTargetGroupsWithContext(ctx aws.Context, input *DescribeLoadBalancerTargetGroupsInput, opts ...request.Option) (*DescribeLoadBalancerTargetGroupsOutput, error) { + req, out := c.DescribeLoadBalancerTargetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLoadBalancers = "DescribeLoadBalancers" @@ -1856,8 +2277,23 @@ func (c *AutoScaling) DescribeLoadBalancersRequest(input *DescribeLoadBalancersI // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancers func (c *AutoScaling) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { req, out := c.DescribeLoadBalancersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoadBalancersWithContext is the same as DescribeLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoadBalancersWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.Option) (*DescribeLoadBalancersOutput, error) { + req, out := c.DescribeLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMetricCollectionTypes = "DescribeMetricCollectionTypes" @@ -1925,8 +2361,23 @@ func (c *AutoScaling) DescribeMetricCollectionTypesRequest(input *DescribeMetric // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeMetricCollectionTypes func (c *AutoScaling) DescribeMetricCollectionTypes(input *DescribeMetricCollectionTypesInput) (*DescribeMetricCollectionTypesOutput, error) { req, out := c.DescribeMetricCollectionTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMetricCollectionTypesWithContext is the same as DescribeMetricCollectionTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMetricCollectionTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMetricCollectionTypesWithContext(ctx aws.Context, input *DescribeMetricCollectionTypesInput, opts ...request.Option) (*DescribeMetricCollectionTypesOutput, error) { + req, out := c.DescribeMetricCollectionTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeNotificationConfigurations = "DescribeNotificationConfigurations" @@ -2001,8 +2452,23 @@ func (c *AutoScaling) DescribeNotificationConfigurationsRequest(input *DescribeN // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeNotificationConfigurations func (c *AutoScaling) DescribeNotificationConfigurations(input *DescribeNotificationConfigurationsInput) (*DescribeNotificationConfigurationsOutput, error) { req, out := c.DescribeNotificationConfigurationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeNotificationConfigurationsWithContext is the same as DescribeNotificationConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNotificationConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeNotificationConfigurationsWithContext(ctx aws.Context, input *DescribeNotificationConfigurationsInput, opts ...request.Option) (*DescribeNotificationConfigurationsOutput, error) { + req, out := c.DescribeNotificationConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeNotificationConfigurationsPages iterates over the pages of a DescribeNotificationConfigurations operation, @@ -2022,12 +2488,37 @@ func (c *AutoScaling) DescribeNotificationConfigurations(input *DescribeNotifica // return pageNum <= 3 // }) // -func (c *AutoScaling) DescribeNotificationConfigurationsPages(input *DescribeNotificationConfigurationsInput, fn func(p *DescribeNotificationConfigurationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeNotificationConfigurationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeNotificationConfigurationsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNotificationConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNotificationConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeNotificationConfigurationsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribePolicies = "DescribePolicies" @@ -2101,8 +2592,23 @@ func (c *AutoScaling) DescribePoliciesRequest(input *DescribePoliciesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribePolicies func (c *AutoScaling) DescribePolicies(input *DescribePoliciesInput) (*DescribePoliciesOutput, error) { req, out := c.DescribePoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribePoliciesWithContext is the same as DescribePolicies with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribePoliciesWithContext(ctx aws.Context, input *DescribePoliciesInput, opts ...request.Option) (*DescribePoliciesOutput, error) { + req, out := c.DescribePoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribePoliciesPages iterates over the pages of a DescribePolicies operation, @@ -2122,12 +2628,37 @@ func (c *AutoScaling) DescribePolicies(input *DescribePoliciesInput) (*DescribeP // return pageNum <= 3 // }) // -func (c *AutoScaling) DescribePoliciesPages(input *DescribePoliciesInput, fn func(p *DescribePoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribePoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribePoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribePoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribePoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribePoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeScalingActivities = "DescribeScalingActivities" @@ -2201,8 +2732,23 @@ func (c *AutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingAct // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingActivities func (c *AutoScaling) DescribeScalingActivities(input *DescribeScalingActivitiesInput) (*DescribeScalingActivitiesOutput, error) { req, out := c.DescribeScalingActivitiesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeScalingActivitiesWithContext is the same as DescribeScalingActivities with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScalingActivities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeScalingActivitiesWithContext(ctx aws.Context, input *DescribeScalingActivitiesInput, opts ...request.Option) (*DescribeScalingActivitiesOutput, error) { + req, out := c.DescribeScalingActivitiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeScalingActivitiesPages iterates over the pages of a DescribeScalingActivities operation, @@ -2222,12 +2768,37 @@ func (c *AutoScaling) DescribeScalingActivities(input *DescribeScalingActivities // return pageNum <= 3 // }) // -func (c *AutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActivitiesInput, fn func(p *DescribeScalingActivitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScalingActivitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScalingActivitiesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScalingActivitiesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScalingActivitiesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeScalingProcessTypes = "DescribeScalingProcessTypes" @@ -2292,8 +2863,23 @@ func (c *AutoScaling) DescribeScalingProcessTypesRequest(input *DescribeScalingP // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingProcessTypes func (c *AutoScaling) DescribeScalingProcessTypes(input *DescribeScalingProcessTypesInput) (*DescribeScalingProcessTypesOutput, error) { req, out := c.DescribeScalingProcessTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeScalingProcessTypesWithContext is the same as DescribeScalingProcessTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScalingProcessTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeScalingProcessTypesWithContext(ctx aws.Context, input *DescribeScalingProcessTypesInput, opts ...request.Option) (*DescribeScalingProcessTypesOutput, error) { + req, out := c.DescribeScalingProcessTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeScheduledActions = "DescribeScheduledActions" @@ -2368,8 +2954,23 @@ func (c *AutoScaling) DescribeScheduledActionsRequest(input *DescribeScheduledAc // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScheduledActions func (c *AutoScaling) DescribeScheduledActions(input *DescribeScheduledActionsInput) (*DescribeScheduledActionsOutput, error) { req, out := c.DescribeScheduledActionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeScheduledActionsWithContext is the same as DescribeScheduledActions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScheduledActions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeScheduledActionsWithContext(ctx aws.Context, input *DescribeScheduledActionsInput, opts ...request.Option) (*DescribeScheduledActionsOutput, error) { + req, out := c.DescribeScheduledActionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeScheduledActionsPages iterates over the pages of a DescribeScheduledActions operation, @@ -2389,12 +2990,37 @@ func (c *AutoScaling) DescribeScheduledActions(input *DescribeScheduledActionsIn // return pageNum <= 3 // }) // -func (c *AutoScaling) DescribeScheduledActionsPages(input *DescribeScheduledActionsInput, fn func(p *DescribeScheduledActionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScheduledActionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScheduledActionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScheduledActionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScheduledActionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeTags = "DescribeTags" @@ -2477,8 +3103,23 @@ func (c *AutoScaling) DescribeTagsRequest(input *DescribeTagsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTags func (c *AutoScaling) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTagsWithContext is the same as DescribeTags with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { + req, out := c.DescribeTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeTagsPages iterates over the pages of a DescribeTags operation, @@ -2498,12 +3139,37 @@ func (c *AutoScaling) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutpu // return pageNum <= 3 // }) // -func (c *AutoScaling) DescribeTagsPages(input *DescribeTagsInput, fn func(p *DescribeTagsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeTagsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeTagsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTagsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTagsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeTerminationPolicyTypes = "DescribeTerminationPolicyTypes" @@ -2568,8 +3234,23 @@ func (c *AutoScaling) DescribeTerminationPolicyTypesRequest(input *DescribeTermi // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTerminationPolicyTypes func (c *AutoScaling) DescribeTerminationPolicyTypes(input *DescribeTerminationPolicyTypesInput) (*DescribeTerminationPolicyTypesOutput, error) { req, out := c.DescribeTerminationPolicyTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTerminationPolicyTypesWithContext is the same as DescribeTerminationPolicyTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTerminationPolicyTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTerminationPolicyTypesWithContext(ctx aws.Context, input *DescribeTerminationPolicyTypesInput, opts ...request.Option) (*DescribeTerminationPolicyTypesOutput, error) { + req, out := c.DescribeTerminationPolicyTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachInstances = "DetachInstances" @@ -2649,8 +3330,23 @@ func (c *AutoScaling) DetachInstancesRequest(input *DetachInstancesInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachInstances func (c *AutoScaling) DetachInstances(input *DetachInstancesInput) (*DetachInstancesOutput, error) { req, out := c.DetachInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachInstancesWithContext is the same as DetachInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DetachInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachInstancesWithContext(ctx aws.Context, input *DetachInstancesInput, opts ...request.Option) (*DetachInstancesOutput, error) { + req, out := c.DetachInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachLoadBalancerTargetGroups = "DetachLoadBalancerTargetGroups" @@ -2715,8 +3411,23 @@ func (c *AutoScaling) DetachLoadBalancerTargetGroupsRequest(input *DetachLoadBal // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancerTargetGroups func (c *AutoScaling) DetachLoadBalancerTargetGroups(input *DetachLoadBalancerTargetGroupsInput) (*DetachLoadBalancerTargetGroupsOutput, error) { req, out := c.DetachLoadBalancerTargetGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachLoadBalancerTargetGroupsWithContext is the same as DetachLoadBalancerTargetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DetachLoadBalancerTargetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachLoadBalancerTargetGroupsWithContext(ctx aws.Context, input *DetachLoadBalancerTargetGroupsInput, opts ...request.Option) (*DetachLoadBalancerTargetGroupsOutput, error) { + req, out := c.DetachLoadBalancerTargetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachLoadBalancers = "DetachLoadBalancers" @@ -2790,8 +3501,23 @@ func (c *AutoScaling) DetachLoadBalancersRequest(input *DetachLoadBalancersInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancers func (c *AutoScaling) DetachLoadBalancers(input *DetachLoadBalancersInput) (*DetachLoadBalancersOutput, error) { req, out := c.DetachLoadBalancersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachLoadBalancersWithContext is the same as DetachLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See DetachLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachLoadBalancersWithContext(ctx aws.Context, input *DetachLoadBalancersInput, opts ...request.Option) (*DetachLoadBalancersOutput, error) { + req, out := c.DetachLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableMetricsCollection = "DisableMetricsCollection" @@ -2858,8 +3584,23 @@ func (c *AutoScaling) DisableMetricsCollectionRequest(input *DisableMetricsColle // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DisableMetricsCollection func (c *AutoScaling) DisableMetricsCollection(input *DisableMetricsCollectionInput) (*DisableMetricsCollectionOutput, error) { req, out := c.DisableMetricsCollectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableMetricsCollectionWithContext is the same as DisableMetricsCollection with the addition of +// the ability to pass a context and additional request options. +// +// See DisableMetricsCollection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableMetricsCollectionWithContext(ctx aws.Context, input *DisableMetricsCollectionInput, opts ...request.Option) (*DisableMetricsCollectionOutput, error) { + req, out := c.DisableMetricsCollectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableMetricsCollection = "EnableMetricsCollection" @@ -2928,8 +3669,23 @@ func (c *AutoScaling) EnableMetricsCollectionRequest(input *EnableMetricsCollect // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnableMetricsCollection func (c *AutoScaling) EnableMetricsCollection(input *EnableMetricsCollectionInput) (*EnableMetricsCollectionOutput, error) { req, out := c.EnableMetricsCollectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableMetricsCollectionWithContext is the same as EnableMetricsCollection with the addition of +// the ability to pass a context and additional request options. +// +// See EnableMetricsCollection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableMetricsCollectionWithContext(ctx aws.Context, input *EnableMetricsCollectionInput, opts ...request.Option) (*EnableMetricsCollectionOutput, error) { + req, out := c.EnableMetricsCollectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnterStandby = "EnterStandby" @@ -2997,8 +3753,23 @@ func (c *AutoScaling) EnterStandbyRequest(input *EnterStandbyInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnterStandby func (c *AutoScaling) EnterStandby(input *EnterStandbyInput) (*EnterStandbyOutput, error) { req, out := c.EnterStandbyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnterStandbyWithContext is the same as EnterStandby with the addition of +// the ability to pass a context and additional request options. +// +// See EnterStandby for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnterStandbyWithContext(ctx aws.Context, input *EnterStandbyInput, opts ...request.Option) (*EnterStandbyOutput, error) { + req, out := c.EnterStandbyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opExecutePolicy = "ExecutePolicy" @@ -3069,8 +3840,23 @@ func (c *AutoScaling) ExecutePolicyRequest(input *ExecutePolicyInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExecutePolicy func (c *AutoScaling) ExecutePolicy(input *ExecutePolicyInput) (*ExecutePolicyOutput, error) { req, out := c.ExecutePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ExecutePolicyWithContext is the same as ExecutePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See ExecutePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ExecutePolicyWithContext(ctx aws.Context, input *ExecutePolicyInput, opts ...request.Option) (*ExecutePolicyOutput, error) { + req, out := c.ExecutePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opExitStandby = "ExitStandby" @@ -3138,8 +3924,23 @@ func (c *AutoScaling) ExitStandbyRequest(input *ExitStandbyInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExitStandby func (c *AutoScaling) ExitStandby(input *ExitStandbyInput) (*ExitStandbyOutput, error) { req, out := c.ExitStandbyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ExitStandbyWithContext is the same as ExitStandby with the addition of +// the ability to pass a context and additional request options. +// +// See ExitStandby for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ExitStandbyWithContext(ctx aws.Context, input *ExitStandbyInput, opts ...request.Option) (*ExitStandbyOutput, error) { + req, out := c.ExitStandbyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutLifecycleHook = "PutLifecycleHook" @@ -3239,8 +4040,23 @@ func (c *AutoScaling) PutLifecycleHookRequest(input *PutLifecycleHookInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutLifecycleHook func (c *AutoScaling) PutLifecycleHook(input *PutLifecycleHookInput) (*PutLifecycleHookOutput, error) { req, out := c.PutLifecycleHookRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutLifecycleHookWithContext is the same as PutLifecycleHook with the addition of +// the ability to pass a context and additional request options. +// +// See PutLifecycleHook for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutLifecycleHookWithContext(ctx aws.Context, input *PutLifecycleHookInput, opts ...request.Option) (*PutLifecycleHookOutput, error) { + req, out := c.PutLifecycleHookRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutNotificationConfiguration = "PutNotificationConfiguration" @@ -3320,8 +4136,23 @@ func (c *AutoScaling) PutNotificationConfigurationRequest(input *PutNotification // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutNotificationConfiguration func (c *AutoScaling) PutNotificationConfiguration(input *PutNotificationConfigurationInput) (*PutNotificationConfigurationOutput, error) { req, out := c.PutNotificationConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutNotificationConfigurationWithContext is the same as PutNotificationConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutNotificationConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutNotificationConfigurationWithContext(ctx aws.Context, input *PutNotificationConfigurationInput, opts ...request.Option) (*PutNotificationConfigurationOutput, error) { + req, out := c.PutNotificationConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutScalingPolicy = "PutScalingPolicy" @@ -3399,8 +4230,23 @@ func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScalingPolicy func (c *AutoScaling) PutScalingPolicy(input *PutScalingPolicyInput) (*PutScalingPolicyOutput, error) { req, out := c.PutScalingPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutScalingPolicyWithContext is the same as PutScalingPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutScalingPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutScalingPolicyWithContext(ctx aws.Context, input *PutScalingPolicyInput, opts ...request.Option) (*PutScalingPolicyOutput, error) { + req, out := c.PutScalingPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutScheduledUpdateGroupAction = "PutScheduledUpdateGroupAction" @@ -3481,8 +4327,23 @@ func (c *AutoScaling) PutScheduledUpdateGroupActionRequest(input *PutScheduledUp // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScheduledUpdateGroupAction func (c *AutoScaling) PutScheduledUpdateGroupAction(input *PutScheduledUpdateGroupActionInput) (*PutScheduledUpdateGroupActionOutput, error) { req, out := c.PutScheduledUpdateGroupActionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutScheduledUpdateGroupActionWithContext is the same as PutScheduledUpdateGroupAction with the addition of +// the ability to pass a context and additional request options. +// +// See PutScheduledUpdateGroupAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutScheduledUpdateGroupActionWithContext(ctx aws.Context, input *PutScheduledUpdateGroupActionInput, opts ...request.Option) (*PutScheduledUpdateGroupActionOutput, error) { + req, out := c.PutScheduledUpdateGroupActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRecordLifecycleActionHeartbeat = "RecordLifecycleActionHeartbeat" @@ -3570,8 +4431,23 @@ func (c *AutoScaling) RecordLifecycleActionHeartbeatRequest(input *RecordLifecyc // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/RecordLifecycleActionHeartbeat func (c *AutoScaling) RecordLifecycleActionHeartbeat(input *RecordLifecycleActionHeartbeatInput) (*RecordLifecycleActionHeartbeatOutput, error) { req, out := c.RecordLifecycleActionHeartbeatRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RecordLifecycleActionHeartbeatWithContext is the same as RecordLifecycleActionHeartbeat with the addition of +// the ability to pass a context and additional request options. +// +// See RecordLifecycleActionHeartbeat for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RecordLifecycleActionHeartbeatWithContext(ctx aws.Context, input *RecordLifecycleActionHeartbeatInput, opts ...request.Option) (*RecordLifecycleActionHeartbeatOutput, error) { + req, out := c.RecordLifecycleActionHeartbeatRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResumeProcesses = "ResumeProcesses" @@ -3646,8 +4522,23 @@ func (c *AutoScaling) ResumeProcessesRequest(input *ScalingProcessQuery) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ResumeProcesses func (c *AutoScaling) ResumeProcesses(input *ScalingProcessQuery) (*ResumeProcessesOutput, error) { req, out := c.ResumeProcessesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResumeProcessesWithContext is the same as ResumeProcesses with the addition of +// the ability to pass a context and additional request options. +// +// See ResumeProcesses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResumeProcessesWithContext(ctx aws.Context, input *ScalingProcessQuery, opts ...request.Option) (*ResumeProcessesOutput, error) { + req, out := c.ResumeProcessesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetDesiredCapacity = "SetDesiredCapacity" @@ -3721,8 +4612,23 @@ func (c *AutoScaling) SetDesiredCapacityRequest(input *SetDesiredCapacityInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetDesiredCapacity func (c *AutoScaling) SetDesiredCapacity(input *SetDesiredCapacityInput) (*SetDesiredCapacityOutput, error) { req, out := c.SetDesiredCapacityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetDesiredCapacityWithContext is the same as SetDesiredCapacity with the addition of +// the ability to pass a context and additional request options. +// +// See SetDesiredCapacity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetDesiredCapacityWithContext(ctx aws.Context, input *SetDesiredCapacityInput, opts ...request.Option) (*SetDesiredCapacityOutput, error) { + req, out := c.SetDesiredCapacityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetInstanceHealth = "SetInstanceHealth" @@ -3792,8 +4698,23 @@ func (c *AutoScaling) SetInstanceHealthRequest(input *SetInstanceHealthInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceHealth func (c *AutoScaling) SetInstanceHealth(input *SetInstanceHealthInput) (*SetInstanceHealthOutput, error) { req, out := c.SetInstanceHealthRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetInstanceHealthWithContext is the same as SetInstanceHealth with the addition of +// the ability to pass a context and additional request options. +// +// See SetInstanceHealth for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetInstanceHealthWithContext(ctx aws.Context, input *SetInstanceHealthInput, opts ...request.Option) (*SetInstanceHealthOutput, error) { + req, out := c.SetInstanceHealthRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetInstanceProtection = "SetInstanceProtection" @@ -3866,8 +4787,23 @@ func (c *AutoScaling) SetInstanceProtectionRequest(input *SetInstanceProtectionI // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceProtection func (c *AutoScaling) SetInstanceProtection(input *SetInstanceProtectionInput) (*SetInstanceProtectionOutput, error) { req, out := c.SetInstanceProtectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetInstanceProtectionWithContext is the same as SetInstanceProtection with the addition of +// the ability to pass a context and additional request options. +// +// See SetInstanceProtection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetInstanceProtectionWithContext(ctx aws.Context, input *SetInstanceProtectionInput, opts ...request.Option) (*SetInstanceProtectionOutput, error) { + req, out := c.SetInstanceProtectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSuspendProcesses = "SuspendProcesses" @@ -3947,8 +4883,23 @@ func (c *AutoScaling) SuspendProcessesRequest(input *ScalingProcessQuery) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SuspendProcesses func (c *AutoScaling) SuspendProcesses(input *ScalingProcessQuery) (*SuspendProcessesOutput, error) { req, out := c.SuspendProcessesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SuspendProcessesWithContext is the same as SuspendProcesses with the addition of +// the ability to pass a context and additional request options. +// +// See SuspendProcesses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SuspendProcessesWithContext(ctx aws.Context, input *ScalingProcessQuery, opts ...request.Option) (*SuspendProcessesOutput, error) { + req, out := c.SuspendProcessesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTerminateInstanceInAutoScalingGroup = "TerminateInstanceInAutoScalingGroup" @@ -4021,8 +4972,23 @@ func (c *AutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *Terminat // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/TerminateInstanceInAutoScalingGroup func (c *AutoScaling) TerminateInstanceInAutoScalingGroup(input *TerminateInstanceInAutoScalingGroupInput) (*TerminateInstanceInAutoScalingGroupOutput, error) { req, out := c.TerminateInstanceInAutoScalingGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TerminateInstanceInAutoScalingGroupWithContext is the same as TerminateInstanceInAutoScalingGroup with the addition of +// the ability to pass a context and additional request options. +// +// See TerminateInstanceInAutoScalingGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TerminateInstanceInAutoScalingGroupWithContext(ctx aws.Context, input *TerminateInstanceInAutoScalingGroupInput, opts ...request.Option) (*TerminateInstanceInAutoScalingGroupOutput, error) { + req, out := c.TerminateInstanceInAutoScalingGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAutoScalingGroup = "UpdateAutoScalingGroup" @@ -4116,8 +5082,23 @@ func (c *AutoScaling) UpdateAutoScalingGroupRequest(input *UpdateAutoScalingGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/UpdateAutoScalingGroup func (c *AutoScaling) UpdateAutoScalingGroup(input *UpdateAutoScalingGroupInput) (*UpdateAutoScalingGroupOutput, error) { req, out := c.UpdateAutoScalingGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAutoScalingGroupWithContext is the same as UpdateAutoScalingGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAutoScalingGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAutoScalingGroupWithContext(ctx aws.Context, input *UpdateAutoScalingGroupInput, opts ...request.Option) (*UpdateAutoScalingGroupOutput, error) { + req, out := c.UpdateAutoScalingGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Describes scaling activity, which is a long-running process that represents diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go index 227e6b3b3..68ab1e3c1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package autoscaling diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go index 98e1bb4ad..752375f1f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package autoscaling diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go index 15a9fd86e..1b1c5a3a1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package autoscaling import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilGroupExists uses the Auto Scaling API operation @@ -11,32 +14,50 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *AutoScaling) WaitUntilGroupExists(input *DescribeAutoScalingGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeAutoScalingGroups", - Delay: 5, + return c.WaitUntilGroupExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilGroupExistsWithContext is an extended version of WaitUntilGroupExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilGroupExistsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilGroupExists", MaxAttempts: 10, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "length(AutoScalingGroups) > `0`", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`", Expected: true, }, { - State: "retry", - Matcher: "path", - Argument: "length(AutoScalingGroups) > `0`", + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`", Expected: false, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeAutoScalingGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilGroupInService uses the Auto Scaling API operation @@ -44,32 +65,50 @@ func (c *AutoScaling) WaitUntilGroupExists(input *DescribeAutoScalingGroupsInput // If the condition is not meet within the max attempt window an error will // be returned. func (c *AutoScaling) WaitUntilGroupInService(input *DescribeAutoScalingGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeAutoScalingGroups", - Delay: 15, + return c.WaitUntilGroupInServiceWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilGroupInServiceWithContext is an extended version of WaitUntilGroupInService. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilGroupInServiceWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilGroupInService", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)", Expected: false, }, { - State: "retry", - Matcher: "path", - Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)", + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)", Expected: true, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeAutoScalingGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilGroupNotExists uses the Auto Scaling API operation @@ -77,30 +116,48 @@ func (c *AutoScaling) WaitUntilGroupInService(input *DescribeAutoScalingGroupsIn // If the condition is not meet within the max attempt window an error will // be returned. func (c *AutoScaling) WaitUntilGroupNotExists(input *DescribeAutoScalingGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeAutoScalingGroups", - Delay: 15, + return c.WaitUntilGroupNotExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilGroupNotExistsWithContext is an extended version of WaitUntilGroupNotExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilGroupNotExistsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilGroupNotExists", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "length(AutoScalingGroups) > `0`", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`", Expected: false, }, { - State: "retry", - Matcher: "path", - Argument: "length(AutoScalingGroups) > `0`", + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`", Expected: true, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeAutoScalingGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go index be60e851f..37b1eabbe 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package cloudformation provides a client for AWS CloudFormation. package cloudformation @@ -6,6 +6,7 @@ package cloudformation import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -73,8 +74,23 @@ func (c *CloudFormation) CancelUpdateStackRequest(input *CancelUpdateStackInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CancelUpdateStack func (c *CloudFormation) CancelUpdateStack(input *CancelUpdateStackInput) (*CancelUpdateStackOutput, error) { req, out := c.CancelUpdateStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelUpdateStackWithContext is the same as CancelUpdateStack with the addition of +// the ability to pass a context and additional request options. +// +// See CancelUpdateStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelUpdateStackWithContext(ctx aws.Context, input *CancelUpdateStackInput, opts ...request.Option) (*CancelUpdateStackOutput, error) { + req, out := c.CancelUpdateStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opContinueUpdateRollback = "ContinueUpdateRollback" @@ -145,8 +161,23 @@ func (c *CloudFormation) ContinueUpdateRollbackRequest(input *ContinueUpdateRoll // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ContinueUpdateRollback func (c *CloudFormation) ContinueUpdateRollback(input *ContinueUpdateRollbackInput) (*ContinueUpdateRollbackOutput, error) { req, out := c.ContinueUpdateRollbackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ContinueUpdateRollbackWithContext is the same as ContinueUpdateRollback with the addition of +// the ability to pass a context and additional request options. +// +// See ContinueUpdateRollback for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ContinueUpdateRollbackWithContext(ctx aws.Context, input *ContinueUpdateRollbackInput, opts ...request.Option) (*ContinueUpdateRollbackOutput, error) { + req, out := c.ContinueUpdateRollbackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateChangeSet = "CreateChangeSet" @@ -230,8 +261,23 @@ func (c *CloudFormation) CreateChangeSetRequest(input *CreateChangeSetInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet func (c *CloudFormation) CreateChangeSet(input *CreateChangeSetInput) (*CreateChangeSetOutput, error) { req, out := c.CreateChangeSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateChangeSetWithContext is the same as CreateChangeSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateChangeSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateChangeSetWithContext(ctx aws.Context, input *CreateChangeSetInput, opts ...request.Option) (*CreateChangeSetOutput, error) { + req, out := c.CreateChangeSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateStack = "CreateStack" @@ -304,8 +350,23 @@ func (c *CloudFormation) CreateStackRequest(input *CreateStackInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStack func (c *CloudFormation) CreateStack(input *CreateStackInput) (*CreateStackOutput, error) { req, out := c.CreateStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateStackWithContext is the same as CreateStack with the addition of +// the ability to pass a context and additional request options. +// +// See CreateStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateStackWithContext(ctx aws.Context, input *CreateStackInput, opts ...request.Option) (*CreateStackOutput, error) { + req, out := c.CreateStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteChangeSet = "DeleteChangeSet" @@ -375,8 +436,23 @@ func (c *CloudFormation) DeleteChangeSetRequest(input *DeleteChangeSetInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteChangeSet func (c *CloudFormation) DeleteChangeSet(input *DeleteChangeSetInput) (*DeleteChangeSetOutput, error) { req, out := c.DeleteChangeSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteChangeSetWithContext is the same as DeleteChangeSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteChangeSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteChangeSetWithContext(ctx aws.Context, input *DeleteChangeSetInput, opts ...request.Option) (*DeleteChangeSetOutput, error) { + req, out := c.DeleteChangeSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteStack = "DeleteStack" @@ -439,8 +515,23 @@ func (c *CloudFormation) DeleteStackRequest(input *DeleteStackInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteStack func (c *CloudFormation) DeleteStack(input *DeleteStackInput) (*DeleteStackOutput, error) { req, out := c.DeleteStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteStackWithContext is the same as DeleteStack with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteStackWithContext(ctx aws.Context, input *DeleteStackInput, opts ...request.Option) (*DeleteStackOutput, error) { + req, out := c.DeleteStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAccountLimits = "DescribeAccountLimits" @@ -500,8 +591,23 @@ func (c *CloudFormation) DescribeAccountLimitsRequest(input *DescribeAccountLimi // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeAccountLimits func (c *CloudFormation) DescribeAccountLimits(input *DescribeAccountLimitsInput) (*DescribeAccountLimitsOutput, error) { req, out := c.DescribeAccountLimitsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAccountLimitsWithContext is the same as DescribeAccountLimits with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAccountLimits for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAccountLimitsWithContext(ctx aws.Context, input *DescribeAccountLimitsInput, opts ...request.Option) (*DescribeAccountLimitsOutput, error) { + req, out := c.DescribeAccountLimitsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeChangeSet = "DescribeChangeSet" @@ -569,8 +675,23 @@ func (c *CloudFormation) DescribeChangeSetRequest(input *DescribeChangeSetInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeChangeSet func (c *CloudFormation) DescribeChangeSet(input *DescribeChangeSetInput) (*DescribeChangeSetOutput, error) { req, out := c.DescribeChangeSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeChangeSetWithContext is the same as DescribeChangeSet with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeChangeSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeChangeSetWithContext(ctx aws.Context, input *DescribeChangeSetInput, opts ...request.Option) (*DescribeChangeSetOutput, error) { + req, out := c.DescribeChangeSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeStackEvents = "DescribeStackEvents" @@ -640,8 +761,23 @@ func (c *CloudFormation) DescribeStackEventsRequest(input *DescribeStackEventsIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackEvents func (c *CloudFormation) DescribeStackEvents(input *DescribeStackEventsInput) (*DescribeStackEventsOutput, error) { req, out := c.DescribeStackEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStackEventsWithContext is the same as DescribeStackEvents with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStackEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStackEventsWithContext(ctx aws.Context, input *DescribeStackEventsInput, opts ...request.Option) (*DescribeStackEventsOutput, error) { + req, out := c.DescribeStackEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeStackEventsPages iterates over the pages of a DescribeStackEvents operation, @@ -661,12 +797,37 @@ func (c *CloudFormation) DescribeStackEvents(input *DescribeStackEventsInput) (* // return pageNum <= 3 // }) // -func (c *CloudFormation) DescribeStackEventsPages(input *DescribeStackEventsInput, fn func(p *DescribeStackEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeStackEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeStackEventsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeStackEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStackEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeStackEventsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeStackResource = "DescribeStackResource" @@ -728,8 +889,23 @@ func (c *CloudFormation) DescribeStackResourceRequest(input *DescribeStackResour // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResource func (c *CloudFormation) DescribeStackResource(input *DescribeStackResourceInput) (*DescribeStackResourceOutput, error) { req, out := c.DescribeStackResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStackResourceWithContext is the same as DescribeStackResource with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStackResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStackResourceWithContext(ctx aws.Context, input *DescribeStackResourceInput, opts ...request.Option) (*DescribeStackResourceOutput, error) { + req, out := c.DescribeStackResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeStackResources = "DescribeStackResources" @@ -805,8 +981,23 @@ func (c *CloudFormation) DescribeStackResourcesRequest(input *DescribeStackResou // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResources func (c *CloudFormation) DescribeStackResources(input *DescribeStackResourcesInput) (*DescribeStackResourcesOutput, error) { req, out := c.DescribeStackResourcesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStackResourcesWithContext is the same as DescribeStackResources with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStackResources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStackResourcesWithContext(ctx aws.Context, input *DescribeStackResourcesInput, opts ...request.Option) (*DescribeStackResourcesOutput, error) { + req, out := c.DescribeStackResourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeStacks = "DescribeStacks" @@ -874,8 +1065,23 @@ func (c *CloudFormation) DescribeStacksRequest(input *DescribeStacksInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacks func (c *CloudFormation) DescribeStacks(input *DescribeStacksInput) (*DescribeStacksOutput, error) { req, out := c.DescribeStacksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStacksWithContext is the same as DescribeStacks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStacks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStacksWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.Option) (*DescribeStacksOutput, error) { + req, out := c.DescribeStacksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeStacksPages iterates over the pages of a DescribeStacks operation, @@ -895,12 +1101,37 @@ func (c *CloudFormation) DescribeStacks(input *DescribeStacksInput) (*DescribeSt // return pageNum <= 3 // }) // -func (c *CloudFormation) DescribeStacksPages(input *DescribeStacksInput, fn func(p *DescribeStacksOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeStacksRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeStacksOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeStacksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStacksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeStacksOutput), !p.HasNextPage()) + } + return p.Err() } const opEstimateTemplateCost = "EstimateTemplateCost" @@ -961,8 +1192,23 @@ func (c *CloudFormation) EstimateTemplateCostRequest(input *EstimateTemplateCost // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/EstimateTemplateCost func (c *CloudFormation) EstimateTemplateCost(input *EstimateTemplateCostInput) (*EstimateTemplateCostOutput, error) { req, out := c.EstimateTemplateCostRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EstimateTemplateCostWithContext is the same as EstimateTemplateCost with the addition of +// the ability to pass a context and additional request options. +// +// See EstimateTemplateCost for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EstimateTemplateCostWithContext(ctx aws.Context, input *EstimateTemplateCostInput, opts ...request.Option) (*EstimateTemplateCostOutput, error) { + req, out := c.EstimateTemplateCostRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opExecuteChangeSet = "ExecuteChangeSet" @@ -1047,8 +1293,23 @@ func (c *CloudFormation) ExecuteChangeSetRequest(input *ExecuteChangeSetInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ExecuteChangeSet func (c *CloudFormation) ExecuteChangeSet(input *ExecuteChangeSetInput) (*ExecuteChangeSetOutput, error) { req, out := c.ExecuteChangeSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ExecuteChangeSetWithContext is the same as ExecuteChangeSet with the addition of +// the ability to pass a context and additional request options. +// +// See ExecuteChangeSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ExecuteChangeSetWithContext(ctx aws.Context, input *ExecuteChangeSetInput, opts ...request.Option) (*ExecuteChangeSetOutput, error) { + req, out := c.ExecuteChangeSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetStackPolicy = "GetStackPolicy" @@ -1108,8 +1369,23 @@ func (c *CloudFormation) GetStackPolicyRequest(input *GetStackPolicyInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetStackPolicy func (c *CloudFormation) GetStackPolicy(input *GetStackPolicyInput) (*GetStackPolicyOutput, error) { req, out := c.GetStackPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetStackPolicyWithContext is the same as GetStackPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetStackPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetStackPolicyWithContext(ctx aws.Context, input *GetStackPolicyInput, opts ...request.Option) (*GetStackPolicyOutput, error) { + req, out := c.GetStackPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetTemplate = "GetTemplate" @@ -1180,8 +1456,23 @@ func (c *CloudFormation) GetTemplateRequest(input *GetTemplateInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplate func (c *CloudFormation) GetTemplate(input *GetTemplateInput) (*GetTemplateOutput, error) { req, out := c.GetTemplateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetTemplateWithContext is the same as GetTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See GetTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetTemplateWithContext(ctx aws.Context, input *GetTemplateInput, opts ...request.Option) (*GetTemplateOutput, error) { + req, out := c.GetTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetTemplateSummary = "GetTemplateSummary" @@ -1249,8 +1540,23 @@ func (c *CloudFormation) GetTemplateSummaryRequest(input *GetTemplateSummaryInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplateSummary func (c *CloudFormation) GetTemplateSummary(input *GetTemplateSummaryInput) (*GetTemplateSummaryOutput, error) { req, out := c.GetTemplateSummaryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetTemplateSummaryWithContext is the same as GetTemplateSummary with the addition of +// the ability to pass a context and additional request options. +// +// See GetTemplateSummary for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetTemplateSummaryWithContext(ctx aws.Context, input *GetTemplateSummaryInput, opts ...request.Option) (*GetTemplateSummaryOutput, error) { + req, out := c.GetTemplateSummaryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListChangeSets = "ListChangeSets" @@ -1311,8 +1617,23 @@ func (c *CloudFormation) ListChangeSetsRequest(input *ListChangeSetsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListChangeSets func (c *CloudFormation) ListChangeSets(input *ListChangeSetsInput) (*ListChangeSetsOutput, error) { req, out := c.ListChangeSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListChangeSetsWithContext is the same as ListChangeSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListChangeSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListChangeSetsWithContext(ctx aws.Context, input *ListChangeSetsInput, opts ...request.Option) (*ListChangeSetsOutput, error) { + req, out := c.ListChangeSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListExports = "ListExports" @@ -1347,6 +1668,12 @@ func (c *CloudFormation) ListExportsRequest(input *ListExportsInput) (req *reque Name: opListExports, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { @@ -1377,8 +1704,73 @@ func (c *CloudFormation) ListExportsRequest(input *ListExportsInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListExports func (c *CloudFormation) ListExports(input *ListExportsInput) (*ListExportsOutput, error) { req, out := c.ListExportsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListExportsWithContext is the same as ListExports with the addition of +// the ability to pass a context and additional request options. +// +// See ListExports for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListExportsWithContext(ctx aws.Context, input *ListExportsInput, opts ...request.Option) (*ListExportsOutput, error) { + req, out := c.ListExportsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// 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. +// +// 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListExportsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListExportsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListExportsOutput), !p.HasNextPage()) + } + return p.Err() } const opListImports = "ListImports" @@ -1413,6 +1805,12 @@ func (c *CloudFormation) ListImportsRequest(input *ListImportsInput) (req *reque Name: opListImports, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { @@ -1443,8 +1841,73 @@ func (c *CloudFormation) ListImportsRequest(input *ListImportsInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListImports func (c *CloudFormation) ListImports(input *ListImportsInput) (*ListImportsOutput, error) { req, out := c.ListImportsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListImportsWithContext is the same as ListImports with the addition of +// the ability to pass a context and additional request options. +// +// See ListImports for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListImportsWithContext(ctx aws.Context, input *ListImportsInput, opts ...request.Option) (*ListImportsOutput, error) { + req, out := c.ListImportsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// 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. +// +// 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListImportsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListImportsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListImportsOutput), !p.HasNextPage()) + } + return p.Err() } const opListStackResources = "ListStackResources" @@ -1512,8 +1975,23 @@ func (c *CloudFormation) ListStackResourcesRequest(input *ListStackResourcesInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackResources func (c *CloudFormation) ListStackResources(input *ListStackResourcesInput) (*ListStackResourcesOutput, error) { req, out := c.ListStackResourcesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListStackResourcesWithContext is the same as ListStackResources with the addition of +// the ability to pass a context and additional request options. +// +// See ListStackResources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListStackResourcesWithContext(ctx aws.Context, input *ListStackResourcesInput, opts ...request.Option) (*ListStackResourcesOutput, error) { + req, out := c.ListStackResourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListStackResourcesPages iterates over the pages of a ListStackResources operation, @@ -1533,12 +2011,37 @@ func (c *CloudFormation) ListStackResources(input *ListStackResourcesInput) (*Li // return pageNum <= 3 // }) // -func (c *CloudFormation) ListStackResourcesPages(input *ListStackResourcesInput, fn func(p *ListStackResourcesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStackResourcesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStackResourcesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListStackResourcesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListStackResourcesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListStackResourcesOutput), !p.HasNextPage()) + } + return p.Err() } const opListStacks = "ListStacks" @@ -1607,8 +2110,23 @@ func (c *CloudFormation) ListStacksRequest(input *ListStacksInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStacks func (c *CloudFormation) ListStacks(input *ListStacksInput) (*ListStacksOutput, error) { req, out := c.ListStacksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListStacksWithContext is the same as ListStacks with the addition of +// the ability to pass a context and additional request options. +// +// See ListStacks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListStacksWithContext(ctx aws.Context, input *ListStacksInput, opts ...request.Option) (*ListStacksOutput, error) { + req, out := c.ListStacksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListStacksPages iterates over the pages of a ListStacks operation, @@ -1628,12 +2146,37 @@ func (c *CloudFormation) ListStacks(input *ListStacksInput) (*ListStacksOutput, // return pageNum <= 3 // }) // -func (c *CloudFormation) ListStacksPages(input *ListStacksInput, fn func(p *ListStacksOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStacksRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStacksOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListStacksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListStacksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListStacksOutput), !p.HasNextPage()) + } + return p.Err() } const opSetStackPolicy = "SetStackPolicy" @@ -1694,8 +2237,23 @@ func (c *CloudFormation) SetStackPolicyRequest(input *SetStackPolicyInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy func (c *CloudFormation) SetStackPolicy(input *SetStackPolicyInput) (*SetStackPolicyOutput, error) { req, out := c.SetStackPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetStackPolicyWithContext is the same as SetStackPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See SetStackPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetStackPolicyWithContext(ctx aws.Context, input *SetStackPolicyInput, opts ...request.Option) (*SetStackPolicyOutput, error) { + req, out := c.SetStackPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSignalResource = "SignalResource" @@ -1761,8 +2319,23 @@ func (c *CloudFormation) SignalResourceRequest(input *SignalResourceInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResource func (c *CloudFormation) SignalResource(input *SignalResourceInput) (*SignalResourceOutput, error) { req, out := c.SignalResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SignalResourceWithContext is the same as SignalResource with the addition of +// the ability to pass a context and additional request options. +// +// See SignalResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SignalResourceWithContext(ctx aws.Context, input *SignalResourceInput, opts ...request.Option) (*SignalResourceOutput, error) { + req, out := c.SignalResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateStack = "UpdateStack" @@ -1835,8 +2408,23 @@ func (c *CloudFormation) UpdateStackRequest(input *UpdateStackInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStack func (c *CloudFormation) UpdateStack(input *UpdateStackInput) (*UpdateStackOutput, error) { req, out := c.UpdateStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateStackWithContext is the same as UpdateStack with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateStackWithContext(ctx aws.Context, input *UpdateStackInput, opts ...request.Option) (*UpdateStackOutput, error) { + req, out := c.UpdateStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opValidateTemplate = "ValidateTemplate" @@ -1898,8 +2486,23 @@ func (c *CloudFormation) ValidateTemplateRequest(input *ValidateTemplateInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate func (c *CloudFormation) ValidateTemplate(input *ValidateTemplateInput) (*ValidateTemplateOutput, error) { req, out := c.ValidateTemplateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ValidateTemplateWithContext is the same as ValidateTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See ValidateTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ValidateTemplateWithContext(ctx aws.Context, input *ValidateTemplateInput, opts ...request.Option) (*ValidateTemplateOutput, error) { + req, out := c.ValidateTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // The AccountLimit data type. diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go index 29fae9221..b49437e31 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudformation diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go index 0591a3204..12883f60a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudformation diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go index 5960e9443..e4454d381 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go @@ -1,72 +1,144 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudformation import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) +// WaitUntilChangeSetCreateComplete uses the AWS CloudFormation API operation +// DescribeChangeSet to wait for a condition to be met before returning. +// If the condition is not meet within the max attempt window an error will +// be returned. +func (c *CloudFormation) WaitUntilChangeSetCreateComplete(input *DescribeChangeSetInput) error { + return c.WaitUntilChangeSetCreateCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilChangeSetCreateCompleteWithContext is an extended version of WaitUntilChangeSetCreateComplete. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilChangeSetCreateCompleteWithContext(ctx aws.Context, input *DescribeChangeSetInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilChangeSetCreateComplete", + MaxAttempts: 120, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Status", + Expected: "CREATE_COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Status", + Expected: "FAILED", + }, + { + State: request.FailureWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "ValidationError", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeChangeSetInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeChangeSetRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + // WaitUntilStackCreateComplete uses the AWS CloudFormation API operation // DescribeStacks to wait for a condition to be met before returning. // If the condition is not meet within the max attempt window an error will // be returned. func (c *CloudFormation) WaitUntilStackCreateComplete(input *DescribeStacksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStacks", - Delay: 30, + return c.WaitUntilStackCreateCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilStackCreateCompleteWithContext is an extended version of WaitUntilStackCreateComplete. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilStackCreateCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilStackCreateComplete", MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Stacks[].StackStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "CREATE_COMPLETE", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "CREATE_FAILED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "DELETE_COMPLETE", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "DELETE_FAILED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "ROLLBACK_FAILED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "ROLLBACK_COMPLETE", }, { - State: "failure", - Matcher: "error", - Argument: "", + State: request.FailureWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ValidationError", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeStacksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStacksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilStackDeleteComplete uses the AWS CloudFormation API operation @@ -74,62 +146,75 @@ func (c *CloudFormation) WaitUntilStackCreateComplete(input *DescribeStacksInput // If the condition is not meet within the max attempt window an error will // be returned. func (c *CloudFormation) WaitUntilStackDeleteComplete(input *DescribeStacksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStacks", - Delay: 30, + return c.WaitUntilStackDeleteCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilStackDeleteCompleteWithContext is an extended version of WaitUntilStackDeleteComplete. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilStackDeleteCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilStackDeleteComplete", MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Stacks[].StackStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "DELETE_COMPLETE", }, { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ValidationError", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "DELETE_FAILED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "CREATE_FAILED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "ROLLBACK_FAILED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "UPDATE_ROLLBACK_FAILED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "UPDATE_ROLLBACK_IN_PROGRESS", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeStacksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStacksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilStackExists uses the AWS CloudFormation API operation @@ -137,32 +222,50 @@ func (c *CloudFormation) WaitUntilStackDeleteComplete(input *DescribeStacksInput // If the condition is not meet within the max attempt window an error will // be returned. func (c *CloudFormation) WaitUntilStackExists(input *DescribeStacksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStacks", - Delay: 5, + return c.WaitUntilStackExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilStackExistsWithContext is an extended version of WaitUntilStackExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilStackExistsWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilStackExists", MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ValidationError", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeStacksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStacksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilStackUpdateComplete uses the AWS CloudFormation API operation @@ -170,48 +273,63 @@ func (c *CloudFormation) WaitUntilStackExists(input *DescribeStacksInput) error // If the condition is not meet within the max attempt window an error will // be returned. func (c *CloudFormation) WaitUntilStackUpdateComplete(input *DescribeStacksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStacks", - Delay: 30, + return c.WaitUntilStackUpdateCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilStackUpdateCompleteWithContext is an extended version of WaitUntilStackUpdateComplete. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilStackUpdateCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilStackUpdateComplete", MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Stacks[].StackStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "UPDATE_COMPLETE", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "UPDATE_FAILED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "UPDATE_ROLLBACK_FAILED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "UPDATE_ROLLBACK_COMPLETE", }, { - State: "failure", - Matcher: "error", - Argument: "", + State: request.FailureWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ValidationError", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeStacksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStacksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go index 17a7eb51a..f0168c0cf 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package cloudfront provides a client for Amazon CloudFront. package cloudfront @@ -7,13 +7,14 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/restxml" ) -const opCreateCloudFrontOriginAccessIdentity = "CreateCloudFrontOriginAccessIdentity2016_11_25" +const opCreateCloudFrontOriginAccessIdentity = "CreateCloudFrontOriginAccessIdentity2017_03_25" // CreateCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the // client's request for the CreateCloudFrontOriginAccessIdentity operation. The "output" return @@ -39,12 +40,12 @@ const opCreateCloudFrontOriginAccessIdentity = "CreateCloudFrontOriginAccessIden // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateCloudFrontOriginAccessIdentity +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentity func (c *CloudFront) CreateCloudFrontOriginAccessIdentityRequest(input *CreateCloudFrontOriginAccessIdentityInput) (req *request.Request, output *CreateCloudFrontOriginAccessIdentityOutput) { op := &request.Operation{ Name: opCreateCloudFrontOriginAccessIdentity, HTTPMethod: "POST", - HTTPPath: "/2016-11-25/origin-access-identity/cloudfront", + HTTPPath: "/2017-03-25/origin-access-identity/cloudfront", } if input == nil { @@ -93,14 +94,29 @@ func (c *CloudFront) CreateCloudFrontOriginAccessIdentityRequest(input *CreateCl // * ErrCodeInconsistentQuantities "InconsistentQuantities" // The value of Quantity and the size of Items do not match. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateCloudFrontOriginAccessIdentity +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentity func (c *CloudFront) CreateCloudFrontOriginAccessIdentity(input *CreateCloudFrontOriginAccessIdentityInput) (*CreateCloudFrontOriginAccessIdentityOutput, error) { req, out := c.CreateCloudFrontOriginAccessIdentityRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opCreateDistribution = "CreateDistribution2016_11_25" +// CreateCloudFrontOriginAccessIdentityWithContext is the same as CreateCloudFrontOriginAccessIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCloudFrontOriginAccessIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *CreateCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*CreateCloudFrontOriginAccessIdentityOutput, error) { + req, out := c.CreateCloudFrontOriginAccessIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateDistribution = "CreateDistribution2017_03_25" // CreateDistributionRequest generates a "aws/request.Request" representing the // client's request for the CreateDistribution operation. The "output" return @@ -126,12 +142,12 @@ const opCreateDistribution = "CreateDistribution2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistribution func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) (req *request.Request, output *CreateDistributionOutput) { op := &request.Operation{ Name: opCreateDistribution, HTTPMethod: "POST", - HTTPPath: "/2016-11-25/distribution", + HTTPPath: "/2017-03-25/distribution", } if input == nil { @@ -145,7 +161,7 @@ func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) ( // CreateDistribution API operation for Amazon CloudFront. // -// Creates a new web distribution. Send a GET request to the /CloudFront API +// Creates a new web distribution. Send a POST request to the /CloudFront API // version/distribution/distribution ID resource. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -270,14 +286,33 @@ func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) ( // * ErrCodeInvalidLambdaFunctionAssociation "InvalidLambdaFunctionAssociation" // The specified Lambda function association is invalid. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistribution +// * ErrCodeInvalidOriginReadTimeout "InvalidOriginReadTimeout" +// +// * ErrCodeInvalidOriginKeepaliveTimeout "InvalidOriginKeepaliveTimeout" +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistribution func (c *CloudFront) CreateDistribution(input *CreateDistributionInput) (*CreateDistributionOutput, error) { req, out := c.CreateDistributionRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opCreateDistributionWithTags = "CreateDistributionWithTags2016_11_25" +// CreateDistributionWithContext is the same as CreateDistribution with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDistribution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDistributionWithContext(ctx aws.Context, input *CreateDistributionInput, opts ...request.Option) (*CreateDistributionOutput, error) { + req, out := c.CreateDistributionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateDistributionWithTags = "CreateDistributionWithTags2017_03_25" // CreateDistributionWithTagsRequest generates a "aws/request.Request" representing the // client's request for the CreateDistributionWithTags operation. The "output" return @@ -303,12 +338,12 @@ const opCreateDistributionWithTags = "CreateDistributionWithTags2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistributionWithTags +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTags func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistributionWithTagsInput) (req *request.Request, output *CreateDistributionWithTagsOutput) { op := &request.Operation{ Name: opCreateDistributionWithTags, HTTPMethod: "POST", - HTTPPath: "/2016-11-25/distribution?WithTags", + HTTPPath: "/2017-03-25/distribution?WithTags", } if input == nil { @@ -448,14 +483,33 @@ func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistribution // * ErrCodeInvalidLambdaFunctionAssociation "InvalidLambdaFunctionAssociation" // The specified Lambda function association is invalid. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistributionWithTags +// * ErrCodeInvalidOriginReadTimeout "InvalidOriginReadTimeout" +// +// * ErrCodeInvalidOriginKeepaliveTimeout "InvalidOriginKeepaliveTimeout" +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTags func (c *CloudFront) CreateDistributionWithTags(input *CreateDistributionWithTagsInput) (*CreateDistributionWithTagsOutput, error) { req, out := c.CreateDistributionWithTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opCreateInvalidation = "CreateInvalidation2016_11_25" +// CreateDistributionWithTagsWithContext is the same as CreateDistributionWithTags with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDistributionWithTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDistributionWithTagsWithContext(ctx aws.Context, input *CreateDistributionWithTagsInput, opts ...request.Option) (*CreateDistributionWithTagsOutput, error) { + req, out := c.CreateDistributionWithTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateInvalidation = "CreateInvalidation2017_03_25" // CreateInvalidationRequest generates a "aws/request.Request" representing the // client's request for the CreateInvalidation operation. The "output" return @@ -481,12 +535,12 @@ const opCreateInvalidation = "CreateInvalidation2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateInvalidation +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidation func (c *CloudFront) CreateInvalidationRequest(input *CreateInvalidationInput) (req *request.Request, output *CreateInvalidationOutput) { op := &request.Operation{ Name: opCreateInvalidation, HTTPMethod: "POST", - HTTPPath: "/2016-11-25/distribution/{DistributionId}/invalidation", + HTTPPath: "/2017-03-25/distribution/{DistributionId}/invalidation", } if input == nil { @@ -532,14 +586,29 @@ func (c *CloudFront) CreateInvalidationRequest(input *CreateInvalidationInput) ( // * ErrCodeInconsistentQuantities "InconsistentQuantities" // The value of Quantity and the size of Items do not match. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateInvalidation +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidation func (c *CloudFront) CreateInvalidation(input *CreateInvalidationInput) (*CreateInvalidationOutput, error) { req, out := c.CreateInvalidationRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opCreateStreamingDistribution = "CreateStreamingDistribution2016_11_25" +// CreateInvalidationWithContext is the same as CreateInvalidation with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInvalidation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateInvalidationWithContext(ctx aws.Context, input *CreateInvalidationInput, opts ...request.Option) (*CreateInvalidationOutput, error) { + req, out := c.CreateInvalidationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateStreamingDistribution = "CreateStreamingDistribution2017_03_25" // CreateStreamingDistributionRequest generates a "aws/request.Request" representing the // client's request for the CreateStreamingDistribution operation. The "output" return @@ -565,12 +634,12 @@ const opCreateStreamingDistribution = "CreateStreamingDistribution2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateStreamingDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistribution func (c *CloudFront) CreateStreamingDistributionRequest(input *CreateStreamingDistributionInput) (req *request.Request, output *CreateStreamingDistributionOutput) { op := &request.Operation{ Name: opCreateStreamingDistribution, HTTPMethod: "POST", - HTTPPath: "/2016-11-25/streaming-distribution", + HTTPPath: "/2017-03-25/streaming-distribution", } if input == nil { @@ -657,14 +726,29 @@ func (c *CloudFront) CreateStreamingDistributionRequest(input *CreateStreamingDi // * ErrCodeInconsistentQuantities "InconsistentQuantities" // The value of Quantity and the size of Items do not match. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateStreamingDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistribution func (c *CloudFront) CreateStreamingDistribution(input *CreateStreamingDistributionInput) (*CreateStreamingDistributionOutput, error) { req, out := c.CreateStreamingDistributionRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opCreateStreamingDistributionWithTags = "CreateStreamingDistributionWithTags2016_11_25" +// CreateStreamingDistributionWithContext is the same as CreateStreamingDistribution with the addition of +// the ability to pass a context and additional request options. +// +// See CreateStreamingDistribution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateStreamingDistributionWithContext(ctx aws.Context, input *CreateStreamingDistributionInput, opts ...request.Option) (*CreateStreamingDistributionOutput, error) { + req, out := c.CreateStreamingDistributionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateStreamingDistributionWithTags = "CreateStreamingDistributionWithTags2017_03_25" // CreateStreamingDistributionWithTagsRequest generates a "aws/request.Request" representing the // client's request for the CreateStreamingDistributionWithTags operation. The "output" return @@ -690,12 +774,12 @@ const opCreateStreamingDistributionWithTags = "CreateStreamingDistributionWithTa // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateStreamingDistributionWithTags +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTags func (c *CloudFront) CreateStreamingDistributionWithTagsRequest(input *CreateStreamingDistributionWithTagsInput) (req *request.Request, output *CreateStreamingDistributionWithTagsOutput) { op := &request.Operation{ Name: opCreateStreamingDistributionWithTags, HTTPMethod: "POST", - HTTPPath: "/2016-11-25/streaming-distribution?WithTags", + HTTPPath: "/2017-03-25/streaming-distribution?WithTags", } if input == nil { @@ -757,14 +841,29 @@ func (c *CloudFront) CreateStreamingDistributionWithTagsRequest(input *CreateStr // // * ErrCodeInvalidTagging "InvalidTagging" // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateStreamingDistributionWithTags +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTags func (c *CloudFront) CreateStreamingDistributionWithTags(input *CreateStreamingDistributionWithTagsInput) (*CreateStreamingDistributionWithTagsOutput, error) { req, out := c.CreateStreamingDistributionWithTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIdentity2016_11_25" +// CreateStreamingDistributionWithTagsWithContext is the same as CreateStreamingDistributionWithTags with the addition of +// the ability to pass a context and additional request options. +// +// See CreateStreamingDistributionWithTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateStreamingDistributionWithTagsWithContext(ctx aws.Context, input *CreateStreamingDistributionWithTagsInput, opts ...request.Option) (*CreateStreamingDistributionWithTagsOutput, error) { + req, out := c.CreateStreamingDistributionWithTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIdentity2017_03_25" // DeleteCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the // client's request for the DeleteCloudFrontOriginAccessIdentity operation. The "output" return @@ -790,12 +889,12 @@ const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIden // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteCloudFrontOriginAccessIdentity +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentity func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityRequest(input *DeleteCloudFrontOriginAccessIdentityInput) (req *request.Request, output *DeleteCloudFrontOriginAccessIdentityOutput) { op := &request.Operation{ Name: opDeleteCloudFrontOriginAccessIdentity, HTTPMethod: "DELETE", - HTTPPath: "/2016-11-25/origin-access-identity/cloudfront/{Id}", + HTTPPath: "/2017-03-25/origin-access-identity/cloudfront/{Id}", } if input == nil { @@ -836,14 +935,29 @@ func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityRequest(input *DeleteCl // // * ErrCodeOriginAccessIdentityInUse "OriginAccessIdentityInUse" // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteCloudFrontOriginAccessIdentity +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentity func (c *CloudFront) DeleteCloudFrontOriginAccessIdentity(input *DeleteCloudFrontOriginAccessIdentityInput) (*DeleteCloudFrontOriginAccessIdentityOutput, error) { req, out := c.DeleteCloudFrontOriginAccessIdentityRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opDeleteDistribution = "DeleteDistribution2016_11_25" +// DeleteCloudFrontOriginAccessIdentityWithContext is the same as DeleteCloudFrontOriginAccessIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCloudFrontOriginAccessIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *DeleteCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*DeleteCloudFrontOriginAccessIdentityOutput, error) { + req, out := c.DeleteCloudFrontOriginAccessIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteDistribution = "DeleteDistribution2017_03_25" // DeleteDistributionRequest generates a "aws/request.Request" representing the // client's request for the DeleteDistribution operation. The "output" return @@ -869,12 +983,12 @@ const opDeleteDistribution = "DeleteDistribution2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteDistribution func (c *CloudFront) DeleteDistributionRequest(input *DeleteDistributionInput) (req *request.Request, output *DeleteDistributionOutput) { op := &request.Operation{ Name: opDeleteDistribution, HTTPMethod: "DELETE", - HTTPPath: "/2016-11-25/distribution/{Id}", + HTTPPath: "/2017-03-25/distribution/{Id}", } if input == nil { @@ -915,14 +1029,29 @@ func (c *CloudFront) DeleteDistributionRequest(input *DeleteDistributionInput) ( // The precondition given in one or more of the request-header fields evaluated // to false. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteDistribution func (c *CloudFront) DeleteDistribution(input *DeleteDistributionInput) (*DeleteDistributionOutput, error) { req, out := c.DeleteDistributionRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opDeleteStreamingDistribution = "DeleteStreamingDistribution2016_11_25" +// DeleteDistributionWithContext is the same as DeleteDistribution with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDistribution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDistributionWithContext(ctx aws.Context, input *DeleteDistributionInput, opts ...request.Option) (*DeleteDistributionOutput, error) { + req, out := c.DeleteDistributionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteStreamingDistribution = "DeleteStreamingDistribution2017_03_25" // DeleteStreamingDistributionRequest generates a "aws/request.Request" representing the // client's request for the DeleteStreamingDistribution operation. The "output" return @@ -948,12 +1077,12 @@ const opDeleteStreamingDistribution = "DeleteStreamingDistribution2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteStreamingDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteStreamingDistribution func (c *CloudFront) DeleteStreamingDistributionRequest(input *DeleteStreamingDistributionInput) (req *request.Request, output *DeleteStreamingDistributionOutput) { op := &request.Operation{ Name: opDeleteStreamingDistribution, HTTPMethod: "DELETE", - HTTPPath: "/2016-11-25/streaming-distribution/{Id}", + HTTPPath: "/2017-03-25/streaming-distribution/{Id}", } if input == nil { @@ -1029,14 +1158,29 @@ func (c *CloudFront) DeleteStreamingDistributionRequest(input *DeleteStreamingDi // The precondition given in one or more of the request-header fields evaluated // to false. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteStreamingDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteStreamingDistribution func (c *CloudFront) DeleteStreamingDistribution(input *DeleteStreamingDistributionInput) (*DeleteStreamingDistributionOutput, error) { req, out := c.DeleteStreamingDistributionRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity2016_11_25" +// DeleteStreamingDistributionWithContext is the same as DeleteStreamingDistribution with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteStreamingDistribution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteStreamingDistributionWithContext(ctx aws.Context, input *DeleteStreamingDistributionInput, opts ...request.Option) (*DeleteStreamingDistributionOutput, error) { + req, out := c.DeleteStreamingDistributionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity2017_03_25" // GetCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the // client's request for the GetCloudFrontOriginAccessIdentity operation. The "output" return @@ -1062,12 +1206,12 @@ const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity20 // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetCloudFrontOriginAccessIdentity +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentity func (c *CloudFront) GetCloudFrontOriginAccessIdentityRequest(input *GetCloudFrontOriginAccessIdentityInput) (req *request.Request, output *GetCloudFrontOriginAccessIdentityOutput) { op := &request.Operation{ Name: opGetCloudFrontOriginAccessIdentity, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/origin-access-identity/cloudfront/{Id}", + HTTPPath: "/2017-03-25/origin-access-identity/cloudfront/{Id}", } if input == nil { @@ -1097,14 +1241,29 @@ func (c *CloudFront) GetCloudFrontOriginAccessIdentityRequest(input *GetCloudFro // * ErrCodeAccessDenied "AccessDenied" // Access denied. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetCloudFrontOriginAccessIdentity +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentity func (c *CloudFront) GetCloudFrontOriginAccessIdentity(input *GetCloudFrontOriginAccessIdentityInput) (*GetCloudFrontOriginAccessIdentityOutput, error) { req, out := c.GetCloudFrontOriginAccessIdentityRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIdentityConfig2016_11_25" +// GetCloudFrontOriginAccessIdentityWithContext is the same as GetCloudFrontOriginAccessIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See GetCloudFrontOriginAccessIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *GetCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*GetCloudFrontOriginAccessIdentityOutput, error) { + req, out := c.GetCloudFrontOriginAccessIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIdentityConfig2017_03_25" // GetCloudFrontOriginAccessIdentityConfigRequest generates a "aws/request.Request" representing the // client's request for the GetCloudFrontOriginAccessIdentityConfig operation. The "output" return @@ -1130,12 +1289,12 @@ const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIden // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetCloudFrontOriginAccessIdentityConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityConfig func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfigRequest(input *GetCloudFrontOriginAccessIdentityConfigInput) (req *request.Request, output *GetCloudFrontOriginAccessIdentityConfigOutput) { op := &request.Operation{ Name: opGetCloudFrontOriginAccessIdentityConfig, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/origin-access-identity/cloudfront/{Id}/config", + HTTPPath: "/2017-03-25/origin-access-identity/cloudfront/{Id}/config", } if input == nil { @@ -1165,14 +1324,29 @@ func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfigRequest(input *GetCl // * ErrCodeAccessDenied "AccessDenied" // Access denied. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetCloudFrontOriginAccessIdentityConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityConfig func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfig(input *GetCloudFrontOriginAccessIdentityConfigInput) (*GetCloudFrontOriginAccessIdentityConfigOutput, error) { req, out := c.GetCloudFrontOriginAccessIdentityConfigRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opGetDistribution = "GetDistribution2016_11_25" +// GetCloudFrontOriginAccessIdentityConfigWithContext is the same as GetCloudFrontOriginAccessIdentityConfig with the addition of +// the ability to pass a context and additional request options. +// +// See GetCloudFrontOriginAccessIdentityConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetCloudFrontOriginAccessIdentityConfigWithContext(ctx aws.Context, input *GetCloudFrontOriginAccessIdentityConfigInput, opts ...request.Option) (*GetCloudFrontOriginAccessIdentityConfigOutput, error) { + req, out := c.GetCloudFrontOriginAccessIdentityConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetDistribution = "GetDistribution2017_03_25" // GetDistributionRequest generates a "aws/request.Request" representing the // client's request for the GetDistribution operation. The "output" return @@ -1198,12 +1372,12 @@ const opGetDistribution = "GetDistribution2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistribution func (c *CloudFront) GetDistributionRequest(input *GetDistributionInput) (req *request.Request, output *GetDistributionOutput) { op := &request.Operation{ Name: opGetDistribution, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/distribution/{Id}", + HTTPPath: "/2017-03-25/distribution/{Id}", } if input == nil { @@ -1233,14 +1407,29 @@ func (c *CloudFront) GetDistributionRequest(input *GetDistributionInput) (req *r // * ErrCodeAccessDenied "AccessDenied" // Access denied. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistribution func (c *CloudFront) GetDistribution(input *GetDistributionInput) (*GetDistributionOutput, error) { req, out := c.GetDistributionRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opGetDistributionConfig = "GetDistributionConfig2016_11_25" +// GetDistributionWithContext is the same as GetDistribution with the addition of +// the ability to pass a context and additional request options. +// +// See GetDistribution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDistributionWithContext(ctx aws.Context, input *GetDistributionInput, opts ...request.Option) (*GetDistributionOutput, error) { + req, out := c.GetDistributionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetDistributionConfig = "GetDistributionConfig2017_03_25" // GetDistributionConfigRequest generates a "aws/request.Request" representing the // client's request for the GetDistributionConfig operation. The "output" return @@ -1266,12 +1455,12 @@ const opGetDistributionConfig = "GetDistributionConfig2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetDistributionConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionConfig func (c *CloudFront) GetDistributionConfigRequest(input *GetDistributionConfigInput) (req *request.Request, output *GetDistributionConfigOutput) { op := &request.Operation{ Name: opGetDistributionConfig, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/distribution/{Id}/config", + HTTPPath: "/2017-03-25/distribution/{Id}/config", } if input == nil { @@ -1301,14 +1490,29 @@ func (c *CloudFront) GetDistributionConfigRequest(input *GetDistributionConfigIn // * ErrCodeAccessDenied "AccessDenied" // Access denied. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetDistributionConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionConfig func (c *CloudFront) GetDistributionConfig(input *GetDistributionConfigInput) (*GetDistributionConfigOutput, error) { req, out := c.GetDistributionConfigRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opGetInvalidation = "GetInvalidation2016_11_25" +// GetDistributionConfigWithContext is the same as GetDistributionConfig with the addition of +// the ability to pass a context and additional request options. +// +// See GetDistributionConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDistributionConfigWithContext(ctx aws.Context, input *GetDistributionConfigInput, opts ...request.Option) (*GetDistributionConfigOutput, error) { + req, out := c.GetDistributionConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetInvalidation = "GetInvalidation2017_03_25" // GetInvalidationRequest generates a "aws/request.Request" representing the // client's request for the GetInvalidation operation. The "output" return @@ -1334,12 +1538,12 @@ const opGetInvalidation = "GetInvalidation2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetInvalidation +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetInvalidation func (c *CloudFront) GetInvalidationRequest(input *GetInvalidationInput) (req *request.Request, output *GetInvalidationOutput) { op := &request.Operation{ Name: opGetInvalidation, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/distribution/{DistributionId}/invalidation/{Id}", + HTTPPath: "/2017-03-25/distribution/{DistributionId}/invalidation/{Id}", } if input == nil { @@ -1372,14 +1576,29 @@ func (c *CloudFront) GetInvalidationRequest(input *GetInvalidationInput) (req *r // * ErrCodeAccessDenied "AccessDenied" // Access denied. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetInvalidation +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetInvalidation func (c *CloudFront) GetInvalidation(input *GetInvalidationInput) (*GetInvalidationOutput, error) { req, out := c.GetInvalidationRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opGetStreamingDistribution = "GetStreamingDistribution2016_11_25" +// GetInvalidationWithContext is the same as GetInvalidation with the addition of +// the ability to pass a context and additional request options. +// +// See GetInvalidation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetInvalidationWithContext(ctx aws.Context, input *GetInvalidationInput, opts ...request.Option) (*GetInvalidationOutput, error) { + req, out := c.GetInvalidationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetStreamingDistribution = "GetStreamingDistribution2017_03_25" // GetStreamingDistributionRequest generates a "aws/request.Request" representing the // client's request for the GetStreamingDistribution operation. The "output" return @@ -1405,12 +1624,12 @@ const opGetStreamingDistribution = "GetStreamingDistribution2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetStreamingDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistribution func (c *CloudFront) GetStreamingDistributionRequest(input *GetStreamingDistributionInput) (req *request.Request, output *GetStreamingDistributionOutput) { op := &request.Operation{ Name: opGetStreamingDistribution, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/streaming-distribution/{Id}", + HTTPPath: "/2017-03-25/streaming-distribution/{Id}", } if input == nil { @@ -1441,14 +1660,29 @@ func (c *CloudFront) GetStreamingDistributionRequest(input *GetStreamingDistribu // * ErrCodeAccessDenied "AccessDenied" // Access denied. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetStreamingDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistribution func (c *CloudFront) GetStreamingDistribution(input *GetStreamingDistributionInput) (*GetStreamingDistributionOutput, error) { req, out := c.GetStreamingDistributionRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2016_11_25" +// GetStreamingDistributionWithContext is the same as GetStreamingDistribution with the addition of +// the ability to pass a context and additional request options. +// +// See GetStreamingDistribution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetStreamingDistributionWithContext(ctx aws.Context, input *GetStreamingDistributionInput, opts ...request.Option) (*GetStreamingDistributionOutput, error) { + req, out := c.GetStreamingDistributionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2017_03_25" // GetStreamingDistributionConfigRequest generates a "aws/request.Request" representing the // client's request for the GetStreamingDistributionConfig operation. The "output" return @@ -1474,12 +1708,12 @@ const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2016_11_ // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetStreamingDistributionConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionConfig func (c *CloudFront) GetStreamingDistributionConfigRequest(input *GetStreamingDistributionConfigInput) (req *request.Request, output *GetStreamingDistributionConfigOutput) { op := &request.Operation{ Name: opGetStreamingDistributionConfig, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/streaming-distribution/{Id}/config", + HTTPPath: "/2017-03-25/streaming-distribution/{Id}/config", } if input == nil { @@ -1509,14 +1743,29 @@ func (c *CloudFront) GetStreamingDistributionConfigRequest(input *GetStreamingDi // * ErrCodeAccessDenied "AccessDenied" // Access denied. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetStreamingDistributionConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionConfig func (c *CloudFront) GetStreamingDistributionConfig(input *GetStreamingDistributionConfigInput) (*GetStreamingDistributionConfigOutput, error) { req, out := c.GetStreamingDistributionConfigRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdentities2016_11_25" +// GetStreamingDistributionConfigWithContext is the same as GetStreamingDistributionConfig with the addition of +// the ability to pass a context and additional request options. +// +// See GetStreamingDistributionConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetStreamingDistributionConfigWithContext(ctx aws.Context, input *GetStreamingDistributionConfigInput, opts ...request.Option) (*GetStreamingDistributionConfigOutput, error) { + req, out := c.GetStreamingDistributionConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdentities2017_03_25" // ListCloudFrontOriginAccessIdentitiesRequest generates a "aws/request.Request" representing the // client's request for the ListCloudFrontOriginAccessIdentities operation. The "output" return @@ -1542,12 +1791,12 @@ const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdenti // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListCloudFrontOriginAccessIdentities +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListCloudFrontOriginAccessIdentities func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesRequest(input *ListCloudFrontOriginAccessIdentitiesInput) (req *request.Request, output *ListCloudFrontOriginAccessIdentitiesOutput) { op := &request.Operation{ Name: opListCloudFrontOriginAccessIdentities, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/origin-access-identity/cloudfront", + HTTPPath: "/2017-03-25/origin-access-identity/cloudfront", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"CloudFrontOriginAccessIdentityList.NextMarker"}, @@ -1580,11 +1829,26 @@ func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesRequest(input *ListClou // * ErrCodeInvalidArgument "InvalidArgument" // The argument is invalid. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListCloudFrontOriginAccessIdentities +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListCloudFrontOriginAccessIdentities func (c *CloudFront) ListCloudFrontOriginAccessIdentities(input *ListCloudFrontOriginAccessIdentitiesInput) (*ListCloudFrontOriginAccessIdentitiesOutput, error) { req, out := c.ListCloudFrontOriginAccessIdentitiesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListCloudFrontOriginAccessIdentitiesWithContext is the same as ListCloudFrontOriginAccessIdentities with the addition of +// the ability to pass a context and additional request options. +// +// See ListCloudFrontOriginAccessIdentities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListCloudFrontOriginAccessIdentitiesWithContext(ctx aws.Context, input *ListCloudFrontOriginAccessIdentitiesInput, opts ...request.Option) (*ListCloudFrontOriginAccessIdentitiesOutput, error) { + req, out := c.ListCloudFrontOriginAccessIdentitiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListCloudFrontOriginAccessIdentitiesPages iterates over the pages of a ListCloudFrontOriginAccessIdentities operation, @@ -1604,15 +1868,40 @@ func (c *CloudFront) ListCloudFrontOriginAccessIdentities(input *ListCloudFrontO // return pageNum <= 3 // }) // -func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesPages(input *ListCloudFrontOriginAccessIdentitiesInput, fn func(p *ListCloudFrontOriginAccessIdentitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListCloudFrontOriginAccessIdentitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListCloudFrontOriginAccessIdentitiesOutput), lastPage) - }) +func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesPages(input *ListCloudFrontOriginAccessIdentitiesInput, fn func(*ListCloudFrontOriginAccessIdentitiesOutput, bool) bool) error { + return c.ListCloudFrontOriginAccessIdentitiesPagesWithContext(aws.BackgroundContext(), input, fn) } -const opListDistributions = "ListDistributions2016_11_25" +// 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListCloudFrontOriginAccessIdentitiesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListCloudFrontOriginAccessIdentitiesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListCloudFrontOriginAccessIdentitiesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListDistributions = "ListDistributions2017_03_25" // ListDistributionsRequest generates a "aws/request.Request" representing the // client's request for the ListDistributions operation. The "output" return @@ -1638,12 +1927,12 @@ const opListDistributions = "ListDistributions2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListDistributions +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributions func (c *CloudFront) ListDistributionsRequest(input *ListDistributionsInput) (req *request.Request, output *ListDistributionsOutput) { op := &request.Operation{ Name: opListDistributions, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/distribution", + HTTPPath: "/2017-03-25/distribution", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"DistributionList.NextMarker"}, @@ -1676,11 +1965,26 @@ func (c *CloudFront) ListDistributionsRequest(input *ListDistributionsInput) (re // * ErrCodeInvalidArgument "InvalidArgument" // The argument is invalid. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListDistributions +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributions func (c *CloudFront) ListDistributions(input *ListDistributionsInput) (*ListDistributionsOutput, error) { req, out := c.ListDistributionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDistributionsWithContext is the same as ListDistributions with the addition of +// the ability to pass a context and additional request options. +// +// See ListDistributions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDistributionsWithContext(ctx aws.Context, input *ListDistributionsInput, opts ...request.Option) (*ListDistributionsOutput, error) { + req, out := c.ListDistributionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListDistributionsPages iterates over the pages of a ListDistributions operation, @@ -1700,15 +2004,40 @@ func (c *CloudFront) ListDistributions(input *ListDistributionsInput) (*ListDist // return pageNum <= 3 // }) // -func (c *CloudFront) ListDistributionsPages(input *ListDistributionsInput, fn func(p *ListDistributionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDistributionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDistributionsOutput), lastPage) - }) +func (c *CloudFront) ListDistributionsPages(input *ListDistributionsInput, fn func(*ListDistributionsOutput, bool) bool) error { + return c.ListDistributionsPagesWithContext(aws.BackgroundContext(), input, fn) } -const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2016_11_25" +// 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDistributionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDistributionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListDistributionsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2017_03_25" // ListDistributionsByWebACLIdRequest generates a "aws/request.Request" representing the // client's request for the ListDistributionsByWebACLId operation. The "output" return @@ -1734,12 +2063,12 @@ const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListDistributionsByWebACLId +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsByWebACLId func (c *CloudFront) ListDistributionsByWebACLIdRequest(input *ListDistributionsByWebACLIdInput) (req *request.Request, output *ListDistributionsByWebACLIdOutput) { op := &request.Operation{ Name: opListDistributionsByWebACLId, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/distributionsByWebACLId/{WebACLId}", + HTTPPath: "/2017-03-25/distributionsByWebACLId/{WebACLId}", } if input == nil { @@ -1768,14 +2097,29 @@ func (c *CloudFront) ListDistributionsByWebACLIdRequest(input *ListDistributions // // * ErrCodeInvalidWebACLId "InvalidWebACLId" // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListDistributionsByWebACLId +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsByWebACLId func (c *CloudFront) ListDistributionsByWebACLId(input *ListDistributionsByWebACLIdInput) (*ListDistributionsByWebACLIdOutput, error) { req, out := c.ListDistributionsByWebACLIdRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opListInvalidations = "ListInvalidations2016_11_25" +// ListDistributionsByWebACLIdWithContext is the same as ListDistributionsByWebACLId with the addition of +// the ability to pass a context and additional request options. +// +// See ListDistributionsByWebACLId for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDistributionsByWebACLIdWithContext(ctx aws.Context, input *ListDistributionsByWebACLIdInput, opts ...request.Option) (*ListDistributionsByWebACLIdOutput, error) { + req, out := c.ListDistributionsByWebACLIdRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListInvalidations = "ListInvalidations2017_03_25" // ListInvalidationsRequest generates a "aws/request.Request" representing the // client's request for the ListInvalidations operation. The "output" return @@ -1801,12 +2145,12 @@ const opListInvalidations = "ListInvalidations2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListInvalidations +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListInvalidations func (c *CloudFront) ListInvalidationsRequest(input *ListInvalidationsInput) (req *request.Request, output *ListInvalidationsOutput) { op := &request.Operation{ Name: opListInvalidations, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/distribution/{DistributionId}/invalidation", + HTTPPath: "/2017-03-25/distribution/{DistributionId}/invalidation", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"InvalidationList.NextMarker"}, @@ -1845,11 +2189,26 @@ func (c *CloudFront) ListInvalidationsRequest(input *ListInvalidationsInput) (re // * ErrCodeAccessDenied "AccessDenied" // Access denied. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListInvalidations +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListInvalidations func (c *CloudFront) ListInvalidations(input *ListInvalidationsInput) (*ListInvalidationsOutput, error) { req, out := c.ListInvalidationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListInvalidationsWithContext is the same as ListInvalidations with the addition of +// the ability to pass a context and additional request options. +// +// See ListInvalidations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListInvalidationsWithContext(ctx aws.Context, input *ListInvalidationsInput, opts ...request.Option) (*ListInvalidationsOutput, error) { + req, out := c.ListInvalidationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListInvalidationsPages iterates over the pages of a ListInvalidations operation, @@ -1869,15 +2228,40 @@ func (c *CloudFront) ListInvalidations(input *ListInvalidationsInput) (*ListInva // return pageNum <= 3 // }) // -func (c *CloudFront) ListInvalidationsPages(input *ListInvalidationsInput, fn func(p *ListInvalidationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInvalidationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInvalidationsOutput), lastPage) - }) +func (c *CloudFront) ListInvalidationsPages(input *ListInvalidationsInput, fn func(*ListInvalidationsOutput, bool) bool) error { + return c.ListInvalidationsPagesWithContext(aws.BackgroundContext(), input, fn) } -const opListStreamingDistributions = "ListStreamingDistributions2016_11_25" +// 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInvalidationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInvalidationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListInvalidationsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListStreamingDistributions = "ListStreamingDistributions2017_03_25" // ListStreamingDistributionsRequest generates a "aws/request.Request" representing the // client's request for the ListStreamingDistributions operation. The "output" return @@ -1903,12 +2287,12 @@ const opListStreamingDistributions = "ListStreamingDistributions2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListStreamingDistributions +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListStreamingDistributions func (c *CloudFront) ListStreamingDistributionsRequest(input *ListStreamingDistributionsInput) (req *request.Request, output *ListStreamingDistributionsOutput) { op := &request.Operation{ Name: opListStreamingDistributions, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/streaming-distribution", + HTTPPath: "/2017-03-25/streaming-distribution", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"StreamingDistributionList.NextMarker"}, @@ -1941,11 +2325,26 @@ func (c *CloudFront) ListStreamingDistributionsRequest(input *ListStreamingDistr // * ErrCodeInvalidArgument "InvalidArgument" // The argument is invalid. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListStreamingDistributions +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListStreamingDistributions func (c *CloudFront) ListStreamingDistributions(input *ListStreamingDistributionsInput) (*ListStreamingDistributionsOutput, error) { req, out := c.ListStreamingDistributionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListStreamingDistributionsWithContext is the same as ListStreamingDistributions with the addition of +// the ability to pass a context and additional request options. +// +// See ListStreamingDistributions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListStreamingDistributionsWithContext(ctx aws.Context, input *ListStreamingDistributionsInput, opts ...request.Option) (*ListStreamingDistributionsOutput, error) { + req, out := c.ListStreamingDistributionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListStreamingDistributionsPages iterates over the pages of a ListStreamingDistributions operation, @@ -1965,15 +2364,40 @@ func (c *CloudFront) ListStreamingDistributions(input *ListStreamingDistribution // return pageNum <= 3 // }) // -func (c *CloudFront) ListStreamingDistributionsPages(input *ListStreamingDistributionsInput, fn func(p *ListStreamingDistributionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStreamingDistributionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStreamingDistributionsOutput), lastPage) - }) +func (c *CloudFront) ListStreamingDistributionsPages(input *ListStreamingDistributionsInput, fn func(*ListStreamingDistributionsOutput, bool) bool) error { + return c.ListStreamingDistributionsPagesWithContext(aws.BackgroundContext(), input, fn) } -const opListTagsForResource = "ListTagsForResource2016_11_25" +// 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListStreamingDistributionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListStreamingDistributionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListStreamingDistributionsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource2017_03_25" // ListTagsForResourceRequest generates a "aws/request.Request" representing the // client's request for the ListTagsForResource operation. The "output" return @@ -1999,12 +2423,12 @@ const opListTagsForResource = "ListTagsForResource2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListTagsForResource +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListTagsForResource func (c *CloudFront) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { op := &request.Operation{ Name: opListTagsForResource, HTTPMethod: "GET", - HTTPPath: "/2016-11-25/tagging", + HTTPPath: "/2017-03-25/tagging", } if input == nil { @@ -2038,14 +2462,29 @@ func (c *CloudFront) ListTagsForResourceRequest(input *ListTagsForResourceInput) // // * ErrCodeNoSuchResource "NoSuchResource" // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListTagsForResource +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListTagsForResource func (c *CloudFront) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opTagResource = "TagResource2016_11_25" +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource2017_03_25" // TagResourceRequest generates a "aws/request.Request" representing the // client's request for the TagResource operation. The "output" return @@ -2071,12 +2510,12 @@ const opTagResource = "TagResource2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/TagResource +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagResource func (c *CloudFront) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { op := &request.Operation{ Name: opTagResource, HTTPMethod: "POST", - HTTPPath: "/2016-11-25/tagging?Operation=Tag", + HTTPPath: "/2017-03-25/tagging?Operation=Tag", } if input == nil { @@ -2112,14 +2551,29 @@ func (c *CloudFront) TagResourceRequest(input *TagResourceInput) (req *request.R // // * ErrCodeNoSuchResource "NoSuchResource" // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/TagResource +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagResource func (c *CloudFront) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { req, out := c.TagResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opUntagResource = "UntagResource2016_11_25" +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource2017_03_25" // UntagResourceRequest generates a "aws/request.Request" representing the // client's request for the UntagResource operation. The "output" return @@ -2145,12 +2599,12 @@ const opUntagResource = "UntagResource2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UntagResource +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UntagResource func (c *CloudFront) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { op := &request.Operation{ Name: opUntagResource, HTTPMethod: "POST", - HTTPPath: "/2016-11-25/tagging?Operation=Untag", + HTTPPath: "/2017-03-25/tagging?Operation=Untag", } if input == nil { @@ -2186,14 +2640,29 @@ func (c *CloudFront) UntagResourceRequest(input *UntagResourceInput) (req *reque // // * ErrCodeNoSuchResource "NoSuchResource" // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UntagResource +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UntagResource func (c *CloudFront) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { req, out := c.UntagResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIdentity2016_11_25" +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIdentity2017_03_25" // UpdateCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the // client's request for the UpdateCloudFrontOriginAccessIdentity operation. The "output" return @@ -2219,12 +2688,12 @@ const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIden // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateCloudFrontOriginAccessIdentity +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateCloudFrontOriginAccessIdentity func (c *CloudFront) UpdateCloudFrontOriginAccessIdentityRequest(input *UpdateCloudFrontOriginAccessIdentityInput) (req *request.Request, output *UpdateCloudFrontOriginAccessIdentityOutput) { op := &request.Operation{ Name: opUpdateCloudFrontOriginAccessIdentity, HTTPMethod: "PUT", - HTTPPath: "/2016-11-25/origin-access-identity/cloudfront/{Id}/config", + HTTPPath: "/2017-03-25/origin-access-identity/cloudfront/{Id}/config", } if input == nil { @@ -2274,14 +2743,29 @@ func (c *CloudFront) UpdateCloudFrontOriginAccessIdentityRequest(input *UpdateCl // * ErrCodeInconsistentQuantities "InconsistentQuantities" // The value of Quantity and the size of Items do not match. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateCloudFrontOriginAccessIdentity +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateCloudFrontOriginAccessIdentity func (c *CloudFront) UpdateCloudFrontOriginAccessIdentity(input *UpdateCloudFrontOriginAccessIdentityInput) (*UpdateCloudFrontOriginAccessIdentityOutput, error) { req, out := c.UpdateCloudFrontOriginAccessIdentityRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opUpdateDistribution = "UpdateDistribution2016_11_25" +// UpdateCloudFrontOriginAccessIdentityWithContext is the same as UpdateCloudFrontOriginAccessIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateCloudFrontOriginAccessIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *UpdateCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*UpdateCloudFrontOriginAccessIdentityOutput, error) { + req, out := c.UpdateCloudFrontOriginAccessIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDistribution = "UpdateDistribution2017_03_25" // UpdateDistributionRequest generates a "aws/request.Request" representing the // client's request for the UpdateDistribution operation. The "output" return @@ -2307,12 +2791,12 @@ const opUpdateDistribution = "UpdateDistribution2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateDistribution func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) (req *request.Request, output *UpdateDistributionOutput) { op := &request.Operation{ Name: opUpdateDistribution, HTTPMethod: "PUT", - HTTPPath: "/2016-11-25/distribution/{Id}/config", + HTTPPath: "/2017-03-25/distribution/{Id}/config", } if input == nil { @@ -2447,14 +2931,33 @@ func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) ( // * ErrCodeInvalidLambdaFunctionAssociation "InvalidLambdaFunctionAssociation" // The specified Lambda function association is invalid. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateDistribution +// * ErrCodeInvalidOriginReadTimeout "InvalidOriginReadTimeout" +// +// * ErrCodeInvalidOriginKeepaliveTimeout "InvalidOriginKeepaliveTimeout" +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateDistribution func (c *CloudFront) UpdateDistribution(input *UpdateDistributionInput) (*UpdateDistributionOutput, error) { req, out := c.UpdateDistributionRequest(input) - err := req.Send() - return out, err + return out, req.Send() } -const opUpdateStreamingDistribution = "UpdateStreamingDistribution2016_11_25" +// UpdateDistributionWithContext is the same as UpdateDistribution with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDistribution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateDistributionWithContext(ctx aws.Context, input *UpdateDistributionInput, opts ...request.Option) (*UpdateDistributionOutput, error) { + req, out := c.UpdateDistributionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateStreamingDistribution = "UpdateStreamingDistribution2017_03_25" // UpdateStreamingDistributionRequest generates a "aws/request.Request" representing the // client's request for the UpdateStreamingDistribution operation. The "output" return @@ -2480,12 +2983,12 @@ const opUpdateStreamingDistribution = "UpdateStreamingDistribution2016_11_25" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateStreamingDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateStreamingDistribution func (c *CloudFront) UpdateStreamingDistributionRequest(input *UpdateStreamingDistributionInput) (req *request.Request, output *UpdateStreamingDistributionOutput) { op := &request.Operation{ Name: opUpdateStreamingDistribution, HTTPMethod: "PUT", - HTTPPath: "/2016-11-25/streaming-distribution/{Id}/config", + HTTPPath: "/2017-03-25/streaming-distribution/{Id}/config", } if input == nil { @@ -2548,11 +3051,26 @@ func (c *CloudFront) UpdateStreamingDistributionRequest(input *UpdateStreamingDi // * ErrCodeInconsistentQuantities "InconsistentQuantities" // The value of Quantity and the size of Items do not match. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateStreamingDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateStreamingDistribution func (c *CloudFront) UpdateStreamingDistribution(input *UpdateStreamingDistributionInput) (*UpdateStreamingDistributionOutput, error) { req, out := c.UpdateStreamingDistributionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateStreamingDistributionWithContext is the same as UpdateStreamingDistribution with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStreamingDistribution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateStreamingDistributionWithContext(ctx aws.Context, input *UpdateStreamingDistributionInput, opts ...request.Option) (*UpdateStreamingDistributionOutput, error) { + req, out := c.UpdateStreamingDistributionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // A complex type that lists the AWS accounts, if any, that you included in @@ -2567,7 +3085,7 @@ func (c *CloudFront) UpdateStreamingDistribution(input *UpdateStreamingDistribut // // For more information, see Serving Private Content through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ActiveTrustedSigners +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ActiveTrustedSigners type ActiveTrustedSigners struct { _ struct{} `type:"structure"` @@ -2625,7 +3143,7 @@ func (s *ActiveTrustedSigners) SetQuantity(v int64) *ActiveTrustedSigners { // A complex type that contains information about CNAMEs (alternate domain names), // if any, for this distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Aliases +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Aliases type Aliases struct { _ struct{} `type:"structure"` @@ -2690,7 +3208,7 @@ func (s *Aliases) SetQuantity(v int64) *Aliases { // S3 bucket or to your custom origin so users can't perform operations that // you don't want them to. For example, you might not want users to have permissions // to delete objects from your origin. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/AllowedMethods +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/AllowedMethods type AllowedMethods struct { _ struct{} `type:"structure"` @@ -2795,7 +3313,7 @@ func (s *AllowedMethods) SetQuantity(v int64) *AllowedMethods { // // For more information about cache behaviors, see Cache Behaviors (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesCacheBehavior) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CacheBehavior +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CacheBehavior type CacheBehavior struct { _ struct{} `type:"structure"` @@ -3077,7 +3595,7 @@ func (s *CacheBehavior) SetViewerProtocolPolicy(v string) *CacheBehavior { } // A complex type that contains zero or more CacheBehavior elements. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CacheBehaviors +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CacheBehaviors type CacheBehaviors struct { _ struct{} `type:"structure"` @@ -3146,7 +3664,7 @@ func (s *CacheBehaviors) SetQuantity(v int64) *CacheBehaviors { // If you pick the second choice for your Amazon S3 Origin, you may need to // forward Access-Control-Request-Method, Access-Control-Request-Headers, and // Origin headers for the responses to be cached correctly. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CachedMethods +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CachedMethods type CachedMethods struct { _ struct{} `type:"structure"` @@ -3207,7 +3725,7 @@ func (s *CachedMethods) SetQuantity(v int64) *CachedMethods { // cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CookieNames +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CookieNames type CookieNames struct { _ struct{} `type:"structure"` @@ -3262,7 +3780,7 @@ func (s *CookieNames) SetQuantity(v int64) *CookieNames { // cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CookiePreference +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CookiePreference type CookiePreference struct { _ struct{} `type:"structure"` @@ -3333,7 +3851,7 @@ func (s *CookiePreference) SetWhitelistedNames(v *CookieNames) *CookiePreference } // The request to create a new origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateCloudFrontOriginAccessIdentityRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentityRequest type CreateCloudFrontOriginAccessIdentityInput struct { _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentityConfig"` @@ -3378,7 +3896,7 @@ func (s *CreateCloudFrontOriginAccessIdentityInput) SetCloudFrontOriginAccessIde } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateCloudFrontOriginAccessIdentityResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentityResult type CreateCloudFrontOriginAccessIdentityOutput struct { _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentity"` @@ -3422,7 +3940,7 @@ func (s *CreateCloudFrontOriginAccessIdentityOutput) SetLocation(v string) *Crea } // The request to create a new distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistributionRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionRequest type CreateDistributionInput struct { _ struct{} `type:"structure" payload:"DistributionConfig"` @@ -3467,7 +3985,7 @@ func (s *CreateDistributionInput) SetDistributionConfig(v *DistributionConfig) * } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistributionResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionResult type CreateDistributionOutput struct { _ struct{} `type:"structure" payload:"Distribution"` @@ -3511,7 +4029,7 @@ func (s *CreateDistributionOutput) SetLocation(v string) *CreateDistributionOutp } // The request to create a new distribution with tags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistributionWithTagsRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTagsRequest type CreateDistributionWithTagsInput struct { _ struct{} `type:"structure" payload:"DistributionConfigWithTags"` @@ -3556,7 +4074,7 @@ func (s *CreateDistributionWithTagsInput) SetDistributionConfigWithTags(v *Distr } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistributionWithTagsResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTagsResult type CreateDistributionWithTagsOutput struct { _ struct{} `type:"structure" payload:"Distribution"` @@ -3600,7 +4118,7 @@ func (s *CreateDistributionWithTagsOutput) SetLocation(v string) *CreateDistribu } // The request to create an invalidation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateInvalidationRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidationRequest type CreateInvalidationInput struct { _ struct{} `type:"structure" payload:"InvalidationBatch"` @@ -3659,7 +4177,7 @@ func (s *CreateInvalidationInput) SetInvalidationBatch(v *InvalidationBatch) *Cr } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateInvalidationResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidationResult type CreateInvalidationOutput struct { _ struct{} `type:"structure" payload:"Invalidation"` @@ -3694,7 +4212,7 @@ func (s *CreateInvalidationOutput) SetLocation(v string) *CreateInvalidationOutp } // The request to create a new streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateStreamingDistributionRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionRequest type CreateStreamingDistributionInput struct { _ struct{} `type:"structure" payload:"StreamingDistributionConfig"` @@ -3739,7 +4257,7 @@ func (s *CreateStreamingDistributionInput) SetStreamingDistributionConfig(v *Str } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateStreamingDistributionResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionResult type CreateStreamingDistributionOutput struct { _ struct{} `type:"structure" payload:"StreamingDistribution"` @@ -3783,7 +4301,7 @@ func (s *CreateStreamingDistributionOutput) SetStreamingDistribution(v *Streamin } // The request to create a new streaming distribution with tags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateStreamingDistributionWithTagsRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTagsRequest type CreateStreamingDistributionWithTagsInput struct { _ struct{} `type:"structure" payload:"StreamingDistributionConfigWithTags"` @@ -3828,7 +4346,7 @@ func (s *CreateStreamingDistributionWithTagsInput) SetStreamingDistributionConfi } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateStreamingDistributionWithTagsResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTagsResult type CreateStreamingDistributionWithTagsOutput struct { _ struct{} `type:"structure" payload:"StreamingDistribution"` @@ -3881,7 +4399,7 @@ func (s *CreateStreamingDistributionWithTagsOutput) SetStreamingDistribution(v * // For more information about custom error pages, see Customizing Error Responses // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CustomErrorResponse +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CustomErrorResponse type CustomErrorResponse struct { _ struct{} `type:"structure"` @@ -4009,7 +4527,7 @@ func (s *CustomErrorResponse) SetResponsePagePath(v string) *CustomErrorResponse // For more information about custom error pages, see Customizing Error Responses // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CustomErrorResponses +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CustomErrorResponses type CustomErrorResponses struct { _ struct{} `type:"structure"` @@ -4071,7 +4589,7 @@ func (s *CustomErrorResponses) SetQuantity(v int64) *CustomErrorResponses { } // A complex type that contains the list of Custom Headers for each origin. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CustomHeaders +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CustomHeaders type CustomHeaders struct { _ struct{} `type:"structure"` @@ -4132,7 +4650,7 @@ func (s *CustomHeaders) SetQuantity(v int64) *CustomHeaders { } // A customer origin. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CustomOriginConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CustomOriginConfig type CustomOriginConfig struct { _ struct{} `type:"structure"` @@ -4146,11 +4664,29 @@ type CustomOriginConfig struct { // HTTPSPort is a required field HTTPSPort *int64 `type:"integer" required:"true"` + // You can create a custom keep-alive timeout. All timeout units are in seconds. + // The default keep-alive timeout is 5 seconds, but you can configure custom + // timeout lengths using the CloudFront API. The minimum timeout length is 1 + // second; the maximum is 60 seconds. + // + // If you need to increase the maximum time limit, contact the AWS Support Center + // (https://console.aws.amazon.com/support/home#/). + OriginKeepaliveTimeout *int64 `type:"integer"` + // The origin protocol policy to apply to your origin. // // OriginProtocolPolicy is a required field OriginProtocolPolicy *string `type:"string" required:"true" enum:"OriginProtocolPolicy"` + // You can create a custom origin read timeout. All timeout units are in seconds. + // The default origin read timeout is 30 seconds, but you can configure custom + // timeout lengths using the CloudFront API. The minimum timeout length is 4 + // seconds; the maximum is 60 seconds. + // + // If you need to increase the maximum time limit, contact the AWS Support Center + // (https://console.aws.amazon.com/support/home#/). + OriginReadTimeout *int64 `type:"integer"` + // The SSL/TLS protocols that you want CloudFront to use when communicating // with your origin over HTTPS. OriginSslProtocols *OriginSslProtocols `type:"structure"` @@ -4202,12 +4738,24 @@ func (s *CustomOriginConfig) SetHTTPSPort(v int64) *CustomOriginConfig { return s } +// SetOriginKeepaliveTimeout sets the OriginKeepaliveTimeout field's value. +func (s *CustomOriginConfig) SetOriginKeepaliveTimeout(v int64) *CustomOriginConfig { + s.OriginKeepaliveTimeout = &v + return s +} + // SetOriginProtocolPolicy sets the OriginProtocolPolicy field's value. func (s *CustomOriginConfig) SetOriginProtocolPolicy(v string) *CustomOriginConfig { s.OriginProtocolPolicy = &v return s } +// SetOriginReadTimeout sets the OriginReadTimeout field's value. +func (s *CustomOriginConfig) SetOriginReadTimeout(v int64) *CustomOriginConfig { + s.OriginReadTimeout = &v + return s +} + // SetOriginSslProtocols sets the OriginSslProtocols field's value. func (s *CustomOriginConfig) SetOriginSslProtocols(v *OriginSslProtocols) *CustomOriginConfig { s.OriginSslProtocols = v @@ -4217,7 +4765,7 @@ func (s *CustomOriginConfig) SetOriginSslProtocols(v *OriginSslProtocols) *Custo // A complex type that describes the default cache behavior if you do not specify // a CacheBehavior element or if files don't match any of the values of PathPattern // in CacheBehavior elements. You must create exactly one default cache behavior. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DefaultCacheBehavior +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DefaultCacheBehavior type DefaultCacheBehavior struct { _ struct{} `type:"structure"` @@ -4463,7 +5011,7 @@ func (s *DefaultCacheBehavior) SetViewerProtocolPolicy(v string) *DefaultCacheBe } // Deletes a origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteCloudFrontOriginAccessIdentityRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentityRequest type DeleteCloudFrontOriginAccessIdentityInput struct { _ struct{} `type:"structure"` @@ -4512,7 +5060,7 @@ func (s *DeleteCloudFrontOriginAccessIdentityInput) SetIfMatch(v string) *Delete return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteCloudFrontOriginAccessIdentityOutput +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentityOutput type DeleteCloudFrontOriginAccessIdentityOutput struct { _ struct{} `type:"structure"` } @@ -4562,7 +5110,7 @@ func (s DeleteCloudFrontOriginAccessIdentityOutput) GoString() string { // For information about deleting a distribution using the CloudFront console, // see Deleting a Distribution (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToDeleteDistribution.html) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteDistributionRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteDistributionRequest type DeleteDistributionInput struct { _ struct{} `type:"structure"` @@ -4611,7 +5159,7 @@ func (s *DeleteDistributionInput) SetIfMatch(v string) *DeleteDistributionInput return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteDistributionOutput +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteDistributionOutput type DeleteDistributionOutput struct { _ struct{} `type:"structure"` } @@ -4627,7 +5175,7 @@ func (s DeleteDistributionOutput) GoString() string { } // The request to delete a streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteStreamingDistributionRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteStreamingDistributionRequest type DeleteStreamingDistributionInput struct { _ struct{} `type:"structure"` @@ -4676,7 +5224,7 @@ func (s *DeleteStreamingDistributionInput) SetIfMatch(v string) *DeleteStreaming return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DeleteStreamingDistributionOutput +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteStreamingDistributionOutput type DeleteStreamingDistributionOutput struct { _ struct{} `type:"structure"` } @@ -4692,7 +5240,7 @@ func (s DeleteStreamingDistributionOutput) GoString() string { } // The distribution's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Distribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Distribution type Distribution struct { _ struct{} `type:"structure"` @@ -4807,7 +5355,7 @@ func (s *Distribution) SetStatus(v string) *Distribution { } // A distribution configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DistributionConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DistributionConfig type DistributionConfig struct { _ struct{} `type:"structure"` @@ -4890,12 +5438,7 @@ type DistributionConfig struct { // in the Amazon CloudFront Developer Guide. DefaultRootObject *string `type:"string"` - // Specifies whether you want CloudFront to save access logs to an Amazon S3 - // bucket. - // - // If you do not want to enable logging when you create a distribution, or if - // you want to disable logging for an existing distribution, specify false for - // Enabled, and specify empty Bucket and Prefix elements. + // From this field, you can enable or disable the selected distribution. // // If you specify false for Enabled but you specify values for Bucket and Prefix, // the values are automatically deleted. @@ -5180,7 +5723,7 @@ func (s *DistributionConfig) SetWebACLId(v string) *DistributionConfig { // A distribution Configuration and a list of tags to be associated with the // distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DistributionConfigWithTags +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DistributionConfigWithTags type DistributionConfigWithTags struct { _ struct{} `type:"structure"` @@ -5244,7 +5787,7 @@ func (s *DistributionConfigWithTags) SetTags(v *Tags) *DistributionConfigWithTag } // A distribution list. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DistributionList +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DistributionList type DistributionList struct { _ struct{} `type:"structure"` @@ -5328,7 +5871,7 @@ func (s *DistributionList) SetQuantity(v int64) *DistributionList { } // A summary of the information about a CloudFront distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/DistributionSummary +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DistributionSummary type DistributionSummary struct { _ struct{} `type:"structure"` @@ -5562,7 +6105,7 @@ func (s *DistributionSummary) SetWebACLId(v string) *DistributionSummary { } // A complex type that specifies how CloudFront handles query strings and cookies. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ForwardedValues +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ForwardedValues type ForwardedValues struct { _ struct{} `type:"structure"` @@ -5678,7 +6221,7 @@ func (s *ForwardedValues) SetQueryStringCacheKeys(v *QueryStringCacheKeys) *Forw // A complex type that controls the countries in which your content is distributed. // CloudFront determines the location of your users using MaxMind GeoIP databases. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GeoRestriction +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GeoRestriction type GeoRestriction struct { _ struct{} `type:"structure"` @@ -5766,7 +6309,7 @@ func (s *GeoRestriction) SetRestrictionType(v string) *GeoRestriction { // The origin access identity's configuration information. For more information, // see CloudFrontOriginAccessIdentityConfigComplexType. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetCloudFrontOriginAccessIdentityConfigRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityConfigRequest type GetCloudFrontOriginAccessIdentityConfigInput struct { _ struct{} `type:"structure"` @@ -5806,7 +6349,7 @@ func (s *GetCloudFrontOriginAccessIdentityConfigInput) SetId(v string) *GetCloud } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetCloudFrontOriginAccessIdentityConfigResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityConfigResult type GetCloudFrontOriginAccessIdentityConfigOutput struct { _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentityConfig"` @@ -5840,7 +6383,7 @@ func (s *GetCloudFrontOriginAccessIdentityConfigOutput) SetETag(v string) *GetCl } // The request to get an origin access identity's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetCloudFrontOriginAccessIdentityRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityRequest type GetCloudFrontOriginAccessIdentityInput struct { _ struct{} `type:"structure"` @@ -5880,7 +6423,7 @@ func (s *GetCloudFrontOriginAccessIdentityInput) SetId(v string) *GetCloudFrontO } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetCloudFrontOriginAccessIdentityResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityResult type GetCloudFrontOriginAccessIdentityOutput struct { _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentity"` @@ -5915,7 +6458,7 @@ func (s *GetCloudFrontOriginAccessIdentityOutput) SetETag(v string) *GetCloudFro } // The request to get a distribution configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetDistributionConfigRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionConfigRequest type GetDistributionConfigInput struct { _ struct{} `type:"structure"` @@ -5955,7 +6498,7 @@ func (s *GetDistributionConfigInput) SetId(v string) *GetDistributionConfigInput } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetDistributionConfigResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionConfigResult type GetDistributionConfigOutput struct { _ struct{} `type:"structure" payload:"DistributionConfig"` @@ -5989,7 +6532,7 @@ func (s *GetDistributionConfigOutput) SetETag(v string) *GetDistributionConfigOu } // The request to get a distribution's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetDistributionRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionRequest type GetDistributionInput struct { _ struct{} `type:"structure"` @@ -6029,7 +6572,7 @@ func (s *GetDistributionInput) SetId(v string) *GetDistributionInput { } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetDistributionResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionResult type GetDistributionOutput struct { _ struct{} `type:"structure" payload:"Distribution"` @@ -6063,7 +6606,7 @@ func (s *GetDistributionOutput) SetETag(v string) *GetDistributionOutput { } // The request to get an invalidation's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetInvalidationRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetInvalidationRequest type GetInvalidationInput struct { _ struct{} `type:"structure"` @@ -6117,7 +6660,7 @@ func (s *GetInvalidationInput) SetId(v string) *GetInvalidationInput { } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetInvalidationResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetInvalidationResult type GetInvalidationOutput struct { _ struct{} `type:"structure" payload:"Invalidation"` @@ -6143,7 +6686,7 @@ func (s *GetInvalidationOutput) SetInvalidation(v *Invalidation) *GetInvalidatio } // To request to get a streaming distribution configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetStreamingDistributionConfigRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionConfigRequest type GetStreamingDistributionConfigInput struct { _ struct{} `type:"structure"` @@ -6183,7 +6726,7 @@ func (s *GetStreamingDistributionConfigInput) SetId(v string) *GetStreamingDistr } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetStreamingDistributionConfigResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionConfigResult type GetStreamingDistributionConfigOutput struct { _ struct{} `type:"structure" payload:"StreamingDistributionConfig"` @@ -6217,7 +6760,7 @@ func (s *GetStreamingDistributionConfigOutput) SetStreamingDistributionConfig(v } // The request to get a streaming distribution's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetStreamingDistributionRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionRequest type GetStreamingDistributionInput struct { _ struct{} `type:"structure"` @@ -6257,7 +6800,7 @@ func (s *GetStreamingDistributionInput) SetId(v string) *GetStreamingDistributio } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/GetStreamingDistributionResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionResult type GetStreamingDistributionOutput struct { _ struct{} `type:"structure" payload:"StreamingDistribution"` @@ -6303,7 +6846,7 @@ func (s *GetStreamingDistributionOutput) SetStreamingDistribution(v *StreamingDi // once for each header value. For more information about caching based on header // values, see How CloudFront Forwards and Caches Headers (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Headers +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Headers type Headers struct { _ struct{} `type:"structure"` @@ -6374,7 +6917,7 @@ func (s *Headers) SetQuantity(v int64) *Headers { } // An invalidation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Invalidation +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Invalidation type Invalidation struct { _ struct{} `type:"structure"` @@ -6435,7 +6978,7 @@ func (s *Invalidation) SetStatus(v string) *Invalidation { } // An invalidation batch. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/InvalidationBatch +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/InvalidationBatch type InvalidationBatch struct { _ struct{} `type:"structure"` @@ -6514,7 +7057,7 @@ func (s *InvalidationBatch) SetPaths(v *Paths) *InvalidationBatch { // For more information about invalidation, see Invalidating Objects (Web Distributions // Only) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/InvalidationList +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/InvalidationList type InvalidationList struct { _ struct{} `type:"structure"` @@ -6598,7 +7141,7 @@ func (s *InvalidationList) SetQuantity(v int64) *InvalidationList { } // A summary of an invalidation request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/InvalidationSummary +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/InvalidationSummary type InvalidationSummary struct { _ struct{} `type:"structure"` @@ -6648,7 +7191,7 @@ func (s *InvalidationSummary) SetStatus(v string) *InvalidationSummary { // associated with AwsAccountNumber. // // For more information, see ActiveTrustedSigners. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/KeyPairIds +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/KeyPairIds type KeyPairIds struct { _ struct{} `type:"structure"` @@ -6689,7 +7232,7 @@ func (s *KeyPairIds) SetQuantity(v int64) *KeyPairIds { } // A complex type that contains a Lambda function association. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/LambdaFunctionAssociation +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/LambdaFunctionAssociation type LambdaFunctionAssociation struct { _ struct{} `type:"structure"` @@ -6742,7 +7285,7 @@ func (s *LambdaFunctionAssociation) SetLambdaFunctionARN(v string) *LambdaFuncti // // If you don't want to invoke any Lambda functions for the requests that match // PathPattern, specify 0 for Quantity and omit Items. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/LambdaFunctionAssociations +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/LambdaFunctionAssociations type LambdaFunctionAssociations struct { _ struct{} `type:"structure"` @@ -6792,7 +7335,7 @@ func (s *LambdaFunctionAssociations) SetQuantity(v int64) *LambdaFunctionAssocia } // The request to list origin access identities. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListCloudFrontOriginAccessIdentitiesRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListCloudFrontOriginAccessIdentitiesRequest type ListCloudFrontOriginAccessIdentitiesInput struct { _ struct{} `type:"structure"` @@ -6830,7 +7373,7 @@ func (s *ListCloudFrontOriginAccessIdentitiesInput) SetMaxItems(v int64) *ListCl } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListCloudFrontOriginAccessIdentitiesResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListCloudFrontOriginAccessIdentitiesResult type ListCloudFrontOriginAccessIdentitiesOutput struct { _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentityList"` @@ -6856,7 +7399,7 @@ func (s *ListCloudFrontOriginAccessIdentitiesOutput) SetCloudFrontOriginAccessId // The request to list distributions that are associated with a specified AWS // WAF web ACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListDistributionsByWebACLIdRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsByWebACLIdRequest type ListDistributionsByWebACLIdInput struct { _ struct{} `type:"structure"` @@ -6922,7 +7465,7 @@ func (s *ListDistributionsByWebACLIdInput) SetWebACLId(v string) *ListDistributi // The response to a request to list the distributions that are associated with // a specified AWS WAF web ACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListDistributionsByWebACLIdResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsByWebACLIdResult type ListDistributionsByWebACLIdOutput struct { _ struct{} `type:"structure" payload:"DistributionList"` @@ -6947,7 +7490,7 @@ func (s *ListDistributionsByWebACLIdOutput) SetDistributionList(v *DistributionL } // The request to list your distributions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListDistributionsRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsRequest type ListDistributionsInput struct { _ struct{} `type:"structure"` @@ -6985,7 +7528,7 @@ func (s *ListDistributionsInput) SetMaxItems(v int64) *ListDistributionsInput { } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListDistributionsResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsResult type ListDistributionsOutput struct { _ struct{} `type:"structure" payload:"DistributionList"` @@ -7010,7 +7553,7 @@ func (s *ListDistributionsOutput) SetDistributionList(v *DistributionList) *List } // The request to list invalidations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListInvalidationsRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListInvalidationsRequest type ListInvalidationsInput struct { _ struct{} `type:"structure"` @@ -7075,7 +7618,7 @@ func (s *ListInvalidationsInput) SetMaxItems(v int64) *ListInvalidationsInput { } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListInvalidationsResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListInvalidationsResult type ListInvalidationsOutput struct { _ struct{} `type:"structure" payload:"InvalidationList"` @@ -7100,7 +7643,7 @@ func (s *ListInvalidationsOutput) SetInvalidationList(v *InvalidationList) *List } // The request to list your streaming distributions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListStreamingDistributionsRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListStreamingDistributionsRequest type ListStreamingDistributionsInput struct { _ struct{} `type:"structure"` @@ -7134,7 +7677,7 @@ func (s *ListStreamingDistributionsInput) SetMaxItems(v int64) *ListStreamingDis } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListStreamingDistributionsResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListStreamingDistributionsResult type ListStreamingDistributionsOutput struct { _ struct{} `type:"structure" payload:"StreamingDistributionList"` @@ -7159,7 +7702,7 @@ func (s *ListStreamingDistributionsOutput) SetStreamingDistributionList(v *Strea } // The request to list tags for a CloudFront resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListTagsForResourceRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListTagsForResourceRequest type ListTagsForResourceInput struct { _ struct{} `type:"structure"` @@ -7199,7 +7742,7 @@ func (s *ListTagsForResourceInput) SetResource(v string) *ListTagsForResourceInp } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ListTagsForResourceResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListTagsForResourceResult type ListTagsForResourceOutput struct { _ struct{} `type:"structure" payload:"Tags"` @@ -7226,7 +7769,7 @@ func (s *ListTagsForResourceOutput) SetTags(v *Tags) *ListTagsForResourceOutput } // A complex type that controls whether access logs are written for the distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/LoggingConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/LoggingConfig type LoggingConfig struct { _ struct{} `type:"structure"` @@ -7327,7 +7870,7 @@ func (s *LoggingConfig) SetPrefix(v string) *LoggingConfig { // For the current limit on the number of origins that you can create for a // distribution, see Amazon CloudFront Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_cloudfront) // in the AWS General Reference. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Origin +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Origin type Origin struct { _ struct{} `type:"structure"` @@ -7485,7 +8028,7 @@ func (s *Origin) SetS3OriginConfig(v *S3OriginConfig) *Origin { } // CloudFront origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CloudFrontOriginAccessIdentity +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CloudFrontOriginAccessIdentity type OriginAccessIdentity struct { _ struct{} `type:"structure"` @@ -7535,7 +8078,7 @@ func (s *OriginAccessIdentity) SetS3CanonicalUserId(v string) *OriginAccessIdent // Origin access identity configuration. Send a GET request to the /CloudFront // API version/CloudFront/identity ID/config resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CloudFrontOriginAccessIdentityConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CloudFrontOriginAccessIdentityConfig type OriginAccessIdentityConfig struct { _ struct{} `type:"structure"` @@ -7607,7 +8150,7 @@ func (s *OriginAccessIdentityConfig) SetComment(v string) *OriginAccessIdentityC // child elements. By default, your entire list of origin access identities // is returned in one single page. If the list is long, you can paginate it // using the MaxItems and Marker parameters. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CloudFrontOriginAccessIdentityList +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CloudFrontOriginAccessIdentityList type OriginAccessIdentityList struct { _ struct{} `type:"structure"` @@ -7696,7 +8239,7 @@ func (s *OriginAccessIdentityList) SetQuantity(v int64) *OriginAccessIdentityLis } // Summary of the information about a CloudFront origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CloudFrontOriginAccessIdentitySummary +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CloudFrontOriginAccessIdentitySummary type OriginAccessIdentitySummary struct { _ struct{} `type:"structure"` @@ -7749,7 +8292,7 @@ func (s *OriginAccessIdentitySummary) SetS3CanonicalUserId(v string) *OriginAcce // A complex type that contains HeaderName and HeaderValue elements, if any, // for this distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/OriginCustomHeader +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/OriginCustomHeader type OriginCustomHeader struct { _ struct{} `type:"structure"` @@ -7807,7 +8350,7 @@ func (s *OriginCustomHeader) SetHeaderValue(v string) *OriginCustomHeader { // A complex type that contains information about the SSL/TLS protocols that // CloudFront can use when establishing an HTTPS connection with your origin. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/OriginSslProtocols +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/OriginSslProtocols type OriginSslProtocols struct { _ struct{} `type:"structure"` @@ -7862,7 +8405,7 @@ func (s *OriginSslProtocols) SetQuantity(v int64) *OriginSslProtocols { } // A complex type that contains information about origins for this distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Origins +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Origins type Origins struct { _ struct{} `type:"structure"` @@ -7927,7 +8470,7 @@ func (s *Origins) SetQuantity(v int64) *Origins { // to invalidate. For more information, see Specifying the Objects to Invalidate // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#invalidation-specifying-objects) // in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Paths +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Paths type Paths struct { _ struct{} `type:"structure"` @@ -7975,7 +8518,7 @@ func (s *Paths) SetQuantity(v int64) *Paths { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/QueryStringCacheKeys +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/QueryStringCacheKeys type QueryStringCacheKeys struct { _ struct{} `type:"structure"` @@ -8027,7 +8570,7 @@ func (s *QueryStringCacheKeys) SetQuantity(v int64) *QueryStringCacheKeys { // A complex type that identifies ways in which you want to restrict distribution // of your content. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Restrictions +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Restrictions type Restrictions struct { _ struct{} `type:"structure"` @@ -8074,7 +8617,7 @@ func (s *Restrictions) SetGeoRestriction(v *GeoRestriction) *Restrictions { // A complex type that contains information about the Amazon S3 bucket from // which you want CloudFront to get your media files for distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/S3Origin +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/S3Origin type S3Origin struct { _ struct{} `type:"structure"` @@ -8145,7 +8688,7 @@ func (s *S3Origin) SetOriginAccessIdentity(v string) *S3Origin { // A complex type that contains information about the Amazon S3 origin. If the // origin is a custom origin, use the CustomOriginConfig element instead. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/S3OriginConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/S3OriginConfig type S3OriginConfig struct { _ struct{} `type:"structure"` @@ -8208,7 +8751,7 @@ func (s *S3OriginConfig) SetOriginAccessIdentity(v string) *S3OriginConfig { // A complex type that lists the AWS accounts that were included in the TrustedSigners // complex type, as well as their active CloudFront key pair IDs, if any. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Signer +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Signer type Signer struct { _ struct{} `type:"structure"` @@ -8248,7 +8791,7 @@ func (s *Signer) SetKeyPairIds(v *KeyPairIds) *Signer { } // A streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/StreamingDistribution +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistribution type StreamingDistribution struct { _ struct{} `type:"structure"` @@ -8350,7 +8893,7 @@ func (s *StreamingDistribution) SetStreamingDistributionConfig(v *StreamingDistr } // The RTMP distribution's configuration information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/StreamingDistributionConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistributionConfig type StreamingDistributionConfig struct { _ struct{} `type:"structure"` @@ -8513,7 +9056,7 @@ func (s *StreamingDistributionConfig) SetTrustedSigners(v *TrustedSigners) *Stre // A streaming distribution Configuration and a list of tags to be associated // with the streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/StreamingDistributionConfigWithTags +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistributionConfigWithTags type StreamingDistributionConfigWithTags struct { _ struct{} `type:"structure"` @@ -8577,7 +9120,7 @@ func (s *StreamingDistributionConfigWithTags) SetTags(v *Tags) *StreamingDistrib } // A streaming distribution list. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/StreamingDistributionList +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistributionList type StreamingDistributionList struct { _ struct{} `type:"structure"` @@ -8662,7 +9205,7 @@ func (s *StreamingDistributionList) SetQuantity(v int64) *StreamingDistributionL } // A summary of the information for an Amazon CloudFront streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/StreamingDistributionSummary +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistributionSummary type StreamingDistributionSummary struct { _ struct{} `type:"structure"` @@ -8813,7 +9356,7 @@ func (s *StreamingDistributionSummary) SetTrustedSigners(v *TrustedSigners) *Str // A complex type that controls whether access logs are written for this streaming // distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/StreamingLoggingConfig +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingLoggingConfig type StreamingLoggingConfig struct { _ struct{} `type:"structure"` @@ -8889,7 +9432,7 @@ func (s *StreamingLoggingConfig) SetPrefix(v string) *StreamingLoggingConfig { } // A complex type that contains Tag key and Tag value. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Tag +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Tag type Tag struct { _ struct{} `type:"structure"` @@ -8947,7 +9490,7 @@ func (s *Tag) SetValue(v string) *Tag { } // A complex type that contains zero or more Tag elements. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/TagKeys +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagKeys type TagKeys struct { _ struct{} `type:"structure"` @@ -8972,7 +9515,7 @@ func (s *TagKeys) SetItems(v []*string) *TagKeys { } // The request to add tags to a CloudFront resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/TagResourceRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagResourceRequest type TagResourceInput struct { _ struct{} `type:"structure" payload:"Tags"` @@ -9030,7 +9573,7 @@ func (s *TagResourceInput) SetTags(v *Tags) *TagResourceInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/TagResourceOutput +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagResourceOutput type TagResourceOutput struct { _ struct{} `type:"structure"` } @@ -9046,7 +9589,7 @@ func (s TagResourceOutput) GoString() string { } // A complex type that contains zero or more Tag elements. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/Tags +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Tags type Tags struct { _ struct{} `type:"structure"` @@ -9108,7 +9651,7 @@ func (s *Tags) SetItems(v []*Tag) *Tags { // // For more information about updating the distribution configuration, see DistributionConfig // . -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/TrustedSigners +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TrustedSigners type TrustedSigners struct { _ struct{} `type:"structure"` @@ -9173,7 +9716,7 @@ func (s *TrustedSigners) SetQuantity(v int64) *TrustedSigners { } // The request to remove tags from a CloudFront resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UntagResourceRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UntagResourceRequest type UntagResourceInput struct { _ struct{} `type:"structure" payload:"TagKeys"` @@ -9226,7 +9769,7 @@ func (s *UntagResourceInput) SetTagKeys(v *TagKeys) *UntagResourceInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UntagResourceOutput +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UntagResourceOutput type UntagResourceOutput struct { _ struct{} `type:"structure"` } @@ -9242,7 +9785,7 @@ func (s UntagResourceOutput) GoString() string { } // The request to update an origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateCloudFrontOriginAccessIdentityRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateCloudFrontOriginAccessIdentityRequest type UpdateCloudFrontOriginAccessIdentityInput struct { _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentityConfig"` @@ -9311,7 +9854,7 @@ func (s *UpdateCloudFrontOriginAccessIdentityInput) SetIfMatch(v string) *Update } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateCloudFrontOriginAccessIdentityResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateCloudFrontOriginAccessIdentityResult type UpdateCloudFrontOriginAccessIdentityOutput struct { _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentity"` @@ -9345,7 +9888,7 @@ func (s *UpdateCloudFrontOriginAccessIdentityOutput) SetETag(v string) *UpdateCl } // The request to update a distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateDistributionRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateDistributionRequest type UpdateDistributionInput struct { _ struct{} `type:"structure" payload:"DistributionConfig"` @@ -9414,7 +9957,7 @@ func (s *UpdateDistributionInput) SetIfMatch(v string) *UpdateDistributionInput } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateDistributionResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateDistributionResult type UpdateDistributionOutput struct { _ struct{} `type:"structure" payload:"Distribution"` @@ -9448,7 +9991,7 @@ func (s *UpdateDistributionOutput) SetETag(v string) *UpdateDistributionOutput { } // The request to update a streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateStreamingDistributionRequest +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateStreamingDistributionRequest type UpdateStreamingDistributionInput struct { _ struct{} `type:"structure" payload:"StreamingDistributionConfig"` @@ -9517,7 +10060,7 @@ func (s *UpdateStreamingDistributionInput) SetStreamingDistributionConfig(v *Str } // The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateStreamingDistributionResult +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateStreamingDistributionResult type UpdateStreamingDistributionOutput struct { _ struct{} `type:"structure" payload:"StreamingDistribution"` @@ -9564,7 +10107,7 @@ func (s *UpdateStreamingDistributionOutput) SetStreamingDistribution(v *Streamin // For more information, see Using an HTTPS Connection to Access Your Objects // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html) // in the Amazon Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/ViewerCertificate +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ViewerCertificate type ViewerCertificate struct { _ struct{} `type:"structure"` @@ -9679,8 +10222,8 @@ type ViewerCertificate struct { // a method that works for all clients or one that works for most clients: // // * vip: CloudFront uses dedicated IP addresses for your content and can - // respond to HTTPS requests from any viewer. However, you must request permission - // to use this feature, and you incur additional monthly charges. + // respond to HTTPS requests from any viewer. However, you will incur additional + // monthly charges. // // * sni-only: CloudFront can respond to HTTPS requests from viewers that // support Server Name Indication (SNI). All modern browsers support SNI, diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go index 072359c4c..2a38d5442 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudfront @@ -107,6 +107,14 @@ const ( // The origin access identity is not valid or doesn't exist. ErrCodeInvalidOriginAccessIdentity = "InvalidOriginAccessIdentity" + // ErrCodeInvalidOriginKeepaliveTimeout for service response error code + // "InvalidOriginKeepaliveTimeout". + ErrCodeInvalidOriginKeepaliveTimeout = "InvalidOriginKeepaliveTimeout" + + // ErrCodeInvalidOriginReadTimeout for service response error code + // "InvalidOriginReadTimeout". + ErrCodeInvalidOriginReadTimeout = "InvalidOriginReadTimeout" + // ErrCodeInvalidProtocolSettings for service response error code // "InvalidProtocolSettings". // diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go index b815814e7..35b82c442 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudfront @@ -17,7 +17,7 @@ import ( // associated API calls, see the Amazon CloudFront Developer Guide. // The service client's operations are safe to be used concurrently. // It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25 +// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25 type CloudFront struct { *client.Client } @@ -59,7 +59,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio SigningName: signingName, SigningRegion: signingRegion, Endpoint: endpoint, - APIVersion: "2016-11-25", + APIVersion: "2017-03-25", }, handlers, ), diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/waiters.go index c14e9d101..c8d4b14da 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudfront import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilDistributionDeployed uses the CloudFront API operation @@ -11,26 +14,45 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *CloudFront) WaitUntilDistributionDeployed(input *GetDistributionInput) error { - waiterCfg := waiter.Config{ - Operation: "GetDistribution", - Delay: 60, + return c.WaitUntilDistributionDeployedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilDistributionDeployedWithContext is an extended version of WaitUntilDistributionDeployed. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilDistributionDeployedWithContext(ctx aws.Context, input *GetDistributionInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilDistributionDeployed", MaxAttempts: 25, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(60 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "Distribution.Status", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Distribution.Status", Expected: "Deployed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetDistributionInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetDistributionRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInvalidationCompleted uses the CloudFront API operation @@ -38,26 +60,45 @@ func (c *CloudFront) WaitUntilDistributionDeployed(input *GetDistributionInput) // If the condition is not meet within the max attempt window an error will // be returned. func (c *CloudFront) WaitUntilInvalidationCompleted(input *GetInvalidationInput) error { - waiterCfg := waiter.Config{ - Operation: "GetInvalidation", - Delay: 20, + return c.WaitUntilInvalidationCompletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInvalidationCompletedWithContext is an extended version of WaitUntilInvalidationCompleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInvalidationCompletedWithContext(ctx aws.Context, input *GetInvalidationInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInvalidationCompleted", MaxAttempts: 30, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(20 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "Invalidation.Status", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Invalidation.Status", Expected: "Completed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetInvalidationInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetInvalidationRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilStreamingDistributionDeployed uses the CloudFront API operation @@ -65,24 +106,43 @@ func (c *CloudFront) WaitUntilInvalidationCompleted(input *GetInvalidationInput) // If the condition is not meet within the max attempt window an error will // be returned. func (c *CloudFront) WaitUntilStreamingDistributionDeployed(input *GetStreamingDistributionInput) error { - waiterCfg := waiter.Config{ - Operation: "GetStreamingDistribution", - Delay: 60, + return c.WaitUntilStreamingDistributionDeployedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilStreamingDistributionDeployedWithContext is an extended version of WaitUntilStreamingDistributionDeployed. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilStreamingDistributionDeployedWithContext(ctx aws.Context, input *GetStreamingDistributionInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilStreamingDistributionDeployed", MaxAttempts: 25, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(60 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "StreamingDistribution.Status", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "StreamingDistribution.Status", Expected: "Deployed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetStreamingDistributionInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetStreamingDistributionRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go index f3ada2c13..f48b86cbd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package cloudtrail provides a client for AWS CloudTrail. package cloudtrail @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -117,8 +118,23 @@ func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags func (c *CloudTrail) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsWithContext is the same as AddTags with the addition of +// the ability to pass a context and additional request options. +// +// See AddTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error) { + req, out := c.AddTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTrail = "CreateTrail" @@ -261,8 +277,23 @@ func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error) { req, out := c.CreateTrailRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTrailWithContext is the same as CreateTrail with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTrail for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTrailWithContext(ctx aws.Context, input *CreateTrailInput, opts ...request.Option) (*CreateTrailOutput, error) { + req, out := c.CreateTrailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTrail = "DeleteTrail" @@ -348,8 +379,23 @@ func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error) { req, out := c.DeleteTrailRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTrailWithContext is the same as DeleteTrail with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTrail for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTrailWithContext(ctx aws.Context, input *DeleteTrailInput, opts ...request.Option) (*DeleteTrailOutput, error) { + req, out := c.DeleteTrailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTrails = "DescribeTrails" @@ -417,8 +463,23 @@ func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails func (c *CloudTrail) DescribeTrails(input *DescribeTrailsInput) (*DescribeTrailsOutput, error) { req, out := c.DescribeTrailsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTrailsWithContext is the same as DescribeTrails with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTrails for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTrailsWithContext(ctx aws.Context, input *DescribeTrailsInput, opts ...request.Option) (*DescribeTrailsOutput, error) { + req, out := c.DescribeTrailsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetEventSelectors = "GetEventSelectors" @@ -516,8 +577,23 @@ func (c *CloudTrail) GetEventSelectorsRequest(input *GetEventSelectorsInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors func (c *CloudTrail) GetEventSelectors(input *GetEventSelectorsInput) (*GetEventSelectorsOutput, error) { req, out := c.GetEventSelectorsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetEventSelectorsWithContext is the same as GetEventSelectors with the addition of +// the ability to pass a context and additional request options. +// +// See GetEventSelectors for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetEventSelectorsWithContext(ctx aws.Context, input *GetEventSelectorsInput, opts ...request.Option) (*GetEventSelectorsOutput, error) { + req, out := c.GetEventSelectorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetTrailStatus = "GetTrailStatus" @@ -601,8 +677,23 @@ func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus func (c *CloudTrail) GetTrailStatus(input *GetTrailStatusInput) (*GetTrailStatusOutput, error) { req, out := c.GetTrailStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetTrailStatusWithContext is the same as GetTrailStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetTrailStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetTrailStatusWithContext(ctx aws.Context, input *GetTrailStatusInput, opts ...request.Option) (*GetTrailStatusOutput, error) { + req, out := c.GetTrailStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListPublicKeys = "ListPublicKeys" @@ -683,8 +774,23 @@ func (c *CloudTrail) ListPublicKeysRequest(input *ListPublicKeysInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys func (c *CloudTrail) ListPublicKeys(input *ListPublicKeysInput) (*ListPublicKeysOutput, error) { req, out := c.ListPublicKeysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPublicKeysWithContext is the same as ListPublicKeys with the addition of +// the ability to pass a context and additional request options. +// +// See ListPublicKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPublicKeysWithContext(ctx aws.Context, input *ListPublicKeysInput, opts ...request.Option) (*ListPublicKeysOutput, error) { + req, out := c.ListPublicKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTags = "ListTags" @@ -783,8 +889,23 @@ func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags func (c *CloudTrail) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { req, out := c.ListTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsWithContext is the same as ListTags with the addition of +// the ability to pass a context and additional request options. +// +// See ListTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { + req, out := c.ListTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opLookupEvents = "LookupEvents" @@ -890,8 +1011,23 @@ func (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents func (c *CloudTrail) LookupEvents(input *LookupEventsInput) (*LookupEventsOutput, error) { req, out := c.LookupEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// LookupEventsWithContext is the same as LookupEvents with the addition of +// the ability to pass a context and additional request options. +// +// See LookupEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) LookupEventsWithContext(ctx aws.Context, input *LookupEventsInput, opts ...request.Option) (*LookupEventsOutput, error) { + req, out := c.LookupEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // LookupEventsPages iterates over the pages of a LookupEvents operation, @@ -911,12 +1047,37 @@ func (c *CloudTrail) LookupEvents(input *LookupEventsInput) (*LookupEventsOutput // return pageNum <= 3 // }) // -func (c *CloudTrail) LookupEventsPages(input *LookupEventsInput, fn func(p *LookupEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.LookupEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*LookupEventsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *LookupEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.LookupEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*LookupEventsOutput), !p.HasNextPage()) + } + return p.Err() } const opPutEventSelectors = "PutEventSelectors" @@ -1045,8 +1206,23 @@ func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors func (c *CloudTrail) PutEventSelectors(input *PutEventSelectorsInput) (*PutEventSelectorsOutput, error) { req, out := c.PutEventSelectorsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutEventSelectorsWithContext is the same as PutEventSelectors with the addition of +// the ability to pass a context and additional request options. +// +// See PutEventSelectors for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutEventSelectorsWithContext(ctx aws.Context, input *PutEventSelectorsInput, opts ...request.Option) (*PutEventSelectorsOutput, error) { + req, out := c.PutEventSelectorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTags = "RemoveTags" @@ -1146,8 +1322,23 @@ func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags func (c *CloudTrail) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsWithContext is the same as RemoveTags with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartLogging = "StartLogging" @@ -1235,8 +1426,23 @@ func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error) { req, out := c.StartLoggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartLoggingWithContext is the same as StartLogging with the addition of +// the ability to pass a context and additional request options. +// +// See StartLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartLoggingWithContext(ctx aws.Context, input *StartLoggingInput, opts ...request.Option) (*StartLoggingOutput, error) { + req, out := c.StartLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopLogging = "StopLogging" @@ -1326,8 +1532,23 @@ func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error) { req, out := c.StopLoggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopLoggingWithContext is the same as StopLogging with the addition of +// the ability to pass a context and additional request options. +// +// See StopLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopLoggingWithContext(ctx aws.Context, input *StopLoggingInput, opts ...request.Option) (*StopLoggingOutput, error) { + req, out := c.StopLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateTrail = "UpdateTrail" @@ -1474,8 +1695,23 @@ func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error) { req, out := c.UpdateTrailRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateTrailWithContext is the same as UpdateTrail with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTrail for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateTrailWithContext(ctx aws.Context, input *UpdateTrailInput, opts ...request.Option) (*UpdateTrailOutput, error) { + req, out := c.UpdateTrailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Specifies the tags to add to a trail. @@ -2232,7 +2468,9 @@ type GetEventSelectorsInput struct { // If you specify a trail ARN, it must be in the format: // // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - TrailName *string `type:"string"` + // + // TrailName is a required field + TrailName *string `type:"string" required:"true"` } // String returns the string representation @@ -2245,6 +2483,19 @@ func (s GetEventSelectorsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetEventSelectorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetEventSelectorsInput"} + if s.TrailName == nil { + invalidParams.Add(request.NewErrParamRequired("TrailName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetTrailName sets the TrailName field's value. func (s *GetEventSelectorsInput) SetTrailName(v string) *GetEventSelectorsInput { s.TrailName = &v @@ -2941,7 +3192,9 @@ type PutEventSelectorsInput struct { // Specifies the settings for your event selectors. You can configure up to // five event selectors for a trail. - EventSelectors []*EventSelector `type:"list"` + // + // EventSelectors is a required field + EventSelectors []*EventSelector `type:"list" required:"true"` // Specifies the name of the trail or trail ARN. If you specify a trail name, // the string must meet the following requirements: @@ -2961,7 +3214,9 @@ type PutEventSelectorsInput struct { // If you specify a trail ARN, it must be in the format: // // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - TrailName *string `type:"string"` + // + // TrailName is a required field + TrailName *string `type:"string" required:"true"` } // String returns the string representation @@ -2974,6 +3229,22 @@ func (s PutEventSelectorsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutEventSelectorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutEventSelectorsInput"} + if s.EventSelectors == nil { + invalidParams.Add(request.NewErrParamRequired("EventSelectors")) + } + if s.TrailName == nil { + invalidParams.Add(request.NewErrParamRequired("TrailName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetEventSelectors sets the EventSelectors field's value. func (s *PutEventSelectorsInput) SetEventSelectors(v []*EventSelector) *PutEventSelectorsInput { s.EventSelectors = v diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go index 14e12f428..0da999b33 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudtrail diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go index f5fcb38c2..05bcdbde1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudtrail diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go index 3abedb2ce..917da5aa3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package cloudwatch provides a client for Amazon CloudWatch. package cloudwatch @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -76,8 +77,23 @@ func (c *CloudWatch) DeleteAlarmsRequest(input *DeleteAlarmsInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarms func (c *CloudWatch) DeleteAlarms(input *DeleteAlarmsInput) (*DeleteAlarmsOutput, error) { req, out := c.DeleteAlarmsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAlarmsWithContext is the same as DeleteAlarms with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAlarms for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAlarmsWithContext(ctx aws.Context, input *DeleteAlarmsInput, opts ...request.Option) (*DeleteAlarmsOutput, error) { + req, out := c.DeleteAlarmsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAlarmHistory = "DescribeAlarmHistory" @@ -152,8 +168,23 @@ func (c *CloudWatch) DescribeAlarmHistoryRequest(input *DescribeAlarmHistoryInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistory func (c *CloudWatch) DescribeAlarmHistory(input *DescribeAlarmHistoryInput) (*DescribeAlarmHistoryOutput, error) { req, out := c.DescribeAlarmHistoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAlarmHistoryWithContext is the same as DescribeAlarmHistory with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAlarmHistory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAlarmHistoryWithContext(ctx aws.Context, input *DescribeAlarmHistoryInput, opts ...request.Option) (*DescribeAlarmHistoryOutput, error) { + req, out := c.DescribeAlarmHistoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeAlarmHistoryPages iterates over the pages of a DescribeAlarmHistory operation, @@ -173,12 +204,37 @@ func (c *CloudWatch) DescribeAlarmHistory(input *DescribeAlarmHistoryInput) (*De // return pageNum <= 3 // }) // -func (c *CloudWatch) DescribeAlarmHistoryPages(input *DescribeAlarmHistoryInput, fn func(p *DescribeAlarmHistoryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeAlarmHistoryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeAlarmHistoryOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeAlarmHistoryInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAlarmHistoryRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeAlarmHistoryOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeAlarms = "DescribeAlarms" @@ -250,8 +306,23 @@ func (c *CloudWatch) DescribeAlarmsRequest(input *DescribeAlarmsInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarms func (c *CloudWatch) DescribeAlarms(input *DescribeAlarmsInput) (*DescribeAlarmsOutput, error) { req, out := c.DescribeAlarmsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAlarmsWithContext is the same as DescribeAlarms with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAlarms for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAlarmsWithContext(ctx aws.Context, input *DescribeAlarmsInput, opts ...request.Option) (*DescribeAlarmsOutput, error) { + req, out := c.DescribeAlarmsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeAlarmsPages iterates over the pages of a DescribeAlarms operation, @@ -271,12 +342,37 @@ func (c *CloudWatch) DescribeAlarms(input *DescribeAlarmsInput) (*DescribeAlarms // return pageNum <= 3 // }) // -func (c *CloudWatch) DescribeAlarmsPages(input *DescribeAlarmsInput, fn func(p *DescribeAlarmsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeAlarmsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeAlarmsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeAlarmsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAlarmsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeAlarmsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeAlarmsForMetric = "DescribeAlarmsForMetric" @@ -336,8 +432,23 @@ func (c *CloudWatch) DescribeAlarmsForMetricRequest(input *DescribeAlarmsForMetr // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetric func (c *CloudWatch) DescribeAlarmsForMetric(input *DescribeAlarmsForMetricInput) (*DescribeAlarmsForMetricOutput, error) { req, out := c.DescribeAlarmsForMetricRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAlarmsForMetricWithContext is the same as DescribeAlarmsForMetric with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAlarmsForMetric for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAlarmsForMetricWithContext(ctx aws.Context, input *DescribeAlarmsForMetricInput, opts ...request.Option) (*DescribeAlarmsForMetricOutput, error) { + req, out := c.DescribeAlarmsForMetricRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableAlarmActions = "DisableAlarmActions" @@ -399,8 +510,23 @@ func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActions func (c *CloudWatch) DisableAlarmActions(input *DisableAlarmActionsInput) (*DisableAlarmActionsOutput, error) { req, out := c.DisableAlarmActionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableAlarmActionsWithContext is the same as DisableAlarmActions with the addition of +// the ability to pass a context and additional request options. +// +// See DisableAlarmActions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableAlarmActionsWithContext(ctx aws.Context, input *DisableAlarmActionsInput, opts ...request.Option) (*DisableAlarmActionsOutput, error) { + req, out := c.DisableAlarmActionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableAlarmActions = "EnableAlarmActions" @@ -461,8 +587,23 @@ func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActions func (c *CloudWatch) EnableAlarmActions(input *EnableAlarmActionsInput) (*EnableAlarmActionsOutput, error) { req, out := c.EnableAlarmActionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableAlarmActionsWithContext is the same as EnableAlarmActions with the addition of +// the ability to pass a context and additional request options. +// +// See EnableAlarmActions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableAlarmActionsWithContext(ctx aws.Context, input *EnableAlarmActionsInput, opts ...request.Option) (*EnableAlarmActionsOutput, error) { + req, out := c.EnableAlarmActionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetMetricStatistics = "GetMetricStatistics" @@ -539,6 +680,14 @@ func (c *CloudWatch) GetMetricStatisticsRequest(input *GetMetricStatisticsInput) // fall within each one-hour period. Therefore, the number of values aggregated // by CloudWatch is larger than the number of data points returned. // +// CloudWatch needs raw data points to calculate percentile statistics. If you +// publish data using a statistic set instead, you cannot retrieve percentile +// statistics for this data unless one of the following conditions is true: +// +// * The SampleCount of the statistic set is 1 +// +// * The Min and the Max of the statistic set are equal +// // For a list of metrics and dimensions supported by AWS services, see the Amazon // CloudWatch Metrics and Dimensions Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html) // in the Amazon CloudWatch User Guide. @@ -566,8 +715,23 @@ func (c *CloudWatch) GetMetricStatisticsRequest(input *GetMetricStatisticsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatistics func (c *CloudWatch) GetMetricStatistics(input *GetMetricStatisticsInput) (*GetMetricStatisticsOutput, error) { req, out := c.GetMetricStatisticsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetMetricStatisticsWithContext is the same as GetMetricStatistics with the addition of +// the ability to pass a context and additional request options. +// +// See GetMetricStatistics for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetMetricStatisticsWithContext(ctx aws.Context, input *GetMetricStatisticsInput, opts ...request.Option) (*GetMetricStatisticsOutput, error) { + req, out := c.GetMetricStatisticsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListMetrics = "ListMetrics" @@ -648,8 +812,23 @@ func (c *CloudWatch) ListMetricsRequest(input *ListMetricsInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetrics func (c *CloudWatch) ListMetrics(input *ListMetricsInput) (*ListMetricsOutput, error) { req, out := c.ListMetricsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListMetricsWithContext is the same as ListMetrics with the addition of +// the ability to pass a context and additional request options. +// +// See ListMetrics for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListMetricsWithContext(ctx aws.Context, input *ListMetricsInput, opts ...request.Option) (*ListMetricsOutput, error) { + req, out := c.ListMetricsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListMetricsPages iterates over the pages of a ListMetrics operation, @@ -669,12 +848,37 @@ func (c *CloudWatch) ListMetrics(input *ListMetricsInput) (*ListMetricsOutput, e // return pageNum <= 3 // }) // -func (c *CloudWatch) ListMetricsPages(input *ListMetricsInput, fn func(p *ListMetricsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListMetricsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListMetricsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMetricsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMetricsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListMetricsOutput), !p.HasNextPage()) + } + return p.Err() } const opPutMetricAlarm = "PutMetricAlarm" @@ -781,8 +985,23 @@ func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarm func (c *CloudWatch) PutMetricAlarm(input *PutMetricAlarmInput) (*PutMetricAlarmOutput, error) { req, out := c.PutMetricAlarmRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutMetricAlarmWithContext is the same as PutMetricAlarm with the addition of +// the ability to pass a context and additional request options. +// +// See PutMetricAlarm for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutMetricAlarmWithContext(ctx aws.Context, input *PutMetricAlarmInput, opts ...request.Option) (*PutMetricAlarmOutput, error) { + req, out := c.PutMetricAlarmRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutMetricData = "PutMetricData" @@ -838,8 +1057,7 @@ func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *reque // a metric, it can take up to fifteen minutes for the metric to appear in calls // to ListMetrics. // -// Each PutMetricData request is limited to 8 KB in size for HTTP GET requests -// and is limited to 40 KB in size for HTTP POST requests. +// Each PutMetricData request is limited to 40 KB in size for HTTP POST requests. // // Although the Value parameter accepts numbers of type Double, Amazon CloudWatch // rejects values that are either too small or too large. Values must be in @@ -847,10 +1065,23 @@ func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *reque // (Base 2). In addition, special values (e.g., NaN, +Infinity, -Infinity) are // not supported. // +// You can use up to 10 dimensions per metric to further clarify what data the +// metric collects. For more information on specifying dimensions, see Publishing +// Metrics (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html) +// in the Amazon CloudWatch User Guide. +// // Data points with time stamps from 24 hours ago or longer can take at least // 48 hours to become available for GetMetricStatistics from the time they are // submitted. // +// CloudWatch needs raw data points to calculate percentile statistics. If you +// publish data using a statistic set instead, you cannot retrieve percentile +// statistics for this data unless one of the following conditions is true: +// +// * The SampleCount of the statistic set is 1 +// +// * The Min and the Max of the statistic set are equal +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -874,8 +1105,23 @@ func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricData func (c *CloudWatch) PutMetricData(input *PutMetricDataInput) (*PutMetricDataOutput, error) { req, out := c.PutMetricDataRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutMetricDataWithContext is the same as PutMetricData with the addition of +// the ability to pass a context and additional request options. +// +// See PutMetricData for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutMetricDataWithContext(ctx aws.Context, input *PutMetricDataInput, opts ...request.Option) (*PutMetricDataOutput, error) { + req, out := c.PutMetricDataRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetAlarmState = "SetAlarmState" @@ -951,8 +1197,23 @@ func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmState func (c *CloudWatch) SetAlarmState(input *SetAlarmStateInput) (*SetAlarmStateOutput, error) { req, out := c.SetAlarmStateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetAlarmStateWithContext is the same as SetAlarmState with the addition of +// the ability to pass a context and additional request options. +// +// See SetAlarmState for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetAlarmStateWithContext(ctx aws.Context, input *SetAlarmStateInput, opts ...request.Option) (*SetAlarmStateOutput, error) { + req, out := c.SetAlarmStateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Represents the history of a specific alarm. @@ -1773,11 +2034,14 @@ func (s EnableAlarmActionsOutput) GoString() string { type GetMetricStatisticsInput struct { _ struct{} `type:"structure"` - // The dimensions. CloudWatch treats each unique combination of dimensions as - // a separate metric. You can't retrieve statistics using combinations of dimensions - // that were not specially published. You must specify the same dimensions that - // were used when the metrics were created. For an example, see Dimension Combinations - // (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations) + // The dimensions. If the metric contains multiple dimensions, you must include + // a value for each dimension. CloudWatch treats each unique combination of + // dimensions as a separate metric. You can't retrieve statistics using combinations + // of dimensions that were not specially published. You must specify the same + // dimensions that were used when the metrics were created. For an example, + // see Dimension Combinations (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations) + // in the Amazon CloudWatch User Guide. For more information on specifying dimensions, + // see Publishing Metrics (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html) // in the Amazon CloudWatch User Guide. Dimensions []*Dimension `type:"list"` @@ -2184,6 +2448,8 @@ type MetricAlarm struct { // The dimensions for the metric associated with the alarm. Dimensions []*Dimension `type:"list"` + EvaluateLowSampleCountPercentile *string `min:"1" type:"string"` + // The number of periods over which data is compared to the specified threshold. EvaluationPeriods *int64 `min:"1" type:"integer"` @@ -2228,6 +2494,8 @@ type MetricAlarm struct { // The value to compare with the specified statistic. Threshold *float64 `type:"double"` + TreatMissingData *string `min:"1" type:"string"` + // The unit of the metric associated with the alarm. Unit *string `type:"string" enum:"StandardUnit"` } @@ -2290,6 +2558,12 @@ func (s *MetricAlarm) SetDimensions(v []*Dimension) *MetricAlarm { return s } +// SetEvaluateLowSampleCountPercentile sets the EvaluateLowSampleCountPercentile field's value. +func (s *MetricAlarm) SetEvaluateLowSampleCountPercentile(v string) *MetricAlarm { + s.EvaluateLowSampleCountPercentile = &v + return s +} + // SetEvaluationPeriods sets the EvaluationPeriods field's value. func (s *MetricAlarm) SetEvaluationPeriods(v int64) *MetricAlarm { s.EvaluationPeriods = &v @@ -2368,6 +2642,12 @@ func (s *MetricAlarm) SetThreshold(v float64) *MetricAlarm { return s } +// SetTreatMissingData sets the TreatMissingData field's value. +func (s *MetricAlarm) SetTreatMissingData(v string) *MetricAlarm { + s.TreatMissingData = &v + return s +} + // SetUnit sets the Unit field's value. func (s *MetricAlarm) SetUnit(v string) *MetricAlarm { s.Unit = &v @@ -2521,6 +2801,16 @@ type PutMetricAlarmInput struct { // The dimensions for the metric associated with the alarm. Dimensions []*Dimension `type:"list"` + // Used only for alarms based on percentiles. If you specify ignore, the alarm + // state will not change during periods with too few data points to be statistically + // significant. If you specify evaluate or omit this parameter, the alarm will + // always be evaluated and possibly change state no matter how many data points + // are available. For more information, see Percentile-Based CloudWatch Alarms + // and Low Data Samples (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples). + // + // Valid Values: evaluate | ignore + EvaluateLowSampleCountPercentile *string `min:"1" type:"string"` + // The number of periods over which data is compared to the specified threshold. // // EvaluationPeriods is a required field @@ -2577,6 +2867,13 @@ type PutMetricAlarmInput struct { // Threshold is a required field Threshold *float64 `type:"double" required:"true"` + // Sets how this alarm is to handle missing data points. If TreatMissingData + // is omitted, the default behavior of missing is used. For more information, + // see Configuring How CloudWatch Alarms Treats Missing Data (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data). + // + // Valid Values: breaching | notBreaching | ignore | missing + TreatMissingData *string `min:"1" type:"string"` + // The unit of measure for the statistic. For example, the units for the Amazon // EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes // that an instance receives on all network interfaces. You can also specify @@ -2612,6 +2909,9 @@ func (s *PutMetricAlarmInput) Validate() error { if s.ComparisonOperator == nil { invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) } + if s.EvaluateLowSampleCountPercentile != nil && len(*s.EvaluateLowSampleCountPercentile) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EvaluateLowSampleCountPercentile", 1)) + } if s.EvaluationPeriods == nil { invalidParams.Add(request.NewErrParamRequired("EvaluationPeriods")) } @@ -2639,6 +2939,9 @@ func (s *PutMetricAlarmInput) Validate() error { if s.Threshold == nil { invalidParams.Add(request.NewErrParamRequired("Threshold")) } + if s.TreatMissingData != nil && len(*s.TreatMissingData) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TreatMissingData", 1)) + } if s.Dimensions != nil { for i, v := range s.Dimensions { if v == nil { @@ -2692,6 +2995,12 @@ func (s *PutMetricAlarmInput) SetDimensions(v []*Dimension) *PutMetricAlarmInput return s } +// SetEvaluateLowSampleCountPercentile sets the EvaluateLowSampleCountPercentile field's value. +func (s *PutMetricAlarmInput) SetEvaluateLowSampleCountPercentile(v string) *PutMetricAlarmInput { + s.EvaluateLowSampleCountPercentile = &v + return s +} + // SetEvaluationPeriods sets the EvaluationPeriods field's value. func (s *PutMetricAlarmInput) SetEvaluationPeriods(v int64) *PutMetricAlarmInput { s.EvaluationPeriods = &v @@ -2746,6 +3055,12 @@ func (s *PutMetricAlarmInput) SetThreshold(v float64) *PutMetricAlarmInput { return s } +// SetTreatMissingData sets the TreatMissingData field's value. +func (s *PutMetricAlarmInput) SetTreatMissingData(v string) *PutMetricAlarmInput { + s.TreatMissingData = &v + return s +} + // SetUnit sets the Unit field's value. func (s *PutMetricAlarmInput) SetUnit(v string) *PutMetricAlarmInput { s.Unit = &v diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go index 60bced5f1..6eb8cb37f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudwatch diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go index 4a992be67..8bffc874e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudwatch diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go index 1184650e2..064abf015 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudwatch import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilAlarmExists uses the CloudWatch API operation @@ -11,24 +14,43 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *CloudWatch) WaitUntilAlarmExists(input *DescribeAlarmsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeAlarms", - Delay: 5, + return c.WaitUntilAlarmExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilAlarmExistsWithContext is an extended version of WaitUntilAlarmExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilAlarmExistsWithContext(ctx aws.Context, input *DescribeAlarmsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilAlarmExists", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "length(MetricAlarms[]) > `0`", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(MetricAlarms[]) > `0`", Expected: true, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeAlarmsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAlarmsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go index d626b354f..c8627baad 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package cloudwatchevents provides a client for Amazon CloudWatch Events. package cloudwatchevents @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -85,8 +86,23 @@ func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRule func (c *CloudWatchEvents) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { req, out := c.DeleteRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRuleWithContext is the same as DeleteRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) DeleteRuleWithContext(ctx aws.Context, input *DeleteRuleInput, opts ...request.Option) (*DeleteRuleOutput, error) { + req, out := c.DeleteRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeRule = "DescribeRule" @@ -153,8 +169,23 @@ func (c *CloudWatchEvents) DescribeRuleRequest(input *DescribeRuleInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRule func (c *CloudWatchEvents) DescribeRule(input *DescribeRuleInput) (*DescribeRuleOutput, error) { req, out := c.DescribeRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeRuleWithContext is the same as DescribeRule with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) DescribeRuleWithContext(ctx aws.Context, input *DescribeRuleInput, opts ...request.Option) (*DescribeRuleOutput, error) { + req, out := c.DescribeRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableRule = "DisableRule" @@ -230,8 +261,23 @@ func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRule func (c *CloudWatchEvents) DisableRule(input *DisableRuleInput) (*DisableRuleOutput, error) { req, out := c.DisableRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableRuleWithContext is the same as DisableRule with the addition of +// the ability to pass a context and additional request options. +// +// See DisableRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) DisableRuleWithContext(ctx aws.Context, input *DisableRuleInput, opts ...request.Option) (*DisableRuleOutput, error) { + req, out := c.DisableRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableRule = "EnableRule" @@ -307,8 +353,23 @@ func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRule func (c *CloudWatchEvents) EnableRule(input *EnableRuleInput) (*EnableRuleOutput, error) { req, out := c.EnableRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableRuleWithContext is the same as EnableRule with the addition of +// the ability to pass a context and additional request options. +// +// See EnableRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) EnableRuleWithContext(ctx aws.Context, input *EnableRuleInput, opts ...request.Option) (*EnableRuleOutput, error) { + req, out := c.EnableRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListRuleNamesByTarget = "ListRuleNamesByTarget" @@ -373,8 +434,23 @@ func (c *CloudWatchEvents) ListRuleNamesByTargetRequest(input *ListRuleNamesByTa // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTarget func (c *CloudWatchEvents) ListRuleNamesByTarget(input *ListRuleNamesByTargetInput) (*ListRuleNamesByTargetOutput, error) { req, out := c.ListRuleNamesByTargetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListRuleNamesByTargetWithContext is the same as ListRuleNamesByTarget with the addition of +// the ability to pass a context and additional request options. +// +// See ListRuleNamesByTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) ListRuleNamesByTargetWithContext(ctx aws.Context, input *ListRuleNamesByTargetInput, opts ...request.Option) (*ListRuleNamesByTargetOutput, error) { + req, out := c.ListRuleNamesByTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListRules = "ListRules" @@ -439,8 +515,23 @@ func (c *CloudWatchEvents) ListRulesRequest(input *ListRulesInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRules func (c *CloudWatchEvents) ListRules(input *ListRulesInput) (*ListRulesOutput, error) { req, out := c.ListRulesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListRulesWithContext is the same as ListRules with the addition of +// the ability to pass a context and additional request options. +// +// See ListRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) ListRulesWithContext(ctx aws.Context, input *ListRulesInput, opts ...request.Option) (*ListRulesOutput, error) { + req, out := c.ListRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTargetsByRule = "ListTargetsByRule" @@ -507,8 +598,23 @@ func (c *CloudWatchEvents) ListTargetsByRuleRequest(input *ListTargetsByRuleInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRule func (c *CloudWatchEvents) ListTargetsByRule(input *ListTargetsByRuleInput) (*ListTargetsByRuleOutput, error) { req, out := c.ListTargetsByRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTargetsByRuleWithContext is the same as ListTargetsByRule with the addition of +// the ability to pass a context and additional request options. +// +// See ListTargetsByRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) ListTargetsByRuleWithContext(ctx aws.Context, input *ListTargetsByRuleInput, opts ...request.Option) (*ListTargetsByRuleOutput, error) { + req, out := c.ListTargetsByRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutEvents = "PutEvents" @@ -573,8 +679,23 @@ func (c *CloudWatchEvents) PutEventsRequest(input *PutEventsInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEvents func (c *CloudWatchEvents) PutEvents(input *PutEventsInput) (*PutEventsOutput, error) { req, out := c.PutEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutEventsWithContext is the same as PutEvents with the addition of +// the ability to pass a context and additional request options. +// +// See PutEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) PutEventsWithContext(ctx aws.Context, input *PutEventsInput, opts ...request.Option) (*PutEventsOutput, error) { + req, out := c.PutEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutRule = "PutRule" @@ -663,8 +784,23 @@ func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRule func (c *CloudWatchEvents) PutRule(input *PutRuleInput) (*PutRuleOutput, error) { req, out := c.PutRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutRuleWithContext is the same as PutRule with the addition of +// the ability to pass a context and additional request options. +// +// See PutRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) PutRuleWithContext(ctx aws.Context, input *PutRuleInput, opts ...request.Option) (*PutRuleOutput, error) { + req, out := c.PutRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutTargets = "PutTargets" @@ -781,8 +917,23 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargets func (c *CloudWatchEvents) PutTargets(input *PutTargetsInput) (*PutTargetsOutput, error) { req, out := c.PutTargetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutTargetsWithContext is the same as PutTargets with the addition of +// the ability to pass a context and additional request options. +// +// See PutTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) PutTargetsWithContext(ctx aws.Context, input *PutTargetsInput, opts ...request.Option) (*PutTargetsOutput, error) { + req, out := c.PutTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTargets = "RemoveTargets" @@ -857,8 +1008,23 @@ func (c *CloudWatchEvents) RemoveTargetsRequest(input *RemoveTargetsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargets func (c *CloudWatchEvents) RemoveTargets(input *RemoveTargetsInput) (*RemoveTargetsOutput, error) { req, out := c.RemoveTargetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTargetsWithContext is the same as RemoveTargets with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) RemoveTargetsWithContext(ctx aws.Context, input *RemoveTargetsInput, opts ...request.Option) (*RemoveTargetsOutput, error) { + req, out := c.RemoveTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTestEventPattern = "TestEventPattern" @@ -930,8 +1096,23 @@ func (c *CloudWatchEvents) TestEventPatternRequest(input *TestEventPatternInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPattern func (c *CloudWatchEvents) TestEventPattern(input *TestEventPatternInput) (*TestEventPatternOutput, error) { req, out := c.TestEventPatternRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TestEventPatternWithContext is the same as TestEventPattern with the addition of +// the ability to pass a context and additional request options. +// +// See TestEventPattern for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatchEvents) TestEventPatternWithContext(ctx aws.Context, input *TestEventPatternInput, opts ...request.Option) (*TestEventPatternOutput, error) { + req, out := c.TestEventPatternRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRuleRequest diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/errors.go index fe9ecb8f8..c7bbe1f58 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudwatchevents diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/service.go index 569d91ed8..88c8421d4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudwatchevents diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go index 38fee5bc7..444b2fd76 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package cloudwatchlogs provides a client for Amazon CloudWatch Logs. package cloudwatchlogs @@ -6,6 +6,7 @@ package cloudwatchlogs import ( "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -86,8 +87,23 @@ func (c *CloudWatchLogs) CancelExportTaskRequest(input *CancelExportTaskInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CancelExportTask func (c *CloudWatchLogs) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) { req, out := c.CancelExportTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelExportTaskWithContext is the same as CancelExportTask with the addition of +// the ability to pass a context and additional request options. +// +// See CancelExportTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelExportTaskWithContext(ctx aws.Context, input *CancelExportTaskInput, opts ...request.Option) (*CancelExportTaskOutput, error) { + req, out := c.CancelExportTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateExportTask = "CreateExportTask" @@ -177,8 +193,23 @@ func (c *CloudWatchLogs) CreateExportTaskRequest(input *CreateExportTaskInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateExportTask func (c *CloudWatchLogs) CreateExportTask(input *CreateExportTaskInput) (*CreateExportTaskOutput, error) { req, out := c.CreateExportTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateExportTaskWithContext is the same as CreateExportTask with the addition of +// the ability to pass a context and additional request options. +// +// See CreateExportTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateExportTaskWithContext(ctx aws.Context, input *CreateExportTaskInput, opts ...request.Option) (*CreateExportTaskOutput, error) { + req, out := c.CreateExportTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLogGroup = "CreateLogGroup" @@ -267,8 +298,23 @@ func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogGroup func (c *CloudWatchLogs) CreateLogGroup(input *CreateLogGroupInput) (*CreateLogGroupOutput, error) { req, out := c.CreateLogGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLogGroupWithContext is the same as CreateLogGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLogGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLogGroupWithContext(ctx aws.Context, input *CreateLogGroupInput, opts ...request.Option) (*CreateLogGroupOutput, error) { + req, out := c.CreateLogGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLogStream = "CreateLogStream" @@ -354,8 +400,23 @@ func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogStream func (c *CloudWatchLogs) CreateLogStream(input *CreateLogStreamInput) (*CreateLogStreamOutput, error) { req, out := c.CreateLogStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLogStreamWithContext is the same as CreateLogStream with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLogStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLogStreamWithContext(ctx aws.Context, input *CreateLogStreamInput, opts ...request.Option) (*CreateLogStreamOutput, error) { + req, out := c.CreateLogStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDestination = "DeleteDestination" @@ -432,8 +493,23 @@ func (c *CloudWatchLogs) DeleteDestinationRequest(input *DeleteDestinationInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteDestination func (c *CloudWatchLogs) DeleteDestination(input *DeleteDestinationInput) (*DeleteDestinationOutput, error) { req, out := c.DeleteDestinationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDestinationWithContext is the same as DeleteDestination with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDestinationWithContext(ctx aws.Context, input *DeleteDestinationInput, opts ...request.Option) (*DeleteDestinationOutput, error) { + req, out := c.DeleteDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLogGroup = "DeleteLogGroup" @@ -509,8 +585,23 @@ func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogGroup func (c *CloudWatchLogs) DeleteLogGroup(input *DeleteLogGroupInput) (*DeleteLogGroupOutput, error) { req, out := c.DeleteLogGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLogGroupWithContext is the same as DeleteLogGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLogGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLogGroupWithContext(ctx aws.Context, input *DeleteLogGroupInput, opts ...request.Option) (*DeleteLogGroupOutput, error) { + req, out := c.DeleteLogGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLogStream = "DeleteLogStream" @@ -586,8 +677,23 @@ func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogStream func (c *CloudWatchLogs) DeleteLogStream(input *DeleteLogStreamInput) (*DeleteLogStreamOutput, error) { req, out := c.DeleteLogStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLogStreamWithContext is the same as DeleteLogStream with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLogStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLogStreamWithContext(ctx aws.Context, input *DeleteLogStreamInput, opts ...request.Option) (*DeleteLogStreamOutput, error) { + req, out := c.DeleteLogStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteMetricFilter = "DeleteMetricFilter" @@ -662,8 +768,23 @@ func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteMetricFilter func (c *CloudWatchLogs) DeleteMetricFilter(input *DeleteMetricFilterInput) (*DeleteMetricFilterOutput, error) { req, out := c.DeleteMetricFilterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteMetricFilterWithContext is the same as DeleteMetricFilter with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMetricFilter for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteMetricFilterWithContext(ctx aws.Context, input *DeleteMetricFilterInput, opts ...request.Option) (*DeleteMetricFilterOutput, error) { + req, out := c.DeleteMetricFilterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRetentionPolicy = "DeleteRetentionPolicy" @@ -741,8 +862,23 @@ func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPoli // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteRetentionPolicy func (c *CloudWatchLogs) DeleteRetentionPolicy(input *DeleteRetentionPolicyInput) (*DeleteRetentionPolicyOutput, error) { req, out := c.DeleteRetentionPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRetentionPolicyWithContext is the same as DeleteRetentionPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRetentionPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRetentionPolicyWithContext(ctx aws.Context, input *DeleteRetentionPolicyInput, opts ...request.Option) (*DeleteRetentionPolicyOutput, error) { + req, out := c.DeleteRetentionPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSubscriptionFilter = "DeleteSubscriptionFilter" @@ -817,8 +953,23 @@ func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscripti // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteSubscriptionFilter func (c *CloudWatchLogs) DeleteSubscriptionFilter(input *DeleteSubscriptionFilterInput) (*DeleteSubscriptionFilterOutput, error) { req, out := c.DeleteSubscriptionFilterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSubscriptionFilterWithContext is the same as DeleteSubscriptionFilter with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSubscriptionFilter for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSubscriptionFilterWithContext(ctx aws.Context, input *DeleteSubscriptionFilterInput, opts ...request.Option) (*DeleteSubscriptionFilterOutput, error) { + req, out := c.DeleteSubscriptionFilterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDestinations = "DescribeDestinations" @@ -892,8 +1043,23 @@ func (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinations // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeDestinations func (c *CloudWatchLogs) DescribeDestinations(input *DescribeDestinationsInput) (*DescribeDestinationsOutput, error) { req, out := c.DescribeDestinationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDestinationsWithContext is the same as DescribeDestinations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDestinations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDestinationsWithContext(ctx aws.Context, input *DescribeDestinationsInput, opts ...request.Option) (*DescribeDestinationsOutput, error) { + req, out := c.DescribeDestinationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDestinationsPages iterates over the pages of a DescribeDestinations operation, @@ -913,12 +1079,37 @@ func (c *CloudWatchLogs) DescribeDestinations(input *DescribeDestinationsInput) // return pageNum <= 3 // }) // -func (c *CloudWatchLogs) DescribeDestinationsPages(input *DescribeDestinationsInput, fn func(p *DescribeDestinationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDestinationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDestinationsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDestinationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDestinationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDestinationsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeExportTasks = "DescribeExportTasks" @@ -986,8 +1177,23 @@ func (c *CloudWatchLogs) DescribeExportTasksRequest(input *DescribeExportTasksIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeExportTasks func (c *CloudWatchLogs) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) { req, out := c.DescribeExportTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeExportTasksWithContext is the same as DescribeExportTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeExportTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeExportTasksWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.Option) (*DescribeExportTasksOutput, error) { + req, out := c.DescribeExportTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLogGroups = "DescribeLogGroups" @@ -1061,8 +1267,23 @@ func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogGroups func (c *CloudWatchLogs) DescribeLogGroups(input *DescribeLogGroupsInput) (*DescribeLogGroupsOutput, error) { req, out := c.DescribeLogGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLogGroupsWithContext is the same as DescribeLogGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLogGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLogGroupsWithContext(ctx aws.Context, input *DescribeLogGroupsInput, opts ...request.Option) (*DescribeLogGroupsOutput, error) { + req, out := c.DescribeLogGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeLogGroupsPages iterates over the pages of a DescribeLogGroups operation, @@ -1082,12 +1303,37 @@ func (c *CloudWatchLogs) DescribeLogGroups(input *DescribeLogGroupsInput) (*Desc // return pageNum <= 3 // }) // -func (c *CloudWatchLogs) DescribeLogGroupsPages(input *DescribeLogGroupsInput, fn func(p *DescribeLogGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLogGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLogGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLogGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLogGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLogGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeLogStreams = "DescribeLogStreams" @@ -1168,8 +1414,23 @@ func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogStreams func (c *CloudWatchLogs) DescribeLogStreams(input *DescribeLogStreamsInput) (*DescribeLogStreamsOutput, error) { req, out := c.DescribeLogStreamsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLogStreamsWithContext is the same as DescribeLogStreams with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLogStreams for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLogStreamsWithContext(ctx aws.Context, input *DescribeLogStreamsInput, opts ...request.Option) (*DescribeLogStreamsOutput, error) { + req, out := c.DescribeLogStreamsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeLogStreamsPages iterates over the pages of a DescribeLogStreams operation, @@ -1189,12 +1450,37 @@ func (c *CloudWatchLogs) DescribeLogStreams(input *DescribeLogStreamsInput) (*De // return pageNum <= 3 // }) // -func (c *CloudWatchLogs) DescribeLogStreamsPages(input *DescribeLogStreamsInput, fn func(p *DescribeLogStreamsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLogStreamsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLogStreamsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLogStreamsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLogStreamsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLogStreamsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeMetricFilters = "DescribeMetricFilters" @@ -1272,8 +1558,23 @@ func (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFilte // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeMetricFilters func (c *CloudWatchLogs) DescribeMetricFilters(input *DescribeMetricFiltersInput) (*DescribeMetricFiltersOutput, error) { req, out := c.DescribeMetricFiltersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMetricFiltersWithContext is the same as DescribeMetricFilters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMetricFilters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMetricFiltersWithContext(ctx aws.Context, input *DescribeMetricFiltersInput, opts ...request.Option) (*DescribeMetricFiltersOutput, error) { + req, out := c.DescribeMetricFiltersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeMetricFiltersPages iterates over the pages of a DescribeMetricFilters operation, @@ -1293,12 +1594,37 @@ func (c *CloudWatchLogs) DescribeMetricFilters(input *DescribeMetricFiltersInput // return pageNum <= 3 // }) // -func (c *CloudWatchLogs) DescribeMetricFiltersPages(input *DescribeMetricFiltersInput, fn func(p *DescribeMetricFiltersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeMetricFiltersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeMetricFiltersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeMetricFiltersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeMetricFiltersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeMetricFiltersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeSubscriptionFilters = "DescribeSubscriptionFilters" @@ -1376,8 +1702,23 @@ func (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubsc // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeSubscriptionFilters func (c *CloudWatchLogs) DescribeSubscriptionFilters(input *DescribeSubscriptionFiltersInput) (*DescribeSubscriptionFiltersOutput, error) { req, out := c.DescribeSubscriptionFiltersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSubscriptionFiltersWithContext is the same as DescribeSubscriptionFilters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSubscriptionFilters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSubscriptionFiltersWithContext(ctx aws.Context, input *DescribeSubscriptionFiltersInput, opts ...request.Option) (*DescribeSubscriptionFiltersOutput, error) { + req, out := c.DescribeSubscriptionFiltersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeSubscriptionFiltersPages iterates over the pages of a DescribeSubscriptionFilters operation, @@ -1397,12 +1738,37 @@ func (c *CloudWatchLogs) DescribeSubscriptionFilters(input *DescribeSubscription // return pageNum <= 3 // }) // -func (c *CloudWatchLogs) DescribeSubscriptionFiltersPages(input *DescribeSubscriptionFiltersInput, fn func(p *DescribeSubscriptionFiltersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSubscriptionFiltersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSubscriptionFiltersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeSubscriptionFiltersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSubscriptionFiltersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeSubscriptionFiltersOutput), !p.HasNextPage()) + } + return p.Err() } const opFilterLogEvents = "FilterLogEvents" @@ -1486,8 +1852,23 @@ func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/FilterLogEvents func (c *CloudWatchLogs) FilterLogEvents(input *FilterLogEventsInput) (*FilterLogEventsOutput, error) { req, out := c.FilterLogEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// FilterLogEventsWithContext is the same as FilterLogEvents with the addition of +// the ability to pass a context and additional request options. +// +// See FilterLogEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) FilterLogEventsWithContext(ctx aws.Context, input *FilterLogEventsInput, opts ...request.Option) (*FilterLogEventsOutput, error) { + req, out := c.FilterLogEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // FilterLogEventsPages iterates over the pages of a FilterLogEvents operation, @@ -1507,12 +1888,37 @@ func (c *CloudWatchLogs) FilterLogEvents(input *FilterLogEventsInput) (*FilterLo // return pageNum <= 3 // }) // -func (c *CloudWatchLogs) FilterLogEventsPages(input *FilterLogEventsInput, fn func(p *FilterLogEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.FilterLogEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*FilterLogEventsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *FilterLogEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.FilterLogEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*FilterLogEventsOutput), !p.HasNextPage()) + } + return p.Err() } const opGetLogEvents = "GetLogEvents" @@ -1594,8 +2000,23 @@ func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogEvents func (c *CloudWatchLogs) GetLogEvents(input *GetLogEventsInput) (*GetLogEventsOutput, error) { req, out := c.GetLogEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetLogEventsWithContext is the same as GetLogEvents with the addition of +// the ability to pass a context and additional request options. +// +// See GetLogEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetLogEventsWithContext(ctx aws.Context, input *GetLogEventsInput, opts ...request.Option) (*GetLogEventsOutput, error) { + req, out := c.GetLogEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetLogEventsPages iterates over the pages of a GetLogEvents operation, @@ -1615,12 +2036,37 @@ func (c *CloudWatchLogs) GetLogEvents(input *GetLogEventsInput) (*GetLogEventsOu // return pageNum <= 3 // }) // -func (c *CloudWatchLogs) GetLogEventsPages(input *GetLogEventsInput, fn func(p *GetLogEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetLogEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetLogEventsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetLogEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetLogEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetLogEventsOutput), !p.HasNextPage()) + } + return p.Err() } const opListTagsLogGroup = "ListTagsLogGroup" @@ -1689,8 +2135,23 @@ func (c *CloudWatchLogs) ListTagsLogGroupRequest(input *ListTagsLogGroupInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ListTagsLogGroup func (c *CloudWatchLogs) ListTagsLogGroup(input *ListTagsLogGroupInput) (*ListTagsLogGroupOutput, error) { req, out := c.ListTagsLogGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsLogGroupWithContext is the same as ListTagsLogGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsLogGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsLogGroupWithContext(ctx aws.Context, input *ListTagsLogGroupInput, opts ...request.Option) (*ListTagsLogGroupOutput, error) { + req, out := c.ListTagsLogGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutDestination = "PutDestination" @@ -1770,8 +2231,23 @@ func (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestination func (c *CloudWatchLogs) PutDestination(input *PutDestinationInput) (*PutDestinationOutput, error) { req, out := c.PutDestinationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutDestinationWithContext is the same as PutDestination with the addition of +// the ability to pass a context and additional request options. +// +// See PutDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutDestinationWithContext(ctx aws.Context, input *PutDestinationInput, opts ...request.Option) (*PutDestinationOutput, error) { + req, out := c.PutDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutDestinationPolicy = "PutDestinationPolicy" @@ -1846,8 +2322,23 @@ func (c *CloudWatchLogs) PutDestinationPolicyRequest(input *PutDestinationPolicy // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestinationPolicy func (c *CloudWatchLogs) PutDestinationPolicy(input *PutDestinationPolicyInput) (*PutDestinationPolicyOutput, error) { req, out := c.PutDestinationPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutDestinationPolicyWithContext is the same as PutDestinationPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutDestinationPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutDestinationPolicyWithContext(ctx aws.Context, input *PutDestinationPolicyInput, opts ...request.Option) (*PutDestinationPolicyOutput, error) { + req, out := c.PutDestinationPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutLogEvents = "PutLogEvents" @@ -1948,8 +2439,23 @@ func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutLogEvents func (c *CloudWatchLogs) PutLogEvents(input *PutLogEventsInput) (*PutLogEventsOutput, error) { req, out := c.PutLogEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutLogEventsWithContext is the same as PutLogEvents with the addition of +// the ability to pass a context and additional request options. +// +// See PutLogEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutLogEventsWithContext(ctx aws.Context, input *PutLogEventsInput, opts ...request.Option) (*PutLogEventsOutput, error) { + req, out := c.PutLogEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutMetricFilter = "PutMetricFilter" @@ -2032,8 +2538,23 @@ func (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutMetricFilter func (c *CloudWatchLogs) PutMetricFilter(input *PutMetricFilterInput) (*PutMetricFilterOutput, error) { req, out := c.PutMetricFilterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutMetricFilterWithContext is the same as PutMetricFilter with the addition of +// the ability to pass a context and additional request options. +// +// See PutMetricFilter for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutMetricFilterWithContext(ctx aws.Context, input *PutMetricFilterInput, opts ...request.Option) (*PutMetricFilterOutput, error) { + req, out := c.PutMetricFilterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutRetentionPolicy = "PutRetentionPolicy" @@ -2110,8 +2631,23 @@ func (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutRetentionPolicy func (c *CloudWatchLogs) PutRetentionPolicy(input *PutRetentionPolicyInput) (*PutRetentionPolicyOutput, error) { req, out := c.PutRetentionPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutRetentionPolicyWithContext is the same as PutRetentionPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutRetentionPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutRetentionPolicyWithContext(ctx aws.Context, input *PutRetentionPolicyInput, opts ...request.Option) (*PutRetentionPolicyOutput, error) { + req, out := c.PutRetentionPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutSubscriptionFilter = "PutSubscriptionFilter" @@ -2206,8 +2742,23 @@ func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilt // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutSubscriptionFilter func (c *CloudWatchLogs) PutSubscriptionFilter(input *PutSubscriptionFilterInput) (*PutSubscriptionFilterOutput, error) { req, out := c.PutSubscriptionFilterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutSubscriptionFilterWithContext is the same as PutSubscriptionFilter with the addition of +// the ability to pass a context and additional request options. +// +// See PutSubscriptionFilter for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutSubscriptionFilterWithContext(ctx aws.Context, input *PutSubscriptionFilterInput, opts ...request.Option) (*PutSubscriptionFilterOutput, error) { + req, out := c.PutSubscriptionFilterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTagLogGroup = "TagLogGroup" @@ -2283,8 +2834,23 @@ func (c *CloudWatchLogs) TagLogGroupRequest(input *TagLogGroupInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TagLogGroup func (c *CloudWatchLogs) TagLogGroup(input *TagLogGroupInput) (*TagLogGroupOutput, error) { req, out := c.TagLogGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TagLogGroupWithContext is the same as TagLogGroup with the addition of +// the ability to pass a context and additional request options. +// +// See TagLogGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TagLogGroupWithContext(ctx aws.Context, input *TagLogGroupInput, opts ...request.Option) (*TagLogGroupOutput, error) { + req, out := c.TagLogGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTestMetricFilter = "TestMetricFilter" @@ -2353,8 +2919,23 @@ func (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TestMetricFilter func (c *CloudWatchLogs) TestMetricFilter(input *TestMetricFilterInput) (*TestMetricFilterOutput, error) { req, out := c.TestMetricFilterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TestMetricFilterWithContext is the same as TestMetricFilter with the addition of +// the ability to pass a context and additional request options. +// +// See TestMetricFilter for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TestMetricFilterWithContext(ctx aws.Context, input *TestMetricFilterInput, opts ...request.Option) (*TestMetricFilterOutput, error) { + req, out := c.TestMetricFilterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUntagLogGroup = "UntagLogGroup" @@ -2423,8 +3004,23 @@ func (c *CloudWatchLogs) UntagLogGroupRequest(input *UntagLogGroupInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/UntagLogGroup func (c *CloudWatchLogs) UntagLogGroup(input *UntagLogGroupInput) (*UntagLogGroupOutput, error) { req, out := c.UntagLogGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UntagLogGroupWithContext is the same as UntagLogGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UntagLogGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UntagLogGroupWithContext(ctx aws.Context, input *UntagLogGroupInput, opts ...request.Option) (*UntagLogGroupOutput, error) { + req, out := c.UntagLogGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CancelExportTaskRequest diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/errors.go index de1b3fd9d..772141f53 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudwatchlogs diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go index e161f962b..d4b0cb559 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudwatchlogs diff --git a/vendor/github.com/aws/aws-sdk-go/service/codebuild/api.go b/vendor/github.com/aws/aws-sdk-go/service/codebuild/api.go index ebef335d1..8ffd90339 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codebuild/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package codebuild provides a client for AWS CodeBuild. package codebuild @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -72,8 +73,23 @@ func (c *CodeBuild) BatchGetBuildsRequest(input *BatchGetBuildsInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetBuilds func (c *CodeBuild) BatchGetBuilds(input *BatchGetBuildsInput) (*BatchGetBuildsOutput, error) { req, out := c.BatchGetBuildsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetBuildsWithContext is the same as BatchGetBuilds with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetBuilds for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) BatchGetBuildsWithContext(ctx aws.Context, input *BatchGetBuildsInput, opts ...request.Option) (*BatchGetBuildsOutput, error) { + req, out := c.BatchGetBuildsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchGetProjects = "BatchGetProjects" @@ -137,8 +153,23 @@ func (c *CodeBuild) BatchGetProjectsRequest(input *BatchGetProjectsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetProjects func (c *CodeBuild) BatchGetProjects(input *BatchGetProjectsInput) (*BatchGetProjectsOutput, error) { req, out := c.BatchGetProjectsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetProjectsWithContext is the same as BatchGetProjects with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetProjects for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) BatchGetProjectsWithContext(ctx aws.Context, input *BatchGetProjectsInput, opts ...request.Option) (*BatchGetProjectsOutput, error) { + req, out := c.BatchGetProjectsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateProject = "CreateProject" @@ -209,8 +240,23 @@ func (c *CodeBuild) CreateProjectRequest(input *CreateProjectInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/CreateProject func (c *CodeBuild) CreateProject(input *CreateProjectInput) (*CreateProjectOutput, error) { req, out := c.CreateProjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateProjectWithContext is the same as CreateProject with the addition of +// the ability to pass a context and additional request options. +// +// See CreateProject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) CreateProjectWithContext(ctx aws.Context, input *CreateProjectInput, opts ...request.Option) (*CreateProjectOutput, error) { + req, out := c.CreateProjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteProject = "DeleteProject" @@ -274,8 +320,23 @@ func (c *CodeBuild) DeleteProjectRequest(input *DeleteProjectInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteProject func (c *CodeBuild) DeleteProject(input *DeleteProjectInput) (*DeleteProjectOutput, error) { req, out := c.DeleteProjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteProjectWithContext is the same as DeleteProject with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteProject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) DeleteProjectWithContext(ctx aws.Context, input *DeleteProjectInput, opts ...request.Option) (*DeleteProjectOutput, error) { + req, out := c.DeleteProjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListBuilds = "ListBuilds" @@ -339,8 +400,23 @@ func (c *CodeBuild) ListBuildsRequest(input *ListBuildsInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuilds func (c *CodeBuild) ListBuilds(input *ListBuildsInput) (*ListBuildsOutput, error) { req, out := c.ListBuildsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListBuildsWithContext is the same as ListBuilds with the addition of +// the ability to pass a context and additional request options. +// +// See ListBuilds for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListBuildsWithContext(ctx aws.Context, input *ListBuildsInput, opts ...request.Option) (*ListBuildsOutput, error) { + req, out := c.ListBuildsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListBuildsForProject = "ListBuildsForProject" @@ -408,8 +484,23 @@ func (c *CodeBuild) ListBuildsForProjectRequest(input *ListBuildsForProjectInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuildsForProject func (c *CodeBuild) ListBuildsForProject(input *ListBuildsForProjectInput) (*ListBuildsForProjectOutput, error) { req, out := c.ListBuildsForProjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListBuildsForProjectWithContext is the same as ListBuildsForProject with the addition of +// the ability to pass a context and additional request options. +// +// See ListBuildsForProject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListBuildsForProjectWithContext(ctx aws.Context, input *ListBuildsForProjectInput, opts ...request.Option) (*ListBuildsForProjectOutput, error) { + req, out := c.ListBuildsForProjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListCuratedEnvironmentImages = "ListCuratedEnvironmentImages" @@ -468,8 +559,23 @@ func (c *CodeBuild) ListCuratedEnvironmentImagesRequest(input *ListCuratedEnviro // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListCuratedEnvironmentImages func (c *CodeBuild) ListCuratedEnvironmentImages(input *ListCuratedEnvironmentImagesInput) (*ListCuratedEnvironmentImagesOutput, error) { req, out := c.ListCuratedEnvironmentImagesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListCuratedEnvironmentImagesWithContext is the same as ListCuratedEnvironmentImages with the addition of +// the ability to pass a context and additional request options. +// +// See ListCuratedEnvironmentImages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListCuratedEnvironmentImagesWithContext(ctx aws.Context, input *ListCuratedEnvironmentImagesInput, opts ...request.Option) (*ListCuratedEnvironmentImagesOutput, error) { + req, out := c.ListCuratedEnvironmentImagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListProjects = "ListProjects" @@ -534,8 +640,23 @@ func (c *CodeBuild) ListProjectsRequest(input *ListProjectsInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListProjects func (c *CodeBuild) ListProjects(input *ListProjectsInput) (*ListProjectsOutput, error) { req, out := c.ListProjectsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListProjectsWithContext is the same as ListProjects with the addition of +// the ability to pass a context and additional request options. +// +// See ListProjects for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListProjectsWithContext(ctx aws.Context, input *ListProjectsInput, opts ...request.Option) (*ListProjectsOutput, error) { + req, out := c.ListProjectsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartBuild = "StartBuild" @@ -605,8 +726,23 @@ func (c *CodeBuild) StartBuildRequest(input *StartBuildInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StartBuild func (c *CodeBuild) StartBuild(input *StartBuildInput) (*StartBuildOutput, error) { req, out := c.StartBuildRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartBuildWithContext is the same as StartBuild with the addition of +// the ability to pass a context and additional request options. +// +// See StartBuild for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) StartBuildWithContext(ctx aws.Context, input *StartBuildInput, opts ...request.Option) (*StartBuildOutput, error) { + req, out := c.StartBuildRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopBuild = "StopBuild" @@ -673,8 +809,23 @@ func (c *CodeBuild) StopBuildRequest(input *StopBuildInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StopBuild func (c *CodeBuild) StopBuild(input *StopBuildInput) (*StopBuildOutput, error) { req, out := c.StopBuildRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopBuildWithContext is the same as StopBuild with the addition of +// the ability to pass a context and additional request options. +// +// See StopBuild for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) StopBuildWithContext(ctx aws.Context, input *StopBuildInput, opts ...request.Option) (*StopBuildOutput, error) { + req, out := c.StopBuildRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateProject = "UpdateProject" @@ -741,8 +892,23 @@ func (c *CodeBuild) UpdateProjectRequest(input *UpdateProjectInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateProject func (c *CodeBuild) UpdateProject(input *UpdateProjectInput) (*UpdateProjectOutput, error) { req, out := c.UpdateProjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateProjectWithContext is the same as UpdateProject with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateProject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) UpdateProjectWithContext(ctx aws.Context, input *UpdateProjectInput, opts ...request.Option) (*UpdateProjectOutput, error) { + req, out := c.UpdateProjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetBuildsInput @@ -2505,14 +2671,15 @@ type ProjectSource struct { // bucket, the path to the ZIP file that contains the source code (for example, // bucket-name/path/to/object-name.zip) // - // * For source code in a GitHub repository, instead of specifying a value - // here, you connect your AWS account to your GitHub account. To do this, - // use the AWS CodeBuild console to begin creating a build project, and follow - // the on-screen instructions to complete the connection. (After you have - // connected to your GitHub account, you do not need to finish creating the - // build project, and you may then leave the AWS CodeBuild console.) To instruct - // AWS CodeBuild to then use this connection, in the source object, set the - // auth object's type value to OAUTH. + // * For source code in a GitHub repository, the HTTPS clone URL to the repository + // that contains the source and the build spec. Also, you must connect your + // AWS account to your GitHub account. To do this, use the AWS CodeBuild + // console to begin creating a build project, and follow the on-screen instructions + // to complete the connection. (After you have connected to your GitHub account, + // you do not need to finish creating the build project, and you may then + // leave the AWS CodeBuild console.) To instruct AWS CodeBuild to then use + // this connection, in the source object, set the auth object's type value + // to OAUTH. Location *string `locationName:"location" type:"string"` // The type of repository that contains the source code to be built. Valid values diff --git a/vendor/github.com/aws/aws-sdk-go/service/codebuild/errors.go b/vendor/github.com/aws/aws-sdk-go/service/codebuild/errors.go index 88cfe77ad..2b91b700a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codebuild/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package codebuild diff --git a/vendor/github.com/aws/aws-sdk-go/service/codebuild/service.go b/vendor/github.com/aws/aws-sdk-go/service/codebuild/service.go index 41d6dd7e7..22fc184db 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codebuild/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package codebuild diff --git a/vendor/github.com/aws/aws-sdk-go/service/codecommit/api.go b/vendor/github.com/aws/aws-sdk-go/service/codecommit/api.go index 47ab5eab2..28e7837e9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codecommit/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package codecommit provides a client for AWS CodeCommit. package codecommit @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -106,8 +107,23 @@ func (c *CodeCommit) BatchGetRepositoriesRequest(input *BatchGetRepositoriesInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchGetRepositories func (c *CodeCommit) BatchGetRepositories(input *BatchGetRepositoriesInput) (*BatchGetRepositoriesOutput, error) { req, out := c.BatchGetRepositoriesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetRepositoriesWithContext is the same as BatchGetRepositories with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetRepositories for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchGetRepositoriesWithContext(ctx aws.Context, input *BatchGetRepositoriesInput, opts ...request.Option) (*BatchGetRepositoriesOutput, error) { + req, out := c.BatchGetRepositoriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateBranch = "CreateBranch" @@ -220,8 +236,23 @@ func (c *CodeCommit) CreateBranchRequest(input *CreateBranchInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranch func (c *CodeCommit) CreateBranch(input *CreateBranchInput) (*CreateBranchOutput, error) { req, out := c.CreateBranchRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateBranchWithContext is the same as CreateBranch with the addition of +// the ability to pass a context and additional request options. +// +// See CreateBranch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateBranchWithContext(ctx aws.Context, input *CreateBranchInput, opts ...request.Option) (*CreateBranchOutput, error) { + req, out := c.CreateBranchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateRepository = "CreateRepository" @@ -316,8 +347,23 @@ func (c *CodeCommit) CreateRepositoryRequest(input *CreateRepositoryInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateRepository func (c *CodeCommit) CreateRepository(input *CreateRepositoryInput) (*CreateRepositoryOutput, error) { req, out := c.CreateRepositoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateRepositoryWithContext is the same as CreateRepository with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRepository for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateRepositoryWithContext(ctx aws.Context, input *CreateRepositoryInput, opts ...request.Option) (*CreateRepositoryOutput, error) { + req, out := c.CreateRepositoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRepository = "DeleteRepository" @@ -408,8 +454,23 @@ func (c *CodeCommit) DeleteRepositoryRequest(input *DeleteRepositoryInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteRepository func (c *CodeCommit) DeleteRepository(input *DeleteRepositoryInput) (*DeleteRepositoryOutput, error) { req, out := c.DeleteRepositoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRepositoryWithContext is the same as DeleteRepository with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRepository for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRepositoryWithContext(ctx aws.Context, input *DeleteRepositoryInput, opts ...request.Option) (*DeleteRepositoryOutput, error) { + req, out := c.DeleteRepositoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBlob = "GetBlob" @@ -512,8 +573,23 @@ func (c *CodeCommit) GetBlobRequest(input *GetBlobInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBlob func (c *CodeCommit) GetBlob(input *GetBlobInput) (*GetBlobOutput, error) { req, out := c.GetBlobRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBlobWithContext is the same as GetBlob with the addition of +// the ability to pass a context and additional request options. +// +// See GetBlob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBlobWithContext(ctx aws.Context, input *GetBlobInput, opts ...request.Option) (*GetBlobOutput, error) { + req, out := c.GetBlobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBranch = "GetBranch" @@ -612,8 +688,23 @@ func (c *CodeCommit) GetBranchRequest(input *GetBranchInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBranch func (c *CodeCommit) GetBranch(input *GetBranchInput) (*GetBranchOutput, error) { req, out := c.GetBranchRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBranchWithContext is the same as GetBranch with the addition of +// the ability to pass a context and additional request options. +// +// See GetBranch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBranchWithContext(ctx aws.Context, input *GetBranchInput, opts ...request.Option) (*GetBranchOutput, error) { + req, out := c.GetBranchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetCommit = "GetCommit" @@ -712,8 +803,23 @@ func (c *CodeCommit) GetCommitRequest(input *GetCommitInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommit func (c *CodeCommit) GetCommit(input *GetCommitInput) (*GetCommitOutput, error) { req, out := c.GetCommitRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetCommitWithContext is the same as GetCommit with the addition of +// the ability to pass a context and additional request options. +// +// See GetCommit for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetCommitWithContext(ctx aws.Context, input *GetCommitInput, opts ...request.Option) (*GetCommitOutput, error) { + req, out := c.GetCommitRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDifferences = "GetDifferences" @@ -835,8 +941,23 @@ func (c *CodeCommit) GetDifferencesRequest(input *GetDifferencesInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetDifferences func (c *CodeCommit) GetDifferences(input *GetDifferencesInput) (*GetDifferencesOutput, error) { req, out := c.GetDifferencesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDifferencesWithContext is the same as GetDifferences with the addition of +// the ability to pass a context and additional request options. +// +// See GetDifferences for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDifferencesWithContext(ctx aws.Context, input *GetDifferencesInput, opts ...request.Option) (*GetDifferencesOutput, error) { + req, out := c.GetDifferencesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetDifferencesPages iterates over the pages of a GetDifferences operation, @@ -856,12 +977,37 @@ func (c *CodeCommit) GetDifferences(input *GetDifferencesInput) (*GetDifferences // return pageNum <= 3 // }) // -func (c *CodeCommit) GetDifferencesPages(input *GetDifferencesInput, fn func(p *GetDifferencesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetDifferencesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetDifferencesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetDifferencesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetDifferencesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetDifferencesOutput), !p.HasNextPage()) + } + return p.Err() } const opGetRepository = "GetRepository" @@ -956,8 +1102,23 @@ func (c *CodeCommit) GetRepositoryRequest(input *GetRepositoryInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepository func (c *CodeCommit) GetRepository(input *GetRepositoryInput) (*GetRepositoryOutput, error) { req, out := c.GetRepositoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRepositoryWithContext is the same as GetRepository with the addition of +// the ability to pass a context and additional request options. +// +// See GetRepository for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetRepositoryWithContext(ctx aws.Context, input *GetRepositoryInput, opts ...request.Option) (*GetRepositoryOutput, error) { + req, out := c.GetRepositoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetRepositoryTriggers = "GetRepositoryTriggers" @@ -1046,8 +1207,23 @@ func (c *CodeCommit) GetRepositoryTriggersRequest(input *GetRepositoryTriggersIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryTriggers func (c *CodeCommit) GetRepositoryTriggers(input *GetRepositoryTriggersInput) (*GetRepositoryTriggersOutput, error) { req, out := c.GetRepositoryTriggersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRepositoryTriggersWithContext is the same as GetRepositoryTriggers with the addition of +// the ability to pass a context and additional request options. +// +// See GetRepositoryTriggers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetRepositoryTriggersWithContext(ctx aws.Context, input *GetRepositoryTriggersInput, opts ...request.Option) (*GetRepositoryTriggersOutput, error) { + req, out := c.GetRepositoryTriggersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListBranches = "ListBranches" @@ -1145,8 +1321,23 @@ func (c *CodeCommit) ListBranchesRequest(input *ListBranchesInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListBranches func (c *CodeCommit) ListBranches(input *ListBranchesInput) (*ListBranchesOutput, error) { req, out := c.ListBranchesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListBranchesWithContext is the same as ListBranches with the addition of +// the ability to pass a context and additional request options. +// +// See ListBranches for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListBranchesWithContext(ctx aws.Context, input *ListBranchesInput, opts ...request.Option) (*ListBranchesOutput, error) { + req, out := c.ListBranchesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListBranchesPages iterates over the pages of a ListBranches operation, @@ -1166,12 +1357,37 @@ func (c *CodeCommit) ListBranches(input *ListBranchesInput) (*ListBranchesOutput // return pageNum <= 3 // }) // -func (c *CodeCommit) ListBranchesPages(input *ListBranchesInput, fn func(p *ListBranchesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListBranchesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListBranchesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListBranchesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListBranchesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListBranchesOutput), !p.HasNextPage()) + } + return p.Err() } const opListRepositories = "ListRepositories" @@ -1247,8 +1463,23 @@ func (c *CodeCommit) ListRepositoriesRequest(input *ListRepositoriesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositories func (c *CodeCommit) ListRepositories(input *ListRepositoriesInput) (*ListRepositoriesOutput, error) { req, out := c.ListRepositoriesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListRepositoriesWithContext is the same as ListRepositories with the addition of +// the ability to pass a context and additional request options. +// +// See ListRepositories for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListRepositoriesWithContext(ctx aws.Context, input *ListRepositoriesInput, opts ...request.Option) (*ListRepositoriesOutput, error) { + req, out := c.ListRepositoriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListRepositoriesPages iterates over the pages of a ListRepositories operation, @@ -1268,12 +1499,37 @@ func (c *CodeCommit) ListRepositories(input *ListRepositoriesInput) (*ListReposi // return pageNum <= 3 // }) // -func (c *CodeCommit) ListRepositoriesPages(input *ListRepositoriesInput, fn func(p *ListRepositoriesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListRepositoriesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListRepositoriesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListRepositoriesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListRepositoriesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListRepositoriesOutput), !p.HasNextPage()) + } + return p.Err() } const opPutRepositoryTriggers = "PutRepositoryTriggers" @@ -1408,8 +1664,23 @@ func (c *CodeCommit) PutRepositoryTriggersRequest(input *PutRepositoryTriggersIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutRepositoryTriggers func (c *CodeCommit) PutRepositoryTriggers(input *PutRepositoryTriggersInput) (*PutRepositoryTriggersOutput, error) { req, out := c.PutRepositoryTriggersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutRepositoryTriggersWithContext is the same as PutRepositoryTriggers with the addition of +// the ability to pass a context and additional request options. +// +// See PutRepositoryTriggers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutRepositoryTriggersWithContext(ctx aws.Context, input *PutRepositoryTriggersInput, opts ...request.Option) (*PutRepositoryTriggersOutput, error) { + req, out := c.PutRepositoryTriggersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTestRepositoryTriggers = "TestRepositoryTriggers" @@ -1546,8 +1817,23 @@ func (c *CodeCommit) TestRepositoryTriggersRequest(input *TestRepositoryTriggers // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TestRepositoryTriggers func (c *CodeCommit) TestRepositoryTriggers(input *TestRepositoryTriggersInput) (*TestRepositoryTriggersOutput, error) { req, out := c.TestRepositoryTriggersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TestRepositoryTriggersWithContext is the same as TestRepositoryTriggers with the addition of +// the ability to pass a context and additional request options. +// +// See TestRepositoryTriggers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TestRepositoryTriggersWithContext(ctx aws.Context, input *TestRepositoryTriggersInput, opts ...request.Option) (*TestRepositoryTriggersOutput, error) { + req, out := c.TestRepositoryTriggersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDefaultBranch = "UpdateDefaultBranch" @@ -1651,8 +1937,23 @@ func (c *CodeCommit) UpdateDefaultBranchRequest(input *UpdateDefaultBranchInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateDefaultBranch func (c *CodeCommit) UpdateDefaultBranch(input *UpdateDefaultBranchInput) (*UpdateDefaultBranchOutput, error) { req, out := c.UpdateDefaultBranchRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDefaultBranchWithContext is the same as UpdateDefaultBranch with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDefaultBranch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateDefaultBranchWithContext(ctx aws.Context, input *UpdateDefaultBranchInput, opts ...request.Option) (*UpdateDefaultBranchOutput, error) { + req, out := c.UpdateDefaultBranchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateRepositoryDescription = "UpdateRepositoryDescription" @@ -1752,8 +2053,23 @@ func (c *CodeCommit) UpdateRepositoryDescriptionRequest(input *UpdateRepositoryD // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryDescription func (c *CodeCommit) UpdateRepositoryDescription(input *UpdateRepositoryDescriptionInput) (*UpdateRepositoryDescriptionOutput, error) { req, out := c.UpdateRepositoryDescriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateRepositoryDescriptionWithContext is the same as UpdateRepositoryDescription with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRepositoryDescription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateRepositoryDescriptionWithContext(ctx aws.Context, input *UpdateRepositoryDescriptionInput, opts ...request.Option) (*UpdateRepositoryDescriptionOutput, error) { + req, out := c.UpdateRepositoryDescriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateRepositoryName = "UpdateRepositoryName" @@ -1837,8 +2153,23 @@ func (c *CodeCommit) UpdateRepositoryNameRequest(input *UpdateRepositoryNameInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryName func (c *CodeCommit) UpdateRepositoryName(input *UpdateRepositoryNameInput) (*UpdateRepositoryNameOutput, error) { req, out := c.UpdateRepositoryNameRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateRepositoryNameWithContext is the same as UpdateRepositoryName with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRepositoryName for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateRepositoryNameWithContext(ctx aws.Context, input *UpdateRepositoryNameInput, opts ...request.Option) (*UpdateRepositoryNameOutput, error) { + req, out := c.UpdateRepositoryNameRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Represents the input of a batch get repositories operation. diff --git a/vendor/github.com/aws/aws-sdk-go/service/codecommit/errors.go b/vendor/github.com/aws/aws-sdk-go/service/codecommit/errors.go index 718d09dec..6200809f4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codecommit/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package codecommit diff --git a/vendor/github.com/aws/aws-sdk-go/service/codecommit/service.go b/vendor/github.com/aws/aws-sdk-go/service/codecommit/service.go index dd0b66613..b1e292ce0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codecommit/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package codecommit diff --git a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/api.go b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/api.go index 1004323da..96e1b208c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package codedeploy provides a client for AWS CodeDeploy. package codedeploy @@ -6,6 +6,7 @@ package codedeploy import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -91,8 +92,23 @@ func (c *CodeDeploy) AddTagsToOnPremisesInstancesRequest(input *AddTagsToOnPremi // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/AddTagsToOnPremisesInstances func (c *CodeDeploy) AddTagsToOnPremisesInstances(input *AddTagsToOnPremisesInstancesInput) (*AddTagsToOnPremisesInstancesOutput, error) { req, out := c.AddTagsToOnPremisesInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsToOnPremisesInstancesWithContext is the same as AddTagsToOnPremisesInstances with the addition of +// the ability to pass a context and additional request options. +// +// See AddTagsToOnPremisesInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsToOnPremisesInstancesWithContext(ctx aws.Context, input *AddTagsToOnPremisesInstancesInput, opts ...request.Option) (*AddTagsToOnPremisesInstancesOutput, error) { + req, out := c.AddTagsToOnPremisesInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchGetApplicationRevisions = "BatchGetApplicationRevisions" @@ -171,8 +187,23 @@ func (c *CodeDeploy) BatchGetApplicationRevisionsRequest(input *BatchGetApplicat // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplicationRevisions func (c *CodeDeploy) BatchGetApplicationRevisions(input *BatchGetApplicationRevisionsInput) (*BatchGetApplicationRevisionsOutput, error) { req, out := c.BatchGetApplicationRevisionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetApplicationRevisionsWithContext is the same as BatchGetApplicationRevisions with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetApplicationRevisions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchGetApplicationRevisionsWithContext(ctx aws.Context, input *BatchGetApplicationRevisionsInput, opts ...request.Option) (*BatchGetApplicationRevisionsOutput, error) { + req, out := c.BatchGetApplicationRevisionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchGetApplications = "BatchGetApplications" @@ -245,8 +276,23 @@ func (c *CodeDeploy) BatchGetApplicationsRequest(input *BatchGetApplicationsInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplications func (c *CodeDeploy) BatchGetApplications(input *BatchGetApplicationsInput) (*BatchGetApplicationsOutput, error) { req, out := c.BatchGetApplicationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetApplicationsWithContext is the same as BatchGetApplications with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetApplications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchGetApplicationsWithContext(ctx aws.Context, input *BatchGetApplicationsInput, opts ...request.Option) (*BatchGetApplicationsOutput, error) { + req, out := c.BatchGetApplicationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchGetDeploymentGroups = "BatchGetDeploymentGroups" @@ -325,8 +371,23 @@ func (c *CodeDeploy) BatchGetDeploymentGroupsRequest(input *BatchGetDeploymentGr // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentGroups func (c *CodeDeploy) BatchGetDeploymentGroups(input *BatchGetDeploymentGroupsInput) (*BatchGetDeploymentGroupsOutput, error) { req, out := c.BatchGetDeploymentGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetDeploymentGroupsWithContext is the same as BatchGetDeploymentGroups with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetDeploymentGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchGetDeploymentGroupsWithContext(ctx aws.Context, input *BatchGetDeploymentGroupsInput, opts ...request.Option) (*BatchGetDeploymentGroupsOutput, error) { + req, out := c.BatchGetDeploymentGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchGetDeploymentInstances = "BatchGetDeploymentInstances" @@ -406,8 +467,23 @@ func (c *CodeDeploy) BatchGetDeploymentInstancesRequest(input *BatchGetDeploymen // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentInstances func (c *CodeDeploy) BatchGetDeploymentInstances(input *BatchGetDeploymentInstancesInput) (*BatchGetDeploymentInstancesOutput, error) { req, out := c.BatchGetDeploymentInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetDeploymentInstancesWithContext is the same as BatchGetDeploymentInstances with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetDeploymentInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchGetDeploymentInstancesWithContext(ctx aws.Context, input *BatchGetDeploymentInstancesInput, opts ...request.Option) (*BatchGetDeploymentInstancesOutput, error) { + req, out := c.BatchGetDeploymentInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchGetDeployments = "BatchGetDeployments" @@ -477,8 +553,23 @@ func (c *CodeDeploy) BatchGetDeploymentsRequest(input *BatchGetDeploymentsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeployments func (c *CodeDeploy) BatchGetDeployments(input *BatchGetDeploymentsInput) (*BatchGetDeploymentsOutput, error) { req, out := c.BatchGetDeploymentsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetDeploymentsWithContext is the same as BatchGetDeployments with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetDeployments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchGetDeploymentsWithContext(ctx aws.Context, input *BatchGetDeploymentsInput, opts ...request.Option) (*BatchGetDeploymentsOutput, error) { + req, out := c.BatchGetDeploymentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchGetOnPremisesInstances = "BatchGetOnPremisesInstances" @@ -548,8 +639,23 @@ func (c *CodeDeploy) BatchGetOnPremisesInstancesRequest(input *BatchGetOnPremise // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetOnPremisesInstances func (c *CodeDeploy) BatchGetOnPremisesInstances(input *BatchGetOnPremisesInstancesInput) (*BatchGetOnPremisesInstancesOutput, error) { req, out := c.BatchGetOnPremisesInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetOnPremisesInstancesWithContext is the same as BatchGetOnPremisesInstances with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetOnPremisesInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchGetOnPremisesInstancesWithContext(ctx aws.Context, input *BatchGetOnPremisesInstancesInput, opts ...request.Option) (*BatchGetOnPremisesInstancesOutput, error) { + req, out := c.BatchGetOnPremisesInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opContinueDeployment = "ContinueDeployment" @@ -634,8 +740,23 @@ func (c *CodeDeploy) ContinueDeploymentRequest(input *ContinueDeploymentInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ContinueDeployment func (c *CodeDeploy) ContinueDeployment(input *ContinueDeploymentInput) (*ContinueDeploymentOutput, error) { req, out := c.ContinueDeploymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ContinueDeploymentWithContext is the same as ContinueDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See ContinueDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ContinueDeploymentWithContext(ctx aws.Context, input *ContinueDeploymentInput, opts ...request.Option) (*ContinueDeploymentOutput, error) { + req, out := c.ContinueDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateApplication = "CreateApplication" @@ -709,8 +830,23 @@ func (c *CodeDeploy) CreateApplicationRequest(input *CreateApplicationInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateApplication func (c *CodeDeploy) CreateApplication(input *CreateApplicationInput) (*CreateApplicationOutput, error) { req, out := c.CreateApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateApplicationWithContext is the same as CreateApplication with the addition of +// the ability to pass a context and additional request options. +// +// See CreateApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateApplicationWithContext(ctx aws.Context, input *CreateApplicationInput, opts ...request.Option) (*CreateApplicationOutput, error) { + req, out := c.CreateApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDeployment = "CreateDeployment" @@ -832,8 +968,23 @@ func (c *CodeDeploy) CreateDeploymentRequest(input *CreateDeploymentInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeployment func (c *CodeDeploy) CreateDeployment(input *CreateDeploymentInput) (*CreateDeploymentOutput, error) { req, out := c.CreateDeploymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDeploymentWithContext is the same as CreateDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDeploymentWithContext(ctx aws.Context, input *CreateDeploymentInput, opts ...request.Option) (*CreateDeploymentOutput, error) { + req, out := c.CreateDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDeploymentConfig = "CreateDeploymentConfig" @@ -910,8 +1061,23 @@ func (c *CodeDeploy) CreateDeploymentConfigRequest(input *CreateDeploymentConfig // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentConfig func (c *CodeDeploy) CreateDeploymentConfig(input *CreateDeploymentConfigInput) (*CreateDeploymentConfigOutput, error) { req, out := c.CreateDeploymentConfigRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDeploymentConfigWithContext is the same as CreateDeploymentConfig with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDeploymentConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDeploymentConfigWithContext(ctx aws.Context, input *CreateDeploymentConfigInput, opts ...request.Option) (*CreateDeploymentConfigOutput, error) { + req, out := c.CreateDeploymentConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDeploymentGroup = "CreateDeploymentGroup" @@ -1061,8 +1227,23 @@ func (c *CodeDeploy) CreateDeploymentGroupRequest(input *CreateDeploymentGroupIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentGroup func (c *CodeDeploy) CreateDeploymentGroup(input *CreateDeploymentGroupInput) (*CreateDeploymentGroupOutput, error) { req, out := c.CreateDeploymentGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDeploymentGroupWithContext is the same as CreateDeploymentGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDeploymentGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDeploymentGroupWithContext(ctx aws.Context, input *CreateDeploymentGroupInput, opts ...request.Option) (*CreateDeploymentGroupOutput, error) { + req, out := c.CreateDeploymentGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteApplication = "DeleteApplication" @@ -1131,8 +1312,23 @@ func (c *CodeDeploy) DeleteApplicationRequest(input *DeleteApplicationInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteApplication func (c *CodeDeploy) DeleteApplication(input *DeleteApplicationInput) (*DeleteApplicationOutput, error) { req, out := c.DeleteApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteApplicationWithContext is the same as DeleteApplication with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteApplicationWithContext(ctx aws.Context, input *DeleteApplicationInput, opts ...request.Option) (*DeleteApplicationOutput, error) { + req, out := c.DeleteApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDeploymentConfig = "DeleteDeploymentConfig" @@ -1210,8 +1406,23 @@ func (c *CodeDeploy) DeleteDeploymentConfigRequest(input *DeleteDeploymentConfig // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentConfig func (c *CodeDeploy) DeleteDeploymentConfig(input *DeleteDeploymentConfigInput) (*DeleteDeploymentConfigOutput, error) { req, out := c.DeleteDeploymentConfigRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDeploymentConfigWithContext is the same as DeleteDeploymentConfig with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDeploymentConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDeploymentConfigWithContext(ctx aws.Context, input *DeleteDeploymentConfigInput, opts ...request.Option) (*DeleteDeploymentConfigOutput, error) { + req, out := c.DeleteDeploymentConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDeploymentGroup = "DeleteDeploymentGroup" @@ -1289,8 +1500,23 @@ func (c *CodeDeploy) DeleteDeploymentGroupRequest(input *DeleteDeploymentGroupIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentGroup func (c *CodeDeploy) DeleteDeploymentGroup(input *DeleteDeploymentGroupInput) (*DeleteDeploymentGroupOutput, error) { req, out := c.DeleteDeploymentGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDeploymentGroupWithContext is the same as DeleteDeploymentGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDeploymentGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDeploymentGroupWithContext(ctx aws.Context, input *DeleteDeploymentGroupInput, opts ...request.Option) (*DeleteDeploymentGroupOutput, error) { + req, out := c.DeleteDeploymentGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterOnPremisesInstance = "DeregisterOnPremisesInstance" @@ -1359,8 +1585,23 @@ func (c *CodeDeploy) DeregisterOnPremisesInstanceRequest(input *DeregisterOnPrem // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeregisterOnPremisesInstance func (c *CodeDeploy) DeregisterOnPremisesInstance(input *DeregisterOnPremisesInstanceInput) (*DeregisterOnPremisesInstanceOutput, error) { req, out := c.DeregisterOnPremisesInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterOnPremisesInstanceWithContext is the same as DeregisterOnPremisesInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterOnPremisesInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterOnPremisesInstanceWithContext(ctx aws.Context, input *DeregisterOnPremisesInstanceInput, opts ...request.Option) (*DeregisterOnPremisesInstanceOutput, error) { + req, out := c.DeregisterOnPremisesInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetApplication = "GetApplication" @@ -1430,8 +1671,23 @@ func (c *CodeDeploy) GetApplicationRequest(input *GetApplicationInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplication func (c *CodeDeploy) GetApplication(input *GetApplicationInput) (*GetApplicationOutput, error) { req, out := c.GetApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetApplicationWithContext is the same as GetApplication with the addition of +// the ability to pass a context and additional request options. +// +// See GetApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetApplicationWithContext(ctx aws.Context, input *GetApplicationInput, opts ...request.Option) (*GetApplicationOutput, error) { + req, out := c.GetApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetApplicationRevision = "GetApplicationRevision" @@ -1510,8 +1766,23 @@ func (c *CodeDeploy) GetApplicationRevisionRequest(input *GetApplicationRevision // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplicationRevision func (c *CodeDeploy) GetApplicationRevision(input *GetApplicationRevisionInput) (*GetApplicationRevisionOutput, error) { req, out := c.GetApplicationRevisionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetApplicationRevisionWithContext is the same as GetApplicationRevision with the addition of +// the ability to pass a context and additional request options. +// +// See GetApplicationRevision for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetApplicationRevisionWithContext(ctx aws.Context, input *GetApplicationRevisionInput, opts ...request.Option) (*GetApplicationRevisionOutput, error) { + req, out := c.GetApplicationRevisionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDeployment = "GetDeployment" @@ -1581,8 +1852,23 @@ func (c *CodeDeploy) GetDeploymentRequest(input *GetDeploymentInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeployment func (c *CodeDeploy) GetDeployment(input *GetDeploymentInput) (*GetDeploymentOutput, error) { req, out := c.GetDeploymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDeploymentWithContext is the same as GetDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDeploymentWithContext(ctx aws.Context, input *GetDeploymentInput, opts ...request.Option) (*GetDeploymentOutput, error) { + req, out := c.GetDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDeploymentConfig = "GetDeploymentConfig" @@ -1653,8 +1939,23 @@ func (c *CodeDeploy) GetDeploymentConfigRequest(input *GetDeploymentConfigInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentConfig func (c *CodeDeploy) GetDeploymentConfig(input *GetDeploymentConfigInput) (*GetDeploymentConfigOutput, error) { req, out := c.GetDeploymentConfigRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDeploymentConfigWithContext is the same as GetDeploymentConfig with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeploymentConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDeploymentConfigWithContext(ctx aws.Context, input *GetDeploymentConfigInput, opts ...request.Option) (*GetDeploymentConfigOutput, error) { + req, out := c.GetDeploymentConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDeploymentGroup = "GetDeploymentGroup" @@ -1734,8 +2035,23 @@ func (c *CodeDeploy) GetDeploymentGroupRequest(input *GetDeploymentGroupInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentGroup func (c *CodeDeploy) GetDeploymentGroup(input *GetDeploymentGroupInput) (*GetDeploymentGroupOutput, error) { req, out := c.GetDeploymentGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDeploymentGroupWithContext is the same as GetDeploymentGroup with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeploymentGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDeploymentGroupWithContext(ctx aws.Context, input *GetDeploymentGroupInput, opts ...request.Option) (*GetDeploymentGroupOutput, error) { + req, out := c.GetDeploymentGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDeploymentInstance = "GetDeploymentInstance" @@ -1814,8 +2130,23 @@ func (c *CodeDeploy) GetDeploymentInstanceRequest(input *GetDeploymentInstanceIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentInstance func (c *CodeDeploy) GetDeploymentInstance(input *GetDeploymentInstanceInput) (*GetDeploymentInstanceOutput, error) { req, out := c.GetDeploymentInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDeploymentInstanceWithContext is the same as GetDeploymentInstance with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeploymentInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDeploymentInstanceWithContext(ctx aws.Context, input *GetDeploymentInstanceInput, opts ...request.Option) (*GetDeploymentInstanceOutput, error) { + req, out := c.GetDeploymentInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetOnPremisesInstance = "GetOnPremisesInstance" @@ -1885,8 +2216,23 @@ func (c *CodeDeploy) GetOnPremisesInstanceRequest(input *GetOnPremisesInstanceIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetOnPremisesInstance func (c *CodeDeploy) GetOnPremisesInstance(input *GetOnPremisesInstanceInput) (*GetOnPremisesInstanceOutput, error) { req, out := c.GetOnPremisesInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetOnPremisesInstanceWithContext is the same as GetOnPremisesInstance with the addition of +// the ability to pass a context and additional request options. +// +// See GetOnPremisesInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetOnPremisesInstanceWithContext(ctx aws.Context, input *GetOnPremisesInstanceInput, opts ...request.Option) (*GetOnPremisesInstanceOutput, error) { + req, out := c.GetOnPremisesInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListApplicationRevisions = "ListApplicationRevisions" @@ -1984,8 +2330,23 @@ func (c *CodeDeploy) ListApplicationRevisionsRequest(input *ListApplicationRevis // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplicationRevisions func (c *CodeDeploy) ListApplicationRevisions(input *ListApplicationRevisionsInput) (*ListApplicationRevisionsOutput, error) { req, out := c.ListApplicationRevisionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListApplicationRevisionsWithContext is the same as ListApplicationRevisions with the addition of +// the ability to pass a context and additional request options. +// +// See ListApplicationRevisions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListApplicationRevisionsWithContext(ctx aws.Context, input *ListApplicationRevisionsInput, opts ...request.Option) (*ListApplicationRevisionsOutput, error) { + req, out := c.ListApplicationRevisionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListApplicationRevisionsPages iterates over the pages of a ListApplicationRevisions operation, @@ -2005,12 +2366,37 @@ func (c *CodeDeploy) ListApplicationRevisions(input *ListApplicationRevisionsInp // return pageNum <= 3 // }) // -func (c *CodeDeploy) ListApplicationRevisionsPages(input *ListApplicationRevisionsInput, fn func(p *ListApplicationRevisionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListApplicationRevisionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListApplicationRevisionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListApplicationRevisionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListApplicationRevisionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListApplicationRevisionsOutput), !p.HasNextPage()) + } + return p.Err() } const opListApplications = "ListApplications" @@ -2080,8 +2466,23 @@ func (c *CodeDeploy) ListApplicationsRequest(input *ListApplicationsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplications func (c *CodeDeploy) ListApplications(input *ListApplicationsInput) (*ListApplicationsOutput, error) { req, out := c.ListApplicationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListApplicationsWithContext is the same as ListApplications with the addition of +// the ability to pass a context and additional request options. +// +// See ListApplications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListApplicationsWithContext(ctx aws.Context, input *ListApplicationsInput, opts ...request.Option) (*ListApplicationsOutput, error) { + req, out := c.ListApplicationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListApplicationsPages iterates over the pages of a ListApplications operation, @@ -2101,12 +2502,37 @@ func (c *CodeDeploy) ListApplications(input *ListApplicationsInput) (*ListApplic // return pageNum <= 3 // }) // -func (c *CodeDeploy) ListApplicationsPages(input *ListApplicationsInput, fn func(p *ListApplicationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListApplicationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListApplicationsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListApplicationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListApplicationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) + } + return p.Err() } const opListDeploymentConfigs = "ListDeploymentConfigs" @@ -2176,8 +2602,23 @@ func (c *CodeDeploy) ListDeploymentConfigsRequest(input *ListDeploymentConfigsIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentConfigs func (c *CodeDeploy) ListDeploymentConfigs(input *ListDeploymentConfigsInput) (*ListDeploymentConfigsOutput, error) { req, out := c.ListDeploymentConfigsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDeploymentConfigsWithContext is the same as ListDeploymentConfigs with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeploymentConfigs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDeploymentConfigsWithContext(ctx aws.Context, input *ListDeploymentConfigsInput, opts ...request.Option) (*ListDeploymentConfigsOutput, error) { + req, out := c.ListDeploymentConfigsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListDeploymentConfigsPages iterates over the pages of a ListDeploymentConfigs operation, @@ -2197,12 +2638,37 @@ func (c *CodeDeploy) ListDeploymentConfigs(input *ListDeploymentConfigsInput) (* // return pageNum <= 3 // }) // -func (c *CodeDeploy) ListDeploymentConfigsPages(input *ListDeploymentConfigsInput, fn func(p *ListDeploymentConfigsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDeploymentConfigsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDeploymentConfigsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDeploymentConfigsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDeploymentConfigsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListDeploymentConfigsOutput), !p.HasNextPage()) + } + return p.Err() } const opListDeploymentGroups = "ListDeploymentGroups" @@ -2282,8 +2748,23 @@ func (c *CodeDeploy) ListDeploymentGroupsRequest(input *ListDeploymentGroupsInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentGroups func (c *CodeDeploy) ListDeploymentGroups(input *ListDeploymentGroupsInput) (*ListDeploymentGroupsOutput, error) { req, out := c.ListDeploymentGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDeploymentGroupsWithContext is the same as ListDeploymentGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeploymentGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDeploymentGroupsWithContext(ctx aws.Context, input *ListDeploymentGroupsInput, opts ...request.Option) (*ListDeploymentGroupsOutput, error) { + req, out := c.ListDeploymentGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListDeploymentGroupsPages iterates over the pages of a ListDeploymentGroups operation, @@ -2303,12 +2784,37 @@ func (c *CodeDeploy) ListDeploymentGroups(input *ListDeploymentGroupsInput) (*Li // return pageNum <= 3 // }) // -func (c *CodeDeploy) ListDeploymentGroupsPages(input *ListDeploymentGroupsInput, fn func(p *ListDeploymentGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDeploymentGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDeploymentGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDeploymentGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDeploymentGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListDeploymentGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opListDeploymentInstances = "ListDeploymentInstances" @@ -2399,8 +2905,23 @@ func (c *CodeDeploy) ListDeploymentInstancesRequest(input *ListDeploymentInstanc // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentInstances func (c *CodeDeploy) ListDeploymentInstances(input *ListDeploymentInstancesInput) (*ListDeploymentInstancesOutput, error) { req, out := c.ListDeploymentInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDeploymentInstancesWithContext is the same as ListDeploymentInstances with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeploymentInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDeploymentInstancesWithContext(ctx aws.Context, input *ListDeploymentInstancesInput, opts ...request.Option) (*ListDeploymentInstancesOutput, error) { + req, out := c.ListDeploymentInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListDeploymentInstancesPages iterates over the pages of a ListDeploymentInstances operation, @@ -2420,12 +2941,37 @@ func (c *CodeDeploy) ListDeploymentInstances(input *ListDeploymentInstancesInput // return pageNum <= 3 // }) // -func (c *CodeDeploy) ListDeploymentInstancesPages(input *ListDeploymentInstancesInput, fn func(p *ListDeploymentInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDeploymentInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDeploymentInstancesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDeploymentInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDeploymentInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListDeploymentInstancesOutput), !p.HasNextPage()) + } + return p.Err() } const opListDeployments = "ListDeployments" @@ -2521,8 +3067,23 @@ func (c *CodeDeploy) ListDeploymentsRequest(input *ListDeploymentsInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeployments func (c *CodeDeploy) ListDeployments(input *ListDeploymentsInput) (*ListDeploymentsOutput, error) { req, out := c.ListDeploymentsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDeploymentsWithContext is the same as ListDeployments with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeployments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDeploymentsWithContext(ctx aws.Context, input *ListDeploymentsInput, opts ...request.Option) (*ListDeploymentsOutput, error) { + req, out := c.ListDeploymentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListDeploymentsPages iterates over the pages of a ListDeployments operation, @@ -2542,12 +3103,37 @@ func (c *CodeDeploy) ListDeployments(input *ListDeploymentsInput) (*ListDeployme // return pageNum <= 3 // }) // -func (c *CodeDeploy) ListDeploymentsPages(input *ListDeploymentsInput, fn func(p *ListDeploymentsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDeploymentsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDeploymentsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDeploymentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDeploymentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListDeploymentsOutput), !p.HasNextPage()) + } + return p.Err() } const opListOnPremisesInstances = "ListOnPremisesInstances" @@ -2621,8 +3207,23 @@ func (c *CodeDeploy) ListOnPremisesInstancesRequest(input *ListOnPremisesInstanc // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListOnPremisesInstances func (c *CodeDeploy) ListOnPremisesInstances(input *ListOnPremisesInstancesInput) (*ListOnPremisesInstancesOutput, error) { req, out := c.ListOnPremisesInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListOnPremisesInstancesWithContext is the same as ListOnPremisesInstances with the addition of +// the ability to pass a context and additional request options. +// +// See ListOnPremisesInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListOnPremisesInstancesWithContext(ctx aws.Context, input *ListOnPremisesInstancesInput, opts ...request.Option) (*ListOnPremisesInstancesOutput, error) { + req, out := c.ListOnPremisesInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterApplicationRevision = "RegisterApplicationRevision" @@ -2703,8 +3304,23 @@ func (c *CodeDeploy) RegisterApplicationRevisionRequest(input *RegisterApplicati // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterApplicationRevision func (c *CodeDeploy) RegisterApplicationRevision(input *RegisterApplicationRevisionInput) (*RegisterApplicationRevisionOutput, error) { req, out := c.RegisterApplicationRevisionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterApplicationRevisionWithContext is the same as RegisterApplicationRevision with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterApplicationRevision for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterApplicationRevisionWithContext(ctx aws.Context, input *RegisterApplicationRevisionInput, opts ...request.Option) (*RegisterApplicationRevisionOutput, error) { + req, out := c.RegisterApplicationRevisionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterOnPremisesInstance = "RegisterOnPremisesInstance" @@ -2803,8 +3419,23 @@ func (c *CodeDeploy) RegisterOnPremisesInstanceRequest(input *RegisterOnPremises // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterOnPremisesInstance func (c *CodeDeploy) RegisterOnPremisesInstance(input *RegisterOnPremisesInstanceInput) (*RegisterOnPremisesInstanceOutput, error) { req, out := c.RegisterOnPremisesInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterOnPremisesInstanceWithContext is the same as RegisterOnPremisesInstance with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterOnPremisesInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterOnPremisesInstanceWithContext(ctx aws.Context, input *RegisterOnPremisesInstanceInput, opts ...request.Option) (*RegisterOnPremisesInstanceOutput, error) { + req, out := c.RegisterOnPremisesInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTagsFromOnPremisesInstances = "RemoveTagsFromOnPremisesInstances" @@ -2886,8 +3517,23 @@ func (c *CodeDeploy) RemoveTagsFromOnPremisesInstancesRequest(input *RemoveTagsF // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RemoveTagsFromOnPremisesInstances func (c *CodeDeploy) RemoveTagsFromOnPremisesInstances(input *RemoveTagsFromOnPremisesInstancesInput) (*RemoveTagsFromOnPremisesInstancesOutput, error) { req, out := c.RemoveTagsFromOnPremisesInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsFromOnPremisesInstancesWithContext is the same as RemoveTagsFromOnPremisesInstances with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTagsFromOnPremisesInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsFromOnPremisesInstancesWithContext(ctx aws.Context, input *RemoveTagsFromOnPremisesInstancesInput, opts ...request.Option) (*RemoveTagsFromOnPremisesInstancesOutput, error) { + req, out := c.RemoveTagsFromOnPremisesInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSkipWaitTimeForInstanceTermination = "SkipWaitTimeForInstanceTermination" @@ -2969,8 +3615,23 @@ func (c *CodeDeploy) SkipWaitTimeForInstanceTerminationRequest(input *SkipWaitTi // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/SkipWaitTimeForInstanceTermination func (c *CodeDeploy) SkipWaitTimeForInstanceTermination(input *SkipWaitTimeForInstanceTerminationInput) (*SkipWaitTimeForInstanceTerminationOutput, error) { req, out := c.SkipWaitTimeForInstanceTerminationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SkipWaitTimeForInstanceTerminationWithContext is the same as SkipWaitTimeForInstanceTermination with the addition of +// the ability to pass a context and additional request options. +// +// See SkipWaitTimeForInstanceTermination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SkipWaitTimeForInstanceTerminationWithContext(ctx aws.Context, input *SkipWaitTimeForInstanceTerminationInput, opts ...request.Option) (*SkipWaitTimeForInstanceTerminationOutput, error) { + req, out := c.SkipWaitTimeForInstanceTerminationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopDeployment = "StopDeployment" @@ -3043,8 +3704,23 @@ func (c *CodeDeploy) StopDeploymentRequest(input *StopDeploymentInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/StopDeployment func (c *CodeDeploy) StopDeployment(input *StopDeploymentInput) (*StopDeploymentOutput, error) { req, out := c.StopDeploymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopDeploymentWithContext is the same as StopDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See StopDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopDeploymentWithContext(ctx aws.Context, input *StopDeploymentInput, opts ...request.Option) (*StopDeploymentOutput, error) { + req, out := c.StopDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateApplication = "UpdateApplication" @@ -3120,8 +3796,23 @@ func (c *CodeDeploy) UpdateApplicationRequest(input *UpdateApplicationInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateApplication func (c *CodeDeploy) UpdateApplication(input *UpdateApplicationInput) (*UpdateApplicationOutput, error) { req, out := c.UpdateApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateApplicationWithContext is the same as UpdateApplication with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateApplicationWithContext(ctx aws.Context, input *UpdateApplicationInput, opts ...request.Option) (*UpdateApplicationOutput, error) { + req, out := c.UpdateApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDeploymentGroup = "UpdateDeploymentGroup" @@ -3269,8 +3960,23 @@ func (c *CodeDeploy) UpdateDeploymentGroupRequest(input *UpdateDeploymentGroupIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateDeploymentGroup func (c *CodeDeploy) UpdateDeploymentGroup(input *UpdateDeploymentGroupInput) (*UpdateDeploymentGroupOutput, error) { req, out := c.UpdateDeploymentGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDeploymentGroupWithContext is the same as UpdateDeploymentGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDeploymentGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateDeploymentGroupWithContext(ctx aws.Context, input *UpdateDeploymentGroupInput, opts ...request.Option) (*UpdateDeploymentGroupOutput, error) { + req, out := c.UpdateDeploymentGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Represents the input of, and adds tags to, an on-premises instance operation. diff --git a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/errors.go b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/errors.go index 6eebf7315..1f8c6a96d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package codedeploy diff --git a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/service.go b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/service.go index 5b20f2a45..87e026456 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package codedeploy diff --git a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/waiters.go index 3d605b11b..8b885e852 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package codedeploy import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilDeploymentSuccessful uses the CodeDeploy API operation @@ -11,36 +14,53 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *CodeDeploy) WaitUntilDeploymentSuccessful(input *GetDeploymentInput) error { - waiterCfg := waiter.Config{ - Operation: "GetDeployment", - Delay: 15, + return c.WaitUntilDeploymentSuccessfulWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilDeploymentSuccessfulWithContext is an extended version of WaitUntilDeploymentSuccessful. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilDeploymentSuccessfulWithContext(ctx aws.Context, input *GetDeploymentInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilDeploymentSuccessful", MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "deploymentInfo.status", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "deploymentInfo.status", Expected: "Succeeded", }, { - State: "failure", - Matcher: "path", - Argument: "deploymentInfo.status", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "deploymentInfo.status", Expected: "Failed", }, { - State: "failure", - Matcher: "path", - Argument: "deploymentInfo.status", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "deploymentInfo.status", Expected: "Stopped", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetDeploymentInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetDeploymentRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/api.go b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/api.go index 0320007aa..1e4ce3cc1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package codepipeline provides a client for AWS CodePipeline. package codepipeline @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -81,8 +82,23 @@ func (c *CodePipeline) AcknowledgeJobRequest(input *AcknowledgeJobInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeJob func (c *CodePipeline) AcknowledgeJob(input *AcknowledgeJobInput) (*AcknowledgeJobOutput, error) { req, out := c.AcknowledgeJobRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AcknowledgeJobWithContext is the same as AcknowledgeJob with the addition of +// the ability to pass a context and additional request options. +// +// See AcknowledgeJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) AcknowledgeJobWithContext(ctx aws.Context, input *AcknowledgeJobInput, opts ...request.Option) (*AcknowledgeJobOutput, error) { + req, out := c.AcknowledgeJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAcknowledgeThirdPartyJob = "AcknowledgeThirdPartyJob" @@ -156,8 +172,23 @@ func (c *CodePipeline) AcknowledgeThirdPartyJobRequest(input *AcknowledgeThirdPa // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeThirdPartyJob func (c *CodePipeline) AcknowledgeThirdPartyJob(input *AcknowledgeThirdPartyJobInput) (*AcknowledgeThirdPartyJobOutput, error) { req, out := c.AcknowledgeThirdPartyJobRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AcknowledgeThirdPartyJobWithContext is the same as AcknowledgeThirdPartyJob with the addition of +// the ability to pass a context and additional request options. +// +// See AcknowledgeThirdPartyJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) AcknowledgeThirdPartyJobWithContext(ctx aws.Context, input *AcknowledgeThirdPartyJobInput, opts ...request.Option) (*AcknowledgeThirdPartyJobOutput, error) { + req, out := c.AcknowledgeThirdPartyJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateCustomActionType = "CreateCustomActionType" @@ -226,8 +257,23 @@ func (c *CodePipeline) CreateCustomActionTypeRequest(input *CreateCustomActionTy // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreateCustomActionType func (c *CodePipeline) CreateCustomActionType(input *CreateCustomActionTypeInput) (*CreateCustomActionTypeOutput, error) { req, out := c.CreateCustomActionTypeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateCustomActionTypeWithContext is the same as CreateCustomActionType with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCustomActionType for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) CreateCustomActionTypeWithContext(ctx aws.Context, input *CreateCustomActionTypeInput, opts ...request.Option) (*CreateCustomActionTypeOutput, error) { + req, out := c.CreateCustomActionTypeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePipeline = "CreatePipeline" @@ -310,8 +356,23 @@ func (c *CodePipeline) CreatePipelineRequest(input *CreatePipelineInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreatePipeline func (c *CodePipeline) CreatePipeline(input *CreatePipelineInput) (*CreatePipelineOutput, error) { req, out := c.CreatePipelineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePipelineWithContext is the same as CreatePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) CreatePipelineWithContext(ctx aws.Context, input *CreatePipelineInput, opts ...request.Option) (*CreatePipelineOutput, error) { + req, out := c.CreatePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCustomActionType = "DeleteCustomActionType" @@ -381,8 +442,23 @@ func (c *CodePipeline) DeleteCustomActionTypeRequest(input *DeleteCustomActionTy // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeleteCustomActionType func (c *CodePipeline) DeleteCustomActionType(input *DeleteCustomActionTypeInput) (*DeleteCustomActionTypeOutput, error) { req, out := c.DeleteCustomActionTypeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteCustomActionTypeWithContext is the same as DeleteCustomActionType with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCustomActionType for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) DeleteCustomActionTypeWithContext(ctx aws.Context, input *DeleteCustomActionTypeInput, opts ...request.Option) (*DeleteCustomActionTypeOutput, error) { + req, out := c.DeleteCustomActionTypeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePipeline = "DeletePipeline" @@ -448,8 +524,23 @@ func (c *CodePipeline) DeletePipelineRequest(input *DeletePipelineInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeletePipeline func (c *CodePipeline) DeletePipeline(input *DeletePipelineInput) (*DeletePipelineOutput, error) { req, out := c.DeletePipelineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePipelineWithContext is the same as DeletePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) DeletePipelineWithContext(ctx aws.Context, input *DeletePipelineInput, opts ...request.Option) (*DeletePipelineOutput, error) { + req, out := c.DeletePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableStageTransition = "DisableStageTransition" @@ -522,8 +613,23 @@ func (c *CodePipeline) DisableStageTransitionRequest(input *DisableStageTransiti // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DisableStageTransition func (c *CodePipeline) DisableStageTransition(input *DisableStageTransitionInput) (*DisableStageTransitionOutput, error) { req, out := c.DisableStageTransitionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableStageTransitionWithContext is the same as DisableStageTransition with the addition of +// the ability to pass a context and additional request options. +// +// See DisableStageTransition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) DisableStageTransitionWithContext(ctx aws.Context, input *DisableStageTransitionInput, opts ...request.Option) (*DisableStageTransitionOutput, error) { + req, out := c.DisableStageTransitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableStageTransition = "EnableStageTransition" @@ -595,8 +701,23 @@ func (c *CodePipeline) EnableStageTransitionRequest(input *EnableStageTransition // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/EnableStageTransition func (c *CodePipeline) EnableStageTransition(input *EnableStageTransitionInput) (*EnableStageTransitionOutput, error) { req, out := c.EnableStageTransitionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableStageTransitionWithContext is the same as EnableStageTransition with the addition of +// the ability to pass a context and additional request options. +// +// See EnableStageTransition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) EnableStageTransitionWithContext(ctx aws.Context, input *EnableStageTransitionInput, opts ...request.Option) (*EnableStageTransitionOutput, error) { + req, out := c.EnableStageTransitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetJobDetails = "GetJobDetails" @@ -668,8 +789,23 @@ func (c *CodePipeline) GetJobDetailsRequest(input *GetJobDetailsInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetJobDetails func (c *CodePipeline) GetJobDetails(input *GetJobDetailsInput) (*GetJobDetailsOutput, error) { req, out := c.GetJobDetailsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetJobDetailsWithContext is the same as GetJobDetails with the addition of +// the ability to pass a context and additional request options. +// +// See GetJobDetails for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) GetJobDetailsWithContext(ctx aws.Context, input *GetJobDetailsInput, opts ...request.Option) (*GetJobDetailsOutput, error) { + req, out := c.GetJobDetailsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPipeline = "GetPipeline" @@ -742,8 +878,23 @@ func (c *CodePipeline) GetPipelineRequest(input *GetPipelineInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipeline func (c *CodePipeline) GetPipeline(input *GetPipelineInput) (*GetPipelineOutput, error) { req, out := c.GetPipelineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPipelineWithContext is the same as GetPipeline with the addition of +// the ability to pass a context and additional request options. +// +// See GetPipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) GetPipelineWithContext(ctx aws.Context, input *GetPipelineInput, opts ...request.Option) (*GetPipelineOutput, error) { + req, out := c.GetPipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPipelineExecution = "GetPipelineExecution" @@ -816,8 +967,23 @@ func (c *CodePipeline) GetPipelineExecutionRequest(input *GetPipelineExecutionIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineExecution func (c *CodePipeline) GetPipelineExecution(input *GetPipelineExecutionInput) (*GetPipelineExecutionOutput, error) { req, out := c.GetPipelineExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPipelineExecutionWithContext is the same as GetPipelineExecution with the addition of +// the ability to pass a context and additional request options. +// +// See GetPipelineExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) GetPipelineExecutionWithContext(ctx aws.Context, input *GetPipelineExecutionInput, opts ...request.Option) (*GetPipelineExecutionOutput, error) { + req, out := c.GetPipelineExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPipelineState = "GetPipelineState" @@ -885,8 +1051,23 @@ func (c *CodePipeline) GetPipelineStateRequest(input *GetPipelineStateInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineState func (c *CodePipeline) GetPipelineState(input *GetPipelineStateInput) (*GetPipelineStateOutput, error) { req, out := c.GetPipelineStateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPipelineStateWithContext is the same as GetPipelineState with the addition of +// the ability to pass a context and additional request options. +// +// See GetPipelineState for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) GetPipelineStateWithContext(ctx aws.Context, input *GetPipelineStateInput, opts ...request.Option) (*GetPipelineStateOutput, error) { + req, out := c.GetPipelineStateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetThirdPartyJobDetails = "GetThirdPartyJobDetails" @@ -965,8 +1146,23 @@ func (c *CodePipeline) GetThirdPartyJobDetailsRequest(input *GetThirdPartyJobDet // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetThirdPartyJobDetails func (c *CodePipeline) GetThirdPartyJobDetails(input *GetThirdPartyJobDetailsInput) (*GetThirdPartyJobDetailsOutput, error) { req, out := c.GetThirdPartyJobDetailsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetThirdPartyJobDetailsWithContext is the same as GetThirdPartyJobDetails with the addition of +// the ability to pass a context and additional request options. +// +// See GetThirdPartyJobDetails for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) GetThirdPartyJobDetailsWithContext(ctx aws.Context, input *GetThirdPartyJobDetailsInput, opts ...request.Option) (*GetThirdPartyJobDetailsOutput, error) { + req, out := c.GetThirdPartyJobDetailsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListActionTypes = "ListActionTypes" @@ -1035,8 +1231,23 @@ func (c *CodePipeline) ListActionTypesRequest(input *ListActionTypesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListActionTypes func (c *CodePipeline) ListActionTypes(input *ListActionTypesInput) (*ListActionTypesOutput, error) { req, out := c.ListActionTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListActionTypesWithContext is the same as ListActionTypes with the addition of +// the ability to pass a context and additional request options. +// +// See ListActionTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) ListActionTypesWithContext(ctx aws.Context, input *ListActionTypesInput, opts ...request.Option) (*ListActionTypesOutput, error) { + req, out := c.ListActionTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListPipelines = "ListPipelines" @@ -1101,8 +1312,23 @@ func (c *CodePipeline) ListPipelinesRequest(input *ListPipelinesInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelines func (c *CodePipeline) ListPipelines(input *ListPipelinesInput) (*ListPipelinesOutput, error) { req, out := c.ListPipelinesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPipelinesWithContext is the same as ListPipelines with the addition of +// the ability to pass a context and additional request options. +// +// See ListPipelines for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) ListPipelinesWithContext(ctx aws.Context, input *ListPipelinesInput, opts ...request.Option) (*ListPipelinesOutput, error) { + req, out := c.ListPipelinesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPollForJobs = "PollForJobs" @@ -1174,8 +1400,23 @@ func (c *CodePipeline) PollForJobsRequest(input *PollForJobsInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForJobs func (c *CodePipeline) PollForJobs(input *PollForJobsInput) (*PollForJobsOutput, error) { req, out := c.PollForJobsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PollForJobsWithContext is the same as PollForJobs with the addition of +// the ability to pass a context and additional request options. +// +// See PollForJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) PollForJobsWithContext(ctx aws.Context, input *PollForJobsInput, opts ...request.Option) (*PollForJobsOutput, error) { + req, out := c.PollForJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPollForThirdPartyJobs = "PollForThirdPartyJobs" @@ -1247,8 +1488,23 @@ func (c *CodePipeline) PollForThirdPartyJobsRequest(input *PollForThirdPartyJobs // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForThirdPartyJobs func (c *CodePipeline) PollForThirdPartyJobs(input *PollForThirdPartyJobsInput) (*PollForThirdPartyJobsOutput, error) { req, out := c.PollForThirdPartyJobsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PollForThirdPartyJobsWithContext is the same as PollForThirdPartyJobs with the addition of +// the ability to pass a context and additional request options. +// +// See PollForThirdPartyJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) PollForThirdPartyJobsWithContext(ctx aws.Context, input *PollForThirdPartyJobsInput, opts ...request.Option) (*PollForThirdPartyJobsOutput, error) { + req, out := c.PollForThirdPartyJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutActionRevision = "PutActionRevision" @@ -1321,8 +1577,23 @@ func (c *CodePipeline) PutActionRevisionRequest(input *PutActionRevisionInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutActionRevision func (c *CodePipeline) PutActionRevision(input *PutActionRevisionInput) (*PutActionRevisionOutput, error) { req, out := c.PutActionRevisionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutActionRevisionWithContext is the same as PutActionRevision with the addition of +// the ability to pass a context and additional request options. +// +// See PutActionRevision for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) PutActionRevisionWithContext(ctx aws.Context, input *PutActionRevisionInput, opts ...request.Option) (*PutActionRevisionOutput, error) { + req, out := c.PutActionRevisionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutApprovalResult = "PutApprovalResult" @@ -1402,8 +1673,23 @@ func (c *CodePipeline) PutApprovalResultRequest(input *PutApprovalResultInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutApprovalResult func (c *CodePipeline) PutApprovalResult(input *PutApprovalResultInput) (*PutApprovalResultOutput, error) { req, out := c.PutApprovalResultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutApprovalResultWithContext is the same as PutApprovalResult with the addition of +// the ability to pass a context and additional request options. +// +// See PutApprovalResult for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) PutApprovalResultWithContext(ctx aws.Context, input *PutApprovalResultInput, opts ...request.Option) (*PutApprovalResultOutput, error) { + req, out := c.PutApprovalResultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutJobFailureResult = "PutJobFailureResult" @@ -1476,8 +1762,23 @@ func (c *CodePipeline) PutJobFailureResultRequest(input *PutJobFailureResultInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobFailureResult func (c *CodePipeline) PutJobFailureResult(input *PutJobFailureResultInput) (*PutJobFailureResultOutput, error) { req, out := c.PutJobFailureResultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutJobFailureResultWithContext is the same as PutJobFailureResult with the addition of +// the ability to pass a context and additional request options. +// +// See PutJobFailureResult for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) PutJobFailureResultWithContext(ctx aws.Context, input *PutJobFailureResultInput, opts ...request.Option) (*PutJobFailureResultOutput, error) { + req, out := c.PutJobFailureResultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutJobSuccessResult = "PutJobSuccessResult" @@ -1550,8 +1851,23 @@ func (c *CodePipeline) PutJobSuccessResultRequest(input *PutJobSuccessResultInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobSuccessResult func (c *CodePipeline) PutJobSuccessResult(input *PutJobSuccessResultInput) (*PutJobSuccessResultOutput, error) { req, out := c.PutJobSuccessResultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutJobSuccessResultWithContext is the same as PutJobSuccessResult with the addition of +// the ability to pass a context and additional request options. +// +// See PutJobSuccessResult for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) PutJobSuccessResultWithContext(ctx aws.Context, input *PutJobSuccessResultInput, opts ...request.Option) (*PutJobSuccessResultOutput, error) { + req, out := c.PutJobSuccessResultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutThirdPartyJobFailureResult = "PutThirdPartyJobFailureResult" @@ -1627,8 +1943,23 @@ func (c *CodePipeline) PutThirdPartyJobFailureResultRequest(input *PutThirdParty // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobFailureResult func (c *CodePipeline) PutThirdPartyJobFailureResult(input *PutThirdPartyJobFailureResultInput) (*PutThirdPartyJobFailureResultOutput, error) { req, out := c.PutThirdPartyJobFailureResultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutThirdPartyJobFailureResultWithContext is the same as PutThirdPartyJobFailureResult with the addition of +// the ability to pass a context and additional request options. +// +// See PutThirdPartyJobFailureResult for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) PutThirdPartyJobFailureResultWithContext(ctx aws.Context, input *PutThirdPartyJobFailureResultInput, opts ...request.Option) (*PutThirdPartyJobFailureResultOutput, error) { + req, out := c.PutThirdPartyJobFailureResultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutThirdPartyJobSuccessResult = "PutThirdPartyJobSuccessResult" @@ -1704,8 +2035,23 @@ func (c *CodePipeline) PutThirdPartyJobSuccessResultRequest(input *PutThirdParty // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobSuccessResult func (c *CodePipeline) PutThirdPartyJobSuccessResult(input *PutThirdPartyJobSuccessResultInput) (*PutThirdPartyJobSuccessResultOutput, error) { req, out := c.PutThirdPartyJobSuccessResultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutThirdPartyJobSuccessResultWithContext is the same as PutThirdPartyJobSuccessResult with the addition of +// the ability to pass a context and additional request options. +// +// See PutThirdPartyJobSuccessResult for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) PutThirdPartyJobSuccessResultWithContext(ctx aws.Context, input *PutThirdPartyJobSuccessResultInput, opts ...request.Option) (*PutThirdPartyJobSuccessResultOutput, error) { + req, out := c.PutThirdPartyJobSuccessResultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRetryStageExecution = "RetryStageExecution" @@ -1785,8 +2131,23 @@ func (c *CodePipeline) RetryStageExecutionRequest(input *RetryStageExecutionInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/RetryStageExecution func (c *CodePipeline) RetryStageExecution(input *RetryStageExecutionInput) (*RetryStageExecutionOutput, error) { req, out := c.RetryStageExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RetryStageExecutionWithContext is the same as RetryStageExecution with the addition of +// the ability to pass a context and additional request options. +// +// See RetryStageExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) RetryStageExecutionWithContext(ctx aws.Context, input *RetryStageExecutionInput, opts ...request.Option) (*RetryStageExecutionOutput, error) { + req, out := c.RetryStageExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartPipelineExecution = "StartPipelineExecution" @@ -1854,8 +2215,23 @@ func (c *CodePipeline) StartPipelineExecutionRequest(input *StartPipelineExecuti // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StartPipelineExecution func (c *CodePipeline) StartPipelineExecution(input *StartPipelineExecutionInput) (*StartPipelineExecutionOutput, error) { req, out := c.StartPipelineExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartPipelineExecutionWithContext is the same as StartPipelineExecution with the addition of +// the ability to pass a context and additional request options. +// +// See StartPipelineExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) StartPipelineExecutionWithContext(ctx aws.Context, input *StartPipelineExecutionInput, opts ...request.Option) (*StartPipelineExecutionOutput, error) { + req, out := c.StartPipelineExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdatePipeline = "UpdatePipeline" @@ -1934,8 +2310,23 @@ func (c *CodePipeline) UpdatePipelineRequest(input *UpdatePipelineInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/UpdatePipeline func (c *CodePipeline) UpdatePipeline(input *UpdatePipelineInput) (*UpdatePipelineOutput, error) { req, out := c.UpdatePipelineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdatePipelineWithContext is the same as UpdatePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) UpdatePipelineWithContext(ctx aws.Context, input *UpdatePipelineInput, opts ...request.Option) (*UpdatePipelineOutput, error) { + req, out := c.UpdatePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Represents an AWS session credentials object. These credentials are temporary diff --git a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/errors.go b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/errors.go index 7e664c0e7..ca160b26a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package codepipeline diff --git a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/service.go b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/service.go index 960d8f52a..9f18b1d34 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package codepipeline diff --git a/vendor/github.com/aws/aws-sdk-go/service/configservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/configservice/api.go index c5b4467ce..02498a86d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/configservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/configservice/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package configservice provides a client for AWS Config. package configservice @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -87,8 +88,23 @@ func (c *ConfigService) DeleteConfigRuleRequest(input *DeleteConfigRuleInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigRule func (c *ConfigService) DeleteConfigRule(input *DeleteConfigRuleInput) (*DeleteConfigRuleOutput, error) { req, out := c.DeleteConfigRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteConfigRuleWithContext is the same as DeleteConfigRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteConfigRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteConfigRuleWithContext(ctx aws.Context, input *DeleteConfigRuleInput, opts ...request.Option) (*DeleteConfigRuleOutput, error) { + req, out := c.DeleteConfigRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteConfigurationRecorder = "DeleteConfigurationRecorder" @@ -163,8 +179,23 @@ func (c *ConfigService) DeleteConfigurationRecorderRequest(input *DeleteConfigur // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigurationRecorder func (c *ConfigService) DeleteConfigurationRecorder(input *DeleteConfigurationRecorderInput) (*DeleteConfigurationRecorderOutput, error) { req, out := c.DeleteConfigurationRecorderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteConfigurationRecorderWithContext is the same as DeleteConfigurationRecorder with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteConfigurationRecorder for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteConfigurationRecorderWithContext(ctx aws.Context, input *DeleteConfigurationRecorderInput, opts ...request.Option) (*DeleteConfigurationRecorderOutput, error) { + req, out := c.DeleteConfigurationRecorderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDeliveryChannel = "DeleteDeliveryChannel" @@ -237,8 +268,23 @@ func (c *ConfigService) DeleteDeliveryChannelRequest(input *DeleteDeliveryChanne // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteDeliveryChannel func (c *ConfigService) DeleteDeliveryChannel(input *DeleteDeliveryChannelInput) (*DeleteDeliveryChannelOutput, error) { req, out := c.DeleteDeliveryChannelRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDeliveryChannelWithContext is the same as DeleteDeliveryChannel with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDeliveryChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDeliveryChannelWithContext(ctx aws.Context, input *DeleteDeliveryChannelInput, opts ...request.Option) (*DeleteDeliveryChannelOutput, error) { + req, out := c.DeleteDeliveryChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteEvaluationResults = "DeleteEvaluationResults" @@ -310,8 +356,23 @@ func (c *ConfigService) DeleteEvaluationResultsRequest(input *DeleteEvaluationRe // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteEvaluationResults func (c *ConfigService) DeleteEvaluationResults(input *DeleteEvaluationResultsInput) (*DeleteEvaluationResultsOutput, error) { req, out := c.DeleteEvaluationResultsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteEvaluationResultsWithContext is the same as DeleteEvaluationResults with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteEvaluationResults for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteEvaluationResultsWithContext(ctx aws.Context, input *DeleteEvaluationResultsInput, opts ...request.Option) (*DeleteEvaluationResultsOutput, error) { + req, out := c.DeleteEvaluationResultsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeliverConfigSnapshot = "DeliverConfigSnapshot" @@ -391,8 +452,23 @@ func (c *ConfigService) DeliverConfigSnapshotRequest(input *DeliverConfigSnapsho // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeliverConfigSnapshot func (c *ConfigService) DeliverConfigSnapshot(input *DeliverConfigSnapshotInput) (*DeliverConfigSnapshotOutput, error) { req, out := c.DeliverConfigSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeliverConfigSnapshotWithContext is the same as DeliverConfigSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See DeliverConfigSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeliverConfigSnapshotWithContext(ctx aws.Context, input *DeliverConfigSnapshotInput, opts ...request.Option) (*DeliverConfigSnapshotOutput, error) { + req, out := c.DeliverConfigSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeComplianceByConfigRule = "DescribeComplianceByConfigRule" @@ -487,8 +563,23 @@ func (c *ConfigService) DescribeComplianceByConfigRuleRequest(input *DescribeCom // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByConfigRule func (c *ConfigService) DescribeComplianceByConfigRule(input *DescribeComplianceByConfigRuleInput) (*DescribeComplianceByConfigRuleOutput, error) { req, out := c.DescribeComplianceByConfigRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeComplianceByConfigRuleWithContext is the same as DescribeComplianceByConfigRule with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeComplianceByConfigRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeComplianceByConfigRuleWithContext(ctx aws.Context, input *DescribeComplianceByConfigRuleInput, opts ...request.Option) (*DescribeComplianceByConfigRuleOutput, error) { + req, out := c.DescribeComplianceByConfigRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeComplianceByResource = "DescribeComplianceByResource" @@ -581,8 +672,23 @@ func (c *ConfigService) DescribeComplianceByResourceRequest(input *DescribeCompl // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByResource func (c *ConfigService) DescribeComplianceByResource(input *DescribeComplianceByResourceInput) (*DescribeComplianceByResourceOutput, error) { req, out := c.DescribeComplianceByResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeComplianceByResourceWithContext is the same as DescribeComplianceByResource with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeComplianceByResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeComplianceByResourceWithContext(ctx aws.Context, input *DescribeComplianceByResourceInput, opts ...request.Option) (*DescribeComplianceByResourceOutput, error) { + req, out := c.DescribeComplianceByResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConfigRuleEvaluationStatus = "DescribeConfigRuleEvaluationStatus" @@ -658,8 +764,23 @@ func (c *ConfigService) DescribeConfigRuleEvaluationStatusRequest(input *Describ // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRuleEvaluationStatus func (c *ConfigService) DescribeConfigRuleEvaluationStatus(input *DescribeConfigRuleEvaluationStatusInput) (*DescribeConfigRuleEvaluationStatusOutput, error) { req, out := c.DescribeConfigRuleEvaluationStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConfigRuleEvaluationStatusWithContext is the same as DescribeConfigRuleEvaluationStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConfigRuleEvaluationStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConfigRuleEvaluationStatusWithContext(ctx aws.Context, input *DescribeConfigRuleEvaluationStatusInput, opts ...request.Option) (*DescribeConfigRuleEvaluationStatusOutput, error) { + req, out := c.DescribeConfigRuleEvaluationStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConfigRules = "DescribeConfigRules" @@ -728,8 +849,23 @@ func (c *ConfigService) DescribeConfigRulesRequest(input *DescribeConfigRulesInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRules func (c *ConfigService) DescribeConfigRules(input *DescribeConfigRulesInput) (*DescribeConfigRulesOutput, error) { req, out := c.DescribeConfigRulesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConfigRulesWithContext is the same as DescribeConfigRules with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConfigRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConfigRulesWithContext(ctx aws.Context, input *DescribeConfigRulesInput, opts ...request.Option) (*DescribeConfigRulesOutput, error) { + req, out := c.DescribeConfigRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConfigurationRecorderStatus = "DescribeConfigurationRecorderStatus" @@ -798,8 +934,23 @@ func (c *ConfigService) DescribeConfigurationRecorderStatusRequest(input *Descri // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorderStatus func (c *ConfigService) DescribeConfigurationRecorderStatus(input *DescribeConfigurationRecorderStatusInput) (*DescribeConfigurationRecorderStatusOutput, error) { req, out := c.DescribeConfigurationRecorderStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConfigurationRecorderStatusWithContext is the same as DescribeConfigurationRecorderStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConfigurationRecorderStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConfigurationRecorderStatusWithContext(ctx aws.Context, input *DescribeConfigurationRecorderStatusInput, opts ...request.Option) (*DescribeConfigurationRecorderStatusOutput, error) { + req, out := c.DescribeConfigurationRecorderStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConfigurationRecorders = "DescribeConfigurationRecorders" @@ -868,8 +1019,23 @@ func (c *ConfigService) DescribeConfigurationRecordersRequest(input *DescribeCon // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorders func (c *ConfigService) DescribeConfigurationRecorders(input *DescribeConfigurationRecordersInput) (*DescribeConfigurationRecordersOutput, error) { req, out := c.DescribeConfigurationRecordersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConfigurationRecordersWithContext is the same as DescribeConfigurationRecorders with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConfigurationRecorders for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConfigurationRecordersWithContext(ctx aws.Context, input *DescribeConfigurationRecordersInput, opts ...request.Option) (*DescribeConfigurationRecordersOutput, error) { + req, out := c.DescribeConfigurationRecordersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDeliveryChannelStatus = "DescribeDeliveryChannelStatus" @@ -937,8 +1103,23 @@ func (c *ConfigService) DescribeDeliveryChannelStatusRequest(input *DescribeDeli // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannelStatus func (c *ConfigService) DescribeDeliveryChannelStatus(input *DescribeDeliveryChannelStatusInput) (*DescribeDeliveryChannelStatusOutput, error) { req, out := c.DescribeDeliveryChannelStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDeliveryChannelStatusWithContext is the same as DescribeDeliveryChannelStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDeliveryChannelStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDeliveryChannelStatusWithContext(ctx aws.Context, input *DescribeDeliveryChannelStatusInput, opts ...request.Option) (*DescribeDeliveryChannelStatusOutput, error) { + req, out := c.DescribeDeliveryChannelStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDeliveryChannels = "DescribeDeliveryChannels" @@ -1006,8 +1187,23 @@ func (c *ConfigService) DescribeDeliveryChannelsRequest(input *DescribeDeliveryC // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannels func (c *ConfigService) DescribeDeliveryChannels(input *DescribeDeliveryChannelsInput) (*DescribeDeliveryChannelsOutput, error) { req, out := c.DescribeDeliveryChannelsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDeliveryChannelsWithContext is the same as DescribeDeliveryChannels with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDeliveryChannels for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDeliveryChannelsWithContext(ctx aws.Context, input *DescribeDeliveryChannelsInput, opts ...request.Option) (*DescribeDeliveryChannelsOutput, error) { + req, out := c.DescribeDeliveryChannelsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetComplianceDetailsByConfigRule = "GetComplianceDetailsByConfigRule" @@ -1082,8 +1278,23 @@ func (c *ConfigService) GetComplianceDetailsByConfigRuleRequest(input *GetCompli // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByConfigRule func (c *ConfigService) GetComplianceDetailsByConfigRule(input *GetComplianceDetailsByConfigRuleInput) (*GetComplianceDetailsByConfigRuleOutput, error) { req, out := c.GetComplianceDetailsByConfigRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetComplianceDetailsByConfigRuleWithContext is the same as GetComplianceDetailsByConfigRule with the addition of +// the ability to pass a context and additional request options. +// +// See GetComplianceDetailsByConfigRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetComplianceDetailsByConfigRuleWithContext(ctx aws.Context, input *GetComplianceDetailsByConfigRuleInput, opts ...request.Option) (*GetComplianceDetailsByConfigRuleOutput, error) { + req, out := c.GetComplianceDetailsByConfigRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetComplianceDetailsByResource = "GetComplianceDetailsByResource" @@ -1150,8 +1361,23 @@ func (c *ConfigService) GetComplianceDetailsByResourceRequest(input *GetComplian // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByResource func (c *ConfigService) GetComplianceDetailsByResource(input *GetComplianceDetailsByResourceInput) (*GetComplianceDetailsByResourceOutput, error) { req, out := c.GetComplianceDetailsByResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetComplianceDetailsByResourceWithContext is the same as GetComplianceDetailsByResource with the addition of +// the ability to pass a context and additional request options. +// +// See GetComplianceDetailsByResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetComplianceDetailsByResourceWithContext(ctx aws.Context, input *GetComplianceDetailsByResourceInput, opts ...request.Option) (*GetComplianceDetailsByResourceOutput, error) { + req, out := c.GetComplianceDetailsByResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetComplianceSummaryByConfigRule = "GetComplianceSummaryByConfigRule" @@ -1211,8 +1437,23 @@ func (c *ConfigService) GetComplianceSummaryByConfigRuleRequest(input *GetCompli // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByConfigRule func (c *ConfigService) GetComplianceSummaryByConfigRule(input *GetComplianceSummaryByConfigRuleInput) (*GetComplianceSummaryByConfigRuleOutput, error) { req, out := c.GetComplianceSummaryByConfigRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetComplianceSummaryByConfigRuleWithContext is the same as GetComplianceSummaryByConfigRule with the addition of +// the ability to pass a context and additional request options. +// +// See GetComplianceSummaryByConfigRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetComplianceSummaryByConfigRuleWithContext(ctx aws.Context, input *GetComplianceSummaryByConfigRuleInput, opts ...request.Option) (*GetComplianceSummaryByConfigRuleOutput, error) { + req, out := c.GetComplianceSummaryByConfigRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetComplianceSummaryByResourceType = "GetComplianceSummaryByResourceType" @@ -1279,8 +1520,23 @@ func (c *ConfigService) GetComplianceSummaryByResourceTypeRequest(input *GetComp // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByResourceType func (c *ConfigService) GetComplianceSummaryByResourceType(input *GetComplianceSummaryByResourceTypeInput) (*GetComplianceSummaryByResourceTypeOutput, error) { req, out := c.GetComplianceSummaryByResourceTypeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetComplianceSummaryByResourceTypeWithContext is the same as GetComplianceSummaryByResourceType with the addition of +// the ability to pass a context and additional request options. +// +// See GetComplianceSummaryByResourceType for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetComplianceSummaryByResourceTypeWithContext(ctx aws.Context, input *GetComplianceSummaryByResourceTypeInput, opts ...request.Option) (*GetComplianceSummaryByResourceTypeOutput, error) { + req, out := c.GetComplianceSummaryByResourceTypeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetResourceConfigHistory = "GetResourceConfigHistory" @@ -1380,8 +1636,23 @@ func (c *ConfigService) GetResourceConfigHistoryRequest(input *GetResourceConfig // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetResourceConfigHistory func (c *ConfigService) GetResourceConfigHistory(input *GetResourceConfigHistoryInput) (*GetResourceConfigHistoryOutput, error) { req, out := c.GetResourceConfigHistoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetResourceConfigHistoryWithContext is the same as GetResourceConfigHistory with the addition of +// the ability to pass a context and additional request options. +// +// See GetResourceConfigHistory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetResourceConfigHistoryWithContext(ctx aws.Context, input *GetResourceConfigHistoryInput, opts ...request.Option) (*GetResourceConfigHistoryOutput, error) { + req, out := c.GetResourceConfigHistoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetResourceConfigHistoryPages iterates over the pages of a GetResourceConfigHistory operation, @@ -1401,12 +1672,37 @@ func (c *ConfigService) GetResourceConfigHistory(input *GetResourceConfigHistory // return pageNum <= 3 // }) // -func (c *ConfigService) GetResourceConfigHistoryPages(input *GetResourceConfigHistoryInput, fn func(p *GetResourceConfigHistoryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetResourceConfigHistoryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetResourceConfigHistoryOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetResourceConfigHistoryInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetResourceConfigHistoryRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetResourceConfigHistoryOutput), !p.HasNextPage()) + } + return p.Err() } const opListDiscoveredResources = "ListDiscoveredResources" @@ -1494,8 +1790,23 @@ func (c *ConfigService) ListDiscoveredResourcesRequest(input *ListDiscoveredReso // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListDiscoveredResources func (c *ConfigService) ListDiscoveredResources(input *ListDiscoveredResourcesInput) (*ListDiscoveredResourcesOutput, error) { req, out := c.ListDiscoveredResourcesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDiscoveredResourcesWithContext is the same as ListDiscoveredResources with the addition of +// the ability to pass a context and additional request options. +// +// See ListDiscoveredResources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDiscoveredResourcesWithContext(ctx aws.Context, input *ListDiscoveredResourcesInput, opts ...request.Option) (*ListDiscoveredResourcesOutput, error) { + req, out := c.ListDiscoveredResourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutConfigRule = "PutConfigRule" @@ -1559,9 +1870,9 @@ func (c *ConfigService) PutConfigRuleRequest(input *PutConfigRuleInput) (req *re // the ARN for the SourceIdentifier key. This key is part of the Source object, // which is part of the ConfigRule object. // -// If you are adding a new AWS managed Config rule, specify the rule's identifier +// If you are adding an AWS managed Config rule, specify the rule's identifier // for the SourceIdentifier key. To reference AWS managed Config rule identifiers, -// see Using AWS Managed Config Rules (http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). +// see About AWS Managed Config Rules (http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). // // For any new rule that you add, specify the ConfigRuleName in the ConfigRule // object. Do not specify the ConfigRuleArn or the ConfigRuleId. These values @@ -1618,8 +1929,23 @@ func (c *ConfigService) PutConfigRuleRequest(input *PutConfigRuleInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigRule func (c *ConfigService) PutConfigRule(input *PutConfigRuleInput) (*PutConfigRuleOutput, error) { req, out := c.PutConfigRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutConfigRuleWithContext is the same as PutConfigRule with the addition of +// the ability to pass a context and additional request options. +// +// See PutConfigRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutConfigRuleWithContext(ctx aws.Context, input *PutConfigRuleInput, opts ...request.Option) (*PutConfigRuleOutput, error) { + req, out := c.PutConfigRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutConfigurationRecorder = "PutConfigurationRecorder" @@ -1705,8 +2031,23 @@ func (c *ConfigService) PutConfigurationRecorderRequest(input *PutConfigurationR // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationRecorder func (c *ConfigService) PutConfigurationRecorder(input *PutConfigurationRecorderInput) (*PutConfigurationRecorderOutput, error) { req, out := c.PutConfigurationRecorderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutConfigurationRecorderWithContext is the same as PutConfigurationRecorder with the addition of +// the ability to pass a context and additional request options. +// +// See PutConfigurationRecorder for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutConfigurationRecorderWithContext(ctx aws.Context, input *PutConfigurationRecorderInput, opts ...request.Option) (*PutConfigurationRecorderOutput, error) { + req, out := c.PutConfigurationRecorderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutDeliveryChannel = "PutDeliveryChannel" @@ -1804,8 +2145,23 @@ func (c *ConfigService) PutDeliveryChannelRequest(input *PutDeliveryChannelInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutDeliveryChannel func (c *ConfigService) PutDeliveryChannel(input *PutDeliveryChannelInput) (*PutDeliveryChannelOutput, error) { req, out := c.PutDeliveryChannelRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutDeliveryChannelWithContext is the same as PutDeliveryChannel with the addition of +// the ability to pass a context and additional request options. +// +// See PutDeliveryChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutDeliveryChannelWithContext(ctx aws.Context, input *PutDeliveryChannelInput, opts ...request.Option) (*PutDeliveryChannelOutput, error) { + req, out := c.PutDeliveryChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutEvaluations = "PutEvaluations" @@ -1879,8 +2235,23 @@ func (c *ConfigService) PutEvaluationsRequest(input *PutEvaluationsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutEvaluations func (c *ConfigService) PutEvaluations(input *PutEvaluationsInput) (*PutEvaluationsOutput, error) { req, out := c.PutEvaluationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutEvaluationsWithContext is the same as PutEvaluations with the addition of +// the ability to pass a context and additional request options. +// +// See PutEvaluations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutEvaluationsWithContext(ctx aws.Context, input *PutEvaluationsInput, opts ...request.Option) (*PutEvaluationsOutput, error) { + req, out := c.PutEvaluationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartConfigRulesEvaluation = "StartConfigRulesEvaluation" @@ -1986,8 +2357,23 @@ func (c *ConfigService) StartConfigRulesEvaluationRequest(input *StartConfigRule // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigRulesEvaluation func (c *ConfigService) StartConfigRulesEvaluation(input *StartConfigRulesEvaluationInput) (*StartConfigRulesEvaluationOutput, error) { req, out := c.StartConfigRulesEvaluationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartConfigRulesEvaluationWithContext is the same as StartConfigRulesEvaluation with the addition of +// the ability to pass a context and additional request options. +// +// See StartConfigRulesEvaluation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartConfigRulesEvaluationWithContext(ctx aws.Context, input *StartConfigRulesEvaluationInput, opts ...request.Option) (*StartConfigRulesEvaluationOutput, error) { + req, out := c.StartConfigRulesEvaluationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartConfigurationRecorder = "StartConfigurationRecorder" @@ -2060,8 +2446,23 @@ func (c *ConfigService) StartConfigurationRecorderRequest(input *StartConfigurat // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigurationRecorder func (c *ConfigService) StartConfigurationRecorder(input *StartConfigurationRecorderInput) (*StartConfigurationRecorderOutput, error) { req, out := c.StartConfigurationRecorderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartConfigurationRecorderWithContext is the same as StartConfigurationRecorder with the addition of +// the ability to pass a context and additional request options. +// +// See StartConfigurationRecorder for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartConfigurationRecorderWithContext(ctx aws.Context, input *StartConfigurationRecorderInput, opts ...request.Option) (*StartConfigurationRecorderOutput, error) { + req, out := c.StartConfigurationRecorderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopConfigurationRecorder = "StopConfigurationRecorder" @@ -2128,8 +2529,23 @@ func (c *ConfigService) StopConfigurationRecorderRequest(input *StopConfiguratio // Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StopConfigurationRecorder func (c *ConfigService) StopConfigurationRecorder(input *StopConfigurationRecorderInput) (*StopConfigurationRecorderOutput, error) { req, out := c.StopConfigurationRecorderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopConfigurationRecorderWithContext is the same as StopConfigurationRecorder with the addition of +// the ability to pass a context and additional request options. +// +// See StopConfigurationRecorder for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopConfigurationRecorderWithContext(ctx aws.Context, input *StopConfigurationRecorderInput, opts ...request.Option) (*StopConfigurationRecorderOutput, error) { + req, out := c.StopConfigurationRecorderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Indicates whether an AWS resource or AWS Config rule is compliant and provides @@ -2511,9 +2927,11 @@ type ConfigRule struct { // * You are using an AWS managed rule that is triggered at a periodic frequency. // // * Your custom rule is triggered when AWS Config delivers the configuration - // snapshot. + // snapshot. For more information, see ConfigSnapshotDeliveryProperties. // - // For more information, see ConfigSnapshotDeliveryProperties. + // By default, rules with a periodic trigger are evaluated every 24 hours. To + // change the frequency, specify a valid value for the MaximumExecutionFrequency + // parameter. MaximumExecutionFrequency *string `type:"string" enum:"MaximumExecutionFrequency"` // Defines which resources can trigger an evaluation for the rule. The scope @@ -3522,45 +3940,8 @@ func (s *DeliverConfigSnapshotOutput) SetConfigSnapshotId(v string) *DeliverConf type DeliveryChannel struct { _ struct{} `type:"structure"` - // Provides options for how often AWS Config delivers configuration snapshots - // to the Amazon S3 bucket in your delivery channel. - // - // If you want to create a rule that triggers evaluations for your resources - // when AWS Config delivers the configuration snapshot, see the following: - // - // The frequency for a rule that triggers evaluations for your resources when - // AWS Config delivers the configuration snapshot is set by one of two values, - // depending on which is less frequent: - // - // * The value for the deliveryFrequency parameter within the delivery channel - // configuration, which sets how often AWS Config delivers configuration - // snapshots. This value also sets how often AWS Config invokes evaluations - // for Config rules. - // - // * The value for the MaximumExecutionFrequency parameter, which sets the - // maximum frequency with which AWS Config invokes evaluations for the rule. - // For more information, see ConfigRule. - // - // If the deliveryFrequency value is less frequent than the MaximumExecutionFrequency - // value for a rule, AWS Config invokes the rule only as often as the deliveryFrequency - // value. - // - // For example, you want your rule to run evaluations when AWS Config delivers - // the configuration snapshot. - // - // You specify the MaximumExecutionFrequency value for Six_Hours. - // - // You then specify the delivery channel deliveryFrequency value for TwentyFour_Hours. - // - // Because the value for deliveryFrequency is less frequent than MaximumExecutionFrequency, - // AWS Config invokes evaluations for the rule every 24 hours. - // - // You should set the MaximumExecutionFrequency value to be at least as frequent - // as the deliveryFrequency value. You can view the deliveryFrequency value - // by using the DescribeDeliveryChannnels action. - // - // To update the deliveryFrequency with which AWS Config delivers your configuration - // snapshots, use the PutDeliveryChannel action. + // The options for how often AWS Config delivers configuration snapshots to + // the Amazon S3 bucket. ConfigSnapshotDeliveryProperties *ConfigSnapshotDeliveryProperties `locationName:"configSnapshotDeliveryProperties" type:"structure"` // The name of the delivery channel. By default, AWS Config assigns the name @@ -5124,20 +5505,7 @@ func (s *ListDiscoveredResourcesOutput) SetResourceIdentifiers(v []*ResourceIden type PutConfigRuleInput struct { _ struct{} `type:"structure"` - // An AWS Config rule represents an AWS Lambda function that you create for - // a custom rule or a predefined function for an AWS managed rule. The function - // evaluates configuration items to assess whether your AWS resources comply - // with your desired configurations. This function can run when AWS Config detects - // a configuration change to an AWS resource and at a periodic frequency that - // you choose (for example, every 24 hours). - // - // You can use the AWS CLI and AWS SDKs if you want to create a rule that triggers - // evaluations for your resources when AWS Config delivers the configuration - // snapshot. For more information, see ConfigSnapshotDeliveryProperties. - // - // For more information about developing and using AWS Config rules, see Evaluating - // AWS Resource Configurations with AWS Config (http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html) - // in the AWS Config Developer Guide. + // The rule that you want to add to your account. // // ConfigRule is a required field ConfigRule *ConfigRule `type:"structure" required:"true"` @@ -5790,9 +6158,13 @@ type SourceDetail struct { // to evaluate your AWS resources. EventSource *string `type:"string" enum:"EventSource"` - // The frequency that you want AWS Config to run evaluations for a rule that - // is triggered periodically. If you specify a value for MaximumExecutionFrequency, + // The frequency that you want AWS Config to run evaluations for a custom rule + // with a periodic trigger. If you specify a value for MaximumExecutionFrequency, // then MessageType must use the ScheduledNotification value. + // + // By default, rules with a periodic trigger are evaluated every 24 hours. To + // change the frequency, specify a valid value for the MaximumExecutionFrequency + // parameter. MaximumExecutionFrequency *string `type:"string" enum:"MaximumExecutionFrequency"` // The type of notification that triggers AWS Config to run an evaluation for diff --git a/vendor/github.com/aws/aws-sdk-go/service/configservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/configservice/errors.go index abe7294e3..cc1554087 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/configservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/configservice/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package configservice diff --git a/vendor/github.com/aws/aws-sdk-go/service/configservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/configservice/service.go index b27bfb5a5..4eefd3463 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/configservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/configservice/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package configservice diff --git a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/api.go index 06ceb9495..7dc62e751 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package databasemigrationservice provides a client for AWS Database Migration Service. package databasemigrationservice @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -75,8 +76,23 @@ func (c *DatabaseMigrationService) AddTagsToResourceRequest(input *AddTagsToReso // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/AddTagsToResource func (c *DatabaseMigrationService) AddTagsToResource(input *AddTagsToResourceInput) (*AddTagsToResourceOutput, error) { req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsToResourceWithContext is the same as AddTagsToResource with the addition of +// the ability to pass a context and additional request options. +// +// See AddTagsToResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsToResourceWithContext(ctx aws.Context, input *AddTagsToResourceInput, opts ...request.Option) (*AddTagsToResourceOutput, error) { + req, out := c.AddTagsToResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateEndpoint = "CreateEndpoint" @@ -156,8 +172,23 @@ func (c *DatabaseMigrationService) CreateEndpointRequest(input *CreateEndpointIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateEndpoint func (c *DatabaseMigrationService) CreateEndpoint(input *CreateEndpointInput) (*CreateEndpointOutput, error) { req, out := c.CreateEndpointRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateEndpointWithContext is the same as CreateEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See CreateEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateEndpointWithContext(ctx aws.Context, input *CreateEndpointInput, opts ...request.Option) (*CreateEndpointOutput, error) { + req, out := c.CreateEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateReplicationInstance = "CreateReplicationInstance" @@ -250,8 +281,23 @@ func (c *DatabaseMigrationService) CreateReplicationInstanceRequest(input *Creat // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationInstance func (c *DatabaseMigrationService) CreateReplicationInstance(input *CreateReplicationInstanceInput) (*CreateReplicationInstanceOutput, error) { req, out := c.CreateReplicationInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateReplicationInstanceWithContext is the same as CreateReplicationInstance with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReplicationInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateReplicationInstanceWithContext(ctx aws.Context, input *CreateReplicationInstanceInput, opts ...request.Option) (*CreateReplicationInstanceOutput, error) { + req, out := c.CreateReplicationInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateReplicationSubnetGroup = "CreateReplicationSubnetGroup" @@ -331,8 +377,23 @@ func (c *DatabaseMigrationService) CreateReplicationSubnetGroupRequest(input *Cr // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationSubnetGroup func (c *DatabaseMigrationService) CreateReplicationSubnetGroup(input *CreateReplicationSubnetGroupInput) (*CreateReplicationSubnetGroupOutput, error) { req, out := c.CreateReplicationSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateReplicationSubnetGroupWithContext is the same as CreateReplicationSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReplicationSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateReplicationSubnetGroupWithContext(ctx aws.Context, input *CreateReplicationSubnetGroupInput, opts ...request.Option) (*CreateReplicationSubnetGroupOutput, error) { + req, out := c.CreateReplicationSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateReplicationTask = "CreateReplicationTask" @@ -409,8 +470,23 @@ func (c *DatabaseMigrationService) CreateReplicationTaskRequest(input *CreateRep // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationTask func (c *DatabaseMigrationService) CreateReplicationTask(input *CreateReplicationTaskInput) (*CreateReplicationTaskOutput, error) { req, out := c.CreateReplicationTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateReplicationTaskWithContext is the same as CreateReplicationTask with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReplicationTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateReplicationTaskWithContext(ctx aws.Context, input *CreateReplicationTaskInput, opts ...request.Option) (*CreateReplicationTaskOutput, error) { + req, out := c.CreateReplicationTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCertificate = "DeleteCertificate" @@ -478,8 +554,23 @@ func (c *DatabaseMigrationService) DeleteCertificateRequest(input *DeleteCertifi // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteCertificate func (c *DatabaseMigrationService) DeleteCertificate(input *DeleteCertificateInput) (*DeleteCertificateOutput, error) { req, out := c.DeleteCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteCertificateWithContext is the same as DeleteCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteCertificateWithContext(ctx aws.Context, input *DeleteCertificateInput, opts ...request.Option) (*DeleteCertificateOutput, error) { + req, out := c.DeleteCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteEndpoint = "DeleteEndpoint" @@ -550,8 +641,23 @@ func (c *DatabaseMigrationService) DeleteEndpointRequest(input *DeleteEndpointIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteEndpoint func (c *DatabaseMigrationService) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) { req, out := c.DeleteEndpointRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteEndpointWithContext is the same as DeleteEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteEndpointWithContext(ctx aws.Context, input *DeleteEndpointInput, opts ...request.Option) (*DeleteEndpointOutput, error) { + req, out := c.DeleteEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteReplicationInstance = "DeleteReplicationInstance" @@ -622,8 +728,23 @@ func (c *DatabaseMigrationService) DeleteReplicationInstanceRequest(input *Delet // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationInstance func (c *DatabaseMigrationService) DeleteReplicationInstance(input *DeleteReplicationInstanceInput) (*DeleteReplicationInstanceOutput, error) { req, out := c.DeleteReplicationInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteReplicationInstanceWithContext is the same as DeleteReplicationInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteReplicationInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteReplicationInstanceWithContext(ctx aws.Context, input *DeleteReplicationInstanceInput, opts ...request.Option) (*DeleteReplicationInstanceOutput, error) { + req, out := c.DeleteReplicationInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteReplicationSubnetGroup = "DeleteReplicationSubnetGroup" @@ -691,8 +812,23 @@ func (c *DatabaseMigrationService) DeleteReplicationSubnetGroupRequest(input *De // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationSubnetGroup func (c *DatabaseMigrationService) DeleteReplicationSubnetGroup(input *DeleteReplicationSubnetGroupInput) (*DeleteReplicationSubnetGroupOutput, error) { req, out := c.DeleteReplicationSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteReplicationSubnetGroupWithContext is the same as DeleteReplicationSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteReplicationSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteReplicationSubnetGroupWithContext(ctx aws.Context, input *DeleteReplicationSubnetGroupInput, opts ...request.Option) (*DeleteReplicationSubnetGroupOutput, error) { + req, out := c.DeleteReplicationSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteReplicationTask = "DeleteReplicationTask" @@ -760,8 +896,23 @@ func (c *DatabaseMigrationService) DeleteReplicationTaskRequest(input *DeleteRep // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationTask func (c *DatabaseMigrationService) DeleteReplicationTask(input *DeleteReplicationTaskInput) (*DeleteReplicationTaskOutput, error) { req, out := c.DeleteReplicationTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteReplicationTaskWithContext is the same as DeleteReplicationTask with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteReplicationTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteReplicationTaskWithContext(ctx aws.Context, input *DeleteReplicationTaskInput, opts ...request.Option) (*DeleteReplicationTaskOutput, error) { + req, out := c.DeleteReplicationTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAccountAttributes = "DescribeAccountAttributes" @@ -825,8 +976,23 @@ func (c *DatabaseMigrationService) DescribeAccountAttributesRequest(input *Descr // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeAccountAttributes func (c *DatabaseMigrationService) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (*DescribeAccountAttributesOutput, error) { req, out := c.DescribeAccountAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAccountAttributesWithContext is the same as DescribeAccountAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAccountAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAccountAttributesWithContext(ctx aws.Context, input *DescribeAccountAttributesInput, opts ...request.Option) (*DescribeAccountAttributesOutput, error) { + req, out := c.DescribeAccountAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeCertificates = "DescribeCertificates" @@ -890,8 +1056,23 @@ func (c *DatabaseMigrationService) DescribeCertificatesRequest(input *DescribeCe // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeCertificates func (c *DatabaseMigrationService) DescribeCertificates(input *DescribeCertificatesInput) (*DescribeCertificatesOutput, error) { req, out := c.DescribeCertificatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCertificatesWithContext is the same as DescribeCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCertificatesWithContext(ctx aws.Context, input *DescribeCertificatesInput, opts ...request.Option) (*DescribeCertificatesOutput, error) { + req, out := c.DescribeCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConnections = "DescribeConnections" @@ -956,8 +1137,23 @@ func (c *DatabaseMigrationService) DescribeConnectionsRequest(input *DescribeCon // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeConnections func (c *DatabaseMigrationService) DescribeConnections(input *DescribeConnectionsInput) (*DescribeConnectionsOutput, error) { req, out := c.DescribeConnectionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConnectionsWithContext is the same as DescribeConnections with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConnections for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConnectionsWithContext(ctx aws.Context, input *DescribeConnectionsInput, opts ...request.Option) (*DescribeConnectionsOutput, error) { + req, out := c.DescribeConnectionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEndpointTypes = "DescribeEndpointTypes" @@ -1016,8 +1212,23 @@ func (c *DatabaseMigrationService) DescribeEndpointTypesRequest(input *DescribeE // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpointTypes func (c *DatabaseMigrationService) DescribeEndpointTypes(input *DescribeEndpointTypesInput) (*DescribeEndpointTypesOutput, error) { req, out := c.DescribeEndpointTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEndpointTypesWithContext is the same as DescribeEndpointTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEndpointTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEndpointTypesWithContext(ctx aws.Context, input *DescribeEndpointTypesInput, opts ...request.Option) (*DescribeEndpointTypesOutput, error) { + req, out := c.DescribeEndpointTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEndpoints = "DescribeEndpoints" @@ -1081,8 +1292,23 @@ func (c *DatabaseMigrationService) DescribeEndpointsRequest(input *DescribeEndpo // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpoints func (c *DatabaseMigrationService) DescribeEndpoints(input *DescribeEndpointsInput) (*DescribeEndpointsOutput, error) { req, out := c.DescribeEndpointsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEndpointsWithContext is the same as DescribeEndpoints with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEndpoints for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEndpointsWithContext(ctx aws.Context, input *DescribeEndpointsInput, opts ...request.Option) (*DescribeEndpointsOutput, error) { + req, out := c.DescribeEndpointsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeOrderableReplicationInstances = "DescribeOrderableReplicationInstances" @@ -1142,8 +1368,23 @@ func (c *DatabaseMigrationService) DescribeOrderableReplicationInstancesRequest( // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeOrderableReplicationInstances func (c *DatabaseMigrationService) DescribeOrderableReplicationInstances(input *DescribeOrderableReplicationInstancesInput) (*DescribeOrderableReplicationInstancesOutput, error) { req, out := c.DescribeOrderableReplicationInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeOrderableReplicationInstancesWithContext is the same as DescribeOrderableReplicationInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeOrderableReplicationInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeOrderableReplicationInstancesWithContext(ctx aws.Context, input *DescribeOrderableReplicationInstancesInput, opts ...request.Option) (*DescribeOrderableReplicationInstancesOutput, error) { + req, out := c.DescribeOrderableReplicationInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeRefreshSchemasStatus = "DescribeRefreshSchemasStatus" @@ -1211,8 +1452,23 @@ func (c *DatabaseMigrationService) DescribeRefreshSchemasStatusRequest(input *De // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeRefreshSchemasStatus func (c *DatabaseMigrationService) DescribeRefreshSchemasStatus(input *DescribeRefreshSchemasStatusInput) (*DescribeRefreshSchemasStatusOutput, error) { req, out := c.DescribeRefreshSchemasStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeRefreshSchemasStatusWithContext is the same as DescribeRefreshSchemasStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRefreshSchemasStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeRefreshSchemasStatusWithContext(ctx aws.Context, input *DescribeRefreshSchemasStatusInput, opts ...request.Option) (*DescribeRefreshSchemasStatusOutput, error) { + req, out := c.DescribeRefreshSchemasStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeReplicationInstances = "DescribeReplicationInstances" @@ -1277,8 +1533,23 @@ func (c *DatabaseMigrationService) DescribeReplicationInstancesRequest(input *De // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationInstances func (c *DatabaseMigrationService) DescribeReplicationInstances(input *DescribeReplicationInstancesInput) (*DescribeReplicationInstancesOutput, error) { req, out := c.DescribeReplicationInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReplicationInstancesWithContext is the same as DescribeReplicationInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReplicationInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReplicationInstancesWithContext(ctx aws.Context, input *DescribeReplicationInstancesInput, opts ...request.Option) (*DescribeReplicationInstancesOutput, error) { + req, out := c.DescribeReplicationInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeReplicationSubnetGroups = "DescribeReplicationSubnetGroups" @@ -1342,8 +1613,23 @@ func (c *DatabaseMigrationService) DescribeReplicationSubnetGroupsRequest(input // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationSubnetGroups func (c *DatabaseMigrationService) DescribeReplicationSubnetGroups(input *DescribeReplicationSubnetGroupsInput) (*DescribeReplicationSubnetGroupsOutput, error) { req, out := c.DescribeReplicationSubnetGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReplicationSubnetGroupsWithContext is the same as DescribeReplicationSubnetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReplicationSubnetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReplicationSubnetGroupsWithContext(ctx aws.Context, input *DescribeReplicationSubnetGroupsInput, opts ...request.Option) (*DescribeReplicationSubnetGroupsOutput, error) { + req, out := c.DescribeReplicationSubnetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeReplicationTasks = "DescribeReplicationTasks" @@ -1408,8 +1694,23 @@ func (c *DatabaseMigrationService) DescribeReplicationTasksRequest(input *Descri // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationTasks func (c *DatabaseMigrationService) DescribeReplicationTasks(input *DescribeReplicationTasksInput) (*DescribeReplicationTasksOutput, error) { req, out := c.DescribeReplicationTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReplicationTasksWithContext is the same as DescribeReplicationTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReplicationTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReplicationTasksWithContext(ctx aws.Context, input *DescribeReplicationTasksInput, opts ...request.Option) (*DescribeReplicationTasksOutput, error) { + req, out := c.DescribeReplicationTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSchemas = "DescribeSchemas" @@ -1477,8 +1778,23 @@ func (c *DatabaseMigrationService) DescribeSchemasRequest(input *DescribeSchemas // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeSchemas func (c *DatabaseMigrationService) DescribeSchemas(input *DescribeSchemasInput) (*DescribeSchemasOutput, error) { req, out := c.DescribeSchemasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSchemasWithContext is the same as DescribeSchemas with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSchemas for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSchemasWithContext(ctx aws.Context, input *DescribeSchemasInput, opts ...request.Option) (*DescribeSchemasOutput, error) { + req, out := c.DescribeSchemasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTableStatistics = "DescribeTableStatistics" @@ -1547,8 +1863,23 @@ func (c *DatabaseMigrationService) DescribeTableStatisticsRequest(input *Describ // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeTableStatistics func (c *DatabaseMigrationService) DescribeTableStatistics(input *DescribeTableStatisticsInput) (*DescribeTableStatisticsOutput, error) { req, out := c.DescribeTableStatisticsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTableStatisticsWithContext is the same as DescribeTableStatistics with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTableStatistics for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTableStatisticsWithContext(ctx aws.Context, input *DescribeTableStatisticsInput, opts ...request.Option) (*DescribeTableStatisticsOutput, error) { + req, out := c.DescribeTableStatisticsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportCertificate = "ImportCertificate" @@ -1615,8 +1946,23 @@ func (c *DatabaseMigrationService) ImportCertificateRequest(input *ImportCertifi // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ImportCertificate func (c *DatabaseMigrationService) ImportCertificate(input *ImportCertificateInput) (*ImportCertificateOutput, error) { req, out := c.ImportCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportCertificateWithContext is the same as ImportCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See ImportCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportCertificateWithContext(ctx aws.Context, input *ImportCertificateInput, opts ...request.Option) (*ImportCertificateOutput, error) { + req, out := c.ImportCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTagsForResource = "ListTagsForResource" @@ -1680,8 +2026,23 @@ func (c *DatabaseMigrationService) ListTagsForResourceRequest(input *ListTagsFor // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ListTagsForResource func (c *DatabaseMigrationService) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyEndpoint = "ModifyEndpoint" @@ -1755,8 +2116,23 @@ func (c *DatabaseMigrationService) ModifyEndpointRequest(input *ModifyEndpointIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyEndpoint func (c *DatabaseMigrationService) ModifyEndpoint(input *ModifyEndpointInput) (*ModifyEndpointOutput, error) { req, out := c.ModifyEndpointRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyEndpointWithContext is the same as ModifyEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyEndpointWithContext(ctx aws.Context, input *ModifyEndpointInput, opts ...request.Option) (*ModifyEndpointOutput, error) { + req, out := c.ModifyEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyReplicationInstance = "ModifyReplicationInstance" @@ -1840,8 +2216,23 @@ func (c *DatabaseMigrationService) ModifyReplicationInstanceRequest(input *Modif // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationInstance func (c *DatabaseMigrationService) ModifyReplicationInstance(input *ModifyReplicationInstanceInput) (*ModifyReplicationInstanceOutput, error) { req, out := c.ModifyReplicationInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyReplicationInstanceWithContext is the same as ModifyReplicationInstance with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyReplicationInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyReplicationInstanceWithContext(ctx aws.Context, input *ModifyReplicationInstanceInput, opts ...request.Option) (*ModifyReplicationInstanceOutput, error) { + req, out := c.ModifyReplicationInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyReplicationSubnetGroup = "ModifyReplicationSubnetGroup" @@ -1921,8 +2312,23 @@ func (c *DatabaseMigrationService) ModifyReplicationSubnetGroupRequest(input *Mo // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationSubnetGroup func (c *DatabaseMigrationService) ModifyReplicationSubnetGroup(input *ModifyReplicationSubnetGroupInput) (*ModifyReplicationSubnetGroupOutput, error) { req, out := c.ModifyReplicationSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyReplicationSubnetGroupWithContext is the same as ModifyReplicationSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyReplicationSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyReplicationSubnetGroupWithContext(ctx aws.Context, input *ModifyReplicationSubnetGroupInput, opts ...request.Option) (*ModifyReplicationSubnetGroupOutput, error) { + req, out := c.ModifyReplicationSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyReplicationTask = "ModifyReplicationTask" @@ -1999,8 +2405,23 @@ func (c *DatabaseMigrationService) ModifyReplicationTaskRequest(input *ModifyRep // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationTask func (c *DatabaseMigrationService) ModifyReplicationTask(input *ModifyReplicationTaskInput) (*ModifyReplicationTaskOutput, error) { req, out := c.ModifyReplicationTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyReplicationTaskWithContext is the same as ModifyReplicationTask with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyReplicationTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyReplicationTaskWithContext(ctx aws.Context, input *ModifyReplicationTaskInput, opts ...request.Option) (*ModifyReplicationTaskOutput, error) { + req, out := c.ModifyReplicationTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRefreshSchemas = "RefreshSchemas" @@ -2076,8 +2497,23 @@ func (c *DatabaseMigrationService) RefreshSchemasRequest(input *RefreshSchemasIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RefreshSchemas func (c *DatabaseMigrationService) RefreshSchemas(input *RefreshSchemasInput) (*RefreshSchemasOutput, error) { req, out := c.RefreshSchemasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RefreshSchemasWithContext is the same as RefreshSchemas with the addition of +// the ability to pass a context and additional request options. +// +// See RefreshSchemas for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RefreshSchemasWithContext(ctx aws.Context, input *RefreshSchemasInput, opts ...request.Option) (*RefreshSchemasOutput, error) { + req, out := c.RefreshSchemasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -2141,8 +2577,23 @@ func (c *DatabaseMigrationService) RemoveTagsFromResourceRequest(input *RemoveTa // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RemoveTagsFromResource func (c *DatabaseMigrationService) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*RemoveTagsFromResourceOutput, error) { req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsFromResourceWithContext is the same as RemoveTagsFromResource with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTagsFromResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsFromResourceWithContext(ctx aws.Context, input *RemoveTagsFromResourceInput, opts ...request.Option) (*RemoveTagsFromResourceOutput, error) { + req, out := c.RemoveTagsFromResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartReplicationTask = "StartReplicationTask" @@ -2210,8 +2661,23 @@ func (c *DatabaseMigrationService) StartReplicationTaskRequest(input *StartRepli // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StartReplicationTask func (c *DatabaseMigrationService) StartReplicationTask(input *StartReplicationTaskInput) (*StartReplicationTaskOutput, error) { req, out := c.StartReplicationTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartReplicationTaskWithContext is the same as StartReplicationTask with the addition of +// the ability to pass a context and additional request options. +// +// See StartReplicationTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartReplicationTaskWithContext(ctx aws.Context, input *StartReplicationTaskInput, opts ...request.Option) (*StartReplicationTaskOutput, error) { + req, out := c.StartReplicationTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopReplicationTask = "StopReplicationTask" @@ -2279,8 +2745,23 @@ func (c *DatabaseMigrationService) StopReplicationTaskRequest(input *StopReplica // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StopReplicationTask func (c *DatabaseMigrationService) StopReplicationTask(input *StopReplicationTaskInput) (*StopReplicationTaskOutput, error) { req, out := c.StopReplicationTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopReplicationTaskWithContext is the same as StopReplicationTask with the addition of +// the ability to pass a context and additional request options. +// +// See StopReplicationTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopReplicationTaskWithContext(ctx aws.Context, input *StopReplicationTaskInput, opts ...request.Option) (*StopReplicationTaskOutput, error) { + req, out := c.StopReplicationTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTestConnection = "TestConnection" @@ -2354,8 +2835,23 @@ func (c *DatabaseMigrationService) TestConnectionRequest(input *TestConnectionIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/TestConnection func (c *DatabaseMigrationService) TestConnection(input *TestConnectionInput) (*TestConnectionOutput, error) { req, out := c.TestConnectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TestConnectionWithContext is the same as TestConnection with the addition of +// the ability to pass a context and additional request options. +// +// See TestConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TestConnectionWithContext(ctx aws.Context, input *TestConnectionInput, opts ...request.Option) (*TestConnectionOutput, error) { + req, out := c.TestConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Describes a quota for an AWS account, for example, the number of replication diff --git a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/errors.go index 11d19d7a7..01d12048a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package databasemigrationservice diff --git a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/service.go index cbb36fd34..212f2fc40 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package databasemigrationservice diff --git a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/api.go index 436175a5a..3367557da 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package directoryservice provides a client for AWS Directory Service. package directoryservice @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -100,8 +101,23 @@ func (c *DirectoryService) AddIpRoutesRequest(input *AddIpRoutesInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddIpRoutes func (c *DirectoryService) AddIpRoutes(input *AddIpRoutesInput) (*AddIpRoutesOutput, error) { req, out := c.AddIpRoutesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddIpRoutesWithContext is the same as AddIpRoutes with the addition of +// the ability to pass a context and additional request options. +// +// See AddIpRoutes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddIpRoutesWithContext(ctx aws.Context, input *AddIpRoutesInput, opts ...request.Option) (*AddIpRoutesOutput, error) { + req, out := c.AddIpRoutesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAddTagsToResource = "AddTagsToResource" @@ -179,8 +195,23 @@ func (c *DirectoryService) AddTagsToResourceRequest(input *AddTagsToResourceInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddTagsToResource func (c *DirectoryService) AddTagsToResource(input *AddTagsToResourceInput) (*AddTagsToResourceOutput, error) { req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsToResourceWithContext is the same as AddTagsToResource with the addition of +// the ability to pass a context and additional request options. +// +// See AddTagsToResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsToResourceWithContext(ctx aws.Context, input *AddTagsToResourceInput, opts ...request.Option) (*AddTagsToResourceOutput, error) { + req, out := c.AddTagsToResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelSchemaExtension = "CancelSchemaExtension" @@ -253,8 +284,23 @@ func (c *DirectoryService) CancelSchemaExtensionRequest(input *CancelSchemaExten // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CancelSchemaExtension func (c *DirectoryService) CancelSchemaExtension(input *CancelSchemaExtensionInput) (*CancelSchemaExtensionOutput, error) { req, out := c.CancelSchemaExtensionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelSchemaExtensionWithContext is the same as CancelSchemaExtension with the addition of +// the ability to pass a context and additional request options. +// +// See CancelSchemaExtension for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelSchemaExtensionWithContext(ctx aws.Context, input *CancelSchemaExtensionInput, opts ...request.Option) (*CancelSchemaExtensionOutput, error) { + req, out := c.CancelSchemaExtensionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opConnectDirectory = "ConnectDirectory" @@ -334,8 +380,23 @@ func (c *DirectoryService) ConnectDirectoryRequest(input *ConnectDirectoryInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ConnectDirectory func (c *DirectoryService) ConnectDirectory(input *ConnectDirectoryInput) (*ConnectDirectoryOutput, error) { req, out := c.ConnectDirectoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ConnectDirectoryWithContext is the same as ConnectDirectory with the addition of +// the ability to pass a context and additional request options. +// +// See ConnectDirectory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ConnectDirectoryWithContext(ctx aws.Context, input *ConnectDirectoryInput, opts ...request.Option) (*ConnectDirectoryOutput, error) { + req, out := c.ConnectDirectoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAlias = "CreateAlias" @@ -416,8 +477,23 @@ func (c *DirectoryService) CreateAliasRequest(input *CreateAliasInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateAlias func (c *DirectoryService) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { req, out := c.CreateAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAliasWithContext is the same as CreateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAliasWithContext(ctx aws.Context, input *CreateAliasInput, opts ...request.Option) (*CreateAliasOutput, error) { + req, out := c.CreateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateComputer = "CreateComputer" @@ -503,8 +579,23 @@ func (c *DirectoryService) CreateComputerRequest(input *CreateComputerInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateComputer func (c *DirectoryService) CreateComputer(input *CreateComputerInput) (*CreateComputerOutput, error) { req, out := c.CreateComputerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateComputerWithContext is the same as CreateComputer with the addition of +// the ability to pass a context and additional request options. +// +// See CreateComputer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateComputerWithContext(ctx aws.Context, input *CreateComputerInput, opts ...request.Option) (*CreateComputerOutput, error) { + req, out := c.CreateComputerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateConditionalForwarder = "CreateConditionalForwarder" @@ -588,8 +679,23 @@ func (c *DirectoryService) CreateConditionalForwarderRequest(input *CreateCondit // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateConditionalForwarder func (c *DirectoryService) CreateConditionalForwarder(input *CreateConditionalForwarderInput) (*CreateConditionalForwarderOutput, error) { req, out := c.CreateConditionalForwarderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateConditionalForwarderWithContext is the same as CreateConditionalForwarder with the addition of +// the ability to pass a context and additional request options. +// +// See CreateConditionalForwarder for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateConditionalForwarderWithContext(ctx aws.Context, input *CreateConditionalForwarderInput, opts ...request.Option) (*CreateConditionalForwarderOutput, error) { + req, out := c.CreateConditionalForwarderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDirectory = "CreateDirectory" @@ -669,8 +775,23 @@ func (c *DirectoryService) CreateDirectoryRequest(input *CreateDirectoryInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateDirectory func (c *DirectoryService) CreateDirectory(input *CreateDirectoryInput) (*CreateDirectoryOutput, error) { req, out := c.CreateDirectoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDirectoryWithContext is the same as CreateDirectory with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDirectory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDirectoryWithContext(ctx aws.Context, input *CreateDirectoryInput, opts ...request.Option) (*CreateDirectoryOutput, error) { + req, out := c.CreateDirectoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateMicrosoftAD = "CreateMicrosoftAD" @@ -753,8 +874,23 @@ func (c *DirectoryService) CreateMicrosoftADRequest(input *CreateMicrosoftADInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateMicrosoftAD func (c *DirectoryService) CreateMicrosoftAD(input *CreateMicrosoftADInput) (*CreateMicrosoftADOutput, error) { req, out := c.CreateMicrosoftADRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateMicrosoftADWithContext is the same as CreateMicrosoftAD with the addition of +// the ability to pass a context and additional request options. +// +// See CreateMicrosoftAD for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateMicrosoftADWithContext(ctx aws.Context, input *CreateMicrosoftADInput, opts ...request.Option) (*CreateMicrosoftADOutput, error) { + req, out := c.CreateMicrosoftADRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSnapshot = "CreateSnapshot" @@ -834,8 +970,23 @@ func (c *DirectoryService) CreateSnapshotRequest(input *CreateSnapshotInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateSnapshot func (c *DirectoryService) CreateSnapshot(input *CreateSnapshotInput) (*CreateSnapshotOutput, error) { req, out := c.CreateSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSnapshotWithContext is the same as CreateSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotInput, opts ...request.Option) (*CreateSnapshotOutput, error) { + req, out := c.CreateSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTrust = "CreateTrust" @@ -921,8 +1072,23 @@ func (c *DirectoryService) CreateTrustRequest(input *CreateTrustInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateTrust func (c *DirectoryService) CreateTrust(input *CreateTrustInput) (*CreateTrustOutput, error) { req, out := c.CreateTrustRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTrustWithContext is the same as CreateTrust with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTrust for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTrustWithContext(ctx aws.Context, input *CreateTrustInput, opts ...request.Option) (*CreateTrustOutput, error) { + req, out := c.CreateTrustRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteConditionalForwarder = "DeleteConditionalForwarder" @@ -1001,8 +1167,23 @@ func (c *DirectoryService) DeleteConditionalForwarderRequest(input *DeleteCondit // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteConditionalForwarder func (c *DirectoryService) DeleteConditionalForwarder(input *DeleteConditionalForwarderInput) (*DeleteConditionalForwarderOutput, error) { req, out := c.DeleteConditionalForwarderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteConditionalForwarderWithContext is the same as DeleteConditionalForwarder with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteConditionalForwarder for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteConditionalForwarderWithContext(ctx aws.Context, input *DeleteConditionalForwarderInput, opts ...request.Option) (*DeleteConditionalForwarderOutput, error) { + req, out := c.DeleteConditionalForwarderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDirectory = "DeleteDirectory" @@ -1077,8 +1258,23 @@ func (c *DirectoryService) DeleteDirectoryRequest(input *DeleteDirectoryInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteDirectory func (c *DirectoryService) DeleteDirectory(input *DeleteDirectoryInput) (*DeleteDirectoryOutput, error) { req, out := c.DeleteDirectoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDirectoryWithContext is the same as DeleteDirectory with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDirectory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDirectoryWithContext(ctx aws.Context, input *DeleteDirectoryInput, opts ...request.Option) (*DeleteDirectoryOutput, error) { + req, out := c.DeleteDirectoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSnapshot = "DeleteSnapshot" @@ -1151,8 +1347,23 @@ func (c *DirectoryService) DeleteSnapshotRequest(input *DeleteSnapshotInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteSnapshot func (c *DirectoryService) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error) { req, out := c.DeleteSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSnapshotWithContext is the same as DeleteSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSnapshotWithContext(ctx aws.Context, input *DeleteSnapshotInput, opts ...request.Option) (*DeleteSnapshotOutput, error) { + req, out := c.DeleteSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTrust = "DeleteTrust" @@ -1229,8 +1440,23 @@ func (c *DirectoryService) DeleteTrustRequest(input *DeleteTrustInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteTrust func (c *DirectoryService) DeleteTrust(input *DeleteTrustInput) (*DeleteTrustOutput, error) { req, out := c.DeleteTrustRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTrustWithContext is the same as DeleteTrust with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTrust for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTrustWithContext(ctx aws.Context, input *DeleteTrustInput, opts ...request.Option) (*DeleteTrustOutput, error) { + req, out := c.DeleteTrustRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterEventTopic = "DeregisterEventTopic" @@ -1303,8 +1529,23 @@ func (c *DirectoryService) DeregisterEventTopicRequest(input *DeregisterEventTop // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeregisterEventTopic func (c *DirectoryService) DeregisterEventTopic(input *DeregisterEventTopicInput) (*DeregisterEventTopicOutput, error) { req, out := c.DeregisterEventTopicRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterEventTopicWithContext is the same as DeregisterEventTopic with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterEventTopic for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterEventTopicWithContext(ctx aws.Context, input *DeregisterEventTopicInput, opts ...request.Option) (*DeregisterEventTopicOutput, error) { + req, out := c.DeregisterEventTopicRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConditionalForwarders = "DescribeConditionalForwarders" @@ -1386,8 +1627,23 @@ func (c *DirectoryService) DescribeConditionalForwardersRequest(input *DescribeC // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeConditionalForwarders func (c *DirectoryService) DescribeConditionalForwarders(input *DescribeConditionalForwardersInput) (*DescribeConditionalForwardersOutput, error) { req, out := c.DescribeConditionalForwardersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConditionalForwardersWithContext is the same as DescribeConditionalForwarders with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConditionalForwarders for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConditionalForwardersWithContext(ctx aws.Context, input *DescribeConditionalForwardersInput, opts ...request.Option) (*DescribeConditionalForwardersOutput, error) { + req, out := c.DescribeConditionalForwardersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDirectories = "DescribeDirectories" @@ -1474,8 +1730,23 @@ func (c *DirectoryService) DescribeDirectoriesRequest(input *DescribeDirectories // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDirectories func (c *DirectoryService) DescribeDirectories(input *DescribeDirectoriesInput) (*DescribeDirectoriesOutput, error) { req, out := c.DescribeDirectoriesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDirectoriesWithContext is the same as DescribeDirectories with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDirectories for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDirectoriesWithContext(ctx aws.Context, input *DescribeDirectoriesInput, opts ...request.Option) (*DescribeDirectoriesOutput, error) { + req, out := c.DescribeDirectoriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEventTopics = "DescribeEventTopics" @@ -1552,8 +1823,23 @@ func (c *DirectoryService) DescribeEventTopicsRequest(input *DescribeEventTopics // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeEventTopics func (c *DirectoryService) DescribeEventTopics(input *DescribeEventTopicsInput) (*DescribeEventTopicsOutput, error) { req, out := c.DescribeEventTopicsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEventTopicsWithContext is the same as DescribeEventTopics with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEventTopics for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEventTopicsWithContext(ctx aws.Context, input *DescribeEventTopicsInput, opts ...request.Option) (*DescribeEventTopicsOutput, error) { + req, out := c.DescribeEventTopicsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSnapshots = "DescribeSnapshots" @@ -1636,8 +1922,23 @@ func (c *DirectoryService) DescribeSnapshotsRequest(input *DescribeSnapshotsInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeSnapshots func (c *DirectoryService) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error) { req, out := c.DescribeSnapshotsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSnapshotsWithContext is the same as DescribeSnapshots with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSnapshots for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSnapshotsWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.Option) (*DescribeSnapshotsOutput, error) { + req, out := c.DescribeSnapshotsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTrusts = "DescribeTrusts" @@ -1719,8 +2020,23 @@ func (c *DirectoryService) DescribeTrustsRequest(input *DescribeTrustsInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeTrusts func (c *DirectoryService) DescribeTrusts(input *DescribeTrustsInput) (*DescribeTrustsOutput, error) { req, out := c.DescribeTrustsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTrustsWithContext is the same as DescribeTrusts with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTrusts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTrustsWithContext(ctx aws.Context, input *DescribeTrustsInput, opts ...request.Option) (*DescribeTrustsOutput, error) { + req, out := c.DescribeTrustsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableRadius = "DisableRadius" @@ -1791,8 +2107,23 @@ func (c *DirectoryService) DisableRadiusRequest(input *DisableRadiusInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableRadius func (c *DirectoryService) DisableRadius(input *DisableRadiusInput) (*DisableRadiusOutput, error) { req, out := c.DisableRadiusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableRadiusWithContext is the same as DisableRadius with the addition of +// the ability to pass a context and additional request options. +// +// See DisableRadius for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableRadiusWithContext(ctx aws.Context, input *DisableRadiusInput, opts ...request.Option) (*DisableRadiusOutput, error) { + req, out := c.DisableRadiusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableSso = "DisableSso" @@ -1868,8 +2199,23 @@ func (c *DirectoryService) DisableSsoRequest(input *DisableSsoInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableSso func (c *DirectoryService) DisableSso(input *DisableSsoInput) (*DisableSsoOutput, error) { req, out := c.DisableSsoRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableSsoWithContext is the same as DisableSso with the addition of +// the ability to pass a context and additional request options. +// +// See DisableSso for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableSsoWithContext(ctx aws.Context, input *DisableSsoInput, opts ...request.Option) (*DisableSsoOutput, error) { + req, out := c.DisableSsoRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableRadius = "EnableRadius" @@ -1946,8 +2292,23 @@ func (c *DirectoryService) EnableRadiusRequest(input *EnableRadiusInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableRadius func (c *DirectoryService) EnableRadius(input *EnableRadiusInput) (*EnableRadiusOutput, error) { req, out := c.EnableRadiusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableRadiusWithContext is the same as EnableRadius with the addition of +// the ability to pass a context and additional request options. +// +// See EnableRadius for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableRadiusWithContext(ctx aws.Context, input *EnableRadiusInput, opts ...request.Option) (*EnableRadiusOutput, error) { + req, out := c.EnableRadiusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableSso = "EnableSso" @@ -2023,8 +2384,23 @@ func (c *DirectoryService) EnableSsoRequest(input *EnableSsoInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableSso func (c *DirectoryService) EnableSso(input *EnableSsoInput) (*EnableSsoOutput, error) { req, out := c.EnableSsoRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableSsoWithContext is the same as EnableSso with the addition of +// the ability to pass a context and additional request options. +// +// See EnableSso for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableSsoWithContext(ctx aws.Context, input *EnableSsoInput, opts ...request.Option) (*EnableSsoOutput, error) { + req, out := c.EnableSsoRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDirectoryLimits = "GetDirectoryLimits" @@ -2094,8 +2470,23 @@ func (c *DirectoryService) GetDirectoryLimitsRequest(input *GetDirectoryLimitsIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetDirectoryLimits func (c *DirectoryService) GetDirectoryLimits(input *GetDirectoryLimitsInput) (*GetDirectoryLimitsOutput, error) { req, out := c.GetDirectoryLimitsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDirectoryLimitsWithContext is the same as GetDirectoryLimits with the addition of +// the ability to pass a context and additional request options. +// +// See GetDirectoryLimits for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDirectoryLimitsWithContext(ctx aws.Context, input *GetDirectoryLimitsInput, opts ...request.Option) (*GetDirectoryLimitsOutput, error) { + req, out := c.GetDirectoryLimitsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSnapshotLimits = "GetSnapshotLimits" @@ -2165,8 +2556,23 @@ func (c *DirectoryService) GetSnapshotLimitsRequest(input *GetSnapshotLimitsInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetSnapshotLimits func (c *DirectoryService) GetSnapshotLimits(input *GetSnapshotLimitsInput) (*GetSnapshotLimitsOutput, error) { req, out := c.GetSnapshotLimitsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSnapshotLimitsWithContext is the same as GetSnapshotLimits with the addition of +// the ability to pass a context and additional request options. +// +// See GetSnapshotLimits for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSnapshotLimitsWithContext(ctx aws.Context, input *GetSnapshotLimitsInput, opts ...request.Option) (*GetSnapshotLimitsOutput, error) { + req, out := c.GetSnapshotLimitsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListIpRoutes = "ListIpRoutes" @@ -2242,8 +2648,23 @@ func (c *DirectoryService) ListIpRoutesRequest(input *ListIpRoutesInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListIpRoutes func (c *DirectoryService) ListIpRoutes(input *ListIpRoutesInput) (*ListIpRoutesOutput, error) { req, out := c.ListIpRoutesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListIpRoutesWithContext is the same as ListIpRoutes with the addition of +// the ability to pass a context and additional request options. +// +// See ListIpRoutes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListIpRoutesWithContext(ctx aws.Context, input *ListIpRoutesInput, opts ...request.Option) (*ListIpRoutesOutput, error) { + req, out := c.ListIpRoutesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListSchemaExtensions = "ListSchemaExtensions" @@ -2316,8 +2737,23 @@ func (c *DirectoryService) ListSchemaExtensionsRequest(input *ListSchemaExtensio // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListSchemaExtensions func (c *DirectoryService) ListSchemaExtensions(input *ListSchemaExtensionsInput) (*ListSchemaExtensionsOutput, error) { req, out := c.ListSchemaExtensionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListSchemaExtensionsWithContext is the same as ListSchemaExtensions with the addition of +// the ability to pass a context and additional request options. +// +// See ListSchemaExtensions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListSchemaExtensionsWithContext(ctx aws.Context, input *ListSchemaExtensionsInput, opts ...request.Option) (*ListSchemaExtensionsOutput, error) { + req, out := c.ListSchemaExtensionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTagsForResource = "ListTagsForResource" @@ -2393,8 +2829,23 @@ func (c *DirectoryService) ListTagsForResourceRequest(input *ListTagsForResource // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListTagsForResource func (c *DirectoryService) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterEventTopic = "RegisterEventTopic" @@ -2472,8 +2923,23 @@ func (c *DirectoryService) RegisterEventTopicRequest(input *RegisterEventTopicIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RegisterEventTopic func (c *DirectoryService) RegisterEventTopic(input *RegisterEventTopicInput) (*RegisterEventTopicOutput, error) { req, out := c.RegisterEventTopicRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterEventTopicWithContext is the same as RegisterEventTopic with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterEventTopic for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterEventTopicWithContext(ctx aws.Context, input *RegisterEventTopicInput, opts ...request.Option) (*RegisterEventTopicOutput, error) { + req, out := c.RegisterEventTopicRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveIpRoutes = "RemoveIpRoutes" @@ -2549,8 +3015,23 @@ func (c *DirectoryService) RemoveIpRoutesRequest(input *RemoveIpRoutesInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveIpRoutes func (c *DirectoryService) RemoveIpRoutes(input *RemoveIpRoutesInput) (*RemoveIpRoutesOutput, error) { req, out := c.RemoveIpRoutesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveIpRoutesWithContext is the same as RemoveIpRoutes with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveIpRoutes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveIpRoutesWithContext(ctx aws.Context, input *RemoveIpRoutesInput, opts ...request.Option) (*RemoveIpRoutesOutput, error) { + req, out := c.RemoveIpRoutesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -2623,8 +3104,23 @@ func (c *DirectoryService) RemoveTagsFromResourceRequest(input *RemoveTagsFromRe // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveTagsFromResource func (c *DirectoryService) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*RemoveTagsFromResourceOutput, error) { req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsFromResourceWithContext is the same as RemoveTagsFromResource with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTagsFromResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsFromResourceWithContext(ctx aws.Context, input *RemoveTagsFromResourceInput, opts ...request.Option) (*RemoveTagsFromResourceOutput, error) { + req, out := c.RemoveTagsFromResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreFromSnapshot = "RestoreFromSnapshot" @@ -2705,8 +3201,23 @@ func (c *DirectoryService) RestoreFromSnapshotRequest(input *RestoreFromSnapshot // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RestoreFromSnapshot func (c *DirectoryService) RestoreFromSnapshot(input *RestoreFromSnapshotInput) (*RestoreFromSnapshotOutput, error) { req, out := c.RestoreFromSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreFromSnapshotWithContext is the same as RestoreFromSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreFromSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreFromSnapshotWithContext(ctx aws.Context, input *RestoreFromSnapshotInput, opts ...request.Option) (*RestoreFromSnapshotOutput, error) { + req, out := c.RestoreFromSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartSchemaExtension = "StartSchemaExtension" @@ -2787,8 +3298,23 @@ func (c *DirectoryService) StartSchemaExtensionRequest(input *StartSchemaExtensi // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/StartSchemaExtension func (c *DirectoryService) StartSchemaExtension(input *StartSchemaExtensionInput) (*StartSchemaExtensionOutput, error) { req, out := c.StartSchemaExtensionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartSchemaExtensionWithContext is the same as StartSchemaExtension with the addition of +// the ability to pass a context and additional request options. +// +// See StartSchemaExtension for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartSchemaExtensionWithContext(ctx aws.Context, input *StartSchemaExtensionInput, opts ...request.Option) (*StartSchemaExtensionOutput, error) { + req, out := c.StartSchemaExtensionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateConditionalForwarder = "UpdateConditionalForwarder" @@ -2867,8 +3393,23 @@ func (c *DirectoryService) UpdateConditionalForwarderRequest(input *UpdateCondit // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateConditionalForwarder func (c *DirectoryService) UpdateConditionalForwarder(input *UpdateConditionalForwarderInput) (*UpdateConditionalForwarderOutput, error) { req, out := c.UpdateConditionalForwarderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateConditionalForwarderWithContext is the same as UpdateConditionalForwarder with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateConditionalForwarder for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateConditionalForwarderWithContext(ctx aws.Context, input *UpdateConditionalForwarderInput, opts ...request.Option) (*UpdateConditionalForwarderOutput, error) { + req, out := c.UpdateConditionalForwarderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateRadius = "UpdateRadius" @@ -2942,8 +3483,23 @@ func (c *DirectoryService) UpdateRadiusRequest(input *UpdateRadiusInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateRadius func (c *DirectoryService) UpdateRadius(input *UpdateRadiusInput) (*UpdateRadiusOutput, error) { req, out := c.UpdateRadiusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateRadiusWithContext is the same as UpdateRadius with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRadius for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateRadiusWithContext(ctx aws.Context, input *UpdateRadiusInput, opts ...request.Option) (*UpdateRadiusOutput, error) { + req, out := c.UpdateRadiusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opVerifyTrust = "VerifyTrust" @@ -3023,8 +3579,23 @@ func (c *DirectoryService) VerifyTrustRequest(input *VerifyTrustInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/VerifyTrust func (c *DirectoryService) VerifyTrust(input *VerifyTrustInput) (*VerifyTrustOutput, error) { req, out := c.VerifyTrustRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// VerifyTrustWithContext is the same as VerifyTrust with the addition of +// the ability to pass a context and additional request options. +// +// See VerifyTrust for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) VerifyTrustWithContext(ctx aws.Context, input *VerifyTrustInput, opts ...request.Option) (*VerifyTrustOutput, error) { + req, out := c.VerifyTrustRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddIpRoutesRequest diff --git a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/errors.go index d8d9fa52a..64ba6fd0a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package directoryservice diff --git a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/service.go index 950ed3bef..ba14d2cf0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package directoryservice diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go index 55dfb23c1..95b35ba4f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package dynamodb provides a client for Amazon DynamoDB. package dynamodb @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -140,8 +141,23 @@ func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItem func (c *DynamoDB) BatchGetItem(input *BatchGetItemInput) (*BatchGetItemOutput, error) { req, out := c.BatchGetItemRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetItemWithContext is the same as BatchGetItem with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetItem for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchGetItemWithContext(ctx aws.Context, input *BatchGetItemInput, opts ...request.Option) (*BatchGetItemOutput, error) { + req, out := c.BatchGetItemRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // BatchGetItemPages iterates over the pages of a BatchGetItem operation, @@ -161,12 +177,37 @@ func (c *DynamoDB) BatchGetItem(input *BatchGetItemInput) (*BatchGetItemOutput, // return pageNum <= 3 // }) // -func (c *DynamoDB) BatchGetItemPages(input *BatchGetItemInput, fn func(p *BatchGetItemOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.BatchGetItemRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*BatchGetItemOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *BatchGetItemInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.BatchGetItemRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*BatchGetItemOutput), !p.HasNextPage()) + } + return p.Err() } const opBatchWriteItem = "BatchWriteItem" @@ -314,8 +355,23 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItem func (c *DynamoDB) BatchWriteItem(input *BatchWriteItemInput) (*BatchWriteItemOutput, error) { req, out := c.BatchWriteItemRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchWriteItemWithContext is the same as BatchWriteItem with the addition of +// the ability to pass a context and additional request options. +// +// See BatchWriteItem for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchWriteItemWithContext(ctx aws.Context, input *BatchWriteItemInput, opts ...request.Option) (*BatchWriteItemOutput, error) { + req, out := c.BatchWriteItemRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTable = "CreateTable" @@ -408,8 +464,23 @@ func (c *DynamoDB) CreateTableRequest(input *CreateTableInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTable func (c *DynamoDB) CreateTable(input *CreateTableInput) (*CreateTableOutput, error) { req, out := c.CreateTableRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTableWithContext is the same as CreateTable with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTable for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTableWithContext(ctx aws.Context, input *CreateTableInput, opts ...request.Option) (*CreateTableOutput, error) { + req, out := c.CreateTableRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteItem = "DeleteItem" @@ -505,8 +576,23 @@ func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteItem func (c *DynamoDB) DeleteItem(input *DeleteItemInput) (*DeleteItemOutput, error) { req, out := c.DeleteItemRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteItemWithContext is the same as DeleteItem with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteItem for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteItemWithContext(ctx aws.Context, input *DeleteItemInput, opts ...request.Option) (*DeleteItemOutput, error) { + req, out := c.DeleteItemRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTable = "DeleteTable" @@ -606,8 +692,23 @@ func (c *DynamoDB) DeleteTableRequest(input *DeleteTableInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteTable func (c *DynamoDB) DeleteTable(input *DeleteTableInput) (*DeleteTableOutput, error) { req, out := c.DeleteTableRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTableWithContext is the same as DeleteTable with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTable for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTableWithContext(ctx aws.Context, input *DeleteTableInput, opts ...request.Option) (*DeleteTableOutput, error) { + req, out := c.DeleteTableRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLimits = "DescribeLimits" @@ -727,8 +828,23 @@ func (c *DynamoDB) DescribeLimitsRequest(input *DescribeLimitsInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeLimits func (c *DynamoDB) DescribeLimits(input *DescribeLimitsInput) (*DescribeLimitsOutput, error) { req, out := c.DescribeLimitsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLimitsWithContext is the same as DescribeLimits with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLimits for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLimitsWithContext(ctx aws.Context, input *DescribeLimitsInput, opts ...request.Option) (*DescribeLimitsOutput, error) { + req, out := c.DescribeLimitsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTable = "DescribeTable" @@ -804,8 +920,23 @@ func (c *DynamoDB) DescribeTableRequest(input *DescribeTableInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTable func (c *DynamoDB) DescribeTable(input *DescribeTableInput) (*DescribeTableOutput, error) { req, out := c.DescribeTableRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTableWithContext is the same as DescribeTable with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTable for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTableWithContext(ctx aws.Context, input *DescribeTableInput, opts ...request.Option) (*DescribeTableOutput, error) { + req, out := c.DescribeTableRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTimeToLive = "DescribeTimeToLive" @@ -873,8 +1004,23 @@ func (c *DynamoDB) DescribeTimeToLiveRequest(input *DescribeTimeToLiveInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLive func (c *DynamoDB) DescribeTimeToLive(input *DescribeTimeToLiveInput) (*DescribeTimeToLiveOutput, error) { req, out := c.DescribeTimeToLiveRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTimeToLiveWithContext is the same as DescribeTimeToLive with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTimeToLive for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTimeToLiveWithContext(ctx aws.Context, input *DescribeTimeToLiveInput, opts ...request.Option) (*DescribeTimeToLiveOutput, error) { + req, out := c.DescribeTimeToLiveRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetItem = "GetItem" @@ -957,8 +1103,23 @@ func (c *DynamoDB) GetItemRequest(input *GetItemInput) (req *request.Request, ou // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GetItem func (c *DynamoDB) GetItem(input *GetItemInput) (*GetItemOutput, error) { req, out := c.GetItemRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetItemWithContext is the same as GetItem with the addition of +// the ability to pass a context and additional request options. +// +// See GetItem for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetItemWithContext(ctx aws.Context, input *GetItemInput, opts ...request.Option) (*GetItemOutput, error) { + req, out := c.GetItemRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTables = "ListTables" @@ -1030,8 +1191,23 @@ func (c *DynamoDB) ListTablesRequest(input *ListTablesInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTables func (c *DynamoDB) ListTables(input *ListTablesInput) (*ListTablesOutput, error) { req, out := c.ListTablesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTablesWithContext is the same as ListTables with the addition of +// the ability to pass a context and additional request options. +// +// See ListTables for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTablesWithContext(ctx aws.Context, input *ListTablesInput, opts ...request.Option) (*ListTablesOutput, error) { + req, out := c.ListTablesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListTablesPages iterates over the pages of a ListTables operation, @@ -1051,12 +1227,37 @@ func (c *DynamoDB) ListTables(input *ListTablesInput) (*ListTablesOutput, error) // return pageNum <= 3 // }) // -func (c *DynamoDB) ListTablesPages(input *ListTablesInput, fn func(p *ListTablesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTablesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTablesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTablesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTablesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListTablesOutput), !p.HasNextPage()) + } + return p.Err() } const opListTagsOfResource = "ListTagsOfResource" @@ -1128,8 +1329,23 @@ func (c *DynamoDB) ListTagsOfResourceRequest(input *ListTagsOfResourceInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTagsOfResource func (c *DynamoDB) ListTagsOfResource(input *ListTagsOfResourceInput) (*ListTagsOfResourceOutput, error) { req, out := c.ListTagsOfResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsOfResourceWithContext is the same as ListTagsOfResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsOfResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsOfResourceWithContext(ctx aws.Context, input *ListTagsOfResourceInput, opts ...request.Option) (*ListTagsOfResourceOutput, error) { + req, out := c.ListTagsOfResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutItem = "PutItem" @@ -1234,8 +1450,23 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, ou // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutItem func (c *DynamoDB) PutItem(input *PutItemInput) (*PutItemOutput, error) { req, out := c.PutItemRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutItemWithContext is the same as PutItem with the addition of +// the ability to pass a context and additional request options. +// +// See PutItem for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutItemWithContext(ctx aws.Context, input *PutItemInput, opts ...request.Option) (*PutItemOutput, error) { + req, out := c.PutItemRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opQuery = "Query" @@ -1342,8 +1573,23 @@ func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Query func (c *DynamoDB) Query(input *QueryInput) (*QueryOutput, error) { req, out := c.QueryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// QueryWithContext is the same as Query with the addition of +// the ability to pass a context and additional request options. +// +// See Query for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) QueryWithContext(ctx aws.Context, input *QueryInput, opts ...request.Option) (*QueryOutput, error) { + req, out := c.QueryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // QueryPages iterates over the pages of a Query operation, @@ -1363,12 +1609,37 @@ func (c *DynamoDB) Query(input *QueryInput) (*QueryOutput, error) { // return pageNum <= 3 // }) // -func (c *DynamoDB) QueryPages(input *QueryInput, fn func(p *QueryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.QueryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*QueryOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *QueryInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.QueryRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*QueryOutput), !p.HasNextPage()) + } + return p.Err() } const opScan = "Scan" @@ -1470,8 +1741,23 @@ func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output * // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Scan func (c *DynamoDB) Scan(input *ScanInput) (*ScanOutput, error) { req, out := c.ScanRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ScanWithContext is the same as Scan with the addition of +// the ability to pass a context and additional request options. +// +// See Scan for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ScanWithContext(ctx aws.Context, input *ScanInput, opts ...request.Option) (*ScanOutput, error) { + req, out := c.ScanRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ScanPages iterates over the pages of a Scan operation, @@ -1491,12 +1777,37 @@ func (c *DynamoDB) Scan(input *ScanInput) (*ScanOutput, error) { // return pageNum <= 3 // }) // -func (c *DynamoDB) ScanPages(input *ScanInput, fn func(p *ScanOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ScanRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ScanOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ScanInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ScanRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ScanOutput), !p.HasNextPage()) + } + return p.Err() } const opTagResource = "TagResource" @@ -1587,8 +1898,23 @@ func (c *DynamoDB) TagResourceRequest(input *TagResourceInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TagResource func (c *DynamoDB) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { req, out := c.TagResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUntagResource = "UntagResource" @@ -1677,8 +2003,23 @@ func (c *DynamoDB) UntagResourceRequest(input *UntagResourceInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UntagResource func (c *DynamoDB) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { req, out := c.UntagResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateItem = "UpdateItem" @@ -1768,8 +2109,23 @@ func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateItem func (c *DynamoDB) UpdateItem(input *UpdateItemInput) (*UpdateItemOutput, error) { req, out := c.UpdateItemRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateItemWithContext is the same as UpdateItem with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateItem for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateItemWithContext(ctx aws.Context, input *UpdateItemInput, opts ...request.Option) (*UpdateItemOutput, error) { + req, out := c.UpdateItemRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateTable = "UpdateTable" @@ -1869,8 +2225,23 @@ func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTable func (c *DynamoDB) UpdateTable(input *UpdateTableInput) (*UpdateTableOutput, error) { req, out := c.UpdateTableRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateTableWithContext is the same as UpdateTable with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTable for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateTableWithContext(ctx aws.Context, input *UpdateTableInput, opts ...request.Option) (*UpdateTableOutput, error) { + req, out := c.UpdateTableRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateTimeToLive = "UpdateTimeToLive" @@ -1980,8 +2351,23 @@ func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLive func (c *DynamoDB) UpdateTimeToLive(input *UpdateTimeToLiveInput) (*UpdateTimeToLiveOutput, error) { req, out := c.UpdateTimeToLiveRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateTimeToLiveWithContext is the same as UpdateTimeToLive with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTimeToLive for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateTimeToLiveWithContext(ctx aws.Context, input *UpdateTimeToLiveInput, opts ...request.Option) (*UpdateTimeToLiveOutput, error) { + req, out := c.UpdateTimeToLiveRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Represents an attribute for describing the key schema for the table and indexes. diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go index 51843cd7a..333e61bfc 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go @@ -26,19 +26,30 @@ func (d retryer) RetryRules(r *request.Request) time.Duration { func init() { initClient = func(c *client.Client) { - r := retryer{} - if c.Config.MaxRetries == nil || aws.IntValue(c.Config.MaxRetries) == aws.UseServiceDefaultRetries { - r.NumMaxRetries = 10 - } else { - r.NumMaxRetries = *c.Config.MaxRetries + if c.Config.Retryer == nil { + // Only override the retryer with a custom one if the config + // does not already contain a retryer + setCustomRetryer(c) } - c.Retryer = r c.Handlers.Build.PushBack(disableCompression) c.Handlers.Unmarshal.PushFront(validateCRC32) } } +func setCustomRetryer(c *client.Client) { + maxRetries := aws.IntValue(c.Config.MaxRetries) + if c.Config.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { + maxRetries = 10 + } + + c.Retryer = retryer{ + DefaultRetryer: client.DefaultRetryer{ + NumMaxRetries: maxRetries, + }, + } +} + func drainBody(b io.ReadCloser, length int64) (out *bytes.Buffer, err error) { if length < 0 { length = 0 diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go index 05a9ee84c..d47a10486 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package dynamodb diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go index b8765f033..778276967 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package dynamodb diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go index 57e1264b7..07c75c428 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package dynamodb import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilTableExists uses the DynamoDB API operation @@ -11,32 +14,50 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *DynamoDB) WaitUntilTableExists(input *DescribeTableInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeTable", - Delay: 20, + return c.WaitUntilTableExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilTableExistsWithContext is an extended version of WaitUntilTableExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilTableExistsWithContext(ctx aws.Context, input *DescribeTableInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilTableExists", MaxAttempts: 25, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(20 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "Table.TableStatus", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Table.TableStatus", Expected: "ACTIVE", }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ResourceNotFoundException", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeTableInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTableRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilTableNotExists uses the DynamoDB API operation @@ -44,24 +65,43 @@ func (c *DynamoDB) WaitUntilTableExists(input *DescribeTableInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *DynamoDB) WaitUntilTableNotExists(input *DescribeTableInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeTable", - Delay: 20, + return c.WaitUntilTableNotExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilTableNotExistsWithContext is an extended version of WaitUntilTableNotExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilTableNotExistsWithContext(ctx aws.Context, input *DescribeTableInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilTableNotExists", MaxAttempts: 25, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(20 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ResourceNotFoundException", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeTableInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTableRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go index 83191e2d7..63e7dbc70 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package ec2 provides a client for Amazon Elastic Compute Cloud. package ec2 @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -70,8 +71,23 @@ func (c *EC2) AcceptReservedInstancesExchangeQuoteRequest(input *AcceptReservedI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptReservedInstancesExchangeQuote func (c *EC2) AcceptReservedInstancesExchangeQuote(input *AcceptReservedInstancesExchangeQuoteInput) (*AcceptReservedInstancesExchangeQuoteOutput, error) { req, out := c.AcceptReservedInstancesExchangeQuoteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AcceptReservedInstancesExchangeQuoteWithContext is the same as AcceptReservedInstancesExchangeQuote with the addition of +// the ability to pass a context and additional request options. +// +// See AcceptReservedInstancesExchangeQuote for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AcceptReservedInstancesExchangeQuoteWithContext(ctx aws.Context, input *AcceptReservedInstancesExchangeQuoteInput, opts ...request.Option) (*AcceptReservedInstancesExchangeQuoteOutput, error) { + req, out := c.AcceptReservedInstancesExchangeQuoteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAcceptVpcPeeringConnection = "AcceptVpcPeeringConnection" @@ -133,8 +149,23 @@ func (c *EC2) AcceptVpcPeeringConnectionRequest(input *AcceptVpcPeeringConnectio // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcPeeringConnection func (c *EC2) AcceptVpcPeeringConnection(input *AcceptVpcPeeringConnectionInput) (*AcceptVpcPeeringConnectionOutput, error) { req, out := c.AcceptVpcPeeringConnectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AcceptVpcPeeringConnectionWithContext is the same as AcceptVpcPeeringConnection with the addition of +// the ability to pass a context and additional request options. +// +// See AcceptVpcPeeringConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AcceptVpcPeeringConnectionWithContext(ctx aws.Context, input *AcceptVpcPeeringConnectionInput, opts ...request.Option) (*AcceptVpcPeeringConnectionOutput, error) { + req, out := c.AcceptVpcPeeringConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAllocateAddress = "AllocateAddress" @@ -197,8 +228,23 @@ func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateAddress func (c *EC2) AllocateAddress(input *AllocateAddressInput) (*AllocateAddressOutput, error) { req, out := c.AllocateAddressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AllocateAddressWithContext is the same as AllocateAddress with the addition of +// the ability to pass a context and additional request options. +// +// See AllocateAddress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AllocateAddressWithContext(ctx aws.Context, input *AllocateAddressInput, opts ...request.Option) (*AllocateAddressOutput, error) { + req, out := c.AllocateAddressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAllocateHosts = "AllocateHosts" @@ -259,8 +305,23 @@ func (c *EC2) AllocateHostsRequest(input *AllocateHostsInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateHosts func (c *EC2) AllocateHosts(input *AllocateHostsInput) (*AllocateHostsOutput, error) { req, out := c.AllocateHostsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AllocateHostsWithContext is the same as AllocateHosts with the addition of +// the ability to pass a context and additional request options. +// +// See AllocateHosts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AllocateHostsWithContext(ctx aws.Context, input *AllocateHostsInput, opts ...request.Option) (*AllocateHostsOutput, error) { + req, out := c.AllocateHostsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssignIpv6Addresses = "AssignIpv6Addresses" @@ -326,8 +387,23 @@ func (c *EC2) AssignIpv6AddressesRequest(input *AssignIpv6AddressesInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignIpv6Addresses func (c *EC2) AssignIpv6Addresses(input *AssignIpv6AddressesInput) (*AssignIpv6AddressesOutput, error) { req, out := c.AssignIpv6AddressesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssignIpv6AddressesWithContext is the same as AssignIpv6Addresses with the addition of +// the ability to pass a context and additional request options. +// +// See AssignIpv6Addresses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssignIpv6AddressesWithContext(ctx aws.Context, input *AssignIpv6AddressesInput, opts ...request.Option) (*AssignIpv6AddressesOutput, error) { + req, out := c.AssignIpv6AddressesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssignPrivateIpAddresses = "AssignPrivateIpAddresses" @@ -398,8 +474,23 @@ func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignPrivateIpAddresses func (c *EC2) AssignPrivateIpAddresses(input *AssignPrivateIpAddressesInput) (*AssignPrivateIpAddressesOutput, error) { req, out := c.AssignPrivateIpAddressesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssignPrivateIpAddressesWithContext is the same as AssignPrivateIpAddresses with the addition of +// the ability to pass a context and additional request options. +// +// See AssignPrivateIpAddresses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssignPrivateIpAddressesWithContext(ctx aws.Context, input *AssignPrivateIpAddressesInput, opts ...request.Option) (*AssignPrivateIpAddressesOutput, error) { + req, out := c.AssignPrivateIpAddressesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssociateAddress = "AssociateAddress" @@ -476,8 +567,23 @@ func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateAddress func (c *EC2) AssociateAddress(input *AssociateAddressInput) (*AssociateAddressOutput, error) { req, out := c.AssociateAddressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssociateAddressWithContext is the same as AssociateAddress with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateAddress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssociateAddressWithContext(ctx aws.Context, input *AssociateAddressInput, opts ...request.Option) (*AssociateAddressOutput, error) { + req, out := c.AssociateAddressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssociateDhcpOptions = "AssociateDhcpOptions" @@ -549,8 +655,23 @@ func (c *EC2) AssociateDhcpOptionsRequest(input *AssociateDhcpOptionsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateDhcpOptions func (c *EC2) AssociateDhcpOptions(input *AssociateDhcpOptionsInput) (*AssociateDhcpOptionsOutput, error) { req, out := c.AssociateDhcpOptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssociateDhcpOptionsWithContext is the same as AssociateDhcpOptions with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateDhcpOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssociateDhcpOptionsWithContext(ctx aws.Context, input *AssociateDhcpOptionsInput, opts ...request.Option) (*AssociateDhcpOptionsOutput, error) { + req, out := c.AssociateDhcpOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssociateIamInstanceProfile = "AssociateIamInstanceProfile" @@ -610,8 +731,23 @@ func (c *EC2) AssociateIamInstanceProfileRequest(input *AssociateIamInstanceProf // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfile func (c *EC2) AssociateIamInstanceProfile(input *AssociateIamInstanceProfileInput) (*AssociateIamInstanceProfileOutput, error) { req, out := c.AssociateIamInstanceProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssociateIamInstanceProfileWithContext is the same as AssociateIamInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateIamInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssociateIamInstanceProfileWithContext(ctx aws.Context, input *AssociateIamInstanceProfileInput, opts ...request.Option) (*AssociateIamInstanceProfileOutput, error) { + req, out := c.AssociateIamInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssociateRouteTable = "AssociateRouteTable" @@ -677,8 +813,23 @@ func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTable func (c *EC2) AssociateRouteTable(input *AssociateRouteTableInput) (*AssociateRouteTableOutput, error) { req, out := c.AssociateRouteTableRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssociateRouteTableWithContext is the same as AssociateRouteTable with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateRouteTable for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssociateRouteTableWithContext(ctx aws.Context, input *AssociateRouteTableInput, opts ...request.Option) (*AssociateRouteTableOutput, error) { + req, out := c.AssociateRouteTableRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssociateSubnetCidrBlock = "AssociateSubnetCidrBlock" @@ -739,8 +890,23 @@ func (c *EC2) AssociateSubnetCidrBlockRequest(input *AssociateSubnetCidrBlockInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateSubnetCidrBlock func (c *EC2) AssociateSubnetCidrBlock(input *AssociateSubnetCidrBlockInput) (*AssociateSubnetCidrBlockOutput, error) { req, out := c.AssociateSubnetCidrBlockRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssociateSubnetCidrBlockWithContext is the same as AssociateSubnetCidrBlock with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateSubnetCidrBlock for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssociateSubnetCidrBlockWithContext(ctx aws.Context, input *AssociateSubnetCidrBlockInput, opts ...request.Option) (*AssociateSubnetCidrBlockOutput, error) { + req, out := c.AssociateSubnetCidrBlockRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssociateVpcCidrBlock = "AssociateVpcCidrBlock" @@ -800,8 +966,23 @@ func (c *EC2) AssociateVpcCidrBlockRequest(input *AssociateVpcCidrBlockInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateVpcCidrBlock func (c *EC2) AssociateVpcCidrBlock(input *AssociateVpcCidrBlockInput) (*AssociateVpcCidrBlockOutput, error) { req, out := c.AssociateVpcCidrBlockRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssociateVpcCidrBlockWithContext is the same as AssociateVpcCidrBlock with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateVpcCidrBlock for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssociateVpcCidrBlockWithContext(ctx aws.Context, input *AssociateVpcCidrBlockInput, opts ...request.Option) (*AssociateVpcCidrBlockOutput, error) { + req, out := c.AssociateVpcCidrBlockRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachClassicLinkVpc = "AttachClassicLinkVpc" @@ -871,8 +1052,23 @@ func (c *EC2) AttachClassicLinkVpcRequest(input *AttachClassicLinkVpcInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachClassicLinkVpc func (c *EC2) AttachClassicLinkVpc(input *AttachClassicLinkVpcInput) (*AttachClassicLinkVpcOutput, error) { req, out := c.AttachClassicLinkVpcRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachClassicLinkVpcWithContext is the same as AttachClassicLinkVpc with the addition of +// the ability to pass a context and additional request options. +// +// See AttachClassicLinkVpc for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachClassicLinkVpcWithContext(ctx aws.Context, input *AttachClassicLinkVpcInput, opts ...request.Option) (*AttachClassicLinkVpcOutput, error) { + req, out := c.AttachClassicLinkVpcRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachInternetGateway = "AttachInternetGateway" @@ -935,8 +1131,23 @@ func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachInternetGateway func (c *EC2) AttachInternetGateway(input *AttachInternetGatewayInput) (*AttachInternetGatewayOutput, error) { req, out := c.AttachInternetGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachInternetGatewayWithContext is the same as AttachInternetGateway with the addition of +// the ability to pass a context and additional request options. +// +// See AttachInternetGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachInternetGatewayWithContext(ctx aws.Context, input *AttachInternetGatewayInput, opts ...request.Option) (*AttachInternetGatewayOutput, error) { + req, out := c.AttachInternetGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachNetworkInterface = "AttachNetworkInterface" @@ -995,8 +1206,23 @@ func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachNetworkInterface func (c *EC2) AttachNetworkInterface(input *AttachNetworkInterfaceInput) (*AttachNetworkInterfaceOutput, error) { req, out := c.AttachNetworkInterfaceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachNetworkInterfaceWithContext is the same as AttachNetworkInterface with the addition of +// the ability to pass a context and additional request options. +// +// See AttachNetworkInterface for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachNetworkInterfaceWithContext(ctx aws.Context, input *AttachNetworkInterfaceInput, opts ...request.Option) (*AttachNetworkInterfaceOutput, error) { + req, out := c.AttachNetworkInterfaceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachVolume = "AttachVolume" @@ -1084,8 +1310,23 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVolume func (c *EC2) AttachVolume(input *AttachVolumeInput) (*VolumeAttachment, error) { req, out := c.AttachVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachVolumeWithContext is the same as AttachVolume with the addition of +// the ability to pass a context and additional request options. +// +// See AttachVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachVolumeWithContext(ctx aws.Context, input *AttachVolumeInput, opts ...request.Option) (*VolumeAttachment, error) { + req, out := c.AttachVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachVpnGateway = "AttachVpnGateway" @@ -1133,8 +1374,11 @@ func (c *EC2) AttachVpnGatewayRequest(input *AttachVpnGatewayInput) (req *reques // AttachVpnGateway API operation for Amazon Elastic Compute Cloud. // -// Attaches a virtual private gateway to a VPC. For more information, see Adding -// a Hardware Virtual Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) +// Attaches a virtual private gateway to a VPC. You can attach one virtual private +// gateway to one VPC at a time. +// +// For more information, see Adding a Hardware Virtual Private Gateway to Your +// VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1146,8 +1390,23 @@ func (c *EC2) AttachVpnGatewayRequest(input *AttachVpnGatewayInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVpnGateway func (c *EC2) AttachVpnGateway(input *AttachVpnGatewayInput) (*AttachVpnGatewayOutput, error) { req, out := c.AttachVpnGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachVpnGatewayWithContext is the same as AttachVpnGateway with the addition of +// the ability to pass a context and additional request options. +// +// See AttachVpnGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachVpnGatewayWithContext(ctx aws.Context, input *AttachVpnGatewayInput, opts ...request.Option) (*AttachVpnGatewayOutput, error) { + req, out := c.AttachVpnGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAuthorizeSecurityGroupEgress = "AuthorizeSecurityGroupEgress" @@ -1224,8 +1483,23 @@ func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupE // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupEgress func (c *EC2) AuthorizeSecurityGroupEgress(input *AuthorizeSecurityGroupEgressInput) (*AuthorizeSecurityGroupEgressOutput, error) { req, out := c.AuthorizeSecurityGroupEgressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AuthorizeSecurityGroupEgressWithContext is the same as AuthorizeSecurityGroupEgress with the addition of +// the ability to pass a context and additional request options. +// +// See AuthorizeSecurityGroupEgress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AuthorizeSecurityGroupEgressWithContext(ctx aws.Context, input *AuthorizeSecurityGroupEgressInput, opts ...request.Option) (*AuthorizeSecurityGroupEgressOutput, error) { + req, out := c.AuthorizeSecurityGroupEgressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAuthorizeSecurityGroupIngress = "AuthorizeSecurityGroupIngress" @@ -1302,8 +1576,23 @@ func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroup // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupIngress func (c *EC2) AuthorizeSecurityGroupIngress(input *AuthorizeSecurityGroupIngressInput) (*AuthorizeSecurityGroupIngressOutput, error) { req, out := c.AuthorizeSecurityGroupIngressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AuthorizeSecurityGroupIngressWithContext is the same as AuthorizeSecurityGroupIngress with the addition of +// the ability to pass a context and additional request options. +// +// See AuthorizeSecurityGroupIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AuthorizeSecurityGroupIngressWithContext(ctx aws.Context, input *AuthorizeSecurityGroupIngressInput, opts ...request.Option) (*AuthorizeSecurityGroupIngressOutput, error) { + req, out := c.AuthorizeSecurityGroupIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBundleInstance = "BundleInstance" @@ -1370,8 +1659,23 @@ func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstance func (c *EC2) BundleInstance(input *BundleInstanceInput) (*BundleInstanceOutput, error) { req, out := c.BundleInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BundleInstanceWithContext is the same as BundleInstance with the addition of +// the ability to pass a context and additional request options. +// +// See BundleInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BundleInstanceWithContext(ctx aws.Context, input *BundleInstanceInput, opts ...request.Option) (*BundleInstanceOutput, error) { + req, out := c.BundleInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelBundleTask = "CancelBundleTask" @@ -1430,8 +1734,23 @@ func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelBundleTask func (c *EC2) CancelBundleTask(input *CancelBundleTaskInput) (*CancelBundleTaskOutput, error) { req, out := c.CancelBundleTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelBundleTaskWithContext is the same as CancelBundleTask with the addition of +// the ability to pass a context and additional request options. +// +// See CancelBundleTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelBundleTaskWithContext(ctx aws.Context, input *CancelBundleTaskInput, opts ...request.Option) (*CancelBundleTaskOutput, error) { + req, out := c.CancelBundleTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelConversionTask = "CancelConversionTask" @@ -1499,8 +1818,23 @@ func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelConversionTask func (c *EC2) CancelConversionTask(input *CancelConversionTaskInput) (*CancelConversionTaskOutput, error) { req, out := c.CancelConversionTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelConversionTaskWithContext is the same as CancelConversionTask with the addition of +// the ability to pass a context and additional request options. +// +// See CancelConversionTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelConversionTaskWithContext(ctx aws.Context, input *CancelConversionTaskInput, opts ...request.Option) (*CancelConversionTaskOutput, error) { + req, out := c.CancelConversionTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelExportTask = "CancelExportTask" @@ -1564,8 +1898,23 @@ func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelExportTask func (c *EC2) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) { req, out := c.CancelExportTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelExportTaskWithContext is the same as CancelExportTask with the addition of +// the ability to pass a context and additional request options. +// +// See CancelExportTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelExportTaskWithContext(ctx aws.Context, input *CancelExportTaskInput, opts ...request.Option) (*CancelExportTaskOutput, error) { + req, out := c.CancelExportTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelImportTask = "CancelImportTask" @@ -1624,8 +1973,23 @@ func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTask func (c *EC2) CancelImportTask(input *CancelImportTaskInput) (*CancelImportTaskOutput, error) { req, out := c.CancelImportTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelImportTaskWithContext is the same as CancelImportTask with the addition of +// the ability to pass a context and additional request options. +// +// See CancelImportTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelImportTaskWithContext(ctx aws.Context, input *CancelImportTaskInput, opts ...request.Option) (*CancelImportTaskOutput, error) { + req, out := c.CancelImportTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelReservedInstancesListing = "CancelReservedInstancesListing" @@ -1688,8 +2052,23 @@ func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstanc // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelReservedInstancesListing func (c *EC2) CancelReservedInstancesListing(input *CancelReservedInstancesListingInput) (*CancelReservedInstancesListingOutput, error) { req, out := c.CancelReservedInstancesListingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelReservedInstancesListingWithContext is the same as CancelReservedInstancesListing with the addition of +// the ability to pass a context and additional request options. +// +// See CancelReservedInstancesListing for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelReservedInstancesListingWithContext(ctx aws.Context, input *CancelReservedInstancesListingInput, opts ...request.Option) (*CancelReservedInstancesListingOutput, error) { + req, out := c.CancelReservedInstancesListingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelSpotFleetRequests = "CancelSpotFleetRequests" @@ -1755,8 +2134,23 @@ func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequests func (c *EC2) CancelSpotFleetRequests(input *CancelSpotFleetRequestsInput) (*CancelSpotFleetRequestsOutput, error) { req, out := c.CancelSpotFleetRequestsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelSpotFleetRequestsWithContext is the same as CancelSpotFleetRequests with the addition of +// the ability to pass a context and additional request options. +// +// See CancelSpotFleetRequests for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelSpotFleetRequestsWithContext(ctx aws.Context, input *CancelSpotFleetRequestsInput, opts ...request.Option) (*CancelSpotFleetRequestsOutput, error) { + req, out := c.CancelSpotFleetRequestsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelSpotInstanceRequests = "CancelSpotInstanceRequests" @@ -1823,8 +2217,23 @@ func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequest // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequests func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) (*CancelSpotInstanceRequestsOutput, error) { req, out := c.CancelSpotInstanceRequestsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelSpotInstanceRequestsWithContext is the same as CancelSpotInstanceRequests with the addition of +// the ability to pass a context and additional request options. +// +// See CancelSpotInstanceRequests for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelSpotInstanceRequestsWithContext(ctx aws.Context, input *CancelSpotInstanceRequestsInput, opts ...request.Option) (*CancelSpotInstanceRequestsOutput, error) { + req, out := c.CancelSpotInstanceRequestsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opConfirmProductInstance = "ConfirmProductInstance" @@ -1886,8 +2295,23 @@ func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConfirmProductInstance func (c *EC2) ConfirmProductInstance(input *ConfirmProductInstanceInput) (*ConfirmProductInstanceOutput, error) { req, out := c.ConfirmProductInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ConfirmProductInstanceWithContext is the same as ConfirmProductInstance with the addition of +// the ability to pass a context and additional request options. +// +// See ConfirmProductInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ConfirmProductInstanceWithContext(ctx aws.Context, input *ConfirmProductInstanceInput, opts ...request.Option) (*ConfirmProductInstanceOutput, error) { + req, out := c.ConfirmProductInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopyImage = "CopyImage" @@ -1951,8 +2375,23 @@ func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyImage func (c *EC2) CopyImage(input *CopyImageInput) (*CopyImageOutput, error) { req, out := c.CopyImageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopyImageWithContext is the same as CopyImage with the addition of +// the ability to pass a context and additional request options. +// +// See CopyImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopyImageWithContext(ctx aws.Context, input *CopyImageInput, opts ...request.Option) (*CopyImageOutput, error) { + req, out := c.CopyImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopySnapshot = "CopySnapshot" @@ -2030,8 +2469,23 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopySnapshot func (c *EC2) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error) { req, out := c.CopySnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopySnapshotWithContext is the same as CopySnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CopySnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopySnapshotWithContext(ctx aws.Context, input *CopySnapshotInput, opts ...request.Option) (*CopySnapshotOutput, error) { + req, out := c.CopySnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateCustomerGateway = "CreateCustomerGateway" @@ -2114,8 +2568,23 @@ func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGateway func (c *EC2) CreateCustomerGateway(input *CreateCustomerGatewayInput) (*CreateCustomerGatewayOutput, error) { req, out := c.CreateCustomerGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateCustomerGatewayWithContext is the same as CreateCustomerGateway with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCustomerGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateCustomerGatewayWithContext(ctx aws.Context, input *CreateCustomerGatewayInput, opts ...request.Option) (*CreateCustomerGatewayOutput, error) { + req, out := c.CreateCustomerGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDhcpOptions = "CreateDhcpOptions" @@ -2213,8 +2682,23 @@ func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptions func (c *EC2) CreateDhcpOptions(input *CreateDhcpOptionsInput) (*CreateDhcpOptionsOutput, error) { req, out := c.CreateDhcpOptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDhcpOptionsWithContext is the same as CreateDhcpOptions with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDhcpOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDhcpOptionsWithContext(ctx aws.Context, input *CreateDhcpOptionsInput, opts ...request.Option) (*CreateDhcpOptionsOutput, error) { + req, out := c.CreateDhcpOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateEgressOnlyInternetGateway = "CreateEgressOnlyInternetGateway" @@ -2276,8 +2760,23 @@ func (c *EC2) CreateEgressOnlyInternetGatewayRequest(input *CreateEgressOnlyInte // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateEgressOnlyInternetGateway func (c *EC2) CreateEgressOnlyInternetGateway(input *CreateEgressOnlyInternetGatewayInput) (*CreateEgressOnlyInternetGatewayOutput, error) { req, out := c.CreateEgressOnlyInternetGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateEgressOnlyInternetGatewayWithContext is the same as CreateEgressOnlyInternetGateway with the addition of +// the ability to pass a context and additional request options. +// +// See CreateEgressOnlyInternetGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateEgressOnlyInternetGatewayWithContext(ctx aws.Context, input *CreateEgressOnlyInternetGatewayInput, opts ...request.Option) (*CreateEgressOnlyInternetGatewayOutput, error) { + req, out := c.CreateEgressOnlyInternetGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateFlowLogs = "CreateFlowLogs" @@ -2345,8 +2844,23 @@ func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFlowLogs func (c *EC2) CreateFlowLogs(input *CreateFlowLogsInput) (*CreateFlowLogsOutput, error) { req, out := c.CreateFlowLogsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateFlowLogsWithContext is the same as CreateFlowLogs with the addition of +// the ability to pass a context and additional request options. +// +// See CreateFlowLogs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateFlowLogsWithContext(ctx aws.Context, input *CreateFlowLogsInput, opts ...request.Option) (*CreateFlowLogsOutput, error) { + req, out := c.CreateFlowLogsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateImage = "CreateImage" @@ -2414,8 +2928,23 @@ func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateImage func (c *EC2) CreateImage(input *CreateImageInput) (*CreateImageOutput, error) { req, out := c.CreateImageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateImageWithContext is the same as CreateImage with the addition of +// the ability to pass a context and additional request options. +// +// See CreateImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateImageWithContext(ctx aws.Context, input *CreateImageInput, opts ...request.Option) (*CreateImageOutput, error) { + req, out := c.CreateImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateInstanceExportTask = "CreateInstanceExportTask" @@ -2479,8 +3008,23 @@ func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceExportTask func (c *EC2) CreateInstanceExportTask(input *CreateInstanceExportTaskInput) (*CreateInstanceExportTaskOutput, error) { req, out := c.CreateInstanceExportTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateInstanceExportTaskWithContext is the same as CreateInstanceExportTask with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInstanceExportTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateInstanceExportTaskWithContext(ctx aws.Context, input *CreateInstanceExportTaskInput, opts ...request.Option) (*CreateInstanceExportTaskOutput, error) { + req, out := c.CreateInstanceExportTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateInternetGateway = "CreateInternetGateway" @@ -2543,8 +3087,23 @@ func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInternetGateway func (c *EC2) CreateInternetGateway(input *CreateInternetGatewayInput) (*CreateInternetGatewayOutput, error) { req, out := c.CreateInternetGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateInternetGatewayWithContext is the same as CreateInternetGateway with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInternetGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateInternetGatewayWithContext(ctx aws.Context, input *CreateInternetGatewayInput, opts ...request.Option) (*CreateInternetGatewayOutput, error) { + req, out := c.CreateInternetGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateKeyPair = "CreateKeyPair" @@ -2614,8 +3173,23 @@ func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateKeyPair func (c *EC2) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, error) { req, out := c.CreateKeyPairRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateKeyPairWithContext is the same as CreateKeyPair with the addition of +// the ability to pass a context and additional request options. +// +// See CreateKeyPair for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateKeyPairWithContext(ctx aws.Context, input *CreateKeyPairInput, opts ...request.Option) (*CreateKeyPairOutput, error) { + req, out := c.CreateKeyPairRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateNatGateway = "CreateNatGateway" @@ -2679,8 +3253,23 @@ func (c *EC2) CreateNatGatewayRequest(input *CreateNatGatewayInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGateway func (c *EC2) CreateNatGateway(input *CreateNatGatewayInput) (*CreateNatGatewayOutput, error) { req, out := c.CreateNatGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateNatGatewayWithContext is the same as CreateNatGateway with the addition of +// the ability to pass a context and additional request options. +// +// See CreateNatGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateNatGatewayWithContext(ctx aws.Context, input *CreateNatGatewayInput, opts ...request.Option) (*CreateNatGatewayOutput, error) { + req, out := c.CreateNatGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateNetworkAcl = "CreateNetworkAcl" @@ -2743,8 +3332,23 @@ func (c *EC2) CreateNetworkAclRequest(input *CreateNetworkAclInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAcl func (c *EC2) CreateNetworkAcl(input *CreateNetworkAclInput) (*CreateNetworkAclOutput, error) { req, out := c.CreateNetworkAclRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateNetworkAclWithContext is the same as CreateNetworkAcl with the addition of +// the ability to pass a context and additional request options. +// +// See CreateNetworkAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateNetworkAclWithContext(ctx aws.Context, input *CreateNetworkAclInput, opts ...request.Option) (*CreateNetworkAclOutput, error) { + req, out := c.CreateNetworkAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateNetworkAclEntry = "CreateNetworkAclEntry" @@ -2821,8 +3425,23 @@ func (c *EC2) CreateNetworkAclEntryRequest(input *CreateNetworkAclEntryInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclEntry func (c *EC2) CreateNetworkAclEntry(input *CreateNetworkAclEntryInput) (*CreateNetworkAclEntryOutput, error) { req, out := c.CreateNetworkAclEntryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateNetworkAclEntryWithContext is the same as CreateNetworkAclEntry with the addition of +// the ability to pass a context and additional request options. +// +// See CreateNetworkAclEntry for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateNetworkAclEntryWithContext(ctx aws.Context, input *CreateNetworkAclEntryInput, opts ...request.Option) (*CreateNetworkAclEntryOutput, error) { + req, out := c.CreateNetworkAclEntryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateNetworkInterface = "CreateNetworkInterface" @@ -2885,8 +3504,23 @@ func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterface func (c *EC2) CreateNetworkInterface(input *CreateNetworkInterfaceInput) (*CreateNetworkInterfaceOutput, error) { req, out := c.CreateNetworkInterfaceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateNetworkInterfaceWithContext is the same as CreateNetworkInterface with the addition of +// the ability to pass a context and additional request options. +// +// See CreateNetworkInterface for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateNetworkInterfaceWithContext(ctx aws.Context, input *CreateNetworkInterfaceInput, opts ...request.Option) (*CreateNetworkInterfaceOutput, error) { + req, out := c.CreateNetworkInterfaceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePlacementGroup = "CreatePlacementGroup" @@ -2952,8 +3586,23 @@ func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreatePlacementGroup func (c *EC2) CreatePlacementGroup(input *CreatePlacementGroupInput) (*CreatePlacementGroupOutput, error) { req, out := c.CreatePlacementGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePlacementGroupWithContext is the same as CreatePlacementGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePlacementGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreatePlacementGroupWithContext(ctx aws.Context, input *CreatePlacementGroupInput, opts ...request.Option) (*CreatePlacementGroupOutput, error) { + req, out := c.CreatePlacementGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateReservedInstancesListing = "CreateReservedInstancesListing" @@ -3035,8 +3684,23 @@ func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstanc // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReservedInstancesListing func (c *EC2) CreateReservedInstancesListing(input *CreateReservedInstancesListingInput) (*CreateReservedInstancesListingOutput, error) { req, out := c.CreateReservedInstancesListingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateReservedInstancesListingWithContext is the same as CreateReservedInstancesListing with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReservedInstancesListing for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateReservedInstancesListingWithContext(ctx aws.Context, input *CreateReservedInstancesListingInput, opts ...request.Option) (*CreateReservedInstancesListingOutput, error) { + req, out := c.CreateReservedInstancesListingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateRoute = "CreateRoute" @@ -3114,8 +3778,23 @@ func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRoute func (c *EC2) CreateRoute(input *CreateRouteInput) (*CreateRouteOutput, error) { req, out := c.CreateRouteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateRouteWithContext is the same as CreateRoute with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRoute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateRouteWithContext(ctx aws.Context, input *CreateRouteInput, opts ...request.Option) (*CreateRouteOutput, error) { + req, out := c.CreateRouteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateRouteTable = "CreateRouteTable" @@ -3178,8 +3857,23 @@ func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteTable func (c *EC2) CreateRouteTable(input *CreateRouteTableInput) (*CreateRouteTableOutput, error) { req, out := c.CreateRouteTableRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateRouteTableWithContext is the same as CreateRouteTable with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRouteTable for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateRouteTableWithContext(ctx aws.Context, input *CreateRouteTableInput, opts ...request.Option) (*CreateRouteTableOutput, error) { + req, out := c.CreateRouteTableRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSecurityGroup = "CreateSecurityGroup" @@ -3264,8 +3958,23 @@ func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSecurityGroup func (c *EC2) CreateSecurityGroup(input *CreateSecurityGroupInput) (*CreateSecurityGroupOutput, error) { req, out := c.CreateSecurityGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSecurityGroupWithContext is the same as CreateSecurityGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSecurityGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateSecurityGroupWithContext(ctx aws.Context, input *CreateSecurityGroupInput, opts ...request.Option) (*CreateSecurityGroupOutput, error) { + req, out := c.CreateSecurityGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSnapshot = "CreateSnapshot" @@ -3351,8 +4060,23 @@ func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSnapshot func (c *EC2) CreateSnapshot(input *CreateSnapshotInput) (*Snapshot, error) { req, out := c.CreateSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSnapshotWithContext is the same as CreateSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotInput, opts ...request.Option) (*Snapshot, error) { + req, out := c.CreateSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSpotDatafeedSubscription = "CreateSpotDatafeedSubscription" @@ -3414,8 +4138,23 @@ func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSub // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSpotDatafeedSubscription func (c *EC2) CreateSpotDatafeedSubscription(input *CreateSpotDatafeedSubscriptionInput) (*CreateSpotDatafeedSubscriptionOutput, error) { req, out := c.CreateSpotDatafeedSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSpotDatafeedSubscriptionWithContext is the same as CreateSpotDatafeedSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSpotDatafeedSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *CreateSpotDatafeedSubscriptionInput, opts ...request.Option) (*CreateSpotDatafeedSubscriptionOutput, error) { + req, out := c.CreateSpotDatafeedSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSubnet = "CreateSubnet" @@ -3501,8 +4240,23 @@ func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSubnet func (c *EC2) CreateSubnet(input *CreateSubnetInput) (*CreateSubnetOutput, error) { req, out := c.CreateSubnetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSubnetWithContext is the same as CreateSubnet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSubnet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateSubnetWithContext(ctx aws.Context, input *CreateSubnetInput, opts ...request.Option) (*CreateSubnetOutput, error) { + req, out := c.CreateSubnetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTags = "CreateTags" @@ -3571,8 +4325,23 @@ func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTags func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { req, out := c.CreateTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTagsWithContext is the same as CreateTags with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTagsWithContext(ctx aws.Context, input *CreateTagsInput, opts ...request.Option) (*CreateTagsOutput, error) { + req, out := c.CreateTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVolume = "CreateVolume" @@ -3634,7 +4403,10 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Reques // encrypted. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // -// For more information, see Creating or Restoring an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) +// You can tag your volumes during creation. For more information, see Tagging +// Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). +// +// For more information, see Creating an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -3646,8 +4418,23 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolume func (c *EC2) CreateVolume(input *CreateVolumeInput) (*Volume, error) { req, out := c.CreateVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVolumeWithContext is the same as CreateVolume with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVolumeWithContext(ctx aws.Context, input *CreateVolumeInput, opts ...request.Option) (*Volume, error) { + req, out := c.CreateVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVpc = "CreateVpc" @@ -3724,8 +4511,23 @@ func (c *EC2) CreateVpcRequest(input *CreateVpcInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpc func (c *EC2) CreateVpc(input *CreateVpcInput) (*CreateVpcOutput, error) { req, out := c.CreateVpcRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVpcWithContext is the same as CreateVpc with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVpc for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVpcWithContext(ctx aws.Context, input *CreateVpcInput, opts ...request.Option) (*CreateVpcOutput, error) { + req, out := c.CreateVpcRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVpcEndpoint = "CreateVpcEndpoint" @@ -3790,8 +4592,23 @@ func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpoint func (c *EC2) CreateVpcEndpoint(input *CreateVpcEndpointInput) (*CreateVpcEndpointOutput, error) { req, out := c.CreateVpcEndpointRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVpcEndpointWithContext is the same as CreateVpcEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVpcEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVpcEndpointWithContext(ctx aws.Context, input *CreateVpcEndpointInput, opts ...request.Option) (*CreateVpcEndpointOutput, error) { + req, out := c.CreateVpcEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection" @@ -3860,8 +4677,23 @@ func (c *EC2) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConnectio // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcPeeringConnection func (c *EC2) CreateVpcPeeringConnection(input *CreateVpcPeeringConnectionInput) (*CreateVpcPeeringConnectionOutput, error) { req, out := c.CreateVpcPeeringConnectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVpcPeeringConnectionWithContext is the same as CreateVpcPeeringConnection with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVpcPeeringConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVpcPeeringConnectionWithContext(ctx aws.Context, input *CreateVpcPeeringConnectionInput, opts ...request.Option) (*CreateVpcPeeringConnectionOutput, error) { + req, out := c.CreateVpcPeeringConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVpnConnection = "CreateVpnConnection" @@ -3939,8 +4771,23 @@ func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnection func (c *EC2) CreateVpnConnection(input *CreateVpnConnectionInput) (*CreateVpnConnectionOutput, error) { req, out := c.CreateVpnConnectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVpnConnectionWithContext is the same as CreateVpnConnection with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVpnConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVpnConnectionWithContext(ctx aws.Context, input *CreateVpnConnectionInput, opts ...request.Option) (*CreateVpnConnectionOutput, error) { + req, out := c.CreateVpnConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVpnConnectionRoute = "CreateVpnConnectionRoute" @@ -4008,8 +4855,23 @@ func (c *EC2) CreateVpnConnectionRouteRequest(input *CreateVpnConnectionRouteInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRoute func (c *EC2) CreateVpnConnectionRoute(input *CreateVpnConnectionRouteInput) (*CreateVpnConnectionRouteOutput, error) { req, out := c.CreateVpnConnectionRouteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVpnConnectionRouteWithContext is the same as CreateVpnConnectionRoute with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVpnConnectionRoute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVpnConnectionRouteWithContext(ctx aws.Context, input *CreateVpnConnectionRouteInput, opts ...request.Option) (*CreateVpnConnectionRouteOutput, error) { + req, out := c.CreateVpnConnectionRouteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVpnGateway = "CreateVpnGateway" @@ -4074,8 +4936,23 @@ func (c *EC2) CreateVpnGatewayRequest(input *CreateVpnGatewayInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnGateway func (c *EC2) CreateVpnGateway(input *CreateVpnGatewayInput) (*CreateVpnGatewayOutput, error) { req, out := c.CreateVpnGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVpnGatewayWithContext is the same as CreateVpnGateway with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVpnGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVpnGatewayWithContext(ctx aws.Context, input *CreateVpnGatewayInput, opts ...request.Option) (*CreateVpnGatewayOutput, error) { + req, out := c.CreateVpnGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCustomerGateway = "DeleteCustomerGateway" @@ -4137,8 +5014,23 @@ func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCustomerGateway func (c *EC2) DeleteCustomerGateway(input *DeleteCustomerGatewayInput) (*DeleteCustomerGatewayOutput, error) { req, out := c.DeleteCustomerGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteCustomerGatewayWithContext is the same as DeleteCustomerGateway with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCustomerGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteCustomerGatewayWithContext(ctx aws.Context, input *DeleteCustomerGatewayInput, opts ...request.Option) (*DeleteCustomerGatewayOutput, error) { + req, out := c.DeleteCustomerGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDhcpOptions = "DeleteDhcpOptions" @@ -4202,8 +5094,23 @@ func (c *EC2) DeleteDhcpOptionsRequest(input *DeleteDhcpOptionsInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteDhcpOptions func (c *EC2) DeleteDhcpOptions(input *DeleteDhcpOptionsInput) (*DeleteDhcpOptionsOutput, error) { req, out := c.DeleteDhcpOptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDhcpOptionsWithContext is the same as DeleteDhcpOptions with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDhcpOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDhcpOptionsWithContext(ctx aws.Context, input *DeleteDhcpOptionsInput, opts ...request.Option) (*DeleteDhcpOptionsOutput, error) { + req, out := c.DeleteDhcpOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteEgressOnlyInternetGateway = "DeleteEgressOnlyInternetGateway" @@ -4262,8 +5169,23 @@ func (c *EC2) DeleteEgressOnlyInternetGatewayRequest(input *DeleteEgressOnlyInte // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteEgressOnlyInternetGateway func (c *EC2) DeleteEgressOnlyInternetGateway(input *DeleteEgressOnlyInternetGatewayInput) (*DeleteEgressOnlyInternetGatewayOutput, error) { req, out := c.DeleteEgressOnlyInternetGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteEgressOnlyInternetGatewayWithContext is the same as DeleteEgressOnlyInternetGateway with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteEgressOnlyInternetGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteEgressOnlyInternetGatewayWithContext(ctx aws.Context, input *DeleteEgressOnlyInternetGatewayInput, opts ...request.Option) (*DeleteEgressOnlyInternetGatewayOutput, error) { + req, out := c.DeleteEgressOnlyInternetGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteFlowLogs = "DeleteFlowLogs" @@ -4322,8 +5244,23 @@ func (c *EC2) DeleteFlowLogsRequest(input *DeleteFlowLogsInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFlowLogs func (c *EC2) DeleteFlowLogs(input *DeleteFlowLogsInput) (*DeleteFlowLogsOutput, error) { req, out := c.DeleteFlowLogsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteFlowLogsWithContext is the same as DeleteFlowLogs with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteFlowLogs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteFlowLogsWithContext(ctx aws.Context, input *DeleteFlowLogsInput, opts ...request.Option) (*DeleteFlowLogsOutput, error) { + req, out := c.DeleteFlowLogsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteInternetGateway = "DeleteInternetGateway" @@ -4385,8 +5322,23 @@ func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteInternetGateway func (c *EC2) DeleteInternetGateway(input *DeleteInternetGatewayInput) (*DeleteInternetGatewayOutput, error) { req, out := c.DeleteInternetGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteInternetGatewayWithContext is the same as DeleteInternetGateway with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteInternetGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteInternetGatewayWithContext(ctx aws.Context, input *DeleteInternetGatewayInput, opts ...request.Option) (*DeleteInternetGatewayOutput, error) { + req, out := c.DeleteInternetGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteKeyPair = "DeleteKeyPair" @@ -4447,8 +5399,23 @@ func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteKeyPair func (c *EC2) DeleteKeyPair(input *DeleteKeyPairInput) (*DeleteKeyPairOutput, error) { req, out := c.DeleteKeyPairRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteKeyPairWithContext is the same as DeleteKeyPair with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteKeyPair for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteKeyPairWithContext(ctx aws.Context, input *DeleteKeyPairInput, opts ...request.Option) (*DeleteKeyPairOutput, error) { + req, out := c.DeleteKeyPairRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteNatGateway = "DeleteNatGateway" @@ -4509,8 +5476,23 @@ func (c *EC2) DeleteNatGatewayRequest(input *DeleteNatGatewayInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNatGateway func (c *EC2) DeleteNatGateway(input *DeleteNatGatewayInput) (*DeleteNatGatewayOutput, error) { req, out := c.DeleteNatGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteNatGatewayWithContext is the same as DeleteNatGateway with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteNatGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteNatGatewayWithContext(ctx aws.Context, input *DeleteNatGatewayInput, opts ...request.Option) (*DeleteNatGatewayOutput, error) { + req, out := c.DeleteNatGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteNetworkAcl = "DeleteNetworkAcl" @@ -4572,8 +5554,23 @@ func (c *EC2) DeleteNetworkAclRequest(input *DeleteNetworkAclInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAcl func (c *EC2) DeleteNetworkAcl(input *DeleteNetworkAclInput) (*DeleteNetworkAclOutput, error) { req, out := c.DeleteNetworkAclRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteNetworkAclWithContext is the same as DeleteNetworkAcl with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteNetworkAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteNetworkAclWithContext(ctx aws.Context, input *DeleteNetworkAclInput, opts ...request.Option) (*DeleteNetworkAclOutput, error) { + req, out := c.DeleteNetworkAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteNetworkAclEntry = "DeleteNetworkAclEntry" @@ -4635,8 +5632,23 @@ func (c *EC2) DeleteNetworkAclEntryRequest(input *DeleteNetworkAclEntryInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclEntry func (c *EC2) DeleteNetworkAclEntry(input *DeleteNetworkAclEntryInput) (*DeleteNetworkAclEntryOutput, error) { req, out := c.DeleteNetworkAclEntryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteNetworkAclEntryWithContext is the same as DeleteNetworkAclEntry with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteNetworkAclEntry for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteNetworkAclEntryWithContext(ctx aws.Context, input *DeleteNetworkAclEntryInput, opts ...request.Option) (*DeleteNetworkAclEntryOutput, error) { + req, out := c.DeleteNetworkAclEntryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteNetworkInterface = "DeleteNetworkInterface" @@ -4698,8 +5710,23 @@ func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterface func (c *EC2) DeleteNetworkInterface(input *DeleteNetworkInterfaceInput) (*DeleteNetworkInterfaceOutput, error) { req, out := c.DeleteNetworkInterfaceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteNetworkInterfaceWithContext is the same as DeleteNetworkInterface with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteNetworkInterface for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteNetworkInterfaceWithContext(ctx aws.Context, input *DeleteNetworkInterfaceInput, opts ...request.Option) (*DeleteNetworkInterfaceOutput, error) { + req, out := c.DeleteNetworkInterfaceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePlacementGroup = "DeletePlacementGroup" @@ -4763,8 +5790,23 @@ func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeletePlacementGroup func (c *EC2) DeletePlacementGroup(input *DeletePlacementGroupInput) (*DeletePlacementGroupOutput, error) { req, out := c.DeletePlacementGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePlacementGroupWithContext is the same as DeletePlacementGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePlacementGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeletePlacementGroupWithContext(ctx aws.Context, input *DeletePlacementGroupInput, opts ...request.Option) (*DeletePlacementGroupOutput, error) { + req, out := c.DeletePlacementGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRoute = "DeleteRoute" @@ -4825,8 +5867,23 @@ func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRoute func (c *EC2) DeleteRoute(input *DeleteRouteInput) (*DeleteRouteOutput, error) { req, out := c.DeleteRouteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRouteWithContext is the same as DeleteRoute with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRoute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRouteWithContext(ctx aws.Context, input *DeleteRouteInput, opts ...request.Option) (*DeleteRouteOutput, error) { + req, out := c.DeleteRouteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRouteTable = "DeleteRouteTable" @@ -4889,8 +5946,23 @@ func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteTable func (c *EC2) DeleteRouteTable(input *DeleteRouteTableInput) (*DeleteRouteTableOutput, error) { req, out := c.DeleteRouteTableRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRouteTableWithContext is the same as DeleteRouteTable with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRouteTable for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRouteTableWithContext(ctx aws.Context, input *DeleteRouteTableInput, opts ...request.Option) (*DeleteRouteTableOutput, error) { + req, out := c.DeleteRouteTableRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSecurityGroup = "DeleteSecurityGroup" @@ -4955,8 +6027,23 @@ func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSecurityGroup func (c *EC2) DeleteSecurityGroup(input *DeleteSecurityGroupInput) (*DeleteSecurityGroupOutput, error) { req, out := c.DeleteSecurityGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSecurityGroupWithContext is the same as DeleteSecurityGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSecurityGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSecurityGroupWithContext(ctx aws.Context, input *DeleteSecurityGroupInput, opts ...request.Option) (*DeleteSecurityGroupOutput, error) { + req, out := c.DeleteSecurityGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSnapshot = "DeleteSnapshot" @@ -5031,8 +6118,23 @@ func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSnapshot func (c *EC2) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error) { req, out := c.DeleteSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSnapshotWithContext is the same as DeleteSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSnapshotWithContext(ctx aws.Context, input *DeleteSnapshotInput, opts ...request.Option) (*DeleteSnapshotOutput, error) { + req, out := c.DeleteSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSpotDatafeedSubscription = "DeleteSpotDatafeedSubscription" @@ -5093,8 +6195,23 @@ func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSub // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSpotDatafeedSubscription func (c *EC2) DeleteSpotDatafeedSubscription(input *DeleteSpotDatafeedSubscriptionInput) (*DeleteSpotDatafeedSubscriptionOutput, error) { req, out := c.DeleteSpotDatafeedSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSpotDatafeedSubscriptionWithContext is the same as DeleteSpotDatafeedSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSpotDatafeedSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *DeleteSpotDatafeedSubscriptionInput, opts ...request.Option) (*DeleteSpotDatafeedSubscriptionOutput, error) { + req, out := c.DeleteSpotDatafeedSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSubnet = "DeleteSubnet" @@ -5156,8 +6273,23 @@ func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSubnet func (c *EC2) DeleteSubnet(input *DeleteSubnetInput) (*DeleteSubnetOutput, error) { req, out := c.DeleteSubnetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSubnetWithContext is the same as DeleteSubnet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSubnet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSubnetWithContext(ctx aws.Context, input *DeleteSubnetInput, opts ...request.Option) (*DeleteSubnetOutput, error) { + req, out := c.DeleteSubnetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTags = "DeleteTags" @@ -5222,8 +6354,23 @@ func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTags func (c *EC2) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { req, out := c.DeleteTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTagsWithContext is the same as DeleteTags with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { + req, out := c.DeleteTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVolume = "DeleteVolume" @@ -5290,8 +6437,23 @@ func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVolume func (c *EC2) DeleteVolume(input *DeleteVolumeInput) (*DeleteVolumeOutput, error) { req, out := c.DeleteVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVolumeWithContext is the same as DeleteVolume with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVolumeWithContext(ctx aws.Context, input *DeleteVolumeInput, opts ...request.Option) (*DeleteVolumeOutput, error) { + req, out := c.DeleteVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVpc = "DeleteVpc" @@ -5356,8 +6518,23 @@ func (c *EC2) DeleteVpcRequest(input *DeleteVpcInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpc func (c *EC2) DeleteVpc(input *DeleteVpcInput) (*DeleteVpcOutput, error) { req, out := c.DeleteVpcRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVpcWithContext is the same as DeleteVpc with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVpc for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVpcWithContext(ctx aws.Context, input *DeleteVpcInput, opts ...request.Option) (*DeleteVpcOutput, error) { + req, out := c.DeleteVpcRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVpcEndpoints = "DeleteVpcEndpoints" @@ -5417,8 +6594,23 @@ func (c *EC2) DeleteVpcEndpointsRequest(input *DeleteVpcEndpointsInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpoints func (c *EC2) DeleteVpcEndpoints(input *DeleteVpcEndpointsInput) (*DeleteVpcEndpointsOutput, error) { req, out := c.DeleteVpcEndpointsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVpcEndpointsWithContext is the same as DeleteVpcEndpoints with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVpcEndpoints for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVpcEndpointsWithContext(ctx aws.Context, input *DeleteVpcEndpointsInput, opts ...request.Option) (*DeleteVpcEndpointsOutput, error) { + req, out := c.DeleteVpcEndpointsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection" @@ -5480,8 +6672,23 @@ func (c *EC2) DeleteVpcPeeringConnectionRequest(input *DeleteVpcPeeringConnectio // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcPeeringConnection func (c *EC2) DeleteVpcPeeringConnection(input *DeleteVpcPeeringConnectionInput) (*DeleteVpcPeeringConnectionOutput, error) { req, out := c.DeleteVpcPeeringConnectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVpcPeeringConnectionWithContext is the same as DeleteVpcPeeringConnection with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVpcPeeringConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVpcPeeringConnectionWithContext(ctx aws.Context, input *DeleteVpcPeeringConnectionInput, opts ...request.Option) (*DeleteVpcPeeringConnectionOutput, error) { + req, out := c.DeleteVpcPeeringConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVpnConnection = "DeleteVpnConnection" @@ -5551,8 +6758,23 @@ func (c *EC2) DeleteVpnConnectionRequest(input *DeleteVpnConnectionInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnection func (c *EC2) DeleteVpnConnection(input *DeleteVpnConnectionInput) (*DeleteVpnConnectionOutput, error) { req, out := c.DeleteVpnConnectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVpnConnectionWithContext is the same as DeleteVpnConnection with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVpnConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVpnConnectionWithContext(ctx aws.Context, input *DeleteVpnConnectionInput, opts ...request.Option) (*DeleteVpnConnectionOutput, error) { + req, out := c.DeleteVpnConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVpnConnectionRoute = "DeleteVpnConnectionRoute" @@ -5616,8 +6838,23 @@ func (c *EC2) DeleteVpnConnectionRouteRequest(input *DeleteVpnConnectionRouteInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRoute func (c *EC2) DeleteVpnConnectionRoute(input *DeleteVpnConnectionRouteInput) (*DeleteVpnConnectionRouteOutput, error) { req, out := c.DeleteVpnConnectionRouteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVpnConnectionRouteWithContext is the same as DeleteVpnConnectionRoute with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVpnConnectionRoute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVpnConnectionRouteWithContext(ctx aws.Context, input *DeleteVpnConnectionRouteInput, opts ...request.Option) (*DeleteVpnConnectionRouteOutput, error) { + req, out := c.DeleteVpnConnectionRouteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVpnGateway = "DeleteVpnGateway" @@ -5682,8 +6919,23 @@ func (c *EC2) DeleteVpnGatewayRequest(input *DeleteVpnGatewayInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnGateway func (c *EC2) DeleteVpnGateway(input *DeleteVpnGatewayInput) (*DeleteVpnGatewayOutput, error) { req, out := c.DeleteVpnGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVpnGatewayWithContext is the same as DeleteVpnGateway with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVpnGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVpnGatewayWithContext(ctx aws.Context, input *DeleteVpnGatewayInput, opts ...request.Option) (*DeleteVpnGatewayOutput, error) { + req, out := c.DeleteVpnGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterImage = "DeregisterImage" @@ -5747,8 +6999,23 @@ func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterImage func (c *EC2) DeregisterImage(input *DeregisterImageInput) (*DeregisterImageOutput, error) { req, out := c.DeregisterImageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterImageWithContext is the same as DeregisterImage with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterImageWithContext(ctx aws.Context, input *DeregisterImageInput, opts ...request.Option) (*DeregisterImageOutput, error) { + req, out := c.DeregisterImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAccountAttributes = "DescribeAccountAttributes" @@ -5825,8 +7092,23 @@ func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAccountAttributes func (c *EC2) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (*DescribeAccountAttributesOutput, error) { req, out := c.DescribeAccountAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAccountAttributesWithContext is the same as DescribeAccountAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAccountAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAccountAttributesWithContext(ctx aws.Context, input *DescribeAccountAttributesInput, opts ...request.Option) (*DescribeAccountAttributesOutput, error) { + req, out := c.DescribeAccountAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAddresses = "DescribeAddresses" @@ -5889,8 +7171,23 @@ func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddresses func (c *EC2) DescribeAddresses(input *DescribeAddressesInput) (*DescribeAddressesOutput, error) { req, out := c.DescribeAddressesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAddressesWithContext is the same as DescribeAddresses with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAddresses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAddressesWithContext(ctx aws.Context, input *DescribeAddressesInput, opts ...request.Option) (*DescribeAddressesOutput, error) { + req, out := c.DescribeAddressesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAvailabilityZones = "DescribeAvailabilityZones" @@ -5955,8 +7252,23 @@ func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAvailabilityZones func (c *EC2) DescribeAvailabilityZones(input *DescribeAvailabilityZonesInput) (*DescribeAvailabilityZonesOutput, error) { req, out := c.DescribeAvailabilityZonesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAvailabilityZonesWithContext is the same as DescribeAvailabilityZones with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAvailabilityZones for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAvailabilityZonesWithContext(ctx aws.Context, input *DescribeAvailabilityZonesInput, opts ...request.Option) (*DescribeAvailabilityZonesOutput, error) { + req, out := c.DescribeAvailabilityZonesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeBundleTasks = "DescribeBundleTasks" @@ -6020,8 +7332,23 @@ func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeBundleTasks func (c *EC2) DescribeBundleTasks(input *DescribeBundleTasksInput) (*DescribeBundleTasksOutput, error) { req, out := c.DescribeBundleTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeBundleTasksWithContext is the same as DescribeBundleTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeBundleTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeBundleTasksWithContext(ctx aws.Context, input *DescribeBundleTasksInput, opts ...request.Option) (*DescribeBundleTasksOutput, error) { + req, out := c.DescribeBundleTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" @@ -6083,8 +7410,23 @@ func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInst // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClassicLinkInstances func (c *EC2) DescribeClassicLinkInstances(input *DescribeClassicLinkInstancesInput) (*DescribeClassicLinkInstancesOutput, error) { req, out := c.DescribeClassicLinkInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClassicLinkInstancesWithContext is the same as DescribeClassicLinkInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeClassicLinkInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClassicLinkInstancesWithContext(ctx aws.Context, input *DescribeClassicLinkInstancesInput, opts ...request.Option) (*DescribeClassicLinkInstancesOutput, error) { + req, out := c.DescribeClassicLinkInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConversionTasks = "DescribeConversionTasks" @@ -6147,8 +7489,23 @@ func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeConversionTasks func (c *EC2) DescribeConversionTasks(input *DescribeConversionTasksInput) (*DescribeConversionTasksOutput, error) { req, out := c.DescribeConversionTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConversionTasksWithContext is the same as DescribeConversionTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConversionTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConversionTasksWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.Option) (*DescribeConversionTasksOutput, error) { + req, out := c.DescribeConversionTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeCustomerGateways = "DescribeCustomerGateways" @@ -6211,8 +7568,23 @@ func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCustomerGateways func (c *EC2) DescribeCustomerGateways(input *DescribeCustomerGatewaysInput) (*DescribeCustomerGatewaysOutput, error) { req, out := c.DescribeCustomerGatewaysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCustomerGatewaysWithContext is the same as DescribeCustomerGateways with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCustomerGateways for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCustomerGatewaysWithContext(ctx aws.Context, input *DescribeCustomerGatewaysInput, opts ...request.Option) (*DescribeCustomerGatewaysOutput, error) { + req, out := c.DescribeCustomerGatewaysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDhcpOptions = "DescribeDhcpOptions" @@ -6274,8 +7646,23 @@ func (c *EC2) DescribeDhcpOptionsRequest(input *DescribeDhcpOptionsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeDhcpOptions func (c *EC2) DescribeDhcpOptions(input *DescribeDhcpOptionsInput) (*DescribeDhcpOptionsOutput, error) { req, out := c.DescribeDhcpOptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDhcpOptionsWithContext is the same as DescribeDhcpOptions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDhcpOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDhcpOptionsWithContext(ctx aws.Context, input *DescribeDhcpOptionsInput, opts ...request.Option) (*DescribeDhcpOptionsOutput, error) { + req, out := c.DescribeDhcpOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEgressOnlyInternetGateways = "DescribeEgressOnlyInternetGateways" @@ -6334,8 +7721,23 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysRequest(input *DescribeEgressOnl // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeEgressOnlyInternetGateways func (c *EC2) DescribeEgressOnlyInternetGateways(input *DescribeEgressOnlyInternetGatewaysInput) (*DescribeEgressOnlyInternetGatewaysOutput, error) { req, out := c.DescribeEgressOnlyInternetGatewaysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEgressOnlyInternetGatewaysWithContext is the same as DescribeEgressOnlyInternetGateways with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEgressOnlyInternetGateways for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEgressOnlyInternetGatewaysWithContext(ctx aws.Context, input *DescribeEgressOnlyInternetGatewaysInput, opts ...request.Option) (*DescribeEgressOnlyInternetGatewaysOutput, error) { + req, out := c.DescribeEgressOnlyInternetGatewaysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeExportTasks = "DescribeExportTasks" @@ -6394,8 +7796,23 @@ func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeExportTasks func (c *EC2) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) { req, out := c.DescribeExportTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeExportTasksWithContext is the same as DescribeExportTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeExportTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeExportTasksWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.Option) (*DescribeExportTasksOutput, error) { + req, out := c.DescribeExportTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeFlowLogs = "DescribeFlowLogs" @@ -6456,8 +7873,23 @@ func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFlowLogs func (c *EC2) DescribeFlowLogs(input *DescribeFlowLogsInput) (*DescribeFlowLogsOutput, error) { req, out := c.DescribeFlowLogsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeFlowLogsWithContext is the same as DescribeFlowLogs with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeFlowLogs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeFlowLogsWithContext(ctx aws.Context, input *DescribeFlowLogsInput, opts ...request.Option) (*DescribeFlowLogsOutput, error) { + req, out := c.DescribeFlowLogsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeHostReservationOfferings = "DescribeHostReservationOfferings" @@ -6524,8 +7956,23 @@ func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReserva // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservationOfferings func (c *EC2) DescribeHostReservationOfferings(input *DescribeHostReservationOfferingsInput) (*DescribeHostReservationOfferingsOutput, error) { req, out := c.DescribeHostReservationOfferingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeHostReservationOfferingsWithContext is the same as DescribeHostReservationOfferings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeHostReservationOfferings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeHostReservationOfferingsWithContext(ctx aws.Context, input *DescribeHostReservationOfferingsInput, opts ...request.Option) (*DescribeHostReservationOfferingsOutput, error) { + req, out := c.DescribeHostReservationOfferingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeHostReservations = "DescribeHostReservations" @@ -6585,8 +8032,23 @@ func (c *EC2) DescribeHostReservationsRequest(input *DescribeHostReservationsInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservations func (c *EC2) DescribeHostReservations(input *DescribeHostReservationsInput) (*DescribeHostReservationsOutput, error) { req, out := c.DescribeHostReservationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeHostReservationsWithContext is the same as DescribeHostReservations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeHostReservations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeHostReservationsWithContext(ctx aws.Context, input *DescribeHostReservationsInput, opts ...request.Option) (*DescribeHostReservationsOutput, error) { + req, out := c.DescribeHostReservationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeHosts = "DescribeHosts" @@ -6649,8 +8111,23 @@ func (c *EC2) DescribeHostsRequest(input *DescribeHostsInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHosts func (c *EC2) DescribeHosts(input *DescribeHostsInput) (*DescribeHostsOutput, error) { req, out := c.DescribeHostsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeHostsWithContext is the same as DescribeHosts with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeHosts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeHostsWithContext(ctx aws.Context, input *DescribeHostsInput, opts ...request.Option) (*DescribeHostsOutput, error) { + req, out := c.DescribeHostsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeIamInstanceProfileAssociations = "DescribeIamInstanceProfileAssociations" @@ -6709,8 +8186,23 @@ func (c *EC2) DescribeIamInstanceProfileAssociationsRequest(input *DescribeIamIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociations func (c *EC2) DescribeIamInstanceProfileAssociations(input *DescribeIamInstanceProfileAssociationsInput) (*DescribeIamInstanceProfileAssociationsOutput, error) { req, out := c.DescribeIamInstanceProfileAssociationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeIamInstanceProfileAssociationsWithContext is the same as DescribeIamInstanceProfileAssociations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeIamInstanceProfileAssociations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeIamInstanceProfileAssociationsWithContext(ctx aws.Context, input *DescribeIamInstanceProfileAssociationsInput, opts ...request.Option) (*DescribeIamInstanceProfileAssociationsOutput, error) { + req, out := c.DescribeIamInstanceProfileAssociationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeIdFormat = "DescribeIdFormat" @@ -6782,8 +8274,23 @@ func (c *EC2) DescribeIdFormatRequest(input *DescribeIdFormatInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdFormat func (c *EC2) DescribeIdFormat(input *DescribeIdFormatInput) (*DescribeIdFormatOutput, error) { req, out := c.DescribeIdFormatRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeIdFormatWithContext is the same as DescribeIdFormat with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeIdFormat for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeIdFormatWithContext(ctx aws.Context, input *DescribeIdFormatInput, opts ...request.Option) (*DescribeIdFormatOutput, error) { + req, out := c.DescribeIdFormatRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeIdentityIdFormat = "DescribeIdentityIdFormat" @@ -6853,8 +8360,23 @@ func (c *EC2) DescribeIdentityIdFormatRequest(input *DescribeIdentityIdFormatInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdentityIdFormat func (c *EC2) DescribeIdentityIdFormat(input *DescribeIdentityIdFormatInput) (*DescribeIdentityIdFormatOutput, error) { req, out := c.DescribeIdentityIdFormatRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeIdentityIdFormatWithContext is the same as DescribeIdentityIdFormat with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeIdentityIdFormat for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeIdentityIdFormatWithContext(ctx aws.Context, input *DescribeIdentityIdFormatInput, opts ...request.Option) (*DescribeIdentityIdFormatOutput, error) { + req, out := c.DescribeIdentityIdFormatRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeImageAttribute = "DescribeImageAttribute" @@ -6914,8 +8436,23 @@ func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImageAttribute func (c *EC2) DescribeImageAttribute(input *DescribeImageAttributeInput) (*DescribeImageAttributeOutput, error) { req, out := c.DescribeImageAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeImageAttributeWithContext is the same as DescribeImageAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeImageAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeImageAttributeWithContext(ctx aws.Context, input *DescribeImageAttributeInput, opts ...request.Option) (*DescribeImageAttributeOutput, error) { + req, out := c.DescribeImageAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeImages = "DescribeImages" @@ -6980,8 +8517,23 @@ func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImages func (c *EC2) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, error) { req, out := c.DescribeImagesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeImagesWithContext is the same as DescribeImages with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeImages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeImagesWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.Option) (*DescribeImagesOutput, error) { + req, out := c.DescribeImagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeImportImageTasks = "DescribeImportImageTasks" @@ -7041,8 +8593,23 @@ func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportImageTasks func (c *EC2) DescribeImportImageTasks(input *DescribeImportImageTasksInput) (*DescribeImportImageTasksOutput, error) { req, out := c.DescribeImportImageTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeImportImageTasksWithContext is the same as DescribeImportImageTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeImportImageTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeImportImageTasksWithContext(ctx aws.Context, input *DescribeImportImageTasksInput, opts ...request.Option) (*DescribeImportImageTasksOutput, error) { + req, out := c.DescribeImportImageTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks" @@ -7101,8 +8668,23 @@ func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTa // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportSnapshotTasks func (c *EC2) DescribeImportSnapshotTasks(input *DescribeImportSnapshotTasksInput) (*DescribeImportSnapshotTasksOutput, error) { req, out := c.DescribeImportSnapshotTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeImportSnapshotTasksWithContext is the same as DescribeImportSnapshotTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeImportSnapshotTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeImportSnapshotTasksWithContext(ctx aws.Context, input *DescribeImportSnapshotTasksInput, opts ...request.Option) (*DescribeImportSnapshotTasksOutput, error) { + req, out := c.DescribeImportSnapshotTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeInstanceAttribute = "DescribeInstanceAttribute" @@ -7165,8 +8747,23 @@ func (c *EC2) DescribeInstanceAttributeRequest(input *DescribeInstanceAttributeI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceAttribute func (c *EC2) DescribeInstanceAttribute(input *DescribeInstanceAttributeInput) (*DescribeInstanceAttributeOutput, error) { req, out := c.DescribeInstanceAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstanceAttributeWithContext is the same as DescribeInstanceAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstanceAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstanceAttributeWithContext(ctx aws.Context, input *DescribeInstanceAttributeInput, opts ...request.Option) (*DescribeInstanceAttributeOutput, error) { + req, out := c.DescribeInstanceAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeInstanceStatus = "DescribeInstanceStatus" @@ -7251,8 +8848,23 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceStatus func (c *EC2) DescribeInstanceStatus(input *DescribeInstanceStatusInput) (*DescribeInstanceStatusOutput, error) { req, out := c.DescribeInstanceStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstanceStatusWithContext is the same as DescribeInstanceStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstanceStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstanceStatusWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.Option) (*DescribeInstanceStatusOutput, error) { + req, out := c.DescribeInstanceStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeInstanceStatusPages iterates over the pages of a DescribeInstanceStatus operation, @@ -7272,12 +8884,37 @@ func (c *EC2) DescribeInstanceStatus(input *DescribeInstanceStatusInput) (*Descr // return pageNum <= 3 // }) // -func (c *EC2) DescribeInstanceStatusPages(input *DescribeInstanceStatusInput, fn func(p *DescribeInstanceStatusOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeInstanceStatusRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeInstanceStatusOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInstanceStatusInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceStatusRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeInstanceStatusOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeInstances = "DescribeInstances" @@ -7357,8 +8994,23 @@ func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstances func (c *EC2) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstancesOutput, error) { req, out := c.DescribeInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstancesWithContext is the same as DescribeInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstancesWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.Option) (*DescribeInstancesOutput, error) { + req, out := c.DescribeInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeInstancesPages iterates over the pages of a DescribeInstances operation, @@ -7378,12 +9030,37 @@ func (c *EC2) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstanc // return pageNum <= 3 // }) // -func (c *EC2) DescribeInstancesPages(input *DescribeInstancesInput, fn func(p *DescribeInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeInstancesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeInstancesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeInternetGateways = "DescribeInternetGateways" @@ -7442,8 +9119,23 @@ func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInternetGateways func (c *EC2) DescribeInternetGateways(input *DescribeInternetGatewaysInput) (*DescribeInternetGatewaysOutput, error) { req, out := c.DescribeInternetGatewaysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInternetGatewaysWithContext is the same as DescribeInternetGateways with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInternetGateways for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInternetGatewaysWithContext(ctx aws.Context, input *DescribeInternetGatewaysInput, opts ...request.Option) (*DescribeInternetGatewaysOutput, error) { + req, out := c.DescribeInternetGatewaysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeKeyPairs = "DescribeKeyPairs" @@ -7505,8 +9197,23 @@ func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeKeyPairs func (c *EC2) DescribeKeyPairs(input *DescribeKeyPairsInput) (*DescribeKeyPairsOutput, error) { req, out := c.DescribeKeyPairsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeKeyPairsWithContext is the same as DescribeKeyPairs with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeKeyPairs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeKeyPairsWithContext(ctx aws.Context, input *DescribeKeyPairsInput, opts ...request.Option) (*DescribeKeyPairsOutput, error) { + req, out := c.DescribeKeyPairsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMovingAddresses = "DescribeMovingAddresses" @@ -7567,8 +9274,23 @@ func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMovingAddresses func (c *EC2) DescribeMovingAddresses(input *DescribeMovingAddressesInput) (*DescribeMovingAddressesOutput, error) { req, out := c.DescribeMovingAddressesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMovingAddressesWithContext is the same as DescribeMovingAddresses with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMovingAddresses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMovingAddressesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, opts ...request.Option) (*DescribeMovingAddressesOutput, error) { + req, out := c.DescribeMovingAddressesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeNatGateways = "DescribeNatGateways" @@ -7633,8 +9355,23 @@ func (c *EC2) DescribeNatGatewaysRequest(input *DescribeNatGatewaysInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNatGateways func (c *EC2) DescribeNatGateways(input *DescribeNatGatewaysInput) (*DescribeNatGatewaysOutput, error) { req, out := c.DescribeNatGatewaysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeNatGatewaysWithContext is the same as DescribeNatGateways with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNatGateways for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeNatGatewaysWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, opts ...request.Option) (*DescribeNatGatewaysOutput, error) { + req, out := c.DescribeNatGatewaysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeNatGatewaysPages iterates over the pages of a DescribeNatGateways operation, @@ -7654,12 +9391,37 @@ func (c *EC2) DescribeNatGateways(input *DescribeNatGatewaysInput) (*DescribeNat // return pageNum <= 3 // }) // -func (c *EC2) DescribeNatGatewaysPages(input *DescribeNatGatewaysInput, fn func(p *DescribeNatGatewaysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeNatGatewaysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeNatGatewaysOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNatGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNatGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeNatGatewaysOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeNetworkAcls = "DescribeNetworkAcls" @@ -7721,8 +9483,23 @@ func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkAcls func (c *EC2) DescribeNetworkAcls(input *DescribeNetworkAclsInput) (*DescribeNetworkAclsOutput, error) { req, out := c.DescribeNetworkAclsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeNetworkAclsWithContext is the same as DescribeNetworkAcls with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNetworkAcls for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeNetworkAclsWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, opts ...request.Option) (*DescribeNetworkAclsOutput, error) { + req, out := c.DescribeNetworkAclsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" @@ -7782,8 +9559,23 @@ func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInt // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaceAttribute func (c *EC2) DescribeNetworkInterfaceAttribute(input *DescribeNetworkInterfaceAttributeInput) (*DescribeNetworkInterfaceAttributeOutput, error) { req, out := c.DescribeNetworkInterfaceAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeNetworkInterfaceAttributeWithContext is the same as DescribeNetworkInterfaceAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNetworkInterfaceAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeNetworkInterfaceAttributeWithContext(ctx aws.Context, input *DescribeNetworkInterfaceAttributeInput, opts ...request.Option) (*DescribeNetworkInterfaceAttributeOutput, error) { + req, out := c.DescribeNetworkInterfaceAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" @@ -7842,8 +9634,23 @@ func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaces func (c *EC2) DescribeNetworkInterfaces(input *DescribeNetworkInterfacesInput) (*DescribeNetworkInterfacesOutput, error) { req, out := c.DescribeNetworkInterfacesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeNetworkInterfacesWithContext is the same as DescribeNetworkInterfaces with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNetworkInterfaces for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeNetworkInterfacesWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, opts ...request.Option) (*DescribeNetworkInterfacesOutput, error) { + req, out := c.DescribeNetworkInterfacesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribePlacementGroups = "DescribePlacementGroups" @@ -7904,8 +9711,23 @@ func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePlacementGroups func (c *EC2) DescribePlacementGroups(input *DescribePlacementGroupsInput) (*DescribePlacementGroupsOutput, error) { req, out := c.DescribePlacementGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribePlacementGroupsWithContext is the same as DescribePlacementGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePlacementGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribePlacementGroupsWithContext(ctx aws.Context, input *DescribePlacementGroupsInput, opts ...request.Option) (*DescribePlacementGroupsOutput, error) { + req, out := c.DescribePlacementGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribePrefixLists = "DescribePrefixLists" @@ -7968,8 +9790,23 @@ func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixLists func (c *EC2) DescribePrefixLists(input *DescribePrefixListsInput) (*DescribePrefixListsOutput, error) { req, out := c.DescribePrefixListsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribePrefixListsWithContext is the same as DescribePrefixLists with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePrefixLists for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribePrefixListsWithContext(ctx aws.Context, input *DescribePrefixListsInput, opts ...request.Option) (*DescribePrefixListsOutput, error) { + req, out := c.DescribePrefixListsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeRegions = "DescribeRegions" @@ -8031,8 +9868,23 @@ func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRegions func (c *EC2) DescribeRegions(input *DescribeRegionsInput) (*DescribeRegionsOutput, error) { req, out := c.DescribeRegionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeRegionsWithContext is the same as DescribeRegions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRegions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeRegionsWithContext(ctx aws.Context, input *DescribeRegionsInput, opts ...request.Option) (*DescribeRegionsOutput, error) { + req, out := c.DescribeRegionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeReservedInstances = "DescribeReservedInstances" @@ -8094,8 +9946,23 @@ func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstances func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) (*DescribeReservedInstancesOutput, error) { req, out := c.DescribeReservedInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedInstancesWithContext is the same as DescribeReservedInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedInstancesWithContext(ctx aws.Context, input *DescribeReservedInstancesInput, opts ...request.Option) (*DescribeReservedInstancesOutput, error) { + req, out := c.DescribeReservedInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings" @@ -8175,8 +10042,23 @@ func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesListings func (c *EC2) DescribeReservedInstancesListings(input *DescribeReservedInstancesListingsInput) (*DescribeReservedInstancesListingsOutput, error) { req, out := c.DescribeReservedInstancesListingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedInstancesListingsWithContext is the same as DescribeReservedInstancesListings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedInstancesListings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedInstancesListingsWithContext(ctx aws.Context, input *DescribeReservedInstancesListingsInput, opts ...request.Option) (*DescribeReservedInstancesListingsOutput, error) { + req, out := c.DescribeReservedInstancesListingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModifications" @@ -8247,8 +10129,23 @@ func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReser // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesModifications func (c *EC2) DescribeReservedInstancesModifications(input *DescribeReservedInstancesModificationsInput) (*DescribeReservedInstancesModificationsOutput, error) { req, out := c.DescribeReservedInstancesModificationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedInstancesModificationsWithContext is the same as DescribeReservedInstancesModifications with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedInstancesModifications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedInstancesModificationsWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, opts ...request.Option) (*DescribeReservedInstancesModificationsOutput, error) { + req, out := c.DescribeReservedInstancesModificationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeReservedInstancesModificationsPages iterates over the pages of a DescribeReservedInstancesModifications operation, @@ -8268,12 +10165,37 @@ func (c *EC2) DescribeReservedInstancesModifications(input *DescribeReservedInst // return pageNum <= 3 // }) // -func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReservedInstancesModificationsInput, fn func(p *DescribeReservedInstancesModificationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedInstancesModificationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedInstancesModificationsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReservedInstancesModificationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReservedInstancesModificationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeReservedInstancesModificationsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings" @@ -8349,8 +10271,23 @@ func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferings func (c *EC2) DescribeReservedInstancesOfferings(input *DescribeReservedInstancesOfferingsInput) (*DescribeReservedInstancesOfferingsOutput, error) { req, out := c.DescribeReservedInstancesOfferingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedInstancesOfferingsWithContext is the same as DescribeReservedInstancesOfferings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedInstancesOfferings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedInstancesOfferingsWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, opts ...request.Option) (*DescribeReservedInstancesOfferingsOutput, error) { + req, out := c.DescribeReservedInstancesOfferingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeReservedInstancesOfferingsPages iterates over the pages of a DescribeReservedInstancesOfferings operation, @@ -8370,12 +10307,37 @@ func (c *EC2) DescribeReservedInstancesOfferings(input *DescribeReservedInstance // return pageNum <= 3 // }) // -func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedInstancesOfferingsInput, fn func(p *DescribeReservedInstancesOfferingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedInstancesOfferingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedInstancesOfferingsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReservedInstancesOfferingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReservedInstancesOfferingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeReservedInstancesOfferingsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeRouteTables = "DescribeRouteTables" @@ -8442,8 +10404,23 @@ func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRouteTables func (c *EC2) DescribeRouteTables(input *DescribeRouteTablesInput) (*DescribeRouteTablesOutput, error) { req, out := c.DescribeRouteTablesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeRouteTablesWithContext is the same as DescribeRouteTables with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRouteTables for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeRouteTablesWithContext(ctx aws.Context, input *DescribeRouteTablesInput, opts ...request.Option) (*DescribeRouteTablesOutput, error) { + req, out := c.DescribeRouteTablesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeScheduledInstanceAvailability = "DescribeScheduledInstanceAvailability" @@ -8510,8 +10487,23 @@ func (c *EC2) DescribeScheduledInstanceAvailabilityRequest(input *DescribeSchedu // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstanceAvailability func (c *EC2) DescribeScheduledInstanceAvailability(input *DescribeScheduledInstanceAvailabilityInput) (*DescribeScheduledInstanceAvailabilityOutput, error) { req, out := c.DescribeScheduledInstanceAvailabilityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeScheduledInstanceAvailabilityWithContext is the same as DescribeScheduledInstanceAvailability with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScheduledInstanceAvailability for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeScheduledInstanceAvailabilityWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, opts ...request.Option) (*DescribeScheduledInstanceAvailabilityOutput, error) { + req, out := c.DescribeScheduledInstanceAvailabilityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeScheduledInstances = "DescribeScheduledInstances" @@ -8570,8 +10562,23 @@ func (c *EC2) DescribeScheduledInstancesRequest(input *DescribeScheduledInstance // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstances func (c *EC2) DescribeScheduledInstances(input *DescribeScheduledInstancesInput) (*DescribeScheduledInstancesOutput, error) { req, out := c.DescribeScheduledInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeScheduledInstancesWithContext is the same as DescribeScheduledInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScheduledInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeScheduledInstancesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, opts ...request.Option) (*DescribeScheduledInstancesOutput, error) { + req, out := c.DescribeScheduledInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences" @@ -8631,8 +10638,23 @@ func (c *EC2) DescribeSecurityGroupReferencesRequest(input *DescribeSecurityGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferences func (c *EC2) DescribeSecurityGroupReferences(input *DescribeSecurityGroupReferencesInput) (*DescribeSecurityGroupReferencesOutput, error) { req, out := c.DescribeSecurityGroupReferencesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSecurityGroupReferencesWithContext is the same as DescribeSecurityGroupReferences with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSecurityGroupReferences for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSecurityGroupReferencesWithContext(ctx aws.Context, input *DescribeSecurityGroupReferencesInput, opts ...request.Option) (*DescribeSecurityGroupReferencesOutput, error) { + req, out := c.DescribeSecurityGroupReferencesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSecurityGroups = "DescribeSecurityGroups" @@ -8698,8 +10720,23 @@ func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroups func (c *EC2) DescribeSecurityGroups(input *DescribeSecurityGroupsInput) (*DescribeSecurityGroupsOutput, error) { req, out := c.DescribeSecurityGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSecurityGroupsWithContext is the same as DescribeSecurityGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSecurityGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSecurityGroupsWithContext(ctx aws.Context, input *DescribeSecurityGroupsInput, opts ...request.Option) (*DescribeSecurityGroupsOutput, error) { + req, out := c.DescribeSecurityGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute" @@ -8762,8 +10799,23 @@ func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttribute func (c *EC2) DescribeSnapshotAttribute(input *DescribeSnapshotAttributeInput) (*DescribeSnapshotAttributeOutput, error) { req, out := c.DescribeSnapshotAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSnapshotAttributeWithContext is the same as DescribeSnapshotAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSnapshotAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSnapshotAttributeWithContext(ctx aws.Context, input *DescribeSnapshotAttributeInput, opts ...request.Option) (*DescribeSnapshotAttributeOutput, error) { + req, out := c.DescribeSnapshotAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSnapshots = "DescribeSnapshots" @@ -8873,8 +10925,23 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshots func (c *EC2) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error) { req, out := c.DescribeSnapshotsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSnapshotsWithContext is the same as DescribeSnapshots with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSnapshots for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSnapshotsWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.Option) (*DescribeSnapshotsOutput, error) { + req, out := c.DescribeSnapshotsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeSnapshotsPages iterates over the pages of a DescribeSnapshots operation, @@ -8894,12 +10961,37 @@ func (c *EC2) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapsho // return pageNum <= 3 // }) // -func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(p *DescribeSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSnapshotsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSnapshotsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeSnapshotsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSnapshotsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription" @@ -8960,8 +11052,23 @@ func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafee // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotDatafeedSubscription func (c *EC2) DescribeSpotDatafeedSubscription(input *DescribeSpotDatafeedSubscriptionInput) (*DescribeSpotDatafeedSubscriptionOutput, error) { req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSpotDatafeedSubscriptionWithContext is the same as DescribeSpotDatafeedSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSpotDatafeedSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *DescribeSpotDatafeedSubscriptionInput, opts ...request.Option) (*DescribeSpotDatafeedSubscriptionOutput, error) { + req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances" @@ -9020,8 +11127,23 @@ func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstance // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetInstances func (c *EC2) DescribeSpotFleetInstances(input *DescribeSpotFleetInstancesInput) (*DescribeSpotFleetInstancesOutput, error) { req, out := c.DescribeSpotFleetInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSpotFleetInstancesWithContext is the same as DescribeSpotFleetInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSpotFleetInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSpotFleetInstancesWithContext(ctx aws.Context, input *DescribeSpotFleetInstancesInput, opts ...request.Option) (*DescribeSpotFleetInstancesOutput, error) { + req, out := c.DescribeSpotFleetInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory" @@ -9085,8 +11207,23 @@ func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetReq // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestHistory func (c *EC2) DescribeSpotFleetRequestHistory(input *DescribeSpotFleetRequestHistoryInput) (*DescribeSpotFleetRequestHistoryOutput, error) { req, out := c.DescribeSpotFleetRequestHistoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSpotFleetRequestHistoryWithContext is the same as DescribeSpotFleetRequestHistory with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSpotFleetRequestHistory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSpotFleetRequestHistoryWithContext(ctx aws.Context, input *DescribeSpotFleetRequestHistoryInput, opts ...request.Option) (*DescribeSpotFleetRequestHistoryOutput, error) { + req, out := c.DescribeSpotFleetRequestHistoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests" @@ -9154,8 +11291,23 @@ func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequests func (c *EC2) DescribeSpotFleetRequests(input *DescribeSpotFleetRequestsInput) (*DescribeSpotFleetRequestsOutput, error) { req, out := c.DescribeSpotFleetRequestsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSpotFleetRequestsWithContext is the same as DescribeSpotFleetRequests with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSpotFleetRequests for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSpotFleetRequestsWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, opts ...request.Option) (*DescribeSpotFleetRequestsOutput, error) { + req, out := c.DescribeSpotFleetRequestsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeSpotFleetRequestsPages iterates over the pages of a DescribeSpotFleetRequests operation, @@ -9175,12 +11327,37 @@ func (c *EC2) DescribeSpotFleetRequests(input *DescribeSpotFleetRequestsInput) ( // return pageNum <= 3 // }) // -func (c *EC2) DescribeSpotFleetRequestsPages(input *DescribeSpotFleetRequestsInput, fn func(p *DescribeSpotFleetRequestsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSpotFleetRequestsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSpotFleetRequestsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeSpotFleetRequestsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSpotFleetRequestsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeSpotFleetRequestsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests" @@ -9253,8 +11430,23 @@ func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceReq // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequests func (c *EC2) DescribeSpotInstanceRequests(input *DescribeSpotInstanceRequestsInput) (*DescribeSpotInstanceRequestsOutput, error) { req, out := c.DescribeSpotInstanceRequestsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSpotInstanceRequestsWithContext is the same as DescribeSpotInstanceRequests with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSpotInstanceRequests for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSpotInstanceRequestsWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, opts ...request.Option) (*DescribeSpotInstanceRequestsOutput, error) { + req, out := c.DescribeSpotInstanceRequestsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" @@ -9326,8 +11518,23 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotPriceHistory func (c *EC2) DescribeSpotPriceHistory(input *DescribeSpotPriceHistoryInput) (*DescribeSpotPriceHistoryOutput, error) { req, out := c.DescribeSpotPriceHistoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSpotPriceHistoryWithContext is the same as DescribeSpotPriceHistory with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSpotPriceHistory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSpotPriceHistoryWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, opts ...request.Option) (*DescribeSpotPriceHistoryOutput, error) { + req, out := c.DescribeSpotPriceHistoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeSpotPriceHistoryPages iterates over the pages of a DescribeSpotPriceHistory operation, @@ -9347,12 +11554,37 @@ func (c *EC2) DescribeSpotPriceHistory(input *DescribeSpotPriceHistoryInput) (*D // return pageNum <= 3 // }) // -func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput, fn func(p *DescribeSpotPriceHistoryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSpotPriceHistoryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSpotPriceHistoryOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeSpotPriceHistoryInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSpotPriceHistoryRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeSpotPriceHistoryOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeStaleSecurityGroups = "DescribeStaleSecurityGroups" @@ -9414,8 +11646,23 @@ func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGro // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStaleSecurityGroups func (c *EC2) DescribeStaleSecurityGroups(input *DescribeStaleSecurityGroupsInput) (*DescribeStaleSecurityGroupsOutput, error) { req, out := c.DescribeStaleSecurityGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStaleSecurityGroupsWithContext is the same as DescribeStaleSecurityGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStaleSecurityGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStaleSecurityGroupsWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, opts ...request.Option) (*DescribeStaleSecurityGroupsOutput, error) { + req, out := c.DescribeStaleSecurityGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSubnets = "DescribeSubnets" @@ -9477,8 +11724,23 @@ func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSubnets func (c *EC2) DescribeSubnets(input *DescribeSubnetsInput) (*DescribeSubnetsOutput, error) { req, out := c.DescribeSubnetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSubnetsWithContext is the same as DescribeSubnets with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSubnets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSubnetsWithContext(ctx aws.Context, input *DescribeSubnetsInput, opts ...request.Option) (*DescribeSubnetsOutput, error) { + req, out := c.DescribeSubnetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTags = "DescribeTags" @@ -9546,8 +11808,23 @@ func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTags func (c *EC2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTagsWithContext is the same as DescribeTags with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { + req, out := c.DescribeTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeTagsPages iterates over the pages of a DescribeTags operation, @@ -9567,12 +11844,37 @@ func (c *EC2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error // return pageNum <= 3 // }) // -func (c *EC2) DescribeTagsPages(input *DescribeTagsInput, fn func(p *DescribeTagsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeTagsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeTagsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTagsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTagsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeVolumeAttribute = "DescribeVolumeAttribute" @@ -9635,8 +11937,23 @@ func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttribute func (c *EC2) DescribeVolumeAttribute(input *DescribeVolumeAttributeInput) (*DescribeVolumeAttributeOutput, error) { req, out := c.DescribeVolumeAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVolumeAttributeWithContext is the same as DescribeVolumeAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVolumeAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVolumeAttributeWithContext(ctx aws.Context, input *DescribeVolumeAttributeInput, opts ...request.Option) (*DescribeVolumeAttributeOutput, error) { + req, out := c.DescribeVolumeAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVolumeStatus = "DescribeVolumeStatus" @@ -9735,8 +12052,23 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeStatus func (c *EC2) DescribeVolumeStatus(input *DescribeVolumeStatusInput) (*DescribeVolumeStatusOutput, error) { req, out := c.DescribeVolumeStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVolumeStatusWithContext is the same as DescribeVolumeStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVolumeStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVolumeStatusWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, opts ...request.Option) (*DescribeVolumeStatusOutput, error) { + req, out := c.DescribeVolumeStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeVolumeStatusPages iterates over the pages of a DescribeVolumeStatus operation, @@ -9756,12 +12088,37 @@ func (c *EC2) DescribeVolumeStatus(input *DescribeVolumeStatusInput) (*DescribeV // return pageNum <= 3 // }) // -func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn func(p *DescribeVolumeStatusOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeVolumeStatusRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeVolumeStatusOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVolumeStatusInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVolumeStatusRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVolumeStatusOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeVolumes = "DescribeVolumes" @@ -9836,8 +12193,23 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumes func (c *EC2) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutput, error) { req, out := c.DescribeVolumesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVolumesWithContext is the same as DescribeVolumes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVolumes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVolumesWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.Option) (*DescribeVolumesOutput, error) { + req, out := c.DescribeVolumesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeVolumesPages iterates over the pages of a DescribeVolumes operation, @@ -9857,12 +12229,37 @@ func (c *EC2) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutp // return pageNum <= 3 // }) // -func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(p *DescribeVolumesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeVolumesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeVolumesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVolumesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVolumesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVolumesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeVolumesModifications = "DescribeVolumesModifications" @@ -9933,8 +12330,23 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModifications func (c *EC2) DescribeVolumesModifications(input *DescribeVolumesModificationsInput) (*DescribeVolumesModificationsOutput, error) { req, out := c.DescribeVolumesModificationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVolumesModificationsWithContext is the same as DescribeVolumesModifications with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVolumesModifications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVolumesModificationsWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, opts ...request.Option) (*DescribeVolumesModificationsOutput, error) { + req, out := c.DescribeVolumesModificationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVpcAttribute = "DescribeVpcAttribute" @@ -9994,8 +12406,23 @@ func (c *EC2) DescribeVpcAttributeRequest(input *DescribeVpcAttributeInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcAttribute func (c *EC2) DescribeVpcAttribute(input *DescribeVpcAttributeInput) (*DescribeVpcAttributeOutput, error) { req, out := c.DescribeVpcAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVpcAttributeWithContext is the same as DescribeVpcAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpcAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVpcAttributeWithContext(ctx aws.Context, input *DescribeVpcAttributeInput, opts ...request.Option) (*DescribeVpcAttributeOutput, error) { + req, out := c.DescribeVpcAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVpcClassicLink = "DescribeVpcClassicLink" @@ -10054,8 +12481,23 @@ func (c *EC2) DescribeVpcClassicLinkRequest(input *DescribeVpcClassicLinkInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLink func (c *EC2) DescribeVpcClassicLink(input *DescribeVpcClassicLinkInput) (*DescribeVpcClassicLinkOutput, error) { req, out := c.DescribeVpcClassicLinkRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVpcClassicLinkWithContext is the same as DescribeVpcClassicLink with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpcClassicLink for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVpcClassicLinkWithContext(ctx aws.Context, input *DescribeVpcClassicLinkInput, opts ...request.Option) (*DescribeVpcClassicLinkOutput, error) { + req, out := c.DescribeVpcClassicLinkRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVpcClassicLinkDnsSupport = "DescribeVpcClassicLinkDnsSupport" @@ -10120,8 +12562,23 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicL // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkDnsSupport func (c *EC2) DescribeVpcClassicLinkDnsSupport(input *DescribeVpcClassicLinkDnsSupportInput) (*DescribeVpcClassicLinkDnsSupportOutput, error) { req, out := c.DescribeVpcClassicLinkDnsSupportRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVpcClassicLinkDnsSupportWithContext is the same as DescribeVpcClassicLinkDnsSupport with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpcClassicLinkDnsSupport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DescribeVpcClassicLinkDnsSupportOutput, error) { + req, out := c.DescribeVpcClassicLinkDnsSupportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" @@ -10181,8 +12638,23 @@ func (c *EC2) DescribeVpcEndpointServicesRequest(input *DescribeVpcEndpointServi // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServices func (c *EC2) DescribeVpcEndpointServices(input *DescribeVpcEndpointServicesInput) (*DescribeVpcEndpointServicesOutput, error) { req, out := c.DescribeVpcEndpointServicesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVpcEndpointServicesWithContext is the same as DescribeVpcEndpointServices with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpcEndpointServices for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVpcEndpointServicesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicesInput, opts ...request.Option) (*DescribeVpcEndpointServicesOutput, error) { + req, out := c.DescribeVpcEndpointServicesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVpcEndpoints = "DescribeVpcEndpoints" @@ -10241,8 +12713,23 @@ func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpoints func (c *EC2) DescribeVpcEndpoints(input *DescribeVpcEndpointsInput) (*DescribeVpcEndpointsOutput, error) { req, out := c.DescribeVpcEndpointsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVpcEndpointsWithContext is the same as DescribeVpcEndpoints with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpcEndpoints for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVpcEndpointsWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, opts ...request.Option) (*DescribeVpcEndpointsOutput, error) { + req, out := c.DescribeVpcEndpointsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" @@ -10301,8 +12788,23 @@ func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConn // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcPeeringConnections func (c *EC2) DescribeVpcPeeringConnections(input *DescribeVpcPeeringConnectionsInput) (*DescribeVpcPeeringConnectionsOutput, error) { req, out := c.DescribeVpcPeeringConnectionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVpcPeeringConnectionsWithContext is the same as DescribeVpcPeeringConnections with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpcPeeringConnections for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVpcPeeringConnectionsWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.Option) (*DescribeVpcPeeringConnectionsOutput, error) { + req, out := c.DescribeVpcPeeringConnectionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVpcs = "DescribeVpcs" @@ -10361,8 +12863,23 @@ func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcs func (c *EC2) DescribeVpcs(input *DescribeVpcsInput) (*DescribeVpcsOutput, error) { req, out := c.DescribeVpcsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVpcsWithContext is the same as DescribeVpcs with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpcs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVpcsWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.Option) (*DescribeVpcsOutput, error) { + req, out := c.DescribeVpcsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVpnConnections = "DescribeVpnConnections" @@ -10425,8 +12942,23 @@ func (c *EC2) DescribeVpnConnectionsRequest(input *DescribeVpnConnectionsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnConnections func (c *EC2) DescribeVpnConnections(input *DescribeVpnConnectionsInput) (*DescribeVpnConnectionsOutput, error) { req, out := c.DescribeVpnConnectionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVpnConnectionsWithContext is the same as DescribeVpnConnections with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpnConnections for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVpnConnectionsWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.Option) (*DescribeVpnConnectionsOutput, error) { + req, out := c.DescribeVpnConnectionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVpnGateways = "DescribeVpnGateways" @@ -10489,8 +13021,23 @@ func (c *EC2) DescribeVpnGatewaysRequest(input *DescribeVpnGatewaysInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnGateways func (c *EC2) DescribeVpnGateways(input *DescribeVpnGatewaysInput) (*DescribeVpnGatewaysOutput, error) { req, out := c.DescribeVpnGatewaysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVpnGatewaysWithContext is the same as DescribeVpnGateways with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpnGateways for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVpnGatewaysWithContext(ctx aws.Context, input *DescribeVpnGatewaysInput, opts ...request.Option) (*DescribeVpnGatewaysOutput, error) { + req, out := c.DescribeVpnGatewaysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachClassicLinkVpc = "DetachClassicLinkVpc" @@ -10551,8 +13098,23 @@ func (c *EC2) DetachClassicLinkVpcRequest(input *DetachClassicLinkVpcInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachClassicLinkVpc func (c *EC2) DetachClassicLinkVpc(input *DetachClassicLinkVpcInput) (*DetachClassicLinkVpcOutput, error) { req, out := c.DetachClassicLinkVpcRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachClassicLinkVpcWithContext is the same as DetachClassicLinkVpc with the addition of +// the ability to pass a context and additional request options. +// +// See DetachClassicLinkVpc for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachClassicLinkVpcWithContext(ctx aws.Context, input *DetachClassicLinkVpcInput, opts ...request.Option) (*DetachClassicLinkVpcOutput, error) { + req, out := c.DetachClassicLinkVpcRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachInternetGateway = "DetachInternetGateway" @@ -10615,8 +13177,23 @@ func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachInternetGateway func (c *EC2) DetachInternetGateway(input *DetachInternetGatewayInput) (*DetachInternetGatewayOutput, error) { req, out := c.DetachInternetGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachInternetGatewayWithContext is the same as DetachInternetGateway with the addition of +// the ability to pass a context and additional request options. +// +// See DetachInternetGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachInternetGatewayWithContext(ctx aws.Context, input *DetachInternetGatewayInput, opts ...request.Option) (*DetachInternetGatewayOutput, error) { + req, out := c.DetachInternetGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachNetworkInterface = "DetachNetworkInterface" @@ -10677,8 +13254,23 @@ func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachNetworkInterface func (c *EC2) DetachNetworkInterface(input *DetachNetworkInterfaceInput) (*DetachNetworkInterfaceOutput, error) { req, out := c.DetachNetworkInterfaceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachNetworkInterfaceWithContext is the same as DetachNetworkInterface with the addition of +// the ability to pass a context and additional request options. +// +// See DetachNetworkInterface for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachNetworkInterfaceWithContext(ctx aws.Context, input *DetachNetworkInterfaceInput, opts ...request.Option) (*DetachNetworkInterfaceOutput, error) { + req, out := c.DetachNetworkInterfaceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachVolume = "DetachVolume" @@ -10750,8 +13342,23 @@ func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVolume func (c *EC2) DetachVolume(input *DetachVolumeInput) (*VolumeAttachment, error) { req, out := c.DetachVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachVolumeWithContext is the same as DetachVolume with the addition of +// the ability to pass a context and additional request options. +// +// See DetachVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachVolumeWithContext(ctx aws.Context, input *DetachVolumeInput, opts ...request.Option) (*VolumeAttachment, error) { + req, out := c.DetachVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachVpnGateway = "DetachVpnGateway" @@ -10819,8 +13426,23 @@ func (c *EC2) DetachVpnGatewayRequest(input *DetachVpnGatewayInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGateway func (c *EC2) DetachVpnGateway(input *DetachVpnGatewayInput) (*DetachVpnGatewayOutput, error) { req, out := c.DetachVpnGatewayRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachVpnGatewayWithContext is the same as DetachVpnGateway with the addition of +// the ability to pass a context and additional request options. +// +// See DetachVpnGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachVpnGatewayWithContext(ctx aws.Context, input *DetachVpnGatewayInput, opts ...request.Option) (*DetachVpnGatewayOutput, error) { + req, out := c.DetachVpnGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation" @@ -10882,8 +13504,23 @@ func (c *EC2) DisableVgwRoutePropagationRequest(input *DisableVgwRoutePropagatio // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVgwRoutePropagation func (c *EC2) DisableVgwRoutePropagation(input *DisableVgwRoutePropagationInput) (*DisableVgwRoutePropagationOutput, error) { req, out := c.DisableVgwRoutePropagationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableVgwRoutePropagationWithContext is the same as DisableVgwRoutePropagation with the addition of +// the ability to pass a context and additional request options. +// +// See DisableVgwRoutePropagation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableVgwRoutePropagationWithContext(ctx aws.Context, input *DisableVgwRoutePropagationInput, opts ...request.Option) (*DisableVgwRoutePropagationOutput, error) { + req, out := c.DisableVgwRoutePropagationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableVpcClassicLink = "DisableVpcClassicLink" @@ -10943,8 +13580,23 @@ func (c *EC2) DisableVpcClassicLinkRequest(input *DisableVpcClassicLinkInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLink func (c *EC2) DisableVpcClassicLink(input *DisableVpcClassicLinkInput) (*DisableVpcClassicLinkOutput, error) { req, out := c.DisableVpcClassicLinkRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableVpcClassicLinkWithContext is the same as DisableVpcClassicLink with the addition of +// the ability to pass a context and additional request options. +// +// See DisableVpcClassicLink for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableVpcClassicLinkWithContext(ctx aws.Context, input *DisableVpcClassicLinkInput, opts ...request.Option) (*DisableVpcClassicLinkOutput, error) { + req, out := c.DisableVpcClassicLinkRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableVpcClassicLinkDnsSupport = "DisableVpcClassicLinkDnsSupport" @@ -11007,8 +13659,23 @@ func (c *EC2) DisableVpcClassicLinkDnsSupportRequest(input *DisableVpcClassicLin // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkDnsSupport func (c *EC2) DisableVpcClassicLinkDnsSupport(input *DisableVpcClassicLinkDnsSupportInput) (*DisableVpcClassicLinkDnsSupportOutput, error) { req, out := c.DisableVpcClassicLinkDnsSupportRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableVpcClassicLinkDnsSupportWithContext is the same as DisableVpcClassicLinkDnsSupport with the addition of +// the ability to pass a context and additional request options. +// +// See DisableVpcClassicLinkDnsSupport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DisableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DisableVpcClassicLinkDnsSupportOutput, error) { + req, out := c.DisableVpcClassicLinkDnsSupportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisassociateAddress = "DisassociateAddress" @@ -11077,8 +13744,23 @@ func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateAddress func (c *EC2) DisassociateAddress(input *DisassociateAddressInput) (*DisassociateAddressOutput, error) { req, out := c.DisassociateAddressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisassociateAddressWithContext is the same as DisassociateAddress with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateAddress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisassociateAddressWithContext(ctx aws.Context, input *DisassociateAddressInput, opts ...request.Option) (*DisassociateAddressOutput, error) { + req, out := c.DisassociateAddressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisassociateIamInstanceProfile = "DisassociateIamInstanceProfile" @@ -11139,8 +13821,23 @@ func (c *EC2) DisassociateIamInstanceProfileRequest(input *DisassociateIamInstan // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfile func (c *EC2) DisassociateIamInstanceProfile(input *DisassociateIamInstanceProfileInput) (*DisassociateIamInstanceProfileOutput, error) { req, out := c.DisassociateIamInstanceProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisassociateIamInstanceProfileWithContext is the same as DisassociateIamInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateIamInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisassociateIamInstanceProfileWithContext(ctx aws.Context, input *DisassociateIamInstanceProfileInput, opts ...request.Option) (*DisassociateIamInstanceProfileOutput, error) { + req, out := c.DisassociateIamInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisassociateRouteTable = "DisassociateRouteTable" @@ -11206,8 +13903,23 @@ func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTable func (c *EC2) DisassociateRouteTable(input *DisassociateRouteTableInput) (*DisassociateRouteTableOutput, error) { req, out := c.DisassociateRouteTableRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisassociateRouteTableWithContext is the same as DisassociateRouteTable with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateRouteTable for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisassociateRouteTableWithContext(ctx aws.Context, input *DisassociateRouteTableInput, opts ...request.Option) (*DisassociateRouteTableOutput, error) { + req, out := c.DisassociateRouteTableRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisassociateSubnetCidrBlock = "DisassociateSubnetCidrBlock" @@ -11268,8 +13980,23 @@ func (c *EC2) DisassociateSubnetCidrBlockRequest(input *DisassociateSubnetCidrBl // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSubnetCidrBlock func (c *EC2) DisassociateSubnetCidrBlock(input *DisassociateSubnetCidrBlockInput) (*DisassociateSubnetCidrBlockOutput, error) { req, out := c.DisassociateSubnetCidrBlockRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisassociateSubnetCidrBlockWithContext is the same as DisassociateSubnetCidrBlock with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateSubnetCidrBlock for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisassociateSubnetCidrBlockWithContext(ctx aws.Context, input *DisassociateSubnetCidrBlockInput, opts ...request.Option) (*DisassociateSubnetCidrBlockOutput, error) { + req, out := c.DisassociateSubnetCidrBlockRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisassociateVpcCidrBlock = "DisassociateVpcCidrBlock" @@ -11330,8 +14057,23 @@ func (c *EC2) DisassociateVpcCidrBlockRequest(input *DisassociateVpcCidrBlockInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateVpcCidrBlock func (c *EC2) DisassociateVpcCidrBlock(input *DisassociateVpcCidrBlockInput) (*DisassociateVpcCidrBlockOutput, error) { req, out := c.DisassociateVpcCidrBlockRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisassociateVpcCidrBlockWithContext is the same as DisassociateVpcCidrBlock with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateVpcCidrBlock for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisassociateVpcCidrBlockWithContext(ctx aws.Context, input *DisassociateVpcCidrBlockInput, opts ...request.Option) (*DisassociateVpcCidrBlockOutput, error) { + req, out := c.DisassociateVpcCidrBlockRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation" @@ -11393,8 +14135,23 @@ func (c *EC2) EnableVgwRoutePropagationRequest(input *EnableVgwRoutePropagationI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVgwRoutePropagation func (c *EC2) EnableVgwRoutePropagation(input *EnableVgwRoutePropagationInput) (*EnableVgwRoutePropagationOutput, error) { req, out := c.EnableVgwRoutePropagationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableVgwRoutePropagationWithContext is the same as EnableVgwRoutePropagation with the addition of +// the ability to pass a context and additional request options. +// +// See EnableVgwRoutePropagation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableVgwRoutePropagationWithContext(ctx aws.Context, input *EnableVgwRoutePropagationInput, opts ...request.Option) (*EnableVgwRoutePropagationOutput, error) { + req, out := c.EnableVgwRoutePropagationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableVolumeIO = "EnableVolumeIO" @@ -11456,8 +14213,23 @@ func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVolumeIO func (c *EC2) EnableVolumeIO(input *EnableVolumeIOInput) (*EnableVolumeIOOutput, error) { req, out := c.EnableVolumeIORequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableVolumeIOWithContext is the same as EnableVolumeIO with the addition of +// the ability to pass a context and additional request options. +// +// See EnableVolumeIO for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableVolumeIOWithContext(ctx aws.Context, input *EnableVolumeIOInput, opts ...request.Option) (*EnableVolumeIOOutput, error) { + req, out := c.EnableVolumeIORequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableVpcClassicLink = "EnableVpcClassicLink" @@ -11522,8 +14294,23 @@ func (c *EC2) EnableVpcClassicLinkRequest(input *EnableVpcClassicLinkInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLink func (c *EC2) EnableVpcClassicLink(input *EnableVpcClassicLinkInput) (*EnableVpcClassicLinkOutput, error) { req, out := c.EnableVpcClassicLinkRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableVpcClassicLinkWithContext is the same as EnableVpcClassicLink with the addition of +// the ability to pass a context and additional request options. +// +// See EnableVpcClassicLink for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableVpcClassicLinkWithContext(ctx aws.Context, input *EnableVpcClassicLinkInput, opts ...request.Option) (*EnableVpcClassicLinkOutput, error) { + req, out := c.EnableVpcClassicLinkRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableVpcClassicLinkDnsSupport = "EnableVpcClassicLinkDnsSupport" @@ -11588,8 +14375,23 @@ func (c *EC2) EnableVpcClassicLinkDnsSupportRequest(input *EnableVpcClassicLinkD // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkDnsSupport func (c *EC2) EnableVpcClassicLinkDnsSupport(input *EnableVpcClassicLinkDnsSupportInput) (*EnableVpcClassicLinkDnsSupportOutput, error) { req, out := c.EnableVpcClassicLinkDnsSupportRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableVpcClassicLinkDnsSupportWithContext is the same as EnableVpcClassicLinkDnsSupport with the addition of +// the ability to pass a context and additional request options. +// +// See EnableVpcClassicLinkDnsSupport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *EnableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*EnableVpcClassicLinkDnsSupportOutput, error) { + req, out := c.EnableVpcClassicLinkDnsSupportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetConsoleOutput = "GetConsoleOutput" @@ -11665,8 +14467,23 @@ func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutput func (c *EC2) GetConsoleOutput(input *GetConsoleOutputInput) (*GetConsoleOutputOutput, error) { req, out := c.GetConsoleOutputRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetConsoleOutputWithContext is the same as GetConsoleOutput with the addition of +// the ability to pass a context and additional request options. +// +// See GetConsoleOutput for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetConsoleOutputWithContext(ctx aws.Context, input *GetConsoleOutputInput, opts ...request.Option) (*GetConsoleOutputOutput, error) { + req, out := c.GetConsoleOutputRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetConsoleScreenshot = "GetConsoleScreenshot" @@ -11727,8 +14544,23 @@ func (c *EC2) GetConsoleScreenshotRequest(input *GetConsoleScreenshotInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleScreenshot func (c *EC2) GetConsoleScreenshot(input *GetConsoleScreenshotInput) (*GetConsoleScreenshotOutput, error) { req, out := c.GetConsoleScreenshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetConsoleScreenshotWithContext is the same as GetConsoleScreenshot with the addition of +// the ability to pass a context and additional request options. +// +// See GetConsoleScreenshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetConsoleScreenshotWithContext(ctx aws.Context, input *GetConsoleScreenshotInput, opts ...request.Option) (*GetConsoleScreenshotOutput, error) { + req, out := c.GetConsoleScreenshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetHostReservationPurchasePreview = "GetHostReservationPurchasePreview" @@ -11792,8 +14624,23 @@ func (c *EC2) GetHostReservationPurchasePreviewRequest(input *GetHostReservation // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetHostReservationPurchasePreview func (c *EC2) GetHostReservationPurchasePreview(input *GetHostReservationPurchasePreviewInput) (*GetHostReservationPurchasePreviewOutput, error) { req, out := c.GetHostReservationPurchasePreviewRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetHostReservationPurchasePreviewWithContext is the same as GetHostReservationPurchasePreview with the addition of +// the ability to pass a context and additional request options. +// +// See GetHostReservationPurchasePreview for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetHostReservationPurchasePreviewWithContext(ctx aws.Context, input *GetHostReservationPurchasePreviewInput, opts ...request.Option) (*GetHostReservationPurchasePreviewOutput, error) { + req, out := c.GetHostReservationPurchasePreviewRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPasswordData = "GetPasswordData" @@ -11865,8 +14712,23 @@ func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetPasswordData func (c *EC2) GetPasswordData(input *GetPasswordDataInput) (*GetPasswordDataOutput, error) { req, out := c.GetPasswordDataRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPasswordDataWithContext is the same as GetPasswordData with the addition of +// the ability to pass a context and additional request options. +// +// See GetPasswordData for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetPasswordDataWithContext(ctx aws.Context, input *GetPasswordDataInput, opts ...request.Option) (*GetPasswordDataOutput, error) { + req, out := c.GetPasswordDataRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetReservedInstancesExchangeQuote = "GetReservedInstancesExchangeQuote" @@ -11927,8 +14789,23 @@ func (c *EC2) GetReservedInstancesExchangeQuoteRequest(input *GetReservedInstanc // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetReservedInstancesExchangeQuote func (c *EC2) GetReservedInstancesExchangeQuote(input *GetReservedInstancesExchangeQuoteInput) (*GetReservedInstancesExchangeQuoteOutput, error) { req, out := c.GetReservedInstancesExchangeQuoteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetReservedInstancesExchangeQuoteWithContext is the same as GetReservedInstancesExchangeQuote with the addition of +// the ability to pass a context and additional request options. +// +// See GetReservedInstancesExchangeQuote for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetReservedInstancesExchangeQuoteWithContext(ctx aws.Context, input *GetReservedInstancesExchangeQuoteInput, opts ...request.Option) (*GetReservedInstancesExchangeQuoteOutput, error) { + req, out := c.GetReservedInstancesExchangeQuoteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportImage = "ImportImage" @@ -11990,8 +14867,23 @@ func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImage func (c *EC2) ImportImage(input *ImportImageInput) (*ImportImageOutput, error) { req, out := c.ImportImageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportImageWithContext is the same as ImportImage with the addition of +// the ability to pass a context and additional request options. +// +// See ImportImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportImageWithContext(ctx aws.Context, input *ImportImageInput, opts ...request.Option) (*ImportImageOutput, error) { + req, out := c.ImportImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportInstance = "ImportInstance" @@ -12056,8 +14948,23 @@ func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstance func (c *EC2) ImportInstance(input *ImportInstanceInput) (*ImportInstanceOutput, error) { req, out := c.ImportInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportInstanceWithContext is the same as ImportInstance with the addition of +// the ability to pass a context and additional request options. +// +// See ImportInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportInstanceWithContext(ctx aws.Context, input *ImportInstanceInput, opts ...request.Option) (*ImportInstanceOutput, error) { + req, out := c.ImportInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportKeyPair = "ImportKeyPair" @@ -12123,8 +15030,23 @@ func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportKeyPair func (c *EC2) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, error) { req, out := c.ImportKeyPairRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportKeyPairWithContext is the same as ImportKeyPair with the addition of +// the ability to pass a context and additional request options. +// +// See ImportKeyPair for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportKeyPairWithContext(ctx aws.Context, input *ImportKeyPairInput, opts ...request.Option) (*ImportKeyPairOutput, error) { + req, out := c.ImportKeyPairRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportSnapshot = "ImportSnapshot" @@ -12183,8 +15105,23 @@ func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshot func (c *EC2) ImportSnapshot(input *ImportSnapshotInput) (*ImportSnapshotOutput, error) { req, out := c.ImportSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportSnapshotWithContext is the same as ImportSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See ImportSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportSnapshotWithContext(ctx aws.Context, input *ImportSnapshotInput, opts ...request.Option) (*ImportSnapshotOutput, error) { + req, out := c.ImportSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportVolume = "ImportVolume" @@ -12247,8 +15184,23 @@ func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolume func (c *EC2) ImportVolume(input *ImportVolumeInput) (*ImportVolumeOutput, error) { req, out := c.ImportVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportVolumeWithContext is the same as ImportVolume with the addition of +// the ability to pass a context and additional request options. +// +// See ImportVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportVolumeWithContext(ctx aws.Context, input *ImportVolumeInput, opts ...request.Option) (*ImportVolumeOutput, error) { + req, out := c.ImportVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyHosts = "ModifyHosts" @@ -12313,8 +15265,23 @@ func (c *EC2) ModifyHostsRequest(input *ModifyHostsInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyHosts func (c *EC2) ModifyHosts(input *ModifyHostsInput) (*ModifyHostsOutput, error) { req, out := c.ModifyHostsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyHostsWithContext is the same as ModifyHosts with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyHosts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyHostsWithContext(ctx aws.Context, input *ModifyHostsInput, opts ...request.Option) (*ModifyHostsOutput, error) { + req, out := c.ModifyHostsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyIdFormat = "ModifyIdFormat" @@ -12389,8 +15356,23 @@ func (c *EC2) ModifyIdFormatRequest(input *ModifyIdFormatInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdFormat func (c *EC2) ModifyIdFormat(input *ModifyIdFormatInput) (*ModifyIdFormatOutput, error) { req, out := c.ModifyIdFormatRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyIdFormatWithContext is the same as ModifyIdFormat with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyIdFormat for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyIdFormatWithContext(ctx aws.Context, input *ModifyIdFormatInput, opts ...request.Option) (*ModifyIdFormatOutput, error) { + req, out := c.ModifyIdFormatRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyIdentityIdFormat = "ModifyIdentityIdFormat" @@ -12465,8 +15447,23 @@ func (c *EC2) ModifyIdentityIdFormatRequest(input *ModifyIdentityIdFormatInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdentityIdFormat func (c *EC2) ModifyIdentityIdFormat(input *ModifyIdentityIdFormatInput) (*ModifyIdentityIdFormatOutput, error) { req, out := c.ModifyIdentityIdFormatRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyIdentityIdFormatWithContext is the same as ModifyIdentityIdFormat with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyIdentityIdFormat for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyIdentityIdFormatWithContext(ctx aws.Context, input *ModifyIdentityIdFormatInput, opts ...request.Option) (*ModifyIdentityIdFormatOutput, error) { + req, out := c.ModifyIdentityIdFormatRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyImageAttribute = "ModifyImageAttribute" @@ -12536,8 +15533,23 @@ func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyImageAttribute func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyImageAttributeOutput, error) { req, out := c.ModifyImageAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyImageAttributeWithContext is the same as ModifyImageAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyImageAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyImageAttributeWithContext(ctx aws.Context, input *ModifyImageAttributeInput, opts ...request.Option) (*ModifyImageAttributeOutput, error) { + req, out := c.ModifyImageAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyInstanceAttribute = "ModifyInstanceAttribute" @@ -12603,8 +15615,23 @@ func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceAttribute func (c *EC2) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (*ModifyInstanceAttributeOutput, error) { req, out := c.ModifyInstanceAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyInstanceAttributeWithContext is the same as ModifyInstanceAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyInstanceAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyInstanceAttributeWithContext(ctx aws.Context, input *ModifyInstanceAttributeInput, opts ...request.Option) (*ModifyInstanceAttributeOutput, error) { + req, out := c.ModifyInstanceAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyInstancePlacement = "ModifyInstancePlacement" @@ -12681,8 +15708,23 @@ func (c *EC2) ModifyInstancePlacementRequest(input *ModifyInstancePlacementInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstancePlacement func (c *EC2) ModifyInstancePlacement(input *ModifyInstancePlacementInput) (*ModifyInstancePlacementOutput, error) { req, out := c.ModifyInstancePlacementRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyInstancePlacementWithContext is the same as ModifyInstancePlacement with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyInstancePlacement for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyInstancePlacementWithContext(ctx aws.Context, input *ModifyInstancePlacementInput, opts ...request.Option) (*ModifyInstancePlacementOutput, error) { + req, out := c.ModifyInstancePlacementRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" @@ -12744,8 +15786,23 @@ func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfa // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyNetworkInterfaceAttribute func (c *EC2) ModifyNetworkInterfaceAttribute(input *ModifyNetworkInterfaceAttributeInput) (*ModifyNetworkInterfaceAttributeOutput, error) { req, out := c.ModifyNetworkInterfaceAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyNetworkInterfaceAttributeWithContext is the same as ModifyNetworkInterfaceAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyNetworkInterfaceAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ModifyNetworkInterfaceAttributeInput, opts ...request.Option) (*ModifyNetworkInterfaceAttributeOutput, error) { + req, out := c.ModifyNetworkInterfaceAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyReservedInstances = "ModifyReservedInstances" @@ -12810,8 +15867,23 @@ func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyReservedInstances func (c *EC2) ModifyReservedInstances(input *ModifyReservedInstancesInput) (*ModifyReservedInstancesOutput, error) { req, out := c.ModifyReservedInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyReservedInstancesWithContext is the same as ModifyReservedInstances with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyReservedInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyReservedInstancesWithContext(ctx aws.Context, input *ModifyReservedInstancesInput, opts ...request.Option) (*ModifyReservedInstancesOutput, error) { + req, out := c.ModifyReservedInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifySnapshotAttribute = "ModifySnapshotAttribute" @@ -12884,8 +15956,23 @@ func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySnapshotAttribute func (c *EC2) ModifySnapshotAttribute(input *ModifySnapshotAttributeInput) (*ModifySnapshotAttributeOutput, error) { req, out := c.ModifySnapshotAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifySnapshotAttributeWithContext is the same as ModifySnapshotAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifySnapshotAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifySnapshotAttributeWithContext(ctx aws.Context, input *ModifySnapshotAttributeInput, opts ...request.Option) (*ModifySnapshotAttributeOutput, error) { + req, out := c.ModifySnapshotAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifySpotFleetRequest = "ModifySpotFleetRequest" @@ -12963,8 +16050,23 @@ func (c *EC2) ModifySpotFleetRequestRequest(input *ModifySpotFleetRequestInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySpotFleetRequest func (c *EC2) ModifySpotFleetRequest(input *ModifySpotFleetRequestInput) (*ModifySpotFleetRequestOutput, error) { req, out := c.ModifySpotFleetRequestRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifySpotFleetRequestWithContext is the same as ModifySpotFleetRequest with the addition of +// the ability to pass a context and additional request options. +// +// See ModifySpotFleetRequest for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifySpotFleetRequestWithContext(ctx aws.Context, input *ModifySpotFleetRequestInput, opts ...request.Option) (*ModifySpotFleetRequestOutput, error) { + req, out := c.ModifySpotFleetRequestRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifySubnetAttribute = "ModifySubnetAttribute" @@ -13025,8 +16127,23 @@ func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySubnetAttribute func (c *EC2) ModifySubnetAttribute(input *ModifySubnetAttributeInput) (*ModifySubnetAttributeOutput, error) { req, out := c.ModifySubnetAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifySubnetAttributeWithContext is the same as ModifySubnetAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifySubnetAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifySubnetAttributeWithContext(ctx aws.Context, input *ModifySubnetAttributeInput, opts ...request.Option) (*ModifySubnetAttributeOutput, error) { + req, out := c.ModifySubnetAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyVolume = "ModifyVolume" @@ -13117,8 +16234,23 @@ func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolume func (c *EC2) ModifyVolume(input *ModifyVolumeInput) (*ModifyVolumeOutput, error) { req, out := c.ModifyVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyVolumeWithContext is the same as ModifyVolume with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyVolumeWithContext(ctx aws.Context, input *ModifyVolumeInput, opts ...request.Option) (*ModifyVolumeOutput, error) { + req, out := c.ModifyVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyVolumeAttribute = "ModifyVolumeAttribute" @@ -13188,8 +16320,23 @@ func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeAttribute func (c *EC2) ModifyVolumeAttribute(input *ModifyVolumeAttributeInput) (*ModifyVolumeAttributeOutput, error) { req, out := c.ModifyVolumeAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyVolumeAttributeWithContext is the same as ModifyVolumeAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyVolumeAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyVolumeAttributeWithContext(ctx aws.Context, input *ModifyVolumeAttributeInput, opts ...request.Option) (*ModifyVolumeAttributeOutput, error) { + req, out := c.ModifyVolumeAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyVpcAttribute = "ModifyVpcAttribute" @@ -13250,8 +16397,23 @@ func (c *EC2) ModifyVpcAttributeRequest(input *ModifyVpcAttributeInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttribute func (c *EC2) ModifyVpcAttribute(input *ModifyVpcAttributeInput) (*ModifyVpcAttributeOutput, error) { req, out := c.ModifyVpcAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyVpcAttributeWithContext is the same as ModifyVpcAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyVpcAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyVpcAttributeWithContext(ctx aws.Context, input *ModifyVpcAttributeInput, opts ...request.Option) (*ModifyVpcAttributeOutput, error) { + req, out := c.ModifyVpcAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyVpcEndpoint = "ModifyVpcEndpoint" @@ -13312,8 +16474,23 @@ func (c *EC2) ModifyVpcEndpointRequest(input *ModifyVpcEndpointInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpoint func (c *EC2) ModifyVpcEndpoint(input *ModifyVpcEndpointInput) (*ModifyVpcEndpointOutput, error) { req, out := c.ModifyVpcEndpointRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyVpcEndpointWithContext is the same as ModifyVpcEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyVpcEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyVpcEndpointWithContext(ctx aws.Context, input *ModifyVpcEndpointInput, opts ...request.Option) (*ModifyVpcEndpointOutput, error) { + req, out := c.ModifyVpcEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyVpcPeeringConnectionOptions = "ModifyVpcPeeringConnectionOptions" @@ -13391,8 +16568,23 @@ func (c *EC2) ModifyVpcPeeringConnectionOptionsRequest(input *ModifyVpcPeeringCo // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcPeeringConnectionOptions func (c *EC2) ModifyVpcPeeringConnectionOptions(input *ModifyVpcPeeringConnectionOptionsInput) (*ModifyVpcPeeringConnectionOptionsOutput, error) { req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyVpcPeeringConnectionOptionsWithContext is the same as ModifyVpcPeeringConnectionOptions with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyVpcPeeringConnectionOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyVpcPeeringConnectionOptionsWithContext(ctx aws.Context, input *ModifyVpcPeeringConnectionOptionsInput, opts ...request.Option) (*ModifyVpcPeeringConnectionOptionsOutput, error) { + req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opMonitorInstances = "MonitorInstances" @@ -13456,8 +16648,23 @@ func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MonitorInstances func (c *EC2) MonitorInstances(input *MonitorInstancesInput) (*MonitorInstancesOutput, error) { req, out := c.MonitorInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// MonitorInstancesWithContext is the same as MonitorInstances with the addition of +// the ability to pass a context and additional request options. +// +// See MonitorInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) MonitorInstancesWithContext(ctx aws.Context, input *MonitorInstancesInput, opts ...request.Option) (*MonitorInstancesOutput, error) { + req, out := c.MonitorInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opMoveAddressToVpc = "MoveAddressToVpc" @@ -13522,8 +16729,23 @@ func (c *EC2) MoveAddressToVpcRequest(input *MoveAddressToVpcInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MoveAddressToVpc func (c *EC2) MoveAddressToVpc(input *MoveAddressToVpcInput) (*MoveAddressToVpcOutput, error) { req, out := c.MoveAddressToVpcRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// MoveAddressToVpcWithContext is the same as MoveAddressToVpc with the addition of +// the ability to pass a context and additional request options. +// +// See MoveAddressToVpc for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) MoveAddressToVpcWithContext(ctx aws.Context, input *MoveAddressToVpcInput, opts ...request.Option) (*MoveAddressToVpcOutput, error) { + req, out := c.MoveAddressToVpcRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPurchaseHostReservation = "PurchaseHostReservation" @@ -13585,8 +16807,23 @@ func (c *EC2) PurchaseHostReservationRequest(input *PurchaseHostReservationInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseHostReservation func (c *EC2) PurchaseHostReservation(input *PurchaseHostReservationInput) (*PurchaseHostReservationOutput, error) { req, out := c.PurchaseHostReservationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PurchaseHostReservationWithContext is the same as PurchaseHostReservation with the addition of +// the ability to pass a context and additional request options. +// +// See PurchaseHostReservation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PurchaseHostReservationWithContext(ctx aws.Context, input *PurchaseHostReservationInput, opts ...request.Option) (*PurchaseHostReservationOutput, error) { + req, out := c.PurchaseHostReservationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering" @@ -13654,8 +16891,23 @@ func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseReservedInstancesOffering func (c *EC2) PurchaseReservedInstancesOffering(input *PurchaseReservedInstancesOfferingInput) (*PurchaseReservedInstancesOfferingOutput, error) { req, out := c.PurchaseReservedInstancesOfferingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PurchaseReservedInstancesOfferingWithContext is the same as PurchaseReservedInstancesOffering with the addition of +// the ability to pass a context and additional request options. +// +// See PurchaseReservedInstancesOffering for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PurchaseReservedInstancesOfferingWithContext(ctx aws.Context, input *PurchaseReservedInstancesOfferingInput, opts ...request.Option) (*PurchaseReservedInstancesOfferingOutput, error) { + req, out := c.PurchaseReservedInstancesOfferingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPurchaseScheduledInstances = "PurchaseScheduledInstances" @@ -13723,8 +16975,23 @@ func (c *EC2) PurchaseScheduledInstancesRequest(input *PurchaseScheduledInstance // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseScheduledInstances func (c *EC2) PurchaseScheduledInstances(input *PurchaseScheduledInstancesInput) (*PurchaseScheduledInstancesOutput, error) { req, out := c.PurchaseScheduledInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PurchaseScheduledInstancesWithContext is the same as PurchaseScheduledInstances with the addition of +// the ability to pass a context and additional request options. +// +// See PurchaseScheduledInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PurchaseScheduledInstancesWithContext(ctx aws.Context, input *PurchaseScheduledInstancesInput, opts ...request.Option) (*PurchaseScheduledInstancesOutput, error) { + req, out := c.PurchaseScheduledInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRebootInstances = "RebootInstances" @@ -13795,8 +17062,23 @@ func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RebootInstances func (c *EC2) RebootInstances(input *RebootInstancesInput) (*RebootInstancesOutput, error) { req, out := c.RebootInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RebootInstancesWithContext is the same as RebootInstances with the addition of +// the ability to pass a context and additional request options. +// +// See RebootInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RebootInstancesWithContext(ctx aws.Context, input *RebootInstancesInput, opts ...request.Option) (*RebootInstancesOutput, error) { + req, out := c.RebootInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterImage = "RegisterImage" @@ -13854,8 +17136,8 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ // // You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from // a snapshot of a root device volume. You specify the snapshot using the block -// device mapping. For more information, see Launching an Instance from a Snapshot -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_LaunchingInstanceFromSnapshot.html) +// device mapping. For more information, see Launching a Linux Instance from +// a Backup (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html) // in the Amazon Elastic Compute Cloud User Guide. // // You can't register an image where a secondary (non-root) snapshot has AWS @@ -13883,8 +17165,23 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterImage func (c *EC2) RegisterImage(input *RegisterImageInput) (*RegisterImageOutput, error) { req, out := c.RegisterImageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterImageWithContext is the same as RegisterImage with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterImageWithContext(ctx aws.Context, input *RegisterImageInput, opts ...request.Option) (*RegisterImageOutput, error) { + req, out := c.RegisterImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection" @@ -13947,8 +17244,23 @@ func (c *EC2) RejectVpcPeeringConnectionRequest(input *RejectVpcPeeringConnectio // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcPeeringConnection func (c *EC2) RejectVpcPeeringConnection(input *RejectVpcPeeringConnectionInput) (*RejectVpcPeeringConnectionOutput, error) { req, out := c.RejectVpcPeeringConnectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RejectVpcPeeringConnectionWithContext is the same as RejectVpcPeeringConnection with the addition of +// the ability to pass a context and additional request options. +// +// See RejectVpcPeeringConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RejectVpcPeeringConnectionWithContext(ctx aws.Context, input *RejectVpcPeeringConnectionInput, opts ...request.Option) (*RejectVpcPeeringConnectionOutput, error) { + req, out := c.RejectVpcPeeringConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReleaseAddress = "ReleaseAddress" @@ -14023,8 +17335,23 @@ func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseAddress func (c *EC2) ReleaseAddress(input *ReleaseAddressInput) (*ReleaseAddressOutput, error) { req, out := c.ReleaseAddressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReleaseAddressWithContext is the same as ReleaseAddress with the addition of +// the ability to pass a context and additional request options. +// +// See ReleaseAddress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReleaseAddressWithContext(ctx aws.Context, input *ReleaseAddressInput, opts ...request.Option) (*ReleaseAddressOutput, error) { + req, out := c.ReleaseAddressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReleaseHosts = "ReleaseHosts" @@ -14094,8 +17421,23 @@ func (c *EC2) ReleaseHostsRequest(input *ReleaseHostsInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseHosts func (c *EC2) ReleaseHosts(input *ReleaseHostsInput) (*ReleaseHostsOutput, error) { req, out := c.ReleaseHostsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReleaseHostsWithContext is the same as ReleaseHosts with the addition of +// the ability to pass a context and additional request options. +// +// See ReleaseHosts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReleaseHostsWithContext(ctx aws.Context, input *ReleaseHostsInput, opts ...request.Option) (*ReleaseHostsOutput, error) { + req, out := c.ReleaseHostsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReplaceIamInstanceProfileAssociation = "ReplaceIamInstanceProfileAssociation" @@ -14159,8 +17501,23 @@ func (c *EC2) ReplaceIamInstanceProfileAssociationRequest(input *ReplaceIamInsta // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation func (c *EC2) ReplaceIamInstanceProfileAssociation(input *ReplaceIamInstanceProfileAssociationInput) (*ReplaceIamInstanceProfileAssociationOutput, error) { req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReplaceIamInstanceProfileAssociationWithContext is the same as ReplaceIamInstanceProfileAssociation with the addition of +// the ability to pass a context and additional request options. +// +// See ReplaceIamInstanceProfileAssociation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReplaceIamInstanceProfileAssociationWithContext(ctx aws.Context, input *ReplaceIamInstanceProfileAssociationInput, opts ...request.Option) (*ReplaceIamInstanceProfileAssociationOutput, error) { + req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" @@ -14222,8 +17579,23 @@ func (c *EC2) ReplaceNetworkAclAssociationRequest(input *ReplaceNetworkAclAssoci // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociation func (c *EC2) ReplaceNetworkAclAssociation(input *ReplaceNetworkAclAssociationInput) (*ReplaceNetworkAclAssociationOutput, error) { req, out := c.ReplaceNetworkAclAssociationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReplaceNetworkAclAssociationWithContext is the same as ReplaceNetworkAclAssociation with the addition of +// the ability to pass a context and additional request options. +// +// See ReplaceNetworkAclAssociation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReplaceNetworkAclAssociationWithContext(ctx aws.Context, input *ReplaceNetworkAclAssociationInput, opts ...request.Option) (*ReplaceNetworkAclAssociationOutput, error) { + req, out := c.ReplaceNetworkAclAssociationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry" @@ -14286,8 +17658,23 @@ func (c *EC2) ReplaceNetworkAclEntryRequest(input *ReplaceNetworkAclEntryInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclEntry func (c *EC2) ReplaceNetworkAclEntry(input *ReplaceNetworkAclEntryInput) (*ReplaceNetworkAclEntryOutput, error) { req, out := c.ReplaceNetworkAclEntryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReplaceNetworkAclEntryWithContext is the same as ReplaceNetworkAclEntry with the addition of +// the ability to pass a context and additional request options. +// +// See ReplaceNetworkAclEntry for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReplaceNetworkAclEntryWithContext(ctx aws.Context, input *ReplaceNetworkAclEntryInput, opts ...request.Option) (*ReplaceNetworkAclEntryOutput, error) { + req, out := c.ReplaceNetworkAclEntryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReplaceRoute = "ReplaceRoute" @@ -14354,8 +17741,23 @@ func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRoute func (c *EC2) ReplaceRoute(input *ReplaceRouteInput) (*ReplaceRouteOutput, error) { req, out := c.ReplaceRouteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReplaceRouteWithContext is the same as ReplaceRoute with the addition of +// the ability to pass a context and additional request options. +// +// See ReplaceRoute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReplaceRouteWithContext(ctx aws.Context, input *ReplaceRouteInput, opts ...request.Option) (*ReplaceRouteOutput, error) { + req, out := c.ReplaceRouteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation" @@ -14422,8 +17824,23 @@ func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssoci // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteTableAssociation func (c *EC2) ReplaceRouteTableAssociation(input *ReplaceRouteTableAssociationInput) (*ReplaceRouteTableAssociationOutput, error) { req, out := c.ReplaceRouteTableAssociationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReplaceRouteTableAssociationWithContext is the same as ReplaceRouteTableAssociation with the addition of +// the ability to pass a context and additional request options. +// +// See ReplaceRouteTableAssociation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReplaceRouteTableAssociationWithContext(ctx aws.Context, input *ReplaceRouteTableAssociationInput, opts ...request.Option) (*ReplaceRouteTableAssociationOutput, error) { + req, out := c.ReplaceRouteTableAssociationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReportInstanceStatus = "ReportInstanceStatus" @@ -14490,8 +17907,23 @@ func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReportInstanceStatus func (c *EC2) ReportInstanceStatus(input *ReportInstanceStatusInput) (*ReportInstanceStatusOutput, error) { req, out := c.ReportInstanceStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReportInstanceStatusWithContext is the same as ReportInstanceStatus with the addition of +// the ability to pass a context and additional request options. +// +// See ReportInstanceStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReportInstanceStatusWithContext(ctx aws.Context, input *ReportInstanceStatusInput, opts ...request.Option) (*ReportInstanceStatusOutput, error) { + req, out := c.ReportInstanceStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRequestSpotFleet = "RequestSpotFleet" @@ -14566,8 +17998,23 @@ func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotFleet func (c *EC2) RequestSpotFleet(input *RequestSpotFleetInput) (*RequestSpotFleetOutput, error) { req, out := c.RequestSpotFleetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RequestSpotFleetWithContext is the same as RequestSpotFleet with the addition of +// the ability to pass a context and additional request options. +// +// See RequestSpotFleet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RequestSpotFleetWithContext(ctx aws.Context, input *RequestSpotFleetInput, opts ...request.Option) (*RequestSpotFleetOutput, error) { + req, out := c.RequestSpotFleetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRequestSpotInstances = "RequestSpotInstances" @@ -14631,8 +18078,23 @@ func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotInstances func (c *EC2) RequestSpotInstances(input *RequestSpotInstancesInput) (*RequestSpotInstancesOutput, error) { req, out := c.RequestSpotInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RequestSpotInstancesWithContext is the same as RequestSpotInstances with the addition of +// the ability to pass a context and additional request options. +// +// See RequestSpotInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RequestSpotInstancesWithContext(ctx aws.Context, input *RequestSpotInstancesInput, opts ...request.Option) (*RequestSpotInstancesOutput, error) { + req, out := c.RequestSpotInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResetImageAttribute = "ResetImageAttribute" @@ -14695,8 +18157,23 @@ func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetImageAttribute func (c *EC2) ResetImageAttribute(input *ResetImageAttributeInput) (*ResetImageAttributeOutput, error) { req, out := c.ResetImageAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResetImageAttributeWithContext is the same as ResetImageAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ResetImageAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResetImageAttributeWithContext(ctx aws.Context, input *ResetImageAttributeInput, opts ...request.Option) (*ResetImageAttributeOutput, error) { + req, out := c.ResetImageAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResetInstanceAttribute = "ResetInstanceAttribute" @@ -14765,8 +18242,23 @@ func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetInstanceAttribute func (c *EC2) ResetInstanceAttribute(input *ResetInstanceAttributeInput) (*ResetInstanceAttributeOutput, error) { req, out := c.ResetInstanceAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResetInstanceAttributeWithContext is the same as ResetInstanceAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ResetInstanceAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResetInstanceAttributeWithContext(ctx aws.Context, input *ResetInstanceAttributeInput, opts ...request.Option) (*ResetInstanceAttributeOutput, error) { + req, out := c.ResetInstanceAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute" @@ -14828,8 +18320,23 @@ func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterface // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetNetworkInterfaceAttribute func (c *EC2) ResetNetworkInterfaceAttribute(input *ResetNetworkInterfaceAttributeInput) (*ResetNetworkInterfaceAttributeOutput, error) { req, out := c.ResetNetworkInterfaceAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResetNetworkInterfaceAttributeWithContext is the same as ResetNetworkInterfaceAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ResetNetworkInterfaceAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResetNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ResetNetworkInterfaceAttributeInput, opts ...request.Option) (*ResetNetworkInterfaceAttributeOutput, error) { + req, out := c.ResetNetworkInterfaceAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResetSnapshotAttribute = "ResetSnapshotAttribute" @@ -14894,8 +18401,23 @@ func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetSnapshotAttribute func (c *EC2) ResetSnapshotAttribute(input *ResetSnapshotAttributeInput) (*ResetSnapshotAttributeOutput, error) { req, out := c.ResetSnapshotAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResetSnapshotAttributeWithContext is the same as ResetSnapshotAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ResetSnapshotAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResetSnapshotAttributeWithContext(ctx aws.Context, input *ResetSnapshotAttributeInput, opts ...request.Option) (*ResetSnapshotAttributeOutput, error) { + req, out := c.ResetSnapshotAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreAddressToClassic = "RestoreAddressToClassic" @@ -14957,8 +18479,23 @@ func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreAddressToClassic func (c *EC2) RestoreAddressToClassic(input *RestoreAddressToClassicInput) (*RestoreAddressToClassicOutput, error) { req, out := c.RestoreAddressToClassicRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreAddressToClassicWithContext is the same as RestoreAddressToClassic with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreAddressToClassic for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreAddressToClassicWithContext(ctx aws.Context, input *RestoreAddressToClassicInput, opts ...request.Option) (*RestoreAddressToClassicOutput, error) { + req, out := c.RestoreAddressToClassicRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress" @@ -15030,8 +18567,23 @@ func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupEgress func (c *EC2) RevokeSecurityGroupEgress(input *RevokeSecurityGroupEgressInput) (*RevokeSecurityGroupEgressOutput, error) { req, out := c.RevokeSecurityGroupEgressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RevokeSecurityGroupEgressWithContext is the same as RevokeSecurityGroupEgress with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeSecurityGroupEgress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RevokeSecurityGroupEgressWithContext(ctx aws.Context, input *RevokeSecurityGroupEgressInput, opts ...request.Option) (*RevokeSecurityGroupEgressOutput, error) { + req, out := c.RevokeSecurityGroupEgressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress" @@ -15102,8 +18654,23 @@ func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngres // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupIngress func (c *EC2) RevokeSecurityGroupIngress(input *RevokeSecurityGroupIngressInput) (*RevokeSecurityGroupIngressOutput, error) { req, out := c.RevokeSecurityGroupIngressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RevokeSecurityGroupIngressWithContext is the same as RevokeSecurityGroupIngress with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeSecurityGroupIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RevokeSecurityGroupIngressWithContext(ctx aws.Context, input *RevokeSecurityGroupIngressInput, opts ...request.Option) (*RevokeSecurityGroupIngressOutput, error) { + req, out := c.RevokeSecurityGroupIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRunInstances = "RunInstances" @@ -15186,9 +18753,9 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques // each instead of 1 launch request for 500 instances. // // An instance is ready for you to use when it's in the running state. You can -// check the state of your instance using DescribeInstances. After launch, you -// can apply tags to your running instance (requires a resource ID). For more -// information, see CreateTags and Tagging Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). +// check the state of your instance using DescribeInstances. You can tag instances +// and EBS volumes during launch, after launch, or both. For more information, +// see CreateTags and Tagging Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). // // Linux instances have access to the public key of the key pair at boot. You // can use this key to provide secure access to the instance. Amazon EC2 public @@ -15210,8 +18777,23 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunInstances func (c *EC2) RunInstances(input *RunInstancesInput) (*Reservation, error) { req, out := c.RunInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RunInstancesWithContext is the same as RunInstances with the addition of +// the ability to pass a context and additional request options. +// +// See RunInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RunInstancesWithContext(ctx aws.Context, input *RunInstancesInput, opts ...request.Option) (*Reservation, error) { + req, out := c.RunInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRunScheduledInstances = "RunScheduledInstances" @@ -15280,8 +18862,23 @@ func (c *EC2) RunScheduledInstancesRequest(input *RunScheduledInstancesInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunScheduledInstances func (c *EC2) RunScheduledInstances(input *RunScheduledInstancesInput) (*RunScheduledInstancesOutput, error) { req, out := c.RunScheduledInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RunScheduledInstancesWithContext is the same as RunScheduledInstances with the addition of +// the ability to pass a context and additional request options. +// +// See RunScheduledInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RunScheduledInstancesWithContext(ctx aws.Context, input *RunScheduledInstancesInput, opts ...request.Option) (*RunScheduledInstancesOutput, error) { + req, out := c.RunScheduledInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartInstances = "StartInstances" @@ -15358,8 +18955,23 @@ func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartInstances func (c *EC2) StartInstances(input *StartInstancesInput) (*StartInstancesOutput, error) { req, out := c.StartInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartInstancesWithContext is the same as StartInstances with the addition of +// the ability to pass a context and additional request options. +// +// See StartInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartInstancesWithContext(ctx aws.Context, input *StartInstancesInput, opts ...request.Option) (*StartInstancesOutput, error) { + req, out := c.StartInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopInstances = "StopInstances" @@ -15447,8 +19059,23 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StopInstances func (c *EC2) StopInstances(input *StopInstancesInput) (*StopInstancesOutput, error) { req, out := c.StopInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopInstancesWithContext is the same as StopInstances with the addition of +// the ability to pass a context and additional request options. +// +// See StopInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopInstancesWithContext(ctx aws.Context, input *StopInstancesInput, opts ...request.Option) (*StopInstancesOutput, error) { + req, out := c.StopInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTerminateInstances = "TerminateInstances" @@ -15531,8 +19158,23 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateInstances func (c *EC2) TerminateInstances(input *TerminateInstancesInput) (*TerminateInstancesOutput, error) { req, out := c.TerminateInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TerminateInstancesWithContext is the same as TerminateInstances with the addition of +// the ability to pass a context and additional request options. +// +// See TerminateInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TerminateInstancesWithContext(ctx aws.Context, input *TerminateInstancesInput, opts ...request.Option) (*TerminateInstancesOutput, error) { + req, out := c.TerminateInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUnassignIpv6Addresses = "UnassignIpv6Addresses" @@ -15591,8 +19233,23 @@ func (c *EC2) UnassignIpv6AddressesRequest(input *UnassignIpv6AddressesInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignIpv6Addresses func (c *EC2) UnassignIpv6Addresses(input *UnassignIpv6AddressesInput) (*UnassignIpv6AddressesOutput, error) { req, out := c.UnassignIpv6AddressesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UnassignIpv6AddressesWithContext is the same as UnassignIpv6Addresses with the addition of +// the ability to pass a context and additional request options. +// +// See UnassignIpv6Addresses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UnassignIpv6AddressesWithContext(ctx aws.Context, input *UnassignIpv6AddressesInput, opts ...request.Option) (*UnassignIpv6AddressesOutput, error) { + req, out := c.UnassignIpv6AddressesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses" @@ -15653,8 +19310,23 @@ func (c *EC2) UnassignPrivateIpAddressesRequest(input *UnassignPrivateIpAddresse // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignPrivateIpAddresses func (c *EC2) UnassignPrivateIpAddresses(input *UnassignPrivateIpAddressesInput) (*UnassignPrivateIpAddressesOutput, error) { req, out := c.UnassignPrivateIpAddressesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UnassignPrivateIpAddressesWithContext is the same as UnassignPrivateIpAddresses with the addition of +// the ability to pass a context and additional request options. +// +// See UnassignPrivateIpAddresses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UnassignPrivateIpAddressesWithContext(ctx aws.Context, input *UnassignPrivateIpAddressesInput, opts ...request.Option) (*UnassignPrivateIpAddressesOutput, error) { + req, out := c.UnassignPrivateIpAddressesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUnmonitorInstances = "UnmonitorInstances" @@ -15715,8 +19387,23 @@ func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnmonitorInstances func (c *EC2) UnmonitorInstances(input *UnmonitorInstancesInput) (*UnmonitorInstancesOutput, error) { req, out := c.UnmonitorInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UnmonitorInstancesWithContext is the same as UnmonitorInstances with the addition of +// the ability to pass a context and additional request options. +// +// See UnmonitorInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UnmonitorInstancesWithContext(ctx aws.Context, input *UnmonitorInstancesInput, opts ...request.Option) (*UnmonitorInstancesOutput, error) { + req, out := c.UnmonitorInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Contains the parameters for accepting the quote. @@ -15943,8 +19630,8 @@ func (s *AccountAttributeValue) SetAttributeValue(v string) *AccountAttributeVal type ActiveInstance struct { _ struct{} `type:"structure"` - // The health status of the instance. If the status of both the instance status - // check and the system status check is impaired, the health status of the instance + // The health status of the instance. If the status of either the instance status + // check or the system status check is impaired, the health status of the instance // is unhealthy. Otherwise, the health status is healthy. InstanceHealth *string `locationName:"instanceHealth" type:"string" enum:"InstanceHealthStatus"` @@ -21824,6 +25511,9 @@ type CreateVolumeInput struct { // The snapshot from which to create the volume. SnapshotId *string `type:"string"` + // The tags to apply to the volume during creation. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned // IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard // for Magnetic volumes. @@ -21897,6 +25587,12 @@ func (s *CreateVolumeInput) SetSnapshotId(v string) *CreateVolumeInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateVolumeInput) SetTagSpecifications(v []*TagSpecification) *CreateVolumeInput { + s.TagSpecifications = v + return s +} + // SetVolumeType sets the VolumeType field's value. func (s *CreateVolumeInput) SetVolumeType(v string) *CreateVolumeInput { s.VolumeType = &v @@ -43245,7 +46941,9 @@ type RegisterImageInput struct { // the architecture specified in the manifest file. Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` - // The billing product codes. + // The billing product codes. Your account must be authorized to specify billing + // product codes. Otherwise, you can use the AWS Marketplace to bill for the + // use of an AMI. BillingProducts []*string `locationName:"BillingProduct" locationNameList:"item" type:"list"` // One or more block device mapping entries. @@ -46794,6 +50492,11 @@ type RunInstancesInput struct { // [EC2-VPC] The ID of the subnet to launch the instance into. SubnetId *string `type:"string"` + // The tags to apply to the resources during launch. You can tag instances and + // volumes. The specified tags are applied to all instances or volumes that + // are created during launch. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The user data to make available to the instance. For more information, see // Running Commands on Your Linux Instance at Launch (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) // (Linux) and Adding User Data (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data) @@ -46991,6 +50694,12 @@ func (s *RunInstancesInput) SetSubnetId(v string) *RunInstancesInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *RunInstancesInput) SetTagSpecifications(v []*TagSpecification) *RunInstancesInput { + s.TagSpecifications = v + return s +} + // SetUserData sets the UserData field's value. func (s *RunInstancesInput) SetUserData(v string) *RunInstancesInput { s.UserData = &v @@ -50531,6 +54240,41 @@ func (s *TagDescription) SetValue(v string) *TagDescription { return s } +// The tags to apply to a resource when the resource is being created. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TagSpecification +type TagSpecification struct { + _ struct{} `type:"structure"` + + // The type of resource to tag. Currently, the resource types that support tagging + // on creation are instance and volume. + ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` + + // The tags to apply to the resource. + Tags []*Tag `locationName:"Tag" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s TagSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagSpecification) GoString() string { + return s.String() +} + +// SetResourceType sets the ResourceType field's value. +func (s *TagSpecification) SetResourceType(v string) *TagSpecification { + s.ResourceType = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *TagSpecification) SetTags(v []*Tag) *TagSpecification { + s.Tags = v + return s +} + // Information about the Convertible Reserved Instance offering. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TargetConfiguration type TargetConfiguration struct { diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go index f90fa6ec5..3d61d7e35 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go @@ -1,3 +1,3 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ec2 diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go index c289b5b04..e04220546 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ec2 diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go index 7917cbdaf..c0a655fa0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ec2 import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilBundleTaskComplete uses the Amazon EC2 API operation @@ -11,32 +14,50 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilBundleTaskComplete(input *DescribeBundleTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeBundleTasks", - Delay: 15, + return c.WaitUntilBundleTaskCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilBundleTaskCompleteWithContext is an extended version of WaitUntilBundleTaskComplete. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilBundleTaskCompleteWithContext(ctx aws.Context, input *DescribeBundleTasksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilBundleTaskComplete", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "BundleTasks[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "BundleTasks[].State", Expected: "complete", }, { - State: "failure", - Matcher: "pathAny", - Argument: "BundleTasks[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "BundleTasks[].State", Expected: "failed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeBundleTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeBundleTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilConversionTaskCancelled uses the Amazon EC2 API operation @@ -44,26 +65,45 @@ func (c *EC2) WaitUntilBundleTaskComplete(input *DescribeBundleTasksInput) error // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilConversionTaskCancelled(input *DescribeConversionTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeConversionTasks", - Delay: 15, + return c.WaitUntilConversionTaskCancelledWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilConversionTaskCancelledWithContext is an extended version of WaitUntilConversionTaskCancelled. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilConversionTaskCancelledWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilConversionTaskCancelled", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "ConversionTasks[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", Expected: "cancelled", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeConversionTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeConversionTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilConversionTaskCompleted uses the Amazon EC2 API operation @@ -71,38 +111,55 @@ func (c *EC2) WaitUntilConversionTaskCancelled(input *DescribeConversionTasksInp // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilConversionTaskCompleted(input *DescribeConversionTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeConversionTasks", - Delay: 15, + return c.WaitUntilConversionTaskCompletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilConversionTaskCompletedWithContext is an extended version of WaitUntilConversionTaskCompleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilConversionTaskCompletedWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilConversionTaskCompleted", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "ConversionTasks[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", Expected: "completed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "ConversionTasks[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "ConversionTasks[].State", Expected: "cancelled", }, { - State: "failure", - Matcher: "pathAny", - Argument: "ConversionTasks[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "ConversionTasks[].State", Expected: "cancelling", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeConversionTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeConversionTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilConversionTaskDeleted uses the Amazon EC2 API operation @@ -110,26 +167,45 @@ func (c *EC2) WaitUntilConversionTaskCompleted(input *DescribeConversionTasksInp // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilConversionTaskDeleted(input *DescribeConversionTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeConversionTasks", - Delay: 15, + return c.WaitUntilConversionTaskDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilConversionTaskDeletedWithContext is an extended version of WaitUntilConversionTaskDeleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilConversionTaskDeletedWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilConversionTaskDeleted", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "ConversionTasks[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", Expected: "deleted", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeConversionTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeConversionTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilCustomerGatewayAvailable uses the Amazon EC2 API operation @@ -137,38 +213,55 @@ func (c *EC2) WaitUntilConversionTaskDeleted(input *DescribeConversionTasksInput // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeCustomerGateways", - Delay: 15, + return c.WaitUntilCustomerGatewayAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilCustomerGatewayAvailableWithContext is an extended version of WaitUntilCustomerGatewayAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilCustomerGatewayAvailableWithContext(ctx aws.Context, input *DescribeCustomerGatewaysInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilCustomerGatewayAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "CustomerGateways[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "CustomerGateways[].State", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CustomerGateways[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CustomerGateways[].State", Expected: "deleted", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CustomerGateways[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CustomerGateways[].State", Expected: "deleting", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeCustomerGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCustomerGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilExportTaskCancelled uses the Amazon EC2 API operation @@ -176,26 +269,45 @@ func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysI // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilExportTaskCancelled(input *DescribeExportTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeExportTasks", - Delay: 15, + return c.WaitUntilExportTaskCancelledWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilExportTaskCancelledWithContext is an extended version of WaitUntilExportTaskCancelled. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilExportTaskCancelledWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilExportTaskCancelled", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "ExportTasks[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "ExportTasks[].State", Expected: "cancelled", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeExportTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeExportTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilExportTaskCompleted uses the Amazon EC2 API operation @@ -203,26 +315,45 @@ func (c *EC2) WaitUntilExportTaskCancelled(input *DescribeExportTasksInput) erro // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilExportTaskCompleted(input *DescribeExportTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeExportTasks", - Delay: 15, + return c.WaitUntilExportTaskCompletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilExportTaskCompletedWithContext is an extended version of WaitUntilExportTaskCompleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilExportTaskCompletedWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilExportTaskCompleted", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "ExportTasks[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "ExportTasks[].State", Expected: "completed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeExportTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeExportTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilImageAvailable uses the Amazon EC2 API operation @@ -230,32 +361,50 @@ func (c *EC2) WaitUntilExportTaskCompleted(input *DescribeExportTasksInput) erro // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilImageAvailable(input *DescribeImagesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeImages", - Delay: 15, + return c.WaitUntilImageAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilImageAvailableWithContext is an extended version of WaitUntilImageAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilImageAvailableWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilImageAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Images[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Images[].State", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Images[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Images[].State", Expected: "failed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeImagesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeImagesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilImageExists uses the Amazon EC2 API operation @@ -263,32 +412,50 @@ func (c *EC2) WaitUntilImageAvailable(input *DescribeImagesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilImageExists(input *DescribeImagesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeImages", - Delay: 15, + return c.WaitUntilImageExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilImageExistsWithContext is an extended version of WaitUntilImageExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilImageExistsWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilImageExists", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "length(Images[]) > `0`", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(Images[]) > `0`", Expected: true, }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidAMIID.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeImagesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeImagesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceExists uses the Amazon EC2 API operation @@ -296,32 +463,50 @@ func (c *EC2) WaitUntilImageExists(input *DescribeImagesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 5, + return c.WaitUntilInstanceExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceExistsWithContext is an extended version of WaitUntilInstanceExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceExistsWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceExists", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "length(Reservations[]) > `0`", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(Reservations[]) > `0`", Expected: true, }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidInstanceID.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceRunning uses the Amazon EC2 API operation @@ -329,50 +514,65 @@ func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilInstanceRunning(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, + return c.WaitUntilInstanceRunningWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceRunningWithContext is an extended version of WaitUntilInstanceRunning. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceRunningWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceRunning", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Reservations[].Instances[].State.Name", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "running", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "shutting-down", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "terminated", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "stopping", }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidInstanceID.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceStatusOk uses the Amazon EC2 API operation @@ -380,32 +580,50 @@ func (c *EC2) WaitUntilInstanceRunning(input *DescribeInstancesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceStatus", - Delay: 15, + return c.WaitUntilInstanceStatusOkWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceStatusOkWithContext is an extended version of WaitUntilInstanceStatusOk. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceStatusOkWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceStatusOk", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "InstanceStatuses[].InstanceStatus.Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "InstanceStatuses[].InstanceStatus.Status", Expected: "ok", }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidInstanceID.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstanceStatusInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceStatusRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceStopped uses the Amazon EC2 API operation @@ -413,38 +631,55 @@ func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) erro // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilInstanceStopped(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, + return c.WaitUntilInstanceStoppedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceStoppedWithContext is an extended version of WaitUntilInstanceStopped. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceStoppedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceStopped", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Reservations[].Instances[].State.Name", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "stopped", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "pending", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "terminated", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceTerminated uses the Amazon EC2 API operation @@ -452,38 +687,55 @@ func (c *EC2) WaitUntilInstanceStopped(input *DescribeInstancesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, + return c.WaitUntilInstanceTerminatedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceTerminatedWithContext is an extended version of WaitUntilInstanceTerminated. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceTerminatedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceTerminated", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Reservations[].Instances[].State.Name", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "terminated", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "pending", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", Expected: "stopping", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilKeyPairExists uses the Amazon EC2 API operation @@ -491,32 +743,50 @@ func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeKeyPairs", - Delay: 5, + return c.WaitUntilKeyPairExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilKeyPairExistsWithContext is an extended version of WaitUntilKeyPairExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilKeyPairExistsWithContext(ctx aws.Context, input *DescribeKeyPairsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilKeyPairExists", MaxAttempts: 6, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "length(KeyPairs[].KeyName) > `0`", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(KeyPairs[].KeyName) > `0`", Expected: true, }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidKeyPair.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeKeyPairsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeKeyPairsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilNatGatewayAvailable uses the Amazon EC2 API operation @@ -524,50 +794,65 @@ func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilNatGatewayAvailable(input *DescribeNatGatewaysInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeNatGateways", - Delay: 15, + return c.WaitUntilNatGatewayAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilNatGatewayAvailableWithContext is an extended version of WaitUntilNatGatewayAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilNatGatewayAvailableWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilNatGatewayAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "NatGateways[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "NatGateways[].State", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "NatGateways[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", Expected: "failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "NatGateways[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", Expected: "deleting", }, { - State: "failure", - Matcher: "pathAny", - Argument: "NatGateways[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", Expected: "deleted", }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "NatGatewayNotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeNatGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNatGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilNetworkInterfaceAvailable uses the Amazon EC2 API operation @@ -575,32 +860,50 @@ func (c *EC2) WaitUntilNatGatewayAvailable(input *DescribeNatGatewaysInput) erro // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterfacesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeNetworkInterfaces", - Delay: 20, + return c.WaitUntilNetworkInterfaceAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilNetworkInterfaceAvailableWithContext is an extended version of WaitUntilNetworkInterfaceAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilNetworkInterfaceAvailableWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilNetworkInterfaceAvailable", MaxAttempts: 10, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(20 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "NetworkInterfaces[].Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "NetworkInterfaces[].Status", Expected: "available", }, { - State: "failure", - Matcher: "error", - Argument: "", + State: request.FailureWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidNetworkInterfaceID.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeNetworkInterfacesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNetworkInterfacesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilPasswordDataAvailable uses the Amazon EC2 API operation @@ -608,26 +911,45 @@ func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterface // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilPasswordDataAvailable(input *GetPasswordDataInput) error { - waiterCfg := waiter.Config{ - Operation: "GetPasswordData", - Delay: 15, + return c.WaitUntilPasswordDataAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilPasswordDataAvailableWithContext is an extended version of WaitUntilPasswordDataAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilPasswordDataAvailableWithContext(ctx aws.Context, input *GetPasswordDataInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilPasswordDataAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "length(PasswordData) > `0`", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(PasswordData) > `0`", Expected: true, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetPasswordDataInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetPasswordDataRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilSnapshotCompleted uses the Amazon EC2 API operation @@ -635,26 +957,45 @@ func (c *EC2) WaitUntilPasswordDataAvailable(input *GetPasswordDataInput) error // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilSnapshotCompleted(input *DescribeSnapshotsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeSnapshots", - Delay: 15, + return c.WaitUntilSnapshotCompletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilSnapshotCompletedWithContext is an extended version of WaitUntilSnapshotCompleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilSnapshotCompletedWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilSnapshotCompleted", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Snapshots[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Snapshots[].State", Expected: "completed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeSnapshotsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSnapshotsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilSpotInstanceRequestFulfilled uses the Amazon EC2 API operation @@ -662,50 +1003,65 @@ func (c *EC2) WaitUntilSnapshotCompleted(input *DescribeSnapshotsInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilSpotInstanceRequestFulfilled(input *DescribeSpotInstanceRequestsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeSpotInstanceRequests", - Delay: 15, + return c.WaitUntilSpotInstanceRequestFulfilledWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilSpotInstanceRequestFulfilledWithContext is an extended version of WaitUntilSpotInstanceRequestFulfilled. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilSpotInstanceRequestFulfilledWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilSpotInstanceRequestFulfilled", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "SpotInstanceRequests[].Status.Code", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", Expected: "fulfilled", }, { - State: "failure", - Matcher: "pathAny", - Argument: "SpotInstanceRequests[].Status.Code", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", Expected: "schedule-expired", }, { - State: "failure", - Matcher: "pathAny", - Argument: "SpotInstanceRequests[].Status.Code", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", Expected: "canceled-before-fulfillment", }, { - State: "failure", - Matcher: "pathAny", - Argument: "SpotInstanceRequests[].Status.Code", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", Expected: "bad-parameters", }, { - State: "failure", - Matcher: "pathAny", - Argument: "SpotInstanceRequests[].Status.Code", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", Expected: "system-error", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeSpotInstanceRequestsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSpotInstanceRequestsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilSubnetAvailable uses the Amazon EC2 API operation @@ -713,26 +1069,45 @@ func (c *EC2) WaitUntilSpotInstanceRequestFulfilled(input *DescribeSpotInstanceR // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilSubnetAvailable(input *DescribeSubnetsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeSubnets", - Delay: 15, + return c.WaitUntilSubnetAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilSubnetAvailableWithContext is an extended version of WaitUntilSubnetAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilSubnetAvailableWithContext(ctx aws.Context, input *DescribeSubnetsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilSubnetAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Subnets[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Subnets[].State", Expected: "available", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeSubnetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSubnetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilSystemStatusOk uses the Amazon EC2 API operation @@ -740,26 +1115,45 @@ func (c *EC2) WaitUntilSubnetAvailable(input *DescribeSubnetsInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilSystemStatusOk(input *DescribeInstanceStatusInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceStatus", - Delay: 15, + return c.WaitUntilSystemStatusOkWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilSystemStatusOkWithContext is an extended version of WaitUntilSystemStatusOk. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilSystemStatusOkWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilSystemStatusOk", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "InstanceStatuses[].SystemStatus.Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "InstanceStatuses[].SystemStatus.Status", Expected: "ok", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstanceStatusInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceStatusRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVolumeAvailable uses the Amazon EC2 API operation @@ -767,32 +1161,50 @@ func (c *EC2) WaitUntilSystemStatusOk(input *DescribeInstanceStatusInput) error // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilVolumeAvailable(input *DescribeVolumesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVolumes", - Delay: 15, + return c.WaitUntilVolumeAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVolumeAvailableWithContext is an extended version of WaitUntilVolumeAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVolumeAvailableWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVolumeAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Volumes[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Volumes[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Volumes[].State", Expected: "deleted", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVolumesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVolumesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVolumeDeleted uses the Amazon EC2 API operation @@ -800,32 +1212,50 @@ func (c *EC2) WaitUntilVolumeAvailable(input *DescribeVolumesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVolumes", - Delay: 15, + return c.WaitUntilVolumeDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVolumeDeletedWithContext is an extended version of WaitUntilVolumeDeleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVolumeDeletedWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVolumeDeleted", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Volumes[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", Expected: "deleted", }, { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidVolume.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVolumesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVolumesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVolumeInUse uses the Amazon EC2 API operation @@ -833,32 +1263,50 @@ func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilVolumeInUse(input *DescribeVolumesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVolumes", - Delay: 15, + return c.WaitUntilVolumeInUseWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVolumeInUseWithContext is an extended version of WaitUntilVolumeInUse. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVolumeInUseWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVolumeInUse", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Volumes[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", Expected: "in-use", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Volumes[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Volumes[].State", Expected: "deleted", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVolumesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVolumesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVpcAvailable uses the Amazon EC2 API operation @@ -866,26 +1314,45 @@ func (c *EC2) WaitUntilVolumeInUse(input *DescribeVolumesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilVpcAvailable(input *DescribeVpcsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVpcs", - Delay: 15, + return c.WaitUntilVpcAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVpcAvailableWithContext is an extended version of WaitUntilVpcAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVpcAvailableWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVpcAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Vpcs[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Vpcs[].State", Expected: "available", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVpcsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVpcExists uses the Amazon EC2 API operation @@ -893,32 +1360,50 @@ func (c *EC2) WaitUntilVpcAvailable(input *DescribeVpcsInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilVpcExists(input *DescribeVpcsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVpcs", - Delay: 1, + return c.WaitUntilVpcExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVpcExistsWithContext is an extended version of WaitUntilVpcExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVpcExistsWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVpcExists", MaxAttempts: 5, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(1 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidVpcID.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVpcsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVpcPeeringConnectionDeleted uses the Amazon EC2 API operation @@ -926,32 +1411,50 @@ func (c *EC2) WaitUntilVpcExists(input *DescribeVpcsInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilVpcPeeringConnectionDeleted(input *DescribeVpcPeeringConnectionsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVpcPeeringConnections", - Delay: 15, + return c.WaitUntilVpcPeeringConnectionDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVpcPeeringConnectionDeletedWithContext is an extended version of WaitUntilVpcPeeringConnectionDeleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVpcPeeringConnectionDeletedWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVpcPeeringConnectionDeleted", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "VpcPeeringConnections[].Status.Code", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "VpcPeeringConnections[].Status.Code", Expected: "deleted", }, { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidVpcPeeringConnectionID.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVpcPeeringConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVpcPeeringConnectionExists uses the Amazon EC2 API operation @@ -959,32 +1462,50 @@ func (c *EC2) WaitUntilVpcPeeringConnectionDeleted(input *DescribeVpcPeeringConn // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilVpcPeeringConnectionExists(input *DescribeVpcPeeringConnectionsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVpcPeeringConnections", - Delay: 15, + return c.WaitUntilVpcPeeringConnectionExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVpcPeeringConnectionExistsWithContext is an extended version of WaitUntilVpcPeeringConnectionExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVpcPeeringConnectionExistsWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVpcPeeringConnectionExists", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidVpcPeeringConnectionID.NotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVpcPeeringConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVpnConnectionAvailable uses the Amazon EC2 API operation @@ -992,38 +1513,55 @@ func (c *EC2) WaitUntilVpcPeeringConnectionExists(input *DescribeVpcPeeringConne // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilVpnConnectionAvailable(input *DescribeVpnConnectionsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVpnConnections", - Delay: 15, + return c.WaitUntilVpnConnectionAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVpnConnectionAvailableWithContext is an extended version of WaitUntilVpnConnectionAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVpnConnectionAvailableWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVpnConnectionAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "VpnConnections[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "VpnConnections[].State", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "VpnConnections[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", Expected: "deleting", }, { - State: "failure", - Matcher: "pathAny", - Argument: "VpnConnections[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", Expected: "deleted", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVpnConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpnConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVpnConnectionDeleted uses the Amazon EC2 API operation @@ -1031,30 +1569,48 @@ func (c *EC2) WaitUntilVpnConnectionAvailable(input *DescribeVpnConnectionsInput // If the condition is not meet within the max attempt window an error will // be returned. func (c *EC2) WaitUntilVpnConnectionDeleted(input *DescribeVpnConnectionsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVpnConnections", - Delay: 15, + return c.WaitUntilVpnConnectionDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVpnConnectionDeletedWithContext is an extended version of WaitUntilVpnConnectionDeleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVpnConnectionDeletedWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVpnConnectionDeleted", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "VpnConnections[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "VpnConnections[].State", Expected: "deleted", }, { - State: "failure", - Matcher: "pathAny", - Argument: "VpnConnections[].State", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", Expected: "pending", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVpnConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpnConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go index fc46f5145..d0e62e3a1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package ecr provides a client for Amazon EC2 Container Registry. package ecr @@ -6,6 +6,7 @@ package ecr import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -84,8 +85,23 @@ func (c *ECR) BatchCheckLayerAvailabilityRequest(input *BatchCheckLayerAvailabil // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchCheckLayerAvailability func (c *ECR) BatchCheckLayerAvailability(input *BatchCheckLayerAvailabilityInput) (*BatchCheckLayerAvailabilityOutput, error) { req, out := c.BatchCheckLayerAvailabilityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchCheckLayerAvailabilityWithContext is the same as BatchCheckLayerAvailability with the addition of +// the ability to pass a context and additional request options. +// +// See BatchCheckLayerAvailability for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchCheckLayerAvailabilityWithContext(ctx aws.Context, input *BatchCheckLayerAvailabilityInput, opts ...request.Option) (*BatchCheckLayerAvailabilityOutput, error) { + req, out := c.BatchCheckLayerAvailabilityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchDeleteImage = "BatchDeleteImage" @@ -165,8 +181,23 @@ func (c *ECR) BatchDeleteImageRequest(input *BatchDeleteImageInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchDeleteImage func (c *ECR) BatchDeleteImage(input *BatchDeleteImageInput) (*BatchDeleteImageOutput, error) { req, out := c.BatchDeleteImageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchDeleteImageWithContext is the same as BatchDeleteImage with the addition of +// the ability to pass a context and additional request options. +// +// See BatchDeleteImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchDeleteImageWithContext(ctx aws.Context, input *BatchDeleteImageInput, opts ...request.Option) (*BatchDeleteImageOutput, error) { + req, out := c.BatchDeleteImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchGetImage = "BatchGetImage" @@ -239,8 +270,23 @@ func (c *ECR) BatchGetImageRequest(input *BatchGetImageInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchGetImage func (c *ECR) BatchGetImage(input *BatchGetImageInput) (*BatchGetImageOutput, error) { req, out := c.BatchGetImageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchGetImageWithContext is the same as BatchGetImage with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchGetImageWithContext(ctx aws.Context, input *BatchGetImageInput, opts ...request.Option) (*BatchGetImageOutput, error) { + req, out := c.BatchGetImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCompleteLayerUpload = "CompleteLayerUpload" @@ -335,8 +381,23 @@ func (c *ECR) CompleteLayerUploadRequest(input *CompleteLayerUploadInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CompleteLayerUpload func (c *ECR) CompleteLayerUpload(input *CompleteLayerUploadInput) (*CompleteLayerUploadOutput, error) { req, out := c.CompleteLayerUploadRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CompleteLayerUploadWithContext is the same as CompleteLayerUpload with the addition of +// the ability to pass a context and additional request options. +// +// See CompleteLayerUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CompleteLayerUploadWithContext(ctx aws.Context, input *CompleteLayerUploadInput, opts ...request.Option) (*CompleteLayerUploadOutput, error) { + req, out := c.CompleteLayerUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateRepository = "CreateRepository" @@ -413,8 +474,23 @@ func (c *ECR) CreateRepositoryRequest(input *CreateRepositoryInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CreateRepository func (c *ECR) CreateRepository(input *CreateRepositoryInput) (*CreateRepositoryOutput, error) { req, out := c.CreateRepositoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateRepositoryWithContext is the same as CreateRepository with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRepository for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateRepositoryWithContext(ctx aws.Context, input *CreateRepositoryInput, opts ...request.Option) (*CreateRepositoryOutput, error) { + req, out := c.CreateRepositoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRepository = "DeleteRepository" @@ -491,8 +567,23 @@ func (c *ECR) DeleteRepositoryRequest(input *DeleteRepositoryInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepository func (c *ECR) DeleteRepository(input *DeleteRepositoryInput) (*DeleteRepositoryOutput, error) { req, out := c.DeleteRepositoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRepositoryWithContext is the same as DeleteRepository with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRepository for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRepositoryWithContext(ctx aws.Context, input *DeleteRepositoryInput, opts ...request.Option) (*DeleteRepositoryOutput, error) { + req, out := c.DeleteRepositoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRepositoryPolicy = "DeleteRepositoryPolicy" @@ -568,8 +659,23 @@ func (c *ECR) DeleteRepositoryPolicyRequest(input *DeleteRepositoryPolicyInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepositoryPolicy func (c *ECR) DeleteRepositoryPolicy(input *DeleteRepositoryPolicyInput) (*DeleteRepositoryPolicyOutput, error) { req, out := c.DeleteRepositoryPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRepositoryPolicyWithContext is the same as DeleteRepositoryPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRepositoryPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRepositoryPolicyWithContext(ctx aws.Context, input *DeleteRepositoryPolicyInput, opts ...request.Option) (*DeleteRepositoryPolicyOutput, error) { + req, out := c.DeleteRepositoryPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeImages = "DescribeImages" @@ -656,8 +762,23 @@ func (c *ECR) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeImages func (c *ECR) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, error) { req, out := c.DescribeImagesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeImagesWithContext is the same as DescribeImages with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeImages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeImagesWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.Option) (*DescribeImagesOutput, error) { + req, out := c.DescribeImagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeImagesPages iterates over the pages of a DescribeImages operation, @@ -677,12 +798,37 @@ func (c *ECR) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, // return pageNum <= 3 // }) // -func (c *ECR) DescribeImagesPages(input *DescribeImagesInput, fn func(p *DescribeImagesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeImagesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeImagesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeImagesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeImagesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeImagesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeRepositories = "DescribeRepositories" @@ -760,8 +906,23 @@ func (c *ECR) DescribeRepositoriesRequest(input *DescribeRepositoriesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeRepositories func (c *ECR) DescribeRepositories(input *DescribeRepositoriesInput) (*DescribeRepositoriesOutput, error) { req, out := c.DescribeRepositoriesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeRepositoriesWithContext is the same as DescribeRepositories with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRepositories for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeRepositoriesWithContext(ctx aws.Context, input *DescribeRepositoriesInput, opts ...request.Option) (*DescribeRepositoriesOutput, error) { + req, out := c.DescribeRepositoriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeRepositoriesPages iterates over the pages of a DescribeRepositories operation, @@ -781,12 +942,37 @@ func (c *ECR) DescribeRepositories(input *DescribeRepositoriesInput) (*DescribeR // return pageNum <= 3 // }) // -func (c *ECR) DescribeRepositoriesPages(input *DescribeRepositoriesInput, fn func(p *DescribeRepositoriesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeRepositoriesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeRepositoriesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeRepositoriesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeRepositoriesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeRepositoriesOutput), !p.HasNextPage()) + } + return p.Err() } const opGetAuthorizationToken = "GetAuthorizationToken" @@ -861,8 +1047,23 @@ func (c *ECR) GetAuthorizationTokenRequest(input *GetAuthorizationTokenInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetAuthorizationToken func (c *ECR) GetAuthorizationToken(input *GetAuthorizationTokenInput) (*GetAuthorizationTokenOutput, error) { req, out := c.GetAuthorizationTokenRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAuthorizationTokenWithContext is the same as GetAuthorizationToken with the addition of +// the ability to pass a context and additional request options. +// +// See GetAuthorizationToken for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAuthorizationTokenWithContext(ctx aws.Context, input *GetAuthorizationTokenInput, opts ...request.Option) (*GetAuthorizationTokenOutput, error) { + req, out := c.GetAuthorizationTokenRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDownloadUrlForLayer = "GetDownloadUrlForLayer" @@ -947,8 +1148,23 @@ func (c *ECR) GetDownloadUrlForLayerRequest(input *GetDownloadUrlForLayerInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetDownloadUrlForLayer func (c *ECR) GetDownloadUrlForLayer(input *GetDownloadUrlForLayerInput) (*GetDownloadUrlForLayerOutput, error) { req, out := c.GetDownloadUrlForLayerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDownloadUrlForLayerWithContext is the same as GetDownloadUrlForLayer with the addition of +// the ability to pass a context and additional request options. +// +// See GetDownloadUrlForLayer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDownloadUrlForLayerWithContext(ctx aws.Context, input *GetDownloadUrlForLayerInput, opts ...request.Option) (*GetDownloadUrlForLayerOutput, error) { + req, out := c.GetDownloadUrlForLayerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetRepositoryPolicy = "GetRepositoryPolicy" @@ -1024,8 +1240,23 @@ func (c *ECR) GetRepositoryPolicyRequest(input *GetRepositoryPolicyInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetRepositoryPolicy func (c *ECR) GetRepositoryPolicy(input *GetRepositoryPolicyInput) (*GetRepositoryPolicyOutput, error) { req, out := c.GetRepositoryPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRepositoryPolicyWithContext is the same as GetRepositoryPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetRepositoryPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetRepositoryPolicyWithContext(ctx aws.Context, input *GetRepositoryPolicyInput, opts ...request.Option) (*GetRepositoryPolicyOutput, error) { + req, out := c.GetRepositoryPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opInitiateLayerUpload = "InitiateLayerUpload" @@ -1101,8 +1332,23 @@ func (c *ECR) InitiateLayerUploadRequest(input *InitiateLayerUploadInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/InitiateLayerUpload func (c *ECR) InitiateLayerUpload(input *InitiateLayerUploadInput) (*InitiateLayerUploadOutput, error) { req, out := c.InitiateLayerUploadRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// InitiateLayerUploadWithContext is the same as InitiateLayerUpload with the addition of +// the ability to pass a context and additional request options. +// +// See InitiateLayerUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) InitiateLayerUploadWithContext(ctx aws.Context, input *InitiateLayerUploadInput, opts ...request.Option) (*InitiateLayerUploadOutput, error) { + req, out := c.InitiateLayerUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListImages = "ListImages" @@ -1186,8 +1432,23 @@ func (c *ECR) ListImagesRequest(input *ListImagesInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ListImages func (c *ECR) ListImages(input *ListImagesInput) (*ListImagesOutput, error) { req, out := c.ListImagesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListImagesWithContext is the same as ListImages with the addition of +// the ability to pass a context and additional request options. +// +// See ListImages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListImagesWithContext(ctx aws.Context, input *ListImagesInput, opts ...request.Option) (*ListImagesOutput, error) { + req, out := c.ListImagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListImagesPages iterates over the pages of a ListImages operation, @@ -1207,12 +1468,37 @@ func (c *ECR) ListImages(input *ListImagesInput) (*ListImagesOutput, error) { // return pageNum <= 3 // }) // -func (c *ECR) ListImagesPages(input *ListImagesInput, fn func(p *ListImagesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListImagesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListImagesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListImagesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListImagesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListImagesOutput), !p.HasNextPage()) + } + return p.Err() } const opPutImage = "PutImage" @@ -1302,8 +1588,23 @@ func (c *ECR) PutImageRequest(input *PutImageInput) (req *request.Request, outpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutImage func (c *ECR) PutImage(input *PutImageInput) (*PutImageOutput, error) { req, out := c.PutImageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutImageWithContext is the same as PutImage with the addition of +// the ability to pass a context and additional request options. +// +// See PutImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutImageWithContext(ctx aws.Context, input *PutImageInput, opts ...request.Option) (*PutImageOutput, error) { + req, out := c.PutImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetRepositoryPolicy = "SetRepositoryPolicy" @@ -1375,8 +1676,23 @@ func (c *ECR) SetRepositoryPolicyRequest(input *SetRepositoryPolicyInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/SetRepositoryPolicy func (c *ECR) SetRepositoryPolicy(input *SetRepositoryPolicyInput) (*SetRepositoryPolicyOutput, error) { req, out := c.SetRepositoryPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetRepositoryPolicyWithContext is the same as SetRepositoryPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See SetRepositoryPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetRepositoryPolicyWithContext(ctx aws.Context, input *SetRepositoryPolicyInput, opts ...request.Option) (*SetRepositoryPolicyOutput, error) { + req, out := c.SetRepositoryPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUploadLayerPart = "UploadLayerPart" @@ -1466,8 +1782,23 @@ func (c *ECR) UploadLayerPartRequest(input *UploadLayerPartInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/UploadLayerPart func (c *ECR) UploadLayerPart(input *UploadLayerPartInput) (*UploadLayerPartOutput, error) { req, out := c.UploadLayerPartRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UploadLayerPartWithContext is the same as UploadLayerPart with the addition of +// the ability to pass a context and additional request options. +// +// See UploadLayerPart for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UploadLayerPartWithContext(ctx aws.Context, input *UploadLayerPartInput, opts ...request.Option) (*UploadLayerPartOutput, error) { + req, out := c.UploadLayerPartRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // An object representing authorization data for an Amazon ECR registry. diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go index c51948bc7..4399e6a29 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ecr diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/service.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/service.go index 2c7904b75..76c8fa450 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecr/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ecr diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go index 68ccbd511..12eb794fb 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package ecs provides a client for Amazon EC2 Container Service. package ecs @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -83,8 +84,23 @@ func (c *ECS) CreateClusterRequest(input *CreateClusterInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateCluster func (c *ECS) CreateCluster(input *CreateClusterInput) (*CreateClusterOutput, error) { req, out := c.CreateClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateClusterWithContext is the same as CreateCluster with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateClusterWithContext(ctx aws.Context, input *CreateClusterInput, opts ...request.Option) (*CreateClusterOutput, error) { + req, out := c.CreateClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateService = "CreateService" @@ -218,8 +234,23 @@ func (c *ECS) CreateServiceRequest(input *CreateServiceInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateService func (c *ECS) CreateService(input *CreateServiceInput) (*CreateServiceOutput, error) { req, out := c.CreateServiceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateServiceWithContext is the same as CreateService with the addition of +// the ability to pass a context and additional request options. +// +// See CreateService for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateServiceWithContext(ctx aws.Context, input *CreateServiceInput, opts ...request.Option) (*CreateServiceOutput, error) { + req, out := c.CreateServiceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAttributes = "DeleteAttributes" @@ -293,8 +324,23 @@ func (c *ECS) DeleteAttributesRequest(input *DeleteAttributesInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteAttributes func (c *ECS) DeleteAttributes(input *DeleteAttributesInput) (*DeleteAttributesOutput, error) { req, out := c.DeleteAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAttributesWithContext is the same as DeleteAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAttributesWithContext(ctx aws.Context, input *DeleteAttributesInput, opts ...request.Option) (*DeleteAttributesOutput, error) { + req, out := c.DeleteAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCluster = "DeleteCluster" @@ -383,8 +429,23 @@ func (c *ECS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteCluster func (c *ECS) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { req, out := c.DeleteClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteClusterWithContext is the same as DeleteCluster with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) { + req, out := c.DeleteClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteService = "DeleteService" @@ -478,8 +539,23 @@ func (c *ECS) DeleteServiceRequest(input *DeleteServiceInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteService func (c *ECS) DeleteService(input *DeleteServiceInput) (*DeleteServiceOutput, error) { req, out := c.DeleteServiceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteServiceWithContext is the same as DeleteService with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteService for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteServiceWithContext(ctx aws.Context, input *DeleteServiceInput, opts ...request.Option) (*DeleteServiceOutput, error) { + req, out := c.DeleteServiceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterContainerInstance = "DeregisterContainerInstance" @@ -570,8 +646,23 @@ func (c *ECS) DeregisterContainerInstanceRequest(input *DeregisterContainerInsta // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterContainerInstance func (c *ECS) DeregisterContainerInstance(input *DeregisterContainerInstanceInput) (*DeregisterContainerInstanceOutput, error) { req, out := c.DeregisterContainerInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterContainerInstanceWithContext is the same as DeregisterContainerInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterContainerInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterContainerInstanceWithContext(ctx aws.Context, input *DeregisterContainerInstanceInput, opts ...request.Option) (*DeregisterContainerInstanceOutput, error) { + req, out := c.DeregisterContainerInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterTaskDefinition = "DeregisterTaskDefinition" @@ -653,8 +744,23 @@ func (c *ECS) DeregisterTaskDefinitionRequest(input *DeregisterTaskDefinitionInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterTaskDefinition func (c *ECS) DeregisterTaskDefinition(input *DeregisterTaskDefinitionInput) (*DeregisterTaskDefinitionOutput, error) { req, out := c.DeregisterTaskDefinitionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterTaskDefinitionWithContext is the same as DeregisterTaskDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterTaskDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterTaskDefinitionWithContext(ctx aws.Context, input *DeregisterTaskDefinitionInput, opts ...request.Option) (*DeregisterTaskDefinitionOutput, error) { + req, out := c.DeregisterTaskDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeClusters = "DescribeClusters" @@ -727,8 +833,23 @@ func (c *ECS) DescribeClustersRequest(input *DescribeClustersInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeClusters func (c *ECS) DescribeClusters(input *DescribeClustersInput) (*DescribeClustersOutput, error) { req, out := c.DescribeClustersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClustersWithContext is the same as DescribeClusters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeClusters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClustersWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.Option) (*DescribeClustersOutput, error) { + req, out := c.DescribeClustersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeContainerInstances = "DescribeContainerInstances" @@ -806,8 +927,23 @@ func (c *ECS) DescribeContainerInstancesRequest(input *DescribeContainerInstance // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeContainerInstances func (c *ECS) DescribeContainerInstances(input *DescribeContainerInstancesInput) (*DescribeContainerInstancesOutput, error) { req, out := c.DescribeContainerInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeContainerInstancesWithContext is the same as DescribeContainerInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeContainerInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeContainerInstancesWithContext(ctx aws.Context, input *DescribeContainerInstancesInput, opts ...request.Option) (*DescribeContainerInstancesOutput, error) { + req, out := c.DescribeContainerInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeServices = "DescribeServices" @@ -884,8 +1020,23 @@ func (c *ECS) DescribeServicesRequest(input *DescribeServicesInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeServices func (c *ECS) DescribeServices(input *DescribeServicesInput) (*DescribeServicesOutput, error) { req, out := c.DescribeServicesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeServicesWithContext is the same as DescribeServices with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeServices for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeServicesWithContext(ctx aws.Context, input *DescribeServicesInput, opts ...request.Option) (*DescribeServicesOutput, error) { + req, out := c.DescribeServicesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTaskDefinition = "DescribeTaskDefinition" @@ -963,8 +1114,23 @@ func (c *ECS) DescribeTaskDefinitionRequest(input *DescribeTaskDefinitionInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTaskDefinition func (c *ECS) DescribeTaskDefinition(input *DescribeTaskDefinitionInput) (*DescribeTaskDefinitionOutput, error) { req, out := c.DescribeTaskDefinitionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTaskDefinitionWithContext is the same as DescribeTaskDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTaskDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTaskDefinitionWithContext(ctx aws.Context, input *DescribeTaskDefinitionInput, opts ...request.Option) (*DescribeTaskDefinitionOutput, error) { + req, out := c.DescribeTaskDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTasks = "DescribeTasks" @@ -1041,8 +1207,23 @@ func (c *ECS) DescribeTasksRequest(input *DescribeTasksInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTasks func (c *ECS) DescribeTasks(input *DescribeTasksInput) (*DescribeTasksOutput, error) { req, out := c.DescribeTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTasksWithContext is the same as DescribeTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTasksWithContext(ctx aws.Context, input *DescribeTasksInput, opts ...request.Option) (*DescribeTasksOutput, error) { + req, out := c.DescribeTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDiscoverPollEndpoint = "DiscoverPollEndpoint" @@ -1115,8 +1296,23 @@ func (c *ECS) DiscoverPollEndpointRequest(input *DiscoverPollEndpointInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DiscoverPollEndpoint func (c *ECS) DiscoverPollEndpoint(input *DiscoverPollEndpointInput) (*DiscoverPollEndpointOutput, error) { req, out := c.DiscoverPollEndpointRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DiscoverPollEndpointWithContext is the same as DiscoverPollEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See DiscoverPollEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DiscoverPollEndpointWithContext(ctx aws.Context, input *DiscoverPollEndpointInput, opts ...request.Option) (*DiscoverPollEndpointOutput, error) { + req, out := c.DiscoverPollEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAttributes = "ListAttributes" @@ -1191,8 +1387,23 @@ func (c *ECS) ListAttributesRequest(input *ListAttributesInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListAttributes func (c *ECS) ListAttributes(input *ListAttributesInput) (*ListAttributesOutput, error) { req, out := c.ListAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAttributesWithContext is the same as ListAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See ListAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAttributesWithContext(ctx aws.Context, input *ListAttributesInput, opts ...request.Option) (*ListAttributesOutput, error) { + req, out := c.ListAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListClusters = "ListClusters" @@ -1271,8 +1482,23 @@ func (c *ECS) ListClustersRequest(input *ListClustersInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListClusters func (c *ECS) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { req, out := c.ListClustersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListClustersWithContext is the same as ListClusters with the addition of +// the ability to pass a context and additional request options. +// +// See ListClusters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListClustersWithContext(ctx aws.Context, input *ListClustersInput, opts ...request.Option) (*ListClustersOutput, error) { + req, out := c.ListClustersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListClustersPages iterates over the pages of a ListClusters operation, @@ -1292,12 +1518,37 @@ func (c *ECS) ListClusters(input *ListClustersInput) (*ListClustersOutput, error // return pageNum <= 3 // }) // -func (c *ECS) ListClustersPages(input *ListClustersInput, fn func(p *ListClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListClustersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) + } + return p.Err() } const opListContainerInstances = "ListContainerInstances" @@ -1384,8 +1635,23 @@ func (c *ECS) ListContainerInstancesRequest(input *ListContainerInstancesInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListContainerInstances func (c *ECS) ListContainerInstances(input *ListContainerInstancesInput) (*ListContainerInstancesOutput, error) { req, out := c.ListContainerInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListContainerInstancesWithContext is the same as ListContainerInstances with the addition of +// the ability to pass a context and additional request options. +// +// See ListContainerInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListContainerInstancesWithContext(ctx aws.Context, input *ListContainerInstancesInput, opts ...request.Option) (*ListContainerInstancesOutput, error) { + req, out := c.ListContainerInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListContainerInstancesPages iterates over the pages of a ListContainerInstances operation, @@ -1405,12 +1671,37 @@ func (c *ECS) ListContainerInstances(input *ListContainerInstancesInput) (*ListC // return pageNum <= 3 // }) // -func (c *ECS) ListContainerInstancesPages(input *ListContainerInstancesInput, fn func(p *ListContainerInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListContainerInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListContainerInstancesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListContainerInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListContainerInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListContainerInstancesOutput), !p.HasNextPage()) + } + return p.Err() } const opListServices = "ListServices" @@ -1493,8 +1784,23 @@ func (c *ECS) ListServicesRequest(input *ListServicesInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListServices func (c *ECS) ListServices(input *ListServicesInput) (*ListServicesOutput, error) { req, out := c.ListServicesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListServicesWithContext is the same as ListServices with the addition of +// the ability to pass a context and additional request options. +// +// See ListServices for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListServicesWithContext(ctx aws.Context, input *ListServicesInput, opts ...request.Option) (*ListServicesOutput, error) { + req, out := c.ListServicesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListServicesPages iterates over the pages of a ListServices operation, @@ -1514,12 +1820,37 @@ func (c *ECS) ListServices(input *ListServicesInput) (*ListServicesOutput, error // return pageNum <= 3 // }) // -func (c *ECS) ListServicesPages(input *ListServicesInput, fn func(p *ListServicesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListServicesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListServicesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListServicesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListServicesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) + } + return p.Err() } const opListTaskDefinitionFamilies = "ListTaskDefinitionFamilies" @@ -1604,8 +1935,23 @@ func (c *ECS) ListTaskDefinitionFamiliesRequest(input *ListTaskDefinitionFamilie // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitionFamilies func (c *ECS) ListTaskDefinitionFamilies(input *ListTaskDefinitionFamiliesInput) (*ListTaskDefinitionFamiliesOutput, error) { req, out := c.ListTaskDefinitionFamiliesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTaskDefinitionFamiliesWithContext is the same as ListTaskDefinitionFamilies with the addition of +// the ability to pass a context and additional request options. +// +// See ListTaskDefinitionFamilies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTaskDefinitionFamiliesWithContext(ctx aws.Context, input *ListTaskDefinitionFamiliesInput, opts ...request.Option) (*ListTaskDefinitionFamiliesOutput, error) { + req, out := c.ListTaskDefinitionFamiliesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListTaskDefinitionFamiliesPages iterates over the pages of a ListTaskDefinitionFamilies operation, @@ -1625,12 +1971,37 @@ func (c *ECS) ListTaskDefinitionFamilies(input *ListTaskDefinitionFamiliesInput) // return pageNum <= 3 // }) // -func (c *ECS) ListTaskDefinitionFamiliesPages(input *ListTaskDefinitionFamiliesInput, fn func(p *ListTaskDefinitionFamiliesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTaskDefinitionFamiliesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTaskDefinitionFamiliesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTaskDefinitionFamiliesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTaskDefinitionFamiliesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListTaskDefinitionFamiliesOutput), !p.HasNextPage()) + } + return p.Err() } const opListTaskDefinitions = "ListTaskDefinitions" @@ -1711,8 +2082,23 @@ func (c *ECS) ListTaskDefinitionsRequest(input *ListTaskDefinitionsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitions func (c *ECS) ListTaskDefinitions(input *ListTaskDefinitionsInput) (*ListTaskDefinitionsOutput, error) { req, out := c.ListTaskDefinitionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTaskDefinitionsWithContext is the same as ListTaskDefinitions with the addition of +// the ability to pass a context and additional request options. +// +// See ListTaskDefinitions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTaskDefinitionsWithContext(ctx aws.Context, input *ListTaskDefinitionsInput, opts ...request.Option) (*ListTaskDefinitionsOutput, error) { + req, out := c.ListTaskDefinitionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListTaskDefinitionsPages iterates over the pages of a ListTaskDefinitions operation, @@ -1732,12 +2118,37 @@ func (c *ECS) ListTaskDefinitions(input *ListTaskDefinitionsInput) (*ListTaskDef // return pageNum <= 3 // }) // -func (c *ECS) ListTaskDefinitionsPages(input *ListTaskDefinitionsInput, fn func(p *ListTaskDefinitionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTaskDefinitionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTaskDefinitionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTaskDefinitionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTaskDefinitionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListTaskDefinitionsOutput), !p.HasNextPage()) + } + return p.Err() } const opListTasks = "ListTasks" @@ -1829,8 +2240,23 @@ func (c *ECS) ListTasksRequest(input *ListTasksInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTasks func (c *ECS) ListTasks(input *ListTasksInput) (*ListTasksOutput, error) { req, out := c.ListTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTasksWithContext is the same as ListTasks with the addition of +// the ability to pass a context and additional request options. +// +// See ListTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTasksWithContext(ctx aws.Context, input *ListTasksInput, opts ...request.Option) (*ListTasksOutput, error) { + req, out := c.ListTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListTasksPages iterates over the pages of a ListTasks operation, @@ -1850,12 +2276,37 @@ func (c *ECS) ListTasks(input *ListTasksInput) (*ListTasksOutput, error) { // return pageNum <= 3 // }) // -func (c *ECS) ListTasksPages(input *ListTasksInput, fn func(p *ListTasksOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTasksRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTasksOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListTasksOutput), !p.HasNextPage()) + } + return p.Err() } const opPutAttributes = "PutAttributes" @@ -1938,8 +2389,23 @@ func (c *ECS) PutAttributesRequest(input *PutAttributesInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAttributes func (c *ECS) PutAttributes(input *PutAttributesInput) (*PutAttributesOutput, error) { req, out := c.PutAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutAttributesWithContext is the same as PutAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See PutAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutAttributesWithContext(ctx aws.Context, input *PutAttributesInput, opts ...request.Option) (*PutAttributesOutput, error) { + req, out := c.PutAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterContainerInstance = "RegisterContainerInstance" @@ -2012,8 +2478,23 @@ func (c *ECS) RegisterContainerInstanceRequest(input *RegisterContainerInstanceI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterContainerInstance func (c *ECS) RegisterContainerInstance(input *RegisterContainerInstanceInput) (*RegisterContainerInstanceOutput, error) { req, out := c.RegisterContainerInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterContainerInstanceWithContext is the same as RegisterContainerInstance with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterContainerInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterContainerInstanceWithContext(ctx aws.Context, input *RegisterContainerInstanceInput, opts ...request.Option) (*RegisterContainerInstanceOutput, error) { + req, out := c.RegisterContainerInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterTaskDefinition = "RegisterTaskDefinition" @@ -2102,8 +2583,23 @@ func (c *ECS) RegisterTaskDefinitionRequest(input *RegisterTaskDefinitionInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterTaskDefinition func (c *ECS) RegisterTaskDefinition(input *RegisterTaskDefinitionInput) (*RegisterTaskDefinitionOutput, error) { req, out := c.RegisterTaskDefinitionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterTaskDefinitionWithContext is the same as RegisterTaskDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterTaskDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterTaskDefinitionWithContext(ctx aws.Context, input *RegisterTaskDefinitionInput, opts ...request.Option) (*RegisterTaskDefinitionOutput, error) { + req, out := c.RegisterTaskDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRunTask = "RunTask" @@ -2188,8 +2684,23 @@ func (c *ECS) RunTaskRequest(input *RunTaskInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RunTask func (c *ECS) RunTask(input *RunTaskInput) (*RunTaskOutput, error) { req, out := c.RunTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RunTaskWithContext is the same as RunTask with the addition of +// the ability to pass a context and additional request options. +// +// See RunTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RunTaskWithContext(ctx aws.Context, input *RunTaskInput, opts ...request.Option) (*RunTaskOutput, error) { + req, out := c.RunTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartTask = "StartTask" @@ -2271,8 +2782,23 @@ func (c *ECS) StartTaskRequest(input *StartTaskInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StartTask func (c *ECS) StartTask(input *StartTaskInput) (*StartTaskOutput, error) { req, out := c.StartTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartTaskWithContext is the same as StartTask with the addition of +// the ability to pass a context and additional request options. +// +// See StartTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartTaskWithContext(ctx aws.Context, input *StartTaskInput, opts ...request.Option) (*StartTaskOutput, error) { + req, out := c.StartTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopTask = "StopTask" @@ -2355,8 +2881,23 @@ func (c *ECS) StopTaskRequest(input *StopTaskInput) (req *request.Request, outpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StopTask func (c *ECS) StopTask(input *StopTaskInput) (*StopTaskOutput, error) { req, out := c.StopTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopTaskWithContext is the same as StopTask with the addition of +// the ability to pass a context and additional request options. +// +// See StopTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopTaskWithContext(ctx aws.Context, input *StopTaskInput, opts ...request.Option) (*StopTaskOutput, error) { + req, out := c.StopTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSubmitContainerStateChange = "SubmitContainerStateChange" @@ -2428,8 +2969,23 @@ func (c *ECS) SubmitContainerStateChangeRequest(input *SubmitContainerStateChang // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitContainerStateChange func (c *ECS) SubmitContainerStateChange(input *SubmitContainerStateChangeInput) (*SubmitContainerStateChangeOutput, error) { req, out := c.SubmitContainerStateChangeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SubmitContainerStateChangeWithContext is the same as SubmitContainerStateChange with the addition of +// the ability to pass a context and additional request options. +// +// See SubmitContainerStateChange for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SubmitContainerStateChangeWithContext(ctx aws.Context, input *SubmitContainerStateChangeInput, opts ...request.Option) (*SubmitContainerStateChangeOutput, error) { + req, out := c.SubmitContainerStateChangeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSubmitTaskStateChange = "SubmitTaskStateChange" @@ -2501,8 +3057,23 @@ func (c *ECS) SubmitTaskStateChangeRequest(input *SubmitTaskStateChangeInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitTaskStateChange func (c *ECS) SubmitTaskStateChange(input *SubmitTaskStateChangeInput) (*SubmitTaskStateChangeOutput, error) { req, out := c.SubmitTaskStateChangeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SubmitTaskStateChangeWithContext is the same as SubmitTaskStateChange with the addition of +// the ability to pass a context and additional request options. +// +// See SubmitTaskStateChange for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SubmitTaskStateChangeWithContext(ctx aws.Context, input *SubmitTaskStateChangeInput, opts ...request.Option) (*SubmitTaskStateChangeOutput, error) { + req, out := c.SubmitTaskStateChangeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateContainerAgent = "UpdateContainerAgent" @@ -2607,8 +3178,23 @@ func (c *ECS) UpdateContainerAgentRequest(input *UpdateContainerAgentInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerAgent func (c *ECS) UpdateContainerAgent(input *UpdateContainerAgentInput) (*UpdateContainerAgentOutput, error) { req, out := c.UpdateContainerAgentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateContainerAgentWithContext is the same as UpdateContainerAgent with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateContainerAgent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateContainerAgentWithContext(ctx aws.Context, input *UpdateContainerAgentInput, opts ...request.Option) (*UpdateContainerAgentOutput, error) { + req, out := c.UpdateContainerAgentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateContainerInstancesState = "UpdateContainerInstancesState" @@ -2728,8 +3314,23 @@ func (c *ECS) UpdateContainerInstancesStateRequest(input *UpdateContainerInstanc // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerInstancesState func (c *ECS) UpdateContainerInstancesState(input *UpdateContainerInstancesStateInput) (*UpdateContainerInstancesStateOutput, error) { req, out := c.UpdateContainerInstancesStateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateContainerInstancesStateWithContext is the same as UpdateContainerInstancesState with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateContainerInstancesState for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateContainerInstancesStateWithContext(ctx aws.Context, input *UpdateContainerInstancesStateInput, opts ...request.Option) (*UpdateContainerInstancesStateOutput, error) { + req, out := c.UpdateContainerInstancesStateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateService = "UpdateService" @@ -2881,8 +3482,23 @@ func (c *ECS) UpdateServiceRequest(input *UpdateServiceInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateService func (c *ECS) UpdateService(input *UpdateServiceInput) (*UpdateServiceOutput, error) { req, out := c.UpdateServiceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateServiceWithContext is the same as UpdateService with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateService for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateServiceWithContext(ctx aws.Context, input *UpdateServiceInput, opts ...request.Option) (*UpdateServiceOutput, error) { + req, out := c.UpdateServiceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // An attribute is a name-value pair associated with an Amazon ECS object. Attributes diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go index 02d4d4ab5..1e32412ac 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ecs diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go index 4998b15fd..67ef4953c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ecs diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go index cbc6f76e1..007b21614 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ecs import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilServicesInactive uses the Amazon ECS API operation @@ -11,32 +14,50 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *ECS) WaitUntilServicesInactive(input *DescribeServicesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeServices", - Delay: 15, + return c.WaitUntilServicesInactiveWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilServicesInactiveWithContext is an extended version of WaitUntilServicesInactive. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilServicesInactiveWithContext(ctx aws.Context, input *DescribeServicesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilServicesInactive", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "failure", - Matcher: "pathAny", - Argument: "failures[].reason", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "failures[].reason", Expected: "MISSING", }, { - State: "success", - Matcher: "pathAny", - Argument: "services[].status", + State: request.SuccessWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "services[].status", Expected: "INACTIVE", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeServicesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeServicesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilServicesStable uses the Amazon ECS API operation @@ -44,44 +65,60 @@ func (c *ECS) WaitUntilServicesInactive(input *DescribeServicesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *ECS) WaitUntilServicesStable(input *DescribeServicesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeServices", - Delay: 15, + return c.WaitUntilServicesStableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilServicesStableWithContext is an extended version of WaitUntilServicesStable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilServicesStableWithContext(ctx aws.Context, input *DescribeServicesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilServicesStable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "failure", - Matcher: "pathAny", - Argument: "failures[].reason", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "failures[].reason", Expected: "MISSING", }, { - State: "failure", - Matcher: "pathAny", - Argument: "services[].status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "services[].status", Expected: "DRAINING", }, { - State: "failure", - Matcher: "pathAny", - Argument: "services[].status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "services[].status", Expected: "INACTIVE", }, { - State: "success", - Matcher: "path", - Argument: "length(services[?!(length(deployments) == `1` && runningCount == desiredCount)]) == `0`", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(services[?!(length(deployments) == `1` && runningCount == desiredCount)]) == `0`", Expected: true, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeServicesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeServicesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilTasksRunning uses the Amazon ECS API operation @@ -89,38 +126,55 @@ func (c *ECS) WaitUntilServicesStable(input *DescribeServicesInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *ECS) WaitUntilTasksRunning(input *DescribeTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeTasks", - Delay: 6, + return c.WaitUntilTasksRunningWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilTasksRunningWithContext is an extended version of WaitUntilTasksRunning. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilTasksRunningWithContext(ctx aws.Context, input *DescribeTasksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilTasksRunning", MaxAttempts: 100, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(6 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "failure", - Matcher: "pathAny", - Argument: "tasks[].lastStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "tasks[].lastStatus", Expected: "STOPPED", }, { - State: "failure", - Matcher: "pathAny", - Argument: "failures[].reason", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "failures[].reason", Expected: "MISSING", }, { - State: "success", - Matcher: "pathAll", - Argument: "tasks[].lastStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "tasks[].lastStatus", Expected: "RUNNING", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilTasksStopped uses the Amazon ECS API operation @@ -128,24 +182,43 @@ func (c *ECS) WaitUntilTasksRunning(input *DescribeTasksInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *ECS) WaitUntilTasksStopped(input *DescribeTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeTasks", - Delay: 6, + return c.WaitUntilTasksStoppedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilTasksStoppedWithContext is an extended version of WaitUntilTasksStopped. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilTasksStoppedWithContext(ctx aws.Context, input *DescribeTasksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilTasksStopped", MaxAttempts: 100, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(6 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "tasks[].lastStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "tasks[].lastStatus", Expected: "STOPPED", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/efs/api.go b/vendor/github.com/aws/aws-sdk-go/service/efs/api.go index f4c2ac141..e137e30d6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/efs/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package efs provides a client for Amazon Elastic File System. package efs @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -131,8 +132,23 @@ func (c *EFS) CreateFileSystemRequest(input *CreateFileSystemInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateFileSystem func (c *EFS) CreateFileSystem(input *CreateFileSystemInput) (*FileSystemDescription, error) { req, out := c.CreateFileSystemRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateFileSystemWithContext is the same as CreateFileSystem with the addition of +// the ability to pass a context and additional request options. +// +// See CreateFileSystem for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) CreateFileSystemWithContext(ctx aws.Context, input *CreateFileSystemInput, opts ...request.Option) (*FileSystemDescription, error) { + req, out := c.CreateFileSystemRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateMountTarget = "CreateMountTarget" @@ -333,8 +349,23 @@ func (c *EFS) CreateMountTargetRequest(input *CreateMountTargetInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateMountTarget func (c *EFS) CreateMountTarget(input *CreateMountTargetInput) (*MountTargetDescription, error) { req, out := c.CreateMountTargetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateMountTargetWithContext is the same as CreateMountTarget with the addition of +// the ability to pass a context and additional request options. +// +// See CreateMountTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) CreateMountTargetWithContext(ctx aws.Context, input *CreateMountTargetInput, opts ...request.Option) (*MountTargetDescription, error) { + req, out := c.CreateMountTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTags = "CreateTags" @@ -414,8 +445,23 @@ func (c *EFS) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateTags func (c *EFS) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { req, out := c.CreateTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTagsWithContext is the same as CreateTags with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) CreateTagsWithContext(ctx aws.Context, input *CreateTagsInput, opts ...request.Option) (*CreateTagsOutput, error) { + req, out := c.CreateTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteFileSystem = "DeleteFileSystem" @@ -507,8 +553,23 @@ func (c *EFS) DeleteFileSystemRequest(input *DeleteFileSystemInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteFileSystem func (c *EFS) DeleteFileSystem(input *DeleteFileSystemInput) (*DeleteFileSystemOutput, error) { req, out := c.DeleteFileSystemRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteFileSystemWithContext is the same as DeleteFileSystem with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteFileSystem for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DeleteFileSystemWithContext(ctx aws.Context, input *DeleteFileSystemInput, opts ...request.Option) (*DeleteFileSystemOutput, error) { + req, out := c.DeleteFileSystemRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteMountTarget = "DeleteMountTarget" @@ -610,8 +671,23 @@ func (c *EFS) DeleteMountTargetRequest(input *DeleteMountTargetInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteMountTarget func (c *EFS) DeleteMountTarget(input *DeleteMountTargetInput) (*DeleteMountTargetOutput, error) { req, out := c.DeleteMountTargetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteMountTargetWithContext is the same as DeleteMountTarget with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMountTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DeleteMountTargetWithContext(ctx aws.Context, input *DeleteMountTargetInput, opts ...request.Option) (*DeleteMountTargetOutput, error) { + req, out := c.DeleteMountTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTags = "DeleteTags" @@ -692,8 +768,23 @@ func (c *EFS) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteTags func (c *EFS) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { req, out := c.DeleteTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTagsWithContext is the same as DeleteTags with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { + req, out := c.DeleteTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeFileSystems = "DescribeFileSystems" @@ -790,8 +881,23 @@ func (c *EFS) DescribeFileSystemsRequest(input *DescribeFileSystemsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeFileSystems func (c *EFS) DescribeFileSystems(input *DescribeFileSystemsInput) (*DescribeFileSystemsOutput, error) { req, out := c.DescribeFileSystemsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeFileSystemsWithContext is the same as DescribeFileSystems with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeFileSystems for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DescribeFileSystemsWithContext(ctx aws.Context, input *DescribeFileSystemsInput, opts ...request.Option) (*DescribeFileSystemsOutput, error) { + req, out := c.DescribeFileSystemsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMountTargetSecurityGroups = "DescribeMountTargetSecurityGroups" @@ -876,8 +982,23 @@ func (c *EFS) DescribeMountTargetSecurityGroupsRequest(input *DescribeMountTarge // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargetSecurityGroups func (c *EFS) DescribeMountTargetSecurityGroups(input *DescribeMountTargetSecurityGroupsInput) (*DescribeMountTargetSecurityGroupsOutput, error) { req, out := c.DescribeMountTargetSecurityGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMountTargetSecurityGroupsWithContext is the same as DescribeMountTargetSecurityGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMountTargetSecurityGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DescribeMountTargetSecurityGroupsWithContext(ctx aws.Context, input *DescribeMountTargetSecurityGroupsInput, opts ...request.Option) (*DescribeMountTargetSecurityGroupsOutput, error) { + req, out := c.DescribeMountTargetSecurityGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMountTargets = "DescribeMountTargets" @@ -959,8 +1080,23 @@ func (c *EFS) DescribeMountTargetsRequest(input *DescribeMountTargetsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargets func (c *EFS) DescribeMountTargets(input *DescribeMountTargetsInput) (*DescribeMountTargetsOutput, error) { req, out := c.DescribeMountTargetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMountTargetsWithContext is the same as DescribeMountTargets with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMountTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DescribeMountTargetsWithContext(ctx aws.Context, input *DescribeMountTargetsInput, opts ...request.Option) (*DescribeMountTargetsOutput, error) { + req, out := c.DescribeMountTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTags = "DescribeTags" @@ -1037,8 +1173,23 @@ func (c *EFS) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeTags func (c *EFS) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTagsWithContext is the same as DescribeTags with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { + req, out := c.DescribeTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyMountTargetSecurityGroups = "ModifyMountTargetSecurityGroups" @@ -1138,8 +1289,23 @@ func (c *EFS) ModifyMountTargetSecurityGroupsRequest(input *ModifyMountTargetSec // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/ModifyMountTargetSecurityGroups func (c *EFS) ModifyMountTargetSecurityGroups(input *ModifyMountTargetSecurityGroupsInput) (*ModifyMountTargetSecurityGroupsOutput, error) { req, out := c.ModifyMountTargetSecurityGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyMountTargetSecurityGroupsWithContext is the same as ModifyMountTargetSecurityGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyMountTargetSecurityGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) ModifyMountTargetSecurityGroupsWithContext(ctx aws.Context, input *ModifyMountTargetSecurityGroupsInput, opts ...request.Option) (*ModifyMountTargetSecurityGroupsOutput, error) { + req, out := c.ModifyMountTargetSecurityGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateFileSystemRequest diff --git a/vendor/github.com/aws/aws-sdk-go/service/efs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/efs/errors.go index 326ffa4b2..950e4ca5f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/efs/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package efs diff --git a/vendor/github.com/aws/aws-sdk-go/service/efs/service.go b/vendor/github.com/aws/aws-sdk-go/service/efs/service.go index 583f08d39..ae189c197 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/efs/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package efs diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go index 4eab1e4d0..ee02a8089 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package elasticache provides a client for Amazon ElastiCache. package elasticache @@ -6,6 +6,7 @@ package elasticache import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -94,8 +95,23 @@ func (c *ElastiCache) AddTagsToResourceRequest(input *AddTagsToResourceInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AddTagsToResource func (c *ElastiCache) AddTagsToResource(input *AddTagsToResourceInput) (*TagListMessage, error) { req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsToResourceWithContext is the same as AddTagsToResource with the addition of +// the ability to pass a context and additional request options. +// +// See AddTagsToResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsToResourceWithContext(ctx aws.Context, input *AddTagsToResourceInput, opts ...request.Option) (*TagListMessage, error) { + req, out := c.AddTagsToResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAuthorizeCacheSecurityGroupIngress = "AuthorizeCacheSecurityGroupIngress" @@ -178,8 +194,23 @@ func (c *ElastiCache) AuthorizeCacheSecurityGroupIngressRequest(input *Authorize // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AuthorizeCacheSecurityGroupIngress func (c *ElastiCache) AuthorizeCacheSecurityGroupIngress(input *AuthorizeCacheSecurityGroupIngressInput) (*AuthorizeCacheSecurityGroupIngressOutput, error) { req, out := c.AuthorizeCacheSecurityGroupIngressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AuthorizeCacheSecurityGroupIngressWithContext is the same as AuthorizeCacheSecurityGroupIngress with the addition of +// the ability to pass a context and additional request options. +// +// See AuthorizeCacheSecurityGroupIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AuthorizeCacheSecurityGroupIngressWithContext(ctx aws.Context, input *AuthorizeCacheSecurityGroupIngressInput, opts ...request.Option) (*AuthorizeCacheSecurityGroupIngressOutput, error) { + req, out := c.AuthorizeCacheSecurityGroupIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopySnapshot = "CopySnapshot" @@ -324,8 +355,23 @@ func (c *ElastiCache) CopySnapshotRequest(input *CopySnapshotInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CopySnapshot func (c *ElastiCache) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error) { req, out := c.CopySnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopySnapshotWithContext is the same as CopySnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CopySnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopySnapshotWithContext(ctx aws.Context, input *CopySnapshotInput, opts ...request.Option) (*CopySnapshotOutput, error) { + req, out := c.CopySnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateCacheCluster = "CreateCacheCluster" @@ -442,8 +488,23 @@ func (c *ElastiCache) CreateCacheClusterRequest(input *CreateCacheClusterInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheCluster func (c *ElastiCache) CreateCacheCluster(input *CreateCacheClusterInput) (*CreateCacheClusterOutput, error) { req, out := c.CreateCacheClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateCacheClusterWithContext is the same as CreateCacheCluster with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCacheCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateCacheClusterWithContext(ctx aws.Context, input *CreateCacheClusterInput, opts ...request.Option) (*CreateCacheClusterOutput, error) { + req, out := c.CreateCacheClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateCacheParameterGroup = "CreateCacheParameterGroup" @@ -522,8 +583,23 @@ func (c *ElastiCache) CreateCacheParameterGroupRequest(input *CreateCacheParamet // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheParameterGroup func (c *ElastiCache) CreateCacheParameterGroup(input *CreateCacheParameterGroupInput) (*CreateCacheParameterGroupOutput, error) { req, out := c.CreateCacheParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateCacheParameterGroupWithContext is the same as CreateCacheParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCacheParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateCacheParameterGroupWithContext(ctx aws.Context, input *CreateCacheParameterGroupInput, opts ...request.Option) (*CreateCacheParameterGroupOutput, error) { + req, out := c.CreateCacheParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateCacheSecurityGroup = "CreateCacheSecurityGroup" @@ -603,8 +679,23 @@ func (c *ElastiCache) CreateCacheSecurityGroupRequest(input *CreateCacheSecurity // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSecurityGroup func (c *ElastiCache) CreateCacheSecurityGroup(input *CreateCacheSecurityGroupInput) (*CreateCacheSecurityGroupOutput, error) { req, out := c.CreateCacheSecurityGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateCacheSecurityGroupWithContext is the same as CreateCacheSecurityGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCacheSecurityGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateCacheSecurityGroupWithContext(ctx aws.Context, input *CreateCacheSecurityGroupInput, opts ...request.Option) (*CreateCacheSecurityGroupOutput, error) { + req, out := c.CreateCacheSecurityGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateCacheSubnetGroup = "CreateCacheSubnetGroup" @@ -683,8 +774,23 @@ func (c *ElastiCache) CreateCacheSubnetGroupRequest(input *CreateCacheSubnetGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSubnetGroup func (c *ElastiCache) CreateCacheSubnetGroup(input *CreateCacheSubnetGroupInput) (*CreateCacheSubnetGroupOutput, error) { req, out := c.CreateCacheSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateCacheSubnetGroupWithContext is the same as CreateCacheSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCacheSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateCacheSubnetGroupWithContext(ctx aws.Context, input *CreateCacheSubnetGroupInput, opts ...request.Option) (*CreateCacheSubnetGroupOutput, error) { + req, out := c.CreateCacheSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateReplicationGroup = "CreateReplicationGroup" @@ -819,8 +925,23 @@ func (c *ElastiCache) CreateReplicationGroupRequest(input *CreateReplicationGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateReplicationGroup func (c *ElastiCache) CreateReplicationGroup(input *CreateReplicationGroupInput) (*CreateReplicationGroupOutput, error) { req, out := c.CreateReplicationGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateReplicationGroupWithContext is the same as CreateReplicationGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReplicationGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateReplicationGroupWithContext(ctx aws.Context, input *CreateReplicationGroupInput, opts ...request.Option) (*CreateReplicationGroupOutput, error) { + req, out := c.CreateReplicationGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSnapshot = "CreateSnapshot" @@ -920,8 +1041,23 @@ func (c *ElastiCache) CreateSnapshotRequest(input *CreateSnapshotInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateSnapshot func (c *ElastiCache) CreateSnapshot(input *CreateSnapshotInput) (*CreateSnapshotOutput, error) { req, out := c.CreateSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSnapshotWithContext is the same as CreateSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotInput, opts ...request.Option) (*CreateSnapshotOutput, error) { + req, out := c.CreateSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCacheCluster = "DeleteCacheCluster" @@ -1025,8 +1161,23 @@ func (c *ElastiCache) DeleteCacheClusterRequest(input *DeleteCacheClusterInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheCluster func (c *ElastiCache) DeleteCacheCluster(input *DeleteCacheClusterInput) (*DeleteCacheClusterOutput, error) { req, out := c.DeleteCacheClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteCacheClusterWithContext is the same as DeleteCacheCluster with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCacheCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteCacheClusterWithContext(ctx aws.Context, input *DeleteCacheClusterInput, opts ...request.Option) (*DeleteCacheClusterOutput, error) { + req, out := c.DeleteCacheClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCacheParameterGroup = "DeleteCacheParameterGroup" @@ -1104,8 +1255,23 @@ func (c *ElastiCache) DeleteCacheParameterGroupRequest(input *DeleteCacheParamet // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheParameterGroup func (c *ElastiCache) DeleteCacheParameterGroup(input *DeleteCacheParameterGroupInput) (*DeleteCacheParameterGroupOutput, error) { req, out := c.DeleteCacheParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteCacheParameterGroupWithContext is the same as DeleteCacheParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCacheParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteCacheParameterGroupWithContext(ctx aws.Context, input *DeleteCacheParameterGroupInput, opts ...request.Option) (*DeleteCacheParameterGroupOutput, error) { + req, out := c.DeleteCacheParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCacheSecurityGroup = "DeleteCacheSecurityGroup" @@ -1184,8 +1350,23 @@ func (c *ElastiCache) DeleteCacheSecurityGroupRequest(input *DeleteCacheSecurity // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSecurityGroup func (c *ElastiCache) DeleteCacheSecurityGroup(input *DeleteCacheSecurityGroupInput) (*DeleteCacheSecurityGroupOutput, error) { req, out := c.DeleteCacheSecurityGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteCacheSecurityGroupWithContext is the same as DeleteCacheSecurityGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCacheSecurityGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteCacheSecurityGroupWithContext(ctx aws.Context, input *DeleteCacheSecurityGroupInput, opts ...request.Option) (*DeleteCacheSecurityGroupOutput, error) { + req, out := c.DeleteCacheSecurityGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCacheSubnetGroup = "DeleteCacheSubnetGroup" @@ -1258,8 +1439,23 @@ func (c *ElastiCache) DeleteCacheSubnetGroupRequest(input *DeleteCacheSubnetGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSubnetGroup func (c *ElastiCache) DeleteCacheSubnetGroup(input *DeleteCacheSubnetGroupInput) (*DeleteCacheSubnetGroupOutput, error) { req, out := c.DeleteCacheSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteCacheSubnetGroupWithContext is the same as DeleteCacheSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCacheSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteCacheSubnetGroupWithContext(ctx aws.Context, input *DeleteCacheSubnetGroupInput, opts ...request.Option) (*DeleteCacheSubnetGroupOutput, error) { + req, out := c.DeleteCacheSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteReplicationGroup = "DeleteReplicationGroup" @@ -1360,8 +1556,23 @@ func (c *ElastiCache) DeleteReplicationGroupRequest(input *DeleteReplicationGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteReplicationGroup func (c *ElastiCache) DeleteReplicationGroup(input *DeleteReplicationGroupInput) (*DeleteReplicationGroupOutput, error) { req, out := c.DeleteReplicationGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteReplicationGroupWithContext is the same as DeleteReplicationGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteReplicationGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteReplicationGroupWithContext(ctx aws.Context, input *DeleteReplicationGroupInput, opts ...request.Option) (*DeleteReplicationGroupOutput, error) { + req, out := c.DeleteReplicationGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSnapshot = "DeleteSnapshot" @@ -1439,8 +1650,23 @@ func (c *ElastiCache) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteSnapshot func (c *ElastiCache) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error) { req, out := c.DeleteSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSnapshotWithContext is the same as DeleteSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSnapshotWithContext(ctx aws.Context, input *DeleteSnapshotInput, opts ...request.Option) (*DeleteSnapshotOutput, error) { + req, out := c.DeleteSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeCacheClusters = "DescribeCacheClusters" @@ -1537,8 +1763,23 @@ func (c *ElastiCache) DescribeCacheClustersRequest(input *DescribeCacheClustersI // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheClusters func (c *ElastiCache) DescribeCacheClusters(input *DescribeCacheClustersInput) (*DescribeCacheClustersOutput, error) { req, out := c.DescribeCacheClustersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCacheClustersWithContext is the same as DescribeCacheClusters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCacheClusters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCacheClustersWithContext(ctx aws.Context, input *DescribeCacheClustersInput, opts ...request.Option) (*DescribeCacheClustersOutput, error) { + req, out := c.DescribeCacheClustersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeCacheClustersPages iterates over the pages of a DescribeCacheClusters operation, @@ -1558,12 +1799,37 @@ func (c *ElastiCache) DescribeCacheClusters(input *DescribeCacheClustersInput) ( // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeCacheClustersPages(input *DescribeCacheClustersInput, fn func(p *DescribeCacheClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheClustersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCacheClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCacheClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeCacheClustersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeCacheEngineVersions = "DescribeCacheEngineVersions" @@ -1628,8 +1894,23 @@ func (c *ElastiCache) DescribeCacheEngineVersionsRequest(input *DescribeCacheEng // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheEngineVersions func (c *ElastiCache) DescribeCacheEngineVersions(input *DescribeCacheEngineVersionsInput) (*DescribeCacheEngineVersionsOutput, error) { req, out := c.DescribeCacheEngineVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCacheEngineVersionsWithContext is the same as DescribeCacheEngineVersions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCacheEngineVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCacheEngineVersionsWithContext(ctx aws.Context, input *DescribeCacheEngineVersionsInput, opts ...request.Option) (*DescribeCacheEngineVersionsOutput, error) { + req, out := c.DescribeCacheEngineVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeCacheEngineVersionsPages iterates over the pages of a DescribeCacheEngineVersions operation, @@ -1649,12 +1930,37 @@ func (c *ElastiCache) DescribeCacheEngineVersions(input *DescribeCacheEngineVers // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeCacheEngineVersionsPages(input *DescribeCacheEngineVersionsInput, fn func(p *DescribeCacheEngineVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheEngineVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheEngineVersionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCacheEngineVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCacheEngineVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeCacheEngineVersionsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeCacheParameterGroups = "DescribeCacheParameterGroups" @@ -1733,8 +2039,23 @@ func (c *ElastiCache) DescribeCacheParameterGroupsRequest(input *DescribeCachePa // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameterGroups func (c *ElastiCache) DescribeCacheParameterGroups(input *DescribeCacheParameterGroupsInput) (*DescribeCacheParameterGroupsOutput, error) { req, out := c.DescribeCacheParameterGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCacheParameterGroupsWithContext is the same as DescribeCacheParameterGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCacheParameterGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCacheParameterGroupsWithContext(ctx aws.Context, input *DescribeCacheParameterGroupsInput, opts ...request.Option) (*DescribeCacheParameterGroupsOutput, error) { + req, out := c.DescribeCacheParameterGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeCacheParameterGroupsPages iterates over the pages of a DescribeCacheParameterGroups operation, @@ -1754,12 +2075,37 @@ func (c *ElastiCache) DescribeCacheParameterGroups(input *DescribeCacheParameter // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeCacheParameterGroupsPages(input *DescribeCacheParameterGroupsInput, fn func(p *DescribeCacheParameterGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheParameterGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheParameterGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCacheParameterGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCacheParameterGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeCacheParameterGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeCacheParameters = "DescribeCacheParameters" @@ -1836,8 +2182,23 @@ func (c *ElastiCache) DescribeCacheParametersRequest(input *DescribeCacheParamet // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameters func (c *ElastiCache) DescribeCacheParameters(input *DescribeCacheParametersInput) (*DescribeCacheParametersOutput, error) { req, out := c.DescribeCacheParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCacheParametersWithContext is the same as DescribeCacheParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCacheParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCacheParametersWithContext(ctx aws.Context, input *DescribeCacheParametersInput, opts ...request.Option) (*DescribeCacheParametersOutput, error) { + req, out := c.DescribeCacheParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeCacheParametersPages iterates over the pages of a DescribeCacheParameters operation, @@ -1857,12 +2218,37 @@ func (c *ElastiCache) DescribeCacheParameters(input *DescribeCacheParametersInpu // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeCacheParametersPages(input *DescribeCacheParametersInput, fn func(p *DescribeCacheParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheParametersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCacheParametersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCacheParametersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeCacheParametersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeCacheSecurityGroups = "DescribeCacheSecurityGroups" @@ -1940,8 +2326,23 @@ func (c *ElastiCache) DescribeCacheSecurityGroupsRequest(input *DescribeCacheSec // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSecurityGroups func (c *ElastiCache) DescribeCacheSecurityGroups(input *DescribeCacheSecurityGroupsInput) (*DescribeCacheSecurityGroupsOutput, error) { req, out := c.DescribeCacheSecurityGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCacheSecurityGroupsWithContext is the same as DescribeCacheSecurityGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCacheSecurityGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCacheSecurityGroupsWithContext(ctx aws.Context, input *DescribeCacheSecurityGroupsInput, opts ...request.Option) (*DescribeCacheSecurityGroupsOutput, error) { + req, out := c.DescribeCacheSecurityGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeCacheSecurityGroupsPages iterates over the pages of a DescribeCacheSecurityGroups operation, @@ -1961,12 +2362,37 @@ func (c *ElastiCache) DescribeCacheSecurityGroups(input *DescribeCacheSecurityGr // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeCacheSecurityGroupsPages(input *DescribeCacheSecurityGroupsInput, fn func(p *DescribeCacheSecurityGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheSecurityGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheSecurityGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCacheSecurityGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCacheSecurityGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeCacheSecurityGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeCacheSubnetGroups = "DescribeCacheSubnetGroups" @@ -2038,8 +2464,23 @@ func (c *ElastiCache) DescribeCacheSubnetGroupsRequest(input *DescribeCacheSubne // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSubnetGroups func (c *ElastiCache) DescribeCacheSubnetGroups(input *DescribeCacheSubnetGroupsInput) (*DescribeCacheSubnetGroupsOutput, error) { req, out := c.DescribeCacheSubnetGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCacheSubnetGroupsWithContext is the same as DescribeCacheSubnetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCacheSubnetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCacheSubnetGroupsWithContext(ctx aws.Context, input *DescribeCacheSubnetGroupsInput, opts ...request.Option) (*DescribeCacheSubnetGroupsOutput, error) { + req, out := c.DescribeCacheSubnetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeCacheSubnetGroupsPages iterates over the pages of a DescribeCacheSubnetGroups operation, @@ -2059,12 +2500,37 @@ func (c *ElastiCache) DescribeCacheSubnetGroups(input *DescribeCacheSubnetGroups // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeCacheSubnetGroupsPages(input *DescribeCacheSubnetGroupsInput, fn func(p *DescribeCacheSubnetGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheSubnetGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheSubnetGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCacheSubnetGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCacheSubnetGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeCacheSubnetGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeEngineDefaultParameters = "DescribeEngineDefaultParameters" @@ -2138,8 +2604,23 @@ func (c *ElastiCache) DescribeEngineDefaultParametersRequest(input *DescribeEngi // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEngineDefaultParameters func (c *ElastiCache) DescribeEngineDefaultParameters(input *DescribeEngineDefaultParametersInput) (*DescribeEngineDefaultParametersOutput, error) { req, out := c.DescribeEngineDefaultParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEngineDefaultParametersWithContext is the same as DescribeEngineDefaultParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEngineDefaultParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEngineDefaultParametersWithContext(ctx aws.Context, input *DescribeEngineDefaultParametersInput, opts ...request.Option) (*DescribeEngineDefaultParametersOutput, error) { + req, out := c.DescribeEngineDefaultParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeEngineDefaultParametersPages iterates over the pages of a DescribeEngineDefaultParameters operation, @@ -2159,12 +2640,37 @@ func (c *ElastiCache) DescribeEngineDefaultParameters(input *DescribeEngineDefau // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeEngineDefaultParametersPages(input *DescribeEngineDefaultParametersInput, fn func(p *DescribeEngineDefaultParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEngineDefaultParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEngineDefaultParametersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEngineDefaultParametersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEngineDefaultParametersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeEvents = "DescribeEvents" @@ -2243,8 +2749,23 @@ func (c *ElastiCache) DescribeEventsRequest(input *DescribeEventsInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEvents func (c *ElastiCache) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, error) { req, out := c.DescribeEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEventsWithContext is the same as DescribeEvents with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEventsWithContext(ctx aws.Context, input *DescribeEventsInput, opts ...request.Option) (*DescribeEventsOutput, error) { + req, out := c.DescribeEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeEventsPages iterates over the pages of a DescribeEvents operation, @@ -2264,12 +2785,37 @@ func (c *ElastiCache) DescribeEvents(input *DescribeEventsInput) (*DescribeEvent // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeEventsPages(input *DescribeEventsInput, fn func(p *DescribeEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeReplicationGroups = "DescribeReplicationGroups" @@ -2349,8 +2895,23 @@ func (c *ElastiCache) DescribeReplicationGroupsRequest(input *DescribeReplicatio // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReplicationGroups func (c *ElastiCache) DescribeReplicationGroups(input *DescribeReplicationGroupsInput) (*DescribeReplicationGroupsOutput, error) { req, out := c.DescribeReplicationGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReplicationGroupsWithContext is the same as DescribeReplicationGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReplicationGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReplicationGroupsWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, opts ...request.Option) (*DescribeReplicationGroupsOutput, error) { + req, out := c.DescribeReplicationGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeReplicationGroupsPages iterates over the pages of a DescribeReplicationGroups operation, @@ -2370,12 +2931,37 @@ func (c *ElastiCache) DescribeReplicationGroups(input *DescribeReplicationGroups // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeReplicationGroupsPages(input *DescribeReplicationGroupsInput, fn func(p *DescribeReplicationGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReplicationGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReplicationGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReplicationGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReplicationGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeReplicationGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeReservedCacheNodes = "DescribeReservedCacheNodes" @@ -2452,8 +3038,23 @@ func (c *ElastiCache) DescribeReservedCacheNodesRequest(input *DescribeReservedC // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodes func (c *ElastiCache) DescribeReservedCacheNodes(input *DescribeReservedCacheNodesInput) (*DescribeReservedCacheNodesOutput, error) { req, out := c.DescribeReservedCacheNodesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedCacheNodesWithContext is the same as DescribeReservedCacheNodes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedCacheNodes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedCacheNodesWithContext(ctx aws.Context, input *DescribeReservedCacheNodesInput, opts ...request.Option) (*DescribeReservedCacheNodesOutput, error) { + req, out := c.DescribeReservedCacheNodesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeReservedCacheNodesPages iterates over the pages of a DescribeReservedCacheNodes operation, @@ -2473,12 +3074,37 @@ func (c *ElastiCache) DescribeReservedCacheNodes(input *DescribeReservedCacheNod // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeReservedCacheNodesPages(input *DescribeReservedCacheNodesInput, fn func(p *DescribeReservedCacheNodesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedCacheNodesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedCacheNodesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReservedCacheNodesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReservedCacheNodesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeReservedCacheNodesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeReservedCacheNodesOfferings = "DescribeReservedCacheNodesOfferings" @@ -2554,8 +3180,23 @@ func (c *ElastiCache) DescribeReservedCacheNodesOfferingsRequest(input *Describe // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodesOfferings func (c *ElastiCache) DescribeReservedCacheNodesOfferings(input *DescribeReservedCacheNodesOfferingsInput) (*DescribeReservedCacheNodesOfferingsOutput, error) { req, out := c.DescribeReservedCacheNodesOfferingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedCacheNodesOfferingsWithContext is the same as DescribeReservedCacheNodesOfferings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedCacheNodesOfferings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedCacheNodesOfferingsWithContext(ctx aws.Context, input *DescribeReservedCacheNodesOfferingsInput, opts ...request.Option) (*DescribeReservedCacheNodesOfferingsOutput, error) { + req, out := c.DescribeReservedCacheNodesOfferingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeReservedCacheNodesOfferingsPages iterates over the pages of a DescribeReservedCacheNodesOfferings operation, @@ -2575,12 +3216,37 @@ func (c *ElastiCache) DescribeReservedCacheNodesOfferings(input *DescribeReserve // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeReservedCacheNodesOfferingsPages(input *DescribeReservedCacheNodesOfferingsInput, fn func(p *DescribeReservedCacheNodesOfferingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedCacheNodesOfferingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedCacheNodesOfferingsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReservedCacheNodesOfferingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReservedCacheNodesOfferingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeReservedCacheNodesOfferingsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeSnapshots = "DescribeSnapshots" @@ -2664,8 +3330,23 @@ func (c *ElastiCache) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeSnapshots func (c *ElastiCache) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error) { req, out := c.DescribeSnapshotsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSnapshotsWithContext is the same as DescribeSnapshots with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSnapshots for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSnapshotsWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.Option) (*DescribeSnapshotsOutput, error) { + req, out := c.DescribeSnapshotsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeSnapshotsPages iterates over the pages of a DescribeSnapshots operation, @@ -2685,12 +3366,37 @@ func (c *ElastiCache) DescribeSnapshots(input *DescribeSnapshotsInput) (*Describ // return pageNum <= 3 // }) // -func (c *ElastiCache) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(p *DescribeSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSnapshotsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSnapshotsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeSnapshotsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSnapshotsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) + } + return p.Err() } const opListAllowedNodeTypeModifications = "ListAllowedNodeTypeModifications" @@ -2768,8 +3474,23 @@ func (c *ElastiCache) ListAllowedNodeTypeModificationsRequest(input *ListAllowed // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListAllowedNodeTypeModifications func (c *ElastiCache) ListAllowedNodeTypeModifications(input *ListAllowedNodeTypeModificationsInput) (*ListAllowedNodeTypeModificationsOutput, error) { req, out := c.ListAllowedNodeTypeModificationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAllowedNodeTypeModificationsWithContext is the same as ListAllowedNodeTypeModifications with the addition of +// the ability to pass a context and additional request options. +// +// See ListAllowedNodeTypeModifications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAllowedNodeTypeModificationsWithContext(ctx aws.Context, input *ListAllowedNodeTypeModificationsInput, opts ...request.Option) (*ListAllowedNodeTypeModificationsOutput, error) { + req, out := c.ListAllowedNodeTypeModificationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTagsForResource = "ListTagsForResource" @@ -2846,8 +3567,23 @@ func (c *ElastiCache) ListTagsForResourceRequest(input *ListTagsForResourceInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListTagsForResource func (c *ElastiCache) ListTagsForResource(input *ListTagsForResourceInput) (*TagListMessage, error) { req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*TagListMessage, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyCacheCluster = "ModifyCacheCluster" @@ -2948,8 +3684,23 @@ func (c *ElastiCache) ModifyCacheClusterRequest(input *ModifyCacheClusterInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheCluster func (c *ElastiCache) ModifyCacheCluster(input *ModifyCacheClusterInput) (*ModifyCacheClusterOutput, error) { req, out := c.ModifyCacheClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyCacheClusterWithContext is the same as ModifyCacheCluster with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyCacheCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyCacheClusterWithContext(ctx aws.Context, input *ModifyCacheClusterInput, opts ...request.Option) (*ModifyCacheClusterOutput, error) { + req, out := c.ModifyCacheClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyCacheParameterGroup = "ModifyCacheParameterGroup" @@ -3026,8 +3777,23 @@ func (c *ElastiCache) ModifyCacheParameterGroupRequest(input *ModifyCacheParamet // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheParameterGroup func (c *ElastiCache) ModifyCacheParameterGroup(input *ModifyCacheParameterGroupInput) (*CacheParameterGroupNameMessage, error) { req, out := c.ModifyCacheParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyCacheParameterGroupWithContext is the same as ModifyCacheParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyCacheParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyCacheParameterGroupWithContext(ctx aws.Context, input *ModifyCacheParameterGroupInput, opts ...request.Option) (*CacheParameterGroupNameMessage, error) { + req, out := c.ModifyCacheParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyCacheSubnetGroup = "ModifyCacheSubnetGroup" @@ -3102,8 +3868,23 @@ func (c *ElastiCache) ModifyCacheSubnetGroupRequest(input *ModifyCacheSubnetGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheSubnetGroup func (c *ElastiCache) ModifyCacheSubnetGroup(input *ModifyCacheSubnetGroupInput) (*ModifyCacheSubnetGroupOutput, error) { req, out := c.ModifyCacheSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyCacheSubnetGroupWithContext is the same as ModifyCacheSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyCacheSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyCacheSubnetGroupWithContext(ctx aws.Context, input *ModifyCacheSubnetGroupInput, opts ...request.Option) (*ModifyCacheSubnetGroupOutput, error) { + req, out := c.ModifyCacheSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyReplicationGroup = "ModifyReplicationGroup" @@ -3214,8 +3995,23 @@ func (c *ElastiCache) ModifyReplicationGroupRequest(input *ModifyReplicationGrou // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyReplicationGroup func (c *ElastiCache) ModifyReplicationGroup(input *ModifyReplicationGroupInput) (*ModifyReplicationGroupOutput, error) { req, out := c.ModifyReplicationGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyReplicationGroupWithContext is the same as ModifyReplicationGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyReplicationGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyReplicationGroupWithContext(ctx aws.Context, input *ModifyReplicationGroupInput, opts ...request.Option) (*ModifyReplicationGroupOutput, error) { + req, out := c.ModifyReplicationGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPurchaseReservedCacheNodesOffering = "PurchaseReservedCacheNodesOffering" @@ -3292,8 +4088,23 @@ func (c *ElastiCache) PurchaseReservedCacheNodesOfferingRequest(input *PurchaseR // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/PurchaseReservedCacheNodesOffering func (c *ElastiCache) PurchaseReservedCacheNodesOffering(input *PurchaseReservedCacheNodesOfferingInput) (*PurchaseReservedCacheNodesOfferingOutput, error) { req, out := c.PurchaseReservedCacheNodesOfferingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PurchaseReservedCacheNodesOfferingWithContext is the same as PurchaseReservedCacheNodesOffering with the addition of +// the ability to pass a context and additional request options. +// +// See PurchaseReservedCacheNodesOffering for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PurchaseReservedCacheNodesOfferingWithContext(ctx aws.Context, input *PurchaseReservedCacheNodesOfferingInput, opts ...request.Option) (*PurchaseReservedCacheNodesOfferingOutput, error) { + req, out := c.PurchaseReservedCacheNodesOfferingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRebootCacheCluster = "RebootCacheCluster" @@ -3369,8 +4180,23 @@ func (c *ElastiCache) RebootCacheClusterRequest(input *RebootCacheClusterInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RebootCacheCluster func (c *ElastiCache) RebootCacheCluster(input *RebootCacheClusterInput) (*RebootCacheClusterOutput, error) { req, out := c.RebootCacheClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RebootCacheClusterWithContext is the same as RebootCacheCluster with the addition of +// the ability to pass a context and additional request options. +// +// See RebootCacheCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RebootCacheClusterWithContext(ctx aws.Context, input *RebootCacheClusterInput, opts ...request.Option) (*RebootCacheClusterOutput, error) { + req, out := c.RebootCacheClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -3443,8 +4269,23 @@ func (c *ElastiCache) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourc // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RemoveTagsFromResource func (c *ElastiCache) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*TagListMessage, error) { req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsFromResourceWithContext is the same as RemoveTagsFromResource with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTagsFromResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsFromResourceWithContext(ctx aws.Context, input *RemoveTagsFromResourceInput, opts ...request.Option) (*TagListMessage, error) { + req, out := c.RemoveTagsFromResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResetCacheParameterGroup = "ResetCacheParameterGroup" @@ -3522,8 +4363,23 @@ func (c *ElastiCache) ResetCacheParameterGroupRequest(input *ResetCacheParameter // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ResetCacheParameterGroup func (c *ElastiCache) ResetCacheParameterGroup(input *ResetCacheParameterGroupInput) (*CacheParameterGroupNameMessage, error) { req, out := c.ResetCacheParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResetCacheParameterGroupWithContext is the same as ResetCacheParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ResetCacheParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResetCacheParameterGroupWithContext(ctx aws.Context, input *ResetCacheParameterGroupInput, opts ...request.Option) (*CacheParameterGroupNameMessage, error) { + req, out := c.ResetCacheParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRevokeCacheSecurityGroupIngress = "RevokeCacheSecurityGroupIngress" @@ -3602,8 +4458,23 @@ func (c *ElastiCache) RevokeCacheSecurityGroupIngressRequest(input *RevokeCacheS // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RevokeCacheSecurityGroupIngress func (c *ElastiCache) RevokeCacheSecurityGroupIngress(input *RevokeCacheSecurityGroupIngressInput) (*RevokeCacheSecurityGroupIngressOutput, error) { req, out := c.RevokeCacheSecurityGroupIngressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RevokeCacheSecurityGroupIngressWithContext is the same as RevokeCacheSecurityGroupIngress with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeCacheSecurityGroupIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RevokeCacheSecurityGroupIngressWithContext(ctx aws.Context, input *RevokeCacheSecurityGroupIngressInput, opts ...request.Option) (*RevokeCacheSecurityGroupIngressOutput, error) { + req, out := c.RevokeCacheSecurityGroupIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Represents the input of an AddTagsToResource operation. diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticache/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/errors.go index f5cffec0a..9ad0e8ad2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticache/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elasticache diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticache/service.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/service.go index 7654b3bd7..1ae97a037 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticache/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elasticache diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticache/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/waiters.go index 2e25f84d6..d5ab1eedf 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticache/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elasticache import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilCacheClusterAvailable uses the Amazon ElastiCache API operation @@ -11,50 +14,65 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *ElastiCache) WaitUntilCacheClusterAvailable(input *DescribeCacheClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeCacheClusters", - Delay: 15, + return c.WaitUntilCacheClusterAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilCacheClusterAvailableWithContext is an extended version of WaitUntilCacheClusterAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilCacheClusterAvailableWithContext(ctx aws.Context, input *DescribeCacheClustersInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilCacheClusterAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "deleted", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "deleting", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "incompatible-network", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "restore-failed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeCacheClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCacheClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilCacheClusterDeleted uses the Amazon ElastiCache API operation @@ -62,68 +80,80 @@ func (c *ElastiCache) WaitUntilCacheClusterAvailable(input *DescribeCacheCluster // If the condition is not meet within the max attempt window an error will // be returned. func (c *ElastiCache) WaitUntilCacheClusterDeleted(input *DescribeCacheClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeCacheClusters", - Delay: 15, + return c.WaitUntilCacheClusterDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilCacheClusterDeletedWithContext is an extended version of WaitUntilCacheClusterDeleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilCacheClusterDeletedWithContext(ctx aws.Context, input *DescribeCacheClustersInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilCacheClusterDeleted", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "deleted", }, { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "CacheClusterNotFound", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "creating", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "incompatible-network", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "modifying", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "restore-failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus", Expected: "snapshotting", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeCacheClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCacheClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilReplicationGroupAvailable uses the Amazon ElastiCache API operation @@ -131,32 +161,50 @@ func (c *ElastiCache) WaitUntilCacheClusterDeleted(input *DescribeCacheClustersI // If the condition is not meet within the max attempt window an error will // be returned. func (c *ElastiCache) WaitUntilReplicationGroupAvailable(input *DescribeReplicationGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeReplicationGroups", - Delay: 15, + return c.WaitUntilReplicationGroupAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilReplicationGroupAvailableWithContext is an extended version of WaitUntilReplicationGroupAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilReplicationGroupAvailableWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilReplicationGroupAvailable", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationGroups[].Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "ReplicationGroups[].Status", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "ReplicationGroups[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "ReplicationGroups[].Status", Expected: "deleted", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeReplicationGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReplicationGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilReplicationGroupDeleted uses the Amazon ElastiCache API operation @@ -164,36 +212,53 @@ func (c *ElastiCache) WaitUntilReplicationGroupAvailable(input *DescribeReplicat // If the condition is not meet within the max attempt window an error will // be returned. func (c *ElastiCache) WaitUntilReplicationGroupDeleted(input *DescribeReplicationGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeReplicationGroups", - Delay: 15, + return c.WaitUntilReplicationGroupDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilReplicationGroupDeletedWithContext is an extended version of WaitUntilReplicationGroupDeleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilReplicationGroupDeletedWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilReplicationGroupDeleted", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationGroups[].Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "ReplicationGroups[].Status", Expected: "deleted", }, { - State: "failure", - Matcher: "pathAny", - Argument: "ReplicationGroups[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "ReplicationGroups[].Status", Expected: "available", }, { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ReplicationGroupNotFoundFault", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeReplicationGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReplicationGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/api.go b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/api.go index 7f4e1f137..b8db05a32 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package elasticbeanstalk provides a client for AWS Elastic Beanstalk. package elasticbeanstalk @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -78,8 +79,23 @@ func (c *ElasticBeanstalk) AbortEnvironmentUpdateRequest(input *AbortEnvironment // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/AbortEnvironmentUpdate func (c *ElasticBeanstalk) AbortEnvironmentUpdate(input *AbortEnvironmentUpdateInput) (*AbortEnvironmentUpdateOutput, error) { req, out := c.AbortEnvironmentUpdateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AbortEnvironmentUpdateWithContext is the same as AbortEnvironmentUpdate with the addition of +// the ability to pass a context and additional request options. +// +// See AbortEnvironmentUpdate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AbortEnvironmentUpdateWithContext(ctx aws.Context, input *AbortEnvironmentUpdateInput, opts ...request.Option) (*AbortEnvironmentUpdateOutput, error) { + req, out := c.AbortEnvironmentUpdateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opApplyEnvironmentManagedAction = "ApplyEnvironmentManagedAction" @@ -148,8 +164,23 @@ func (c *ElasticBeanstalk) ApplyEnvironmentManagedActionRequest(input *ApplyEnvi // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplyEnvironmentManagedAction func (c *ElasticBeanstalk) ApplyEnvironmentManagedAction(input *ApplyEnvironmentManagedActionInput) (*ApplyEnvironmentManagedActionOutput, error) { req, out := c.ApplyEnvironmentManagedActionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ApplyEnvironmentManagedActionWithContext is the same as ApplyEnvironmentManagedAction with the addition of +// the ability to pass a context and additional request options. +// +// See ApplyEnvironmentManagedAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ApplyEnvironmentManagedActionWithContext(ctx aws.Context, input *ApplyEnvironmentManagedActionInput, opts ...request.Option) (*ApplyEnvironmentManagedActionOutput, error) { + req, out := c.ApplyEnvironmentManagedActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCheckDNSAvailability = "CheckDNSAvailability" @@ -208,8 +239,23 @@ func (c *ElasticBeanstalk) CheckDNSAvailabilityRequest(input *CheckDNSAvailabili // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CheckDNSAvailability func (c *ElasticBeanstalk) CheckDNSAvailability(input *CheckDNSAvailabilityInput) (*CheckDNSAvailabilityOutput, error) { req, out := c.CheckDNSAvailabilityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CheckDNSAvailabilityWithContext is the same as CheckDNSAvailability with the addition of +// the ability to pass a context and additional request options. +// +// See CheckDNSAvailability for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CheckDNSAvailabilityWithContext(ctx aws.Context, input *CheckDNSAvailabilityInput, opts ...request.Option) (*CheckDNSAvailabilityOutput, error) { + req, out := c.CheckDNSAvailabilityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opComposeEnvironments = "ComposeEnvironments" @@ -283,8 +329,23 @@ func (c *ElasticBeanstalk) ComposeEnvironmentsRequest(input *ComposeEnvironments // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ComposeEnvironments func (c *ElasticBeanstalk) ComposeEnvironments(input *ComposeEnvironmentsInput) (*EnvironmentDescriptionsMessage, error) { req, out := c.ComposeEnvironmentsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ComposeEnvironmentsWithContext is the same as ComposeEnvironments with the addition of +// the ability to pass a context and additional request options. +// +// See ComposeEnvironments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ComposeEnvironmentsWithContext(ctx aws.Context, input *ComposeEnvironmentsInput, opts ...request.Option) (*EnvironmentDescriptionsMessage, error) { + req, out := c.ComposeEnvironmentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateApplication = "CreateApplication" @@ -349,8 +410,23 @@ func (c *ElasticBeanstalk) CreateApplicationRequest(input *CreateApplicationInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateApplication func (c *ElasticBeanstalk) CreateApplication(input *CreateApplicationInput) (*ApplicationDescriptionMessage, error) { req, out := c.CreateApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateApplicationWithContext is the same as CreateApplication with the addition of +// the ability to pass a context and additional request options. +// +// See CreateApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateApplicationWithContext(ctx aws.Context, input *CreateApplicationInput, opts ...request.Option) (*ApplicationDescriptionMessage, error) { + req, out := c.CreateApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateApplicationVersion = "CreateApplicationVersion" @@ -450,8 +526,23 @@ func (c *ElasticBeanstalk) CreateApplicationVersionRequest(input *CreateApplicat // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateApplicationVersion func (c *ElasticBeanstalk) CreateApplicationVersion(input *CreateApplicationVersionInput) (*ApplicationVersionDescriptionMessage, error) { req, out := c.CreateApplicationVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateApplicationVersionWithContext is the same as CreateApplicationVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateApplicationVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateApplicationVersionWithContext(ctx aws.Context, input *CreateApplicationVersionInput, opts ...request.Option) (*ApplicationVersionDescriptionMessage, error) { + req, out := c.CreateApplicationVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateConfigurationTemplate = "CreateConfigurationTemplate" @@ -532,8 +623,23 @@ func (c *ElasticBeanstalk) CreateConfigurationTemplateRequest(input *CreateConfi // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateConfigurationTemplate func (c *ElasticBeanstalk) CreateConfigurationTemplate(input *CreateConfigurationTemplateInput) (*ConfigurationSettingsDescription, error) { req, out := c.CreateConfigurationTemplateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateConfigurationTemplateWithContext is the same as CreateConfigurationTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See CreateConfigurationTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateConfigurationTemplateWithContext(ctx aws.Context, input *CreateConfigurationTemplateInput, opts ...request.Option) (*ConfigurationSettingsDescription, error) { + req, out := c.CreateConfigurationTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateEnvironment = "CreateEnvironment" @@ -602,8 +708,23 @@ func (c *ElasticBeanstalk) CreateEnvironmentRequest(input *CreateEnvironmentInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateEnvironment func (c *ElasticBeanstalk) CreateEnvironment(input *CreateEnvironmentInput) (*EnvironmentDescription, error) { req, out := c.CreateEnvironmentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateEnvironmentWithContext is the same as CreateEnvironment with the addition of +// the ability to pass a context and additional request options. +// +// See CreateEnvironment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateEnvironmentWithContext(ctx aws.Context, input *CreateEnvironmentInput, opts ...request.Option) (*EnvironmentDescription, error) { + req, out := c.CreateEnvironmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePlatformVersion = "CreatePlatformVersion" @@ -675,8 +796,23 @@ func (c *ElasticBeanstalk) CreatePlatformVersionRequest(input *CreatePlatformVer // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreatePlatformVersion func (c *ElasticBeanstalk) CreatePlatformVersion(input *CreatePlatformVersionInput) (*CreatePlatformVersionOutput, error) { req, out := c.CreatePlatformVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePlatformVersionWithContext is the same as CreatePlatformVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePlatformVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreatePlatformVersionWithContext(ctx aws.Context, input *CreatePlatformVersionInput, opts ...request.Option) (*CreatePlatformVersionOutput, error) { + req, out := c.CreatePlatformVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateStorageLocation = "CreateStorageLocation" @@ -749,8 +885,23 @@ func (c *ElasticBeanstalk) CreateStorageLocationRequest(input *CreateStorageLoca // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateStorageLocation func (c *ElasticBeanstalk) CreateStorageLocation(input *CreateStorageLocationInput) (*CreateStorageLocationOutput, error) { req, out := c.CreateStorageLocationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateStorageLocationWithContext is the same as CreateStorageLocation with the addition of +// the ability to pass a context and additional request options. +// +// See CreateStorageLocation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateStorageLocationWithContext(ctx aws.Context, input *CreateStorageLocationInput, opts ...request.Option) (*CreateStorageLocationOutput, error) { + req, out := c.CreateStorageLocationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteApplication = "DeleteApplication" @@ -821,8 +972,23 @@ func (c *ElasticBeanstalk) DeleteApplicationRequest(input *DeleteApplicationInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplication func (c *ElasticBeanstalk) DeleteApplication(input *DeleteApplicationInput) (*DeleteApplicationOutput, error) { req, out := c.DeleteApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteApplicationWithContext is the same as DeleteApplication with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteApplicationWithContext(ctx aws.Context, input *DeleteApplicationInput, opts ...request.Option) (*DeleteApplicationOutput, error) { + req, out := c.DeleteApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteApplicationVersion = "DeleteApplicationVersion" @@ -910,8 +1076,23 @@ func (c *ElasticBeanstalk) DeleteApplicationVersionRequest(input *DeleteApplicat // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplicationVersion func (c *ElasticBeanstalk) DeleteApplicationVersion(input *DeleteApplicationVersionInput) (*DeleteApplicationVersionOutput, error) { req, out := c.DeleteApplicationVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteApplicationVersionWithContext is the same as DeleteApplicationVersion with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteApplicationVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteApplicationVersionWithContext(ctx aws.Context, input *DeleteApplicationVersionInput, opts ...request.Option) (*DeleteApplicationVersionOutput, error) { + req, out := c.DeleteApplicationVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteConfigurationTemplate = "DeleteConfigurationTemplate" @@ -982,8 +1163,23 @@ func (c *ElasticBeanstalk) DeleteConfigurationTemplateRequest(input *DeleteConfi // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteConfigurationTemplate func (c *ElasticBeanstalk) DeleteConfigurationTemplate(input *DeleteConfigurationTemplateInput) (*DeleteConfigurationTemplateOutput, error) { req, out := c.DeleteConfigurationTemplateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteConfigurationTemplateWithContext is the same as DeleteConfigurationTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteConfigurationTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteConfigurationTemplateWithContext(ctx aws.Context, input *DeleteConfigurationTemplateInput, opts ...request.Option) (*DeleteConfigurationTemplateOutput, error) { + req, out := c.DeleteConfigurationTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteEnvironmentConfiguration = "DeleteEnvironmentConfiguration" @@ -1051,8 +1247,23 @@ func (c *ElasticBeanstalk) DeleteEnvironmentConfigurationRequest(input *DeleteEn // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteEnvironmentConfiguration func (c *ElasticBeanstalk) DeleteEnvironmentConfiguration(input *DeleteEnvironmentConfigurationInput) (*DeleteEnvironmentConfigurationOutput, error) { req, out := c.DeleteEnvironmentConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteEnvironmentConfigurationWithContext is the same as DeleteEnvironmentConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteEnvironmentConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteEnvironmentConfigurationWithContext(ctx aws.Context, input *DeleteEnvironmentConfigurationInput, opts ...request.Option) (*DeleteEnvironmentConfigurationOutput, error) { + req, out := c.DeleteEnvironmentConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePlatformVersion = "DeletePlatformVersion" @@ -1128,8 +1339,23 @@ func (c *ElasticBeanstalk) DeletePlatformVersionRequest(input *DeletePlatformVer // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeletePlatformVersion func (c *ElasticBeanstalk) DeletePlatformVersion(input *DeletePlatformVersionInput) (*DeletePlatformVersionOutput, error) { req, out := c.DeletePlatformVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePlatformVersionWithContext is the same as DeletePlatformVersion with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePlatformVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeletePlatformVersionWithContext(ctx aws.Context, input *DeletePlatformVersionInput, opts ...request.Option) (*DeletePlatformVersionOutput, error) { + req, out := c.DeletePlatformVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeApplicationVersions = "DescribeApplicationVersions" @@ -1188,8 +1414,23 @@ func (c *ElasticBeanstalk) DescribeApplicationVersionsRequest(input *DescribeApp // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeApplicationVersions func (c *ElasticBeanstalk) DescribeApplicationVersions(input *DescribeApplicationVersionsInput) (*DescribeApplicationVersionsOutput, error) { req, out := c.DescribeApplicationVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeApplicationVersionsWithContext is the same as DescribeApplicationVersions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeApplicationVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeApplicationVersionsWithContext(ctx aws.Context, input *DescribeApplicationVersionsInput, opts ...request.Option) (*DescribeApplicationVersionsOutput, error) { + req, out := c.DescribeApplicationVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeApplications = "DescribeApplications" @@ -1248,8 +1489,23 @@ func (c *ElasticBeanstalk) DescribeApplicationsRequest(input *DescribeApplicatio // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeApplications func (c *ElasticBeanstalk) DescribeApplications(input *DescribeApplicationsInput) (*DescribeApplicationsOutput, error) { req, out := c.DescribeApplicationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeApplicationsWithContext is the same as DescribeApplications with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeApplications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeApplicationsWithContext(ctx aws.Context, input *DescribeApplicationsInput, opts ...request.Option) (*DescribeApplicationsOutput, error) { + req, out := c.DescribeApplicationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConfigurationOptions = "DescribeConfigurationOptions" @@ -1317,8 +1573,23 @@ func (c *ElasticBeanstalk) DescribeConfigurationOptionsRequest(input *DescribeCo // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeConfigurationOptions func (c *ElasticBeanstalk) DescribeConfigurationOptions(input *DescribeConfigurationOptionsInput) (*DescribeConfigurationOptionsOutput, error) { req, out := c.DescribeConfigurationOptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConfigurationOptionsWithContext is the same as DescribeConfigurationOptions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConfigurationOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConfigurationOptionsWithContext(ctx aws.Context, input *DescribeConfigurationOptionsInput, opts ...request.Option) (*DescribeConfigurationOptionsOutput, error) { + req, out := c.DescribeConfigurationOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConfigurationSettings = "DescribeConfigurationSettings" @@ -1394,8 +1665,23 @@ func (c *ElasticBeanstalk) DescribeConfigurationSettingsRequest(input *DescribeC // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeConfigurationSettings func (c *ElasticBeanstalk) DescribeConfigurationSettings(input *DescribeConfigurationSettingsInput) (*DescribeConfigurationSettingsOutput, error) { req, out := c.DescribeConfigurationSettingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConfigurationSettingsWithContext is the same as DescribeConfigurationSettings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConfigurationSettings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConfigurationSettingsWithContext(ctx aws.Context, input *DescribeConfigurationSettingsInput, opts ...request.Option) (*DescribeConfigurationSettingsOutput, error) { + req, out := c.DescribeConfigurationSettingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEnvironmentHealth = "DescribeEnvironmentHealth" @@ -1465,8 +1751,23 @@ func (c *ElasticBeanstalk) DescribeEnvironmentHealthRequest(input *DescribeEnvir // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentHealth func (c *ElasticBeanstalk) DescribeEnvironmentHealth(input *DescribeEnvironmentHealthInput) (*DescribeEnvironmentHealthOutput, error) { req, out := c.DescribeEnvironmentHealthRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEnvironmentHealthWithContext is the same as DescribeEnvironmentHealth with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEnvironmentHealth for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEnvironmentHealthWithContext(ctx aws.Context, input *DescribeEnvironmentHealthInput, opts ...request.Option) (*DescribeEnvironmentHealthOutput, error) { + req, out := c.DescribeEnvironmentHealthRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEnvironmentManagedActionHistory = "DescribeEnvironmentManagedActionHistory" @@ -1530,8 +1831,23 @@ func (c *ElasticBeanstalk) DescribeEnvironmentManagedActionHistoryRequest(input // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActionHistory func (c *ElasticBeanstalk) DescribeEnvironmentManagedActionHistory(input *DescribeEnvironmentManagedActionHistoryInput) (*DescribeEnvironmentManagedActionHistoryOutput, error) { req, out := c.DescribeEnvironmentManagedActionHistoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEnvironmentManagedActionHistoryWithContext is the same as DescribeEnvironmentManagedActionHistory with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEnvironmentManagedActionHistory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEnvironmentManagedActionHistoryWithContext(ctx aws.Context, input *DescribeEnvironmentManagedActionHistoryInput, opts ...request.Option) (*DescribeEnvironmentManagedActionHistoryOutput, error) { + req, out := c.DescribeEnvironmentManagedActionHistoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEnvironmentManagedActions = "DescribeEnvironmentManagedActions" @@ -1595,8 +1911,23 @@ func (c *ElasticBeanstalk) DescribeEnvironmentManagedActionsRequest(input *Descr // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActions func (c *ElasticBeanstalk) DescribeEnvironmentManagedActions(input *DescribeEnvironmentManagedActionsInput) (*DescribeEnvironmentManagedActionsOutput, error) { req, out := c.DescribeEnvironmentManagedActionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEnvironmentManagedActionsWithContext is the same as DescribeEnvironmentManagedActions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEnvironmentManagedActions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEnvironmentManagedActionsWithContext(ctx aws.Context, input *DescribeEnvironmentManagedActionsInput, opts ...request.Option) (*DescribeEnvironmentManagedActionsOutput, error) { + req, out := c.DescribeEnvironmentManagedActionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEnvironmentResources = "DescribeEnvironmentResources" @@ -1661,8 +1992,23 @@ func (c *ElasticBeanstalk) DescribeEnvironmentResourcesRequest(input *DescribeEn // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentResources func (c *ElasticBeanstalk) DescribeEnvironmentResources(input *DescribeEnvironmentResourcesInput) (*DescribeEnvironmentResourcesOutput, error) { req, out := c.DescribeEnvironmentResourcesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEnvironmentResourcesWithContext is the same as DescribeEnvironmentResources with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEnvironmentResources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEnvironmentResourcesWithContext(ctx aws.Context, input *DescribeEnvironmentResourcesInput, opts ...request.Option) (*DescribeEnvironmentResourcesOutput, error) { + req, out := c.DescribeEnvironmentResourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEnvironments = "DescribeEnvironments" @@ -1721,8 +2067,23 @@ func (c *ElasticBeanstalk) DescribeEnvironmentsRequest(input *DescribeEnvironmen // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironments func (c *ElasticBeanstalk) DescribeEnvironments(input *DescribeEnvironmentsInput) (*EnvironmentDescriptionsMessage, error) { req, out := c.DescribeEnvironmentsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEnvironmentsWithContext is the same as DescribeEnvironments with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEnvironments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEnvironmentsWithContext(ctx aws.Context, input *DescribeEnvironmentsInput, opts ...request.Option) (*EnvironmentDescriptionsMessage, error) { + req, out := c.DescribeEnvironmentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEvents = "DescribeEvents" @@ -1789,8 +2150,23 @@ func (c *ElasticBeanstalk) DescribeEventsRequest(input *DescribeEventsInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEvents func (c *ElasticBeanstalk) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, error) { req, out := c.DescribeEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEventsWithContext is the same as DescribeEvents with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEventsWithContext(ctx aws.Context, input *DescribeEventsInput, opts ...request.Option) (*DescribeEventsOutput, error) { + req, out := c.DescribeEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeEventsPages iterates over the pages of a DescribeEvents operation, @@ -1810,12 +2186,37 @@ func (c *ElasticBeanstalk) DescribeEvents(input *DescribeEventsInput) (*Describe // return pageNum <= 3 // }) // -func (c *ElasticBeanstalk) DescribeEventsPages(input *DescribeEventsInput, fn func(p *DescribeEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeInstancesHealth = "DescribeInstancesHealth" @@ -1884,8 +2285,23 @@ func (c *ElasticBeanstalk) DescribeInstancesHealthRequest(input *DescribeInstanc // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeInstancesHealth func (c *ElasticBeanstalk) DescribeInstancesHealth(input *DescribeInstancesHealthInput) (*DescribeInstancesHealthOutput, error) { req, out := c.DescribeInstancesHealthRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstancesHealthWithContext is the same as DescribeInstancesHealth with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstancesHealth for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstancesHealthWithContext(ctx aws.Context, input *DescribeInstancesHealthInput, opts ...request.Option) (*DescribeInstancesHealthOutput, error) { + req, out := c.DescribeInstancesHealthRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribePlatformVersion = "DescribePlatformVersion" @@ -1953,8 +2369,23 @@ func (c *ElasticBeanstalk) DescribePlatformVersionRequest(input *DescribePlatfor // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribePlatformVersion func (c *ElasticBeanstalk) DescribePlatformVersion(input *DescribePlatformVersionInput) (*DescribePlatformVersionOutput, error) { req, out := c.DescribePlatformVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribePlatformVersionWithContext is the same as DescribePlatformVersion with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePlatformVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribePlatformVersionWithContext(ctx aws.Context, input *DescribePlatformVersionInput, opts ...request.Option) (*DescribePlatformVersionOutput, error) { + req, out := c.DescribePlatformVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAvailableSolutionStacks = "ListAvailableSolutionStacks" @@ -2014,8 +2445,23 @@ func (c *ElasticBeanstalk) ListAvailableSolutionStacksRequest(input *ListAvailab // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListAvailableSolutionStacks func (c *ElasticBeanstalk) ListAvailableSolutionStacks(input *ListAvailableSolutionStacksInput) (*ListAvailableSolutionStacksOutput, error) { req, out := c.ListAvailableSolutionStacksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAvailableSolutionStacksWithContext is the same as ListAvailableSolutionStacks with the addition of +// the ability to pass a context and additional request options. +// +// See ListAvailableSolutionStacks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAvailableSolutionStacksWithContext(ctx aws.Context, input *ListAvailableSolutionStacksInput, opts ...request.Option) (*ListAvailableSolutionStacksOutput, error) { + req, out := c.ListAvailableSolutionStacksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListPlatformVersions = "ListPlatformVersions" @@ -2083,8 +2529,23 @@ func (c *ElasticBeanstalk) ListPlatformVersionsRequest(input *ListPlatformVersio // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListPlatformVersions func (c *ElasticBeanstalk) ListPlatformVersions(input *ListPlatformVersionsInput) (*ListPlatformVersionsOutput, error) { req, out := c.ListPlatformVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPlatformVersionsWithContext is the same as ListPlatformVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListPlatformVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPlatformVersionsWithContext(ctx aws.Context, input *ListPlatformVersionsInput, opts ...request.Option) (*ListPlatformVersionsOutput, error) { + req, out := c.ListPlatformVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRebuildEnvironment = "RebuildEnvironment" @@ -2152,8 +2613,23 @@ func (c *ElasticBeanstalk) RebuildEnvironmentRequest(input *RebuildEnvironmentIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RebuildEnvironment func (c *ElasticBeanstalk) RebuildEnvironment(input *RebuildEnvironmentInput) (*RebuildEnvironmentOutput, error) { req, out := c.RebuildEnvironmentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RebuildEnvironmentWithContext is the same as RebuildEnvironment with the addition of +// the ability to pass a context and additional request options. +// +// See RebuildEnvironment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RebuildEnvironmentWithContext(ctx aws.Context, input *RebuildEnvironmentInput, opts ...request.Option) (*RebuildEnvironmentOutput, error) { + req, out := c.RebuildEnvironmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRequestEnvironmentInfo = "RequestEnvironmentInfo" @@ -2228,8 +2704,23 @@ func (c *ElasticBeanstalk) RequestEnvironmentInfoRequest(input *RequestEnvironme // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RequestEnvironmentInfo func (c *ElasticBeanstalk) RequestEnvironmentInfo(input *RequestEnvironmentInfoInput) (*RequestEnvironmentInfoOutput, error) { req, out := c.RequestEnvironmentInfoRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RequestEnvironmentInfoWithContext is the same as RequestEnvironmentInfo with the addition of +// the ability to pass a context and additional request options. +// +// See RequestEnvironmentInfo for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RequestEnvironmentInfoWithContext(ctx aws.Context, input *RequestEnvironmentInfoInput, opts ...request.Option) (*RequestEnvironmentInfoOutput, error) { + req, out := c.RequestEnvironmentInfoRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestartAppServer = "RestartAppServer" @@ -2291,8 +2782,23 @@ func (c *ElasticBeanstalk) RestartAppServerRequest(input *RestartAppServerInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RestartAppServer func (c *ElasticBeanstalk) RestartAppServer(input *RestartAppServerInput) (*RestartAppServerOutput, error) { req, out := c.RestartAppServerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestartAppServerWithContext is the same as RestartAppServer with the addition of +// the ability to pass a context and additional request options. +// +// See RestartAppServer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestartAppServerWithContext(ctx aws.Context, input *RestartAppServerInput, opts ...request.Option) (*RestartAppServerOutput, error) { + req, out := c.RestartAppServerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRetrieveEnvironmentInfo = "RetrieveEnvironmentInfo" @@ -2355,8 +2861,23 @@ func (c *ElasticBeanstalk) RetrieveEnvironmentInfoRequest(input *RetrieveEnviron // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RetrieveEnvironmentInfo func (c *ElasticBeanstalk) RetrieveEnvironmentInfo(input *RetrieveEnvironmentInfoInput) (*RetrieveEnvironmentInfoOutput, error) { req, out := c.RetrieveEnvironmentInfoRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RetrieveEnvironmentInfoWithContext is the same as RetrieveEnvironmentInfo with the addition of +// the ability to pass a context and additional request options. +// +// See RetrieveEnvironmentInfo for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RetrieveEnvironmentInfoWithContext(ctx aws.Context, input *RetrieveEnvironmentInfoInput, opts ...request.Option) (*RetrieveEnvironmentInfoOutput, error) { + req, out := c.RetrieveEnvironmentInfoRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSwapEnvironmentCNAMEs = "SwapEnvironmentCNAMEs" @@ -2417,8 +2938,23 @@ func (c *ElasticBeanstalk) SwapEnvironmentCNAMEsRequest(input *SwapEnvironmentCN // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs func (c *ElasticBeanstalk) SwapEnvironmentCNAMEs(input *SwapEnvironmentCNAMEsInput) (*SwapEnvironmentCNAMEsOutput, error) { req, out := c.SwapEnvironmentCNAMEsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SwapEnvironmentCNAMEsWithContext is the same as SwapEnvironmentCNAMEs with the addition of +// the ability to pass a context and additional request options. +// +// See SwapEnvironmentCNAMEs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SwapEnvironmentCNAMEsWithContext(ctx aws.Context, input *SwapEnvironmentCNAMEsInput, opts ...request.Option) (*SwapEnvironmentCNAMEsOutput, error) { + req, out := c.SwapEnvironmentCNAMEsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTerminateEnvironment = "TerminateEnvironment" @@ -2483,8 +3019,23 @@ func (c *ElasticBeanstalk) TerminateEnvironmentRequest(input *TerminateEnvironme // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/TerminateEnvironment func (c *ElasticBeanstalk) TerminateEnvironment(input *TerminateEnvironmentInput) (*EnvironmentDescription, error) { req, out := c.TerminateEnvironmentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TerminateEnvironmentWithContext is the same as TerminateEnvironment with the addition of +// the ability to pass a context and additional request options. +// +// See TerminateEnvironment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TerminateEnvironmentWithContext(ctx aws.Context, input *TerminateEnvironmentInput, opts ...request.Option) (*EnvironmentDescription, error) { + req, out := c.TerminateEnvironmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateApplication = "UpdateApplication" @@ -2546,8 +3097,23 @@ func (c *ElasticBeanstalk) UpdateApplicationRequest(input *UpdateApplicationInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplication func (c *ElasticBeanstalk) UpdateApplication(input *UpdateApplicationInput) (*ApplicationDescriptionMessage, error) { req, out := c.UpdateApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateApplicationWithContext is the same as UpdateApplication with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateApplicationWithContext(ctx aws.Context, input *UpdateApplicationInput, opts ...request.Option) (*ApplicationDescriptionMessage, error) { + req, out := c.UpdateApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateApplicationResourceLifecycle = "UpdateApplicationResourceLifecycle" @@ -2612,8 +3178,23 @@ func (c *ElasticBeanstalk) UpdateApplicationResourceLifecycleRequest(input *Upda // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplicationResourceLifecycle func (c *ElasticBeanstalk) UpdateApplicationResourceLifecycle(input *UpdateApplicationResourceLifecycleInput) (*UpdateApplicationResourceLifecycleOutput, error) { req, out := c.UpdateApplicationResourceLifecycleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateApplicationResourceLifecycleWithContext is the same as UpdateApplicationResourceLifecycle with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApplicationResourceLifecycle for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateApplicationResourceLifecycleWithContext(ctx aws.Context, input *UpdateApplicationResourceLifecycleInput, opts ...request.Option) (*UpdateApplicationResourceLifecycleOutput, error) { + req, out := c.UpdateApplicationResourceLifecycleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateApplicationVersion = "UpdateApplicationVersion" @@ -2675,8 +3256,23 @@ func (c *ElasticBeanstalk) UpdateApplicationVersionRequest(input *UpdateApplicat // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplicationVersion func (c *ElasticBeanstalk) UpdateApplicationVersion(input *UpdateApplicationVersionInput) (*ApplicationVersionDescriptionMessage, error) { req, out := c.UpdateApplicationVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateApplicationVersionWithContext is the same as UpdateApplicationVersion with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApplicationVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateApplicationVersionWithContext(ctx aws.Context, input *UpdateApplicationVersionInput, opts ...request.Option) (*ApplicationVersionDescriptionMessage, error) { + req, out := c.UpdateApplicationVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateConfigurationTemplate = "UpdateConfigurationTemplate" @@ -2752,8 +3348,23 @@ func (c *ElasticBeanstalk) UpdateConfigurationTemplateRequest(input *UpdateConfi // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateConfigurationTemplate func (c *ElasticBeanstalk) UpdateConfigurationTemplate(input *UpdateConfigurationTemplateInput) (*ConfigurationSettingsDescription, error) { req, out := c.UpdateConfigurationTemplateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateConfigurationTemplateWithContext is the same as UpdateConfigurationTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateConfigurationTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateConfigurationTemplateWithContext(ctx aws.Context, input *UpdateConfigurationTemplateInput, opts ...request.Option) (*ConfigurationSettingsDescription, error) { + req, out := c.UpdateConfigurationTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateEnvironment = "UpdateEnvironment" @@ -2831,8 +3442,23 @@ func (c *ElasticBeanstalk) UpdateEnvironmentRequest(input *UpdateEnvironmentInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateEnvironment func (c *ElasticBeanstalk) UpdateEnvironment(input *UpdateEnvironmentInput) (*EnvironmentDescription, error) { req, out := c.UpdateEnvironmentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateEnvironmentWithContext is the same as UpdateEnvironment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateEnvironment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateEnvironmentWithContext(ctx aws.Context, input *UpdateEnvironmentInput, opts ...request.Option) (*EnvironmentDescription, error) { + req, out := c.UpdateEnvironmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opValidateConfigurationSettings = "ValidateConfigurationSettings" @@ -2904,8 +3530,23 @@ func (c *ElasticBeanstalk) ValidateConfigurationSettingsRequest(input *ValidateC // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ValidateConfigurationSettings func (c *ElasticBeanstalk) ValidateConfigurationSettings(input *ValidateConfigurationSettingsInput) (*ValidateConfigurationSettingsOutput, error) { req, out := c.ValidateConfigurationSettingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ValidateConfigurationSettingsWithContext is the same as ValidateConfigurationSettings with the addition of +// the ability to pass a context and additional request options. +// +// See ValidateConfigurationSettings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ValidateConfigurationSettingsWithContext(ctx aws.Context, input *ValidateConfigurationSettingsInput, opts ...request.Option) (*ValidateConfigurationSettingsOutput, error) { + req, out := c.ValidateConfigurationSettingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/AbortEnvironmentUpdateMessage diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/errors.go index f185a055c..0ed1bd633 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elasticbeanstalk diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/service.go b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/service.go index 2134341fb..91c3b4df8 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elasticbeanstalk diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/api.go index 64f26f650..b7d3ca20b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package elasticsearchservice provides a client for Amazon Elasticsearch Service. package elasticsearchservice @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -91,8 +92,23 @@ func (c *ElasticsearchService) AddTagsRequest(input *AddTagsInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AddTags func (c *ElasticsearchService) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsWithContext is the same as AddTags with the addition of +// the ability to pass a context and additional request options. +// +// See AddTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error) { + req, out := c.AddTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateElasticsearchDomain = "CreateElasticsearchDomain" @@ -183,8 +199,23 @@ func (c *ElasticsearchService) CreateElasticsearchDomainRequest(input *CreateEla // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateElasticsearchDomain func (c *ElasticsearchService) CreateElasticsearchDomain(input *CreateElasticsearchDomainInput) (*CreateElasticsearchDomainOutput, error) { req, out := c.CreateElasticsearchDomainRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateElasticsearchDomainWithContext is the same as CreateElasticsearchDomain with the addition of +// the ability to pass a context and additional request options. +// +// See CreateElasticsearchDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateElasticsearchDomainWithContext(ctx aws.Context, input *CreateElasticsearchDomainInput, opts ...request.Option) (*CreateElasticsearchDomainOutput, error) { + req, out := c.CreateElasticsearchDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteElasticsearchDomain = "DeleteElasticsearchDomain" @@ -262,8 +293,23 @@ func (c *ElasticsearchService) DeleteElasticsearchDomainRequest(input *DeleteEla // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchDomain func (c *ElasticsearchService) DeleteElasticsearchDomain(input *DeleteElasticsearchDomainInput) (*DeleteElasticsearchDomainOutput, error) { req, out := c.DeleteElasticsearchDomainRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteElasticsearchDomainWithContext is the same as DeleteElasticsearchDomain with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteElasticsearchDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteElasticsearchDomainWithContext(ctx aws.Context, input *DeleteElasticsearchDomainInput, opts ...request.Option) (*DeleteElasticsearchDomainOutput, error) { + req, out := c.DeleteElasticsearchDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeElasticsearchDomain = "DescribeElasticsearchDomain" @@ -341,8 +387,23 @@ func (c *ElasticsearchService) DescribeElasticsearchDomainRequest(input *Describ // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomain func (c *ElasticsearchService) DescribeElasticsearchDomain(input *DescribeElasticsearchDomainInput) (*DescribeElasticsearchDomainOutput, error) { req, out := c.DescribeElasticsearchDomainRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeElasticsearchDomainWithContext is the same as DescribeElasticsearchDomain with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeElasticsearchDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeElasticsearchDomainWithContext(ctx aws.Context, input *DescribeElasticsearchDomainInput, opts ...request.Option) (*DescribeElasticsearchDomainOutput, error) { + req, out := c.DescribeElasticsearchDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeElasticsearchDomainConfig = "DescribeElasticsearchDomainConfig" @@ -421,8 +482,23 @@ func (c *ElasticsearchService) DescribeElasticsearchDomainConfigRequest(input *D // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainConfig func (c *ElasticsearchService) DescribeElasticsearchDomainConfig(input *DescribeElasticsearchDomainConfigInput) (*DescribeElasticsearchDomainConfigOutput, error) { req, out := c.DescribeElasticsearchDomainConfigRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeElasticsearchDomainConfigWithContext is the same as DescribeElasticsearchDomainConfig with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeElasticsearchDomainConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeElasticsearchDomainConfigWithContext(ctx aws.Context, input *DescribeElasticsearchDomainConfigInput, opts ...request.Option) (*DescribeElasticsearchDomainConfigOutput, error) { + req, out := c.DescribeElasticsearchDomainConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeElasticsearchDomains = "DescribeElasticsearchDomains" @@ -496,8 +572,23 @@ func (c *ElasticsearchService) DescribeElasticsearchDomainsRequest(input *Descri // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomains func (c *ElasticsearchService) DescribeElasticsearchDomains(input *DescribeElasticsearchDomainsInput) (*DescribeElasticsearchDomainsOutput, error) { req, out := c.DescribeElasticsearchDomainsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeElasticsearchDomainsWithContext is the same as DescribeElasticsearchDomains with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeElasticsearchDomains for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeElasticsearchDomainsWithContext(ctx aws.Context, input *DescribeElasticsearchDomainsInput, opts ...request.Option) (*DescribeElasticsearchDomainsOutput, error) { + req, out := c.DescribeElasticsearchDomainsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeElasticsearchInstanceTypeLimits = "DescribeElasticsearchInstanceTypeLimits" @@ -584,8 +675,23 @@ func (c *ElasticsearchService) DescribeElasticsearchInstanceTypeLimitsRequest(in // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimits func (c *ElasticsearchService) DescribeElasticsearchInstanceTypeLimits(input *DescribeElasticsearchInstanceTypeLimitsInput) (*DescribeElasticsearchInstanceTypeLimitsOutput, error) { req, out := c.DescribeElasticsearchInstanceTypeLimitsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeElasticsearchInstanceTypeLimitsWithContext is the same as DescribeElasticsearchInstanceTypeLimits with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeElasticsearchInstanceTypeLimits for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeElasticsearchInstanceTypeLimitsWithContext(ctx aws.Context, input *DescribeElasticsearchInstanceTypeLimitsInput, opts ...request.Option) (*DescribeElasticsearchInstanceTypeLimitsOutput, error) { + req, out := c.DescribeElasticsearchInstanceTypeLimitsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListDomainNames = "ListDomainNames" @@ -654,8 +760,23 @@ func (c *ElasticsearchService) ListDomainNamesRequest(input *ListDomainNamesInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainNames func (c *ElasticsearchService) ListDomainNames(input *ListDomainNamesInput) (*ListDomainNamesOutput, error) { req, out := c.ListDomainNamesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDomainNamesWithContext is the same as ListDomainNames with the addition of +// the ability to pass a context and additional request options. +// +// See ListDomainNames for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDomainNamesWithContext(ctx aws.Context, input *ListDomainNamesInput, opts ...request.Option) (*ListDomainNamesOutput, error) { + req, out := c.ListDomainNamesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListElasticsearchInstanceTypes = "ListElasticsearchInstanceTypes" @@ -738,8 +859,23 @@ func (c *ElasticsearchService) ListElasticsearchInstanceTypesRequest(input *List // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypes func (c *ElasticsearchService) ListElasticsearchInstanceTypes(input *ListElasticsearchInstanceTypesInput) (*ListElasticsearchInstanceTypesOutput, error) { req, out := c.ListElasticsearchInstanceTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListElasticsearchInstanceTypesWithContext is the same as ListElasticsearchInstanceTypes with the addition of +// the ability to pass a context and additional request options. +// +// See ListElasticsearchInstanceTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListElasticsearchInstanceTypesWithContext(ctx aws.Context, input *ListElasticsearchInstanceTypesInput, opts ...request.Option) (*ListElasticsearchInstanceTypesOutput, error) { + req, out := c.ListElasticsearchInstanceTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListElasticsearchInstanceTypesPages iterates over the pages of a ListElasticsearchInstanceTypes operation, @@ -759,12 +895,37 @@ func (c *ElasticsearchService) ListElasticsearchInstanceTypes(input *ListElastic // return pageNum <= 3 // }) // -func (c *ElasticsearchService) ListElasticsearchInstanceTypesPages(input *ListElasticsearchInstanceTypesInput, fn func(p *ListElasticsearchInstanceTypesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListElasticsearchInstanceTypesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListElasticsearchInstanceTypesOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListElasticsearchInstanceTypesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListElasticsearchInstanceTypesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListElasticsearchInstanceTypesOutput), !p.HasNextPage()) + } + return p.Err() } const opListElasticsearchVersions = "ListElasticsearchVersions" @@ -847,8 +1008,23 @@ func (c *ElasticsearchService) ListElasticsearchVersionsRequest(input *ListElast // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersions func (c *ElasticsearchService) ListElasticsearchVersions(input *ListElasticsearchVersionsInput) (*ListElasticsearchVersionsOutput, error) { req, out := c.ListElasticsearchVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListElasticsearchVersionsWithContext is the same as ListElasticsearchVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListElasticsearchVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListElasticsearchVersionsWithContext(ctx aws.Context, input *ListElasticsearchVersionsInput, opts ...request.Option) (*ListElasticsearchVersionsOutput, error) { + req, out := c.ListElasticsearchVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListElasticsearchVersionsPages iterates over the pages of a ListElasticsearchVersions operation, @@ -868,12 +1044,37 @@ func (c *ElasticsearchService) ListElasticsearchVersions(input *ListElasticsearc // return pageNum <= 3 // }) // -func (c *ElasticsearchService) ListElasticsearchVersionsPages(input *ListElasticsearchVersionsInput, fn func(p *ListElasticsearchVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListElasticsearchVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListElasticsearchVersionsOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListElasticsearchVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListElasticsearchVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListElasticsearchVersionsOutput), !p.HasNextPage()) + } + return p.Err() } const opListTags = "ListTags" @@ -950,8 +1151,23 @@ func (c *ElasticsearchService) ListTagsRequest(input *ListTagsInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListTags func (c *ElasticsearchService) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { req, out := c.ListTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsWithContext is the same as ListTags with the addition of +// the ability to pass a context and additional request options. +// +// See ListTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { + req, out := c.ListTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTags = "RemoveTags" @@ -1026,8 +1242,23 @@ func (c *ElasticsearchService) RemoveTagsRequest(input *RemoveTagsInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RemoveTags func (c *ElasticsearchService) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsWithContext is the same as RemoveTags with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateElasticsearchDomainConfig = "UpdateElasticsearchDomainConfig" @@ -1113,8 +1344,23 @@ func (c *ElasticsearchService) UpdateElasticsearchDomainConfigRequest(input *Upd // Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdateElasticsearchDomainConfig func (c *ElasticsearchService) UpdateElasticsearchDomainConfig(input *UpdateElasticsearchDomainConfigInput) (*UpdateElasticsearchDomainConfigOutput, error) { req, out := c.UpdateElasticsearchDomainConfigRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateElasticsearchDomainConfigWithContext is the same as UpdateElasticsearchDomainConfig with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateElasticsearchDomainConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateElasticsearchDomainConfigWithContext(ctx aws.Context, input *UpdateElasticsearchDomainConfigInput, opts ...request.Option) (*UpdateElasticsearchDomainConfigOutput, error) { + req, out := c.UpdateElasticsearchDomainConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // The configured access rules for the domain's document and search endpoints, diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/errors.go index 66c1650b0..332cf8d4f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elasticsearchservice diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/service.go index 8ba1f8bf5..ee2acc495 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elasticsearchservice diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go index df4a29947..a4c0d3f31 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package elastictranscoder provides a client for Amazon Elastic Transcoder. package elastictranscoder @@ -6,6 +6,7 @@ package elastictranscoder import ( "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -90,8 +91,23 @@ func (c *ElasticTranscoder) CancelJobRequest(input *CancelJobInput) (req *reques // func (c *ElasticTranscoder) CancelJob(input *CancelJobInput) (*CancelJobOutput, error) { req, out := c.CancelJobRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelJobWithContext is the same as CancelJob with the addition of +// the ability to pass a context and additional request options. +// +// See CancelJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelJobWithContext(ctx aws.Context, input *CancelJobInput, opts ...request.Option) (*CancelJobOutput, error) { + req, out := c.CancelJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateJob = "CreateJob" @@ -176,8 +192,23 @@ func (c *ElasticTranscoder) CreateJobRequest(input *CreateJobInput) (req *reques // func (c *ElasticTranscoder) CreateJob(input *CreateJobInput) (*CreateJobResponse, error) { req, out := c.CreateJobRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateJobWithContext is the same as CreateJob with the addition of +// the ability to pass a context and additional request options. +// +// See CreateJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateJobWithContext(ctx aws.Context, input *CreateJobInput, opts ...request.Option) (*CreateJobResponse, error) { + req, out := c.CreateJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePipeline = "CreatePipeline" @@ -256,8 +287,23 @@ func (c *ElasticTranscoder) CreatePipelineRequest(input *CreatePipelineInput) (r // func (c *ElasticTranscoder) CreatePipeline(input *CreatePipelineInput) (*CreatePipelineOutput, error) { req, out := c.CreatePipelineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePipelineWithContext is the same as CreatePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreatePipelineWithContext(ctx aws.Context, input *CreatePipelineInput, opts ...request.Option) (*CreatePipelineOutput, error) { + req, out := c.CreatePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePreset = "CreatePreset" @@ -345,8 +391,23 @@ func (c *ElasticTranscoder) CreatePresetRequest(input *CreatePresetInput) (req * // func (c *ElasticTranscoder) CreatePreset(input *CreatePresetInput) (*CreatePresetOutput, error) { req, out := c.CreatePresetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePresetWithContext is the same as CreatePreset with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePreset for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreatePresetWithContext(ctx aws.Context, input *CreatePresetInput, opts ...request.Option) (*CreatePresetOutput, error) { + req, out := c.CreatePresetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePipeline = "DeletePipeline" @@ -429,8 +490,23 @@ func (c *ElasticTranscoder) DeletePipelineRequest(input *DeletePipelineInput) (r // func (c *ElasticTranscoder) DeletePipeline(input *DeletePipelineInput) (*DeletePipelineOutput, error) { req, out := c.DeletePipelineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePipelineWithContext is the same as DeletePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeletePipelineWithContext(ctx aws.Context, input *DeletePipelineInput, opts ...request.Option) (*DeletePipelineOutput, error) { + req, out := c.DeletePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePreset = "DeletePreset" @@ -507,8 +583,23 @@ func (c *ElasticTranscoder) DeletePresetRequest(input *DeletePresetInput) (req * // func (c *ElasticTranscoder) DeletePreset(input *DeletePresetInput) (*DeletePresetOutput, error) { req, out := c.DeletePresetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePresetWithContext is the same as DeletePreset with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePreset for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeletePresetWithContext(ctx aws.Context, input *DeletePresetInput, opts ...request.Option) (*DeletePresetOutput, error) { + req, out := c.DeletePresetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListJobsByPipeline = "ListJobsByPipeline" @@ -593,8 +684,23 @@ func (c *ElasticTranscoder) ListJobsByPipelineRequest(input *ListJobsByPipelineI // func (c *ElasticTranscoder) ListJobsByPipeline(input *ListJobsByPipelineInput) (*ListJobsByPipelineOutput, error) { req, out := c.ListJobsByPipelineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListJobsByPipelineWithContext is the same as ListJobsByPipeline with the addition of +// the ability to pass a context and additional request options. +// +// See ListJobsByPipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListJobsByPipelineWithContext(ctx aws.Context, input *ListJobsByPipelineInput, opts ...request.Option) (*ListJobsByPipelineOutput, error) { + req, out := c.ListJobsByPipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListJobsByPipelinePages iterates over the pages of a ListJobsByPipeline operation, @@ -614,12 +720,37 @@ func (c *ElasticTranscoder) ListJobsByPipeline(input *ListJobsByPipelineInput) ( // return pageNum <= 3 // }) // -func (c *ElasticTranscoder) ListJobsByPipelinePages(input *ListJobsByPipelineInput, fn func(p *ListJobsByPipelineOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListJobsByPipelineRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListJobsByPipelineOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListJobsByPipelineInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListJobsByPipelineRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListJobsByPipelineOutput), !p.HasNextPage()) + } + return p.Err() } const opListJobsByStatus = "ListJobsByStatus" @@ -702,8 +833,23 @@ func (c *ElasticTranscoder) ListJobsByStatusRequest(input *ListJobsByStatusInput // func (c *ElasticTranscoder) ListJobsByStatus(input *ListJobsByStatusInput) (*ListJobsByStatusOutput, error) { req, out := c.ListJobsByStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListJobsByStatusWithContext is the same as ListJobsByStatus with the addition of +// the ability to pass a context and additional request options. +// +// See ListJobsByStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListJobsByStatusWithContext(ctx aws.Context, input *ListJobsByStatusInput, opts ...request.Option) (*ListJobsByStatusOutput, error) { + req, out := c.ListJobsByStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListJobsByStatusPages iterates over the pages of a ListJobsByStatus operation, @@ -723,12 +869,37 @@ func (c *ElasticTranscoder) ListJobsByStatus(input *ListJobsByStatusInput) (*Lis // return pageNum <= 3 // }) // -func (c *ElasticTranscoder) ListJobsByStatusPages(input *ListJobsByStatusInput, fn func(p *ListJobsByStatusOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListJobsByStatusRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListJobsByStatusOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListJobsByStatusInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListJobsByStatusRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListJobsByStatusOutput), !p.HasNextPage()) + } + return p.Err() } const opListPipelines = "ListPipelines" @@ -805,8 +976,23 @@ func (c *ElasticTranscoder) ListPipelinesRequest(input *ListPipelinesInput) (req // func (c *ElasticTranscoder) ListPipelines(input *ListPipelinesInput) (*ListPipelinesOutput, error) { req, out := c.ListPipelinesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPipelinesWithContext is the same as ListPipelines with the addition of +// the ability to pass a context and additional request options. +// +// See ListPipelines for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPipelinesWithContext(ctx aws.Context, input *ListPipelinesInput, opts ...request.Option) (*ListPipelinesOutput, error) { + req, out := c.ListPipelinesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListPipelinesPages iterates over the pages of a ListPipelines operation, @@ -826,12 +1012,37 @@ func (c *ElasticTranscoder) ListPipelines(input *ListPipelinesInput) (*ListPipel // return pageNum <= 3 // }) // -func (c *ElasticTranscoder) ListPipelinesPages(input *ListPipelinesInput, fn func(p *ListPipelinesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPipelinesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPipelinesOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPipelinesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPipelinesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) + } + return p.Err() } const opListPresets = "ListPresets" @@ -908,8 +1119,23 @@ func (c *ElasticTranscoder) ListPresetsRequest(input *ListPresetsInput) (req *re // func (c *ElasticTranscoder) ListPresets(input *ListPresetsInput) (*ListPresetsOutput, error) { req, out := c.ListPresetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPresetsWithContext is the same as ListPresets with the addition of +// the ability to pass a context and additional request options. +// +// See ListPresets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPresetsWithContext(ctx aws.Context, input *ListPresetsInput, opts ...request.Option) (*ListPresetsOutput, error) { + req, out := c.ListPresetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListPresetsPages iterates over the pages of a ListPresets operation, @@ -929,12 +1155,37 @@ func (c *ElasticTranscoder) ListPresets(input *ListPresetsInput) (*ListPresetsOu // return pageNum <= 3 // }) // -func (c *ElasticTranscoder) ListPresetsPages(input *ListPresetsInput, fn func(p *ListPresetsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPresetsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPresetsOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPresetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPresetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPresetsOutput), !p.HasNextPage()) + } + return p.Err() } const opReadJob = "ReadJob" @@ -1009,8 +1260,23 @@ func (c *ElasticTranscoder) ReadJobRequest(input *ReadJobInput) (req *request.Re // func (c *ElasticTranscoder) ReadJob(input *ReadJobInput) (*ReadJobOutput, error) { req, out := c.ReadJobRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReadJobWithContext is the same as ReadJob with the addition of +// the ability to pass a context and additional request options. +// +// See ReadJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReadJobWithContext(ctx aws.Context, input *ReadJobInput, opts ...request.Option) (*ReadJobOutput, error) { + req, out := c.ReadJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReadPipeline = "ReadPipeline" @@ -1085,8 +1351,23 @@ func (c *ElasticTranscoder) ReadPipelineRequest(input *ReadPipelineInput) (req * // func (c *ElasticTranscoder) ReadPipeline(input *ReadPipelineInput) (*ReadPipelineOutput, error) { req, out := c.ReadPipelineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReadPipelineWithContext is the same as ReadPipeline with the addition of +// the ability to pass a context and additional request options. +// +// See ReadPipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReadPipelineWithContext(ctx aws.Context, input *ReadPipelineInput, opts ...request.Option) (*ReadPipelineOutput, error) { + req, out := c.ReadPipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReadPreset = "ReadPreset" @@ -1161,8 +1442,23 @@ func (c *ElasticTranscoder) ReadPresetRequest(input *ReadPresetInput) (req *requ // func (c *ElasticTranscoder) ReadPreset(input *ReadPresetInput) (*ReadPresetOutput, error) { req, out := c.ReadPresetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReadPresetWithContext is the same as ReadPreset with the addition of +// the ability to pass a context and additional request options. +// +// See ReadPreset for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReadPresetWithContext(ctx aws.Context, input *ReadPresetInput, opts ...request.Option) (*ReadPresetOutput, error) { + req, out := c.ReadPresetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTestRole = "TestRole" @@ -1246,8 +1542,23 @@ func (c *ElasticTranscoder) TestRoleRequest(input *TestRoleInput) (req *request. // func (c *ElasticTranscoder) TestRole(input *TestRoleInput) (*TestRoleOutput, error) { req, out := c.TestRoleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TestRoleWithContext is the same as TestRole with the addition of +// the ability to pass a context and additional request options. +// +// See TestRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TestRoleWithContext(ctx aws.Context, input *TestRoleInput, opts ...request.Option) (*TestRoleOutput, error) { + req, out := c.TestRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdatePipeline = "UpdatePipeline" @@ -1331,8 +1642,23 @@ func (c *ElasticTranscoder) UpdatePipelineRequest(input *UpdatePipelineInput) (r // func (c *ElasticTranscoder) UpdatePipeline(input *UpdatePipelineInput) (*UpdatePipelineOutput, error) { req, out := c.UpdatePipelineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdatePipelineWithContext is the same as UpdatePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdatePipelineWithContext(ctx aws.Context, input *UpdatePipelineInput, opts ...request.Option) (*UpdatePipelineOutput, error) { + req, out := c.UpdatePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdatePipelineNotifications = "UpdatePipelineNotifications" @@ -1415,8 +1741,23 @@ func (c *ElasticTranscoder) UpdatePipelineNotificationsRequest(input *UpdatePipe // func (c *ElasticTranscoder) UpdatePipelineNotifications(input *UpdatePipelineNotificationsInput) (*UpdatePipelineNotificationsOutput, error) { req, out := c.UpdatePipelineNotificationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdatePipelineNotificationsWithContext is the same as UpdatePipelineNotifications with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePipelineNotifications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdatePipelineNotificationsWithContext(ctx aws.Context, input *UpdatePipelineNotificationsInput, opts ...request.Option) (*UpdatePipelineNotificationsOutput, error) { + req, out := c.UpdatePipelineNotificationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdatePipelineStatus = "UpdatePipelineStatus" @@ -1502,8 +1843,23 @@ func (c *ElasticTranscoder) UpdatePipelineStatusRequest(input *UpdatePipelineSta // func (c *ElasticTranscoder) UpdatePipelineStatus(input *UpdatePipelineStatusInput) (*UpdatePipelineStatusOutput, error) { req, out := c.UpdatePipelineStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdatePipelineStatusWithContext is the same as UpdatePipelineStatus with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePipelineStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdatePipelineStatusWithContext(ctx aws.Context, input *UpdatePipelineStatusInput, opts ...request.Option) (*UpdatePipelineStatusOutput, error) { + req, out := c.UpdatePipelineStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // The file to be used as album art. There can be multiple artworks associated diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go index 18374bc24..7c670785c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elastictranscoder diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go index bbd6e2479..7060799dd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elastictranscoder diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/waiters.go index 767462041..d4e2bf2ae 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elastictranscoder import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilJobComplete uses the Amazon Elastic Transcoder API operation @@ -11,36 +14,53 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *ElasticTranscoder) WaitUntilJobComplete(input *ReadJobInput) error { - waiterCfg := waiter.Config{ - Operation: "ReadJob", - Delay: 30, + return c.WaitUntilJobCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilJobCompleteWithContext is an extended version of WaitUntilJobComplete. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilJobCompleteWithContext(ctx aws.Context, input *ReadJobInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilJobComplete", MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "Job.Status", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Job.Status", Expected: "Complete", }, { - State: "failure", - Matcher: "path", - Argument: "Job.Status", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Job.Status", Expected: "Canceled", }, { - State: "failure", - Matcher: "path", - Argument: "Job.Status", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Job.Status", Expected: "Error", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *ReadJobInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ReadJobRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go index b8c6d428e..ed376a514 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package elb provides a client for Elastic Load Balancing. package elb @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -86,8 +87,23 @@ func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddTags func (c *ELB) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsWithContext is the same as AddTags with the addition of +// the ability to pass a context and additional request options. +// +// See AddTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error) { + req, out := c.AddTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opApplySecurityGroupsToLoadBalancer = "ApplySecurityGroupsToLoadBalancer" @@ -162,8 +178,23 @@ func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroup // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ApplySecurityGroupsToLoadBalancer func (c *ELB) ApplySecurityGroupsToLoadBalancer(input *ApplySecurityGroupsToLoadBalancerInput) (*ApplySecurityGroupsToLoadBalancerOutput, error) { req, out := c.ApplySecurityGroupsToLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ApplySecurityGroupsToLoadBalancerWithContext is the same as ApplySecurityGroupsToLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See ApplySecurityGroupsToLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ApplySecurityGroupsToLoadBalancerWithContext(ctx aws.Context, input *ApplySecurityGroupsToLoadBalancerInput, opts ...request.Option) (*ApplySecurityGroupsToLoadBalancerOutput, error) { + req, out := c.ApplySecurityGroupsToLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachLoadBalancerToSubnets = "AttachLoadBalancerToSubnets" @@ -242,8 +273,23 @@ func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubn // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AttachLoadBalancerToSubnets func (c *ELB) AttachLoadBalancerToSubnets(input *AttachLoadBalancerToSubnetsInput) (*AttachLoadBalancerToSubnetsOutput, error) { req, out := c.AttachLoadBalancerToSubnetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachLoadBalancerToSubnetsWithContext is the same as AttachLoadBalancerToSubnets with the addition of +// the ability to pass a context and additional request options. +// +// See AttachLoadBalancerToSubnets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachLoadBalancerToSubnetsWithContext(ctx aws.Context, input *AttachLoadBalancerToSubnetsInput, opts ...request.Option) (*AttachLoadBalancerToSubnetsOutput, error) { + req, out := c.AttachLoadBalancerToSubnetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opConfigureHealthCheck = "ConfigureHealthCheck" @@ -312,8 +358,23 @@ func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConfigureHealthCheck func (c *ELB) ConfigureHealthCheck(input *ConfigureHealthCheckInput) (*ConfigureHealthCheckOutput, error) { req, out := c.ConfigureHealthCheckRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ConfigureHealthCheckWithContext is the same as ConfigureHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See ConfigureHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ConfigureHealthCheckWithContext(ctx aws.Context, input *ConfigureHealthCheckInput, opts ...request.Option) (*ConfigureHealthCheckOutput, error) { + req, out := c.ConfigureHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAppCookieStickinessPolicy = "CreateAppCookieStickinessPolicy" @@ -400,8 +461,23 @@ func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStick // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAppCookieStickinessPolicy func (c *ELB) CreateAppCookieStickinessPolicy(input *CreateAppCookieStickinessPolicyInput) (*CreateAppCookieStickinessPolicyOutput, error) { req, out := c.CreateAppCookieStickinessPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAppCookieStickinessPolicyWithContext is the same as CreateAppCookieStickinessPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAppCookieStickinessPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAppCookieStickinessPolicyWithContext(ctx aws.Context, input *CreateAppCookieStickinessPolicyInput, opts ...request.Option) (*CreateAppCookieStickinessPolicyOutput, error) { + req, out := c.CreateAppCookieStickinessPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLBCookieStickinessPolicy = "CreateLBCookieStickinessPolicy" @@ -490,8 +566,23 @@ func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickin // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLBCookieStickinessPolicy func (c *ELB) CreateLBCookieStickinessPolicy(input *CreateLBCookieStickinessPolicyInput) (*CreateLBCookieStickinessPolicyOutput, error) { req, out := c.CreateLBCookieStickinessPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLBCookieStickinessPolicyWithContext is the same as CreateLBCookieStickinessPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLBCookieStickinessPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLBCookieStickinessPolicyWithContext(ctx aws.Context, input *CreateLBCookieStickinessPolicyInput, opts ...request.Option) (*CreateLBCookieStickinessPolicyOutput, error) { + req, out := c.CreateLBCookieStickinessPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLoadBalancer = "CreateLoadBalancer" @@ -601,8 +692,23 @@ func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancer func (c *ELB) CreateLoadBalancer(input *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error) { req, out := c.CreateLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLoadBalancerWithContext is the same as CreateLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLoadBalancerWithContext(ctx aws.Context, input *CreateLoadBalancerInput, opts ...request.Option) (*CreateLoadBalancerOutput, error) { + req, out := c.CreateLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLoadBalancerListeners = "CreateLoadBalancerListeners" @@ -687,8 +793,23 @@ func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListen // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerListeners func (c *ELB) CreateLoadBalancerListeners(input *CreateLoadBalancerListenersInput) (*CreateLoadBalancerListenersOutput, error) { req, out := c.CreateLoadBalancerListenersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLoadBalancerListenersWithContext is the same as CreateLoadBalancerListeners with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoadBalancerListeners for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLoadBalancerListenersWithContext(ctx aws.Context, input *CreateLoadBalancerListenersInput, opts ...request.Option) (*CreateLoadBalancerListenersOutput, error) { + req, out := c.CreateLoadBalancerListenersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLoadBalancerPolicy = "CreateLoadBalancerPolicy" @@ -768,8 +889,23 @@ func (c *ELB) CreateLoadBalancerPolicyRequest(input *CreateLoadBalancerPolicyInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerPolicy func (c *ELB) CreateLoadBalancerPolicy(input *CreateLoadBalancerPolicyInput) (*CreateLoadBalancerPolicyOutput, error) { req, out := c.CreateLoadBalancerPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLoadBalancerPolicyWithContext is the same as CreateLoadBalancerPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoadBalancerPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLoadBalancerPolicyWithContext(ctx aws.Context, input *CreateLoadBalancerPolicyInput, opts ...request.Option) (*CreateLoadBalancerPolicyOutput, error) { + req, out := c.CreateLoadBalancerPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLoadBalancer = "DeleteLoadBalancer" @@ -837,8 +973,23 @@ func (c *ELB) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancer func (c *ELB) DeleteLoadBalancer(input *DeleteLoadBalancerInput) (*DeleteLoadBalancerOutput, error) { req, out := c.DeleteLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLoadBalancerWithContext is the same as DeleteLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLoadBalancerWithContext(ctx aws.Context, input *DeleteLoadBalancerInput, opts ...request.Option) (*DeleteLoadBalancerOutput, error) { + req, out := c.DeleteLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLoadBalancerListeners = "DeleteLoadBalancerListeners" @@ -902,8 +1053,23 @@ func (c *ELB) DeleteLoadBalancerListenersRequest(input *DeleteLoadBalancerListen // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerListeners func (c *ELB) DeleteLoadBalancerListeners(input *DeleteLoadBalancerListenersInput) (*DeleteLoadBalancerListenersOutput, error) { req, out := c.DeleteLoadBalancerListenersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLoadBalancerListenersWithContext is the same as DeleteLoadBalancerListeners with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoadBalancerListeners for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLoadBalancerListenersWithContext(ctx aws.Context, input *DeleteLoadBalancerListenersInput, opts ...request.Option) (*DeleteLoadBalancerListenersOutput, error) { + req, out := c.DeleteLoadBalancerListenersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLoadBalancerPolicy = "DeleteLoadBalancerPolicy" @@ -971,8 +1137,23 @@ func (c *ELB) DeleteLoadBalancerPolicyRequest(input *DeleteLoadBalancerPolicyInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerPolicy func (c *ELB) DeleteLoadBalancerPolicy(input *DeleteLoadBalancerPolicyInput) (*DeleteLoadBalancerPolicyOutput, error) { req, out := c.DeleteLoadBalancerPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLoadBalancerPolicyWithContext is the same as DeleteLoadBalancerPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoadBalancerPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLoadBalancerPolicyWithContext(ctx aws.Context, input *DeleteLoadBalancerPolicyInput, opts ...request.Option) (*DeleteLoadBalancerPolicyOutput, error) { + req, out := c.DeleteLoadBalancerPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterInstancesFromLoadBalancer = "DeregisterInstancesFromLoadBalancer" @@ -1047,8 +1228,23 @@ func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstan // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeregisterInstancesFromLoadBalancer func (c *ELB) DeregisterInstancesFromLoadBalancer(input *DeregisterInstancesFromLoadBalancerInput) (*DeregisterInstancesFromLoadBalancerOutput, error) { req, out := c.DeregisterInstancesFromLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterInstancesFromLoadBalancerWithContext is the same as DeregisterInstancesFromLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterInstancesFromLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterInstancesFromLoadBalancerWithContext(ctx aws.Context, input *DeregisterInstancesFromLoadBalancerInput, opts ...request.Option) (*DeregisterInstancesFromLoadBalancerOutput, error) { + req, out := c.DeregisterInstancesFromLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeInstanceHealth = "DescribeInstanceHealth" @@ -1120,8 +1316,23 @@ func (c *ELB) DescribeInstanceHealthRequest(input *DescribeInstanceHealthInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeInstanceHealth func (c *ELB) DescribeInstanceHealth(input *DescribeInstanceHealthInput) (*DescribeInstanceHealthOutput, error) { req, out := c.DescribeInstanceHealthRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstanceHealthWithContext is the same as DescribeInstanceHealth with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstanceHealth for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstanceHealthWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.Option) (*DescribeInstanceHealthOutput, error) { + req, out := c.DescribeInstanceHealthRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" @@ -1188,8 +1399,23 @@ func (c *ELB) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerA // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerAttributes func (c *ELB) DescribeLoadBalancerAttributes(input *DescribeLoadBalancerAttributesInput) (*DescribeLoadBalancerAttributesOutput, error) { req, out := c.DescribeLoadBalancerAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoadBalancerAttributesWithContext is the same as DescribeLoadBalancerAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancerAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoadBalancerAttributesWithContext(ctx aws.Context, input *DescribeLoadBalancerAttributesInput, opts ...request.Option) (*DescribeLoadBalancerAttributesOutput, error) { + req, out := c.DescribeLoadBalancerAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLoadBalancerPolicies = "DescribeLoadBalancerPolicies" @@ -1263,8 +1489,23 @@ func (c *ELB) DescribeLoadBalancerPoliciesRequest(input *DescribeLoadBalancerPol // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicies func (c *ELB) DescribeLoadBalancerPolicies(input *DescribeLoadBalancerPoliciesInput) (*DescribeLoadBalancerPoliciesOutput, error) { req, out := c.DescribeLoadBalancerPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoadBalancerPoliciesWithContext is the same as DescribeLoadBalancerPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancerPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoadBalancerPoliciesWithContext(ctx aws.Context, input *DescribeLoadBalancerPoliciesInput, opts ...request.Option) (*DescribeLoadBalancerPoliciesOutput, error) { + req, out := c.DescribeLoadBalancerPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLoadBalancerPolicyTypes = "DescribeLoadBalancerPolicyTypes" @@ -1339,8 +1580,23 @@ func (c *ELB) DescribeLoadBalancerPolicyTypesRequest(input *DescribeLoadBalancer // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicyTypes func (c *ELB) DescribeLoadBalancerPolicyTypes(input *DescribeLoadBalancerPolicyTypesInput) (*DescribeLoadBalancerPolicyTypesOutput, error) { req, out := c.DescribeLoadBalancerPolicyTypesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoadBalancerPolicyTypesWithContext is the same as DescribeLoadBalancerPolicyTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancerPolicyTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoadBalancerPolicyTypesWithContext(ctx aws.Context, input *DescribeLoadBalancerPolicyTypesInput, opts ...request.Option) (*DescribeLoadBalancerPolicyTypesOutput, error) { + req, out := c.DescribeLoadBalancerPolicyTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLoadBalancers = "DescribeLoadBalancers" @@ -1413,8 +1669,23 @@ func (c *ELB) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancers func (c *ELB) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { req, out := c.DescribeLoadBalancersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoadBalancersWithContext is the same as DescribeLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoadBalancersWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.Option) (*DescribeLoadBalancersOutput, error) { + req, out := c.DescribeLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeLoadBalancersPages iterates over the pages of a DescribeLoadBalancers operation, @@ -1434,12 +1705,37 @@ func (c *ELB) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*Describ // return pageNum <= 3 // }) // -func (c *ELB) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(p *DescribeLoadBalancersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLoadBalancersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLoadBalancersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLoadBalancersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLoadBalancersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLoadBalancersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeTags = "DescribeTags" @@ -1503,8 +1799,23 @@ func (c *ELB) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeTags func (c *ELB) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTagsWithContext is the same as DescribeTags with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { + req, out := c.DescribeTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachLoadBalancerFromSubnets = "DetachLoadBalancerFromSubnets" @@ -1576,8 +1887,23 @@ func (c *ELB) DetachLoadBalancerFromSubnetsRequest(input *DetachLoadBalancerFrom // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnets func (c *ELB) DetachLoadBalancerFromSubnets(input *DetachLoadBalancerFromSubnetsInput) (*DetachLoadBalancerFromSubnetsOutput, error) { req, out := c.DetachLoadBalancerFromSubnetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachLoadBalancerFromSubnetsWithContext is the same as DetachLoadBalancerFromSubnets with the addition of +// the ability to pass a context and additional request options. +// +// See DetachLoadBalancerFromSubnets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachLoadBalancerFromSubnetsWithContext(ctx aws.Context, input *DetachLoadBalancerFromSubnetsInput, opts ...request.Option) (*DetachLoadBalancerFromSubnetsOutput, error) { + req, out := c.DetachLoadBalancerFromSubnetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableAvailabilityZonesForLoadBalancer = "DisableAvailabilityZonesForLoadBalancer" @@ -1654,8 +1980,23 @@ func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvail // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DisableAvailabilityZonesForLoadBalancer func (c *ELB) DisableAvailabilityZonesForLoadBalancer(input *DisableAvailabilityZonesForLoadBalancerInput) (*DisableAvailabilityZonesForLoadBalancerOutput, error) { req, out := c.DisableAvailabilityZonesForLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableAvailabilityZonesForLoadBalancerWithContext is the same as DisableAvailabilityZonesForLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See DisableAvailabilityZonesForLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableAvailabilityZonesForLoadBalancerWithContext(ctx aws.Context, input *DisableAvailabilityZonesForLoadBalancerInput, opts ...request.Option) (*DisableAvailabilityZonesForLoadBalancerOutput, error) { + req, out := c.DisableAvailabilityZonesForLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableAvailabilityZonesForLoadBalancer = "EnableAvailabilityZonesForLoadBalancer" @@ -1726,8 +2067,23 @@ func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailab // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/EnableAvailabilityZonesForLoadBalancer func (c *ELB) EnableAvailabilityZonesForLoadBalancer(input *EnableAvailabilityZonesForLoadBalancerInput) (*EnableAvailabilityZonesForLoadBalancerOutput, error) { req, out := c.EnableAvailabilityZonesForLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableAvailabilityZonesForLoadBalancerWithContext is the same as EnableAvailabilityZonesForLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See EnableAvailabilityZonesForLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableAvailabilityZonesForLoadBalancerWithContext(ctx aws.Context, input *EnableAvailabilityZonesForLoadBalancerInput, opts ...request.Option) (*EnableAvailabilityZonesForLoadBalancerOutput, error) { + req, out := c.EnableAvailabilityZonesForLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" @@ -1812,8 +2168,23 @@ func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttri // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ModifyLoadBalancerAttributes func (c *ELB) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesInput) (*ModifyLoadBalancerAttributesOutput, error) { req, out := c.ModifyLoadBalancerAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyLoadBalancerAttributesWithContext is the same as ModifyLoadBalancerAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyLoadBalancerAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyLoadBalancerAttributesWithContext(ctx aws.Context, input *ModifyLoadBalancerAttributesInput, opts ...request.Option) (*ModifyLoadBalancerAttributesOutput, error) { + req, out := c.ModifyLoadBalancerAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterInstancesWithLoadBalancer = "RegisterInstancesWithLoadBalancer" @@ -1902,8 +2273,23 @@ func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesW // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RegisterInstancesWithLoadBalancer func (c *ELB) RegisterInstancesWithLoadBalancer(input *RegisterInstancesWithLoadBalancerInput) (*RegisterInstancesWithLoadBalancerOutput, error) { req, out := c.RegisterInstancesWithLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterInstancesWithLoadBalancerWithContext is the same as RegisterInstancesWithLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterInstancesWithLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterInstancesWithLoadBalancerWithContext(ctx aws.Context, input *RegisterInstancesWithLoadBalancerInput, opts ...request.Option) (*RegisterInstancesWithLoadBalancerOutput, error) { + req, out := c.RegisterInstancesWithLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTags = "RemoveTags" @@ -1967,8 +2353,23 @@ func (c *ELB) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveTags func (c *ELB) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsWithContext is the same as RemoveTags with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetLoadBalancerListenerSSLCertificate = "SetLoadBalancerListenerSSLCertificate" @@ -2052,8 +2453,23 @@ func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalance // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerListenerSSLCertificate func (c *ELB) SetLoadBalancerListenerSSLCertificate(input *SetLoadBalancerListenerSSLCertificateInput) (*SetLoadBalancerListenerSSLCertificateOutput, error) { req, out := c.SetLoadBalancerListenerSSLCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetLoadBalancerListenerSSLCertificateWithContext is the same as SetLoadBalancerListenerSSLCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See SetLoadBalancerListenerSSLCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetLoadBalancerListenerSSLCertificateWithContext(ctx aws.Context, input *SetLoadBalancerListenerSSLCertificateInput, opts ...request.Option) (*SetLoadBalancerListenerSSLCertificateOutput, error) { + req, out := c.SetLoadBalancerListenerSSLCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetLoadBalancerPoliciesForBackendServer = "SetLoadBalancerPoliciesForBackendServer" @@ -2138,8 +2554,23 @@ func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalan // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesForBackendServer func (c *ELB) SetLoadBalancerPoliciesForBackendServer(input *SetLoadBalancerPoliciesForBackendServerInput) (*SetLoadBalancerPoliciesForBackendServerOutput, error) { req, out := c.SetLoadBalancerPoliciesForBackendServerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetLoadBalancerPoliciesForBackendServerWithContext is the same as SetLoadBalancerPoliciesForBackendServer with the addition of +// the ability to pass a context and additional request options. +// +// See SetLoadBalancerPoliciesForBackendServer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetLoadBalancerPoliciesForBackendServerWithContext(ctx aws.Context, input *SetLoadBalancerPoliciesForBackendServerInput, opts ...request.Option) (*SetLoadBalancerPoliciesForBackendServerOutput, error) { + req, out := c.SetLoadBalancerPoliciesForBackendServerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetLoadBalancerPoliciesOfListener = "SetLoadBalancerPoliciesOfListener" @@ -2221,8 +2652,23 @@ func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPol // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListener func (c *ELB) SetLoadBalancerPoliciesOfListener(input *SetLoadBalancerPoliciesOfListenerInput) (*SetLoadBalancerPoliciesOfListenerOutput, error) { req, out := c.SetLoadBalancerPoliciesOfListenerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetLoadBalancerPoliciesOfListenerWithContext is the same as SetLoadBalancerPoliciesOfListener with the addition of +// the ability to pass a context and additional request options. +// +// See SetLoadBalancerPoliciesOfListener for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetLoadBalancerPoliciesOfListenerWithContext(ctx aws.Context, input *SetLoadBalancerPoliciesOfListenerInput, opts ...request.Option) (*SetLoadBalancerPoliciesOfListenerOutput, error) { + req, out := c.SetLoadBalancerPoliciesOfListenerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Information about the AccessLog attribute. diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go index aab539987..97042c05a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elb diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/service.go b/vendor/github.com/aws/aws-sdk-go/service/elb/service.go index 68d7e2ac0..1c83ec5e9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elb diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go index 89fc1d85b..aa0d7e157 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elb import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilAnyInstanceInService uses the Elastic Load Balancing API operation @@ -11,26 +14,45 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceHealth", - Delay: 15, + return c.WaitUntilAnyInstanceInServiceWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilAnyInstanceInServiceWithContext is an extended version of WaitUntilAnyInstanceInService. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilAnyInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilAnyInstanceInService", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAny", - Argument: "InstanceStates[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "InstanceStates[].State", Expected: "InService", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstanceHealthInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceHealthRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceDeregistered uses the Elastic Load Balancing API operation @@ -38,32 +60,50 @@ func (c *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) // If the condition is not meet within the max attempt window an error will // be returned. func (c *ELB) WaitUntilInstanceDeregistered(input *DescribeInstanceHealthInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceHealth", - Delay: 15, + return c.WaitUntilInstanceDeregisteredWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceDeregisteredWithContext is an extended version of WaitUntilInstanceDeregistered. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceDeregisteredWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceDeregistered", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "InstanceStates[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "InstanceStates[].State", Expected: "OutOfService", }, { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "InvalidInstance", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstanceHealthInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceHealthRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceInService uses the Elastic Load Balancing API operation @@ -71,24 +111,43 @@ func (c *ELB) WaitUntilInstanceDeregistered(input *DescribeInstanceHealthInput) // If the condition is not meet within the max attempt window an error will // be returned. func (c *ELB) WaitUntilInstanceInService(input *DescribeInstanceHealthInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceHealth", - Delay: 15, + return c.WaitUntilInstanceInServiceWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceInServiceWithContext is an extended version of WaitUntilInstanceInService. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceInService", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "InstanceStates[].State", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "InstanceStates[].State", Expected: "InService", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstanceHealthInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceHealthRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go b/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go index 2098550c6..33c5f08eb 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package elbv2 provides a client for Elastic Load Balancing. package elbv2 @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -88,8 +89,23 @@ func (c *ELBV2) AddTagsRequest(input *AddTagsInput) (req *request.Request, outpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddTags func (c *ELBV2) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsWithContext is the same as AddTags with the addition of +// the ability to pass a context and additional request options. +// +// See AddTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error) { + req, out := c.AddTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateListener = "CreateListener" @@ -196,8 +212,23 @@ func (c *ELBV2) CreateListenerRequest(input *CreateListenerInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateListener func (c *ELBV2) CreateListener(input *CreateListenerInput) (*CreateListenerOutput, error) { req, out := c.CreateListenerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateListenerWithContext is the same as CreateListener with the addition of +// the ability to pass a context and additional request options. +// +// See CreateListener for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateListenerWithContext(ctx aws.Context, input *CreateListenerInput, opts ...request.Option) (*CreateListenerOutput, error) { + req, out := c.CreateListenerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLoadBalancer = "CreateLoadBalancer" @@ -301,8 +332,23 @@ func (c *ELBV2) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateLoadBalancer func (c *ELBV2) CreateLoadBalancer(input *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error) { req, out := c.CreateLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLoadBalancerWithContext is the same as CreateLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLoadBalancerWithContext(ctx aws.Context, input *CreateLoadBalancerInput, opts ...request.Option) (*CreateLoadBalancerOutput, error) { + req, out := c.CreateLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateRule = "CreateRule" @@ -399,8 +445,23 @@ func (c *ELBV2) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateRule func (c *ELBV2) CreateRule(input *CreateRuleInput) (*CreateRuleOutput, error) { req, out := c.CreateRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateRuleWithContext is the same as CreateRule with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateRuleWithContext(ctx aws.Context, input *CreateRuleInput, opts ...request.Option) (*CreateRuleOutput, error) { + req, out := c.CreateRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTargetGroup = "CreateTargetGroup" @@ -480,8 +541,23 @@ func (c *ELBV2) CreateTargetGroupRequest(input *CreateTargetGroupInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateTargetGroup func (c *ELBV2) CreateTargetGroup(input *CreateTargetGroupInput) (*CreateTargetGroupOutput, error) { req, out := c.CreateTargetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTargetGroupWithContext is the same as CreateTargetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTargetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTargetGroupWithContext(ctx aws.Context, input *CreateTargetGroupInput, opts ...request.Option) (*CreateTargetGroupOutput, error) { + req, out := c.CreateTargetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteListener = "DeleteListener" @@ -548,8 +624,23 @@ func (c *ELBV2) DeleteListenerRequest(input *DeleteListenerInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteListener func (c *ELBV2) DeleteListener(input *DeleteListenerInput) (*DeleteListenerOutput, error) { req, out := c.DeleteListenerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteListenerWithContext is the same as DeleteListener with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteListener for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteListenerWithContext(ctx aws.Context, input *DeleteListenerInput, opts ...request.Option) (*DeleteListenerOutput, error) { + req, out := c.DeleteListenerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLoadBalancer = "DeleteLoadBalancer" @@ -624,8 +715,23 @@ func (c *ELBV2) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteLoadBalancer func (c *ELBV2) DeleteLoadBalancer(input *DeleteLoadBalancerInput) (*DeleteLoadBalancerOutput, error) { req, out := c.DeleteLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLoadBalancerWithContext is the same as DeleteLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLoadBalancerWithContext(ctx aws.Context, input *DeleteLoadBalancerInput, opts ...request.Option) (*DeleteLoadBalancerOutput, error) { + req, out := c.DeleteLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRule = "DeleteRule" @@ -692,8 +798,23 @@ func (c *ELBV2) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteRule func (c *ELBV2) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { req, out := c.DeleteRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRuleWithContext is the same as DeleteRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRuleWithContext(ctx aws.Context, input *DeleteRuleInput, opts ...request.Option) (*DeleteRuleOutput, error) { + req, out := c.DeleteRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTargetGroup = "DeleteTargetGroup" @@ -760,8 +881,23 @@ func (c *ELBV2) DeleteTargetGroupRequest(input *DeleteTargetGroupInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteTargetGroup func (c *ELBV2) DeleteTargetGroup(input *DeleteTargetGroupInput) (*DeleteTargetGroupOutput, error) { req, out := c.DeleteTargetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTargetGroupWithContext is the same as DeleteTargetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTargetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTargetGroupWithContext(ctx aws.Context, input *DeleteTargetGroupInput, opts ...request.Option) (*DeleteTargetGroupOutput, error) { + req, out := c.DeleteTargetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterTargets = "DeregisterTargets" @@ -831,8 +967,23 @@ func (c *ELBV2) DeregisterTargetsRequest(input *DeregisterTargetsInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeregisterTargets func (c *ELBV2) DeregisterTargets(input *DeregisterTargetsInput) (*DeregisterTargetsOutput, error) { req, out := c.DeregisterTargetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterTargetsWithContext is the same as DeregisterTargets with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterTargetsWithContext(ctx aws.Context, input *DeregisterTargetsInput, opts ...request.Option) (*DeregisterTargetsOutput, error) { + req, out := c.DeregisterTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeListeners = "DescribeListeners" @@ -906,8 +1057,23 @@ func (c *ELBV2) DescribeListenersRequest(input *DescribeListenersInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListeners func (c *ELBV2) DescribeListeners(input *DescribeListenersInput) (*DescribeListenersOutput, error) { req, out := c.DescribeListenersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeListenersWithContext is the same as DescribeListeners with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeListeners for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeListenersWithContext(ctx aws.Context, input *DescribeListenersInput, opts ...request.Option) (*DescribeListenersOutput, error) { + req, out := c.DescribeListenersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeListenersPages iterates over the pages of a DescribeListeners operation, @@ -927,12 +1093,37 @@ func (c *ELBV2) DescribeListeners(input *DescribeListenersInput) (*DescribeListe // return pageNum <= 3 // }) // -func (c *ELBV2) DescribeListenersPages(input *DescribeListenersInput, fn func(p *DescribeListenersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeListenersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeListenersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeListenersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeListenersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeListenersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" @@ -996,8 +1187,23 @@ func (c *ELBV2) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalance // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancerAttributes func (c *ELBV2) DescribeLoadBalancerAttributes(input *DescribeLoadBalancerAttributesInput) (*DescribeLoadBalancerAttributesOutput, error) { req, out := c.DescribeLoadBalancerAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoadBalancerAttributesWithContext is the same as DescribeLoadBalancerAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancerAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoadBalancerAttributesWithContext(ctx aws.Context, input *DescribeLoadBalancerAttributesInput, opts ...request.Option) (*DescribeLoadBalancerAttributesOutput, error) { + req, out := c.DescribeLoadBalancerAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLoadBalancers = "DescribeLoadBalancers" @@ -1071,8 +1277,23 @@ func (c *ELBV2) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancers func (c *ELBV2) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { req, out := c.DescribeLoadBalancersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoadBalancersWithContext is the same as DescribeLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoadBalancersWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.Option) (*DescribeLoadBalancersOutput, error) { + req, out := c.DescribeLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeLoadBalancersPages iterates over the pages of a DescribeLoadBalancers operation, @@ -1092,12 +1313,37 @@ func (c *ELBV2) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*Descr // return pageNum <= 3 // }) // -func (c *ELBV2) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(p *DescribeLoadBalancersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLoadBalancersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLoadBalancersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLoadBalancersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLoadBalancersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLoadBalancersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeRules = "DescribeRules" @@ -1165,8 +1411,23 @@ func (c *ELBV2) DescribeRulesRequest(input *DescribeRulesInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeRules func (c *ELBV2) DescribeRules(input *DescribeRulesInput) (*DescribeRulesOutput, error) { req, out := c.DescribeRulesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeRulesWithContext is the same as DescribeRules with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeRulesWithContext(ctx aws.Context, input *DescribeRulesInput, opts ...request.Option) (*DescribeRulesOutput, error) { + req, out := c.DescribeRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSSLPolicies = "DescribeSSLPolicies" @@ -1232,8 +1493,23 @@ func (c *ELBV2) DescribeSSLPoliciesRequest(input *DescribeSSLPoliciesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeSSLPolicies func (c *ELBV2) DescribeSSLPolicies(input *DescribeSSLPoliciesInput) (*DescribeSSLPoliciesOutput, error) { req, out := c.DescribeSSLPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSSLPoliciesWithContext is the same as DescribeSSLPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSSLPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSSLPoliciesWithContext(ctx aws.Context, input *DescribeSSLPoliciesInput, opts ...request.Option) (*DescribeSSLPoliciesOutput, error) { + req, out := c.DescribeSSLPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTags = "DescribeTags" @@ -1306,8 +1582,23 @@ func (c *ELBV2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTags func (c *ELBV2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTagsWithContext is the same as DescribeTags with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { + req, out := c.DescribeTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTargetGroupAttributes = "DescribeTargetGroupAttributes" @@ -1371,8 +1662,23 @@ func (c *ELBV2) DescribeTargetGroupAttributesRequest(input *DescribeTargetGroupA // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupAttributes func (c *ELBV2) DescribeTargetGroupAttributes(input *DescribeTargetGroupAttributesInput) (*DescribeTargetGroupAttributesOutput, error) { req, out := c.DescribeTargetGroupAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTargetGroupAttributesWithContext is the same as DescribeTargetGroupAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTargetGroupAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTargetGroupAttributesWithContext(ctx aws.Context, input *DescribeTargetGroupAttributesInput, opts ...request.Option) (*DescribeTargetGroupAttributesOutput, error) { + req, out := c.DescribeTargetGroupAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTargetGroups = "DescribeTargetGroups" @@ -1451,8 +1757,23 @@ func (c *ELBV2) DescribeTargetGroupsRequest(input *DescribeTargetGroupsInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroups func (c *ELBV2) DescribeTargetGroups(input *DescribeTargetGroupsInput) (*DescribeTargetGroupsOutput, error) { req, out := c.DescribeTargetGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTargetGroupsWithContext is the same as DescribeTargetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTargetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTargetGroupsWithContext(ctx aws.Context, input *DescribeTargetGroupsInput, opts ...request.Option) (*DescribeTargetGroupsOutput, error) { + req, out := c.DescribeTargetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeTargetGroupsPages iterates over the pages of a DescribeTargetGroups operation, @@ -1472,12 +1793,37 @@ func (c *ELBV2) DescribeTargetGroups(input *DescribeTargetGroupsInput) (*Describ // return pageNum <= 3 // }) // -func (c *ELBV2) DescribeTargetGroupsPages(input *DescribeTargetGroupsInput, fn func(p *DescribeTargetGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeTargetGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeTargetGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTargetGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTargetGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTargetGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeTargetHealth = "DescribeTargetHealth" @@ -1549,8 +1895,23 @@ func (c *ELBV2) DescribeTargetHealthRequest(input *DescribeTargetHealthInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetHealth func (c *ELBV2) DescribeTargetHealth(input *DescribeTargetHealthInput) (*DescribeTargetHealthOutput, error) { req, out := c.DescribeTargetHealthRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTargetHealthWithContext is the same as DescribeTargetHealth with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTargetHealth for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTargetHealthWithContext(ctx aws.Context, input *DescribeTargetHealthInput, opts ...request.Option) (*DescribeTargetHealthOutput, error) { + req, out := c.DescribeTargetHealthRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyListener = "ModifyListener" @@ -1653,8 +2014,23 @@ func (c *ELBV2) ModifyListenerRequest(input *ModifyListenerInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyListener func (c *ELBV2) ModifyListener(input *ModifyListenerInput) (*ModifyListenerOutput, error) { req, out := c.ModifyListenerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyListenerWithContext is the same as ModifyListener with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyListener for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyListenerWithContext(ctx aws.Context, input *ModifyListenerInput, opts ...request.Option) (*ModifyListenerOutput, error) { + req, out := c.ModifyListenerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" @@ -1725,8 +2101,23 @@ func (c *ELBV2) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAtt // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyLoadBalancerAttributes func (c *ELBV2) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesInput) (*ModifyLoadBalancerAttributesOutput, error) { req, out := c.ModifyLoadBalancerAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyLoadBalancerAttributesWithContext is the same as ModifyLoadBalancerAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyLoadBalancerAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyLoadBalancerAttributesWithContext(ctx aws.Context, input *ModifyLoadBalancerAttributesInput, opts ...request.Option) (*ModifyLoadBalancerAttributesOutput, error) { + req, out := c.ModifyLoadBalancerAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyRule = "ModifyRule" @@ -1804,8 +2195,23 @@ func (c *ELBV2) ModifyRuleRequest(input *ModifyRuleInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyRule func (c *ELBV2) ModifyRule(input *ModifyRuleInput) (*ModifyRuleOutput, error) { req, out := c.ModifyRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyRuleWithContext is the same as ModifyRule with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyRuleWithContext(ctx aws.Context, input *ModifyRuleInput, opts ...request.Option) (*ModifyRuleOutput, error) { + req, out := c.ModifyRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyTargetGroup = "ModifyTargetGroup" @@ -1872,8 +2278,23 @@ func (c *ELBV2) ModifyTargetGroupRequest(input *ModifyTargetGroupInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroup func (c *ELBV2) ModifyTargetGroup(input *ModifyTargetGroupInput) (*ModifyTargetGroupOutput, error) { req, out := c.ModifyTargetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyTargetGroupWithContext is the same as ModifyTargetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyTargetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyTargetGroupWithContext(ctx aws.Context, input *ModifyTargetGroupInput, opts ...request.Option) (*ModifyTargetGroupOutput, error) { + req, out := c.ModifyTargetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyTargetGroupAttributes = "ModifyTargetGroupAttributes" @@ -1937,8 +2358,23 @@ func (c *ELBV2) ModifyTargetGroupAttributesRequest(input *ModifyTargetGroupAttri // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupAttributes func (c *ELBV2) ModifyTargetGroupAttributes(input *ModifyTargetGroupAttributesInput) (*ModifyTargetGroupAttributesOutput, error) { req, out := c.ModifyTargetGroupAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyTargetGroupAttributesWithContext is the same as ModifyTargetGroupAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyTargetGroupAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyTargetGroupAttributesWithContext(ctx aws.Context, input *ModifyTargetGroupAttributesInput, opts ...request.Option) (*ModifyTargetGroupAttributesOutput, error) { + req, out := c.ModifyTargetGroupAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterTargets = "RegisterTargets" @@ -2023,8 +2459,23 @@ func (c *ELBV2) RegisterTargetsRequest(input *RegisterTargetsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RegisterTargets func (c *ELBV2) RegisterTargets(input *RegisterTargetsInput) (*RegisterTargetsOutput, error) { req, out := c.RegisterTargetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterTargetsWithContext is the same as RegisterTargets with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterTargetsWithContext(ctx aws.Context, input *RegisterTargetsInput, opts ...request.Option) (*RegisterTargetsOutput, error) { + req, out := c.RegisterTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTags = "RemoveTags" @@ -2102,8 +2553,23 @@ func (c *ELBV2) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveTags func (c *ELBV2) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsWithContext is the same as RemoveTags with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetIpAddressType = "SetIpAddressType" @@ -2174,8 +2640,23 @@ func (c *ELBV2) SetIpAddressTypeRequest(input *SetIpAddressTypeInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetIpAddressType func (c *ELBV2) SetIpAddressType(input *SetIpAddressTypeInput) (*SetIpAddressTypeOutput, error) { req, out := c.SetIpAddressTypeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetIpAddressTypeWithContext is the same as SetIpAddressType with the addition of +// the ability to pass a context and additional request options. +// +// See SetIpAddressType for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetIpAddressTypeWithContext(ctx aws.Context, input *SetIpAddressTypeInput, opts ...request.Option) (*SetIpAddressTypeOutput, error) { + req, out := c.SetIpAddressTypeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetRulePriorities = "SetRulePriorities" @@ -2249,8 +2730,23 @@ func (c *ELBV2) SetRulePrioritiesRequest(input *SetRulePrioritiesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetRulePriorities func (c *ELBV2) SetRulePriorities(input *SetRulePrioritiesInput) (*SetRulePrioritiesOutput, error) { req, out := c.SetRulePrioritiesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetRulePrioritiesWithContext is the same as SetRulePriorities with the addition of +// the ability to pass a context and additional request options. +// +// See SetRulePriorities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetRulePrioritiesWithContext(ctx aws.Context, input *SetRulePrioritiesInput, opts ...request.Option) (*SetRulePrioritiesOutput, error) { + req, out := c.SetRulePrioritiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetSecurityGroups = "SetSecurityGroups" @@ -2322,8 +2818,23 @@ func (c *ELBV2) SetSecurityGroupsRequest(input *SetSecurityGroupsInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSecurityGroups func (c *ELBV2) SetSecurityGroups(input *SetSecurityGroupsInput) (*SetSecurityGroupsOutput, error) { req, out := c.SetSecurityGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetSecurityGroupsWithContext is the same as SetSecurityGroups with the addition of +// the ability to pass a context and additional request options. +// +// See SetSecurityGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetSecurityGroupsWithContext(ctx aws.Context, input *SetSecurityGroupsInput, opts ...request.Option) (*SetSecurityGroupsOutput, error) { + req, out := c.SetSecurityGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetSubnets = "SetSubnets" @@ -2397,8 +2908,23 @@ func (c *ELBV2) SetSubnetsRequest(input *SetSubnetsInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSubnets func (c *ELBV2) SetSubnets(input *SetSubnetsInput) (*SetSubnetsOutput, error) { req, out := c.SetSubnetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetSubnetsWithContext is the same as SetSubnets with the addition of +// the ability to pass a context and additional request options. +// +// See SetSubnets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetSubnetsWithContext(ctx aws.Context, input *SetSubnetsInput, opts ...request.Option) (*SetSubnetsOutput, error) { + req, out := c.SetSubnetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Information about an action. diff --git a/vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go index 4f49c2f22..3d241e622 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elbv2 diff --git a/vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go b/vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go index 3e2e79a89..57e079245 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elbv2 diff --git a/vendor/github.com/aws/aws-sdk-go/service/elbv2/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/elbv2/waiters.go new file mode 100644 index 000000000..a958d8ed3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/elbv2/waiters.go @@ -0,0 +1,117 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elbv2 + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// WaitUntilLoadBalancerAvailable uses the Elastic Load Balancing v2 API operation +// DescribeLoadBalancers to wait for a condition to be met before returning. +// If the condition is not meet within the max attempt window an error will +// be returned. +func (c *ELBV2) WaitUntilLoadBalancerAvailable(input *DescribeLoadBalancersInput) error { + return c.WaitUntilLoadBalancerAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilLoadBalancerAvailableWithContext is an extended version of WaitUntilLoadBalancerAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilLoadBalancerAvailableWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilLoadBalancerAvailable", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "LoadBalancers[].State.Code", + Expected: "active", + }, + { + State: request.RetryWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "LoadBalancers[].State.Code", + Expected: "provisioning", + }, + { + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "LoadBalancerNotFound", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeLoadBalancersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLoadBalancersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilLoadBalancerExists uses the Elastic Load Balancing v2 API operation +// DescribeLoadBalancers to wait for a condition to be met before returning. +// If the condition is not meet within the max attempt window an error will +// be returned. +func (c *ELBV2) WaitUntilLoadBalancerExists(input *DescribeLoadBalancersInput) error { + return c.WaitUntilLoadBalancerExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilLoadBalancerExistsWithContext is an extended version of WaitUntilLoadBalancerExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilLoadBalancerExistsWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilLoadBalancerExists", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 200, + }, + { + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "LoadBalancerNotFound", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeLoadBalancersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLoadBalancersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/emr/api.go b/vendor/github.com/aws/aws-sdk-go/service/emr/api.go index 169ba4e3a..5fa88f564 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/emr/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package emr provides a client for Amazon Elastic MapReduce. package emr @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -80,8 +81,23 @@ func (c *EMR) AddInstanceFleetRequest(input *AddInstanceFleetInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceFleet func (c *EMR) AddInstanceFleet(input *AddInstanceFleetInput) (*AddInstanceFleetOutput, error) { req, out := c.AddInstanceFleetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddInstanceFleetWithContext is the same as AddInstanceFleet with the addition of +// the ability to pass a context and additional request options. +// +// See AddInstanceFleet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddInstanceFleetWithContext(ctx aws.Context, input *AddInstanceFleetInput, opts ...request.Option) (*AddInstanceFleetOutput, error) { + req, out := c.AddInstanceFleetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAddInstanceGroups = "AddInstanceGroups" @@ -146,8 +162,23 @@ func (c *EMR) AddInstanceGroupsRequest(input *AddInstanceGroupsInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceGroups func (c *EMR) AddInstanceGroups(input *AddInstanceGroupsInput) (*AddInstanceGroupsOutput, error) { req, out := c.AddInstanceGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddInstanceGroupsWithContext is the same as AddInstanceGroups with the addition of +// the ability to pass a context and additional request options. +// +// See AddInstanceGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddInstanceGroupsWithContext(ctx aws.Context, input *AddInstanceGroupsInput, opts ...request.Option) (*AddInstanceGroupsOutput, error) { + req, out := c.AddInstanceGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAddJobFlowSteps = "AddJobFlowSteps" @@ -234,8 +265,23 @@ func (c *EMR) AddJobFlowStepsRequest(input *AddJobFlowStepsInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddJobFlowSteps func (c *EMR) AddJobFlowSteps(input *AddJobFlowStepsInput) (*AddJobFlowStepsOutput, error) { req, out := c.AddJobFlowStepsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddJobFlowStepsWithContext is the same as AddJobFlowSteps with the addition of +// the ability to pass a context and additional request options. +// +// See AddJobFlowSteps for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddJobFlowStepsWithContext(ctx aws.Context, input *AddJobFlowStepsInput, opts ...request.Option) (*AddJobFlowStepsOutput, error) { + req, out := c.AddJobFlowStepsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAddTags = "AddTags" @@ -305,8 +351,23 @@ func (c *EMR) AddTagsRequest(input *AddTagsInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddTags func (c *EMR) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsWithContext is the same as AddTags with the addition of +// the ability to pass a context and additional request options. +// +// See AddTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error) { + req, out := c.AddTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelSteps = "CancelSteps" @@ -378,8 +439,23 @@ func (c *EMR) CancelStepsRequest(input *CancelStepsInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CancelSteps func (c *EMR) CancelSteps(input *CancelStepsInput) (*CancelStepsOutput, error) { req, out := c.CancelStepsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelStepsWithContext is the same as CancelSteps with the addition of +// the ability to pass a context and additional request options. +// +// See CancelSteps for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelStepsWithContext(ctx aws.Context, input *CancelStepsInput, opts ...request.Option) (*CancelStepsOutput, error) { + req, out := c.CancelStepsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSecurityConfiguration = "CreateSecurityConfiguration" @@ -447,8 +523,23 @@ func (c *EMR) CreateSecurityConfigurationRequest(input *CreateSecurityConfigurat // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CreateSecurityConfiguration func (c *EMR) CreateSecurityConfiguration(input *CreateSecurityConfigurationInput) (*CreateSecurityConfigurationOutput, error) { req, out := c.CreateSecurityConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSecurityConfigurationWithContext is the same as CreateSecurityConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSecurityConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateSecurityConfigurationWithContext(ctx aws.Context, input *CreateSecurityConfigurationInput, opts ...request.Option) (*CreateSecurityConfigurationOutput, error) { + req, out := c.CreateSecurityConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSecurityConfiguration = "DeleteSecurityConfiguration" @@ -515,8 +606,23 @@ func (c *EMR) DeleteSecurityConfigurationRequest(input *DeleteSecurityConfigurat // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DeleteSecurityConfiguration func (c *EMR) DeleteSecurityConfiguration(input *DeleteSecurityConfigurationInput) (*DeleteSecurityConfigurationOutput, error) { req, out := c.DeleteSecurityConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSecurityConfigurationWithContext is the same as DeleteSecurityConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSecurityConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSecurityConfigurationWithContext(ctx aws.Context, input *DeleteSecurityConfigurationInput, opts ...request.Option) (*DeleteSecurityConfigurationOutput, error) { + req, out := c.DeleteSecurityConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeCluster = "DescribeCluster" @@ -584,8 +690,23 @@ func (c *EMR) DescribeClusterRequest(input *DescribeClusterInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeCluster func (c *EMR) DescribeCluster(input *DescribeClusterInput) (*DescribeClusterOutput, error) { req, out := c.DescribeClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClusterWithContext is the same as DescribeCluster with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClusterWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.Option) (*DescribeClusterOutput, error) { + req, out := c.DescribeClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeJobFlows = "DescribeJobFlows" @@ -672,8 +793,23 @@ func (c *EMR) DescribeJobFlowsRequest(input *DescribeJobFlowsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeJobFlows func (c *EMR) DescribeJobFlows(input *DescribeJobFlowsInput) (*DescribeJobFlowsOutput, error) { req, out := c.DescribeJobFlowsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeJobFlowsWithContext is the same as DescribeJobFlows with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeJobFlows for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeJobFlowsWithContext(ctx aws.Context, input *DescribeJobFlowsInput, opts ...request.Option) (*DescribeJobFlowsOutput, error) { + req, out := c.DescribeJobFlowsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSecurityConfiguration = "DescribeSecurityConfiguration" @@ -741,8 +877,23 @@ func (c *EMR) DescribeSecurityConfigurationRequest(input *DescribeSecurityConfig // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeSecurityConfiguration func (c *EMR) DescribeSecurityConfiguration(input *DescribeSecurityConfigurationInput) (*DescribeSecurityConfigurationOutput, error) { req, out := c.DescribeSecurityConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSecurityConfigurationWithContext is the same as DescribeSecurityConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSecurityConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSecurityConfigurationWithContext(ctx aws.Context, input *DescribeSecurityConfigurationInput, opts ...request.Option) (*DescribeSecurityConfigurationOutput, error) { + req, out := c.DescribeSecurityConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeStep = "DescribeStep" @@ -809,8 +960,23 @@ func (c *EMR) DescribeStepRequest(input *DescribeStepInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeStep func (c *EMR) DescribeStep(input *DescribeStepInput) (*DescribeStepOutput, error) { req, out := c.DescribeStepRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStepWithContext is the same as DescribeStep with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStep for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStepWithContext(ctx aws.Context, input *DescribeStepInput, opts ...request.Option) (*DescribeStepOutput, error) { + req, out := c.DescribeStepRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListBootstrapActions = "ListBootstrapActions" @@ -883,8 +1049,23 @@ func (c *EMR) ListBootstrapActionsRequest(input *ListBootstrapActionsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListBootstrapActions func (c *EMR) ListBootstrapActions(input *ListBootstrapActionsInput) (*ListBootstrapActionsOutput, error) { req, out := c.ListBootstrapActionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListBootstrapActionsWithContext is the same as ListBootstrapActions with the addition of +// the ability to pass a context and additional request options. +// +// See ListBootstrapActions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListBootstrapActionsWithContext(ctx aws.Context, input *ListBootstrapActionsInput, opts ...request.Option) (*ListBootstrapActionsOutput, error) { + req, out := c.ListBootstrapActionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListBootstrapActionsPages iterates over the pages of a ListBootstrapActions operation, @@ -904,12 +1085,37 @@ func (c *EMR) ListBootstrapActions(input *ListBootstrapActionsInput) (*ListBoots // return pageNum <= 3 // }) // -func (c *EMR) ListBootstrapActionsPages(input *ListBootstrapActionsInput, fn func(p *ListBootstrapActionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListBootstrapActionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListBootstrapActionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListBootstrapActionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListBootstrapActionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListBootstrapActionsOutput), !p.HasNextPage()) + } + return p.Err() } const opListClusters = "ListClusters" @@ -986,8 +1192,23 @@ func (c *EMR) ListClustersRequest(input *ListClustersInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListClusters func (c *EMR) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { req, out := c.ListClustersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListClustersWithContext is the same as ListClusters with the addition of +// the ability to pass a context and additional request options. +// +// See ListClusters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListClustersWithContext(ctx aws.Context, input *ListClustersInput, opts ...request.Option) (*ListClustersOutput, error) { + req, out := c.ListClustersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListClustersPages iterates over the pages of a ListClusters operation, @@ -1007,12 +1228,37 @@ func (c *EMR) ListClusters(input *ListClustersInput) (*ListClustersOutput, error // return pageNum <= 3 // }) // -func (c *EMR) ListClustersPages(input *ListClustersInput, fn func(p *ListClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListClustersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) + } + return p.Err() } const opListInstanceFleets = "ListInstanceFleets" @@ -1088,8 +1334,23 @@ func (c *EMR) ListInstanceFleetsRequest(input *ListInstanceFleetsInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceFleets func (c *EMR) ListInstanceFleets(input *ListInstanceFleetsInput) (*ListInstanceFleetsOutput, error) { req, out := c.ListInstanceFleetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListInstanceFleetsWithContext is the same as ListInstanceFleets with the addition of +// the ability to pass a context and additional request options. +// +// See ListInstanceFleets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListInstanceFleetsWithContext(ctx aws.Context, input *ListInstanceFleetsInput, opts ...request.Option) (*ListInstanceFleetsOutput, error) { + req, out := c.ListInstanceFleetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListInstanceFleetsPages iterates over the pages of a ListInstanceFleets operation, @@ -1109,12 +1370,37 @@ func (c *EMR) ListInstanceFleets(input *ListInstanceFleetsInput) (*ListInstanceF // return pageNum <= 3 // }) // -func (c *EMR) ListInstanceFleetsPages(input *ListInstanceFleetsInput, fn func(p *ListInstanceFleetsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstanceFleetsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstanceFleetsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInstanceFleetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInstanceFleetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListInstanceFleetsOutput), !p.HasNextPage()) + } + return p.Err() } const opListInstanceGroups = "ListInstanceGroups" @@ -1187,8 +1473,23 @@ func (c *EMR) ListInstanceGroupsRequest(input *ListInstanceGroupsInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceGroups func (c *EMR) ListInstanceGroups(input *ListInstanceGroupsInput) (*ListInstanceGroupsOutput, error) { req, out := c.ListInstanceGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListInstanceGroupsWithContext is the same as ListInstanceGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListInstanceGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListInstanceGroupsWithContext(ctx aws.Context, input *ListInstanceGroupsInput, opts ...request.Option) (*ListInstanceGroupsOutput, error) { + req, out := c.ListInstanceGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListInstanceGroupsPages iterates over the pages of a ListInstanceGroups operation, @@ -1208,12 +1509,37 @@ func (c *EMR) ListInstanceGroups(input *ListInstanceGroupsInput) (*ListInstanceG // return pageNum <= 3 // }) // -func (c *EMR) ListInstanceGroupsPages(input *ListInstanceGroupsInput, fn func(p *ListInstanceGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstanceGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstanceGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInstanceGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInstanceGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListInstanceGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opListInstances = "ListInstances" @@ -1290,8 +1616,23 @@ func (c *EMR) ListInstancesRequest(input *ListInstancesInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstances func (c *EMR) ListInstances(input *ListInstancesInput) (*ListInstancesOutput, error) { req, out := c.ListInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListInstancesWithContext is the same as ListInstances with the addition of +// the ability to pass a context and additional request options. +// +// See ListInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListInstancesWithContext(ctx aws.Context, input *ListInstancesInput, opts ...request.Option) (*ListInstancesOutput, error) { + req, out := c.ListInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListInstancesPages iterates over the pages of a ListInstances operation, @@ -1311,12 +1652,37 @@ func (c *EMR) ListInstances(input *ListInstancesInput) (*ListInstancesOutput, er // return pageNum <= 3 // }) // -func (c *EMR) ListInstancesPages(input *ListInstancesInput, fn func(p *ListInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstancesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListInstancesOutput), !p.HasNextPage()) + } + return p.Err() } const opListSecurityConfigurations = "ListSecurityConfigurations" @@ -1386,8 +1752,23 @@ func (c *EMR) ListSecurityConfigurationsRequest(input *ListSecurityConfiguration // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSecurityConfigurations func (c *EMR) ListSecurityConfigurations(input *ListSecurityConfigurationsInput) (*ListSecurityConfigurationsOutput, error) { req, out := c.ListSecurityConfigurationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListSecurityConfigurationsWithContext is the same as ListSecurityConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListSecurityConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListSecurityConfigurationsWithContext(ctx aws.Context, input *ListSecurityConfigurationsInput, opts ...request.Option) (*ListSecurityConfigurationsOutput, error) { + req, out := c.ListSecurityConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListSteps = "ListSteps" @@ -1461,8 +1842,23 @@ func (c *EMR) ListStepsRequest(input *ListStepsInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSteps func (c *EMR) ListSteps(input *ListStepsInput) (*ListStepsOutput, error) { req, out := c.ListStepsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListStepsWithContext is the same as ListSteps with the addition of +// the ability to pass a context and additional request options. +// +// See ListSteps for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListStepsWithContext(ctx aws.Context, input *ListStepsInput, opts ...request.Option) (*ListStepsOutput, error) { + req, out := c.ListStepsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListStepsPages iterates over the pages of a ListSteps operation, @@ -1482,12 +1878,37 @@ func (c *EMR) ListSteps(input *ListStepsInput) (*ListStepsOutput, error) { // return pageNum <= 3 // }) // -func (c *EMR) ListStepsPages(input *ListStepsInput, fn func(p *ListStepsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStepsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStepsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListStepsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListStepsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListStepsOutput), !p.HasNextPage()) + } + return p.Err() } const opModifyInstanceFleet = "ModifyInstanceFleet" @@ -1561,8 +1982,23 @@ func (c *EMR) ModifyInstanceFleetRequest(input *ModifyInstanceFleetInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceFleet func (c *EMR) ModifyInstanceFleet(input *ModifyInstanceFleetInput) (*ModifyInstanceFleetOutput, error) { req, out := c.ModifyInstanceFleetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyInstanceFleetWithContext is the same as ModifyInstanceFleet with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyInstanceFleet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyInstanceFleetWithContext(ctx aws.Context, input *ModifyInstanceFleetInput, opts ...request.Option) (*ModifyInstanceFleetOutput, error) { + req, out := c.ModifyInstanceFleetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyInstanceGroups = "ModifyInstanceGroups" @@ -1632,8 +2068,23 @@ func (c *EMR) ModifyInstanceGroupsRequest(input *ModifyInstanceGroupsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceGroups func (c *EMR) ModifyInstanceGroups(input *ModifyInstanceGroupsInput) (*ModifyInstanceGroupsOutput, error) { req, out := c.ModifyInstanceGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyInstanceGroupsWithContext is the same as ModifyInstanceGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyInstanceGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyInstanceGroupsWithContext(ctx aws.Context, input *ModifyInstanceGroupsInput, opts ...request.Option) (*ModifyInstanceGroupsOutput, error) { + req, out := c.ModifyInstanceGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutAutoScalingPolicy = "PutAutoScalingPolicy" @@ -1695,8 +2146,23 @@ func (c *EMR) PutAutoScalingPolicyRequest(input *PutAutoScalingPolicyInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/PutAutoScalingPolicy func (c *EMR) PutAutoScalingPolicy(input *PutAutoScalingPolicyInput) (*PutAutoScalingPolicyOutput, error) { req, out := c.PutAutoScalingPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutAutoScalingPolicyWithContext is the same as PutAutoScalingPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutAutoScalingPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutAutoScalingPolicyWithContext(ctx aws.Context, input *PutAutoScalingPolicyInput, opts ...request.Option) (*PutAutoScalingPolicyOutput, error) { + req, out := c.PutAutoScalingPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveAutoScalingPolicy = "RemoveAutoScalingPolicy" @@ -1756,8 +2222,23 @@ func (c *EMR) RemoveAutoScalingPolicyRequest(input *RemoveAutoScalingPolicyInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveAutoScalingPolicy func (c *EMR) RemoveAutoScalingPolicy(input *RemoveAutoScalingPolicyInput) (*RemoveAutoScalingPolicyOutput, error) { req, out := c.RemoveAutoScalingPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveAutoScalingPolicyWithContext is the same as RemoveAutoScalingPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveAutoScalingPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveAutoScalingPolicyWithContext(ctx aws.Context, input *RemoveAutoScalingPolicyInput, opts ...request.Option) (*RemoveAutoScalingPolicyOutput, error) { + req, out := c.RemoveAutoScalingPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTags = "RemoveTags" @@ -1829,8 +2310,23 @@ func (c *EMR) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveTags func (c *EMR) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsWithContext is the same as RemoveTags with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRunJobFlow = "RunJobFlow" @@ -1921,8 +2417,23 @@ func (c *EMR) RunJobFlowRequest(input *RunJobFlowInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RunJobFlow func (c *EMR) RunJobFlow(input *RunJobFlowInput) (*RunJobFlowOutput, error) { req, out := c.RunJobFlowRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RunJobFlowWithContext is the same as RunJobFlow with the addition of +// the ability to pass a context and additional request options. +// +// See RunJobFlow for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RunJobFlowWithContext(ctx aws.Context, input *RunJobFlowInput, opts ...request.Option) (*RunJobFlowOutput, error) { + req, out := c.RunJobFlowRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetTerminationProtection = "SetTerminationProtection" @@ -2005,8 +2516,23 @@ func (c *EMR) SetTerminationProtectionRequest(input *SetTerminationProtectionInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetTerminationProtection func (c *EMR) SetTerminationProtection(input *SetTerminationProtectionInput) (*SetTerminationProtectionOutput, error) { req, out := c.SetTerminationProtectionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetTerminationProtectionWithContext is the same as SetTerminationProtection with the addition of +// the ability to pass a context and additional request options. +// +// See SetTerminationProtection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetTerminationProtectionWithContext(ctx aws.Context, input *SetTerminationProtectionInput, opts ...request.Option) (*SetTerminationProtectionOutput, error) { + req, out := c.SetTerminationProtectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetVisibleToAllUsers = "SetVisibleToAllUsers" @@ -2078,8 +2604,23 @@ func (c *EMR) SetVisibleToAllUsersRequest(input *SetVisibleToAllUsersInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetVisibleToAllUsers func (c *EMR) SetVisibleToAllUsers(input *SetVisibleToAllUsersInput) (*SetVisibleToAllUsersOutput, error) { req, out := c.SetVisibleToAllUsersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetVisibleToAllUsersWithContext is the same as SetVisibleToAllUsers with the addition of +// the ability to pass a context and additional request options. +// +// See SetVisibleToAllUsers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetVisibleToAllUsersWithContext(ctx aws.Context, input *SetVisibleToAllUsersInput, opts ...request.Option) (*SetVisibleToAllUsersOutput, error) { + req, out := c.SetVisibleToAllUsersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTerminateJobFlows = "TerminateJobFlows" @@ -2155,8 +2696,23 @@ func (c *EMR) TerminateJobFlowsRequest(input *TerminateJobFlowsInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/TerminateJobFlows func (c *EMR) TerminateJobFlows(input *TerminateJobFlowsInput) (*TerminateJobFlowsOutput, error) { req, out := c.TerminateJobFlowsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TerminateJobFlowsWithContext is the same as TerminateJobFlows with the addition of +// the ability to pass a context and additional request options. +// +// See TerminateJobFlows for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TerminateJobFlowsWithContext(ctx aws.Context, input *TerminateJobFlowsInput, opts ...request.Option) (*TerminateJobFlowsOutput, error) { + req, out := c.TerminateJobFlowsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceFleetInput diff --git a/vendor/github.com/aws/aws-sdk-go/service/emr/errors.go b/vendor/github.com/aws/aws-sdk-go/service/emr/errors.go index 7621ae662..b4bf33708 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/emr/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package emr diff --git a/vendor/github.com/aws/aws-sdk-go/service/emr/service.go b/vendor/github.com/aws/aws-sdk-go/service/emr/service.go index 610c46580..04d982bc8 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/emr/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package emr diff --git a/vendor/github.com/aws/aws-sdk-go/service/emr/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/emr/waiters.go index 443240d3d..6e1b7ddec 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/emr/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package emr import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilClusterRunning uses the Amazon EMR API operation @@ -11,50 +14,65 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *EMR) WaitUntilClusterRunning(input *DescribeClusterInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeCluster", - Delay: 30, + return c.WaitUntilClusterRunningWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilClusterRunningWithContext is an extended version of WaitUntilClusterRunning. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilClusterRunningWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilClusterRunning", MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "Cluster.Status.State", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Cluster.Status.State", Expected: "RUNNING", }, { - State: "success", - Matcher: "path", - Argument: "Cluster.Status.State", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Cluster.Status.State", Expected: "WAITING", }, { - State: "failure", - Matcher: "path", - Argument: "Cluster.Status.State", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Cluster.Status.State", Expected: "TERMINATING", }, { - State: "failure", - Matcher: "path", - Argument: "Cluster.Status.State", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Cluster.Status.State", Expected: "TERMINATED", }, { - State: "failure", - Matcher: "path", - Argument: "Cluster.Status.State", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Cluster.Status.State", Expected: "TERMINATED_WITH_ERRORS", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeClusterInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClusterRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilClusterTerminated uses the Amazon EMR API operation @@ -62,32 +80,50 @@ func (c *EMR) WaitUntilClusterRunning(input *DescribeClusterInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EMR) WaitUntilClusterTerminated(input *DescribeClusterInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeCluster", - Delay: 30, + return c.WaitUntilClusterTerminatedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilClusterTerminatedWithContext is an extended version of WaitUntilClusterTerminated. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilClusterTerminatedWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilClusterTerminated", MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "Cluster.Status.State", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Cluster.Status.State", Expected: "TERMINATED", }, { - State: "failure", - Matcher: "path", - Argument: "Cluster.Status.State", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Cluster.Status.State", Expected: "TERMINATED_WITH_ERRORS", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeClusterInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClusterRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilStepComplete uses the Amazon EMR API operation @@ -95,36 +131,53 @@ func (c *EMR) WaitUntilClusterTerminated(input *DescribeClusterInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *EMR) WaitUntilStepComplete(input *DescribeStepInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStep", - Delay: 30, + return c.WaitUntilStepCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilStepCompleteWithContext is an extended version of WaitUntilStepComplete. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilStepCompleteWithContext(ctx aws.Context, input *DescribeStepInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilStepComplete", MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "Step.Status.State", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Step.Status.State", Expected: "COMPLETED", }, { - State: "failure", - Matcher: "path", - Argument: "Step.Status.State", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Step.Status.State", Expected: "FAILED", }, { - State: "failure", - Matcher: "path", - Argument: "Step.Status.State", + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "Step.Status.State", Expected: "CANCELLED", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeStepInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStepRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/firehose/api.go b/vendor/github.com/aws/aws-sdk-go/service/firehose/api.go index b22bb85d6..0a4eb541e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/firehose/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package firehose provides a client for Amazon Kinesis Firehose. package firehose @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -122,8 +123,23 @@ func (c *Firehose) CreateDeliveryStreamRequest(input *CreateDeliveryStreamInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/CreateDeliveryStream func (c *Firehose) CreateDeliveryStream(input *CreateDeliveryStreamInput) (*CreateDeliveryStreamOutput, error) { req, out := c.CreateDeliveryStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDeliveryStreamWithContext is the same as CreateDeliveryStream with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDeliveryStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Firehose) CreateDeliveryStreamWithContext(ctx aws.Context, input *CreateDeliveryStreamInput, opts ...request.Option) (*CreateDeliveryStreamOutput, error) { + req, out := c.CreateDeliveryStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDeliveryStream = "DeleteDeliveryStream" @@ -201,8 +217,23 @@ func (c *Firehose) DeleteDeliveryStreamRequest(input *DeleteDeliveryStreamInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DeleteDeliveryStream func (c *Firehose) DeleteDeliveryStream(input *DeleteDeliveryStreamInput) (*DeleteDeliveryStreamOutput, error) { req, out := c.DeleteDeliveryStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDeliveryStreamWithContext is the same as DeleteDeliveryStream with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDeliveryStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Firehose) DeleteDeliveryStreamWithContext(ctx aws.Context, input *DeleteDeliveryStreamInput, opts ...request.Option) (*DeleteDeliveryStreamOutput, error) { + req, out := c.DeleteDeliveryStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDeliveryStream = "DescribeDeliveryStream" @@ -269,8 +300,23 @@ func (c *Firehose) DescribeDeliveryStreamRequest(input *DescribeDeliveryStreamIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DescribeDeliveryStream func (c *Firehose) DescribeDeliveryStream(input *DescribeDeliveryStreamInput) (*DescribeDeliveryStreamOutput, error) { req, out := c.DescribeDeliveryStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDeliveryStreamWithContext is the same as DescribeDeliveryStream with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDeliveryStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Firehose) DescribeDeliveryStreamWithContext(ctx aws.Context, input *DescribeDeliveryStreamInput, opts ...request.Option) (*DescribeDeliveryStreamOutput, error) { + req, out := c.DescribeDeliveryStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListDeliveryStreams = "ListDeliveryStreams" @@ -337,8 +383,23 @@ func (c *Firehose) ListDeliveryStreamsRequest(input *ListDeliveryStreamsInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ListDeliveryStreams func (c *Firehose) ListDeliveryStreams(input *ListDeliveryStreamsInput) (*ListDeliveryStreamsOutput, error) { req, out := c.ListDeliveryStreamsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDeliveryStreamsWithContext is the same as ListDeliveryStreams with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeliveryStreams for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Firehose) ListDeliveryStreamsWithContext(ctx aws.Context, input *ListDeliveryStreamsInput, opts ...request.Option) (*ListDeliveryStreamsOutput, error) { + req, out := c.ListDeliveryStreamsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutRecord = "PutRecord" @@ -443,8 +504,23 @@ func (c *Firehose) PutRecordRequest(input *PutRecordInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecord func (c *Firehose) PutRecord(input *PutRecordInput) (*PutRecordOutput, error) { req, out := c.PutRecordRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutRecordWithContext is the same as PutRecord with the addition of +// the ability to pass a context and additional request options. +// +// See PutRecord for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Firehose) PutRecordWithContext(ctx aws.Context, input *PutRecordInput, opts ...request.Option) (*PutRecordOutput, error) { + req, out := c.PutRecordRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutRecordBatch = "PutRecordBatch" @@ -573,8 +649,23 @@ func (c *Firehose) PutRecordBatchRequest(input *PutRecordBatchInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordBatch func (c *Firehose) PutRecordBatch(input *PutRecordBatchInput) (*PutRecordBatchOutput, error) { req, out := c.PutRecordBatchRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutRecordBatchWithContext is the same as PutRecordBatch with the addition of +// the ability to pass a context and additional request options. +// +// See PutRecordBatch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Firehose) PutRecordBatchWithContext(ctx aws.Context, input *PutRecordBatchInput, opts ...request.Option) (*PutRecordBatchOutput, error) { + req, out := c.PutRecordBatchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDestination = "UpdateDestination" @@ -677,8 +768,23 @@ func (c *Firehose) UpdateDestinationRequest(input *UpdateDestinationInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/UpdateDestination func (c *Firehose) UpdateDestination(input *UpdateDestinationInput) (*UpdateDestinationOutput, error) { req, out := c.UpdateDestinationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDestinationWithContext is the same as UpdateDestination with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Firehose) UpdateDestinationWithContext(ctx aws.Context, input *UpdateDestinationInput, opts ...request.Option) (*UpdateDestinationOutput, error) { + req, out := c.UpdateDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Describes hints for the buffering to perform before delivering data to the diff --git a/vendor/github.com/aws/aws-sdk-go/service/firehose/errors.go b/vendor/github.com/aws/aws-sdk-go/service/firehose/errors.go index f541053f0..82bdcca24 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/firehose/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package firehose diff --git a/vendor/github.com/aws/aws-sdk-go/service/firehose/service.go b/vendor/github.com/aws/aws-sdk-go/service/firehose/service.go index 930a4d428..08350cf62 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/firehose/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package firehose diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/api.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/api.go index e48809ed0..2fc06cc13 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glacier/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package glacier provides a client for Amazon Glacier. package glacier @@ -6,6 +6,7 @@ package glacier import ( "io" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -101,8 +102,23 @@ func (c *Glacier) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) // func (c *Glacier) AbortMultipartUpload(input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error) { req, out := c.AbortMultipartUploadRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AbortMultipartUploadWithContext is the same as AbortMultipartUpload with the addition of +// the ability to pass a context and additional request options. +// +// See AbortMultipartUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AbortMultipartUploadWithContext(ctx aws.Context, input *AbortMultipartUploadInput, opts ...request.Option) (*AbortMultipartUploadOutput, error) { + req, out := c.AbortMultipartUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAbortVaultLock = "AbortVaultLock" @@ -190,8 +206,23 @@ func (c *Glacier) AbortVaultLockRequest(input *AbortVaultLockInput) (req *reques // func (c *Glacier) AbortVaultLock(input *AbortVaultLockInput) (*AbortVaultLockOutput, error) { req, out := c.AbortVaultLockRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AbortVaultLockWithContext is the same as AbortVaultLock with the addition of +// the ability to pass a context and additional request options. +// +// See AbortVaultLock for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AbortVaultLockWithContext(ctx aws.Context, input *AbortVaultLockInput, opts ...request.Option) (*AbortVaultLockOutput, error) { + req, out := c.AbortVaultLockRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAddTagsToVault = "AddTagsToVault" @@ -272,8 +303,23 @@ func (c *Glacier) AddTagsToVaultRequest(input *AddTagsToVaultInput) (req *reques // func (c *Glacier) AddTagsToVault(input *AddTagsToVaultInput) (*AddTagsToVaultOutput, error) { req, out := c.AddTagsToVaultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsToVaultWithContext is the same as AddTagsToVault with the addition of +// the ability to pass a context and additional request options. +// +// See AddTagsToVault for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsToVaultWithContext(ctx aws.Context, input *AddTagsToVaultInput, opts ...request.Option) (*AddTagsToVaultOutput, error) { + req, out := c.AddTagsToVaultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCompleteMultipartUpload = "CompleteMultipartUpload" @@ -387,8 +433,23 @@ func (c *Glacier) CompleteMultipartUploadRequest(input *CompleteMultipartUploadI // func (c *Glacier) CompleteMultipartUpload(input *CompleteMultipartUploadInput) (*ArchiveCreationOutput, error) { req, out := c.CompleteMultipartUploadRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CompleteMultipartUploadWithContext is the same as CompleteMultipartUpload with the addition of +// the ability to pass a context and additional request options. +// +// See CompleteMultipartUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CompleteMultipartUploadWithContext(ctx aws.Context, input *CompleteMultipartUploadInput, opts ...request.Option) (*ArchiveCreationOutput, error) { + req, out := c.CompleteMultipartUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCompleteVaultLock = "CompleteVaultLock" @@ -475,8 +536,23 @@ func (c *Glacier) CompleteVaultLockRequest(input *CompleteVaultLockInput) (req * // func (c *Glacier) CompleteVaultLock(input *CompleteVaultLockInput) (*CompleteVaultLockOutput, error) { req, out := c.CompleteVaultLockRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CompleteVaultLockWithContext is the same as CompleteVaultLock with the addition of +// the ability to pass a context and additional request options. +// +// See CompleteVaultLock for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CompleteVaultLockWithContext(ctx aws.Context, input *CompleteVaultLockInput, opts ...request.Option) (*CompleteVaultLockOutput, error) { + req, out := c.CompleteVaultLockRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVault = "CreateVault" @@ -569,8 +645,23 @@ func (c *Glacier) CreateVaultRequest(input *CreateVaultInput) (req *request.Requ // func (c *Glacier) CreateVault(input *CreateVaultInput) (*CreateVaultOutput, error) { req, out := c.CreateVaultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVaultWithContext is the same as CreateVault with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVault for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVaultWithContext(ctx aws.Context, input *CreateVaultInput, opts ...request.Option) (*CreateVaultOutput, error) { + req, out := c.CreateVaultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteArchive = "DeleteArchive" @@ -667,8 +758,23 @@ func (c *Glacier) DeleteArchiveRequest(input *DeleteArchiveInput) (req *request. // func (c *Glacier) DeleteArchive(input *DeleteArchiveInput) (*DeleteArchiveOutput, error) { req, out := c.DeleteArchiveRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteArchiveWithContext is the same as DeleteArchive with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteArchive for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteArchiveWithContext(ctx aws.Context, input *DeleteArchiveInput, opts ...request.Option) (*DeleteArchiveOutput, error) { + req, out := c.DeleteArchiveRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVault = "DeleteVault" @@ -763,8 +869,23 @@ func (c *Glacier) DeleteVaultRequest(input *DeleteVaultInput) (req *request.Requ // func (c *Glacier) DeleteVault(input *DeleteVaultInput) (*DeleteVaultOutput, error) { req, out := c.DeleteVaultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVaultWithContext is the same as DeleteVault with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVault for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVaultWithContext(ctx aws.Context, input *DeleteVaultInput, opts ...request.Option) (*DeleteVaultOutput, error) { + req, out := c.DeleteVaultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVaultAccessPolicy = "DeleteVaultAccessPolicy" @@ -846,8 +967,23 @@ func (c *Glacier) DeleteVaultAccessPolicyRequest(input *DeleteVaultAccessPolicyI // func (c *Glacier) DeleteVaultAccessPolicy(input *DeleteVaultAccessPolicyInput) (*DeleteVaultAccessPolicyOutput, error) { req, out := c.DeleteVaultAccessPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVaultAccessPolicyWithContext is the same as DeleteVaultAccessPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVaultAccessPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVaultAccessPolicyWithContext(ctx aws.Context, input *DeleteVaultAccessPolicyInput, opts ...request.Option) (*DeleteVaultAccessPolicyOutput, error) { + req, out := c.DeleteVaultAccessPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVaultNotifications = "DeleteVaultNotifications" @@ -934,8 +1070,23 @@ func (c *Glacier) DeleteVaultNotificationsRequest(input *DeleteVaultNotification // func (c *Glacier) DeleteVaultNotifications(input *DeleteVaultNotificationsInput) (*DeleteVaultNotificationsOutput, error) { req, out := c.DeleteVaultNotificationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVaultNotificationsWithContext is the same as DeleteVaultNotifications with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVaultNotifications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVaultNotificationsWithContext(ctx aws.Context, input *DeleteVaultNotificationsInput, opts ...request.Option) (*DeleteVaultNotificationsOutput, error) { + req, out := c.DeleteVaultNotificationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeJob = "DescribeJob" @@ -1027,8 +1178,23 @@ func (c *Glacier) DescribeJobRequest(input *DescribeJobInput) (req *request.Requ // func (c *Glacier) DescribeJob(input *DescribeJobInput) (*JobDescription, error) { req, out := c.DescribeJobRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeJobWithContext is the same as DescribeJob with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeJobWithContext(ctx aws.Context, input *DescribeJobInput, opts ...request.Option) (*JobDescription, error) { + req, out := c.DescribeJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVault = "DescribeVault" @@ -1118,8 +1284,23 @@ func (c *Glacier) DescribeVaultRequest(input *DescribeVaultInput) (req *request. // func (c *Glacier) DescribeVault(input *DescribeVaultInput) (*DescribeVaultOutput, error) { req, out := c.DescribeVaultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVaultWithContext is the same as DescribeVault with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVault for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVaultWithContext(ctx aws.Context, input *DescribeVaultInput, opts ...request.Option) (*DescribeVaultOutput, error) { + req, out := c.DescribeVaultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDataRetrievalPolicy = "GetDataRetrievalPolicy" @@ -1188,8 +1369,23 @@ func (c *Glacier) GetDataRetrievalPolicyRequest(input *GetDataRetrievalPolicyInp // func (c *Glacier) GetDataRetrievalPolicy(input *GetDataRetrievalPolicyInput) (*GetDataRetrievalPolicyOutput, error) { req, out := c.GetDataRetrievalPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDataRetrievalPolicyWithContext is the same as GetDataRetrievalPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetDataRetrievalPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDataRetrievalPolicyWithContext(ctx aws.Context, input *GetDataRetrievalPolicyInput, opts ...request.Option) (*GetDataRetrievalPolicyOutput, error) { + req, out := c.GetDataRetrievalPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetJobOutput = "GetJobOutput" @@ -1303,8 +1499,23 @@ func (c *Glacier) GetJobOutputRequest(input *GetJobOutputInput) (req *request.Re // func (c *Glacier) GetJobOutput(input *GetJobOutputInput) (*GetJobOutputOutput, error) { req, out := c.GetJobOutputRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetJobOutputWithContext is the same as GetJobOutput with the addition of +// the ability to pass a context and additional request options. +// +// See GetJobOutput for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetJobOutputWithContext(ctx aws.Context, input *GetJobOutputInput, opts ...request.Option) (*GetJobOutputOutput, error) { + req, out := c.GetJobOutputRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetVaultAccessPolicy = "GetVaultAccessPolicy" @@ -1380,8 +1591,23 @@ func (c *Glacier) GetVaultAccessPolicyRequest(input *GetVaultAccessPolicyInput) // func (c *Glacier) GetVaultAccessPolicy(input *GetVaultAccessPolicyInput) (*GetVaultAccessPolicyOutput, error) { req, out := c.GetVaultAccessPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetVaultAccessPolicyWithContext is the same as GetVaultAccessPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetVaultAccessPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetVaultAccessPolicyWithContext(ctx aws.Context, input *GetVaultAccessPolicyInput, opts ...request.Option) (*GetVaultAccessPolicyOutput, error) { + req, out := c.GetVaultAccessPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetVaultLock = "GetVaultLock" @@ -1471,8 +1697,23 @@ func (c *Glacier) GetVaultLockRequest(input *GetVaultLockInput) (req *request.Re // func (c *Glacier) GetVaultLock(input *GetVaultLockInput) (*GetVaultLockOutput, error) { req, out := c.GetVaultLockRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetVaultLockWithContext is the same as GetVaultLock with the addition of +// the ability to pass a context and additional request options. +// +// See GetVaultLock for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetVaultLockWithContext(ctx aws.Context, input *GetVaultLockInput, opts ...request.Option) (*GetVaultLockOutput, error) { + req, out := c.GetVaultLockRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetVaultNotifications = "GetVaultNotifications" @@ -1561,8 +1802,23 @@ func (c *Glacier) GetVaultNotificationsRequest(input *GetVaultNotificationsInput // func (c *Glacier) GetVaultNotifications(input *GetVaultNotificationsInput) (*GetVaultNotificationsOutput, error) { req, out := c.GetVaultNotificationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetVaultNotificationsWithContext is the same as GetVaultNotifications with the addition of +// the ability to pass a context and additional request options. +// +// See GetVaultNotifications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetVaultNotificationsWithContext(ctx aws.Context, input *GetVaultNotificationsInput, opts ...request.Option) (*GetVaultNotificationsOutput, error) { + req, out := c.GetVaultNotificationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opInitiateJob = "InitiateJob" @@ -1777,8 +2033,23 @@ func (c *Glacier) InitiateJobRequest(input *InitiateJobInput) (req *request.Requ // func (c *Glacier) InitiateJob(input *InitiateJobInput) (*InitiateJobOutput, error) { req, out := c.InitiateJobRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// InitiateJobWithContext is the same as InitiateJob with the addition of +// the ability to pass a context and additional request options. +// +// See InitiateJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) InitiateJobWithContext(ctx aws.Context, input *InitiateJobInput, opts ...request.Option) (*InitiateJobOutput, error) { + req, out := c.InitiateJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opInitiateMultipartUpload = "InitiateMultipartUpload" @@ -1883,8 +2154,23 @@ func (c *Glacier) InitiateMultipartUploadRequest(input *InitiateMultipartUploadI // func (c *Glacier) InitiateMultipartUpload(input *InitiateMultipartUploadInput) (*InitiateMultipartUploadOutput, error) { req, out := c.InitiateMultipartUploadRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// InitiateMultipartUploadWithContext is the same as InitiateMultipartUpload with the addition of +// the ability to pass a context and additional request options. +// +// See InitiateMultipartUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) InitiateMultipartUploadWithContext(ctx aws.Context, input *InitiateMultipartUploadInput, opts ...request.Option) (*InitiateMultipartUploadOutput, error) { + req, out := c.InitiateMultipartUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opInitiateVaultLock = "InitiateVaultLock" @@ -1983,8 +2269,23 @@ func (c *Glacier) InitiateVaultLockRequest(input *InitiateVaultLockInput) (req * // func (c *Glacier) InitiateVaultLock(input *InitiateVaultLockInput) (*InitiateVaultLockOutput, error) { req, out := c.InitiateVaultLockRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// InitiateVaultLockWithContext is the same as InitiateVaultLock with the addition of +// the ability to pass a context and additional request options. +// +// See InitiateVaultLock for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) InitiateVaultLockWithContext(ctx aws.Context, input *InitiateVaultLockInput, opts ...request.Option) (*InitiateVaultLockOutput, error) { + req, out := c.InitiateVaultLockRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListJobs = "ListJobs" @@ -2100,8 +2401,23 @@ func (c *Glacier) ListJobsRequest(input *ListJobsInput) (req *request.Request, o // func (c *Glacier) ListJobs(input *ListJobsInput) (*ListJobsOutput, error) { req, out := c.ListJobsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListJobsWithContext is the same as ListJobs with the addition of +// the ability to pass a context and additional request options. +// +// See ListJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListJobsWithContext(ctx aws.Context, input *ListJobsInput, opts ...request.Option) (*ListJobsOutput, error) { + req, out := c.ListJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListJobsPages iterates over the pages of a ListJobs operation, @@ -2121,12 +2437,37 @@ func (c *Glacier) ListJobs(input *ListJobsInput) (*ListJobsOutput, error) { // return pageNum <= 3 // }) // -func (c *Glacier) ListJobsPages(input *ListJobsInput, fn func(p *ListJobsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListJobsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListJobsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) + } + return p.Err() } const opListMultipartUploads = "ListMultipartUploads" @@ -2232,8 +2573,23 @@ func (c *Glacier) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) // func (c *Glacier) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultipartUploadsOutput, error) { req, out := c.ListMultipartUploadsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListMultipartUploadsWithContext is the same as ListMultipartUploads with the addition of +// the ability to pass a context and additional request options. +// +// See ListMultipartUploads for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListMultipartUploadsWithContext(ctx aws.Context, input *ListMultipartUploadsInput, opts ...request.Option) (*ListMultipartUploadsOutput, error) { + req, out := c.ListMultipartUploadsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListMultipartUploadsPages iterates over the pages of a ListMultipartUploads operation, @@ -2253,12 +2609,37 @@ func (c *Glacier) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListM // return pageNum <= 3 // }) // -func (c *Glacier) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(p *ListMultipartUploadsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListMultipartUploadsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListMultipartUploadsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMultipartUploadsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMultipartUploadsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) + } + return p.Err() } const opListParts = "ListParts" @@ -2358,8 +2739,23 @@ func (c *Glacier) ListPartsRequest(input *ListPartsInput) (req *request.Request, // func (c *Glacier) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { req, out := c.ListPartsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPartsWithContext is the same as ListParts with the addition of +// the ability to pass a context and additional request options. +// +// See ListParts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPartsWithContext(ctx aws.Context, input *ListPartsInput, opts ...request.Option) (*ListPartsOutput, error) { + req, out := c.ListPartsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListPartsPages iterates over the pages of a ListParts operation, @@ -2379,12 +2775,37 @@ func (c *Glacier) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { // return pageNum <= 3 // }) // -func (c *Glacier) ListPartsPages(input *ListPartsInput, fn func(p *ListPartsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPartsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPartsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPartsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPartsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) + } + return p.Err() } const opListProvisionedCapacity = "ListProvisionedCapacity" @@ -2451,8 +2872,23 @@ func (c *Glacier) ListProvisionedCapacityRequest(input *ListProvisionedCapacityI // func (c *Glacier) ListProvisionedCapacity(input *ListProvisionedCapacityInput) (*ListProvisionedCapacityOutput, error) { req, out := c.ListProvisionedCapacityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListProvisionedCapacityWithContext is the same as ListProvisionedCapacity with the addition of +// the ability to pass a context and additional request options. +// +// See ListProvisionedCapacity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListProvisionedCapacityWithContext(ctx aws.Context, input *ListProvisionedCapacityInput, opts ...request.Option) (*ListProvisionedCapacityOutput, error) { + req, out := c.ListProvisionedCapacityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTagsForVault = "ListTagsForVault" @@ -2525,8 +2961,23 @@ func (c *Glacier) ListTagsForVaultRequest(input *ListTagsForVaultInput) (req *re // func (c *Glacier) ListTagsForVault(input *ListTagsForVaultInput) (*ListTagsForVaultOutput, error) { req, out := c.ListTagsForVaultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForVaultWithContext is the same as ListTagsForVault with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForVault for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForVaultWithContext(ctx aws.Context, input *ListTagsForVaultInput, opts ...request.Option) (*ListTagsForVaultOutput, error) { + req, out := c.ListTagsForVaultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListVaults = "ListVaults" @@ -2623,8 +3074,23 @@ func (c *Glacier) ListVaultsRequest(input *ListVaultsInput) (req *request.Reques // func (c *Glacier) ListVaults(input *ListVaultsInput) (*ListVaultsOutput, error) { req, out := c.ListVaultsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListVaultsWithContext is the same as ListVaults with the addition of +// the ability to pass a context and additional request options. +// +// See ListVaults for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListVaultsWithContext(ctx aws.Context, input *ListVaultsInput, opts ...request.Option) (*ListVaultsOutput, error) { + req, out := c.ListVaultsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListVaultsPages iterates over the pages of a ListVaults operation, @@ -2644,12 +3110,37 @@ func (c *Glacier) ListVaults(input *ListVaultsInput) (*ListVaultsOutput, error) // return pageNum <= 3 // }) // -func (c *Glacier) ListVaultsPages(input *ListVaultsInput, fn func(p *ListVaultsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListVaultsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListVaultsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListVaultsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListVaultsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListVaultsOutput), !p.HasNextPage()) + } + return p.Err() } const opPurchaseProvisionedCapacity = "PurchaseProvisionedCapacity" @@ -2719,8 +3210,23 @@ func (c *Glacier) PurchaseProvisionedCapacityRequest(input *PurchaseProvisionedC // func (c *Glacier) PurchaseProvisionedCapacity(input *PurchaseProvisionedCapacityInput) (*PurchaseProvisionedCapacityOutput, error) { req, out := c.PurchaseProvisionedCapacityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PurchaseProvisionedCapacityWithContext is the same as PurchaseProvisionedCapacity with the addition of +// the ability to pass a context and additional request options. +// +// See PurchaseProvisionedCapacity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PurchaseProvisionedCapacityWithContext(ctx aws.Context, input *PurchaseProvisionedCapacityInput, opts ...request.Option) (*PurchaseProvisionedCapacityOutput, error) { + req, out := c.PurchaseProvisionedCapacityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTagsFromVault = "RemoveTagsFromVault" @@ -2797,8 +3303,23 @@ func (c *Glacier) RemoveTagsFromVaultRequest(input *RemoveTagsFromVaultInput) (r // func (c *Glacier) RemoveTagsFromVault(input *RemoveTagsFromVaultInput) (*RemoveTagsFromVaultOutput, error) { req, out := c.RemoveTagsFromVaultRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsFromVaultWithContext is the same as RemoveTagsFromVault with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTagsFromVault for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsFromVaultWithContext(ctx aws.Context, input *RemoveTagsFromVaultInput, opts ...request.Option) (*RemoveTagsFromVaultOutput, error) { + req, out := c.RemoveTagsFromVaultRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetDataRetrievalPolicy = "SetDataRetrievalPolicy" @@ -2873,8 +3394,23 @@ func (c *Glacier) SetDataRetrievalPolicyRequest(input *SetDataRetrievalPolicyInp // func (c *Glacier) SetDataRetrievalPolicy(input *SetDataRetrievalPolicyInput) (*SetDataRetrievalPolicyOutput, error) { req, out := c.SetDataRetrievalPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetDataRetrievalPolicyWithContext is the same as SetDataRetrievalPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See SetDataRetrievalPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetDataRetrievalPolicyWithContext(ctx aws.Context, input *SetDataRetrievalPolicyInput, opts ...request.Option) (*SetDataRetrievalPolicyOutput, error) { + req, out := c.SetDataRetrievalPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetVaultAccessPolicy = "SetVaultAccessPolicy" @@ -2953,8 +3489,23 @@ func (c *Glacier) SetVaultAccessPolicyRequest(input *SetVaultAccessPolicyInput) // func (c *Glacier) SetVaultAccessPolicy(input *SetVaultAccessPolicyInput) (*SetVaultAccessPolicyOutput, error) { req, out := c.SetVaultAccessPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetVaultAccessPolicyWithContext is the same as SetVaultAccessPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See SetVaultAccessPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetVaultAccessPolicyWithContext(ctx aws.Context, input *SetVaultAccessPolicyInput, opts ...request.Option) (*SetVaultAccessPolicyOutput, error) { + req, out := c.SetVaultAccessPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetVaultNotifications = "SetVaultNotifications" @@ -3058,8 +3609,23 @@ func (c *Glacier) SetVaultNotificationsRequest(input *SetVaultNotificationsInput // func (c *Glacier) SetVaultNotifications(input *SetVaultNotificationsInput) (*SetVaultNotificationsOutput, error) { req, out := c.SetVaultNotificationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetVaultNotificationsWithContext is the same as SetVaultNotifications with the addition of +// the ability to pass a context and additional request options. +// +// See SetVaultNotifications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetVaultNotificationsWithContext(ctx aws.Context, input *SetVaultNotificationsInput, opts ...request.Option) (*SetVaultNotificationsOutput, error) { + req, out := c.SetVaultNotificationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUploadArchive = "UploadArchive" @@ -3169,8 +3735,23 @@ func (c *Glacier) UploadArchiveRequest(input *UploadArchiveInput) (req *request. // func (c *Glacier) UploadArchive(input *UploadArchiveInput) (*ArchiveCreationOutput, error) { req, out := c.UploadArchiveRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UploadArchiveWithContext is the same as UploadArchive with the addition of +// the ability to pass a context and additional request options. +// +// See UploadArchive for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UploadArchiveWithContext(ctx aws.Context, input *UploadArchiveInput, opts ...request.Option) (*ArchiveCreationOutput, error) { + req, out := c.UploadArchiveRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUploadMultipartPart = "UploadMultipartPart" @@ -3290,8 +3871,23 @@ func (c *Glacier) UploadMultipartPartRequest(input *UploadMultipartPartInput) (r // func (c *Glacier) UploadMultipartPart(input *UploadMultipartPartInput) (*UploadMultipartPartOutput, error) { req, out := c.UploadMultipartPartRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UploadMultipartPartWithContext is the same as UploadMultipartPart with the addition of +// the ability to pass a context and additional request options. +// +// See UploadMultipartPart for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UploadMultipartPartWithContext(ctx aws.Context, input *UploadMultipartPartInput, opts ...request.Option) (*UploadMultipartPartOutput, error) { + req, out := c.UploadMultipartPartRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Provides options to abort a multipart upload identified by the upload ID. diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/errors.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/errors.go index 9ce95315a..c47e3bb30 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glacier/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package glacier diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/service.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/service.go index d668dde26..7caefefdd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glacier/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package glacier diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/treehash.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/treehash.go index dac44baf5..e1ee0aa5b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/treehash.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glacier/treehash.go @@ -15,6 +15,8 @@ type Hash struct { } // ComputeHashes computes the tree-hash and linear hash of a seekable reader r. +// +// See http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html for more information. func ComputeHashes(r io.ReadSeeker) Hash { r.Seek(0, 0) // Read the whole stream defer r.Seek(0, 0) // Rewind stream at end @@ -41,12 +43,16 @@ func ComputeHashes(r io.ReadSeeker) Hash { return Hash{ LinearHash: hsh.Sum(nil), - TreeHash: buildHashTree(hashes), + TreeHash: ComputeTreeHash(hashes), } } -// buildHashTree builds a hash tree root node given a set of hashes. -func buildHashTree(hashes [][]byte) []byte { +// ComputeTreeHash builds a tree hash root node given a slice of +// hashes. Glacier tree hash to be derived from SHA256 hashes of 1MB +// chucks of the data. +// +// See http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html for more information. +func ComputeTreeHash(hashes [][]byte) []byte { if hashes == nil || len(hashes) == 0 { return nil } diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/waiters.go index fd33dc977..342fe25e7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glacier/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package glacier import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilVaultExists uses the Amazon Glacier API operation @@ -11,32 +14,50 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *Glacier) WaitUntilVaultExists(input *DescribeVaultInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVault", - Delay: 3, + return c.WaitUntilVaultExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVaultExistsWithContext is an extended version of WaitUntilVaultExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVaultExistsWithContext(ctx aws.Context, input *DescribeVaultInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVaultExists", MaxAttempts: 15, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(3 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ResourceNotFoundException", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVaultInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVaultRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilVaultNotExists uses the Amazon Glacier API operation @@ -44,30 +65,48 @@ func (c *Glacier) WaitUntilVaultExists(input *DescribeVaultInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *Glacier) WaitUntilVaultNotExists(input *DescribeVaultInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVault", - Delay: 3, + return c.WaitUntilVaultNotExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilVaultNotExistsWithContext is an extended version of WaitUntilVaultNotExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilVaultNotExistsWithContext(ctx aws.Context, input *DescribeVaultInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilVaultNotExists", MaxAttempts: 15, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(3 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "retry", - Matcher: "status", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ResourceNotFoundException", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeVaultInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVaultRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/api.go b/vendor/github.com/aws/aws-sdk-go/service/iam/api.go index e41818673..7bf68ca83 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package iam provides a client for AWS Identity and Access Management. package iam @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -93,8 +94,23 @@ func (c *IAM) AddClientIDToOpenIDConnectProviderRequest(input *AddClientIDToOpen // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddClientIDToOpenIDConnectProvider func (c *IAM) AddClientIDToOpenIDConnectProvider(input *AddClientIDToOpenIDConnectProviderInput) (*AddClientIDToOpenIDConnectProviderOutput, error) { req, out := c.AddClientIDToOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddClientIDToOpenIDConnectProviderWithContext is the same as AddClientIDToOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See AddClientIDToOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddClientIDToOpenIDConnectProviderWithContext(ctx aws.Context, input *AddClientIDToOpenIDConnectProviderInput, opts ...request.Option) (*AddClientIDToOpenIDConnectProviderOutput, error) { + req, out := c.AddClientIDToOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAddRoleToInstanceProfile = "AddRoleToInstanceProfile" @@ -180,8 +196,23 @@ func (c *IAM) AddRoleToInstanceProfileRequest(input *AddRoleToInstanceProfileInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddRoleToInstanceProfile func (c *IAM) AddRoleToInstanceProfile(input *AddRoleToInstanceProfileInput) (*AddRoleToInstanceProfileOutput, error) { req, out := c.AddRoleToInstanceProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddRoleToInstanceProfileWithContext is the same as AddRoleToInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See AddRoleToInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddRoleToInstanceProfileWithContext(ctx aws.Context, input *AddRoleToInstanceProfileInput, opts ...request.Option) (*AddRoleToInstanceProfileOutput, error) { + req, out := c.AddRoleToInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAddUserToGroup = "AddUserToGroup" @@ -256,8 +287,23 @@ func (c *IAM) AddUserToGroupRequest(input *AddUserToGroupInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddUserToGroup func (c *IAM) AddUserToGroup(input *AddUserToGroupInput) (*AddUserToGroupOutput, error) { req, out := c.AddUserToGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddUserToGroupWithContext is the same as AddUserToGroup with the addition of +// the ability to pass a context and additional request options. +// +// See AddUserToGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddUserToGroupWithContext(ctx aws.Context, input *AddUserToGroupInput, opts ...request.Option) (*AddUserToGroupOutput, error) { + req, out := c.AddUserToGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachGroupPolicy = "AttachGroupPolicy" @@ -343,8 +389,23 @@ func (c *IAM) AttachGroupPolicyRequest(input *AttachGroupPolicyInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachGroupPolicy func (c *IAM) AttachGroupPolicy(input *AttachGroupPolicyInput) (*AttachGroupPolicyOutput, error) { req, out := c.AttachGroupPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachGroupPolicyWithContext is the same as AttachGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See AttachGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachGroupPolicyWithContext(ctx aws.Context, input *AttachGroupPolicyInput, opts ...request.Option) (*AttachGroupPolicyOutput, error) { + req, out := c.AttachGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachRolePolicy = "AttachRolePolicy" @@ -434,8 +495,23 @@ func (c *IAM) AttachRolePolicyRequest(input *AttachRolePolicyInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachRolePolicy func (c *IAM) AttachRolePolicy(input *AttachRolePolicyInput) (*AttachRolePolicyOutput, error) { req, out := c.AttachRolePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachRolePolicyWithContext is the same as AttachRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See AttachRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachRolePolicyWithContext(ctx aws.Context, input *AttachRolePolicyInput, opts ...request.Option) (*AttachRolePolicyOutput, error) { + req, out := c.AttachRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachUserPolicy = "AttachUserPolicy" @@ -521,8 +597,23 @@ func (c *IAM) AttachUserPolicyRequest(input *AttachUserPolicyInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachUserPolicy func (c *IAM) AttachUserPolicy(input *AttachUserPolicyInput) (*AttachUserPolicyOutput, error) { req, out := c.AttachUserPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachUserPolicyWithContext is the same as AttachUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See AttachUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachUserPolicyWithContext(ctx aws.Context, input *AttachUserPolicyInput, opts ...request.Option) (*AttachUserPolicyOutput, error) { + req, out := c.AttachUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opChangePassword = "ChangePassword" @@ -616,8 +707,23 @@ func (c *IAM) ChangePasswordRequest(input *ChangePasswordInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ChangePassword func (c *IAM) ChangePassword(input *ChangePasswordInput) (*ChangePasswordOutput, error) { req, out := c.ChangePasswordRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ChangePasswordWithContext is the same as ChangePassword with the addition of +// the ability to pass a context and additional request options. +// +// See ChangePassword for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ChangePasswordWithContext(ctx aws.Context, input *ChangePasswordInput, opts ...request.Option) (*ChangePasswordOutput, error) { + req, out := c.ChangePasswordRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAccessKey = "CreateAccessKey" @@ -706,8 +812,23 @@ func (c *IAM) CreateAccessKeyRequest(input *CreateAccessKeyInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccessKey func (c *IAM) CreateAccessKey(input *CreateAccessKeyInput) (*CreateAccessKeyOutput, error) { req, out := c.CreateAccessKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAccessKeyWithContext is the same as CreateAccessKey with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAccessKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAccessKeyWithContext(ctx aws.Context, input *CreateAccessKeyInput, opts ...request.Option) (*CreateAccessKeyOutput, error) { + req, out := c.CreateAccessKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAccountAlias = "CreateAccountAlias" @@ -784,8 +905,23 @@ func (c *IAM) CreateAccountAliasRequest(input *CreateAccountAliasInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccountAlias func (c *IAM) CreateAccountAlias(input *CreateAccountAliasInput) (*CreateAccountAliasOutput, error) { req, out := c.CreateAccountAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAccountAliasWithContext is the same as CreateAccountAlias with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAccountAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAccountAliasWithContext(ctx aws.Context, input *CreateAccountAliasInput, opts ...request.Option) (*CreateAccountAliasOutput, error) { + req, out := c.CreateAccountAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateGroup = "CreateGroup" @@ -866,8 +1002,23 @@ func (c *IAM) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateGroup func (c *IAM) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) { req, out := c.CreateGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateGroupWithContext is the same as CreateGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateGroupWithContext(ctx aws.Context, input *CreateGroupInput, opts ...request.Option) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateInstanceProfile = "CreateInstanceProfile" @@ -945,8 +1096,23 @@ func (c *IAM) CreateInstanceProfileRequest(input *CreateInstanceProfileInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateInstanceProfile func (c *IAM) CreateInstanceProfile(input *CreateInstanceProfileInput) (*CreateInstanceProfileOutput, error) { req, out := c.CreateInstanceProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateInstanceProfileWithContext is the same as CreateInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateInstanceProfileWithContext(ctx aws.Context, input *CreateInstanceProfileInput, opts ...request.Option) (*CreateInstanceProfileOutput, error) { + req, out := c.CreateInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLoginProfile = "CreateLoginProfile" @@ -1030,8 +1196,23 @@ func (c *IAM) CreateLoginProfileRequest(input *CreateLoginProfileInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateLoginProfile func (c *IAM) CreateLoginProfile(input *CreateLoginProfileInput) (*CreateLoginProfileOutput, error) { req, out := c.CreateLoginProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLoginProfileWithContext is the same as CreateLoginProfile with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoginProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLoginProfileWithContext(ctx aws.Context, input *CreateLoginProfileInput, opts ...request.Option) (*CreateLoginProfileOutput, error) { + req, out := c.CreateLoginProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateOpenIDConnectProvider = "CreateOpenIDConnectProvider" @@ -1124,8 +1305,23 @@ func (c *IAM) CreateOpenIDConnectProviderRequest(input *CreateOpenIDConnectProvi // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateOpenIDConnectProvider func (c *IAM) CreateOpenIDConnectProvider(input *CreateOpenIDConnectProviderInput) (*CreateOpenIDConnectProviderOutput, error) { req, out := c.CreateOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateOpenIDConnectProviderWithContext is the same as CreateOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See CreateOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateOpenIDConnectProviderWithContext(ctx aws.Context, input *CreateOpenIDConnectProviderInput, opts ...request.Option) (*CreateOpenIDConnectProviderOutput, error) { + req, out := c.CreateOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePolicy = "CreatePolicy" @@ -1215,8 +1411,23 @@ func (c *IAM) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicy func (c *IAM) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) { req, out := c.CreatePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePolicyWithContext is the same as CreatePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreatePolicyWithContext(ctx aws.Context, input *CreatePolicyInput, opts ...request.Option) (*CreatePolicyOutput, error) { + req, out := c.CreatePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePolicyVersion = "CreatePolicyVersion" @@ -1308,8 +1519,23 @@ func (c *IAM) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyVersion func (c *IAM) CreatePolicyVersion(input *CreatePolicyVersionInput) (*CreatePolicyVersionOutput, error) { req, out := c.CreatePolicyVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePolicyVersionWithContext is the same as CreatePolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreatePolicyVersionWithContext(ctx aws.Context, input *CreatePolicyVersionInput, opts ...request.Option) (*CreatePolicyVersionOutput, error) { + req, out := c.CreatePolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateRole = "CreateRole" @@ -1390,8 +1616,23 @@ func (c *IAM) CreateRoleRequest(input *CreateRoleInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateRole func (c *IAM) CreateRole(input *CreateRoleInput) (*CreateRoleOutput, error) { req, out := c.CreateRoleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateRoleWithContext is the same as CreateRole with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateRoleWithContext(ctx aws.Context, input *CreateRoleInput, opts ...request.Option) (*CreateRoleOutput, error) { + req, out := c.CreateRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSAMLProvider = "CreateSAMLProvider" @@ -1489,8 +1730,23 @@ func (c *IAM) CreateSAMLProviderRequest(input *CreateSAMLProviderInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProvider func (c *IAM) CreateSAMLProvider(input *CreateSAMLProviderInput) (*CreateSAMLProviderOutput, error) { req, out := c.CreateSAMLProviderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSAMLProviderWithContext is the same as CreateSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateSAMLProviderWithContext(ctx aws.Context, input *CreateSAMLProviderInput, opts ...request.Option) (*CreateSAMLProviderOutput, error) { + req, out := c.CreateSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateServiceSpecificCredential = "CreateServiceSpecificCredential" @@ -1575,8 +1831,23 @@ func (c *IAM) CreateServiceSpecificCredentialRequest(input *CreateServiceSpecifi // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceSpecificCredential func (c *IAM) CreateServiceSpecificCredential(input *CreateServiceSpecificCredentialInput) (*CreateServiceSpecificCredentialOutput, error) { req, out := c.CreateServiceSpecificCredentialRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateServiceSpecificCredentialWithContext is the same as CreateServiceSpecificCredential with the addition of +// the ability to pass a context and additional request options. +// +// See CreateServiceSpecificCredential for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateServiceSpecificCredentialWithContext(ctx aws.Context, input *CreateServiceSpecificCredentialInput, opts ...request.Option) (*CreateServiceSpecificCredentialOutput, error) { + req, out := c.CreateServiceSpecificCredentialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateUser = "CreateUser" @@ -1657,8 +1928,23 @@ func (c *IAM) CreateUserRequest(input *CreateUserInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateUser func (c *IAM) CreateUser(input *CreateUserInput) (*CreateUserOutput, error) { req, out := c.CreateUserRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateUserWithContext is the same as CreateUser with the addition of +// the ability to pass a context and additional request options. +// +// See CreateUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateUserWithContext(ctx aws.Context, input *CreateUserInput, opts ...request.Option) (*CreateUserOutput, error) { + req, out := c.CreateUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVirtualMFADevice = "CreateVirtualMFADevice" @@ -1744,8 +2030,23 @@ func (c *IAM) CreateVirtualMFADeviceRequest(input *CreateVirtualMFADeviceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateVirtualMFADevice func (c *IAM) CreateVirtualMFADevice(input *CreateVirtualMFADeviceInput) (*CreateVirtualMFADeviceOutput, error) { req, out := c.CreateVirtualMFADeviceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVirtualMFADeviceWithContext is the same as CreateVirtualMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVirtualMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVirtualMFADeviceWithContext(ctx aws.Context, input *CreateVirtualMFADeviceInput, opts ...request.Option) (*CreateVirtualMFADeviceOutput, error) { + req, out := c.CreateVirtualMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeactivateMFADevice = "DeactivateMFADevice" @@ -1831,8 +2132,23 @@ func (c *IAM) DeactivateMFADeviceRequest(input *DeactivateMFADeviceInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeactivateMFADevice func (c *IAM) DeactivateMFADevice(input *DeactivateMFADeviceInput) (*DeactivateMFADeviceOutput, error) { req, out := c.DeactivateMFADeviceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeactivateMFADeviceWithContext is the same as DeactivateMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See DeactivateMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeactivateMFADeviceWithContext(ctx aws.Context, input *DeactivateMFADeviceInput, opts ...request.Option) (*DeactivateMFADeviceOutput, error) { + req, out := c.DeactivateMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAccessKey = "DeleteAccessKey" @@ -1912,8 +2228,23 @@ func (c *IAM) DeleteAccessKeyRequest(input *DeleteAccessKeyInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccessKey func (c *IAM) DeleteAccessKey(input *DeleteAccessKeyInput) (*DeleteAccessKeyOutput, error) { req, out := c.DeleteAccessKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAccessKeyWithContext is the same as DeleteAccessKey with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccessKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAccessKeyWithContext(ctx aws.Context, input *DeleteAccessKeyInput, opts ...request.Option) (*DeleteAccessKeyOutput, error) { + req, out := c.DeleteAccessKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAccountAlias = "DeleteAccountAlias" @@ -1990,8 +2321,23 @@ func (c *IAM) DeleteAccountAliasRequest(input *DeleteAccountAliasInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountAlias func (c *IAM) DeleteAccountAlias(input *DeleteAccountAliasInput) (*DeleteAccountAliasOutput, error) { req, out := c.DeleteAccountAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAccountAliasWithContext is the same as DeleteAccountAlias with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccountAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAccountAliasWithContext(ctx aws.Context, input *DeleteAccountAliasInput, opts ...request.Option) (*DeleteAccountAliasOutput, error) { + req, out := c.DeleteAccountAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAccountPasswordPolicy = "DeleteAccountPasswordPolicy" @@ -2066,8 +2412,23 @@ func (c *IAM) DeleteAccountPasswordPolicyRequest(input *DeleteAccountPasswordPol // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountPasswordPolicy func (c *IAM) DeleteAccountPasswordPolicy(input *DeleteAccountPasswordPolicyInput) (*DeleteAccountPasswordPolicyOutput, error) { req, out := c.DeleteAccountPasswordPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAccountPasswordPolicyWithContext is the same as DeleteAccountPasswordPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccountPasswordPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAccountPasswordPolicyWithContext(ctx aws.Context, input *DeleteAccountPasswordPolicyInput, opts ...request.Option) (*DeleteAccountPasswordPolicyOutput, error) { + req, out := c.DeleteAccountPasswordPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteGroup = "DeleteGroup" @@ -2147,8 +2508,23 @@ func (c *IAM) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroup func (c *IAM) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { req, out := c.DeleteGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteGroupWithContext is the same as DeleteGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteGroupPolicy = "DeleteGroupPolicy" @@ -2229,8 +2605,23 @@ func (c *IAM) DeleteGroupPolicyRequest(input *DeleteGroupPolicyInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupPolicy func (c *IAM) DeleteGroupPolicy(input *DeleteGroupPolicyInput) (*DeleteGroupPolicyOutput, error) { req, out := c.DeleteGroupPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteGroupPolicyWithContext is the same as DeleteGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteGroupPolicyWithContext(ctx aws.Context, input *DeleteGroupPolicyInput, opts ...request.Option) (*DeleteGroupPolicyOutput, error) { + req, out := c.DeleteGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteInstanceProfile = "DeleteInstanceProfile" @@ -2318,8 +2709,23 @@ func (c *IAM) DeleteInstanceProfileRequest(input *DeleteInstanceProfileInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfile func (c *IAM) DeleteInstanceProfile(input *DeleteInstanceProfileInput) (*DeleteInstanceProfileOutput, error) { req, out := c.DeleteInstanceProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteInstanceProfileWithContext is the same as DeleteInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteInstanceProfileWithContext(ctx aws.Context, input *DeleteInstanceProfileInput, opts ...request.Option) (*DeleteInstanceProfileOutput, error) { + req, out := c.DeleteInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLoginProfile = "DeleteLoginProfile" @@ -2406,8 +2812,23 @@ func (c *IAM) DeleteLoginProfileRequest(input *DeleteLoginProfileInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteLoginProfile func (c *IAM) DeleteLoginProfile(input *DeleteLoginProfileInput) (*DeleteLoginProfileOutput, error) { req, out := c.DeleteLoginProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLoginProfileWithContext is the same as DeleteLoginProfile with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoginProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLoginProfileWithContext(ctx aws.Context, input *DeleteLoginProfileInput, opts ...request.Option) (*DeleteLoginProfileOutput, error) { + req, out := c.DeleteLoginProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteOpenIDConnectProvider = "DeleteOpenIDConnectProvider" @@ -2489,8 +2910,23 @@ func (c *IAM) DeleteOpenIDConnectProviderRequest(input *DeleteOpenIDConnectProvi // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteOpenIDConnectProvider func (c *IAM) DeleteOpenIDConnectProvider(input *DeleteOpenIDConnectProviderInput) (*DeleteOpenIDConnectProviderOutput, error) { req, out := c.DeleteOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteOpenIDConnectProviderWithContext is the same as DeleteOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteOpenIDConnectProviderWithContext(ctx aws.Context, input *DeleteOpenIDConnectProviderInput, opts ...request.Option) (*DeleteOpenIDConnectProviderOutput, error) { + req, out := c.DeleteOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePolicy = "DeletePolicy" @@ -2595,8 +3031,23 @@ func (c *IAM) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicy func (c *IAM) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { req, out := c.DeletePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePolicyWithContext is the same as DeletePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeletePolicyWithContext(ctx aws.Context, input *DeletePolicyInput, opts ...request.Option) (*DeletePolicyOutput, error) { + req, out := c.DeletePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePolicyVersion = "DeletePolicyVersion" @@ -2687,8 +3138,23 @@ func (c *IAM) DeletePolicyVersionRequest(input *DeletePolicyVersionInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyVersion func (c *IAM) DeletePolicyVersion(input *DeletePolicyVersionInput) (*DeletePolicyVersionOutput, error) { req, out := c.DeletePolicyVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePolicyVersionWithContext is the same as DeletePolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeletePolicyVersionWithContext(ctx aws.Context, input *DeletePolicyVersionInput, opts ...request.Option) (*DeletePolicyVersionOutput, error) { + req, out := c.DeletePolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRole = "DeleteRole" @@ -2772,8 +3238,23 @@ func (c *IAM) DeleteRoleRequest(input *DeleteRoleInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRole func (c *IAM) DeleteRole(input *DeleteRoleInput) (*DeleteRoleOutput, error) { req, out := c.DeleteRoleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRoleWithContext is the same as DeleteRole with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRoleWithContext(ctx aws.Context, input *DeleteRoleInput, opts ...request.Option) (*DeleteRoleOutput, error) { + req, out := c.DeleteRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRolePolicy = "DeleteRolePolicy" @@ -2854,8 +3335,23 @@ func (c *IAM) DeleteRolePolicyRequest(input *DeleteRolePolicyInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePolicy func (c *IAM) DeleteRolePolicy(input *DeleteRolePolicyInput) (*DeleteRolePolicyOutput, error) { req, out := c.DeleteRolePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRolePolicyWithContext is the same as DeleteRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteRolePolicyWithContext(ctx aws.Context, input *DeleteRolePolicyInput, opts ...request.Option) (*DeleteRolePolicyOutput, error) { + req, out := c.DeleteRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSAMLProvider = "DeleteSAMLProvider" @@ -2941,8 +3437,23 @@ func (c *IAM) DeleteSAMLProviderRequest(input *DeleteSAMLProviderInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSAMLProvider func (c *IAM) DeleteSAMLProvider(input *DeleteSAMLProviderInput) (*DeleteSAMLProviderOutput, error) { req, out := c.DeleteSAMLProviderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSAMLProviderWithContext is the same as DeleteSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSAMLProviderWithContext(ctx aws.Context, input *DeleteSAMLProviderInput, opts ...request.Option) (*DeleteSAMLProviderOutput, error) { + req, out := c.DeleteSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSSHPublicKey = "DeleteSSHPublicKey" @@ -3015,8 +3526,23 @@ func (c *IAM) DeleteSSHPublicKeyRequest(input *DeleteSSHPublicKeyInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSSHPublicKey func (c *IAM) DeleteSSHPublicKey(input *DeleteSSHPublicKeyInput) (*DeleteSSHPublicKeyOutput, error) { req, out := c.DeleteSSHPublicKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSSHPublicKeyWithContext is the same as DeleteSSHPublicKey with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSSHPublicKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSSHPublicKeyWithContext(ctx aws.Context, input *DeleteSSHPublicKeyInput, opts ...request.Option) (*DeleteSSHPublicKeyOutput, error) { + req, out := c.DeleteSSHPublicKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteServerCertificate = "DeleteServerCertificate" @@ -3110,8 +3636,23 @@ func (c *IAM) DeleteServerCertificateRequest(input *DeleteServerCertificateInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServerCertificate func (c *IAM) DeleteServerCertificate(input *DeleteServerCertificateInput) (*DeleteServerCertificateOutput, error) { req, out := c.DeleteServerCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteServerCertificateWithContext is the same as DeleteServerCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteServerCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteServerCertificateWithContext(ctx aws.Context, input *DeleteServerCertificateInput, opts ...request.Option) (*DeleteServerCertificateOutput, error) { + req, out := c.DeleteServerCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteServiceSpecificCredential = "DeleteServiceSpecificCredential" @@ -3178,8 +3719,23 @@ func (c *IAM) DeleteServiceSpecificCredentialRequest(input *DeleteServiceSpecifi // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceSpecificCredential func (c *IAM) DeleteServiceSpecificCredential(input *DeleteServiceSpecificCredentialInput) (*DeleteServiceSpecificCredentialOutput, error) { req, out := c.DeleteServiceSpecificCredentialRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteServiceSpecificCredentialWithContext is the same as DeleteServiceSpecificCredential with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteServiceSpecificCredential for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteServiceSpecificCredentialWithContext(ctx aws.Context, input *DeleteServiceSpecificCredentialInput, opts ...request.Option) (*DeleteServiceSpecificCredentialOutput, error) { + req, out := c.DeleteServiceSpecificCredentialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSigningCertificate = "DeleteSigningCertificate" @@ -3259,8 +3815,23 @@ func (c *IAM) DeleteSigningCertificateRequest(input *DeleteSigningCertificateInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSigningCertificate func (c *IAM) DeleteSigningCertificate(input *DeleteSigningCertificateInput) (*DeleteSigningCertificateOutput, error) { req, out := c.DeleteSigningCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSigningCertificateWithContext is the same as DeleteSigningCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSigningCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSigningCertificateWithContext(ctx aws.Context, input *DeleteSigningCertificateInput, opts ...request.Option) (*DeleteSigningCertificateOutput, error) { + req, out := c.DeleteSigningCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteUser = "DeleteUser" @@ -3340,8 +3911,23 @@ func (c *IAM) DeleteUserRequest(input *DeleteUserInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUser func (c *IAM) DeleteUser(input *DeleteUserInput) (*DeleteUserOutput, error) { req, out := c.DeleteUserRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteUserWithContext is the same as DeleteUser with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteUserWithContext(ctx aws.Context, input *DeleteUserInput, opts ...request.Option) (*DeleteUserOutput, error) { + req, out := c.DeleteUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteUserPolicy = "DeleteUserPolicy" @@ -3422,8 +4008,23 @@ func (c *IAM) DeleteUserPolicyRequest(input *DeleteUserPolicyInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPolicy func (c *IAM) DeleteUserPolicy(input *DeleteUserPolicyInput) (*DeleteUserPolicyOutput, error) { req, out := c.DeleteUserPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteUserPolicyWithContext is the same as DeleteUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteUserPolicyWithContext(ctx aws.Context, input *DeleteUserPolicyInput, opts ...request.Option) (*DeleteUserPolicyOutput, error) { + req, out := c.DeleteUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVirtualMFADevice = "DeleteVirtualMFADevice" @@ -3505,8 +4106,23 @@ func (c *IAM) DeleteVirtualMFADeviceRequest(input *DeleteVirtualMFADeviceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteVirtualMFADevice func (c *IAM) DeleteVirtualMFADevice(input *DeleteVirtualMFADeviceInput) (*DeleteVirtualMFADeviceOutput, error) { req, out := c.DeleteVirtualMFADeviceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVirtualMFADeviceWithContext is the same as DeleteVirtualMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVirtualMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVirtualMFADeviceWithContext(ctx aws.Context, input *DeleteVirtualMFADeviceInput, opts ...request.Option) (*DeleteVirtualMFADeviceOutput, error) { + req, out := c.DeleteVirtualMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachGroupPolicy = "DetachGroupPolicy" @@ -3590,8 +4206,23 @@ func (c *IAM) DetachGroupPolicyRequest(input *DetachGroupPolicyInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachGroupPolicy func (c *IAM) DetachGroupPolicy(input *DetachGroupPolicyInput) (*DetachGroupPolicyOutput, error) { req, out := c.DetachGroupPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachGroupPolicyWithContext is the same as DetachGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DetachGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachGroupPolicyWithContext(ctx aws.Context, input *DetachGroupPolicyInput, opts ...request.Option) (*DetachGroupPolicyOutput, error) { + req, out := c.DetachGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachRolePolicy = "DetachRolePolicy" @@ -3675,8 +4306,23 @@ func (c *IAM) DetachRolePolicyRequest(input *DetachRolePolicyInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachRolePolicy func (c *IAM) DetachRolePolicy(input *DetachRolePolicyInput) (*DetachRolePolicyOutput, error) { req, out := c.DetachRolePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachRolePolicyWithContext is the same as DetachRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DetachRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachRolePolicyWithContext(ctx aws.Context, input *DetachRolePolicyInput, opts ...request.Option) (*DetachRolePolicyOutput, error) { + req, out := c.DetachRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachUserPolicy = "DetachUserPolicy" @@ -3760,8 +4406,23 @@ func (c *IAM) DetachUserPolicyRequest(input *DetachUserPolicyInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachUserPolicy func (c *IAM) DetachUserPolicy(input *DetachUserPolicyInput) (*DetachUserPolicyOutput, error) { req, out := c.DetachUserPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachUserPolicyWithContext is the same as DetachUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DetachUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachUserPolicyWithContext(ctx aws.Context, input *DetachUserPolicyInput, opts ...request.Option) (*DetachUserPolicyOutput, error) { + req, out := c.DetachUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableMFADevice = "EnableMFADevice" @@ -3852,8 +4513,23 @@ func (c *IAM) EnableMFADeviceRequest(input *EnableMFADeviceInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EnableMFADevice func (c *IAM) EnableMFADevice(input *EnableMFADeviceInput) (*EnableMFADeviceOutput, error) { req, out := c.EnableMFADeviceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableMFADeviceWithContext is the same as EnableMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See EnableMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableMFADeviceWithContext(ctx aws.Context, input *EnableMFADeviceInput, opts ...request.Option) (*EnableMFADeviceOutput, error) { + req, out := c.EnableMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGenerateCredentialReport = "GenerateCredentialReport" @@ -3924,8 +4600,23 @@ func (c *IAM) GenerateCredentialReportRequest(input *GenerateCredentialReportInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateCredentialReport func (c *IAM) GenerateCredentialReport(input *GenerateCredentialReportInput) (*GenerateCredentialReportOutput, error) { req, out := c.GenerateCredentialReportRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GenerateCredentialReportWithContext is the same as GenerateCredentialReport with the addition of +// the ability to pass a context and additional request options. +// +// See GenerateCredentialReport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GenerateCredentialReportWithContext(ctx aws.Context, input *GenerateCredentialReportInput, opts ...request.Option) (*GenerateCredentialReportOutput, error) { + req, out := c.GenerateCredentialReportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetAccessKeyLastUsed = "GetAccessKeyLastUsed" @@ -3993,8 +4684,23 @@ func (c *IAM) GetAccessKeyLastUsedRequest(input *GetAccessKeyLastUsedInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccessKeyLastUsed func (c *IAM) GetAccessKeyLastUsed(input *GetAccessKeyLastUsedInput) (*GetAccessKeyLastUsedOutput, error) { req, out := c.GetAccessKeyLastUsedRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAccessKeyLastUsedWithContext is the same as GetAccessKeyLastUsed with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccessKeyLastUsed for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAccessKeyLastUsedWithContext(ctx aws.Context, input *GetAccessKeyLastUsedInput, opts ...request.Option) (*GetAccessKeyLastUsedOutput, error) { + req, out := c.GetAccessKeyLastUsedRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetAccountAuthorizationDetails = "GetAccountAuthorizationDetails" @@ -4071,8 +4777,23 @@ func (c *IAM) GetAccountAuthorizationDetailsRequest(input *GetAccountAuthorizati // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountAuthorizationDetails func (c *IAM) GetAccountAuthorizationDetails(input *GetAccountAuthorizationDetailsInput) (*GetAccountAuthorizationDetailsOutput, error) { req, out := c.GetAccountAuthorizationDetailsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAccountAuthorizationDetailsWithContext is the same as GetAccountAuthorizationDetails with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccountAuthorizationDetails for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAccountAuthorizationDetailsWithContext(ctx aws.Context, input *GetAccountAuthorizationDetailsInput, opts ...request.Option) (*GetAccountAuthorizationDetailsOutput, error) { + req, out := c.GetAccountAuthorizationDetailsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetAccountAuthorizationDetailsPages iterates over the pages of a GetAccountAuthorizationDetails operation, @@ -4092,12 +4813,37 @@ func (c *IAM) GetAccountAuthorizationDetails(input *GetAccountAuthorizationDetai // return pageNum <= 3 // }) // -func (c *IAM) GetAccountAuthorizationDetailsPages(input *GetAccountAuthorizationDetailsInput, fn func(p *GetAccountAuthorizationDetailsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetAccountAuthorizationDetailsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetAccountAuthorizationDetailsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetAccountAuthorizationDetailsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetAccountAuthorizationDetailsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetAccountAuthorizationDetailsOutput), !p.HasNextPage()) + } + return p.Err() } const opGetAccountPasswordPolicy = "GetAccountPasswordPolicy" @@ -4167,8 +4913,23 @@ func (c *IAM) GetAccountPasswordPolicyRequest(input *GetAccountPasswordPolicyInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountPasswordPolicy func (c *IAM) GetAccountPasswordPolicy(input *GetAccountPasswordPolicyInput) (*GetAccountPasswordPolicyOutput, error) { req, out := c.GetAccountPasswordPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAccountPasswordPolicyWithContext is the same as GetAccountPasswordPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccountPasswordPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAccountPasswordPolicyWithContext(ctx aws.Context, input *GetAccountPasswordPolicyInput, opts ...request.Option) (*GetAccountPasswordPolicyOutput, error) { + req, out := c.GetAccountPasswordPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetAccountSummary = "GetAccountSummary" @@ -4237,8 +4998,23 @@ func (c *IAM) GetAccountSummaryRequest(input *GetAccountSummaryInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountSummary func (c *IAM) GetAccountSummary(input *GetAccountSummaryInput) (*GetAccountSummaryOutput, error) { req, out := c.GetAccountSummaryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAccountSummaryWithContext is the same as GetAccountSummary with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccountSummary for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAccountSummaryWithContext(ctx aws.Context, input *GetAccountSummaryInput, opts ...request.Option) (*GetAccountSummaryOutput, error) { + req, out := c.GetAccountSummaryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetContextKeysForCustomPolicy = "GetContextKeysForCustomPolicy" @@ -4312,8 +5088,23 @@ func (c *IAM) GetContextKeysForCustomPolicyRequest(input *GetContextKeysForCusto // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForCustomPolicy func (c *IAM) GetContextKeysForCustomPolicy(input *GetContextKeysForCustomPolicyInput) (*GetContextKeysForPolicyResponse, error) { req, out := c.GetContextKeysForCustomPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetContextKeysForCustomPolicyWithContext is the same as GetContextKeysForCustomPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetContextKeysForCustomPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetContextKeysForCustomPolicyWithContext(ctx aws.Context, input *GetContextKeysForCustomPolicyInput, opts ...request.Option) (*GetContextKeysForPolicyResponse, error) { + req, out := c.GetContextKeysForCustomPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetContextKeysForPrincipalPolicy = "GetContextKeysForPrincipalPolicy" @@ -4398,8 +5189,23 @@ func (c *IAM) GetContextKeysForPrincipalPolicyRequest(input *GetContextKeysForPr // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForPrincipalPolicy func (c *IAM) GetContextKeysForPrincipalPolicy(input *GetContextKeysForPrincipalPolicyInput) (*GetContextKeysForPolicyResponse, error) { req, out := c.GetContextKeysForPrincipalPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetContextKeysForPrincipalPolicyWithContext is the same as GetContextKeysForPrincipalPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetContextKeysForPrincipalPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetContextKeysForPrincipalPolicyWithContext(ctx aws.Context, input *GetContextKeysForPrincipalPolicyInput, opts ...request.Option) (*GetContextKeysForPolicyResponse, error) { + req, out := c.GetContextKeysForPrincipalPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetCredentialReport = "GetCredentialReport" @@ -4480,8 +5286,23 @@ func (c *IAM) GetCredentialReportRequest(input *GetCredentialReportInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetCredentialReport func (c *IAM) GetCredentialReport(input *GetCredentialReportInput) (*GetCredentialReportOutput, error) { req, out := c.GetCredentialReportRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetCredentialReportWithContext is the same as GetCredentialReport with the addition of +// the ability to pass a context and additional request options. +// +// See GetCredentialReport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetCredentialReportWithContext(ctx aws.Context, input *GetCredentialReportInput, opts ...request.Option) (*GetCredentialReportOutput, error) { + req, out := c.GetCredentialReportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetGroup = "GetGroup" @@ -4557,8 +5378,23 @@ func (c *IAM) GetGroupRequest(input *GetGroupInput) (req *request.Request, outpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroup func (c *IAM) GetGroup(input *GetGroupInput) (*GetGroupOutput, error) { req, out := c.GetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetGroupWithContext is the same as GetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetGroupWithContext(ctx aws.Context, input *GetGroupInput, opts ...request.Option) (*GetGroupOutput, error) { + req, out := c.GetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetGroupPages iterates over the pages of a GetGroup operation, @@ -4578,12 +5414,37 @@ func (c *IAM) GetGroup(input *GetGroupInput) (*GetGroupOutput, error) { // return pageNum <= 3 // }) // -func (c *IAM) GetGroupPages(input *GetGroupInput, fn func(p *GetGroupOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetGroupRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetGroupOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetGroupInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetGroupRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetGroupOutput), !p.HasNextPage()) + } + return p.Err() } const opGetGroupPolicy = "GetGroupPolicy" @@ -4668,8 +5529,23 @@ func (c *IAM) GetGroupPolicyRequest(input *GetGroupPolicyInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupPolicy func (c *IAM) GetGroupPolicy(input *GetGroupPolicyInput) (*GetGroupPolicyOutput, error) { req, out := c.GetGroupPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetGroupPolicyWithContext is the same as GetGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetGroupPolicyWithContext(ctx aws.Context, input *GetGroupPolicyInput, opts ...request.Option) (*GetGroupPolicyOutput, error) { + req, out := c.GetGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInstanceProfile = "GetInstanceProfile" @@ -4741,8 +5617,23 @@ func (c *IAM) GetInstanceProfileRequest(input *GetInstanceProfileInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetInstanceProfile func (c *IAM) GetInstanceProfile(input *GetInstanceProfileInput) (*GetInstanceProfileOutput, error) { req, out := c.GetInstanceProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInstanceProfileWithContext is the same as GetInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetInstanceProfileWithContext(ctx aws.Context, input *GetInstanceProfileInput, opts ...request.Option) (*GetInstanceProfileOutput, error) { + req, out := c.GetInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetLoginProfile = "GetLoginProfile" @@ -4813,8 +5704,23 @@ func (c *IAM) GetLoginProfileRequest(input *GetLoginProfileInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetLoginProfile func (c *IAM) GetLoginProfile(input *GetLoginProfileInput) (*GetLoginProfileOutput, error) { req, out := c.GetLoginProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetLoginProfileWithContext is the same as GetLoginProfile with the addition of +// the ability to pass a context and additional request options. +// +// See GetLoginProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetLoginProfileWithContext(ctx aws.Context, input *GetLoginProfileInput, opts ...request.Option) (*GetLoginProfileOutput, error) { + req, out := c.GetLoginProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetOpenIDConnectProvider = "GetOpenIDConnectProvider" @@ -4888,8 +5794,23 @@ func (c *IAM) GetOpenIDConnectProviderRequest(input *GetOpenIDConnectProviderInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetOpenIDConnectProvider func (c *IAM) GetOpenIDConnectProvider(input *GetOpenIDConnectProviderInput) (*GetOpenIDConnectProviderOutput, error) { req, out := c.GetOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetOpenIDConnectProviderWithContext is the same as GetOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See GetOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetOpenIDConnectProviderWithContext(ctx aws.Context, input *GetOpenIDConnectProviderInput, opts ...request.Option) (*GetOpenIDConnectProviderOutput, error) { + req, out := c.GetOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPolicy = "GetPolicy" @@ -4975,8 +5896,23 @@ func (c *IAM) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicy func (c *IAM) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) { req, out := c.GetPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPolicyWithContext is the same as GetPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetPolicyWithContext(ctx aws.Context, input *GetPolicyInput, opts ...request.Option) (*GetPolicyOutput, error) { + req, out := c.GetPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPolicyVersion = "GetPolicyVersion" @@ -5070,8 +6006,23 @@ func (c *IAM) GetPolicyVersionRequest(input *GetPolicyVersionInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyVersion func (c *IAM) GetPolicyVersion(input *GetPolicyVersionInput) (*GetPolicyVersionOutput, error) { req, out := c.GetPolicyVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPolicyVersionWithContext is the same as GetPolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetPolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetPolicyVersionWithContext(ctx aws.Context, input *GetPolicyVersionInput, opts ...request.Option) (*GetPolicyVersionOutput, error) { + req, out := c.GetPolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetRole = "GetRole" @@ -5148,8 +6099,23 @@ func (c *IAM) GetRoleRequest(input *GetRoleInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRole func (c *IAM) GetRole(input *GetRoleInput) (*GetRoleOutput, error) { req, out := c.GetRoleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRoleWithContext is the same as GetRole with the addition of +// the ability to pass a context and additional request options. +// +// See GetRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetRoleWithContext(ctx aws.Context, input *GetRoleInput, opts ...request.Option) (*GetRoleOutput, error) { + req, out := c.GetRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetRolePolicy = "GetRolePolicy" @@ -5237,8 +6203,23 @@ func (c *IAM) GetRolePolicyRequest(input *GetRolePolicyInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRolePolicy func (c *IAM) GetRolePolicy(input *GetRolePolicyInput) (*GetRolePolicyOutput, error) { req, out := c.GetRolePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRolePolicyWithContext is the same as GetRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetRolePolicyWithContext(ctx aws.Context, input *GetRolePolicyInput, opts ...request.Option) (*GetRolePolicyOutput, error) { + req, out := c.GetRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSAMLProvider = "GetSAMLProvider" @@ -5314,8 +6295,23 @@ func (c *IAM) GetSAMLProviderRequest(input *GetSAMLProviderInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSAMLProvider func (c *IAM) GetSAMLProvider(input *GetSAMLProviderInput) (*GetSAMLProviderOutput, error) { req, out := c.GetSAMLProviderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSAMLProviderWithContext is the same as GetSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See GetSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSAMLProviderWithContext(ctx aws.Context, input *GetSAMLProviderInput, opts ...request.Option) (*GetSAMLProviderOutput, error) { + req, out := c.GetSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSSHPublicKey = "GetSSHPublicKey" @@ -5390,8 +6386,23 @@ func (c *IAM) GetSSHPublicKeyRequest(input *GetSSHPublicKeyInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSSHPublicKey func (c *IAM) GetSSHPublicKey(input *GetSSHPublicKeyInput) (*GetSSHPublicKeyOutput, error) { req, out := c.GetSSHPublicKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSSHPublicKeyWithContext is the same as GetSSHPublicKey with the addition of +// the ability to pass a context and additional request options. +// +// See GetSSHPublicKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSSHPublicKeyWithContext(ctx aws.Context, input *GetSSHPublicKeyInput, opts ...request.Option) (*GetSSHPublicKeyOutput, error) { + req, out := c.GetSSHPublicKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetServerCertificate = "GetServerCertificate" @@ -5465,8 +6476,23 @@ func (c *IAM) GetServerCertificateRequest(input *GetServerCertificateInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServerCertificate func (c *IAM) GetServerCertificate(input *GetServerCertificateInput) (*GetServerCertificateOutput, error) { req, out := c.GetServerCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetServerCertificateWithContext is the same as GetServerCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See GetServerCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetServerCertificateWithContext(ctx aws.Context, input *GetServerCertificateInput, opts ...request.Option) (*GetServerCertificateOutput, error) { + req, out := c.GetServerCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetUser = "GetUser" @@ -5539,8 +6565,23 @@ func (c *IAM) GetUserRequest(input *GetUserInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUser func (c *IAM) GetUser(input *GetUserInput) (*GetUserOutput, error) { req, out := c.GetUserRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetUserWithContext is the same as GetUser with the addition of +// the ability to pass a context and additional request options. +// +// See GetUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetUserWithContext(ctx aws.Context, input *GetUserInput, opts ...request.Option) (*GetUserOutput, error) { + req, out := c.GetUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetUserPolicy = "GetUserPolicy" @@ -5625,8 +6666,23 @@ func (c *IAM) GetUserPolicyRequest(input *GetUserPolicyInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserPolicy func (c *IAM) GetUserPolicy(input *GetUserPolicyInput) (*GetUserPolicyOutput, error) { req, out := c.GetUserPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetUserPolicyWithContext is the same as GetUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetUserPolicyWithContext(ctx aws.Context, input *GetUserPolicyInput, opts ...request.Option) (*GetUserPolicyOutput, error) { + req, out := c.GetUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAccessKeys = "ListAccessKeys" @@ -5713,8 +6769,23 @@ func (c *IAM) ListAccessKeysRequest(input *ListAccessKeysInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccessKeys func (c *IAM) ListAccessKeys(input *ListAccessKeysInput) (*ListAccessKeysOutput, error) { req, out := c.ListAccessKeysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAccessKeysWithContext is the same as ListAccessKeys with the addition of +// the ability to pass a context and additional request options. +// +// See ListAccessKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAccessKeysWithContext(ctx aws.Context, input *ListAccessKeysInput, opts ...request.Option) (*ListAccessKeysOutput, error) { + req, out := c.ListAccessKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListAccessKeysPages iterates over the pages of a ListAccessKeys operation, @@ -5734,12 +6805,37 @@ func (c *IAM) ListAccessKeys(input *ListAccessKeysInput) (*ListAccessKeysOutput, // return pageNum <= 3 // }) // -func (c *IAM) ListAccessKeysPages(input *ListAccessKeysInput, fn func(p *ListAccessKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAccessKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAccessKeysOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAccessKeysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAccessKeysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAccessKeysOutput), !p.HasNextPage()) + } + return p.Err() } const opListAccountAliases = "ListAccountAliases" @@ -5813,8 +6909,23 @@ func (c *IAM) ListAccountAliasesRequest(input *ListAccountAliasesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccountAliases func (c *IAM) ListAccountAliases(input *ListAccountAliasesInput) (*ListAccountAliasesOutput, error) { req, out := c.ListAccountAliasesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAccountAliasesWithContext is the same as ListAccountAliases with the addition of +// the ability to pass a context and additional request options. +// +// See ListAccountAliases for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAccountAliasesWithContext(ctx aws.Context, input *ListAccountAliasesInput, opts ...request.Option) (*ListAccountAliasesOutput, error) { + req, out := c.ListAccountAliasesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListAccountAliasesPages iterates over the pages of a ListAccountAliases operation, @@ -5834,12 +6945,37 @@ func (c *IAM) ListAccountAliases(input *ListAccountAliasesInput) (*ListAccountAl // return pageNum <= 3 // }) // -func (c *IAM) ListAccountAliasesPages(input *ListAccountAliasesInput, fn func(p *ListAccountAliasesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAccountAliasesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAccountAliasesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAccountAliasesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAccountAliasesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAccountAliasesOutput), !p.HasNextPage()) + } + return p.Err() } const opListAttachedGroupPolicies = "ListAttachedGroupPolicies" @@ -5929,8 +7065,23 @@ func (c *IAM) ListAttachedGroupPoliciesRequest(input *ListAttachedGroupPoliciesI // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedGroupPolicies func (c *IAM) ListAttachedGroupPolicies(input *ListAttachedGroupPoliciesInput) (*ListAttachedGroupPoliciesOutput, error) { req, out := c.ListAttachedGroupPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAttachedGroupPoliciesWithContext is the same as ListAttachedGroupPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListAttachedGroupPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAttachedGroupPoliciesWithContext(ctx aws.Context, input *ListAttachedGroupPoliciesInput, opts ...request.Option) (*ListAttachedGroupPoliciesOutput, error) { + req, out := c.ListAttachedGroupPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListAttachedGroupPoliciesPages iterates over the pages of a ListAttachedGroupPolicies operation, @@ -5950,12 +7101,37 @@ func (c *IAM) ListAttachedGroupPolicies(input *ListAttachedGroupPoliciesInput) ( // return pageNum <= 3 // }) // -func (c *IAM) ListAttachedGroupPoliciesPages(input *ListAttachedGroupPoliciesInput, fn func(p *ListAttachedGroupPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAttachedGroupPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAttachedGroupPoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAttachedGroupPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAttachedGroupPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAttachedGroupPoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opListAttachedRolePolicies = "ListAttachedRolePolicies" @@ -6045,8 +7221,23 @@ func (c *IAM) ListAttachedRolePoliciesRequest(input *ListAttachedRolePoliciesInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedRolePolicies func (c *IAM) ListAttachedRolePolicies(input *ListAttachedRolePoliciesInput) (*ListAttachedRolePoliciesOutput, error) { req, out := c.ListAttachedRolePoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAttachedRolePoliciesWithContext is the same as ListAttachedRolePolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListAttachedRolePolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAttachedRolePoliciesWithContext(ctx aws.Context, input *ListAttachedRolePoliciesInput, opts ...request.Option) (*ListAttachedRolePoliciesOutput, error) { + req, out := c.ListAttachedRolePoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListAttachedRolePoliciesPages iterates over the pages of a ListAttachedRolePolicies operation, @@ -6066,12 +7257,37 @@ func (c *IAM) ListAttachedRolePolicies(input *ListAttachedRolePoliciesInput) (*L // return pageNum <= 3 // }) // -func (c *IAM) ListAttachedRolePoliciesPages(input *ListAttachedRolePoliciesInput, fn func(p *ListAttachedRolePoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAttachedRolePoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAttachedRolePoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAttachedRolePoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAttachedRolePoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAttachedRolePoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opListAttachedUserPolicies = "ListAttachedUserPolicies" @@ -6161,8 +7377,23 @@ func (c *IAM) ListAttachedUserPoliciesRequest(input *ListAttachedUserPoliciesInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedUserPolicies func (c *IAM) ListAttachedUserPolicies(input *ListAttachedUserPoliciesInput) (*ListAttachedUserPoliciesOutput, error) { req, out := c.ListAttachedUserPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAttachedUserPoliciesWithContext is the same as ListAttachedUserPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListAttachedUserPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAttachedUserPoliciesWithContext(ctx aws.Context, input *ListAttachedUserPoliciesInput, opts ...request.Option) (*ListAttachedUserPoliciesOutput, error) { + req, out := c.ListAttachedUserPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListAttachedUserPoliciesPages iterates over the pages of a ListAttachedUserPolicies operation, @@ -6182,12 +7413,37 @@ func (c *IAM) ListAttachedUserPolicies(input *ListAttachedUserPoliciesInput) (*L // return pageNum <= 3 // }) // -func (c *IAM) ListAttachedUserPoliciesPages(input *ListAttachedUserPoliciesInput, fn func(p *ListAttachedUserPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAttachedUserPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAttachedUserPoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAttachedUserPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAttachedUserPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAttachedUserPoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opListEntitiesForPolicy = "ListEntitiesForPolicy" @@ -6274,8 +7530,23 @@ func (c *IAM) ListEntitiesForPolicyRequest(input *ListEntitiesForPolicyInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListEntitiesForPolicy func (c *IAM) ListEntitiesForPolicy(input *ListEntitiesForPolicyInput) (*ListEntitiesForPolicyOutput, error) { req, out := c.ListEntitiesForPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListEntitiesForPolicyWithContext is the same as ListEntitiesForPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See ListEntitiesForPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListEntitiesForPolicyWithContext(ctx aws.Context, input *ListEntitiesForPolicyInput, opts ...request.Option) (*ListEntitiesForPolicyOutput, error) { + req, out := c.ListEntitiesForPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListEntitiesForPolicyPages iterates over the pages of a ListEntitiesForPolicy operation, @@ -6295,12 +7566,37 @@ func (c *IAM) ListEntitiesForPolicy(input *ListEntitiesForPolicyInput) (*ListEnt // return pageNum <= 3 // }) // -func (c *IAM) ListEntitiesForPolicyPages(input *ListEntitiesForPolicyInput, fn func(p *ListEntitiesForPolicyOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListEntitiesForPolicyRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListEntitiesForPolicyOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListEntitiesForPolicyInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListEntitiesForPolicyRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListEntitiesForPolicyOutput), !p.HasNextPage()) + } + return p.Err() } const opListGroupPolicies = "ListGroupPolicies" @@ -6386,8 +7682,23 @@ func (c *IAM) ListGroupPoliciesRequest(input *ListGroupPoliciesInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupPolicies func (c *IAM) ListGroupPolicies(input *ListGroupPoliciesInput) (*ListGroupPoliciesOutput, error) { req, out := c.ListGroupPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListGroupPoliciesWithContext is the same as ListGroupPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroupPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListGroupPoliciesWithContext(ctx aws.Context, input *ListGroupPoliciesInput, opts ...request.Option) (*ListGroupPoliciesOutput, error) { + req, out := c.ListGroupPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListGroupPoliciesPages iterates over the pages of a ListGroupPolicies operation, @@ -6407,12 +7718,37 @@ func (c *IAM) ListGroupPolicies(input *ListGroupPoliciesInput) (*ListGroupPolici // return pageNum <= 3 // }) // -func (c *IAM) ListGroupPoliciesPages(input *ListGroupPoliciesInput, fn func(p *ListGroupPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListGroupPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListGroupPoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListGroupPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListGroupPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListGroupPoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opListGroups = "ListGroups" @@ -6485,8 +7821,23 @@ func (c *IAM) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroups func (c *IAM) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) { req, out := c.ListGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListGroupsWithContext is the same as ListGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListGroupsWithContext(ctx aws.Context, input *ListGroupsInput, opts ...request.Option) (*ListGroupsOutput, error) { + req, out := c.ListGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListGroupsPages iterates over the pages of a ListGroups operation, @@ -6506,12 +7857,37 @@ func (c *IAM) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) { // return pageNum <= 3 // }) // -func (c *IAM) ListGroupsPages(input *ListGroupsInput, fn func(p *ListGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opListGroupsForUser = "ListGroupsForUser" @@ -6588,8 +7964,23 @@ func (c *IAM) ListGroupsForUserRequest(input *ListGroupsForUserInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsForUser func (c *IAM) ListGroupsForUser(input *ListGroupsForUserInput) (*ListGroupsForUserOutput, error) { req, out := c.ListGroupsForUserRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListGroupsForUserWithContext is the same as ListGroupsForUser with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroupsForUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListGroupsForUserWithContext(ctx aws.Context, input *ListGroupsForUserInput, opts ...request.Option) (*ListGroupsForUserOutput, error) { + req, out := c.ListGroupsForUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListGroupsForUserPages iterates over the pages of a ListGroupsForUser operation, @@ -6609,12 +8000,37 @@ func (c *IAM) ListGroupsForUser(input *ListGroupsForUserInput) (*ListGroupsForUs // return pageNum <= 3 // }) // -func (c *IAM) ListGroupsForUserPages(input *ListGroupsForUserInput, fn func(p *ListGroupsForUserOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListGroupsForUserRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListGroupsForUserOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListGroupsForUserInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListGroupsForUserRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListGroupsForUserOutput), !p.HasNextPage()) + } + return p.Err() } const opListInstanceProfiles = "ListInstanceProfiles" @@ -6689,8 +8105,23 @@ func (c *IAM) ListInstanceProfilesRequest(input *ListInstanceProfilesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfiles func (c *IAM) ListInstanceProfiles(input *ListInstanceProfilesInput) (*ListInstanceProfilesOutput, error) { req, out := c.ListInstanceProfilesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListInstanceProfilesWithContext is the same as ListInstanceProfiles with the addition of +// the ability to pass a context and additional request options. +// +// See ListInstanceProfiles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListInstanceProfilesWithContext(ctx aws.Context, input *ListInstanceProfilesInput, opts ...request.Option) (*ListInstanceProfilesOutput, error) { + req, out := c.ListInstanceProfilesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListInstanceProfilesPages iterates over the pages of a ListInstanceProfiles operation, @@ -6710,12 +8141,37 @@ func (c *IAM) ListInstanceProfiles(input *ListInstanceProfilesInput) (*ListInsta // return pageNum <= 3 // }) // -func (c *IAM) ListInstanceProfilesPages(input *ListInstanceProfilesInput, fn func(p *ListInstanceProfilesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstanceProfilesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstanceProfilesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInstanceProfilesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInstanceProfilesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListInstanceProfilesOutput), !p.HasNextPage()) + } + return p.Err() } const opListInstanceProfilesForRole = "ListInstanceProfilesForRole" @@ -6794,8 +8250,23 @@ func (c *IAM) ListInstanceProfilesForRoleRequest(input *ListInstanceProfilesForR // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesForRole func (c *IAM) ListInstanceProfilesForRole(input *ListInstanceProfilesForRoleInput) (*ListInstanceProfilesForRoleOutput, error) { req, out := c.ListInstanceProfilesForRoleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListInstanceProfilesForRoleWithContext is the same as ListInstanceProfilesForRole with the addition of +// the ability to pass a context and additional request options. +// +// See ListInstanceProfilesForRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListInstanceProfilesForRoleWithContext(ctx aws.Context, input *ListInstanceProfilesForRoleInput, opts ...request.Option) (*ListInstanceProfilesForRoleOutput, error) { + req, out := c.ListInstanceProfilesForRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListInstanceProfilesForRolePages iterates over the pages of a ListInstanceProfilesForRole operation, @@ -6815,12 +8286,37 @@ func (c *IAM) ListInstanceProfilesForRole(input *ListInstanceProfilesForRoleInpu // return pageNum <= 3 // }) // -func (c *IAM) ListInstanceProfilesForRolePages(input *ListInstanceProfilesForRoleInput, fn func(p *ListInstanceProfilesForRoleOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstanceProfilesForRoleRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstanceProfilesForRoleOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInstanceProfilesForRoleInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInstanceProfilesForRoleRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListInstanceProfilesForRoleOutput), !p.HasNextPage()) + } + return p.Err() } const opListMFADevices = "ListMFADevices" @@ -6900,8 +8396,23 @@ func (c *IAM) ListMFADevicesRequest(input *ListMFADevicesInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListMFADevices func (c *IAM) ListMFADevices(input *ListMFADevicesInput) (*ListMFADevicesOutput, error) { req, out := c.ListMFADevicesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListMFADevicesWithContext is the same as ListMFADevices with the addition of +// the ability to pass a context and additional request options. +// +// See ListMFADevices for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListMFADevicesWithContext(ctx aws.Context, input *ListMFADevicesInput, opts ...request.Option) (*ListMFADevicesOutput, error) { + req, out := c.ListMFADevicesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListMFADevicesPages iterates over the pages of a ListMFADevices operation, @@ -6921,12 +8432,37 @@ func (c *IAM) ListMFADevices(input *ListMFADevicesInput) (*ListMFADevicesOutput, // return pageNum <= 3 // }) // -func (c *IAM) ListMFADevicesPages(input *ListMFADevicesInput, fn func(p *ListMFADevicesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListMFADevicesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListMFADevicesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMFADevicesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMFADevicesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListMFADevicesOutput), !p.HasNextPage()) + } + return p.Err() } const opListOpenIDConnectProviders = "ListOpenIDConnectProviders" @@ -6992,8 +8528,23 @@ func (c *IAM) ListOpenIDConnectProvidersRequest(input *ListOpenIDConnectProvider // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListOpenIDConnectProviders func (c *IAM) ListOpenIDConnectProviders(input *ListOpenIDConnectProvidersInput) (*ListOpenIDConnectProvidersOutput, error) { req, out := c.ListOpenIDConnectProvidersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListOpenIDConnectProvidersWithContext is the same as ListOpenIDConnectProviders with the addition of +// the ability to pass a context and additional request options. +// +// See ListOpenIDConnectProviders for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListOpenIDConnectProvidersWithContext(ctx aws.Context, input *ListOpenIDConnectProvidersInput, opts ...request.Option) (*ListOpenIDConnectProvidersOutput, error) { + req, out := c.ListOpenIDConnectProvidersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListPolicies = "ListPolicies" @@ -7076,8 +8627,23 @@ func (c *IAM) ListPoliciesRequest(input *ListPoliciesInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicies func (c *IAM) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error) { req, out := c.ListPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPoliciesWithContext is the same as ListPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPoliciesWithContext(ctx aws.Context, input *ListPoliciesInput, opts ...request.Option) (*ListPoliciesOutput, error) { + req, out := c.ListPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListPoliciesPages iterates over the pages of a ListPolicies operation, @@ -7097,12 +8663,37 @@ func (c *IAM) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error // return pageNum <= 3 // }) // -func (c *IAM) ListPoliciesPages(input *ListPoliciesInput, fn func(p *ListPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opListPolicyVersions = "ListPolicyVersions" @@ -7186,8 +8777,23 @@ func (c *IAM) ListPolicyVersionsRequest(input *ListPolicyVersionsInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersions func (c *IAM) ListPolicyVersions(input *ListPolicyVersionsInput) (*ListPolicyVersionsOutput, error) { req, out := c.ListPolicyVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPolicyVersionsWithContext is the same as ListPolicyVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListPolicyVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPolicyVersionsWithContext(ctx aws.Context, input *ListPolicyVersionsInput, opts ...request.Option) (*ListPolicyVersionsOutput, error) { + req, out := c.ListPolicyVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListPolicyVersionsPages iterates over the pages of a ListPolicyVersions operation, @@ -7207,12 +8813,37 @@ func (c *IAM) ListPolicyVersions(input *ListPolicyVersionsInput) (*ListPolicyVer // return pageNum <= 3 // }) // -func (c *IAM) ListPolicyVersionsPages(input *ListPolicyVersionsInput, fn func(p *ListPolicyVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPolicyVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPolicyVersionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPolicyVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPolicyVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPolicyVersionsOutput), !p.HasNextPage()) + } + return p.Err() } const opListRolePolicies = "ListRolePolicies" @@ -7297,8 +8928,23 @@ func (c *IAM) ListRolePoliciesRequest(input *ListRolePoliciesInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolePolicies func (c *IAM) ListRolePolicies(input *ListRolePoliciesInput) (*ListRolePoliciesOutput, error) { req, out := c.ListRolePoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListRolePoliciesWithContext is the same as ListRolePolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListRolePolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListRolePoliciesWithContext(ctx aws.Context, input *ListRolePoliciesInput, opts ...request.Option) (*ListRolePoliciesOutput, error) { + req, out := c.ListRolePoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListRolePoliciesPages iterates over the pages of a ListRolePolicies operation, @@ -7318,12 +8964,37 @@ func (c *IAM) ListRolePolicies(input *ListRolePoliciesInput) (*ListRolePoliciesO // return pageNum <= 3 // }) // -func (c *IAM) ListRolePoliciesPages(input *ListRolePoliciesInput, fn func(p *ListRolePoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListRolePoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListRolePoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListRolePoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListRolePoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListRolePoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opListRoles = "ListRoles" @@ -7398,8 +9069,23 @@ func (c *IAM) ListRolesRequest(input *ListRolesInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRoles func (c *IAM) ListRoles(input *ListRolesInput) (*ListRolesOutput, error) { req, out := c.ListRolesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListRolesWithContext is the same as ListRoles with the addition of +// the ability to pass a context and additional request options. +// +// See ListRoles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListRolesWithContext(ctx aws.Context, input *ListRolesInput, opts ...request.Option) (*ListRolesOutput, error) { + req, out := c.ListRolesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListRolesPages iterates over the pages of a ListRoles operation, @@ -7419,12 +9105,37 @@ func (c *IAM) ListRoles(input *ListRolesInput) (*ListRolesOutput, error) { // return pageNum <= 3 // }) // -func (c *IAM) ListRolesPages(input *ListRolesInput, fn func(p *ListRolesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListRolesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListRolesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListRolesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListRolesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListRolesOutput), !p.HasNextPage()) + } + return p.Err() } const opListSAMLProviders = "ListSAMLProviders" @@ -7491,8 +9202,23 @@ func (c *IAM) ListSAMLProvidersRequest(input *ListSAMLProvidersInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSAMLProviders func (c *IAM) ListSAMLProviders(input *ListSAMLProvidersInput) (*ListSAMLProvidersOutput, error) { req, out := c.ListSAMLProvidersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListSAMLProvidersWithContext is the same as ListSAMLProviders with the addition of +// the ability to pass a context and additional request options. +// +// See ListSAMLProviders for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListSAMLProvidersWithContext(ctx aws.Context, input *ListSAMLProvidersInput, opts ...request.Option) (*ListSAMLProvidersOutput, error) { + req, out := c.ListSAMLProvidersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListSSHPublicKeys = "ListSSHPublicKeys" @@ -7573,8 +9299,23 @@ func (c *IAM) ListSSHPublicKeysRequest(input *ListSSHPublicKeysInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSSHPublicKeys func (c *IAM) ListSSHPublicKeys(input *ListSSHPublicKeysInput) (*ListSSHPublicKeysOutput, error) { req, out := c.ListSSHPublicKeysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListSSHPublicKeysWithContext is the same as ListSSHPublicKeys with the addition of +// the ability to pass a context and additional request options. +// +// See ListSSHPublicKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListSSHPublicKeysWithContext(ctx aws.Context, input *ListSSHPublicKeysInput, opts ...request.Option) (*ListSSHPublicKeysOutput, error) { + req, out := c.ListSSHPublicKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListSSHPublicKeysPages iterates over the pages of a ListSSHPublicKeys operation, @@ -7594,12 +9335,37 @@ func (c *IAM) ListSSHPublicKeys(input *ListSSHPublicKeysInput) (*ListSSHPublicKe // return pageNum <= 3 // }) // -func (c *IAM) ListSSHPublicKeysPages(input *ListSSHPublicKeysInput, fn func(p *ListSSHPublicKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListSSHPublicKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListSSHPublicKeysOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListSSHPublicKeysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListSSHPublicKeysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListSSHPublicKeysOutput), !p.HasNextPage()) + } + return p.Err() } const opListServerCertificates = "ListServerCertificates" @@ -7678,8 +9444,23 @@ func (c *IAM) ListServerCertificatesRequest(input *ListServerCertificatesInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServerCertificates func (c *IAM) ListServerCertificates(input *ListServerCertificatesInput) (*ListServerCertificatesOutput, error) { req, out := c.ListServerCertificatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListServerCertificatesWithContext is the same as ListServerCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See ListServerCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListServerCertificatesWithContext(ctx aws.Context, input *ListServerCertificatesInput, opts ...request.Option) (*ListServerCertificatesOutput, error) { + req, out := c.ListServerCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListServerCertificatesPages iterates over the pages of a ListServerCertificates operation, @@ -7699,12 +9480,37 @@ func (c *IAM) ListServerCertificates(input *ListServerCertificatesInput) (*ListS // return pageNum <= 3 // }) // -func (c *IAM) ListServerCertificatesPages(input *ListServerCertificatesInput, fn func(p *ListServerCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListServerCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListServerCertificatesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListServerCertificatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListServerCertificatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListServerCertificatesOutput), !p.HasNextPage()) + } + return p.Err() } const opListServiceSpecificCredentials = "ListServiceSpecificCredentials" @@ -7778,8 +9584,23 @@ func (c *IAM) ListServiceSpecificCredentialsRequest(input *ListServiceSpecificCr // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServiceSpecificCredentials func (c *IAM) ListServiceSpecificCredentials(input *ListServiceSpecificCredentialsInput) (*ListServiceSpecificCredentialsOutput, error) { req, out := c.ListServiceSpecificCredentialsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListServiceSpecificCredentialsWithContext is the same as ListServiceSpecificCredentials with the addition of +// the ability to pass a context and additional request options. +// +// See ListServiceSpecificCredentials for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListServiceSpecificCredentialsWithContext(ctx aws.Context, input *ListServiceSpecificCredentialsInput, opts ...request.Option) (*ListServiceSpecificCredentialsOutput, error) { + req, out := c.ListServiceSpecificCredentialsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListSigningCertificates = "ListSigningCertificates" @@ -7864,8 +9685,23 @@ func (c *IAM) ListSigningCertificatesRequest(input *ListSigningCertificatesInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSigningCertificates func (c *IAM) ListSigningCertificates(input *ListSigningCertificatesInput) (*ListSigningCertificatesOutput, error) { req, out := c.ListSigningCertificatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListSigningCertificatesWithContext is the same as ListSigningCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See ListSigningCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListSigningCertificatesWithContext(ctx aws.Context, input *ListSigningCertificatesInput, opts ...request.Option) (*ListSigningCertificatesOutput, error) { + req, out := c.ListSigningCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListSigningCertificatesPages iterates over the pages of a ListSigningCertificates operation, @@ -7885,12 +9721,37 @@ func (c *IAM) ListSigningCertificates(input *ListSigningCertificatesInput) (*Lis // return pageNum <= 3 // }) // -func (c *IAM) ListSigningCertificatesPages(input *ListSigningCertificatesInput, fn func(p *ListSigningCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListSigningCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListSigningCertificatesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListSigningCertificatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListSigningCertificatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListSigningCertificatesOutput), !p.HasNextPage()) + } + return p.Err() } const opListUserPolicies = "ListUserPolicies" @@ -7974,8 +9835,23 @@ func (c *IAM) ListUserPoliciesRequest(input *ListUserPoliciesInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUserPolicies func (c *IAM) ListUserPolicies(input *ListUserPoliciesInput) (*ListUserPoliciesOutput, error) { req, out := c.ListUserPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListUserPoliciesWithContext is the same as ListUserPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListUserPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListUserPoliciesWithContext(ctx aws.Context, input *ListUserPoliciesInput, opts ...request.Option) (*ListUserPoliciesOutput, error) { + req, out := c.ListUserPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListUserPoliciesPages iterates over the pages of a ListUserPolicies operation, @@ -7995,12 +9871,37 @@ func (c *IAM) ListUserPolicies(input *ListUserPoliciesInput) (*ListUserPoliciesO // return pageNum <= 3 // }) // -func (c *IAM) ListUserPoliciesPages(input *ListUserPoliciesInput, fn func(p *ListUserPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListUserPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListUserPoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUserPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUserPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListUserPoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opListUsers = "ListUsers" @@ -8075,8 +9976,23 @@ func (c *IAM) ListUsersRequest(input *ListUsersInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUsers func (c *IAM) ListUsers(input *ListUsersInput) (*ListUsersOutput, error) { req, out := c.ListUsersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListUsersWithContext is the same as ListUsers with the addition of +// the ability to pass a context and additional request options. +// +// See ListUsers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListUsersWithContext(ctx aws.Context, input *ListUsersInput, opts ...request.Option) (*ListUsersOutput, error) { + req, out := c.ListUsersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListUsersPages iterates over the pages of a ListUsers operation, @@ -8096,12 +10012,37 @@ func (c *IAM) ListUsers(input *ListUsersInput) (*ListUsersOutput, error) { // return pageNum <= 3 // }) // -func (c *IAM) ListUsersPages(input *ListUsersInput, fn func(p *ListUsersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListUsersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListUsersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUsersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUsersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) + } + return p.Err() } const opListVirtualMFADevices = "ListVirtualMFADevices" @@ -8171,8 +10112,23 @@ func (c *IAM) ListVirtualMFADevicesRequest(input *ListVirtualMFADevicesInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListVirtualMFADevices func (c *IAM) ListVirtualMFADevices(input *ListVirtualMFADevicesInput) (*ListVirtualMFADevicesOutput, error) { req, out := c.ListVirtualMFADevicesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListVirtualMFADevicesWithContext is the same as ListVirtualMFADevices with the addition of +// the ability to pass a context and additional request options. +// +// See ListVirtualMFADevices for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListVirtualMFADevicesWithContext(ctx aws.Context, input *ListVirtualMFADevicesInput, opts ...request.Option) (*ListVirtualMFADevicesOutput, error) { + req, out := c.ListVirtualMFADevicesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListVirtualMFADevicesPages iterates over the pages of a ListVirtualMFADevices operation, @@ -8192,12 +10148,37 @@ func (c *IAM) ListVirtualMFADevices(input *ListVirtualMFADevicesInput) (*ListVir // return pageNum <= 3 // }) // -func (c *IAM) ListVirtualMFADevicesPages(input *ListVirtualMFADevicesInput, fn func(p *ListVirtualMFADevicesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListVirtualMFADevicesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListVirtualMFADevicesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListVirtualMFADevicesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListVirtualMFADevicesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListVirtualMFADevicesOutput), !p.HasNextPage()) + } + return p.Err() } const opPutGroupPolicy = "PutGroupPolicy" @@ -8292,8 +10273,23 @@ func (c *IAM) PutGroupPolicyRequest(input *PutGroupPolicyInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutGroupPolicy func (c *IAM) PutGroupPolicy(input *PutGroupPolicyInput) (*PutGroupPolicyOutput, error) { req, out := c.PutGroupPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutGroupPolicyWithContext is the same as PutGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutGroupPolicyWithContext(ctx aws.Context, input *PutGroupPolicyInput, opts ...request.Option) (*PutGroupPolicyOutput, error) { + req, out := c.PutGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutRolePolicy = "PutRolePolicy" @@ -8394,8 +10390,23 @@ func (c *IAM) PutRolePolicyRequest(input *PutRolePolicyInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutRolePolicy func (c *IAM) PutRolePolicy(input *PutRolePolicyInput) (*PutRolePolicyOutput, error) { req, out := c.PutRolePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutRolePolicyWithContext is the same as PutRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutRolePolicyWithContext(ctx aws.Context, input *PutRolePolicyInput, opts ...request.Option) (*PutRolePolicyOutput, error) { + req, out := c.PutRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutUserPolicy = "PutUserPolicy" @@ -8490,8 +10501,23 @@ func (c *IAM) PutUserPolicyRequest(input *PutUserPolicyInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutUserPolicy func (c *IAM) PutUserPolicy(input *PutUserPolicyInput) (*PutUserPolicyOutput, error) { req, out := c.PutUserPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutUserPolicyWithContext is the same as PutUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutUserPolicyWithContext(ctx aws.Context, input *PutUserPolicyInput, opts ...request.Option) (*PutUserPolicyOutput, error) { + req, out := c.PutUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveClientIDFromOpenIDConnectProvider = "RemoveClientIDFromOpenIDConnectProvider" @@ -8571,8 +10597,23 @@ func (c *IAM) RemoveClientIDFromOpenIDConnectProviderRequest(input *RemoveClient // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveClientIDFromOpenIDConnectProvider func (c *IAM) RemoveClientIDFromOpenIDConnectProvider(input *RemoveClientIDFromOpenIDConnectProviderInput) (*RemoveClientIDFromOpenIDConnectProviderOutput, error) { req, out := c.RemoveClientIDFromOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveClientIDFromOpenIDConnectProviderWithContext is the same as RemoveClientIDFromOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveClientIDFromOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveClientIDFromOpenIDConnectProviderWithContext(ctx aws.Context, input *RemoveClientIDFromOpenIDConnectProviderInput, opts ...request.Option) (*RemoveClientIDFromOpenIDConnectProviderOutput, error) { + req, out := c.RemoveClientIDFromOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveRoleFromInstanceProfile = "RemoveRoleFromInstanceProfile" @@ -8656,8 +10697,23 @@ func (c *IAM) RemoveRoleFromInstanceProfileRequest(input *RemoveRoleFromInstance // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveRoleFromInstanceProfile func (c *IAM) RemoveRoleFromInstanceProfile(input *RemoveRoleFromInstanceProfileInput) (*RemoveRoleFromInstanceProfileOutput, error) { req, out := c.RemoveRoleFromInstanceProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveRoleFromInstanceProfileWithContext is the same as RemoveRoleFromInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveRoleFromInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveRoleFromInstanceProfileWithContext(ctx aws.Context, input *RemoveRoleFromInstanceProfileInput, opts ...request.Option) (*RemoveRoleFromInstanceProfileOutput, error) { + req, out := c.RemoveRoleFromInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveUserFromGroup = "RemoveUserFromGroup" @@ -8732,8 +10788,23 @@ func (c *IAM) RemoveUserFromGroupRequest(input *RemoveUserFromGroupInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveUserFromGroup func (c *IAM) RemoveUserFromGroup(input *RemoveUserFromGroupInput) (*RemoveUserFromGroupOutput, error) { req, out := c.RemoveUserFromGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveUserFromGroupWithContext is the same as RemoveUserFromGroup with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveUserFromGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveUserFromGroupWithContext(ctx aws.Context, input *RemoveUserFromGroupInput, opts ...request.Option) (*RemoveUserFromGroupOutput, error) { + req, out := c.RemoveUserFromGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResetServiceSpecificCredential = "ResetServiceSpecificCredential" @@ -8801,8 +10872,23 @@ func (c *IAM) ResetServiceSpecificCredentialRequest(input *ResetServiceSpecificC // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResetServiceSpecificCredential func (c *IAM) ResetServiceSpecificCredential(input *ResetServiceSpecificCredentialInput) (*ResetServiceSpecificCredentialOutput, error) { req, out := c.ResetServiceSpecificCredentialRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResetServiceSpecificCredentialWithContext is the same as ResetServiceSpecificCredential with the addition of +// the ability to pass a context and additional request options. +// +// See ResetServiceSpecificCredential for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResetServiceSpecificCredentialWithContext(ctx aws.Context, input *ResetServiceSpecificCredentialInput, opts ...request.Option) (*ResetServiceSpecificCredentialOutput, error) { + req, out := c.ResetServiceSpecificCredentialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResyncMFADevice = "ResyncMFADevice" @@ -8886,8 +10972,23 @@ func (c *IAM) ResyncMFADeviceRequest(input *ResyncMFADeviceInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResyncMFADevice func (c *IAM) ResyncMFADevice(input *ResyncMFADeviceInput) (*ResyncMFADeviceOutput, error) { req, out := c.ResyncMFADeviceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResyncMFADeviceWithContext is the same as ResyncMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See ResyncMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResyncMFADeviceWithContext(ctx aws.Context, input *ResyncMFADeviceInput, opts ...request.Option) (*ResyncMFADeviceOutput, error) { + req, out := c.ResyncMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetDefaultPolicyVersion = "SetDefaultPolicyVersion" @@ -8975,8 +11076,23 @@ func (c *IAM) SetDefaultPolicyVersionRequest(input *SetDefaultPolicyVersionInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SetDefaultPolicyVersion func (c *IAM) SetDefaultPolicyVersion(input *SetDefaultPolicyVersionInput) (*SetDefaultPolicyVersionOutput, error) { req, out := c.SetDefaultPolicyVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetDefaultPolicyVersionWithContext is the same as SetDefaultPolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See SetDefaultPolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetDefaultPolicyVersionWithContext(ctx aws.Context, input *SetDefaultPolicyVersionInput, opts ...request.Option) (*SetDefaultPolicyVersionOutput, error) { + req, out := c.SetDefaultPolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSimulateCustomPolicy = "SimulateCustomPolicy" @@ -9067,8 +11183,23 @@ func (c *IAM) SimulateCustomPolicyRequest(input *SimulateCustomPolicyInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulateCustomPolicy func (c *IAM) SimulateCustomPolicy(input *SimulateCustomPolicyInput) (*SimulatePolicyResponse, error) { req, out := c.SimulateCustomPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SimulateCustomPolicyWithContext is the same as SimulateCustomPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See SimulateCustomPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SimulateCustomPolicyWithContext(ctx aws.Context, input *SimulateCustomPolicyInput, opts ...request.Option) (*SimulatePolicyResponse, error) { + req, out := c.SimulateCustomPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // SimulateCustomPolicyPages iterates over the pages of a SimulateCustomPolicy operation, @@ -9088,12 +11219,37 @@ func (c *IAM) SimulateCustomPolicy(input *SimulateCustomPolicyInput) (*SimulateP // return pageNum <= 3 // }) // -func (c *IAM) SimulateCustomPolicyPages(input *SimulateCustomPolicyInput, fn func(p *SimulatePolicyResponse, lastPage bool) (shouldContinue bool)) error { - page, _ := c.SimulateCustomPolicyRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*SimulatePolicyResponse), lastPage) - }) +func (c *IAM) SimulateCustomPolicyPages(input *SimulateCustomPolicyInput, fn func(*SimulatePolicyResponse, 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(*SimulatePolicyResponse, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SimulateCustomPolicyInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SimulateCustomPolicyRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*SimulatePolicyResponse), !p.HasNextPage()) + } + return p.Err() } const opSimulatePrincipalPolicy = "SimulatePrincipalPolicy" @@ -9198,8 +11354,23 @@ func (c *IAM) SimulatePrincipalPolicyRequest(input *SimulatePrincipalPolicyInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulatePrincipalPolicy func (c *IAM) SimulatePrincipalPolicy(input *SimulatePrincipalPolicyInput) (*SimulatePolicyResponse, error) { req, out := c.SimulatePrincipalPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SimulatePrincipalPolicyWithContext is the same as SimulatePrincipalPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See SimulatePrincipalPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SimulatePrincipalPolicyWithContext(ctx aws.Context, input *SimulatePrincipalPolicyInput, opts ...request.Option) (*SimulatePolicyResponse, error) { + req, out := c.SimulatePrincipalPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // SimulatePrincipalPolicyPages iterates over the pages of a SimulatePrincipalPolicy operation, @@ -9219,12 +11390,37 @@ func (c *IAM) SimulatePrincipalPolicy(input *SimulatePrincipalPolicyInput) (*Sim // return pageNum <= 3 // }) // -func (c *IAM) SimulatePrincipalPolicyPages(input *SimulatePrincipalPolicyInput, fn func(p *SimulatePolicyResponse, lastPage bool) (shouldContinue bool)) error { - page, _ := c.SimulatePrincipalPolicyRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*SimulatePolicyResponse), lastPage) - }) +func (c *IAM) SimulatePrincipalPolicyPages(input *SimulatePrincipalPolicyInput, fn func(*SimulatePolicyResponse, 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(*SimulatePolicyResponse, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SimulatePrincipalPolicyInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SimulatePrincipalPolicyRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*SimulatePolicyResponse), !p.HasNextPage()) + } + return p.Err() } const opUpdateAccessKey = "UpdateAccessKey" @@ -9309,8 +11505,23 @@ func (c *IAM) UpdateAccessKeyRequest(input *UpdateAccessKeyInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccessKey func (c *IAM) UpdateAccessKey(input *UpdateAccessKeyInput) (*UpdateAccessKeyOutput, error) { req, out := c.UpdateAccessKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAccessKeyWithContext is the same as UpdateAccessKey with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAccessKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAccessKeyWithContext(ctx aws.Context, input *UpdateAccessKeyInput, opts ...request.Option) (*UpdateAccessKeyOutput, error) { + req, out := c.UpdateAccessKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAccountPasswordPolicy = "UpdateAccountPasswordPolicy" @@ -9398,8 +11609,23 @@ func (c *IAM) UpdateAccountPasswordPolicyRequest(input *UpdateAccountPasswordPol // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccountPasswordPolicy func (c *IAM) UpdateAccountPasswordPolicy(input *UpdateAccountPasswordPolicyInput) (*UpdateAccountPasswordPolicyOutput, error) { req, out := c.UpdateAccountPasswordPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAccountPasswordPolicyWithContext is the same as UpdateAccountPasswordPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAccountPasswordPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAccountPasswordPolicyWithContext(ctx aws.Context, input *UpdateAccountPasswordPolicyInput, opts ...request.Option) (*UpdateAccountPasswordPolicyOutput, error) { + req, out := c.UpdateAccountPasswordPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAssumeRolePolicy = "UpdateAssumeRolePolicy" @@ -9481,8 +11707,23 @@ func (c *IAM) UpdateAssumeRolePolicyRequest(input *UpdateAssumeRolePolicyInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAssumeRolePolicy func (c *IAM) UpdateAssumeRolePolicy(input *UpdateAssumeRolePolicyInput) (*UpdateAssumeRolePolicyOutput, error) { req, out := c.UpdateAssumeRolePolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAssumeRolePolicyWithContext is the same as UpdateAssumeRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAssumeRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAssumeRolePolicyWithContext(ctx aws.Context, input *UpdateAssumeRolePolicyInput, opts ...request.Option) (*UpdateAssumeRolePolicyOutput, error) { + req, out := c.UpdateAssumeRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateGroup = "UpdateGroup" @@ -9571,8 +11812,23 @@ func (c *IAM) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateGroup func (c *IAM) UpdateGroup(input *UpdateGroupInput) (*UpdateGroupOutput, error) { req, out := c.UpdateGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateGroupWithContext is the same as UpdateGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateGroupWithContext(ctx aws.Context, input *UpdateGroupInput, opts ...request.Option) (*UpdateGroupOutput, error) { + req, out := c.UpdateGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateLoginProfile = "UpdateLoginProfile" @@ -9661,8 +11917,23 @@ func (c *IAM) UpdateLoginProfileRequest(input *UpdateLoginProfileInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateLoginProfile func (c *IAM) UpdateLoginProfile(input *UpdateLoginProfileInput) (*UpdateLoginProfileOutput, error) { req, out := c.UpdateLoginProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateLoginProfileWithContext is the same as UpdateLoginProfile with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateLoginProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateLoginProfileWithContext(ctx aws.Context, input *UpdateLoginProfileInput, opts ...request.Option) (*UpdateLoginProfileOutput, error) { + req, out := c.UpdateLoginProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateOpenIDConnectProviderThumbprint = "UpdateOpenIDConnectProviderThumbprint" @@ -9751,8 +12022,23 @@ func (c *IAM) UpdateOpenIDConnectProviderThumbprintRequest(input *UpdateOpenIDCo // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateOpenIDConnectProviderThumbprint func (c *IAM) UpdateOpenIDConnectProviderThumbprint(input *UpdateOpenIDConnectProviderThumbprintInput) (*UpdateOpenIDConnectProviderThumbprintOutput, error) { req, out := c.UpdateOpenIDConnectProviderThumbprintRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateOpenIDConnectProviderThumbprintWithContext is the same as UpdateOpenIDConnectProviderThumbprint with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateOpenIDConnectProviderThumbprint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateOpenIDConnectProviderThumbprintWithContext(ctx aws.Context, input *UpdateOpenIDConnectProviderThumbprintInput, opts ...request.Option) (*UpdateOpenIDConnectProviderThumbprintOutput, error) { + req, out := c.UpdateOpenIDConnectProviderThumbprintRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateSAMLProvider = "UpdateSAMLProvider" @@ -9831,8 +12117,23 @@ func (c *IAM) UpdateSAMLProviderRequest(input *UpdateSAMLProviderInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSAMLProvider func (c *IAM) UpdateSAMLProvider(input *UpdateSAMLProviderInput) (*UpdateSAMLProviderOutput, error) { req, out := c.UpdateSAMLProviderRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateSAMLProviderWithContext is the same as UpdateSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateSAMLProviderWithContext(ctx aws.Context, input *UpdateSAMLProviderInput, opts ...request.Option) (*UpdateSAMLProviderOutput, error) { + req, out := c.UpdateSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateSSHPublicKey = "UpdateSSHPublicKey" @@ -9908,8 +12209,23 @@ func (c *IAM) UpdateSSHPublicKeyRequest(input *UpdateSSHPublicKeyInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSSHPublicKey func (c *IAM) UpdateSSHPublicKey(input *UpdateSSHPublicKeyInput) (*UpdateSSHPublicKeyOutput, error) { req, out := c.UpdateSSHPublicKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateSSHPublicKeyWithContext is the same as UpdateSSHPublicKey with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSSHPublicKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateSSHPublicKeyWithContext(ctx aws.Context, input *UpdateSSHPublicKeyInput, opts ...request.Option) (*UpdateSSHPublicKeyOutput, error) { + req, out := c.UpdateSSHPublicKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateServerCertificate = "UpdateServerCertificate" @@ -10006,8 +12322,23 @@ func (c *IAM) UpdateServerCertificateRequest(input *UpdateServerCertificateInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServerCertificate func (c *IAM) UpdateServerCertificate(input *UpdateServerCertificateInput) (*UpdateServerCertificateOutput, error) { req, out := c.UpdateServerCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateServerCertificateWithContext is the same as UpdateServerCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateServerCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateServerCertificateWithContext(ctx aws.Context, input *UpdateServerCertificateInput, opts ...request.Option) (*UpdateServerCertificateOutput, error) { + req, out := c.UpdateServerCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateServiceSpecificCredential = "UpdateServiceSpecificCredential" @@ -10077,8 +12408,23 @@ func (c *IAM) UpdateServiceSpecificCredentialRequest(input *UpdateServiceSpecifi // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServiceSpecificCredential func (c *IAM) UpdateServiceSpecificCredential(input *UpdateServiceSpecificCredentialInput) (*UpdateServiceSpecificCredentialOutput, error) { req, out := c.UpdateServiceSpecificCredentialRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateServiceSpecificCredentialWithContext is the same as UpdateServiceSpecificCredential with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateServiceSpecificCredential for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateServiceSpecificCredentialWithContext(ctx aws.Context, input *UpdateServiceSpecificCredentialInput, opts ...request.Option) (*UpdateServiceSpecificCredentialOutput, error) { + req, out := c.UpdateServiceSpecificCredentialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateSigningCertificate = "UpdateSigningCertificate" @@ -10160,8 +12506,23 @@ func (c *IAM) UpdateSigningCertificateRequest(input *UpdateSigningCertificateInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSigningCertificate func (c *IAM) UpdateSigningCertificate(input *UpdateSigningCertificateInput) (*UpdateSigningCertificateOutput, error) { req, out := c.UpdateSigningCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateSigningCertificateWithContext is the same as UpdateSigningCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSigningCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateSigningCertificateWithContext(ctx aws.Context, input *UpdateSigningCertificateInput, opts ...request.Option) (*UpdateSigningCertificateOutput, error) { + req, out := c.UpdateSigningCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateUser = "UpdateUser" @@ -10257,8 +12618,23 @@ func (c *IAM) UpdateUserRequest(input *UpdateUserInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateUser func (c *IAM) UpdateUser(input *UpdateUserInput) (*UpdateUserOutput, error) { req, out := c.UpdateUserRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateUserWithContext is the same as UpdateUser with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateUserWithContext(ctx aws.Context, input *UpdateUserInput, opts ...request.Option) (*UpdateUserOutput, error) { + req, out := c.UpdateUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUploadSSHPublicKey = "UploadSSHPublicKey" @@ -10345,8 +12721,23 @@ func (c *IAM) UploadSSHPublicKeyRequest(input *UploadSSHPublicKeyInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSSHPublicKey func (c *IAM) UploadSSHPublicKey(input *UploadSSHPublicKeyInput) (*UploadSSHPublicKeyOutput, error) { req, out := c.UploadSSHPublicKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UploadSSHPublicKeyWithContext is the same as UploadSSHPublicKey with the addition of +// the ability to pass a context and additional request options. +// +// See UploadSSHPublicKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UploadSSHPublicKeyWithContext(ctx aws.Context, input *UploadSSHPublicKeyInput, opts ...request.Option) (*UploadSSHPublicKeyOutput, error) { + req, out := c.UploadSSHPublicKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUploadServerCertificate = "UploadServerCertificate" @@ -10452,8 +12843,23 @@ func (c *IAM) UploadServerCertificateRequest(input *UploadServerCertificateInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadServerCertificate func (c *IAM) UploadServerCertificate(input *UploadServerCertificateInput) (*UploadServerCertificateOutput, error) { req, out := c.UploadServerCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UploadServerCertificateWithContext is the same as UploadServerCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See UploadServerCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UploadServerCertificateWithContext(ctx aws.Context, input *UploadServerCertificateInput, opts ...request.Option) (*UploadServerCertificateOutput, error) { + req, out := c.UploadServerCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUploadSigningCertificate = "UploadSigningCertificate" @@ -10557,8 +12963,23 @@ func (c *IAM) UploadSigningCertificateRequest(input *UploadSigningCertificateInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSigningCertificate func (c *IAM) UploadSigningCertificate(input *UploadSigningCertificateInput) (*UploadSigningCertificateOutput, error) { req, out := c.UploadSigningCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UploadSigningCertificateWithContext is the same as UploadSigningCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See UploadSigningCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UploadSigningCertificateWithContext(ctx aws.Context, input *UploadSigningCertificateInput, opts ...request.Option) (*UploadSigningCertificateOutput, error) { + req, out := c.UploadSigningCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Contains information about an AWS access key. diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go b/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go index 26c2534bf..fd2303523 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package iam diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/service.go b/vendor/github.com/aws/aws-sdk-go/service/iam/service.go index 1942ec03e..73ea1bac2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package iam diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/iam/waiters.go index 9231bf0bd..8bf5129cb 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package iam import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilInstanceProfileExists uses the IAM API operation @@ -11,32 +14,50 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *IAM) WaitUntilInstanceProfileExists(input *GetInstanceProfileInput) error { - waiterCfg := waiter.Config{ - Operation: "GetInstanceProfile", - Delay: 1, + return c.WaitUntilInstanceProfileExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceProfileExistsWithContext is an extended version of WaitUntilInstanceProfileExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceProfileExistsWithContext(ctx aws.Context, input *GetInstanceProfileInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceProfileExists", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(1 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "retry", - Matcher: "status", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 404, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetInstanceProfileInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetInstanceProfileRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilUserExists uses the IAM API operation @@ -44,30 +65,48 @@ func (c *IAM) WaitUntilInstanceProfileExists(input *GetInstanceProfileInput) err // If the condition is not meet within the max attempt window an error will // be returned. func (c *IAM) WaitUntilUserExists(input *GetUserInput) error { - waiterCfg := waiter.Config{ - Operation: "GetUser", - Delay: 1, + return c.WaitUntilUserExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilUserExistsWithContext is an extended version of WaitUntilUserExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilUserExistsWithContext(ctx aws.Context, input *GetUserInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilUserExists", MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(1 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "NoSuchEntity", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetUserInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetUserRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go b/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go index a81c6b062..51aa84dbe 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package inspector provides a client for Amazon Inspector. package inspector @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -86,8 +87,23 @@ func (c *Inspector) AddAttributesToFindingsRequest(input *AddAttributesToFinding // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindings func (c *Inspector) AddAttributesToFindings(input *AddAttributesToFindingsInput) (*AddAttributesToFindingsOutput, error) { req, out := c.AddAttributesToFindingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddAttributesToFindingsWithContext is the same as AddAttributesToFindings with the addition of +// the ability to pass a context and additional request options. +// +// See AddAttributesToFindings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddAttributesToFindingsWithContext(ctx aws.Context, input *AddAttributesToFindingsInput, opts ...request.Option) (*AddAttributesToFindingsOutput, error) { + req, out := c.AddAttributesToFindingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAssessmentTarget = "CreateAssessmentTarget" @@ -169,8 +185,23 @@ func (c *Inspector) CreateAssessmentTargetRequest(input *CreateAssessmentTargetI // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTarget func (c *Inspector) CreateAssessmentTarget(input *CreateAssessmentTargetInput) (*CreateAssessmentTargetOutput, error) { req, out := c.CreateAssessmentTargetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAssessmentTargetWithContext is the same as CreateAssessmentTarget with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAssessmentTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAssessmentTargetWithContext(ctx aws.Context, input *CreateAssessmentTargetInput, opts ...request.Option) (*CreateAssessmentTargetOutput, error) { + req, out := c.CreateAssessmentTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAssessmentTemplate = "CreateAssessmentTemplate" @@ -250,8 +281,23 @@ func (c *Inspector) CreateAssessmentTemplateRequest(input *CreateAssessmentTempl // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTemplate func (c *Inspector) CreateAssessmentTemplate(input *CreateAssessmentTemplateInput) (*CreateAssessmentTemplateOutput, error) { req, out := c.CreateAssessmentTemplateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAssessmentTemplateWithContext is the same as CreateAssessmentTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAssessmentTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAssessmentTemplateWithContext(ctx aws.Context, input *CreateAssessmentTemplateInput, opts ...request.Option) (*CreateAssessmentTemplateOutput, error) { + req, out := c.CreateAssessmentTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateResourceGroup = "CreateResourceGroup" @@ -329,8 +375,23 @@ func (c *Inspector) CreateResourceGroupRequest(input *CreateResourceGroupInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateResourceGroup func (c *Inspector) CreateResourceGroup(input *CreateResourceGroupInput) (*CreateResourceGroupOutput, error) { req, out := c.CreateResourceGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateResourceGroupWithContext is the same as CreateResourceGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateResourceGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateResourceGroupWithContext(ctx aws.Context, input *CreateResourceGroupInput, opts ...request.Option) (*CreateResourceGroupOutput, error) { + req, out := c.CreateResourceGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAssessmentRun = "DeleteAssessmentRun" @@ -412,8 +473,23 @@ func (c *Inspector) DeleteAssessmentRunRequest(input *DeleteAssessmentRunInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentRun func (c *Inspector) DeleteAssessmentRun(input *DeleteAssessmentRunInput) (*DeleteAssessmentRunOutput, error) { req, out := c.DeleteAssessmentRunRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAssessmentRunWithContext is the same as DeleteAssessmentRun with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAssessmentRun for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAssessmentRunWithContext(ctx aws.Context, input *DeleteAssessmentRunInput, opts ...request.Option) (*DeleteAssessmentRunOutput, error) { + req, out := c.DeleteAssessmentRunRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAssessmentTarget = "DeleteAssessmentTarget" @@ -495,8 +571,23 @@ func (c *Inspector) DeleteAssessmentTargetRequest(input *DeleteAssessmentTargetI // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTarget func (c *Inspector) DeleteAssessmentTarget(input *DeleteAssessmentTargetInput) (*DeleteAssessmentTargetOutput, error) { req, out := c.DeleteAssessmentTargetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAssessmentTargetWithContext is the same as DeleteAssessmentTarget with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAssessmentTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAssessmentTargetWithContext(ctx aws.Context, input *DeleteAssessmentTargetInput, opts ...request.Option) (*DeleteAssessmentTargetOutput, error) { + req, out := c.DeleteAssessmentTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAssessmentTemplate = "DeleteAssessmentTemplate" @@ -578,8 +669,23 @@ func (c *Inspector) DeleteAssessmentTemplateRequest(input *DeleteAssessmentTempl // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTemplate func (c *Inspector) DeleteAssessmentTemplate(input *DeleteAssessmentTemplateInput) (*DeleteAssessmentTemplateOutput, error) { req, out := c.DeleteAssessmentTemplateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAssessmentTemplateWithContext is the same as DeleteAssessmentTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAssessmentTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAssessmentTemplateWithContext(ctx aws.Context, input *DeleteAssessmentTemplateInput, opts ...request.Option) (*DeleteAssessmentTemplateOutput, error) { + req, out := c.DeleteAssessmentTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAssessmentRuns = "DescribeAssessmentRuns" @@ -648,8 +754,23 @@ func (c *Inspector) DescribeAssessmentRunsRequest(input *DescribeAssessmentRunsI // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentRuns func (c *Inspector) DescribeAssessmentRuns(input *DescribeAssessmentRunsInput) (*DescribeAssessmentRunsOutput, error) { req, out := c.DescribeAssessmentRunsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAssessmentRunsWithContext is the same as DescribeAssessmentRuns with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAssessmentRuns for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAssessmentRunsWithContext(ctx aws.Context, input *DescribeAssessmentRunsInput, opts ...request.Option) (*DescribeAssessmentRunsOutput, error) { + req, out := c.DescribeAssessmentRunsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAssessmentTargets = "DescribeAssessmentTargets" @@ -718,8 +839,23 @@ func (c *Inspector) DescribeAssessmentTargetsRequest(input *DescribeAssessmentTa // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTargets func (c *Inspector) DescribeAssessmentTargets(input *DescribeAssessmentTargetsInput) (*DescribeAssessmentTargetsOutput, error) { req, out := c.DescribeAssessmentTargetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAssessmentTargetsWithContext is the same as DescribeAssessmentTargets with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAssessmentTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAssessmentTargetsWithContext(ctx aws.Context, input *DescribeAssessmentTargetsInput, opts ...request.Option) (*DescribeAssessmentTargetsOutput, error) { + req, out := c.DescribeAssessmentTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAssessmentTemplates = "DescribeAssessmentTemplates" @@ -788,8 +924,23 @@ func (c *Inspector) DescribeAssessmentTemplatesRequest(input *DescribeAssessment // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTemplates func (c *Inspector) DescribeAssessmentTemplates(input *DescribeAssessmentTemplatesInput) (*DescribeAssessmentTemplatesOutput, error) { req, out := c.DescribeAssessmentTemplatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAssessmentTemplatesWithContext is the same as DescribeAssessmentTemplates with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAssessmentTemplates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAssessmentTemplatesWithContext(ctx aws.Context, input *DescribeAssessmentTemplatesInput, opts ...request.Option) (*DescribeAssessmentTemplatesOutput, error) { + req, out := c.DescribeAssessmentTemplatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeCrossAccountAccessRole = "DescribeCrossAccountAccessRole" @@ -853,8 +1004,23 @@ func (c *Inspector) DescribeCrossAccountAccessRoleRequest(input *DescribeCrossAc // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeCrossAccountAccessRole func (c *Inspector) DescribeCrossAccountAccessRole(input *DescribeCrossAccountAccessRoleInput) (*DescribeCrossAccountAccessRoleOutput, error) { req, out := c.DescribeCrossAccountAccessRoleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCrossAccountAccessRoleWithContext is the same as DescribeCrossAccountAccessRole with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCrossAccountAccessRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCrossAccountAccessRoleWithContext(ctx aws.Context, input *DescribeCrossAccountAccessRoleInput, opts ...request.Option) (*DescribeCrossAccountAccessRoleOutput, error) { + req, out := c.DescribeCrossAccountAccessRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeFindings = "DescribeFindings" @@ -922,8 +1088,23 @@ func (c *Inspector) DescribeFindingsRequest(input *DescribeFindingsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeFindings func (c *Inspector) DescribeFindings(input *DescribeFindingsInput) (*DescribeFindingsOutput, error) { req, out := c.DescribeFindingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeFindingsWithContext is the same as DescribeFindings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeFindings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeFindingsWithContext(ctx aws.Context, input *DescribeFindingsInput, opts ...request.Option) (*DescribeFindingsOutput, error) { + req, out := c.DescribeFindingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeResourceGroups = "DescribeResourceGroups" @@ -992,8 +1173,23 @@ func (c *Inspector) DescribeResourceGroupsRequest(input *DescribeResourceGroupsI // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeResourceGroups func (c *Inspector) DescribeResourceGroups(input *DescribeResourceGroupsInput) (*DescribeResourceGroupsOutput, error) { req, out := c.DescribeResourceGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeResourceGroupsWithContext is the same as DescribeResourceGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeResourceGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeResourceGroupsWithContext(ctx aws.Context, input *DescribeResourceGroupsInput, opts ...request.Option) (*DescribeResourceGroupsOutput, error) { + req, out := c.DescribeResourceGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeRulesPackages = "DescribeRulesPackages" @@ -1062,8 +1258,23 @@ func (c *Inspector) DescribeRulesPackagesRequest(input *DescribeRulesPackagesInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeRulesPackages func (c *Inspector) DescribeRulesPackages(input *DescribeRulesPackagesInput) (*DescribeRulesPackagesOutput, error) { req, out := c.DescribeRulesPackagesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeRulesPackagesWithContext is the same as DescribeRulesPackages with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRulesPackages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeRulesPackagesWithContext(ctx aws.Context, input *DescribeRulesPackagesInput, opts ...request.Option) (*DescribeRulesPackagesOutput, error) { + req, out := c.DescribeRulesPackagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetTelemetryMetadata = "GetTelemetryMetadata" @@ -1139,8 +1350,23 @@ func (c *Inspector) GetTelemetryMetadataRequest(input *GetTelemetryMetadataInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetTelemetryMetadata func (c *Inspector) GetTelemetryMetadata(input *GetTelemetryMetadataInput) (*GetTelemetryMetadataOutput, error) { req, out := c.GetTelemetryMetadataRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetTelemetryMetadataWithContext is the same as GetTelemetryMetadata with the addition of +// the ability to pass a context and additional request options. +// +// See GetTelemetryMetadata for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetTelemetryMetadataWithContext(ctx aws.Context, input *GetTelemetryMetadataInput, opts ...request.Option) (*GetTelemetryMetadataOutput, error) { + req, out := c.GetTelemetryMetadataRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAssessmentRunAgents = "ListAssessmentRunAgents" @@ -1216,8 +1442,23 @@ func (c *Inspector) ListAssessmentRunAgentsRequest(input *ListAssessmentRunAgent // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRunAgents func (c *Inspector) ListAssessmentRunAgents(input *ListAssessmentRunAgentsInput) (*ListAssessmentRunAgentsOutput, error) { req, out := c.ListAssessmentRunAgentsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAssessmentRunAgentsWithContext is the same as ListAssessmentRunAgents with the addition of +// the ability to pass a context and additional request options. +// +// See ListAssessmentRunAgents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAssessmentRunAgentsWithContext(ctx aws.Context, input *ListAssessmentRunAgentsInput, opts ...request.Option) (*ListAssessmentRunAgentsOutput, error) { + req, out := c.ListAssessmentRunAgentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAssessmentRuns = "ListAssessmentRuns" @@ -1293,8 +1534,23 @@ func (c *Inspector) ListAssessmentRunsRequest(input *ListAssessmentRunsInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRuns func (c *Inspector) ListAssessmentRuns(input *ListAssessmentRunsInput) (*ListAssessmentRunsOutput, error) { req, out := c.ListAssessmentRunsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAssessmentRunsWithContext is the same as ListAssessmentRuns with the addition of +// the ability to pass a context and additional request options. +// +// See ListAssessmentRuns for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAssessmentRunsWithContext(ctx aws.Context, input *ListAssessmentRunsInput, opts ...request.Option) (*ListAssessmentRunsOutput, error) { + req, out := c.ListAssessmentRunsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAssessmentTargets = "ListAssessmentTargets" @@ -1367,8 +1623,23 @@ func (c *Inspector) ListAssessmentTargetsRequest(input *ListAssessmentTargetsInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTargets func (c *Inspector) ListAssessmentTargets(input *ListAssessmentTargetsInput) (*ListAssessmentTargetsOutput, error) { req, out := c.ListAssessmentTargetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAssessmentTargetsWithContext is the same as ListAssessmentTargets with the addition of +// the ability to pass a context and additional request options. +// +// See ListAssessmentTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAssessmentTargetsWithContext(ctx aws.Context, input *ListAssessmentTargetsInput, opts ...request.Option) (*ListAssessmentTargetsOutput, error) { + req, out := c.ListAssessmentTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAssessmentTemplates = "ListAssessmentTemplates" @@ -1444,8 +1715,23 @@ func (c *Inspector) ListAssessmentTemplatesRequest(input *ListAssessmentTemplate // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTemplates func (c *Inspector) ListAssessmentTemplates(input *ListAssessmentTemplatesInput) (*ListAssessmentTemplatesOutput, error) { req, out := c.ListAssessmentTemplatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAssessmentTemplatesWithContext is the same as ListAssessmentTemplates with the addition of +// the ability to pass a context and additional request options. +// +// See ListAssessmentTemplates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAssessmentTemplatesWithContext(ctx aws.Context, input *ListAssessmentTemplatesInput, opts ...request.Option) (*ListAssessmentTemplatesOutput, error) { + req, out := c.ListAssessmentTemplatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListEventSubscriptions = "ListEventSubscriptions" @@ -1522,8 +1808,23 @@ func (c *Inspector) ListEventSubscriptionsRequest(input *ListEventSubscriptionsI // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListEventSubscriptions func (c *Inspector) ListEventSubscriptions(input *ListEventSubscriptionsInput) (*ListEventSubscriptionsOutput, error) { req, out := c.ListEventSubscriptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListEventSubscriptionsWithContext is the same as ListEventSubscriptions with the addition of +// the ability to pass a context and additional request options. +// +// See ListEventSubscriptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListEventSubscriptionsWithContext(ctx aws.Context, input *ListEventSubscriptionsInput, opts ...request.Option) (*ListEventSubscriptionsOutput, error) { + req, out := c.ListEventSubscriptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListFindings = "ListFindings" @@ -1599,8 +1900,23 @@ func (c *Inspector) ListFindingsRequest(input *ListFindingsInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListFindings func (c *Inspector) ListFindings(input *ListFindingsInput) (*ListFindingsOutput, error) { req, out := c.ListFindingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListFindingsWithContext is the same as ListFindings with the addition of +// the ability to pass a context and additional request options. +// +// See ListFindings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListFindingsWithContext(ctx aws.Context, input *ListFindingsInput, opts ...request.Option) (*ListFindingsOutput, error) { + req, out := c.ListFindingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListRulesPackages = "ListRulesPackages" @@ -1671,8 +1987,23 @@ func (c *Inspector) ListRulesPackagesRequest(input *ListRulesPackagesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListRulesPackages func (c *Inspector) ListRulesPackages(input *ListRulesPackagesInput) (*ListRulesPackagesOutput, error) { req, out := c.ListRulesPackagesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListRulesPackagesWithContext is the same as ListRulesPackages with the addition of +// the ability to pass a context and additional request options. +// +// See ListRulesPackages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListRulesPackagesWithContext(ctx aws.Context, input *ListRulesPackagesInput, opts ...request.Option) (*ListRulesPackagesOutput, error) { + req, out := c.ListRulesPackagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTagsForResource = "ListTagsForResource" @@ -1747,8 +2078,23 @@ func (c *Inspector) ListTagsForResourceRequest(input *ListTagsForResourceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListTagsForResource func (c *Inspector) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPreviewAgents = "PreviewAgents" @@ -1828,8 +2174,23 @@ func (c *Inspector) PreviewAgentsRequest(input *PreviewAgentsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/PreviewAgents func (c *Inspector) PreviewAgents(input *PreviewAgentsInput) (*PreviewAgentsOutput, error) { req, out := c.PreviewAgentsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PreviewAgentsWithContext is the same as PreviewAgents with the addition of +// the ability to pass a context and additional request options. +// +// See PreviewAgents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PreviewAgentsWithContext(ctx aws.Context, input *PreviewAgentsInput, opts ...request.Option) (*PreviewAgentsOutput, error) { + req, out := c.PreviewAgentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterCrossAccountAccessRole = "RegisterCrossAccountAccessRole" @@ -1907,8 +2268,23 @@ func (c *Inspector) RegisterCrossAccountAccessRoleRequest(input *RegisterCrossAc // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RegisterCrossAccountAccessRole func (c *Inspector) RegisterCrossAccountAccessRole(input *RegisterCrossAccountAccessRoleInput) (*RegisterCrossAccountAccessRoleOutput, error) { req, out := c.RegisterCrossAccountAccessRoleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterCrossAccountAccessRoleWithContext is the same as RegisterCrossAccountAccessRole with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterCrossAccountAccessRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterCrossAccountAccessRoleWithContext(ctx aws.Context, input *RegisterCrossAccountAccessRoleInput, opts ...request.Option) (*RegisterCrossAccountAccessRoleOutput, error) { + req, out := c.RegisterCrossAccountAccessRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveAttributesFromFindings = "RemoveAttributesFromFindings" @@ -1985,8 +2361,23 @@ func (c *Inspector) RemoveAttributesFromFindingsRequest(input *RemoveAttributesF // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RemoveAttributesFromFindings func (c *Inspector) RemoveAttributesFromFindings(input *RemoveAttributesFromFindingsInput) (*RemoveAttributesFromFindingsOutput, error) { req, out := c.RemoveAttributesFromFindingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveAttributesFromFindingsWithContext is the same as RemoveAttributesFromFindings with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveAttributesFromFindings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveAttributesFromFindingsWithContext(ctx aws.Context, input *RemoveAttributesFromFindingsInput, opts ...request.Option) (*RemoveAttributesFromFindingsOutput, error) { + req, out := c.RemoveAttributesFromFindingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetTagsForResource = "SetTagsForResource" @@ -2064,8 +2455,23 @@ func (c *Inspector) SetTagsForResourceRequest(input *SetTagsForResourceInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SetTagsForResource func (c *Inspector) SetTagsForResource(input *SetTagsForResourceInput) (*SetTagsForResourceOutput, error) { req, out := c.SetTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetTagsForResourceWithContext is the same as SetTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See SetTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetTagsForResourceWithContext(ctx aws.Context, input *SetTagsForResourceInput, opts ...request.Option) (*SetTagsForResourceOutput, error) { + req, out := c.SetTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartAssessmentRun = "StartAssessmentRun" @@ -2154,8 +2560,23 @@ func (c *Inspector) StartAssessmentRunRequest(input *StartAssessmentRunInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StartAssessmentRun func (c *Inspector) StartAssessmentRun(input *StartAssessmentRunInput) (*StartAssessmentRunOutput, error) { req, out := c.StartAssessmentRunRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartAssessmentRunWithContext is the same as StartAssessmentRun with the addition of +// the ability to pass a context and additional request options. +// +// See StartAssessmentRun for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartAssessmentRunWithContext(ctx aws.Context, input *StartAssessmentRunInput, opts ...request.Option) (*StartAssessmentRunOutput, error) { + req, out := c.StartAssessmentRunRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopAssessmentRun = "StopAssessmentRun" @@ -2232,8 +2653,23 @@ func (c *Inspector) StopAssessmentRunRequest(input *StopAssessmentRunInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StopAssessmentRun func (c *Inspector) StopAssessmentRun(input *StopAssessmentRunInput) (*StopAssessmentRunOutput, error) { req, out := c.StopAssessmentRunRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopAssessmentRunWithContext is the same as StopAssessmentRun with the addition of +// the ability to pass a context and additional request options. +// +// See StopAssessmentRun for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopAssessmentRunWithContext(ctx aws.Context, input *StopAssessmentRunInput, opts ...request.Option) (*StopAssessmentRunOutput, error) { + req, out := c.StopAssessmentRunRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSubscribeToEvent = "SubscribeToEvent" @@ -2315,8 +2751,23 @@ func (c *Inspector) SubscribeToEventRequest(input *SubscribeToEventInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SubscribeToEvent func (c *Inspector) SubscribeToEvent(input *SubscribeToEventInput) (*SubscribeToEventOutput, error) { req, out := c.SubscribeToEventRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SubscribeToEventWithContext is the same as SubscribeToEvent with the addition of +// the ability to pass a context and additional request options. +// +// See SubscribeToEvent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SubscribeToEventWithContext(ctx aws.Context, input *SubscribeToEventInput, opts ...request.Option) (*SubscribeToEventOutput, error) { + req, out := c.SubscribeToEventRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUnsubscribeFromEvent = "UnsubscribeFromEvent" @@ -2394,8 +2845,23 @@ func (c *Inspector) UnsubscribeFromEventRequest(input *UnsubscribeFromEventInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UnsubscribeFromEvent func (c *Inspector) UnsubscribeFromEvent(input *UnsubscribeFromEventInput) (*UnsubscribeFromEventOutput, error) { req, out := c.UnsubscribeFromEventRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UnsubscribeFromEventWithContext is the same as UnsubscribeFromEvent with the addition of +// the ability to pass a context and additional request options. +// +// See UnsubscribeFromEvent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UnsubscribeFromEventWithContext(ctx aws.Context, input *UnsubscribeFromEventInput, opts ...request.Option) (*UnsubscribeFromEventOutput, error) { + req, out := c.UnsubscribeFromEventRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAssessmentTarget = "UpdateAssessmentTarget" @@ -2473,8 +2939,23 @@ func (c *Inspector) UpdateAssessmentTargetRequest(input *UpdateAssessmentTargetI // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UpdateAssessmentTarget func (c *Inspector) UpdateAssessmentTarget(input *UpdateAssessmentTargetInput) (*UpdateAssessmentTargetOutput, error) { req, out := c.UpdateAssessmentTargetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAssessmentTargetWithContext is the same as UpdateAssessmentTarget with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAssessmentTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAssessmentTargetWithContext(ctx aws.Context, input *UpdateAssessmentTargetInput, opts ...request.Option) (*UpdateAssessmentTargetOutput, error) { + req, out := c.UpdateAssessmentTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindingsRequest diff --git a/vendor/github.com/aws/aws-sdk-go/service/inspector/errors.go b/vendor/github.com/aws/aws-sdk-go/service/inspector/errors.go index e39853022..2178a76b2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/inspector/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/inspector/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package inspector diff --git a/vendor/github.com/aws/aws-sdk-go/service/inspector/service.go b/vendor/github.com/aws/aws-sdk-go/service/inspector/service.go index 3401a9c40..81feadcc1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/inspector/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/inspector/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package inspector diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go index e36f23d22..e0b42ad5c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package kinesis provides a client for Amazon Kinesis. package kinesis @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -93,8 +94,23 @@ func (c *Kinesis) AddTagsToStreamRequest(input *AddTagsToStreamInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/AddTagsToStream func (c *Kinesis) AddTagsToStream(input *AddTagsToStreamInput) (*AddTagsToStreamOutput, error) { req, out := c.AddTagsToStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsToStreamWithContext is the same as AddTagsToStream with the addition of +// the ability to pass a context and additional request options. +// +// See AddTagsToStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsToStreamWithContext(ctx aws.Context, input *AddTagsToStreamInput, opts ...request.Option) (*AddTagsToStreamOutput, error) { + req, out := c.AddTagsToStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateStream = "CreateStream" @@ -206,8 +222,23 @@ func (c *Kinesis) CreateStreamRequest(input *CreateStreamInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/CreateStream func (c *Kinesis) CreateStream(input *CreateStreamInput) (*CreateStreamOutput, error) { req, out := c.CreateStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateStreamWithContext is the same as CreateStream with the addition of +// the ability to pass a context and additional request options. +// +// See CreateStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateStreamWithContext(ctx aws.Context, input *CreateStreamInput, opts ...request.Option) (*CreateStreamOutput, error) { + req, out := c.CreateStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDecreaseStreamRetentionPeriod = "DecreaseStreamRetentionPeriod" @@ -288,8 +319,23 @@ func (c *Kinesis) DecreaseStreamRetentionPeriodRequest(input *DecreaseStreamRete // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DecreaseStreamRetentionPeriod func (c *Kinesis) DecreaseStreamRetentionPeriod(input *DecreaseStreamRetentionPeriodInput) (*DecreaseStreamRetentionPeriodOutput, error) { req, out := c.DecreaseStreamRetentionPeriodRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DecreaseStreamRetentionPeriodWithContext is the same as DecreaseStreamRetentionPeriod with the addition of +// the ability to pass a context and additional request options. +// +// See DecreaseStreamRetentionPeriod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DecreaseStreamRetentionPeriodWithContext(ctx aws.Context, input *DecreaseStreamRetentionPeriodInput, opts ...request.Option) (*DecreaseStreamRetentionPeriodOutput, error) { + req, out := c.DecreaseStreamRetentionPeriodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteStream = "DeleteStream" @@ -379,8 +425,23 @@ func (c *Kinesis) DeleteStreamRequest(input *DeleteStreamInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DeleteStream func (c *Kinesis) DeleteStream(input *DeleteStreamInput) (*DeleteStreamOutput, error) { req, out := c.DeleteStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteStreamWithContext is the same as DeleteStream with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteStreamWithContext(ctx aws.Context, input *DeleteStreamInput, opts ...request.Option) (*DeleteStreamOutput, error) { + req, out := c.DeleteStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLimits = "DescribeLimits" @@ -450,8 +511,23 @@ func (c *Kinesis) DescribeLimitsRequest(input *DescribeLimitsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeLimits func (c *Kinesis) DescribeLimits(input *DescribeLimitsInput) (*DescribeLimitsOutput, error) { req, out := c.DescribeLimitsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLimitsWithContext is the same as DescribeLimits with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLimits for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLimitsWithContext(ctx aws.Context, input *DescribeLimitsInput, opts ...request.Option) (*DescribeLimitsOutput, error) { + req, out := c.DescribeLimitsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeStream = "DescribeStream" @@ -544,8 +620,23 @@ func (c *Kinesis) DescribeStreamRequest(input *DescribeStreamInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeStream func (c *Kinesis) DescribeStream(input *DescribeStreamInput) (*DescribeStreamOutput, error) { req, out := c.DescribeStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStreamWithContext is the same as DescribeStream with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStreamWithContext(ctx aws.Context, input *DescribeStreamInput, opts ...request.Option) (*DescribeStreamOutput, error) { + req, out := c.DescribeStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeStreamPages iterates over the pages of a DescribeStream operation, @@ -565,12 +656,37 @@ func (c *Kinesis) DescribeStream(input *DescribeStreamInput) (*DescribeStreamOut // return pageNum <= 3 // }) // -func (c *Kinesis) DescribeStreamPages(input *DescribeStreamInput, fn func(p *DescribeStreamOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeStreamRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeStreamOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeStreamInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStreamRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeStreamOutput), !p.HasNextPage()) + } + return p.Err() } const opDisableEnhancedMonitoring = "DisableEnhancedMonitoring" @@ -647,8 +763,23 @@ func (c *Kinesis) DisableEnhancedMonitoringRequest(input *DisableEnhancedMonitor // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DisableEnhancedMonitoring func (c *Kinesis) DisableEnhancedMonitoring(input *DisableEnhancedMonitoringInput) (*EnhancedMonitoringOutput, error) { req, out := c.DisableEnhancedMonitoringRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableEnhancedMonitoringWithContext is the same as DisableEnhancedMonitoring with the addition of +// the ability to pass a context and additional request options. +// +// See DisableEnhancedMonitoring for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableEnhancedMonitoringWithContext(ctx aws.Context, input *DisableEnhancedMonitoringInput, opts ...request.Option) (*EnhancedMonitoringOutput, error) { + req, out := c.DisableEnhancedMonitoringRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableEnhancedMonitoring = "EnableEnhancedMonitoring" @@ -725,8 +856,23 @@ func (c *Kinesis) EnableEnhancedMonitoringRequest(input *EnableEnhancedMonitorin // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/EnableEnhancedMonitoring func (c *Kinesis) EnableEnhancedMonitoring(input *EnableEnhancedMonitoringInput) (*EnhancedMonitoringOutput, error) { req, out := c.EnableEnhancedMonitoringRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableEnhancedMonitoringWithContext is the same as EnableEnhancedMonitoring with the addition of +// the ability to pass a context and additional request options. +// +// See EnableEnhancedMonitoring for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableEnhancedMonitoringWithContext(ctx aws.Context, input *EnableEnhancedMonitoringInput, opts ...request.Option) (*EnhancedMonitoringOutput, error) { + req, out := c.EnableEnhancedMonitoringRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetRecords = "GetRecords" @@ -858,8 +1004,23 @@ func (c *Kinesis) GetRecordsRequest(input *GetRecordsInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetRecords func (c *Kinesis) GetRecords(input *GetRecordsInput) (*GetRecordsOutput, error) { req, out := c.GetRecordsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRecordsWithContext is the same as GetRecords with the addition of +// the ability to pass a context and additional request options. +// +// See GetRecords for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetRecordsWithContext(ctx aws.Context, input *GetRecordsInput, opts ...request.Option) (*GetRecordsOutput, error) { + req, out := c.GetRecordsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetShardIterator = "GetShardIterator" @@ -973,8 +1134,23 @@ func (c *Kinesis) GetShardIteratorRequest(input *GetShardIteratorInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetShardIterator func (c *Kinesis) GetShardIterator(input *GetShardIteratorInput) (*GetShardIteratorOutput, error) { req, out := c.GetShardIteratorRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetShardIteratorWithContext is the same as GetShardIterator with the addition of +// the ability to pass a context and additional request options. +// +// See GetShardIterator for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetShardIteratorWithContext(ctx aws.Context, input *GetShardIteratorInput, opts ...request.Option) (*GetShardIteratorOutput, error) { + req, out := c.GetShardIteratorRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opIncreaseStreamRetentionPeriod = "IncreaseStreamRetentionPeriod" @@ -1059,8 +1235,23 @@ func (c *Kinesis) IncreaseStreamRetentionPeriodRequest(input *IncreaseStreamRete // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/IncreaseStreamRetentionPeriod func (c *Kinesis) IncreaseStreamRetentionPeriod(input *IncreaseStreamRetentionPeriodInput) (*IncreaseStreamRetentionPeriodOutput, error) { req, out := c.IncreaseStreamRetentionPeriodRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// IncreaseStreamRetentionPeriodWithContext is the same as IncreaseStreamRetentionPeriod with the addition of +// the ability to pass a context and additional request options. +// +// See IncreaseStreamRetentionPeriod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) IncreaseStreamRetentionPeriodWithContext(ctx aws.Context, input *IncreaseStreamRetentionPeriodInput, opts ...request.Option) (*IncreaseStreamRetentionPeriodOutput, error) { + req, out := c.IncreaseStreamRetentionPeriodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListStreams = "ListStreams" @@ -1146,8 +1337,23 @@ func (c *Kinesis) ListStreamsRequest(input *ListStreamsInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListStreams func (c *Kinesis) ListStreams(input *ListStreamsInput) (*ListStreamsOutput, error) { req, out := c.ListStreamsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListStreamsWithContext is the same as ListStreams with the addition of +// the ability to pass a context and additional request options. +// +// See ListStreams for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListStreamsWithContext(ctx aws.Context, input *ListStreamsInput, opts ...request.Option) (*ListStreamsOutput, error) { + req, out := c.ListStreamsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListStreamsPages iterates over the pages of a ListStreams operation, @@ -1167,12 +1373,37 @@ func (c *Kinesis) ListStreams(input *ListStreamsInput) (*ListStreamsOutput, erro // return pageNum <= 3 // }) // -func (c *Kinesis) ListStreamsPages(input *ListStreamsInput, fn func(p *ListStreamsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStreamsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStreamsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListStreamsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListStreamsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListStreamsOutput), !p.HasNextPage()) + } + return p.Err() } const opListTagsForStream = "ListTagsForStream" @@ -1245,8 +1476,23 @@ func (c *Kinesis) ListTagsForStreamRequest(input *ListTagsForStreamInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListTagsForStream func (c *Kinesis) ListTagsForStream(input *ListTagsForStreamInput) (*ListTagsForStreamOutput, error) { req, out := c.ListTagsForStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForStreamWithContext is the same as ListTagsForStream with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForStreamWithContext(ctx aws.Context, input *ListTagsForStreamInput, opts ...request.Option) (*ListTagsForStreamOutput, error) { + req, out := c.ListTagsForStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opMergeShards = "MergeShards" @@ -1360,8 +1606,23 @@ func (c *Kinesis) MergeShardsRequest(input *MergeShardsInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/MergeShards func (c *Kinesis) MergeShards(input *MergeShardsInput) (*MergeShardsOutput, error) { req, out := c.MergeShardsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// MergeShardsWithContext is the same as MergeShards with the addition of +// the ability to pass a context and additional request options. +// +// See MergeShards for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) MergeShardsWithContext(ctx aws.Context, input *MergeShardsInput, opts ...request.Option) (*MergeShardsOutput, error) { + req, out := c.MergeShardsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutRecord = "PutRecord" @@ -1475,8 +1736,23 @@ func (c *Kinesis) PutRecordRequest(input *PutRecordInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecord func (c *Kinesis) PutRecord(input *PutRecordInput) (*PutRecordOutput, error) { req, out := c.PutRecordRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutRecordWithContext is the same as PutRecord with the addition of +// the ability to pass a context and additional request options. +// +// See PutRecord for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutRecordWithContext(ctx aws.Context, input *PutRecordInput, opts ...request.Option) (*PutRecordOutput, error) { + req, out := c.PutRecordRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutRecords = "PutRecords" @@ -1612,8 +1888,23 @@ func (c *Kinesis) PutRecordsRequest(input *PutRecordsInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecords func (c *Kinesis) PutRecords(input *PutRecordsInput) (*PutRecordsOutput, error) { req, out := c.PutRecordsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutRecordsWithContext is the same as PutRecords with the addition of +// the ability to pass a context and additional request options. +// +// See PutRecords for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutRecordsWithContext(ctx aws.Context, input *PutRecordsInput, opts ...request.Option) (*PutRecordsOutput, error) { + req, out := c.PutRecordsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTagsFromStream = "RemoveTagsFromStream" @@ -1695,8 +1986,23 @@ func (c *Kinesis) RemoveTagsFromStreamRequest(input *RemoveTagsFromStreamInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/RemoveTagsFromStream func (c *Kinesis) RemoveTagsFromStream(input *RemoveTagsFromStreamInput) (*RemoveTagsFromStreamOutput, error) { req, out := c.RemoveTagsFromStreamRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsFromStreamWithContext is the same as RemoveTagsFromStream with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTagsFromStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsFromStreamWithContext(ctx aws.Context, input *RemoveTagsFromStreamInput, opts ...request.Option) (*RemoveTagsFromStreamOutput, error) { + req, out := c.RemoveTagsFromStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSplitShard = "SplitShard" @@ -1819,8 +2125,23 @@ func (c *Kinesis) SplitShardRequest(input *SplitShardInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/SplitShard func (c *Kinesis) SplitShard(input *SplitShardInput) (*SplitShardOutput, error) { req, out := c.SplitShardRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SplitShardWithContext is the same as SplitShard with the addition of +// the ability to pass a context and additional request options. +// +// See SplitShard for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SplitShardWithContext(ctx aws.Context, input *SplitShardInput, opts ...request.Option) (*SplitShardOutput, error) { + req, out := c.SplitShardRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateShardCount = "UpdateShardCount" @@ -1918,8 +2239,23 @@ func (c *Kinesis) UpdateShardCountRequest(input *UpdateShardCountInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/UpdateShardCount func (c *Kinesis) UpdateShardCount(input *UpdateShardCountInput) (*UpdateShardCountOutput, error) { req, out := c.UpdateShardCountRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateShardCountWithContext is the same as UpdateShardCount with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateShardCount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateShardCountWithContext(ctx aws.Context, input *UpdateShardCountInput, opts ...request.Option) (*UpdateShardCountOutput, error) { + req, out := c.UpdateShardCountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Represents the input for AddTagsToStream. diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go index 083aa5e0f..9c9beafe3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package kinesis diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go index ed037fe6e..212a54c77 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package kinesis diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/waiters.go index c1f56d6c1..14e2ba9e2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesis/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package kinesis import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilStreamExists uses the Kinesis API operation @@ -11,24 +14,43 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *Kinesis) WaitUntilStreamExists(input *DescribeStreamInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStream", - Delay: 10, + return c.WaitUntilStreamExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilStreamExistsWithContext is an extended version of WaitUntilStreamExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilStreamExistsWithContext(ctx aws.Context, input *DescribeStreamInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilStreamExists", MaxAttempts: 18, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(10 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "StreamDescription.StreamStatus", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "StreamDescription.StreamStatus", Expected: "ACTIVE", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeStreamInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStreamRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/kms/api.go b/vendor/github.com/aws/aws-sdk-go/service/kms/api.go index afd375b1c..82ef66120 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kms/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kms/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package kms provides a client for AWS Key Management Service. package kms @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -100,8 +101,23 @@ func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletion func (c *KMS) CancelKeyDeletion(input *CancelKeyDeletionInput) (*CancelKeyDeletionOutput, error) { req, out := c.CancelKeyDeletionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelKeyDeletionWithContext is the same as CancelKeyDeletion with the addition of +// the ability to pass a context and additional request options. +// +// See CancelKeyDeletion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelKeyDeletionWithContext(ctx aws.Context, input *CancelKeyDeletionInput, opts ...request.Option) (*CancelKeyDeletionOutput, error) { + req, out := c.CancelKeyDeletionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAlias = "CreateAlias" @@ -207,8 +223,23 @@ func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAlias func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { req, out := c.CreateAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAliasWithContext is the same as CreateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAliasWithContext(ctx aws.Context, input *CreateAliasInput, opts ...request.Option) (*CreateAliasOutput, error) { + req, out := c.CreateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateGrant = "CreateGrant" @@ -307,8 +338,23 @@ func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrant func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error) { req, out := c.CreateGrantRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateGrantWithContext is the same as CreateGrant with the addition of +// the ability to pass a context and additional request options. +// +// See CreateGrant for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateGrantWithContext(ctx aws.Context, input *CreateGrantInput, opts ...request.Option) (*CreateGrantOutput, error) { + req, out := c.CreateGrantRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateKey = "CreateKey" @@ -406,8 +452,23 @@ func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey func (c *KMS) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error) { req, out := c.CreateKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateKeyWithContext is the same as CreateKey with the addition of +// the ability to pass a context and additional request options. +// +// See CreateKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateKeyWithContext(ctx aws.Context, input *CreateKeyInput, opts ...request.Option) (*CreateKeyOutput, error) { + req, out := c.CreateKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDecrypt = "Decrypt" @@ -518,8 +579,23 @@ func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error) { req, out := c.DecryptRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DecryptWithContext is the same as Decrypt with the addition of +// the ability to pass a context and additional request options. +// +// See Decrypt for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DecryptWithContext(ctx aws.Context, input *DecryptInput, opts ...request.Option) (*DecryptOutput, error) { + req, out := c.DecryptRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAlias = "DeleteAlias" @@ -602,8 +678,23 @@ func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAlias func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { req, out := c.DeleteAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAliasWithContext is the same as DeleteAlias with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAliasWithContext(ctx aws.Context, input *DeleteAliasInput, opts ...request.Option) (*DeleteAliasOutput, error) { + req, out := c.DeleteAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteImportedKeyMaterial = "DeleteImportedKeyMaterial" @@ -702,8 +793,23 @@ func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialI // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterial func (c *KMS) DeleteImportedKeyMaterial(input *DeleteImportedKeyMaterialInput) (*DeleteImportedKeyMaterialOutput, error) { req, out := c.DeleteImportedKeyMaterialRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteImportedKeyMaterialWithContext is the same as DeleteImportedKeyMaterial with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteImportedKeyMaterial for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteImportedKeyMaterialWithContext(ctx aws.Context, input *DeleteImportedKeyMaterialInput, opts ...request.Option) (*DeleteImportedKeyMaterialOutput, error) { + req, out := c.DeleteImportedKeyMaterialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeKey = "DescribeKey" @@ -779,8 +885,23 @@ func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey func (c *KMS) DescribeKey(input *DescribeKeyInput) (*DescribeKeyOutput, error) { req, out := c.DescribeKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeKeyWithContext is the same as DescribeKey with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeKeyWithContext(ctx aws.Context, input *DescribeKeyInput, opts ...request.Option) (*DescribeKeyOutput, error) { + req, out := c.DescribeKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableKey = "DisableKey" @@ -870,8 +991,23 @@ func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKey func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error) { req, out := c.DisableKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableKeyWithContext is the same as DisableKey with the addition of +// the ability to pass a context and additional request options. +// +// See DisableKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableKeyWithContext(ctx aws.Context, input *DisableKeyInput, opts ...request.Option) (*DisableKeyOutput, error) { + req, out := c.DisableKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableKeyRotation = "DisableKeyRotation" @@ -964,8 +1100,23 @@ func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRotation func (c *KMS) DisableKeyRotation(input *DisableKeyRotationInput) (*DisableKeyRotationOutput, error) { req, out := c.DisableKeyRotationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableKeyRotationWithContext is the same as DisableKeyRotation with the addition of +// the ability to pass a context and additional request options. +// +// See DisableKeyRotation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableKeyRotationWithContext(ctx aws.Context, input *DisableKeyRotationInput, opts ...request.Option) (*DisableKeyRotationOutput, error) { + req, out := c.DisableKeyRotationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableKey = "EnableKey" @@ -1056,8 +1207,23 @@ func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKey func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error) { req, out := c.EnableKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableKeyWithContext is the same as EnableKey with the addition of +// the ability to pass a context and additional request options. +// +// See EnableKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableKeyWithContext(ctx aws.Context, input *EnableKeyInput, opts ...request.Option) (*EnableKeyOutput, error) { + req, out := c.EnableKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableKeyRotation = "EnableKeyRotation" @@ -1150,8 +1316,23 @@ func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotation func (c *KMS) EnableKeyRotation(input *EnableKeyRotationInput) (*EnableKeyRotationOutput, error) { req, out := c.EnableKeyRotationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableKeyRotationWithContext is the same as EnableKeyRotation with the addition of +// the ability to pass a context and additional request options. +// +// See EnableKeyRotation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableKeyRotationWithContext(ctx aws.Context, input *EnableKeyRotationInput, opts ...request.Option) (*EnableKeyRotationOutput, error) { + req, out := c.EnableKeyRotationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEncrypt = "Encrypt" @@ -1264,8 +1445,23 @@ func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error) { req, out := c.EncryptRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EncryptWithContext is the same as Encrypt with the addition of +// the ability to pass a context and additional request options. +// +// See Encrypt for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EncryptWithContext(ctx aws.Context, input *EncryptInput, opts ...request.Option) (*EncryptOutput, error) { + req, out := c.EncryptRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGenerateDataKey = "GenerateDataKey" @@ -1402,8 +1598,23 @@ func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKey func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error) { req, out := c.GenerateDataKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GenerateDataKeyWithContext is the same as GenerateDataKey with the addition of +// the ability to pass a context and additional request options. +// +// See GenerateDataKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GenerateDataKeyWithContext(ctx aws.Context, input *GenerateDataKeyInput, opts ...request.Option) (*GenerateDataKeyOutput, error) { + req, out := c.GenerateDataKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" @@ -1511,8 +1722,23 @@ func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWitho // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintext func (c *KMS) GenerateDataKeyWithoutPlaintext(input *GenerateDataKeyWithoutPlaintextInput) (*GenerateDataKeyWithoutPlaintextOutput, error) { req, out := c.GenerateDataKeyWithoutPlaintextRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GenerateDataKeyWithoutPlaintextWithContext is the same as GenerateDataKeyWithoutPlaintext with the addition of +// the ability to pass a context and additional request options. +// +// See GenerateDataKeyWithoutPlaintext for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GenerateDataKeyWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyWithoutPlaintextOutput, error) { + req, out := c.GenerateDataKeyWithoutPlaintextRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGenerateRandom = "GenerateRandom" @@ -1581,8 +1807,23 @@ func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandom func (c *KMS) GenerateRandom(input *GenerateRandomInput) (*GenerateRandomOutput, error) { req, out := c.GenerateRandomRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GenerateRandomWithContext is the same as GenerateRandom with the addition of +// the ability to pass a context and additional request options. +// +// See GenerateRandom for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GenerateRandomWithContext(ctx aws.Context, input *GenerateRandomInput, opts ...request.Option) (*GenerateRandomOutput, error) { + req, out := c.GenerateRandomRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetKeyPolicy = "GetKeyPolicy" @@ -1666,8 +1907,23 @@ func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error) { req, out := c.GetKeyPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetKeyPolicyWithContext is the same as GetKeyPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetKeyPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetKeyPolicyWithContext(ctx aws.Context, input *GetKeyPolicyInput, opts ...request.Option) (*GetKeyPolicyOutput, error) { + req, out := c.GetKeyPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetKeyRotationStatus = "GetKeyRotationStatus" @@ -1756,8 +2012,23 @@ func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatus func (c *KMS) GetKeyRotationStatus(input *GetKeyRotationStatusInput) (*GetKeyRotationStatusOutput, error) { req, out := c.GetKeyRotationStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetKeyRotationStatusWithContext is the same as GetKeyRotationStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetKeyRotationStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetKeyRotationStatusWithContext(ctx aws.Context, input *GetKeyRotationStatusInput, opts ...request.Option) (*GetKeyRotationStatusOutput, error) { + req, out := c.GetKeyRotationStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetParametersForImport = "GetParametersForImport" @@ -1860,8 +2131,23 @@ func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImport func (c *KMS) GetParametersForImport(input *GetParametersForImportInput) (*GetParametersForImportOutput, error) { req, out := c.GetParametersForImportRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetParametersForImportWithContext is the same as GetParametersForImport with the addition of +// the ability to pass a context and additional request options. +// +// See GetParametersForImport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetParametersForImportWithContext(ctx aws.Context, input *GetParametersForImportInput, opts ...request.Option) (*GetParametersForImportOutput, error) { + req, out := c.GetParametersForImportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportKeyMaterial = "ImportKeyMaterial" @@ -1988,8 +2274,23 @@ func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterial func (c *KMS) ImportKeyMaterial(input *ImportKeyMaterialInput) (*ImportKeyMaterialOutput, error) { req, out := c.ImportKeyMaterialRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportKeyMaterialWithContext is the same as ImportKeyMaterial with the addition of +// the ability to pass a context and additional request options. +// +// See ImportKeyMaterial for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ImportKeyMaterialWithContext(ctx aws.Context, input *ImportKeyMaterialInput, opts ...request.Option) (*ImportKeyMaterialOutput, error) { + req, out := c.ImportKeyMaterialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAliases = "ListAliases" @@ -2068,8 +2369,23 @@ func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListAliases func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { req, out := c.ListAliasesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAliasesWithContext is the same as ListAliases with the addition of +// the ability to pass a context and additional request options. +// +// See ListAliases for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAliasesWithContext(ctx aws.Context, input *ListAliasesInput, opts ...request.Option) (*ListAliasesOutput, error) { + req, out := c.ListAliasesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListAliasesPages iterates over the pages of a ListAliases operation, @@ -2089,12 +2405,37 @@ func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { // return pageNum <= 3 // }) // -func (c *KMS) ListAliasesPages(input *ListAliasesInput, fn func(p *ListAliasesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAliasesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAliasesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAliasesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAliasesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) + } + return p.Err() } const opListGrants = "ListGrants" @@ -2188,8 +2529,23 @@ func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrants func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error) { req, out := c.ListGrantsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListGrantsWithContext is the same as ListGrants with the addition of +// the ability to pass a context and additional request options. +// +// See ListGrants for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListGrantsWithContext(ctx aws.Context, input *ListGrantsInput, opts ...request.Option) (*ListGrantsResponse, error) { + req, out := c.ListGrantsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListGrantsPages iterates over the pages of a ListGrants operation, @@ -2209,12 +2565,37 @@ func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error) { // return pageNum <= 3 // }) // -func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(p *ListGrantsResponse, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListGrantsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListGrantsResponse), lastPage) - }) +func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(*ListGrantsResponse, 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(*ListGrantsResponse, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListGrantsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListGrantsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListGrantsResponse), !p.HasNextPage()) + } + return p.Err() } const opListKeyPolicies = "ListKeyPolicies" @@ -2304,8 +2685,23 @@ func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPolicies func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error) { req, out := c.ListKeyPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListKeyPoliciesWithContext is the same as ListKeyPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListKeyPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListKeyPoliciesWithContext(ctx aws.Context, input *ListKeyPoliciesInput, opts ...request.Option) (*ListKeyPoliciesOutput, error) { + req, out := c.ListKeyPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListKeyPoliciesPages iterates over the pages of a ListKeyPolicies operation, @@ -2325,12 +2721,37 @@ func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutp // return pageNum <= 3 // }) // -func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, fn func(p *ListKeyPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListKeyPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListKeyPoliciesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListKeyPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListKeyPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListKeyPoliciesOutput), !p.HasNextPage()) + } + return p.Err() } const opListKeys = "ListKeys" @@ -2409,8 +2830,23 @@ func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, outpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeys func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) { req, out := c.ListKeysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListKeysWithContext is the same as ListKeys with the addition of +// the ability to pass a context and additional request options. +// +// See ListKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListKeysWithContext(ctx aws.Context, input *ListKeysInput, opts ...request.Option) (*ListKeysOutput, error) { + req, out := c.ListKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListKeysPages iterates over the pages of a ListKeys operation, @@ -2430,12 +2866,37 @@ func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) { // return pageNum <= 3 // }) // -func (c *KMS) ListKeysPages(input *ListKeysInput, fn func(p *ListKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListKeysOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListKeysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListKeysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListKeysOutput), !p.HasNextPage()) + } + return p.Err() } const opListResourceTags = "ListResourceTags" @@ -2511,8 +2972,23 @@ func (c *KMS) ListResourceTagsRequest(input *ListResourceTagsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListResourceTags func (c *KMS) ListResourceTags(input *ListResourceTagsInput) (*ListResourceTagsOutput, error) { req, out := c.ListResourceTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListResourceTagsWithContext is the same as ListResourceTags with the addition of +// the ability to pass a context and additional request options. +// +// See ListResourceTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListResourceTagsWithContext(ctx aws.Context, input *ListResourceTagsInput, opts ...request.Option) (*ListResourceTagsOutput, error) { + req, out := c.ListResourceTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListRetirableGrants = "ListRetirableGrants" @@ -2596,8 +3072,23 @@ func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListRetirableGrants func (c *KMS) ListRetirableGrants(input *ListRetirableGrantsInput) (*ListGrantsResponse, error) { req, out := c.ListRetirableGrantsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListRetirableGrantsWithContext is the same as ListRetirableGrants with the addition of +// the ability to pass a context and additional request options. +// +// See ListRetirableGrants for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListRetirableGrantsWithContext(ctx aws.Context, input *ListRetirableGrantsInput, opts ...request.Option) (*ListGrantsResponse, error) { + req, out := c.ListRetirableGrantsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutKeyPolicy = "PutKeyPolicy" @@ -2699,8 +3190,23 @@ func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicy func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error) { req, out := c.PutKeyPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutKeyPolicyWithContext is the same as PutKeyPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutKeyPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutKeyPolicyWithContext(ctx aws.Context, input *PutKeyPolicyInput, opts ...request.Option) (*PutKeyPolicyOutput, error) { + req, out := c.PutKeyPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReEncrypt = "ReEncrypt" @@ -2809,8 +3315,23 @@ func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error) { req, out := c.ReEncryptRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReEncryptWithContext is the same as ReEncrypt with the addition of +// the ability to pass a context and additional request options. +// +// See ReEncrypt for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReEncryptWithContext(ctx aws.Context, input *ReEncryptInput, opts ...request.Option) (*ReEncryptOutput, error) { + req, out := c.ReEncryptRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRetireGrant = "RetireGrant" @@ -2914,8 +3435,23 @@ func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrant func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error) { req, out := c.RetireGrantRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RetireGrantWithContext is the same as RetireGrant with the addition of +// the ability to pass a context and additional request options. +// +// See RetireGrant for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RetireGrantWithContext(ctx aws.Context, input *RetireGrantInput, opts ...request.Option) (*RetireGrantOutput, error) { + req, out := c.RetireGrantRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRevokeGrant = "RevokeGrant" @@ -3005,8 +3541,23 @@ func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrant func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error) { req, out := c.RevokeGrantRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RevokeGrantWithContext is the same as RevokeGrant with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeGrant for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RevokeGrantWithContext(ctx aws.Context, input *RevokeGrantInput, opts ...request.Option) (*RevokeGrantOutput, error) { + req, out := c.RevokeGrantRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opScheduleKeyDeletion = "ScheduleKeyDeletion" @@ -3105,8 +3656,23 @@ func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletion func (c *KMS) ScheduleKeyDeletion(input *ScheduleKeyDeletionInput) (*ScheduleKeyDeletionOutput, error) { req, out := c.ScheduleKeyDeletionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ScheduleKeyDeletionWithContext is the same as ScheduleKeyDeletion with the addition of +// the ability to pass a context and additional request options. +// +// See ScheduleKeyDeletion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ScheduleKeyDeletionWithContext(ctx aws.Context, input *ScheduleKeyDeletionInput, opts ...request.Option) (*ScheduleKeyDeletionOutput, error) { + req, out := c.ScheduleKeyDeletionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTagResource = "TagResource" @@ -3206,8 +3772,23 @@ func (c *KMS) TagResourceRequest(input *TagResourceInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/TagResource func (c *KMS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { req, out := c.TagResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUntagResource = "UntagResource" @@ -3297,8 +3878,23 @@ func (c *KMS) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UntagResource func (c *KMS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { req, out := c.UntagResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAlias = "UpdateAlias" @@ -3393,8 +3989,23 @@ func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAlias func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) { req, out := c.UpdateAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAliasWithContext is the same as UpdateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAliasWithContext(ctx aws.Context, input *UpdateAliasInput, opts ...request.Option) (*UpdateAliasOutput, error) { + req, out := c.UpdateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateKeyDescription = "UpdateKeyDescription" @@ -3480,8 +4091,23 @@ func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescription func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error) { req, out := c.UpdateKeyDescriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateKeyDescriptionWithContext is the same as UpdateKeyDescription with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateKeyDescription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateKeyDescriptionWithContext(ctx aws.Context, input *UpdateKeyDescriptionInput, opts ...request.Option) (*UpdateKeyDescriptionOutput, error) { + req, out := c.UpdateKeyDescriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Contains information about an alias. diff --git a/vendor/github.com/aws/aws-sdk-go/service/kms/errors.go b/vendor/github.com/aws/aws-sdk-go/service/kms/errors.go index 474ae6baf..0358c9443 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kms/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kms/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package kms diff --git a/vendor/github.com/aws/aws-sdk-go/service/kms/service.go b/vendor/github.com/aws/aws-sdk-go/service/kms/service.go index b4688cad3..10aeb248f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kms/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kms/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package kms diff --git a/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go b/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go index 4a215f4eb..23e0ecd6c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package lambda provides a client for AWS Lambda. package lambda @@ -7,6 +7,7 @@ import ( "io" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -102,8 +103,23 @@ func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.R // func (c *Lambda) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) { req, out := c.AddPermissionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddPermissionWithContext is the same as AddPermission with the addition of +// the ability to pass a context and additional request options. +// +// See AddPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddPermissionWithContext(ctx aws.Context, input *AddPermissionInput, opts ...request.Option) (*AddPermissionOutput, error) { + req, out := c.AddPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAlias = "CreateAlias" @@ -182,8 +198,23 @@ func (c *Lambda) CreateAliasRequest(input *CreateAliasInput) (req *request.Reque // func (c *Lambda) CreateAlias(input *CreateAliasInput) (*AliasConfiguration, error) { req, out := c.CreateAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAliasWithContext is the same as CreateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAliasWithContext(ctx aws.Context, input *CreateAliasInput, opts ...request.Option) (*AliasConfiguration, error) { + req, out := c.CreateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateEventSourceMapping = "CreateEventSourceMapping" @@ -282,8 +313,23 @@ func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMapping // func (c *Lambda) CreateEventSourceMapping(input *CreateEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { req, out := c.CreateEventSourceMappingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateEventSourceMappingWithContext is the same as CreateEventSourceMapping with the addition of +// the ability to pass a context and additional request options. +// +// See CreateEventSourceMapping for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateEventSourceMappingWithContext(ctx aws.Context, input *CreateEventSourceMappingInput, opts ...request.Option) (*EventSourceMappingConfiguration, error) { + req, out := c.CreateEventSourceMappingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateFunction = "CreateFunction" @@ -370,8 +416,23 @@ func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request // func (c *Lambda) CreateFunction(input *CreateFunctionInput) (*FunctionConfiguration, error) { req, out := c.CreateFunctionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateFunctionWithContext is the same as CreateFunction with the addition of +// the ability to pass a context and additional request options. +// +// See CreateFunction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateFunctionWithContext(ctx aws.Context, input *CreateFunctionInput, opts ...request.Option) (*FunctionConfiguration, error) { + req, out := c.CreateFunctionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAlias = "DeleteAlias" @@ -444,8 +505,23 @@ func (c *Lambda) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Reque // func (c *Lambda) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { req, out := c.DeleteAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAliasWithContext is the same as DeleteAlias with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAliasWithContext(ctx aws.Context, input *DeleteAliasInput, opts ...request.Option) (*DeleteAliasOutput, error) { + req, out := c.DeleteAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteEventSourceMapping = "DeleteEventSourceMapping" @@ -521,8 +597,23 @@ func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMapping // func (c *Lambda) DeleteEventSourceMapping(input *DeleteEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { req, out := c.DeleteEventSourceMappingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteEventSourceMappingWithContext is the same as DeleteEventSourceMapping with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteEventSourceMapping for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteEventSourceMappingWithContext(ctx aws.Context, input *DeleteEventSourceMappingInput, opts ...request.Option) (*EventSourceMappingConfiguration, error) { + req, out := c.DeleteEventSourceMappingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteFunction = "DeleteFunction" @@ -611,8 +702,23 @@ func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) (req *request // func (c *Lambda) DeleteFunction(input *DeleteFunctionInput) (*DeleteFunctionOutput, error) { req, out := c.DeleteFunctionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteFunctionWithContext is the same as DeleteFunction with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteFunction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteFunctionWithContext(ctx aws.Context, input *DeleteFunctionInput, opts ...request.Option) (*DeleteFunctionOutput, error) { + req, out := c.DeleteFunctionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetAccountSettings = "GetAccountSettings" @@ -681,8 +787,23 @@ func (c *Lambda) GetAccountSettingsRequest(input *GetAccountSettingsInput) (req // func (c *Lambda) GetAccountSettings(input *GetAccountSettingsInput) (*GetAccountSettingsOutput, error) { req, out := c.GetAccountSettingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAccountSettingsWithContext is the same as GetAccountSettings with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccountSettings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAccountSettingsWithContext(ctx aws.Context, input *GetAccountSettingsInput, opts ...request.Option) (*GetAccountSettingsOutput, error) { + req, out := c.GetAccountSettingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetAlias = "GetAlias" @@ -758,8 +879,23 @@ func (c *Lambda) GetAliasRequest(input *GetAliasInput) (req *request.Request, ou // func (c *Lambda) GetAlias(input *GetAliasInput) (*AliasConfiguration, error) { req, out := c.GetAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAliasWithContext is the same as GetAlias with the addition of +// the ability to pass a context and additional request options. +// +// See GetAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAliasWithContext(ctx aws.Context, input *GetAliasInput, opts ...request.Option) (*AliasConfiguration, error) { + req, out := c.GetAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetEventSourceMapping = "GetEventSourceMapping" @@ -834,8 +970,23 @@ func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput) // func (c *Lambda) GetEventSourceMapping(input *GetEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { req, out := c.GetEventSourceMappingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetEventSourceMappingWithContext is the same as GetEventSourceMapping with the addition of +// the ability to pass a context and additional request options. +// +// See GetEventSourceMapping for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetEventSourceMappingWithContext(ctx aws.Context, input *GetEventSourceMappingInput, opts ...request.Option) (*EventSourceMappingConfiguration, error) { + req, out := c.GetEventSourceMappingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetFunction = "GetFunction" @@ -919,8 +1070,23 @@ func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) (req *request.Reque // func (c *Lambda) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error) { req, out := c.GetFunctionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetFunctionWithContext is the same as GetFunction with the addition of +// the ability to pass a context and additional request options. +// +// See GetFunction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetFunctionWithContext(ctx aws.Context, input *GetFunctionInput, opts ...request.Option) (*GetFunctionOutput, error) { + req, out := c.GetFunctionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetFunctionConfiguration = "GetFunctionConfiguration" @@ -1004,8 +1170,23 @@ func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfiguration // func (c *Lambda) GetFunctionConfiguration(input *GetFunctionConfigurationInput) (*FunctionConfiguration, error) { req, out := c.GetFunctionConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetFunctionConfigurationWithContext is the same as GetFunctionConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetFunctionConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetFunctionConfigurationWithContext(ctx aws.Context, input *GetFunctionConfigurationInput, opts ...request.Option) (*FunctionConfiguration, error) { + req, out := c.GetFunctionConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPolicy = "GetPolicy" @@ -1086,8 +1267,23 @@ func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, // func (c *Lambda) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) { req, out := c.GetPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPolicyWithContext is the same as GetPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetPolicyWithContext(ctx aws.Context, input *GetPolicyInput, opts ...request.Option) (*GetPolicyOutput, error) { + req, out := c.GetPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opInvoke = "Invoke" @@ -1225,8 +1421,23 @@ func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output // func (c *Lambda) Invoke(input *InvokeInput) (*InvokeOutput, error) { req, out := c.InvokeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// InvokeWithContext is the same as Invoke with the addition of +// the ability to pass a context and additional request options. +// +// See Invoke for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) InvokeWithContext(ctx aws.Context, input *InvokeInput, opts ...request.Option) (*InvokeOutput, error) { + req, out := c.InvokeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opInvokeAsync = "InvokeAsync" @@ -1303,8 +1514,23 @@ func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) (req *request.Reque // func (c *Lambda) InvokeAsync(input *InvokeAsyncInput) (*InvokeAsyncOutput, error) { req, out := c.InvokeAsyncRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// InvokeAsyncWithContext is the same as InvokeAsync with the addition of +// the ability to pass a context and additional request options. +// +// See InvokeAsync for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) InvokeAsyncWithContext(ctx aws.Context, input *InvokeAsyncInput, opts ...request.Option) (*InvokeAsyncOutput, error) { + req, out := c.InvokeAsyncRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAliases = "ListAliases" @@ -1381,8 +1607,23 @@ func (c *Lambda) ListAliasesRequest(input *ListAliasesInput) (req *request.Reque // func (c *Lambda) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { req, out := c.ListAliasesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAliasesWithContext is the same as ListAliases with the addition of +// the ability to pass a context and additional request options. +// +// See ListAliases for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAliasesWithContext(ctx aws.Context, input *ListAliasesInput, opts ...request.Option) (*ListAliasesOutput, error) { + req, out := c.ListAliasesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListEventSourceMappings = "ListEventSourceMappings" @@ -1472,8 +1713,23 @@ func (c *Lambda) ListEventSourceMappingsRequest(input *ListEventSourceMappingsIn // func (c *Lambda) ListEventSourceMappings(input *ListEventSourceMappingsInput) (*ListEventSourceMappingsOutput, error) { req, out := c.ListEventSourceMappingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListEventSourceMappingsWithContext is the same as ListEventSourceMappings with the addition of +// the ability to pass a context and additional request options. +// +// See ListEventSourceMappings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListEventSourceMappingsWithContext(ctx aws.Context, input *ListEventSourceMappingsInput, opts ...request.Option) (*ListEventSourceMappingsOutput, error) { + req, out := c.ListEventSourceMappingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListEventSourceMappingsPages iterates over the pages of a ListEventSourceMappings operation, @@ -1493,12 +1749,37 @@ func (c *Lambda) ListEventSourceMappings(input *ListEventSourceMappingsInput) (* // return pageNum <= 3 // }) // -func (c *Lambda) ListEventSourceMappingsPages(input *ListEventSourceMappingsInput, fn func(p *ListEventSourceMappingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListEventSourceMappingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListEventSourceMappingsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListEventSourceMappingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListEventSourceMappingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListEventSourceMappingsOutput), !p.HasNextPage()) + } + return p.Err() } const opListFunctions = "ListFunctions" @@ -1575,8 +1856,23 @@ func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.R // func (c *Lambda) ListFunctions(input *ListFunctionsInput) (*ListFunctionsOutput, error) { req, out := c.ListFunctionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListFunctionsWithContext is the same as ListFunctions with the addition of +// the ability to pass a context and additional request options. +// +// See ListFunctions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListFunctionsWithContext(ctx aws.Context, input *ListFunctionsInput, opts ...request.Option) (*ListFunctionsOutput, error) { + req, out := c.ListFunctionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListFunctionsPages iterates over the pages of a ListFunctions operation, @@ -1596,12 +1892,37 @@ func (c *Lambda) ListFunctions(input *ListFunctionsInput) (*ListFunctionsOutput, // return pageNum <= 3 // }) // -func (c *Lambda) ListFunctionsPages(input *ListFunctionsInput, fn func(p *ListFunctionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListFunctionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListFunctionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListFunctionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListFunctionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListFunctionsOutput), !p.HasNextPage()) + } + return p.Err() } const opListVersionsByFunction = "ListVersionsByFunction" @@ -1674,8 +1995,23 @@ func (c *Lambda) ListVersionsByFunctionRequest(input *ListVersionsByFunctionInpu // func (c *Lambda) ListVersionsByFunction(input *ListVersionsByFunctionInput) (*ListVersionsByFunctionOutput, error) { req, out := c.ListVersionsByFunctionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListVersionsByFunctionWithContext is the same as ListVersionsByFunction with the addition of +// the ability to pass a context and additional request options. +// +// See ListVersionsByFunction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListVersionsByFunctionWithContext(ctx aws.Context, input *ListVersionsByFunctionInput, opts ...request.Option) (*ListVersionsByFunctionOutput, error) { + req, out := c.ListVersionsByFunctionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPublishVersion = "PublishVersion" @@ -1754,8 +2090,23 @@ func (c *Lambda) PublishVersionRequest(input *PublishVersionInput) (req *request // func (c *Lambda) PublishVersion(input *PublishVersionInput) (*FunctionConfiguration, error) { req, out := c.PublishVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PublishVersionWithContext is the same as PublishVersion with the addition of +// the ability to pass a context and additional request options. +// +// See PublishVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PublishVersionWithContext(ctx aws.Context, input *PublishVersionInput, opts ...request.Option) (*FunctionConfiguration, error) { + req, out := c.PublishVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemovePermission = "RemovePermission" @@ -1841,8 +2192,23 @@ func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) (req *req // func (c *Lambda) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { req, out := c.RemovePermissionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemovePermissionWithContext is the same as RemovePermission with the addition of +// the ability to pass a context and additional request options. +// +// See RemovePermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) { + req, out := c.RemovePermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAlias = "UpdateAlias" @@ -1918,8 +2284,23 @@ func (c *Lambda) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Reque // func (c *Lambda) UpdateAlias(input *UpdateAliasInput) (*AliasConfiguration, error) { req, out := c.UpdateAliasRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAliasWithContext is the same as UpdateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAliasWithContext(ctx aws.Context, input *UpdateAliasInput, opts ...request.Option) (*AliasConfiguration, error) { + req, out := c.UpdateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateEventSourceMapping = "UpdateEventSourceMapping" @@ -2010,8 +2391,23 @@ func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMapping // func (c *Lambda) UpdateEventSourceMapping(input *UpdateEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { req, out := c.UpdateEventSourceMappingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateEventSourceMappingWithContext is the same as UpdateEventSourceMapping with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateEventSourceMapping for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateEventSourceMappingWithContext(ctx aws.Context, input *UpdateEventSourceMappingInput, opts ...request.Option) (*EventSourceMappingConfiguration, error) { + req, out := c.UpdateEventSourceMappingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateFunctionCode = "UpdateFunctionCode" @@ -2094,8 +2490,23 @@ func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) (req // func (c *Lambda) UpdateFunctionCode(input *UpdateFunctionCodeInput) (*FunctionConfiguration, error) { req, out := c.UpdateFunctionCodeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateFunctionCodeWithContext is the same as UpdateFunctionCode with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateFunctionCode for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateFunctionCodeWithContext(ctx aws.Context, input *UpdateFunctionCodeInput, opts ...request.Option) (*FunctionConfiguration, error) { + req, out := c.UpdateFunctionCodeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateFunctionConfiguration = "UpdateFunctionConfiguration" @@ -2177,8 +2588,23 @@ func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigu // func (c *Lambda) UpdateFunctionConfiguration(input *UpdateFunctionConfigurationInput) (*FunctionConfiguration, error) { req, out := c.UpdateFunctionConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateFunctionConfigurationWithContext is the same as UpdateFunctionConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateFunctionConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateFunctionConfigurationWithContext(ctx aws.Context, input *UpdateFunctionConfigurationInput, opts ...request.Option) (*FunctionConfiguration, error) { + req, out := c.UpdateFunctionConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Provides limits of code size and concurrency associated with the current @@ -5422,6 +5848,9 @@ const ( // RuntimeNodejs43 is a Runtime enum value RuntimeNodejs43 = "nodejs4.3" + // RuntimeNodejs610 is a Runtime enum value + RuntimeNodejs610 = "nodejs6.10" + // RuntimeJava8 is a Runtime enum value RuntimeJava8 = "java8" diff --git a/vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go b/vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go index 1f9a11b6b..7ff426888 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package lambda diff --git a/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go b/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go index abb46faa3..619c583f6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package lambda diff --git a/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go b/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go index 06a44736e..b61e0eaad 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package lightsail provides a client for Amazon Lightsail. package lightsail @@ -6,6 +6,7 @@ package lightsail import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -92,8 +93,23 @@ func (c *Lightsail) AllocateStaticIpRequest(input *AllocateStaticIpInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIp func (c *Lightsail) AllocateStaticIp(input *AllocateStaticIpInput) (*AllocateStaticIpOutput, error) { req, out := c.AllocateStaticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AllocateStaticIpWithContext is the same as AllocateStaticIp with the addition of +// the ability to pass a context and additional request options. +// +// See AllocateStaticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) AllocateStaticIpWithContext(ctx aws.Context, input *AllocateStaticIpInput, opts ...request.Option) (*AllocateStaticIpOutput, error) { + req, out := c.AllocateStaticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachStaticIp = "AttachStaticIp" @@ -178,8 +194,23 @@ func (c *Lightsail) AttachStaticIpRequest(input *AttachStaticIpInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachStaticIp func (c *Lightsail) AttachStaticIp(input *AttachStaticIpInput) (*AttachStaticIpOutput, error) { req, out := c.AttachStaticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachStaticIpWithContext is the same as AttachStaticIp with the addition of +// the ability to pass a context and additional request options. +// +// See AttachStaticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) AttachStaticIpWithContext(ctx aws.Context, input *AttachStaticIpInput, opts ...request.Option) (*AttachStaticIpOutput, error) { + req, out := c.AttachStaticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCloseInstancePublicPorts = "CloseInstancePublicPorts" @@ -264,8 +295,23 @@ func (c *Lightsail) CloseInstancePublicPortsRequest(input *CloseInstancePublicPo // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CloseInstancePublicPorts func (c *Lightsail) CloseInstancePublicPorts(input *CloseInstancePublicPortsInput) (*CloseInstancePublicPortsOutput, error) { req, out := c.CloseInstancePublicPortsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CloseInstancePublicPortsWithContext is the same as CloseInstancePublicPorts with the addition of +// the ability to pass a context and additional request options. +// +// See CloseInstancePublicPorts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) CloseInstancePublicPortsWithContext(ctx aws.Context, input *CloseInstancePublicPortsInput, opts ...request.Option) (*CloseInstancePublicPortsOutput, error) { + req, out := c.CloseInstancePublicPortsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDomain = "CreateDomain" @@ -350,8 +396,23 @@ func (c *Lightsail) CreateDomainRequest(input *CreateDomainInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomain func (c *Lightsail) CreateDomain(input *CreateDomainInput) (*CreateDomainOutput, error) { req, out := c.CreateDomainRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDomainWithContext is the same as CreateDomain with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) CreateDomainWithContext(ctx aws.Context, input *CreateDomainInput, opts ...request.Option) (*CreateDomainOutput, error) { + req, out := c.CreateDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDomainEntry = "CreateDomainEntry" @@ -437,8 +498,23 @@ func (c *Lightsail) CreateDomainEntryRequest(input *CreateDomainEntryInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainEntry func (c *Lightsail) CreateDomainEntry(input *CreateDomainEntryInput) (*CreateDomainEntryOutput, error) { req, out := c.CreateDomainEntryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDomainEntryWithContext is the same as CreateDomainEntry with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDomainEntry for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) CreateDomainEntryWithContext(ctx aws.Context, input *CreateDomainEntryInput, opts ...request.Option) (*CreateDomainEntryOutput, error) { + req, out := c.CreateDomainEntryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateInstanceSnapshot = "CreateInstanceSnapshot" @@ -524,8 +600,23 @@ func (c *Lightsail) CreateInstanceSnapshotRequest(input *CreateInstanceSnapshotI // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstanceSnapshot func (c *Lightsail) CreateInstanceSnapshot(input *CreateInstanceSnapshotInput) (*CreateInstanceSnapshotOutput, error) { req, out := c.CreateInstanceSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateInstanceSnapshotWithContext is the same as CreateInstanceSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInstanceSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) CreateInstanceSnapshotWithContext(ctx aws.Context, input *CreateInstanceSnapshotInput, opts ...request.Option) (*CreateInstanceSnapshotOutput, error) { + req, out := c.CreateInstanceSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateInstances = "CreateInstances" @@ -610,8 +701,23 @@ func (c *Lightsail) CreateInstancesRequest(input *CreateInstancesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstances func (c *Lightsail) CreateInstances(input *CreateInstancesInput) (*CreateInstancesOutput, error) { req, out := c.CreateInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateInstancesWithContext is the same as CreateInstances with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) CreateInstancesWithContext(ctx aws.Context, input *CreateInstancesInput, opts ...request.Option) (*CreateInstancesOutput, error) { + req, out := c.CreateInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateInstancesFromSnapshot = "CreateInstancesFromSnapshot" @@ -697,8 +803,23 @@ func (c *Lightsail) CreateInstancesFromSnapshotRequest(input *CreateInstancesFro // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesFromSnapshot func (c *Lightsail) CreateInstancesFromSnapshot(input *CreateInstancesFromSnapshotInput) (*CreateInstancesFromSnapshotOutput, error) { req, out := c.CreateInstancesFromSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateInstancesFromSnapshotWithContext is the same as CreateInstancesFromSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInstancesFromSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) CreateInstancesFromSnapshotWithContext(ctx aws.Context, input *CreateInstancesFromSnapshotInput, opts ...request.Option) (*CreateInstancesFromSnapshotOutput, error) { + req, out := c.CreateInstancesFromSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateKeyPair = "CreateKeyPair" @@ -783,8 +904,23 @@ func (c *Lightsail) CreateKeyPairRequest(input *CreateKeyPairInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateKeyPair func (c *Lightsail) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, error) { req, out := c.CreateKeyPairRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateKeyPairWithContext is the same as CreateKeyPair with the addition of +// the ability to pass a context and additional request options. +// +// See CreateKeyPair for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) CreateKeyPairWithContext(ctx aws.Context, input *CreateKeyPairInput, opts ...request.Option) (*CreateKeyPairOutput, error) { + req, out := c.CreateKeyPairRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDomain = "DeleteDomain" @@ -869,8 +1005,23 @@ func (c *Lightsail) DeleteDomainRequest(input *DeleteDomainInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomain func (c *Lightsail) DeleteDomain(input *DeleteDomainInput) (*DeleteDomainOutput, error) { req, out := c.DeleteDomainRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDomainWithContext is the same as DeleteDomain with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) DeleteDomainWithContext(ctx aws.Context, input *DeleteDomainInput, opts ...request.Option) (*DeleteDomainOutput, error) { + req, out := c.DeleteDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDomainEntry = "DeleteDomainEntry" @@ -955,8 +1106,23 @@ func (c *Lightsail) DeleteDomainEntryRequest(input *DeleteDomainEntryInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainEntry func (c *Lightsail) DeleteDomainEntry(input *DeleteDomainEntryInput) (*DeleteDomainEntryOutput, error) { req, out := c.DeleteDomainEntryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDomainEntryWithContext is the same as DeleteDomainEntry with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDomainEntry for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) DeleteDomainEntryWithContext(ctx aws.Context, input *DeleteDomainEntryInput, opts ...request.Option) (*DeleteDomainEntryOutput, error) { + req, out := c.DeleteDomainEntryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteInstance = "DeleteInstance" @@ -1041,8 +1207,23 @@ func (c *Lightsail) DeleteInstanceRequest(input *DeleteInstanceInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstance func (c *Lightsail) DeleteInstance(input *DeleteInstanceInput) (*DeleteInstanceOutput, error) { req, out := c.DeleteInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteInstanceWithContext is the same as DeleteInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) DeleteInstanceWithContext(ctx aws.Context, input *DeleteInstanceInput, opts ...request.Option) (*DeleteInstanceOutput, error) { + req, out := c.DeleteInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteInstanceSnapshot = "DeleteInstanceSnapshot" @@ -1127,8 +1308,23 @@ func (c *Lightsail) DeleteInstanceSnapshotRequest(input *DeleteInstanceSnapshotI // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceSnapshot func (c *Lightsail) DeleteInstanceSnapshot(input *DeleteInstanceSnapshotInput) (*DeleteInstanceSnapshotOutput, error) { req, out := c.DeleteInstanceSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteInstanceSnapshotWithContext is the same as DeleteInstanceSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteInstanceSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) DeleteInstanceSnapshotWithContext(ctx aws.Context, input *DeleteInstanceSnapshotInput, opts ...request.Option) (*DeleteInstanceSnapshotOutput, error) { + req, out := c.DeleteInstanceSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteKeyPair = "DeleteKeyPair" @@ -1213,8 +1409,23 @@ func (c *Lightsail) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKeyPair func (c *Lightsail) DeleteKeyPair(input *DeleteKeyPairInput) (*DeleteKeyPairOutput, error) { req, out := c.DeleteKeyPairRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteKeyPairWithContext is the same as DeleteKeyPair with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteKeyPair for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) DeleteKeyPairWithContext(ctx aws.Context, input *DeleteKeyPairInput, opts ...request.Option) (*DeleteKeyPairOutput, error) { + req, out := c.DeleteKeyPairRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachStaticIp = "DetachStaticIp" @@ -1299,8 +1510,23 @@ func (c *Lightsail) DetachStaticIpRequest(input *DetachStaticIpInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachStaticIp func (c *Lightsail) DetachStaticIp(input *DetachStaticIpInput) (*DetachStaticIpOutput, error) { req, out := c.DetachStaticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachStaticIpWithContext is the same as DetachStaticIp with the addition of +// the ability to pass a context and additional request options. +// +// See DetachStaticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) DetachStaticIpWithContext(ctx aws.Context, input *DetachStaticIpInput, opts ...request.Option) (*DetachStaticIpOutput, error) { + req, out := c.DetachStaticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDownloadDefaultKeyPair = "DownloadDefaultKeyPair" @@ -1385,8 +1611,23 @@ func (c *Lightsail) DownloadDefaultKeyPairRequest(input *DownloadDefaultKeyPairI // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DownloadDefaultKeyPair func (c *Lightsail) DownloadDefaultKeyPair(input *DownloadDefaultKeyPairInput) (*DownloadDefaultKeyPairOutput, error) { req, out := c.DownloadDefaultKeyPairRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DownloadDefaultKeyPairWithContext is the same as DownloadDefaultKeyPair with the addition of +// the ability to pass a context and additional request options. +// +// See DownloadDefaultKeyPair for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) DownloadDefaultKeyPairWithContext(ctx aws.Context, input *DownloadDefaultKeyPairInput, opts ...request.Option) (*DownloadDefaultKeyPairOutput, error) { + req, out := c.DownloadDefaultKeyPairRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetActiveNames = "GetActiveNames" @@ -1471,8 +1712,23 @@ func (c *Lightsail) GetActiveNamesRequest(input *GetActiveNamesInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetActiveNames func (c *Lightsail) GetActiveNames(input *GetActiveNamesInput) (*GetActiveNamesOutput, error) { req, out := c.GetActiveNamesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetActiveNamesWithContext is the same as GetActiveNames with the addition of +// the ability to pass a context and additional request options. +// +// See GetActiveNames for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetActiveNamesWithContext(ctx aws.Context, input *GetActiveNamesInput, opts ...request.Option) (*GetActiveNamesOutput, error) { + req, out := c.GetActiveNamesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBlueprints = "GetBlueprints" @@ -1560,8 +1816,23 @@ func (c *Lightsail) GetBlueprintsRequest(input *GetBlueprintsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBlueprints func (c *Lightsail) GetBlueprints(input *GetBlueprintsInput) (*GetBlueprintsOutput, error) { req, out := c.GetBlueprintsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBlueprintsWithContext is the same as GetBlueprints with the addition of +// the ability to pass a context and additional request options. +// +// See GetBlueprints for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetBlueprintsWithContext(ctx aws.Context, input *GetBlueprintsInput, opts ...request.Option) (*GetBlueprintsOutput, error) { + req, out := c.GetBlueprintsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBundles = "GetBundles" @@ -1647,8 +1918,23 @@ func (c *Lightsail) GetBundlesRequest(input *GetBundlesInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBundles func (c *Lightsail) GetBundles(input *GetBundlesInput) (*GetBundlesOutput, error) { req, out := c.GetBundlesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBundlesWithContext is the same as GetBundles with the addition of +// the ability to pass a context and additional request options. +// +// See GetBundles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetBundlesWithContext(ctx aws.Context, input *GetBundlesInput, opts ...request.Option) (*GetBundlesOutput, error) { + req, out := c.GetBundlesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDomain = "GetDomain" @@ -1733,8 +2019,23 @@ func (c *Lightsail) GetDomainRequest(input *GetDomainInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomain func (c *Lightsail) GetDomain(input *GetDomainInput) (*GetDomainOutput, error) { req, out := c.GetDomainRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDomainWithContext is the same as GetDomain with the addition of +// the ability to pass a context and additional request options. +// +// See GetDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetDomainWithContext(ctx aws.Context, input *GetDomainInput, opts ...request.Option) (*GetDomainOutput, error) { + req, out := c.GetDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDomains = "GetDomains" @@ -1819,8 +2120,23 @@ func (c *Lightsail) GetDomainsRequest(input *GetDomainsInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomains func (c *Lightsail) GetDomains(input *GetDomainsInput) (*GetDomainsOutput, error) { req, out := c.GetDomainsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDomainsWithContext is the same as GetDomains with the addition of +// the ability to pass a context and additional request options. +// +// See GetDomains for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetDomainsWithContext(ctx aws.Context, input *GetDomainsInput, opts ...request.Option) (*GetDomainsOutput, error) { + req, out := c.GetDomainsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInstance = "GetInstance" @@ -1906,8 +2222,23 @@ func (c *Lightsail) GetInstanceRequest(input *GetInstanceInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstance func (c *Lightsail) GetInstance(input *GetInstanceInput) (*GetInstanceOutput, error) { req, out := c.GetInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInstanceWithContext is the same as GetInstance with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetInstanceWithContext(ctx aws.Context, input *GetInstanceInput, opts ...request.Option) (*GetInstanceOutput, error) { + req, out := c.GetInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInstanceAccessDetails = "GetInstanceAccessDetails" @@ -1993,8 +2324,23 @@ func (c *Lightsail) GetInstanceAccessDetailsRequest(input *GetInstanceAccessDeta // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceAccessDetails func (c *Lightsail) GetInstanceAccessDetails(input *GetInstanceAccessDetailsInput) (*GetInstanceAccessDetailsOutput, error) { req, out := c.GetInstanceAccessDetailsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInstanceAccessDetailsWithContext is the same as GetInstanceAccessDetails with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstanceAccessDetails for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetInstanceAccessDetailsWithContext(ctx aws.Context, input *GetInstanceAccessDetailsInput, opts ...request.Option) (*GetInstanceAccessDetailsOutput, error) { + req, out := c.GetInstanceAccessDetailsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInstanceMetricData = "GetInstanceMetricData" @@ -2080,8 +2426,23 @@ func (c *Lightsail) GetInstanceMetricDataRequest(input *GetInstanceMetricDataInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceMetricData func (c *Lightsail) GetInstanceMetricData(input *GetInstanceMetricDataInput) (*GetInstanceMetricDataOutput, error) { req, out := c.GetInstanceMetricDataRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInstanceMetricDataWithContext is the same as GetInstanceMetricData with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstanceMetricData for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetInstanceMetricDataWithContext(ctx aws.Context, input *GetInstanceMetricDataInput, opts ...request.Option) (*GetInstanceMetricDataOutput, error) { + req, out := c.GetInstanceMetricDataRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInstancePortStates = "GetInstancePortStates" @@ -2166,8 +2527,23 @@ func (c *Lightsail) GetInstancePortStatesRequest(input *GetInstancePortStatesInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancePortStates func (c *Lightsail) GetInstancePortStates(input *GetInstancePortStatesInput) (*GetInstancePortStatesOutput, error) { req, out := c.GetInstancePortStatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInstancePortStatesWithContext is the same as GetInstancePortStates with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstancePortStates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetInstancePortStatesWithContext(ctx aws.Context, input *GetInstancePortStatesInput, opts ...request.Option) (*GetInstancePortStatesOutput, error) { + req, out := c.GetInstancePortStatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInstanceSnapshot = "GetInstanceSnapshot" @@ -2252,8 +2628,23 @@ func (c *Lightsail) GetInstanceSnapshotRequest(input *GetInstanceSnapshotInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshot func (c *Lightsail) GetInstanceSnapshot(input *GetInstanceSnapshotInput) (*GetInstanceSnapshotOutput, error) { req, out := c.GetInstanceSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInstanceSnapshotWithContext is the same as GetInstanceSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstanceSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetInstanceSnapshotWithContext(ctx aws.Context, input *GetInstanceSnapshotInput, opts ...request.Option) (*GetInstanceSnapshotOutput, error) { + req, out := c.GetInstanceSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInstanceSnapshots = "GetInstanceSnapshots" @@ -2338,8 +2729,23 @@ func (c *Lightsail) GetInstanceSnapshotsRequest(input *GetInstanceSnapshotsInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshots func (c *Lightsail) GetInstanceSnapshots(input *GetInstanceSnapshotsInput) (*GetInstanceSnapshotsOutput, error) { req, out := c.GetInstanceSnapshotsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInstanceSnapshotsWithContext is the same as GetInstanceSnapshots with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstanceSnapshots for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetInstanceSnapshotsWithContext(ctx aws.Context, input *GetInstanceSnapshotsInput, opts ...request.Option) (*GetInstanceSnapshotsOutput, error) { + req, out := c.GetInstanceSnapshotsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInstanceState = "GetInstanceState" @@ -2424,8 +2830,23 @@ func (c *Lightsail) GetInstanceStateRequest(input *GetInstanceStateInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceState func (c *Lightsail) GetInstanceState(input *GetInstanceStateInput) (*GetInstanceStateOutput, error) { req, out := c.GetInstanceStateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInstanceStateWithContext is the same as GetInstanceState with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstanceState for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetInstanceStateWithContext(ctx aws.Context, input *GetInstanceStateInput, opts ...request.Option) (*GetInstanceStateOutput, error) { + req, out := c.GetInstanceStateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInstances = "GetInstances" @@ -2511,8 +2932,23 @@ func (c *Lightsail) GetInstancesRequest(input *GetInstancesInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstances func (c *Lightsail) GetInstances(input *GetInstancesInput) (*GetInstancesOutput, error) { req, out := c.GetInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInstancesWithContext is the same as GetInstances with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetInstancesWithContext(ctx aws.Context, input *GetInstancesInput, opts ...request.Option) (*GetInstancesOutput, error) { + req, out := c.GetInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetKeyPair = "GetKeyPair" @@ -2597,8 +3033,23 @@ func (c *Lightsail) GetKeyPairRequest(input *GetKeyPairInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPair func (c *Lightsail) GetKeyPair(input *GetKeyPairInput) (*GetKeyPairOutput, error) { req, out := c.GetKeyPairRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetKeyPairWithContext is the same as GetKeyPair with the addition of +// the ability to pass a context and additional request options. +// +// See GetKeyPair for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetKeyPairWithContext(ctx aws.Context, input *GetKeyPairInput, opts ...request.Option) (*GetKeyPairOutput, error) { + req, out := c.GetKeyPairRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetKeyPairs = "GetKeyPairs" @@ -2683,8 +3134,23 @@ func (c *Lightsail) GetKeyPairsRequest(input *GetKeyPairsInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairs func (c *Lightsail) GetKeyPairs(input *GetKeyPairsInput) (*GetKeyPairsOutput, error) { req, out := c.GetKeyPairsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetKeyPairsWithContext is the same as GetKeyPairs with the addition of +// the ability to pass a context and additional request options. +// +// See GetKeyPairs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetKeyPairsWithContext(ctx aws.Context, input *GetKeyPairsInput, opts ...request.Option) (*GetKeyPairsOutput, error) { + req, out := c.GetKeyPairsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetOperation = "GetOperation" @@ -2771,8 +3237,23 @@ func (c *Lightsail) GetOperationRequest(input *GetOperationInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperation func (c *Lightsail) GetOperation(input *GetOperationInput) (*GetOperationOutput, error) { req, out := c.GetOperationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetOperationWithContext is the same as GetOperation with the addition of +// the ability to pass a context and additional request options. +// +// See GetOperation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetOperationWithContext(ctx aws.Context, input *GetOperationInput, opts ...request.Option) (*GetOperationOutput, error) { + req, out := c.GetOperationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetOperations = "GetOperations" @@ -2861,8 +3342,23 @@ func (c *Lightsail) GetOperationsRequest(input *GetOperationsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperations func (c *Lightsail) GetOperations(input *GetOperationsInput) (*GetOperationsOutput, error) { req, out := c.GetOperationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetOperationsWithContext is the same as GetOperations with the addition of +// the ability to pass a context and additional request options. +// +// See GetOperations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetOperationsWithContext(ctx aws.Context, input *GetOperationsInput, opts ...request.Option) (*GetOperationsOutput, error) { + req, out := c.GetOperationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetOperationsForResource = "GetOperationsForResource" @@ -2947,8 +3443,23 @@ func (c *Lightsail) GetOperationsForResourceRequest(input *GetOperationsForResou // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsForResource func (c *Lightsail) GetOperationsForResource(input *GetOperationsForResourceInput) (*GetOperationsForResourceOutput, error) { req, out := c.GetOperationsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetOperationsForResourceWithContext is the same as GetOperationsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See GetOperationsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetOperationsForResourceWithContext(ctx aws.Context, input *GetOperationsForResourceInput, opts ...request.Option) (*GetOperationsForResourceOutput, error) { + req, out := c.GetOperationsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetRegions = "GetRegions" @@ -3033,8 +3544,23 @@ func (c *Lightsail) GetRegionsRequest(input *GetRegionsInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegions func (c *Lightsail) GetRegions(input *GetRegionsInput) (*GetRegionsOutput, error) { req, out := c.GetRegionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRegionsWithContext is the same as GetRegions with the addition of +// the ability to pass a context and additional request options. +// +// See GetRegions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetRegionsWithContext(ctx aws.Context, input *GetRegionsInput, opts ...request.Option) (*GetRegionsOutput, error) { + req, out := c.GetRegionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetStaticIp = "GetStaticIp" @@ -3119,8 +3645,23 @@ func (c *Lightsail) GetStaticIpRequest(input *GetStaticIpInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIp func (c *Lightsail) GetStaticIp(input *GetStaticIpInput) (*GetStaticIpOutput, error) { req, out := c.GetStaticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetStaticIpWithContext is the same as GetStaticIp with the addition of +// the ability to pass a context and additional request options. +// +// See GetStaticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetStaticIpWithContext(ctx aws.Context, input *GetStaticIpInput, opts ...request.Option) (*GetStaticIpOutput, error) { + req, out := c.GetStaticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetStaticIps = "GetStaticIps" @@ -3205,8 +3746,23 @@ func (c *Lightsail) GetStaticIpsRequest(input *GetStaticIpsInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIps func (c *Lightsail) GetStaticIps(input *GetStaticIpsInput) (*GetStaticIpsOutput, error) { req, out := c.GetStaticIpsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetStaticIpsWithContext is the same as GetStaticIps with the addition of +// the ability to pass a context and additional request options. +// +// See GetStaticIps for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetStaticIpsWithContext(ctx aws.Context, input *GetStaticIpsInput, opts ...request.Option) (*GetStaticIpsOutput, error) { + req, out := c.GetStaticIpsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opImportKeyPair = "ImportKeyPair" @@ -3291,8 +3847,23 @@ func (c *Lightsail) ImportKeyPairRequest(input *ImportKeyPairInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ImportKeyPair func (c *Lightsail) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, error) { req, out := c.ImportKeyPairRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ImportKeyPairWithContext is the same as ImportKeyPair with the addition of +// the ability to pass a context and additional request options. +// +// See ImportKeyPair for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) ImportKeyPairWithContext(ctx aws.Context, input *ImportKeyPairInput, opts ...request.Option) (*ImportKeyPairOutput, error) { + req, out := c.ImportKeyPairRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opIsVpcPeered = "IsVpcPeered" @@ -3377,8 +3948,23 @@ func (c *Lightsail) IsVpcPeeredRequest(input *IsVpcPeeredInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/IsVpcPeered func (c *Lightsail) IsVpcPeered(input *IsVpcPeeredInput) (*IsVpcPeeredOutput, error) { req, out := c.IsVpcPeeredRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// IsVpcPeeredWithContext is the same as IsVpcPeered with the addition of +// the ability to pass a context and additional request options. +// +// See IsVpcPeered for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) IsVpcPeeredWithContext(ctx aws.Context, input *IsVpcPeeredInput, opts ...request.Option) (*IsVpcPeeredOutput, error) { + req, out := c.IsVpcPeeredRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opOpenInstancePublicPorts = "OpenInstancePublicPorts" @@ -3463,8 +4049,23 @@ func (c *Lightsail) OpenInstancePublicPortsRequest(input *OpenInstancePublicPort // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/OpenInstancePublicPorts func (c *Lightsail) OpenInstancePublicPorts(input *OpenInstancePublicPortsInput) (*OpenInstancePublicPortsOutput, error) { req, out := c.OpenInstancePublicPortsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// OpenInstancePublicPortsWithContext is the same as OpenInstancePublicPorts with the addition of +// the ability to pass a context and additional request options. +// +// See OpenInstancePublicPorts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) OpenInstancePublicPortsWithContext(ctx aws.Context, input *OpenInstancePublicPortsInput, opts ...request.Option) (*OpenInstancePublicPortsOutput, error) { + req, out := c.OpenInstancePublicPortsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPeerVpc = "PeerVpc" @@ -3549,8 +4150,23 @@ func (c *Lightsail) PeerVpcRequest(input *PeerVpcInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PeerVpc func (c *Lightsail) PeerVpc(input *PeerVpcInput) (*PeerVpcOutput, error) { req, out := c.PeerVpcRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PeerVpcWithContext is the same as PeerVpc with the addition of +// the ability to pass a context and additional request options. +// +// See PeerVpc for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) PeerVpcWithContext(ctx aws.Context, input *PeerVpcInput, opts ...request.Option) (*PeerVpcOutput, error) { + req, out := c.PeerVpcRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRebootInstance = "RebootInstance" @@ -3638,8 +4254,23 @@ func (c *Lightsail) RebootInstanceRequest(input *RebootInstanceInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootInstance func (c *Lightsail) RebootInstance(input *RebootInstanceInput) (*RebootInstanceOutput, error) { req, out := c.RebootInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RebootInstanceWithContext is the same as RebootInstance with the addition of +// the ability to pass a context and additional request options. +// +// See RebootInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) RebootInstanceWithContext(ctx aws.Context, input *RebootInstanceInput, opts ...request.Option) (*RebootInstanceOutput, error) { + req, out := c.RebootInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReleaseStaticIp = "ReleaseStaticIp" @@ -3724,8 +4355,23 @@ func (c *Lightsail) ReleaseStaticIpRequest(input *ReleaseStaticIpInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ReleaseStaticIp func (c *Lightsail) ReleaseStaticIp(input *ReleaseStaticIpInput) (*ReleaseStaticIpOutput, error) { req, out := c.ReleaseStaticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReleaseStaticIpWithContext is the same as ReleaseStaticIp with the addition of +// the ability to pass a context and additional request options. +// +// See ReleaseStaticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) ReleaseStaticIpWithContext(ctx aws.Context, input *ReleaseStaticIpInput, opts ...request.Option) (*ReleaseStaticIpOutput, error) { + req, out := c.ReleaseStaticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartInstance = "StartInstance" @@ -3811,8 +4457,23 @@ func (c *Lightsail) StartInstanceRequest(input *StartInstanceInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstance func (c *Lightsail) StartInstance(input *StartInstanceInput) (*StartInstanceOutput, error) { req, out := c.StartInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartInstanceWithContext is the same as StartInstance with the addition of +// the ability to pass a context and additional request options. +// +// See StartInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) StartInstanceWithContext(ctx aws.Context, input *StartInstanceInput, opts ...request.Option) (*StartInstanceOutput, error) { + req, out := c.StartInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopInstance = "StopInstance" @@ -3897,8 +4558,23 @@ func (c *Lightsail) StopInstanceRequest(input *StopInstanceInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopInstance func (c *Lightsail) StopInstance(input *StopInstanceInput) (*StopInstanceOutput, error) { req, out := c.StopInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopInstanceWithContext is the same as StopInstance with the addition of +// the ability to pass a context and additional request options. +// +// See StopInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) StopInstanceWithContext(ctx aws.Context, input *StopInstanceInput, opts ...request.Option) (*StopInstanceOutput, error) { + req, out := c.StopInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUnpeerVpc = "UnpeerVpc" @@ -3983,8 +4659,23 @@ func (c *Lightsail) UnpeerVpcRequest(input *UnpeerVpcInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UnpeerVpc func (c *Lightsail) UnpeerVpc(input *UnpeerVpcInput) (*UnpeerVpcOutput, error) { req, out := c.UnpeerVpcRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UnpeerVpcWithContext is the same as UnpeerVpc with the addition of +// the ability to pass a context and additional request options. +// +// See UnpeerVpc for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) UnpeerVpcWithContext(ctx aws.Context, input *UnpeerVpcInput, opts ...request.Option) (*UnpeerVpcOutput, error) { + req, out := c.UnpeerVpcRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDomainEntry = "UpdateDomainEntry" @@ -4069,8 +4760,23 @@ func (c *Lightsail) UpdateDomainEntryRequest(input *UpdateDomainEntryInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateDomainEntry func (c *Lightsail) UpdateDomainEntry(input *UpdateDomainEntryInput) (*UpdateDomainEntryOutput, error) { req, out := c.UpdateDomainEntryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDomainEntryWithContext is the same as UpdateDomainEntry with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDomainEntry for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) UpdateDomainEntryWithContext(ctx aws.Context, input *UpdateDomainEntryInput, opts ...request.Option) (*UpdateDomainEntryOutput, error) { + req, out := c.UpdateDomainEntryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIpRequest diff --git a/vendor/github.com/aws/aws-sdk-go/service/lightsail/errors.go b/vendor/github.com/aws/aws-sdk-go/service/lightsail/errors.go index 309a86b9c..a42a1393b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lightsail/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package lightsail diff --git a/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go b/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go index c3e15def0..544902d85 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package lightsail diff --git a/vendor/github.com/aws/aws-sdk-go/service/opsworks/api.go b/vendor/github.com/aws/aws-sdk-go/service/opsworks/api.go index d0c09d284..430a492f0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/opsworks/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package opsworks provides a client for AWS OpsWorks. package opsworks @@ -6,6 +6,7 @@ package opsworks import ( "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -90,8 +91,23 @@ func (c *OpsWorks) AssignInstanceRequest(input *AssignInstanceInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignInstance func (c *OpsWorks) AssignInstance(input *AssignInstanceInput) (*AssignInstanceOutput, error) { req, out := c.AssignInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssignInstanceWithContext is the same as AssignInstance with the addition of +// the ability to pass a context and additional request options. +// +// See AssignInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssignInstanceWithContext(ctx aws.Context, input *AssignInstanceInput, opts ...request.Option) (*AssignInstanceOutput, error) { + req, out := c.AssignInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssignVolume = "AssignVolume" @@ -169,8 +185,23 @@ func (c *OpsWorks) AssignVolumeRequest(input *AssignVolumeInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignVolume func (c *OpsWorks) AssignVolume(input *AssignVolumeInput) (*AssignVolumeOutput, error) { req, out := c.AssignVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssignVolumeWithContext is the same as AssignVolume with the addition of +// the ability to pass a context and additional request options. +// +// See AssignVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssignVolumeWithContext(ctx aws.Context, input *AssignVolumeInput, opts ...request.Option) (*AssignVolumeOutput, error) { + req, out := c.AssignVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssociateElasticIp = "AssociateElasticIp" @@ -246,8 +277,23 @@ func (c *OpsWorks) AssociateElasticIpRequest(input *AssociateElasticIpInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssociateElasticIp func (c *OpsWorks) AssociateElasticIp(input *AssociateElasticIpInput) (*AssociateElasticIpOutput, error) { req, out := c.AssociateElasticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssociateElasticIpWithContext is the same as AssociateElasticIp with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateElasticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssociateElasticIpWithContext(ctx aws.Context, input *AssociateElasticIpInput, opts ...request.Option) (*AssociateElasticIpOutput, error) { + req, out := c.AssociateElasticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAttachElasticLoadBalancer = "AttachElasticLoadBalancer" @@ -326,8 +372,23 @@ func (c *OpsWorks) AttachElasticLoadBalancerRequest(input *AttachElasticLoadBala // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AttachElasticLoadBalancer func (c *OpsWorks) AttachElasticLoadBalancer(input *AttachElasticLoadBalancerInput) (*AttachElasticLoadBalancerOutput, error) { req, out := c.AttachElasticLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AttachElasticLoadBalancerWithContext is the same as AttachElasticLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See AttachElasticLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AttachElasticLoadBalancerWithContext(ctx aws.Context, input *AttachElasticLoadBalancerInput, opts ...request.Option) (*AttachElasticLoadBalancerOutput, error) { + req, out := c.AttachElasticLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCloneStack = "CloneStack" @@ -400,8 +461,23 @@ func (c *OpsWorks) CloneStackRequest(input *CloneStackInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CloneStack func (c *OpsWorks) CloneStack(input *CloneStackInput) (*CloneStackOutput, error) { req, out := c.CloneStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CloneStackWithContext is the same as CloneStack with the addition of +// the ability to pass a context and additional request options. +// +// See CloneStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CloneStackWithContext(ctx aws.Context, input *CloneStackInput, opts ...request.Option) (*CloneStackOutput, error) { + req, out := c.CloneStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateApp = "CreateApp" @@ -474,8 +550,23 @@ func (c *OpsWorks) CreateAppRequest(input *CreateAppInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateApp func (c *OpsWorks) CreateApp(input *CreateAppInput) (*CreateAppOutput, error) { req, out := c.CreateAppRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAppWithContext is the same as CreateApp with the addition of +// the ability to pass a context and additional request options. +// +// See CreateApp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAppWithContext(ctx aws.Context, input *CreateAppInput, opts ...request.Option) (*CreateAppOutput, error) { + req, out := c.CreateAppRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDeployment = "CreateDeployment" @@ -549,8 +640,23 @@ func (c *OpsWorks) CreateDeploymentRequest(input *CreateDeploymentInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateDeployment func (c *OpsWorks) CreateDeployment(input *CreateDeploymentInput) (*CreateDeploymentOutput, error) { req, out := c.CreateDeploymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDeploymentWithContext is the same as CreateDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDeploymentWithContext(ctx aws.Context, input *CreateDeploymentInput, opts ...request.Option) (*CreateDeploymentOutput, error) { + req, out := c.CreateDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateInstance = "CreateInstance" @@ -623,8 +729,23 @@ func (c *OpsWorks) CreateInstanceRequest(input *CreateInstanceInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateInstance func (c *OpsWorks) CreateInstance(input *CreateInstanceInput) (*CreateInstanceOutput, error) { req, out := c.CreateInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateInstanceWithContext is the same as CreateInstance with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateInstanceWithContext(ctx aws.Context, input *CreateInstanceInput, opts ...request.Option) (*CreateInstanceOutput, error) { + req, out := c.CreateInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateLayer = "CreateLayer" @@ -703,8 +824,23 @@ func (c *OpsWorks) CreateLayerRequest(input *CreateLayerInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateLayer func (c *OpsWorks) CreateLayer(input *CreateLayerInput) (*CreateLayerOutput, error) { req, out := c.CreateLayerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateLayerWithContext is the same as CreateLayer with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLayer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateLayerWithContext(ctx aws.Context, input *CreateLayerInput, opts ...request.Option) (*CreateLayerOutput, error) { + req, out := c.CreateLayerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateStack = "CreateStack" @@ -772,8 +908,23 @@ func (c *OpsWorks) CreateStackRequest(input *CreateStackInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateStack func (c *OpsWorks) CreateStack(input *CreateStackInput) (*CreateStackOutput, error) { req, out := c.CreateStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateStackWithContext is the same as CreateStack with the addition of +// the ability to pass a context and additional request options. +// +// See CreateStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateStackWithContext(ctx aws.Context, input *CreateStackInput, opts ...request.Option) (*CreateStackOutput, error) { + req, out := c.CreateStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateUserProfile = "CreateUserProfile" @@ -841,8 +992,23 @@ func (c *OpsWorks) CreateUserProfileRequest(input *CreateUserProfileInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateUserProfile func (c *OpsWorks) CreateUserProfile(input *CreateUserProfileInput) (*CreateUserProfileOutput, error) { req, out := c.CreateUserProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateUserProfileWithContext is the same as CreateUserProfile with the addition of +// the ability to pass a context and additional request options. +// +// See CreateUserProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateUserProfileWithContext(ctx aws.Context, input *CreateUserProfileInput, opts ...request.Option) (*CreateUserProfileOutput, error) { + req, out := c.CreateUserProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteApp = "DeleteApp" @@ -916,8 +1082,23 @@ func (c *OpsWorks) DeleteAppRequest(input *DeleteAppInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteApp func (c *OpsWorks) DeleteApp(input *DeleteAppInput) (*DeleteAppOutput, error) { req, out := c.DeleteAppRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAppWithContext is the same as DeleteApp with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteApp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAppWithContext(ctx aws.Context, input *DeleteAppInput, opts ...request.Option) (*DeleteAppOutput, error) { + req, out := c.DeleteAppRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteInstance = "DeleteInstance" @@ -994,8 +1175,23 @@ func (c *OpsWorks) DeleteInstanceRequest(input *DeleteInstanceInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteInstance func (c *OpsWorks) DeleteInstance(input *DeleteInstanceInput) (*DeleteInstanceOutput, error) { req, out := c.DeleteInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteInstanceWithContext is the same as DeleteInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteInstanceWithContext(ctx aws.Context, input *DeleteInstanceInput, opts ...request.Option) (*DeleteInstanceOutput, error) { + req, out := c.DeleteInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteLayer = "DeleteLayer" @@ -1071,8 +1267,23 @@ func (c *OpsWorks) DeleteLayerRequest(input *DeleteLayerInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteLayer func (c *OpsWorks) DeleteLayer(input *DeleteLayerInput) (*DeleteLayerOutput, error) { req, out := c.DeleteLayerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteLayerWithContext is the same as DeleteLayer with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLayer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteLayerWithContext(ctx aws.Context, input *DeleteLayerInput, opts ...request.Option) (*DeleteLayerOutput, error) { + req, out := c.DeleteLayerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteStack = "DeleteStack" @@ -1148,8 +1359,23 @@ func (c *OpsWorks) DeleteStackRequest(input *DeleteStackInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteStack func (c *OpsWorks) DeleteStack(input *DeleteStackInput) (*DeleteStackOutput, error) { req, out := c.DeleteStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteStackWithContext is the same as DeleteStack with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteStackWithContext(ctx aws.Context, input *DeleteStackInput, opts ...request.Option) (*DeleteStackOutput, error) { + req, out := c.DeleteStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteUserProfile = "DeleteUserProfile" @@ -1222,8 +1448,23 @@ func (c *OpsWorks) DeleteUserProfileRequest(input *DeleteUserProfileInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteUserProfile func (c *OpsWorks) DeleteUserProfile(input *DeleteUserProfileInput) (*DeleteUserProfileOutput, error) { req, out := c.DeleteUserProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteUserProfileWithContext is the same as DeleteUserProfile with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUserProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteUserProfileWithContext(ctx aws.Context, input *DeleteUserProfileInput, opts ...request.Option) (*DeleteUserProfileOutput, error) { + req, out := c.DeleteUserProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterEcsCluster = "DeregisterEcsCluster" @@ -1298,8 +1539,23 @@ func (c *OpsWorks) DeregisterEcsClusterRequest(input *DeregisterEcsClusterInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterEcsCluster func (c *OpsWorks) DeregisterEcsCluster(input *DeregisterEcsClusterInput) (*DeregisterEcsClusterOutput, error) { req, out := c.DeregisterEcsClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterEcsClusterWithContext is the same as DeregisterEcsCluster with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterEcsCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterEcsClusterWithContext(ctx aws.Context, input *DeregisterEcsClusterInput, opts ...request.Option) (*DeregisterEcsClusterOutput, error) { + req, out := c.DeregisterEcsClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterElasticIp = "DeregisterElasticIp" @@ -1374,8 +1630,23 @@ func (c *OpsWorks) DeregisterElasticIpRequest(input *DeregisterElasticIpInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterElasticIp func (c *OpsWorks) DeregisterElasticIp(input *DeregisterElasticIpInput) (*DeregisterElasticIpOutput, error) { req, out := c.DeregisterElasticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterElasticIpWithContext is the same as DeregisterElasticIp with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterElasticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterElasticIpWithContext(ctx aws.Context, input *DeregisterElasticIpInput, opts ...request.Option) (*DeregisterElasticIpOutput, error) { + req, out := c.DeregisterElasticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterInstance = "DeregisterInstance" @@ -1451,8 +1722,23 @@ func (c *OpsWorks) DeregisterInstanceRequest(input *DeregisterInstanceInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterInstance func (c *OpsWorks) DeregisterInstance(input *DeregisterInstanceInput) (*DeregisterInstanceOutput, error) { req, out := c.DeregisterInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterInstanceWithContext is the same as DeregisterInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterInstanceWithContext(ctx aws.Context, input *DeregisterInstanceInput, opts ...request.Option) (*DeregisterInstanceOutput, error) { + req, out := c.DeregisterInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterRdsDbInstance = "DeregisterRdsDbInstance" @@ -1526,8 +1812,23 @@ func (c *OpsWorks) DeregisterRdsDbInstanceRequest(input *DeregisterRdsDbInstance // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterRdsDbInstance func (c *OpsWorks) DeregisterRdsDbInstance(input *DeregisterRdsDbInstanceInput) (*DeregisterRdsDbInstanceOutput, error) { req, out := c.DeregisterRdsDbInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterRdsDbInstanceWithContext is the same as DeregisterRdsDbInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterRdsDbInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterRdsDbInstanceWithContext(ctx aws.Context, input *DeregisterRdsDbInstanceInput, opts ...request.Option) (*DeregisterRdsDbInstanceOutput, error) { + req, out := c.DeregisterRdsDbInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterVolume = "DeregisterVolume" @@ -1602,8 +1903,23 @@ func (c *OpsWorks) DeregisterVolumeRequest(input *DeregisterVolumeInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterVolume func (c *OpsWorks) DeregisterVolume(input *DeregisterVolumeInput) (*DeregisterVolumeOutput, error) { req, out := c.DeregisterVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterVolumeWithContext is the same as DeregisterVolume with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterVolumeWithContext(ctx aws.Context, input *DeregisterVolumeInput, opts ...request.Option) (*DeregisterVolumeOutput, error) { + req, out := c.DeregisterVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAgentVersions = "DescribeAgentVersions" @@ -1672,8 +1988,23 @@ func (c *OpsWorks) DescribeAgentVersionsRequest(input *DescribeAgentVersionsInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAgentVersions func (c *OpsWorks) DescribeAgentVersions(input *DescribeAgentVersionsInput) (*DescribeAgentVersionsOutput, error) { req, out := c.DescribeAgentVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAgentVersionsWithContext is the same as DescribeAgentVersions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAgentVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAgentVersionsWithContext(ctx aws.Context, input *DescribeAgentVersionsInput, opts ...request.Option) (*DescribeAgentVersionsOutput, error) { + req, out := c.DescribeAgentVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeApps = "DescribeApps" @@ -1747,8 +2078,23 @@ func (c *OpsWorks) DescribeAppsRequest(input *DescribeAppsInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeApps func (c *OpsWorks) DescribeApps(input *DescribeAppsInput) (*DescribeAppsOutput, error) { req, out := c.DescribeAppsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAppsWithContext is the same as DescribeApps with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeApps for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAppsWithContext(ctx aws.Context, input *DescribeAppsInput, opts ...request.Option) (*DescribeAppsOutput, error) { + req, out := c.DescribeAppsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeCommands = "DescribeCommands" @@ -1822,8 +2168,23 @@ func (c *OpsWorks) DescribeCommandsRequest(input *DescribeCommandsInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeCommands func (c *OpsWorks) DescribeCommands(input *DescribeCommandsInput) (*DescribeCommandsOutput, error) { req, out := c.DescribeCommandsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCommandsWithContext is the same as DescribeCommands with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCommands for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCommandsWithContext(ctx aws.Context, input *DescribeCommandsInput, opts ...request.Option) (*DescribeCommandsOutput, error) { + req, out := c.DescribeCommandsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDeployments = "DescribeDeployments" @@ -1897,8 +2258,23 @@ func (c *OpsWorks) DescribeDeploymentsRequest(input *DescribeDeploymentsInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeDeployments func (c *OpsWorks) DescribeDeployments(input *DescribeDeploymentsInput) (*DescribeDeploymentsOutput, error) { req, out := c.DescribeDeploymentsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDeploymentsWithContext is the same as DescribeDeployments with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDeployments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDeploymentsWithContext(ctx aws.Context, input *DescribeDeploymentsInput, opts ...request.Option) (*DescribeDeploymentsOutput, error) { + req, out := c.DescribeDeploymentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEcsClusters = "DescribeEcsClusters" @@ -1979,8 +2355,23 @@ func (c *OpsWorks) DescribeEcsClustersRequest(input *DescribeEcsClustersInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeEcsClusters func (c *OpsWorks) DescribeEcsClusters(input *DescribeEcsClustersInput) (*DescribeEcsClustersOutput, error) { req, out := c.DescribeEcsClustersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEcsClustersWithContext is the same as DescribeEcsClusters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEcsClusters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEcsClustersWithContext(ctx aws.Context, input *DescribeEcsClustersInput, opts ...request.Option) (*DescribeEcsClustersOutput, error) { + req, out := c.DescribeEcsClustersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeEcsClustersPages iterates over the pages of a DescribeEcsClusters operation, @@ -2000,12 +2391,37 @@ func (c *OpsWorks) DescribeEcsClusters(input *DescribeEcsClustersInput) (*Descri // return pageNum <= 3 // }) // -func (c *OpsWorks) DescribeEcsClustersPages(input *DescribeEcsClustersInput, fn func(p *DescribeEcsClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEcsClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEcsClustersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEcsClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEcsClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEcsClustersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeElasticIps = "DescribeElasticIps" @@ -2079,8 +2495,23 @@ func (c *OpsWorks) DescribeElasticIpsRequest(input *DescribeElasticIpsInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticIps func (c *OpsWorks) DescribeElasticIps(input *DescribeElasticIpsInput) (*DescribeElasticIpsOutput, error) { req, out := c.DescribeElasticIpsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeElasticIpsWithContext is the same as DescribeElasticIps with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeElasticIps for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeElasticIpsWithContext(ctx aws.Context, input *DescribeElasticIpsInput, opts ...request.Option) (*DescribeElasticIpsOutput, error) { + req, out := c.DescribeElasticIpsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeElasticLoadBalancers = "DescribeElasticLoadBalancers" @@ -2154,8 +2585,23 @@ func (c *OpsWorks) DescribeElasticLoadBalancersRequest(input *DescribeElasticLoa // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticLoadBalancers func (c *OpsWorks) DescribeElasticLoadBalancers(input *DescribeElasticLoadBalancersInput) (*DescribeElasticLoadBalancersOutput, error) { req, out := c.DescribeElasticLoadBalancersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeElasticLoadBalancersWithContext is the same as DescribeElasticLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeElasticLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeElasticLoadBalancersWithContext(ctx aws.Context, input *DescribeElasticLoadBalancersInput, opts ...request.Option) (*DescribeElasticLoadBalancersOutput, error) { + req, out := c.DescribeElasticLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeInstances = "DescribeInstances" @@ -2229,8 +2675,23 @@ func (c *OpsWorks) DescribeInstancesRequest(input *DescribeInstancesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeInstances func (c *OpsWorks) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstancesOutput, error) { req, out := c.DescribeInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstancesWithContext is the same as DescribeInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstancesWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.Option) (*DescribeInstancesOutput, error) { + req, out := c.DescribeInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLayers = "DescribeLayers" @@ -2304,8 +2765,23 @@ func (c *OpsWorks) DescribeLayersRequest(input *DescribeLayersInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLayers func (c *OpsWorks) DescribeLayers(input *DescribeLayersInput) (*DescribeLayersOutput, error) { req, out := c.DescribeLayersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLayersWithContext is the same as DescribeLayers with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLayers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLayersWithContext(ctx aws.Context, input *DescribeLayersInput, opts ...request.Option) (*DescribeLayersOutput, error) { + req, out := c.DescribeLayersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeLoadBasedAutoScaling = "DescribeLoadBasedAutoScaling" @@ -2379,8 +2855,23 @@ func (c *OpsWorks) DescribeLoadBasedAutoScalingRequest(input *DescribeLoadBasedA // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLoadBasedAutoScaling func (c *OpsWorks) DescribeLoadBasedAutoScaling(input *DescribeLoadBasedAutoScalingInput) (*DescribeLoadBasedAutoScalingOutput, error) { req, out := c.DescribeLoadBasedAutoScalingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoadBasedAutoScalingWithContext is the same as DescribeLoadBasedAutoScaling with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBasedAutoScaling for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoadBasedAutoScalingWithContext(ctx aws.Context, input *DescribeLoadBasedAutoScalingInput, opts ...request.Option) (*DescribeLoadBasedAutoScalingOutput, error) { + req, out := c.DescribeLoadBasedAutoScalingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMyUserProfile = "DescribeMyUserProfile" @@ -2443,8 +2934,23 @@ func (c *OpsWorks) DescribeMyUserProfileRequest(input *DescribeMyUserProfileInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeMyUserProfile func (c *OpsWorks) DescribeMyUserProfile(input *DescribeMyUserProfileInput) (*DescribeMyUserProfileOutput, error) { req, out := c.DescribeMyUserProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMyUserProfileWithContext is the same as DescribeMyUserProfile with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMyUserProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMyUserProfileWithContext(ctx aws.Context, input *DescribeMyUserProfileInput, opts ...request.Option) (*DescribeMyUserProfileOutput, error) { + req, out := c.DescribeMyUserProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribePermissions = "DescribePermissions" @@ -2516,8 +3022,23 @@ func (c *OpsWorks) DescribePermissionsRequest(input *DescribePermissionsInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribePermissions func (c *OpsWorks) DescribePermissions(input *DescribePermissionsInput) (*DescribePermissionsOutput, error) { req, out := c.DescribePermissionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribePermissionsWithContext is the same as DescribePermissions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribePermissionsWithContext(ctx aws.Context, input *DescribePermissionsInput, opts ...request.Option) (*DescribePermissionsOutput, error) { + req, out := c.DescribePermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeRaidArrays = "DescribeRaidArrays" @@ -2591,8 +3112,23 @@ func (c *OpsWorks) DescribeRaidArraysRequest(input *DescribeRaidArraysInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRaidArrays func (c *OpsWorks) DescribeRaidArrays(input *DescribeRaidArraysInput) (*DescribeRaidArraysOutput, error) { req, out := c.DescribeRaidArraysRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeRaidArraysWithContext is the same as DescribeRaidArrays with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRaidArrays for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeRaidArraysWithContext(ctx aws.Context, input *DescribeRaidArraysInput, opts ...request.Option) (*DescribeRaidArraysOutput, error) { + req, out := c.DescribeRaidArraysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeRdsDbInstances = "DescribeRdsDbInstances" @@ -2664,8 +3200,23 @@ func (c *OpsWorks) DescribeRdsDbInstancesRequest(input *DescribeRdsDbInstancesIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRdsDbInstances func (c *OpsWorks) DescribeRdsDbInstances(input *DescribeRdsDbInstancesInput) (*DescribeRdsDbInstancesOutput, error) { req, out := c.DescribeRdsDbInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeRdsDbInstancesWithContext is the same as DescribeRdsDbInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRdsDbInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeRdsDbInstancesWithContext(ctx aws.Context, input *DescribeRdsDbInstancesInput, opts ...request.Option) (*DescribeRdsDbInstancesOutput, error) { + req, out := c.DescribeRdsDbInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeServiceErrors = "DescribeServiceErrors" @@ -2737,8 +3288,23 @@ func (c *OpsWorks) DescribeServiceErrorsRequest(input *DescribeServiceErrorsInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeServiceErrors func (c *OpsWorks) DescribeServiceErrors(input *DescribeServiceErrorsInput) (*DescribeServiceErrorsOutput, error) { req, out := c.DescribeServiceErrorsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeServiceErrorsWithContext is the same as DescribeServiceErrors with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeServiceErrors for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeServiceErrorsWithContext(ctx aws.Context, input *DescribeServiceErrorsInput, opts ...request.Option) (*DescribeServiceErrorsOutput, error) { + req, out := c.DescribeServiceErrorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeStackProvisioningParameters = "DescribeStackProvisioningParameters" @@ -2810,8 +3376,23 @@ func (c *OpsWorks) DescribeStackProvisioningParametersRequest(input *DescribeSta // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackProvisioningParameters func (c *OpsWorks) DescribeStackProvisioningParameters(input *DescribeStackProvisioningParametersInput) (*DescribeStackProvisioningParametersOutput, error) { req, out := c.DescribeStackProvisioningParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStackProvisioningParametersWithContext is the same as DescribeStackProvisioningParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStackProvisioningParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStackProvisioningParametersWithContext(ctx aws.Context, input *DescribeStackProvisioningParametersInput, opts ...request.Option) (*DescribeStackProvisioningParametersOutput, error) { + req, out := c.DescribeStackProvisioningParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeStackSummary = "DescribeStackSummary" @@ -2884,8 +3465,23 @@ func (c *OpsWorks) DescribeStackSummaryRequest(input *DescribeStackSummaryInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackSummary func (c *OpsWorks) DescribeStackSummary(input *DescribeStackSummaryInput) (*DescribeStackSummaryOutput, error) { req, out := c.DescribeStackSummaryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStackSummaryWithContext is the same as DescribeStackSummary with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStackSummary for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStackSummaryWithContext(ctx aws.Context, input *DescribeStackSummaryInput, opts ...request.Option) (*DescribeStackSummaryOutput, error) { + req, out := c.DescribeStackSummaryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeStacks = "DescribeStacks" @@ -2957,8 +3553,23 @@ func (c *OpsWorks) DescribeStacksRequest(input *DescribeStacksInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStacks func (c *OpsWorks) DescribeStacks(input *DescribeStacksInput) (*DescribeStacksOutput, error) { req, out := c.DescribeStacksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStacksWithContext is the same as DescribeStacks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStacks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStacksWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.Option) (*DescribeStacksOutput, error) { + req, out := c.DescribeStacksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTimeBasedAutoScaling = "DescribeTimeBasedAutoScaling" @@ -3032,8 +3643,23 @@ func (c *OpsWorks) DescribeTimeBasedAutoScalingRequest(input *DescribeTimeBasedA // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeTimeBasedAutoScaling func (c *OpsWorks) DescribeTimeBasedAutoScaling(input *DescribeTimeBasedAutoScalingInput) (*DescribeTimeBasedAutoScalingOutput, error) { req, out := c.DescribeTimeBasedAutoScalingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTimeBasedAutoScalingWithContext is the same as DescribeTimeBasedAutoScaling with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTimeBasedAutoScaling for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTimeBasedAutoScalingWithContext(ctx aws.Context, input *DescribeTimeBasedAutoScalingInput, opts ...request.Option) (*DescribeTimeBasedAutoScalingOutput, error) { + req, out := c.DescribeTimeBasedAutoScalingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeUserProfiles = "DescribeUserProfiles" @@ -3104,8 +3730,23 @@ func (c *OpsWorks) DescribeUserProfilesRequest(input *DescribeUserProfilesInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeUserProfiles func (c *OpsWorks) DescribeUserProfiles(input *DescribeUserProfilesInput) (*DescribeUserProfilesOutput, error) { req, out := c.DescribeUserProfilesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeUserProfilesWithContext is the same as DescribeUserProfiles with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeUserProfiles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeUserProfilesWithContext(ctx aws.Context, input *DescribeUserProfilesInput, opts ...request.Option) (*DescribeUserProfilesOutput, error) { + req, out := c.DescribeUserProfilesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeVolumes = "DescribeVolumes" @@ -3179,8 +3820,23 @@ func (c *OpsWorks) DescribeVolumesRequest(input *DescribeVolumesInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeVolumes func (c *OpsWorks) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutput, error) { req, out := c.DescribeVolumesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeVolumesWithContext is the same as DescribeVolumes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVolumes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeVolumesWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.Option) (*DescribeVolumesOutput, error) { + req, out := c.DescribeVolumesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDetachElasticLoadBalancer = "DetachElasticLoadBalancer" @@ -3251,8 +3907,23 @@ func (c *OpsWorks) DetachElasticLoadBalancerRequest(input *DetachElasticLoadBala // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DetachElasticLoadBalancer func (c *OpsWorks) DetachElasticLoadBalancer(input *DetachElasticLoadBalancerInput) (*DetachElasticLoadBalancerOutput, error) { req, out := c.DetachElasticLoadBalancerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DetachElasticLoadBalancerWithContext is the same as DetachElasticLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See DetachElasticLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DetachElasticLoadBalancerWithContext(ctx aws.Context, input *DetachElasticLoadBalancerInput, opts ...request.Option) (*DetachElasticLoadBalancerOutput, error) { + req, out := c.DetachElasticLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisassociateElasticIp = "DisassociateElasticIp" @@ -3328,8 +3999,23 @@ func (c *OpsWorks) DisassociateElasticIpRequest(input *DisassociateElasticIpInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DisassociateElasticIp func (c *OpsWorks) DisassociateElasticIp(input *DisassociateElasticIpInput) (*DisassociateElasticIpOutput, error) { req, out := c.DisassociateElasticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisassociateElasticIpWithContext is the same as DisassociateElasticIp with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateElasticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisassociateElasticIpWithContext(ctx aws.Context, input *DisassociateElasticIpInput, opts ...request.Option) (*DisassociateElasticIpOutput, error) { + req, out := c.DisassociateElasticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetHostnameSuggestion = "GetHostnameSuggestion" @@ -3402,8 +4088,23 @@ func (c *OpsWorks) GetHostnameSuggestionRequest(input *GetHostnameSuggestionInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GetHostnameSuggestion func (c *OpsWorks) GetHostnameSuggestion(input *GetHostnameSuggestionInput) (*GetHostnameSuggestionOutput, error) { req, out := c.GetHostnameSuggestionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetHostnameSuggestionWithContext is the same as GetHostnameSuggestion with the addition of +// the ability to pass a context and additional request options. +// +// See GetHostnameSuggestion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetHostnameSuggestionWithContext(ctx aws.Context, input *GetHostnameSuggestionInput, opts ...request.Option) (*GetHostnameSuggestionOutput, error) { + req, out := c.GetHostnameSuggestionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGrantAccess = "GrantAccess" @@ -3472,8 +4173,23 @@ func (c *OpsWorks) GrantAccessRequest(input *GrantAccessInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GrantAccess func (c *OpsWorks) GrantAccess(input *GrantAccessInput) (*GrantAccessOutput, error) { req, out := c.GrantAccessRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GrantAccessWithContext is the same as GrantAccess with the addition of +// the ability to pass a context and additional request options. +// +// See GrantAccess for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GrantAccessWithContext(ctx aws.Context, input *GrantAccessInput, opts ...request.Option) (*GrantAccessOutput, error) { + req, out := c.GrantAccessRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRebootInstance = "RebootInstance" @@ -3548,8 +4264,23 @@ func (c *OpsWorks) RebootInstanceRequest(input *RebootInstanceInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RebootInstance func (c *OpsWorks) RebootInstance(input *RebootInstanceInput) (*RebootInstanceOutput, error) { req, out := c.RebootInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RebootInstanceWithContext is the same as RebootInstance with the addition of +// the ability to pass a context and additional request options. +// +// See RebootInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RebootInstanceWithContext(ctx aws.Context, input *RebootInstanceInput, opts ...request.Option) (*RebootInstanceOutput, error) { + req, out := c.RebootInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterEcsCluster = "RegisterEcsCluster" @@ -3623,8 +4354,23 @@ func (c *OpsWorks) RegisterEcsClusterRequest(input *RegisterEcsClusterInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterEcsCluster func (c *OpsWorks) RegisterEcsCluster(input *RegisterEcsClusterInput) (*RegisterEcsClusterOutput, error) { req, out := c.RegisterEcsClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterEcsClusterWithContext is the same as RegisterEcsCluster with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterEcsCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterEcsClusterWithContext(ctx aws.Context, input *RegisterEcsClusterInput, opts ...request.Option) (*RegisterEcsClusterOutput, error) { + req, out := c.RegisterEcsClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterElasticIp = "RegisterElasticIp" @@ -3699,8 +4445,23 @@ func (c *OpsWorks) RegisterElasticIpRequest(input *RegisterElasticIpInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterElasticIp func (c *OpsWorks) RegisterElasticIp(input *RegisterElasticIpInput) (*RegisterElasticIpOutput, error) { req, out := c.RegisterElasticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterElasticIpWithContext is the same as RegisterElasticIp with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterElasticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterElasticIpWithContext(ctx aws.Context, input *RegisterElasticIpInput, opts ...request.Option) (*RegisterElasticIpOutput, error) { + req, out := c.RegisterElasticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterInstance = "RegisterInstance" @@ -3780,8 +4541,23 @@ func (c *OpsWorks) RegisterInstanceRequest(input *RegisterInstanceInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterInstance func (c *OpsWorks) RegisterInstance(input *RegisterInstanceInput) (*RegisterInstanceOutput, error) { req, out := c.RegisterInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterInstanceWithContext is the same as RegisterInstance with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterInstanceWithContext(ctx aws.Context, input *RegisterInstanceInput, opts ...request.Option) (*RegisterInstanceOutput, error) { + req, out := c.RegisterInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterRdsDbInstance = "RegisterRdsDbInstance" @@ -3855,8 +4631,23 @@ func (c *OpsWorks) RegisterRdsDbInstanceRequest(input *RegisterRdsDbInstanceInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterRdsDbInstance func (c *OpsWorks) RegisterRdsDbInstance(input *RegisterRdsDbInstanceInput) (*RegisterRdsDbInstanceOutput, error) { req, out := c.RegisterRdsDbInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterRdsDbInstanceWithContext is the same as RegisterRdsDbInstance with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterRdsDbInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterRdsDbInstanceWithContext(ctx aws.Context, input *RegisterRdsDbInstanceInput, opts ...request.Option) (*RegisterRdsDbInstanceOutput, error) { + req, out := c.RegisterRdsDbInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterVolume = "RegisterVolume" @@ -3931,8 +4722,23 @@ func (c *OpsWorks) RegisterVolumeRequest(input *RegisterVolumeInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterVolume func (c *OpsWorks) RegisterVolume(input *RegisterVolumeInput) (*RegisterVolumeOutput, error) { req, out := c.RegisterVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterVolumeWithContext is the same as RegisterVolume with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterVolumeWithContext(ctx aws.Context, input *RegisterVolumeInput, opts ...request.Option) (*RegisterVolumeOutput, error) { + req, out := c.RegisterVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetLoadBasedAutoScaling = "SetLoadBasedAutoScaling" @@ -4013,8 +4819,23 @@ func (c *OpsWorks) SetLoadBasedAutoScalingRequest(input *SetLoadBasedAutoScaling // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetLoadBasedAutoScaling func (c *OpsWorks) SetLoadBasedAutoScaling(input *SetLoadBasedAutoScalingInput) (*SetLoadBasedAutoScalingOutput, error) { req, out := c.SetLoadBasedAutoScalingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetLoadBasedAutoScalingWithContext is the same as SetLoadBasedAutoScaling with the addition of +// the ability to pass a context and additional request options. +// +// See SetLoadBasedAutoScaling for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetLoadBasedAutoScalingWithContext(ctx aws.Context, input *SetLoadBasedAutoScalingInput, opts ...request.Option) (*SetLoadBasedAutoScalingOutput, error) { + req, out := c.SetLoadBasedAutoScalingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetPermission = "SetPermission" @@ -4089,8 +4910,23 @@ func (c *OpsWorks) SetPermissionRequest(input *SetPermissionInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetPermission func (c *OpsWorks) SetPermission(input *SetPermissionInput) (*SetPermissionOutput, error) { req, out := c.SetPermissionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetPermissionWithContext is the same as SetPermission with the addition of +// the ability to pass a context and additional request options. +// +// See SetPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetPermissionWithContext(ctx aws.Context, input *SetPermissionInput, opts ...request.Option) (*SetPermissionOutput, error) { + req, out := c.SetPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetTimeBasedAutoScaling = "SetTimeBasedAutoScaling" @@ -4166,8 +5002,23 @@ func (c *OpsWorks) SetTimeBasedAutoScalingRequest(input *SetTimeBasedAutoScaling // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetTimeBasedAutoScaling func (c *OpsWorks) SetTimeBasedAutoScaling(input *SetTimeBasedAutoScalingInput) (*SetTimeBasedAutoScalingOutput, error) { req, out := c.SetTimeBasedAutoScalingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetTimeBasedAutoScalingWithContext is the same as SetTimeBasedAutoScaling with the addition of +// the ability to pass a context and additional request options. +// +// See SetTimeBasedAutoScaling for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetTimeBasedAutoScalingWithContext(ctx aws.Context, input *SetTimeBasedAutoScalingInput, opts ...request.Option) (*SetTimeBasedAutoScalingOutput, error) { + req, out := c.SetTimeBasedAutoScalingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartInstance = "StartInstance" @@ -4242,8 +5093,23 @@ func (c *OpsWorks) StartInstanceRequest(input *StartInstanceInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartInstance func (c *OpsWorks) StartInstance(input *StartInstanceInput) (*StartInstanceOutput, error) { req, out := c.StartInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartInstanceWithContext is the same as StartInstance with the addition of +// the ability to pass a context and additional request options. +// +// See StartInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartInstanceWithContext(ctx aws.Context, input *StartInstanceInput, opts ...request.Option) (*StartInstanceOutput, error) { + req, out := c.StartInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartStack = "StartStack" @@ -4317,8 +5183,23 @@ func (c *OpsWorks) StartStackRequest(input *StartStackInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartStack func (c *OpsWorks) StartStack(input *StartStackInput) (*StartStackOutput, error) { req, out := c.StartStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartStackWithContext is the same as StartStack with the addition of +// the ability to pass a context and additional request options. +// +// See StartStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartStackWithContext(ctx aws.Context, input *StartStackInput, opts ...request.Option) (*StartStackOutput, error) { + req, out := c.StartStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopInstance = "StopInstance" @@ -4395,8 +5276,23 @@ func (c *OpsWorks) StopInstanceRequest(input *StopInstanceInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopInstance func (c *OpsWorks) StopInstance(input *StopInstanceInput) (*StopInstanceOutput, error) { req, out := c.StopInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopInstanceWithContext is the same as StopInstance with the addition of +// the ability to pass a context and additional request options. +// +// See StopInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopInstanceWithContext(ctx aws.Context, input *StopInstanceInput, opts ...request.Option) (*StopInstanceOutput, error) { + req, out := c.StopInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopStack = "StopStack" @@ -4470,8 +5366,23 @@ func (c *OpsWorks) StopStackRequest(input *StopStackInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopStack func (c *OpsWorks) StopStack(input *StopStackInput) (*StopStackOutput, error) { req, out := c.StopStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopStackWithContext is the same as StopStack with the addition of +// the ability to pass a context and additional request options. +// +// See StopStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopStackWithContext(ctx aws.Context, input *StopStackInput, opts ...request.Option) (*StopStackOutput, error) { + req, out := c.StopStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUnassignInstance = "UnassignInstance" @@ -4548,8 +5459,23 @@ func (c *OpsWorks) UnassignInstanceRequest(input *UnassignInstanceInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignInstance func (c *OpsWorks) UnassignInstance(input *UnassignInstanceInput) (*UnassignInstanceOutput, error) { req, out := c.UnassignInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UnassignInstanceWithContext is the same as UnassignInstance with the addition of +// the ability to pass a context and additional request options. +// +// See UnassignInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UnassignInstanceWithContext(ctx aws.Context, input *UnassignInstanceInput, opts ...request.Option) (*UnassignInstanceOutput, error) { + req, out := c.UnassignInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUnassignVolume = "UnassignVolume" @@ -4624,8 +5550,23 @@ func (c *OpsWorks) UnassignVolumeRequest(input *UnassignVolumeInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignVolume func (c *OpsWorks) UnassignVolume(input *UnassignVolumeInput) (*UnassignVolumeOutput, error) { req, out := c.UnassignVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UnassignVolumeWithContext is the same as UnassignVolume with the addition of +// the ability to pass a context and additional request options. +// +// See UnassignVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UnassignVolumeWithContext(ctx aws.Context, input *UnassignVolumeInput, opts ...request.Option) (*UnassignVolumeOutput, error) { + req, out := c.UnassignVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateApp = "UpdateApp" @@ -4699,8 +5640,23 @@ func (c *OpsWorks) UpdateAppRequest(input *UpdateAppInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateApp func (c *OpsWorks) UpdateApp(input *UpdateAppInput) (*UpdateAppOutput, error) { req, out := c.UpdateAppRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAppWithContext is the same as UpdateApp with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAppWithContext(ctx aws.Context, input *UpdateAppInput, opts ...request.Option) (*UpdateAppOutput, error) { + req, out := c.UpdateAppRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateElasticIp = "UpdateElasticIp" @@ -4775,8 +5731,23 @@ func (c *OpsWorks) UpdateElasticIpRequest(input *UpdateElasticIpInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateElasticIp func (c *OpsWorks) UpdateElasticIp(input *UpdateElasticIpInput) (*UpdateElasticIpOutput, error) { req, out := c.UpdateElasticIpRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateElasticIpWithContext is the same as UpdateElasticIp with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateElasticIp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateElasticIpWithContext(ctx aws.Context, input *UpdateElasticIpInput, opts ...request.Option) (*UpdateElasticIpOutput, error) { + req, out := c.UpdateElasticIpRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateInstance = "UpdateInstance" @@ -4850,8 +5821,23 @@ func (c *OpsWorks) UpdateInstanceRequest(input *UpdateInstanceInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateInstance func (c *OpsWorks) UpdateInstance(input *UpdateInstanceInput) (*UpdateInstanceOutput, error) { req, out := c.UpdateInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateInstanceWithContext is the same as UpdateInstance with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateInstanceWithContext(ctx aws.Context, input *UpdateInstanceInput, opts ...request.Option) (*UpdateInstanceOutput, error) { + req, out := c.UpdateInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateLayer = "UpdateLayer" @@ -4925,8 +5911,23 @@ func (c *OpsWorks) UpdateLayerRequest(input *UpdateLayerInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateLayer func (c *OpsWorks) UpdateLayer(input *UpdateLayerInput) (*UpdateLayerOutput, error) { req, out := c.UpdateLayerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateLayerWithContext is the same as UpdateLayer with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateLayer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateLayerWithContext(ctx aws.Context, input *UpdateLayerInput, opts ...request.Option) (*UpdateLayerOutput, error) { + req, out := c.UpdateLayerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateMyUserProfile = "UpdateMyUserProfile" @@ -4996,8 +5997,23 @@ func (c *OpsWorks) UpdateMyUserProfileRequest(input *UpdateMyUserProfileInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateMyUserProfile func (c *OpsWorks) UpdateMyUserProfile(input *UpdateMyUserProfileInput) (*UpdateMyUserProfileOutput, error) { req, out := c.UpdateMyUserProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateMyUserProfileWithContext is the same as UpdateMyUserProfile with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateMyUserProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateMyUserProfileWithContext(ctx aws.Context, input *UpdateMyUserProfileInput, opts ...request.Option) (*UpdateMyUserProfileOutput, error) { + req, out := c.UpdateMyUserProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateRdsDbInstance = "UpdateRdsDbInstance" @@ -5071,8 +6087,23 @@ func (c *OpsWorks) UpdateRdsDbInstanceRequest(input *UpdateRdsDbInstanceInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateRdsDbInstance func (c *OpsWorks) UpdateRdsDbInstance(input *UpdateRdsDbInstanceInput) (*UpdateRdsDbInstanceOutput, error) { req, out := c.UpdateRdsDbInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateRdsDbInstanceWithContext is the same as UpdateRdsDbInstance with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRdsDbInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateRdsDbInstanceWithContext(ctx aws.Context, input *UpdateRdsDbInstanceInput, opts ...request.Option) (*UpdateRdsDbInstanceOutput, error) { + req, out := c.UpdateRdsDbInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateStack = "UpdateStack" @@ -5146,8 +6177,23 @@ func (c *OpsWorks) UpdateStackRequest(input *UpdateStackInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateStack func (c *OpsWorks) UpdateStack(input *UpdateStackInput) (*UpdateStackOutput, error) { req, out := c.UpdateStackRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateStackWithContext is the same as UpdateStack with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateStackWithContext(ctx aws.Context, input *UpdateStackInput, opts ...request.Option) (*UpdateStackOutput, error) { + req, out := c.UpdateStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateUserProfile = "UpdateUserProfile" @@ -5220,8 +6266,23 @@ func (c *OpsWorks) UpdateUserProfileRequest(input *UpdateUserProfileInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateUserProfile func (c *OpsWorks) UpdateUserProfile(input *UpdateUserProfileInput) (*UpdateUserProfileOutput, error) { req, out := c.UpdateUserProfileRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateUserProfileWithContext is the same as UpdateUserProfile with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateUserProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateUserProfileWithContext(ctx aws.Context, input *UpdateUserProfileInput, opts ...request.Option) (*UpdateUserProfileOutput, error) { + req, out := c.UpdateUserProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateVolume = "UpdateVolume" @@ -5296,8 +6357,23 @@ func (c *OpsWorks) UpdateVolumeRequest(input *UpdateVolumeInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateVolume func (c *OpsWorks) UpdateVolume(input *UpdateVolumeInput) (*UpdateVolumeOutput, error) { req, out := c.UpdateVolumeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateVolumeWithContext is the same as UpdateVolume with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateVolume for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateVolumeWithContext(ctx aws.Context, input *UpdateVolumeInput, opts ...request.Option) (*UpdateVolumeOutput, error) { + req, out := c.UpdateVolumeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Describes an agent version. diff --git a/vendor/github.com/aws/aws-sdk-go/service/opsworks/errors.go b/vendor/github.com/aws/aws-sdk-go/service/opsworks/errors.go index d3e09499d..fc849646c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/opsworks/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package opsworks diff --git a/vendor/github.com/aws/aws-sdk-go/service/opsworks/service.go b/vendor/github.com/aws/aws-sdk-go/service/opsworks/service.go index fa799d9ff..60fa2c02e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/opsworks/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package opsworks diff --git a/vendor/github.com/aws/aws-sdk-go/service/opsworks/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/opsworks/waiters.go index dc4fa42ae..99a800a60 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/opsworks/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package opsworks import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilAppExists uses the AWS OpsWorks API operation @@ -11,32 +14,50 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *OpsWorks) WaitUntilAppExists(input *DescribeAppsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeApps", - Delay: 1, + return c.WaitUntilAppExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilAppExistsWithContext is an extended version of WaitUntilAppExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilAppExistsWithContext(ctx aws.Context, input *DescribeAppsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilAppExists", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(1 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "failure", - Matcher: "status", - Argument: "", + State: request.FailureWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 400, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeAppsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAppsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilDeploymentSuccessful uses the AWS OpsWorks API operation @@ -44,32 +65,50 @@ func (c *OpsWorks) WaitUntilAppExists(input *DescribeAppsInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *OpsWorks) WaitUntilDeploymentSuccessful(input *DescribeDeploymentsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeDeployments", - Delay: 15, + return c.WaitUntilDeploymentSuccessfulWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilDeploymentSuccessfulWithContext is an extended version of WaitUntilDeploymentSuccessful. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilDeploymentSuccessfulWithContext(ctx aws.Context, input *DescribeDeploymentsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilDeploymentSuccessful", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Deployments[].Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Deployments[].Status", Expected: "successful", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Deployments[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Deployments[].Status", Expected: "failed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeDeploymentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDeploymentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceOnline uses the AWS OpsWorks API operation @@ -77,74 +116,85 @@ func (c *OpsWorks) WaitUntilDeploymentSuccessful(input *DescribeDeploymentsInput // If the condition is not meet within the max attempt window an error will // be returned. func (c *OpsWorks) WaitUntilInstanceOnline(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, + return c.WaitUntilInstanceOnlineWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceOnlineWithContext is an extended version of WaitUntilInstanceOnline. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceOnlineWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceOnline", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Instances[].Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Instances[].Status", Expected: "online", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "setup_failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "shutting_down", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "start_failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "stopped", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "stopping", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "terminating", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "terminated", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "stop_failed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceRegistered uses the AWS OpsWorks API operation @@ -152,68 +202,80 @@ func (c *OpsWorks) WaitUntilInstanceOnline(input *DescribeInstancesInput) error // If the condition is not meet within the max attempt window an error will // be returned. func (c *OpsWorks) WaitUntilInstanceRegistered(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, + return c.WaitUntilInstanceRegisteredWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceRegisteredWithContext is an extended version of WaitUntilInstanceRegistered. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceRegisteredWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceRegistered", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Instances[].Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Instances[].Status", Expected: "registered", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "setup_failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "shutting_down", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "stopped", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "stopping", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "terminating", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "terminated", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "stop_failed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceStopped uses the AWS OpsWorks API operation @@ -221,80 +283,90 @@ func (c *OpsWorks) WaitUntilInstanceRegistered(input *DescribeInstancesInput) er // If the condition is not meet within the max attempt window an error will // be returned. func (c *OpsWorks) WaitUntilInstanceStopped(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, + return c.WaitUntilInstanceStoppedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceStoppedWithContext is an extended version of WaitUntilInstanceStopped. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceStoppedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceStopped", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Instances[].Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Instances[].Status", Expected: "stopped", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "booting", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "online", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "pending", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "rebooting", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "requested", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "running_setup", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "setup_failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "start_failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "stop_failed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilInstanceTerminated uses the AWS OpsWorks API operation @@ -302,78 +374,88 @@ func (c *OpsWorks) WaitUntilInstanceStopped(input *DescribeInstancesInput) error // If the condition is not meet within the max attempt window an error will // be returned. func (c *OpsWorks) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, + return c.WaitUntilInstanceTerminatedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceTerminatedWithContext is an extended version of WaitUntilInstanceTerminated. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilInstanceTerminatedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceTerminated", MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Instances[].Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Instances[].Status", Expected: "terminated", }, { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ResourceNotFoundException", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "booting", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "online", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "pending", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "rebooting", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "requested", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "running_setup", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "setup_failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Instances[].Status", Expected: "start_failed", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/api.go b/vendor/github.com/aws/aws-sdk-go/service/rds/api.go index 48b6d2c8b..0477c7471 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/rds/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package rds provides a client for Amazon Relational Database Service. package rds @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -89,8 +90,23 @@ func (c *RDS) AddRoleToDBClusterRequest(input *AddRoleToDBClusterInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddRoleToDBCluster func (c *RDS) AddRoleToDBCluster(input *AddRoleToDBClusterInput) (*AddRoleToDBClusterOutput, error) { req, out := c.AddRoleToDBClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddRoleToDBClusterWithContext is the same as AddRoleToDBCluster with the addition of +// the ability to pass a context and additional request options. +// +// See AddRoleToDBCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddRoleToDBClusterWithContext(ctx aws.Context, input *AddRoleToDBClusterInput, opts ...request.Option) (*AddRoleToDBClusterOutput, error) { + req, out := c.AddRoleToDBClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAddSourceIdentifierToSubscription = "AddSourceIdentifierToSubscription" @@ -157,8 +173,23 @@ func (c *RDS) AddSourceIdentifierToSubscriptionRequest(input *AddSourceIdentifie // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddSourceIdentifierToSubscription func (c *RDS) AddSourceIdentifierToSubscription(input *AddSourceIdentifierToSubscriptionInput) (*AddSourceIdentifierToSubscriptionOutput, error) { req, out := c.AddSourceIdentifierToSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddSourceIdentifierToSubscriptionWithContext is the same as AddSourceIdentifierToSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See AddSourceIdentifierToSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddSourceIdentifierToSubscriptionWithContext(ctx aws.Context, input *AddSourceIdentifierToSubscriptionInput, opts ...request.Option) (*AddSourceIdentifierToSubscriptionOutput, error) { + req, out := c.AddSourceIdentifierToSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAddTagsToResource = "AddTagsToResource" @@ -235,8 +266,23 @@ func (c *RDS) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddTagsToResource func (c *RDS) AddTagsToResource(input *AddTagsToResourceInput) (*AddTagsToResourceOutput, error) { req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsToResourceWithContext is the same as AddTagsToResource with the addition of +// the ability to pass a context and additional request options. +// +// See AddTagsToResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsToResourceWithContext(ctx aws.Context, input *AddTagsToResourceInput, opts ...request.Option) (*AddTagsToResourceOutput, error) { + req, out := c.AddTagsToResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opApplyPendingMaintenanceAction = "ApplyPendingMaintenanceAction" @@ -301,8 +347,23 @@ func (c *RDS) ApplyPendingMaintenanceActionRequest(input *ApplyPendingMaintenanc // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ApplyPendingMaintenanceAction func (c *RDS) ApplyPendingMaintenanceAction(input *ApplyPendingMaintenanceActionInput) (*ApplyPendingMaintenanceActionOutput, error) { req, out := c.ApplyPendingMaintenanceActionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ApplyPendingMaintenanceActionWithContext is the same as ApplyPendingMaintenanceAction with the addition of +// the ability to pass a context and additional request options. +// +// See ApplyPendingMaintenanceAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ApplyPendingMaintenanceActionWithContext(ctx aws.Context, input *ApplyPendingMaintenanceActionInput, opts ...request.Option) (*ApplyPendingMaintenanceActionOutput, error) { + req, out := c.ApplyPendingMaintenanceActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAuthorizeDBSecurityGroupIngress = "AuthorizeDBSecurityGroupIngress" @@ -388,8 +449,23 @@ func (c *RDS) AuthorizeDBSecurityGroupIngressRequest(input *AuthorizeDBSecurityG // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AuthorizeDBSecurityGroupIngress func (c *RDS) AuthorizeDBSecurityGroupIngress(input *AuthorizeDBSecurityGroupIngressInput) (*AuthorizeDBSecurityGroupIngressOutput, error) { req, out := c.AuthorizeDBSecurityGroupIngressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AuthorizeDBSecurityGroupIngressWithContext is the same as AuthorizeDBSecurityGroupIngress with the addition of +// the ability to pass a context and additional request options. +// +// See AuthorizeDBSecurityGroupIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AuthorizeDBSecurityGroupIngressWithContext(ctx aws.Context, input *AuthorizeDBSecurityGroupIngressInput, opts ...request.Option) (*AuthorizeDBSecurityGroupIngressOutput, error) { + req, out := c.AuthorizeDBSecurityGroupIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopyDBClusterParameterGroup = "CopyDBClusterParameterGroup" @@ -460,8 +536,23 @@ func (c *RDS) CopyDBClusterParameterGroupRequest(input *CopyDBClusterParameterGr // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterParameterGroup func (c *RDS) CopyDBClusterParameterGroup(input *CopyDBClusterParameterGroupInput) (*CopyDBClusterParameterGroupOutput, error) { req, out := c.CopyDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopyDBClusterParameterGroupWithContext is the same as CopyDBClusterParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CopyDBClusterParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopyDBClusterParameterGroupWithContext(ctx aws.Context, input *CopyDBClusterParameterGroupInput, opts ...request.Option) (*CopyDBClusterParameterGroupOutput, error) { + req, out := c.CopyDBClusterParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopyDBClusterSnapshot = "CopyDBClusterSnapshot" @@ -601,8 +692,23 @@ func (c *RDS) CopyDBClusterSnapshotRequest(input *CopyDBClusterSnapshotInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterSnapshot func (c *RDS) CopyDBClusterSnapshot(input *CopyDBClusterSnapshotInput) (*CopyDBClusterSnapshotOutput, error) { req, out := c.CopyDBClusterSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopyDBClusterSnapshotWithContext is the same as CopyDBClusterSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CopyDBClusterSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopyDBClusterSnapshotWithContext(ctx aws.Context, input *CopyDBClusterSnapshotInput, opts ...request.Option) (*CopyDBClusterSnapshotOutput, error) { + req, out := c.CopyDBClusterSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopyDBParameterGroup = "CopyDBParameterGroup" @@ -673,8 +779,23 @@ func (c *RDS) CopyDBParameterGroupRequest(input *CopyDBParameterGroupInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBParameterGroup func (c *RDS) CopyDBParameterGroup(input *CopyDBParameterGroupInput) (*CopyDBParameterGroupOutput, error) { req, out := c.CopyDBParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopyDBParameterGroupWithContext is the same as CopyDBParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CopyDBParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopyDBParameterGroupWithContext(ctx aws.Context, input *CopyDBParameterGroupInput, opts ...request.Option) (*CopyDBParameterGroupOutput, error) { + req, out := c.CopyDBParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopyDBSnapshot = "CopyDBSnapshot" @@ -808,8 +929,23 @@ func (c *RDS) CopyDBSnapshotRequest(input *CopyDBSnapshotInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBSnapshot func (c *RDS) CopyDBSnapshot(input *CopyDBSnapshotInput) (*CopyDBSnapshotOutput, error) { req, out := c.CopyDBSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopyDBSnapshotWithContext is the same as CopyDBSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CopyDBSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopyDBSnapshotWithContext(ctx aws.Context, input *CopyDBSnapshotInput, opts ...request.Option) (*CopyDBSnapshotOutput, error) { + req, out := c.CopyDBSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopyOptionGroup = "CopyOptionGroup" @@ -879,8 +1015,23 @@ func (c *RDS) CopyOptionGroupRequest(input *CopyOptionGroupInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyOptionGroup func (c *RDS) CopyOptionGroup(input *CopyOptionGroupInput) (*CopyOptionGroupOutput, error) { req, out := c.CopyOptionGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopyOptionGroupWithContext is the same as CopyOptionGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CopyOptionGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopyOptionGroupWithContext(ctx aws.Context, input *CopyOptionGroupInput, opts ...request.Option) (*CopyOptionGroupOutput, error) { + req, out := c.CopyOptionGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDBCluster = "CreateDBCluster" @@ -1002,8 +1153,23 @@ func (c *RDS) CreateDBClusterRequest(input *CreateDBClusterInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBCluster func (c *RDS) CreateDBCluster(input *CreateDBClusterInput) (*CreateDBClusterOutput, error) { req, out := c.CreateDBClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDBClusterWithContext is the same as CreateDBCluster with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDBClusterWithContext(ctx aws.Context, input *CreateDBClusterInput, opts ...request.Option) (*CreateDBClusterOutput, error) { + req, out := c.CreateDBClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDBClusterParameterGroup = "CreateDBClusterParameterGroup" @@ -1098,8 +1264,23 @@ func (c *RDS) CreateDBClusterParameterGroupRequest(input *CreateDBClusterParamet // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterParameterGroup func (c *RDS) CreateDBClusterParameterGroup(input *CreateDBClusterParameterGroupInput) (*CreateDBClusterParameterGroupOutput, error) { req, out := c.CreateDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDBClusterParameterGroupWithContext is the same as CreateDBClusterParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBClusterParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDBClusterParameterGroupWithContext(ctx aws.Context, input *CreateDBClusterParameterGroupInput, opts ...request.Option) (*CreateDBClusterParameterGroupOutput, error) { + req, out := c.CreateDBClusterParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDBClusterSnapshot = "CreateDBClusterSnapshot" @@ -1177,8 +1358,23 @@ func (c *RDS) CreateDBClusterSnapshotRequest(input *CreateDBClusterSnapshotInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterSnapshot func (c *RDS) CreateDBClusterSnapshot(input *CreateDBClusterSnapshotInput) (*CreateDBClusterSnapshotOutput, error) { req, out := c.CreateDBClusterSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDBClusterSnapshotWithContext is the same as CreateDBClusterSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBClusterSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDBClusterSnapshotWithContext(ctx aws.Context, input *CreateDBClusterSnapshotInput, opts ...request.Option) (*CreateDBClusterSnapshotOutput, error) { + req, out := c.CreateDBClusterSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDBInstance = "CreateDBInstance" @@ -1302,8 +1498,23 @@ func (c *RDS) CreateDBInstanceRequest(input *CreateDBInstanceInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstance func (c *RDS) CreateDBInstance(input *CreateDBInstanceInput) (*CreateDBInstanceOutput, error) { req, out := c.CreateDBInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDBInstanceWithContext is the same as CreateDBInstance with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDBInstanceWithContext(ctx aws.Context, input *CreateDBInstanceInput, opts ...request.Option) (*CreateDBInstanceOutput, error) { + req, out := c.CreateDBInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDBInstanceReadReplica = "CreateDBInstanceReadReplica" @@ -1488,8 +1699,23 @@ func (c *RDS) CreateDBInstanceReadReplicaRequest(input *CreateDBInstanceReadRepl // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstanceReadReplica func (c *RDS) CreateDBInstanceReadReplica(input *CreateDBInstanceReadReplicaInput) (*CreateDBInstanceReadReplicaOutput, error) { req, out := c.CreateDBInstanceReadReplicaRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDBInstanceReadReplicaWithContext is the same as CreateDBInstanceReadReplica with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBInstanceReadReplica for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDBInstanceReadReplicaWithContext(ctx aws.Context, input *CreateDBInstanceReadReplicaInput, opts ...request.Option) (*CreateDBInstanceReadReplicaOutput, error) { + req, out := c.CreateDBInstanceReadReplicaRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDBParameterGroup = "CreateDBParameterGroup" @@ -1577,8 +1803,23 @@ func (c *RDS) CreateDBParameterGroupRequest(input *CreateDBParameterGroupInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBParameterGroup func (c *RDS) CreateDBParameterGroup(input *CreateDBParameterGroupInput) (*CreateDBParameterGroupOutput, error) { req, out := c.CreateDBParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDBParameterGroupWithContext is the same as CreateDBParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDBParameterGroupWithContext(ctx aws.Context, input *CreateDBParameterGroupInput, opts ...request.Option) (*CreateDBParameterGroupOutput, error) { + req, out := c.CreateDBParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDBSecurityGroup = "CreateDBSecurityGroup" @@ -1651,8 +1892,23 @@ func (c *RDS) CreateDBSecurityGroupRequest(input *CreateDBSecurityGroupInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSecurityGroup func (c *RDS) CreateDBSecurityGroup(input *CreateDBSecurityGroupInput) (*CreateDBSecurityGroupOutput, error) { req, out := c.CreateDBSecurityGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDBSecurityGroupWithContext is the same as CreateDBSecurityGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBSecurityGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDBSecurityGroupWithContext(ctx aws.Context, input *CreateDBSecurityGroupInput, opts ...request.Option) (*CreateDBSecurityGroupOutput, error) { + req, out := c.CreateDBSecurityGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDBSnapshot = "CreateDBSnapshot" @@ -1725,8 +1981,23 @@ func (c *RDS) CreateDBSnapshotRequest(input *CreateDBSnapshotInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSnapshot func (c *RDS) CreateDBSnapshot(input *CreateDBSnapshotInput) (*CreateDBSnapshotOutput, error) { req, out := c.CreateDBSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDBSnapshotWithContext is the same as CreateDBSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDBSnapshotWithContext(ctx aws.Context, input *CreateDBSnapshotInput, opts ...request.Option) (*CreateDBSnapshotOutput, error) { + req, out := c.CreateDBSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDBSubnetGroup = "CreateDBSubnetGroup" @@ -1806,8 +2077,23 @@ func (c *RDS) CreateDBSubnetGroupRequest(input *CreateDBSubnetGroupInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSubnetGroup func (c *RDS) CreateDBSubnetGroup(input *CreateDBSubnetGroupInput) (*CreateDBSubnetGroupOutput, error) { req, out := c.CreateDBSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDBSubnetGroupWithContext is the same as CreateDBSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDBSubnetGroupWithContext(ctx aws.Context, input *CreateDBSubnetGroupInput, opts ...request.Option) (*CreateDBSubnetGroupOutput, error) { + req, out := c.CreateDBSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateEventSubscription = "CreateEventSubscription" @@ -1906,8 +2192,23 @@ func (c *RDS) CreateEventSubscriptionRequest(input *CreateEventSubscriptionInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateEventSubscription func (c *RDS) CreateEventSubscription(input *CreateEventSubscriptionInput) (*CreateEventSubscriptionOutput, error) { req, out := c.CreateEventSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateEventSubscriptionWithContext is the same as CreateEventSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See CreateEventSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateEventSubscriptionWithContext(ctx aws.Context, input *CreateEventSubscriptionInput, opts ...request.Option) (*CreateEventSubscriptionOutput, error) { + req, out := c.CreateEventSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateOptionGroup = "CreateOptionGroup" @@ -1974,8 +2275,23 @@ func (c *RDS) CreateOptionGroupRequest(input *CreateOptionGroupInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateOptionGroup func (c *RDS) CreateOptionGroup(input *CreateOptionGroupInput) (*CreateOptionGroupOutput, error) { req, out := c.CreateOptionGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateOptionGroupWithContext is the same as CreateOptionGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateOptionGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateOptionGroupWithContext(ctx aws.Context, input *CreateOptionGroupInput, opts ...request.Option) (*CreateOptionGroupOutput, error) { + req, out := c.CreateOptionGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDBCluster = "DeleteDBCluster" @@ -2056,8 +2372,23 @@ func (c *RDS) DeleteDBClusterRequest(input *DeleteDBClusterInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBCluster func (c *RDS) DeleteDBCluster(input *DeleteDBClusterInput) (*DeleteDBClusterOutput, error) { req, out := c.DeleteDBClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDBClusterWithContext is the same as DeleteDBCluster with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDBCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDBClusterWithContext(ctx aws.Context, input *DeleteDBClusterInput, opts ...request.Option) (*DeleteDBClusterOutput, error) { + req, out := c.DeleteDBClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDBClusterParameterGroup = "DeleteDBClusterParameterGroup" @@ -2130,8 +2461,23 @@ func (c *RDS) DeleteDBClusterParameterGroupRequest(input *DeleteDBClusterParamet // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterParameterGroup func (c *RDS) DeleteDBClusterParameterGroup(input *DeleteDBClusterParameterGroupInput) (*DeleteDBClusterParameterGroupOutput, error) { req, out := c.DeleteDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDBClusterParameterGroupWithContext is the same as DeleteDBClusterParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDBClusterParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDBClusterParameterGroupWithContext(ctx aws.Context, input *DeleteDBClusterParameterGroupInput, opts ...request.Option) (*DeleteDBClusterParameterGroupOutput, error) { + req, out := c.DeleteDBClusterParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDBClusterSnapshot = "DeleteDBClusterSnapshot" @@ -2204,8 +2550,23 @@ func (c *RDS) DeleteDBClusterSnapshotRequest(input *DeleteDBClusterSnapshotInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterSnapshot func (c *RDS) DeleteDBClusterSnapshot(input *DeleteDBClusterSnapshotInput) (*DeleteDBClusterSnapshotOutput, error) { req, out := c.DeleteDBClusterSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDBClusterSnapshotWithContext is the same as DeleteDBClusterSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDBClusterSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDBClusterSnapshotWithContext(ctx aws.Context, input *DeleteDBClusterSnapshotInput, opts ...request.Option) (*DeleteDBClusterSnapshotOutput, error) { + req, out := c.DeleteDBClusterSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDBInstance = "DeleteDBInstance" @@ -2305,8 +2666,23 @@ func (c *RDS) DeleteDBInstanceRequest(input *DeleteDBInstanceInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBInstance func (c *RDS) DeleteDBInstance(input *DeleteDBInstanceInput) (*DeleteDBInstanceOutput, error) { req, out := c.DeleteDBInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDBInstanceWithContext is the same as DeleteDBInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDBInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDBInstanceWithContext(ctx aws.Context, input *DeleteDBInstanceInput, opts ...request.Option) (*DeleteDBInstanceOutput, error) { + req, out := c.DeleteDBInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDBParameterGroup = "DeleteDBParameterGroup" @@ -2376,8 +2752,23 @@ func (c *RDS) DeleteDBParameterGroupRequest(input *DeleteDBParameterGroupInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBParameterGroup func (c *RDS) DeleteDBParameterGroup(input *DeleteDBParameterGroupInput) (*DeleteDBParameterGroupOutput, error) { req, out := c.DeleteDBParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDBParameterGroupWithContext is the same as DeleteDBParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDBParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDBParameterGroupWithContext(ctx aws.Context, input *DeleteDBParameterGroupInput, opts ...request.Option) (*DeleteDBParameterGroupOutput, error) { + req, out := c.DeleteDBParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDBSecurityGroup = "DeleteDBSecurityGroup" @@ -2448,8 +2839,23 @@ func (c *RDS) DeleteDBSecurityGroupRequest(input *DeleteDBSecurityGroupInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSecurityGroup func (c *RDS) DeleteDBSecurityGroup(input *DeleteDBSecurityGroupInput) (*DeleteDBSecurityGroupOutput, error) { req, out := c.DeleteDBSecurityGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDBSecurityGroupWithContext is the same as DeleteDBSecurityGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDBSecurityGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDBSecurityGroupWithContext(ctx aws.Context, input *DeleteDBSecurityGroupInput, opts ...request.Option) (*DeleteDBSecurityGroupOutput, error) { + req, out := c.DeleteDBSecurityGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDBSnapshot = "DeleteDBSnapshot" @@ -2519,8 +2925,23 @@ func (c *RDS) DeleteDBSnapshotRequest(input *DeleteDBSnapshotInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSnapshot func (c *RDS) DeleteDBSnapshot(input *DeleteDBSnapshotInput) (*DeleteDBSnapshotOutput, error) { req, out := c.DeleteDBSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDBSnapshotWithContext is the same as DeleteDBSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDBSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDBSnapshotWithContext(ctx aws.Context, input *DeleteDBSnapshotInput, opts ...request.Option) (*DeleteDBSnapshotOutput, error) { + req, out := c.DeleteDBSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDBSubnetGroup = "DeleteDBSubnetGroup" @@ -2594,8 +3015,23 @@ func (c *RDS) DeleteDBSubnetGroupRequest(input *DeleteDBSubnetGroupInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSubnetGroup func (c *RDS) DeleteDBSubnetGroup(input *DeleteDBSubnetGroupInput) (*DeleteDBSubnetGroupOutput, error) { req, out := c.DeleteDBSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDBSubnetGroupWithContext is the same as DeleteDBSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDBSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDBSubnetGroupWithContext(ctx aws.Context, input *DeleteDBSubnetGroupInput, opts ...request.Option) (*DeleteDBSubnetGroupOutput, error) { + req, out := c.DeleteDBSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteEventSubscription = "DeleteEventSubscription" @@ -2663,8 +3099,23 @@ func (c *RDS) DeleteEventSubscriptionRequest(input *DeleteEventSubscriptionInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteEventSubscription func (c *RDS) DeleteEventSubscription(input *DeleteEventSubscriptionInput) (*DeleteEventSubscriptionOutput, error) { req, out := c.DeleteEventSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteEventSubscriptionWithContext is the same as DeleteEventSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteEventSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteEventSubscriptionWithContext(ctx aws.Context, input *DeleteEventSubscriptionInput, opts ...request.Option) (*DeleteEventSubscriptionOutput, error) { + req, out := c.DeleteEventSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteOptionGroup = "DeleteOptionGroup" @@ -2733,8 +3184,23 @@ func (c *RDS) DeleteOptionGroupRequest(input *DeleteOptionGroupInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteOptionGroup func (c *RDS) DeleteOptionGroup(input *DeleteOptionGroupInput) (*DeleteOptionGroupOutput, error) { req, out := c.DeleteOptionGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteOptionGroupWithContext is the same as DeleteOptionGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteOptionGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteOptionGroupWithContext(ctx aws.Context, input *DeleteOptionGroupInput, opts ...request.Option) (*DeleteOptionGroupOutput, error) { + req, out := c.DeleteOptionGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAccountAttributes = "DescribeAccountAttributes" @@ -2798,8 +3264,23 @@ func (c *RDS) DescribeAccountAttributesRequest(input *DescribeAccountAttributesI // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeAccountAttributes func (c *RDS) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (*DescribeAccountAttributesOutput, error) { req, out := c.DescribeAccountAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAccountAttributesWithContext is the same as DescribeAccountAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAccountAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAccountAttributesWithContext(ctx aws.Context, input *DescribeAccountAttributesInput, opts ...request.Option) (*DescribeAccountAttributesOutput, error) { + req, out := c.DescribeAccountAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeCertificates = "DescribeCertificates" @@ -2863,8 +3344,23 @@ func (c *RDS) DescribeCertificatesRequest(input *DescribeCertificatesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeCertificates func (c *RDS) DescribeCertificates(input *DescribeCertificatesInput) (*DescribeCertificatesOutput, error) { req, out := c.DescribeCertificatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeCertificatesWithContext is the same as DescribeCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeCertificatesWithContext(ctx aws.Context, input *DescribeCertificatesInput, opts ...request.Option) (*DescribeCertificatesOutput, error) { + req, out := c.DescribeCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDBClusterParameterGroups = "DescribeDBClusterParameterGroups" @@ -2933,8 +3429,23 @@ func (c *RDS) DescribeDBClusterParameterGroupsRequest(input *DescribeDBClusterPa // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterParameterGroups func (c *RDS) DescribeDBClusterParameterGroups(input *DescribeDBClusterParameterGroupsInput) (*DescribeDBClusterParameterGroupsOutput, error) { req, out := c.DescribeDBClusterParameterGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBClusterParameterGroupsWithContext is the same as DescribeDBClusterParameterGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBClusterParameterGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBClusterParameterGroupsWithContext(ctx aws.Context, input *DescribeDBClusterParameterGroupsInput, opts ...request.Option) (*DescribeDBClusterParameterGroupsOutput, error) { + req, out := c.DescribeDBClusterParameterGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDBClusterParameters = "DescribeDBClusterParameters" @@ -3002,8 +3513,23 @@ func (c *RDS) DescribeDBClusterParametersRequest(input *DescribeDBClusterParamet // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterParameters func (c *RDS) DescribeDBClusterParameters(input *DescribeDBClusterParametersInput) (*DescribeDBClusterParametersOutput, error) { req, out := c.DescribeDBClusterParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBClusterParametersWithContext is the same as DescribeDBClusterParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBClusterParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBClusterParametersWithContext(ctx aws.Context, input *DescribeDBClusterParametersInput, opts ...request.Option) (*DescribeDBClusterParametersOutput, error) { + req, out := c.DescribeDBClusterParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDBClusterSnapshotAttributes = "DescribeDBClusterSnapshotAttributes" @@ -3078,8 +3604,23 @@ func (c *RDS) DescribeDBClusterSnapshotAttributesRequest(input *DescribeDBCluste // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterSnapshotAttributes func (c *RDS) DescribeDBClusterSnapshotAttributes(input *DescribeDBClusterSnapshotAttributesInput) (*DescribeDBClusterSnapshotAttributesOutput, error) { req, out := c.DescribeDBClusterSnapshotAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBClusterSnapshotAttributesWithContext is the same as DescribeDBClusterSnapshotAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBClusterSnapshotAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBClusterSnapshotAttributesWithContext(ctx aws.Context, input *DescribeDBClusterSnapshotAttributesInput, opts ...request.Option) (*DescribeDBClusterSnapshotAttributesOutput, error) { + req, out := c.DescribeDBClusterSnapshotAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDBClusterSnapshots = "DescribeDBClusterSnapshots" @@ -3147,8 +3688,23 @@ func (c *RDS) DescribeDBClusterSnapshotsRequest(input *DescribeDBClusterSnapshot // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterSnapshots func (c *RDS) DescribeDBClusterSnapshots(input *DescribeDBClusterSnapshotsInput) (*DescribeDBClusterSnapshotsOutput, error) { req, out := c.DescribeDBClusterSnapshotsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBClusterSnapshotsWithContext is the same as DescribeDBClusterSnapshots with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBClusterSnapshots for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBClusterSnapshotsWithContext(ctx aws.Context, input *DescribeDBClusterSnapshotsInput, opts ...request.Option) (*DescribeDBClusterSnapshotsOutput, error) { + req, out := c.DescribeDBClusterSnapshotsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDBClusters = "DescribeDBClusters" @@ -3216,8 +3772,23 @@ func (c *RDS) DescribeDBClustersRequest(input *DescribeDBClustersInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusters func (c *RDS) DescribeDBClusters(input *DescribeDBClustersInput) (*DescribeDBClustersOutput, error) { req, out := c.DescribeDBClustersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBClustersWithContext is the same as DescribeDBClusters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBClusters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBClustersWithContext(ctx aws.Context, input *DescribeDBClustersInput, opts ...request.Option) (*DescribeDBClustersOutput, error) { + req, out := c.DescribeDBClustersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDBEngineVersions = "DescribeDBEngineVersions" @@ -3282,8 +3853,23 @@ func (c *RDS) DescribeDBEngineVersionsRequest(input *DescribeDBEngineVersionsInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBEngineVersions func (c *RDS) DescribeDBEngineVersions(input *DescribeDBEngineVersionsInput) (*DescribeDBEngineVersionsOutput, error) { req, out := c.DescribeDBEngineVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBEngineVersionsWithContext is the same as DescribeDBEngineVersions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBEngineVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBEngineVersionsWithContext(ctx aws.Context, input *DescribeDBEngineVersionsInput, opts ...request.Option) (*DescribeDBEngineVersionsOutput, error) { + req, out := c.DescribeDBEngineVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDBEngineVersionsPages iterates over the pages of a DescribeDBEngineVersions operation, @@ -3303,12 +3889,37 @@ func (c *RDS) DescribeDBEngineVersions(input *DescribeDBEngineVersionsInput) (*D // return pageNum <= 3 // }) // -func (c *RDS) DescribeDBEngineVersionsPages(input *DescribeDBEngineVersionsInput, fn func(p *DescribeDBEngineVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBEngineVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBEngineVersionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBEngineVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBEngineVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDBEngineVersionsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeDBInstances = "DescribeDBInstances" @@ -3378,8 +3989,23 @@ func (c *RDS) DescribeDBInstancesRequest(input *DescribeDBInstancesInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBInstances func (c *RDS) DescribeDBInstances(input *DescribeDBInstancesInput) (*DescribeDBInstancesOutput, error) { req, out := c.DescribeDBInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBInstancesWithContext is the same as DescribeDBInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBInstancesWithContext(ctx aws.Context, input *DescribeDBInstancesInput, opts ...request.Option) (*DescribeDBInstancesOutput, error) { + req, out := c.DescribeDBInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDBInstancesPages iterates over the pages of a DescribeDBInstances operation, @@ -3399,12 +4025,37 @@ func (c *RDS) DescribeDBInstances(input *DescribeDBInstancesInput) (*DescribeDBI // return pageNum <= 3 // }) // -func (c *RDS) DescribeDBInstancesPages(input *DescribeDBInstancesInput, fn func(p *DescribeDBInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBInstancesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDBInstancesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeDBLogFiles = "DescribeDBLogFiles" @@ -3474,8 +4125,23 @@ func (c *RDS) DescribeDBLogFilesRequest(input *DescribeDBLogFilesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBLogFiles func (c *RDS) DescribeDBLogFiles(input *DescribeDBLogFilesInput) (*DescribeDBLogFilesOutput, error) { req, out := c.DescribeDBLogFilesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBLogFilesWithContext is the same as DescribeDBLogFiles with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBLogFiles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBLogFilesWithContext(ctx aws.Context, input *DescribeDBLogFilesInput, opts ...request.Option) (*DescribeDBLogFilesOutput, error) { + req, out := c.DescribeDBLogFilesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDBLogFilesPages iterates over the pages of a DescribeDBLogFiles operation, @@ -3495,12 +4161,37 @@ func (c *RDS) DescribeDBLogFiles(input *DescribeDBLogFilesInput) (*DescribeDBLog // return pageNum <= 3 // }) // -func (c *RDS) DescribeDBLogFilesPages(input *DescribeDBLogFilesInput, fn func(p *DescribeDBLogFilesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBLogFilesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBLogFilesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBLogFilesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBLogFilesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDBLogFilesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeDBParameterGroups = "DescribeDBParameterGroups" @@ -3572,8 +4263,23 @@ func (c *RDS) DescribeDBParameterGroupsRequest(input *DescribeDBParameterGroupsI // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBParameterGroups func (c *RDS) DescribeDBParameterGroups(input *DescribeDBParameterGroupsInput) (*DescribeDBParameterGroupsOutput, error) { req, out := c.DescribeDBParameterGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBParameterGroupsWithContext is the same as DescribeDBParameterGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBParameterGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBParameterGroupsWithContext(ctx aws.Context, input *DescribeDBParameterGroupsInput, opts ...request.Option) (*DescribeDBParameterGroupsOutput, error) { + req, out := c.DescribeDBParameterGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDBParameterGroupsPages iterates over the pages of a DescribeDBParameterGroups operation, @@ -3593,12 +4299,37 @@ func (c *RDS) DescribeDBParameterGroups(input *DescribeDBParameterGroupsInput) ( // return pageNum <= 3 // }) // -func (c *RDS) DescribeDBParameterGroupsPages(input *DescribeDBParameterGroupsInput, fn func(p *DescribeDBParameterGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBParameterGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBParameterGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBParameterGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBParameterGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDBParameterGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeDBParameters = "DescribeDBParameters" @@ -3668,8 +4399,23 @@ func (c *RDS) DescribeDBParametersRequest(input *DescribeDBParametersInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBParameters func (c *RDS) DescribeDBParameters(input *DescribeDBParametersInput) (*DescribeDBParametersOutput, error) { req, out := c.DescribeDBParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBParametersWithContext is the same as DescribeDBParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBParametersWithContext(ctx aws.Context, input *DescribeDBParametersInput, opts ...request.Option) (*DescribeDBParametersOutput, error) { + req, out := c.DescribeDBParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDBParametersPages iterates over the pages of a DescribeDBParameters operation, @@ -3689,12 +4435,37 @@ func (c *RDS) DescribeDBParameters(input *DescribeDBParametersInput) (*DescribeD // return pageNum <= 3 // }) // -func (c *RDS) DescribeDBParametersPages(input *DescribeDBParametersInput, fn func(p *DescribeDBParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBParametersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBParametersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBParametersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDBParametersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeDBSecurityGroups = "DescribeDBSecurityGroups" @@ -3766,8 +4537,23 @@ func (c *RDS) DescribeDBSecurityGroupsRequest(input *DescribeDBSecurityGroupsInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSecurityGroups func (c *RDS) DescribeDBSecurityGroups(input *DescribeDBSecurityGroupsInput) (*DescribeDBSecurityGroupsOutput, error) { req, out := c.DescribeDBSecurityGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBSecurityGroupsWithContext is the same as DescribeDBSecurityGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBSecurityGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBSecurityGroupsWithContext(ctx aws.Context, input *DescribeDBSecurityGroupsInput, opts ...request.Option) (*DescribeDBSecurityGroupsOutput, error) { + req, out := c.DescribeDBSecurityGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDBSecurityGroupsPages iterates over the pages of a DescribeDBSecurityGroups operation, @@ -3787,12 +4573,37 @@ func (c *RDS) DescribeDBSecurityGroups(input *DescribeDBSecurityGroupsInput) (*D // return pageNum <= 3 // }) // -func (c *RDS) DescribeDBSecurityGroupsPages(input *DescribeDBSecurityGroupsInput, fn func(p *DescribeDBSecurityGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBSecurityGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBSecurityGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBSecurityGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBSecurityGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDBSecurityGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeDBSnapshotAttributes = "DescribeDBSnapshotAttributes" @@ -3867,8 +4678,23 @@ func (c *RDS) DescribeDBSnapshotAttributesRequest(input *DescribeDBSnapshotAttri // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSnapshotAttributes func (c *RDS) DescribeDBSnapshotAttributes(input *DescribeDBSnapshotAttributesInput) (*DescribeDBSnapshotAttributesOutput, error) { req, out := c.DescribeDBSnapshotAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBSnapshotAttributesWithContext is the same as DescribeDBSnapshotAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBSnapshotAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBSnapshotAttributesWithContext(ctx aws.Context, input *DescribeDBSnapshotAttributesInput, opts ...request.Option) (*DescribeDBSnapshotAttributesOutput, error) { + req, out := c.DescribeDBSnapshotAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDBSnapshots = "DescribeDBSnapshots" @@ -3938,8 +4764,23 @@ func (c *RDS) DescribeDBSnapshotsRequest(input *DescribeDBSnapshotsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSnapshots func (c *RDS) DescribeDBSnapshots(input *DescribeDBSnapshotsInput) (*DescribeDBSnapshotsOutput, error) { req, out := c.DescribeDBSnapshotsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBSnapshotsWithContext is the same as DescribeDBSnapshots with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBSnapshots for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBSnapshotsWithContext(ctx aws.Context, input *DescribeDBSnapshotsInput, opts ...request.Option) (*DescribeDBSnapshotsOutput, error) { + req, out := c.DescribeDBSnapshotsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDBSnapshotsPages iterates over the pages of a DescribeDBSnapshots operation, @@ -3959,12 +4800,37 @@ func (c *RDS) DescribeDBSnapshots(input *DescribeDBSnapshotsInput) (*DescribeDBS // return pageNum <= 3 // }) // -func (c *RDS) DescribeDBSnapshotsPages(input *DescribeDBSnapshotsInput, fn func(p *DescribeDBSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBSnapshotsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBSnapshotsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBSnapshotsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBSnapshotsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDBSnapshotsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeDBSubnetGroups = "DescribeDBSubnetGroups" @@ -4037,8 +4903,23 @@ func (c *RDS) DescribeDBSubnetGroupsRequest(input *DescribeDBSubnetGroupsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSubnetGroups func (c *RDS) DescribeDBSubnetGroups(input *DescribeDBSubnetGroupsInput) (*DescribeDBSubnetGroupsOutput, error) { req, out := c.DescribeDBSubnetGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDBSubnetGroupsWithContext is the same as DescribeDBSubnetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBSubnetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDBSubnetGroupsWithContext(ctx aws.Context, input *DescribeDBSubnetGroupsInput, opts ...request.Option) (*DescribeDBSubnetGroupsOutput, error) { + req, out := c.DescribeDBSubnetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDBSubnetGroupsPages iterates over the pages of a DescribeDBSubnetGroups operation, @@ -4058,12 +4939,37 @@ func (c *RDS) DescribeDBSubnetGroups(input *DescribeDBSubnetGroupsInput) (*Descr // return pageNum <= 3 // }) // -func (c *RDS) DescribeDBSubnetGroupsPages(input *DescribeDBSubnetGroupsInput, fn func(p *DescribeDBSubnetGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBSubnetGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBSubnetGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBSubnetGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBSubnetGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDBSubnetGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeEngineDefaultClusterParameters = "DescribeEngineDefaultClusterParameters" @@ -4126,8 +5032,23 @@ func (c *RDS) DescribeEngineDefaultClusterParametersRequest(input *DescribeEngin // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultClusterParameters func (c *RDS) DescribeEngineDefaultClusterParameters(input *DescribeEngineDefaultClusterParametersInput) (*DescribeEngineDefaultClusterParametersOutput, error) { req, out := c.DescribeEngineDefaultClusterParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEngineDefaultClusterParametersWithContext is the same as DescribeEngineDefaultClusterParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEngineDefaultClusterParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEngineDefaultClusterParametersWithContext(ctx aws.Context, input *DescribeEngineDefaultClusterParametersInput, opts ...request.Option) (*DescribeEngineDefaultClusterParametersOutput, error) { + req, out := c.DescribeEngineDefaultClusterParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEngineDefaultParameters = "DescribeEngineDefaultParameters" @@ -4193,8 +5114,23 @@ func (c *RDS) DescribeEngineDefaultParametersRequest(input *DescribeEngineDefaul // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultParameters func (c *RDS) DescribeEngineDefaultParameters(input *DescribeEngineDefaultParametersInput) (*DescribeEngineDefaultParametersOutput, error) { req, out := c.DescribeEngineDefaultParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEngineDefaultParametersWithContext is the same as DescribeEngineDefaultParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEngineDefaultParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEngineDefaultParametersWithContext(ctx aws.Context, input *DescribeEngineDefaultParametersInput, opts ...request.Option) (*DescribeEngineDefaultParametersOutput, error) { + req, out := c.DescribeEngineDefaultParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeEngineDefaultParametersPages iterates over the pages of a DescribeEngineDefaultParameters operation, @@ -4214,12 +5150,37 @@ func (c *RDS) DescribeEngineDefaultParameters(input *DescribeEngineDefaultParame // return pageNum <= 3 // }) // -func (c *RDS) DescribeEngineDefaultParametersPages(input *DescribeEngineDefaultParametersInput, fn func(p *DescribeEngineDefaultParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEngineDefaultParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEngineDefaultParametersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEngineDefaultParametersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEngineDefaultParametersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeEventCategories = "DescribeEventCategories" @@ -4281,8 +5242,23 @@ func (c *RDS) DescribeEventCategoriesRequest(input *DescribeEventCategoriesInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEventCategories func (c *RDS) DescribeEventCategories(input *DescribeEventCategoriesInput) (*DescribeEventCategoriesOutput, error) { req, out := c.DescribeEventCategoriesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEventCategoriesWithContext is the same as DescribeEventCategories with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEventCategories for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEventCategoriesWithContext(ctx aws.Context, input *DescribeEventCategoriesInput, opts ...request.Option) (*DescribeEventCategoriesOutput, error) { + req, out := c.DescribeEventCategoriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEventSubscriptions = "DescribeEventSubscriptions" @@ -4356,8 +5332,23 @@ func (c *RDS) DescribeEventSubscriptionsRequest(input *DescribeEventSubscription // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEventSubscriptions func (c *RDS) DescribeEventSubscriptions(input *DescribeEventSubscriptionsInput) (*DescribeEventSubscriptionsOutput, error) { req, out := c.DescribeEventSubscriptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEventSubscriptionsWithContext is the same as DescribeEventSubscriptions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEventSubscriptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEventSubscriptionsWithContext(ctx aws.Context, input *DescribeEventSubscriptionsInput, opts ...request.Option) (*DescribeEventSubscriptionsOutput, error) { + req, out := c.DescribeEventSubscriptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeEventSubscriptionsPages iterates over the pages of a DescribeEventSubscriptions operation, @@ -4377,12 +5368,37 @@ func (c *RDS) DescribeEventSubscriptions(input *DescribeEventSubscriptionsInput) // return pageNum <= 3 // }) // -func (c *RDS) DescribeEventSubscriptionsPages(input *DescribeEventSubscriptionsInput, fn func(p *DescribeEventSubscriptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventSubscriptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventSubscriptionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEventSubscriptionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEventSubscriptionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeEvents = "DescribeEvents" @@ -4451,8 +5467,23 @@ func (c *RDS) DescribeEventsRequest(input *DescribeEventsInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEvents func (c *RDS) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, error) { req, out := c.DescribeEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEventsWithContext is the same as DescribeEvents with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEventsWithContext(ctx aws.Context, input *DescribeEventsInput, opts ...request.Option) (*DescribeEventsOutput, error) { + req, out := c.DescribeEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeEventsPages iterates over the pages of a DescribeEvents operation, @@ -4472,12 +5503,37 @@ func (c *RDS) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, // return pageNum <= 3 // }) // -func (c *RDS) DescribeEventsPages(input *DescribeEventsInput, fn func(p *DescribeEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeOptionGroupOptions = "DescribeOptionGroupOptions" @@ -4542,8 +5598,23 @@ func (c *RDS) DescribeOptionGroupOptionsRequest(input *DescribeOptionGroupOption // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOptionGroupOptions func (c *RDS) DescribeOptionGroupOptions(input *DescribeOptionGroupOptionsInput) (*DescribeOptionGroupOptionsOutput, error) { req, out := c.DescribeOptionGroupOptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeOptionGroupOptionsWithContext is the same as DescribeOptionGroupOptions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeOptionGroupOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeOptionGroupOptionsWithContext(ctx aws.Context, input *DescribeOptionGroupOptionsInput, opts ...request.Option) (*DescribeOptionGroupOptionsOutput, error) { + req, out := c.DescribeOptionGroupOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeOptionGroupOptionsPages iterates over the pages of a DescribeOptionGroupOptions operation, @@ -4563,12 +5634,37 @@ func (c *RDS) DescribeOptionGroupOptions(input *DescribeOptionGroupOptionsInput) // return pageNum <= 3 // }) // -func (c *RDS) DescribeOptionGroupOptionsPages(input *DescribeOptionGroupOptionsInput, fn func(p *DescribeOptionGroupOptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeOptionGroupOptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeOptionGroupOptionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeOptionGroupOptionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeOptionGroupOptionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeOptionGroupOptionsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeOptionGroups = "DescribeOptionGroups" @@ -4638,8 +5734,23 @@ func (c *RDS) DescribeOptionGroupsRequest(input *DescribeOptionGroupsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOptionGroups func (c *RDS) DescribeOptionGroups(input *DescribeOptionGroupsInput) (*DescribeOptionGroupsOutput, error) { req, out := c.DescribeOptionGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeOptionGroupsWithContext is the same as DescribeOptionGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeOptionGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeOptionGroupsWithContext(ctx aws.Context, input *DescribeOptionGroupsInput, opts ...request.Option) (*DescribeOptionGroupsOutput, error) { + req, out := c.DescribeOptionGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeOptionGroupsPages iterates over the pages of a DescribeOptionGroups operation, @@ -4659,12 +5770,37 @@ func (c *RDS) DescribeOptionGroups(input *DescribeOptionGroupsInput) (*DescribeO // return pageNum <= 3 // }) // -func (c *RDS) DescribeOptionGroupsPages(input *DescribeOptionGroupsInput, fn func(p *DescribeOptionGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeOptionGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeOptionGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeOptionGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeOptionGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeOptionGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeOrderableDBInstanceOptions = "DescribeOrderableDBInstanceOptions" @@ -4729,8 +5865,23 @@ func (c *RDS) DescribeOrderableDBInstanceOptionsRequest(input *DescribeOrderable // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOrderableDBInstanceOptions func (c *RDS) DescribeOrderableDBInstanceOptions(input *DescribeOrderableDBInstanceOptionsInput) (*DescribeOrderableDBInstanceOptionsOutput, error) { req, out := c.DescribeOrderableDBInstanceOptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeOrderableDBInstanceOptionsWithContext is the same as DescribeOrderableDBInstanceOptions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeOrderableDBInstanceOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeOrderableDBInstanceOptionsWithContext(ctx aws.Context, input *DescribeOrderableDBInstanceOptionsInput, opts ...request.Option) (*DescribeOrderableDBInstanceOptionsOutput, error) { + req, out := c.DescribeOrderableDBInstanceOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeOrderableDBInstanceOptionsPages iterates over the pages of a DescribeOrderableDBInstanceOptions operation, @@ -4750,12 +5901,37 @@ func (c *RDS) DescribeOrderableDBInstanceOptions(input *DescribeOrderableDBInsta // return pageNum <= 3 // }) // -func (c *RDS) DescribeOrderableDBInstanceOptionsPages(input *DescribeOrderableDBInstanceOptionsInput, fn func(p *DescribeOrderableDBInstanceOptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeOrderableDBInstanceOptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeOrderableDBInstanceOptionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeOrderableDBInstanceOptionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeOrderableDBInstanceOptionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeOrderableDBInstanceOptionsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribePendingMaintenanceActions = "DescribePendingMaintenanceActions" @@ -4820,8 +5996,23 @@ func (c *RDS) DescribePendingMaintenanceActionsRequest(input *DescribePendingMai // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribePendingMaintenanceActions func (c *RDS) DescribePendingMaintenanceActions(input *DescribePendingMaintenanceActionsInput) (*DescribePendingMaintenanceActionsOutput, error) { req, out := c.DescribePendingMaintenanceActionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribePendingMaintenanceActionsWithContext is the same as DescribePendingMaintenanceActions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePendingMaintenanceActions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribePendingMaintenanceActionsWithContext(ctx aws.Context, input *DescribePendingMaintenanceActionsInput, opts ...request.Option) (*DescribePendingMaintenanceActionsOutput, error) { + req, out := c.DescribePendingMaintenanceActionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeReservedDBInstances = "DescribeReservedDBInstances" @@ -4892,8 +6083,23 @@ func (c *RDS) DescribeReservedDBInstancesRequest(input *DescribeReservedDBInstan // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeReservedDBInstances func (c *RDS) DescribeReservedDBInstances(input *DescribeReservedDBInstancesInput) (*DescribeReservedDBInstancesOutput, error) { req, out := c.DescribeReservedDBInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedDBInstancesWithContext is the same as DescribeReservedDBInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedDBInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedDBInstancesWithContext(ctx aws.Context, input *DescribeReservedDBInstancesInput, opts ...request.Option) (*DescribeReservedDBInstancesOutput, error) { + req, out := c.DescribeReservedDBInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeReservedDBInstancesPages iterates over the pages of a DescribeReservedDBInstances operation, @@ -4913,12 +6119,37 @@ func (c *RDS) DescribeReservedDBInstances(input *DescribeReservedDBInstancesInpu // return pageNum <= 3 // }) // -func (c *RDS) DescribeReservedDBInstancesPages(input *DescribeReservedDBInstancesInput, fn func(p *DescribeReservedDBInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedDBInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedDBInstancesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReservedDBInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReservedDBInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeReservedDBInstancesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeReservedDBInstancesOfferings = "DescribeReservedDBInstancesOfferings" @@ -4988,8 +6219,23 @@ func (c *RDS) DescribeReservedDBInstancesOfferingsRequest(input *DescribeReserve // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeReservedDBInstancesOfferings func (c *RDS) DescribeReservedDBInstancesOfferings(input *DescribeReservedDBInstancesOfferingsInput) (*DescribeReservedDBInstancesOfferingsOutput, error) { req, out := c.DescribeReservedDBInstancesOfferingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedDBInstancesOfferingsWithContext is the same as DescribeReservedDBInstancesOfferings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedDBInstancesOfferings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedDBInstancesOfferingsWithContext(ctx aws.Context, input *DescribeReservedDBInstancesOfferingsInput, opts ...request.Option) (*DescribeReservedDBInstancesOfferingsOutput, error) { + req, out := c.DescribeReservedDBInstancesOfferingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeReservedDBInstancesOfferingsPages iterates over the pages of a DescribeReservedDBInstancesOfferings operation, @@ -5009,12 +6255,37 @@ func (c *RDS) DescribeReservedDBInstancesOfferings(input *DescribeReservedDBInst // return pageNum <= 3 // }) // -func (c *RDS) DescribeReservedDBInstancesOfferingsPages(input *DescribeReservedDBInstancesOfferingsInput, fn func(p *DescribeReservedDBInstancesOfferingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedDBInstancesOfferingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedDBInstancesOfferingsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReservedDBInstancesOfferingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReservedDBInstancesOfferingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeReservedDBInstancesOfferingsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeSourceRegions = "DescribeSourceRegions" @@ -5075,8 +6346,23 @@ func (c *RDS) DescribeSourceRegionsRequest(input *DescribeSourceRegionsInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeSourceRegions func (c *RDS) DescribeSourceRegions(input *DescribeSourceRegionsInput) (*DescribeSourceRegionsOutput, error) { req, out := c.DescribeSourceRegionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSourceRegionsWithContext is the same as DescribeSourceRegions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSourceRegions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSourceRegionsWithContext(ctx aws.Context, input *DescribeSourceRegionsInput, opts ...request.Option) (*DescribeSourceRegionsOutput, error) { + req, out := c.DescribeSourceRegionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDownloadDBLogFilePortion = "DownloadDBLogFilePortion" @@ -5149,8 +6435,23 @@ func (c *RDS) DownloadDBLogFilePortionRequest(input *DownloadDBLogFilePortionInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DownloadDBLogFilePortion func (c *RDS) DownloadDBLogFilePortion(input *DownloadDBLogFilePortionInput) (*DownloadDBLogFilePortionOutput, error) { req, out := c.DownloadDBLogFilePortionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DownloadDBLogFilePortionWithContext is the same as DownloadDBLogFilePortion with the addition of +// the ability to pass a context and additional request options. +// +// See DownloadDBLogFilePortion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DownloadDBLogFilePortionWithContext(ctx aws.Context, input *DownloadDBLogFilePortionInput, opts ...request.Option) (*DownloadDBLogFilePortionOutput, error) { + req, out := c.DownloadDBLogFilePortionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DownloadDBLogFilePortionPages iterates over the pages of a DownloadDBLogFilePortion operation, @@ -5170,12 +6471,37 @@ func (c *RDS) DownloadDBLogFilePortion(input *DownloadDBLogFilePortionInput) (*D // return pageNum <= 3 // }) // -func (c *RDS) DownloadDBLogFilePortionPages(input *DownloadDBLogFilePortionInput, fn func(p *DownloadDBLogFilePortionOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DownloadDBLogFilePortionRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DownloadDBLogFilePortionOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DownloadDBLogFilePortionInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DownloadDBLogFilePortionRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DownloadDBLogFilePortionOutput), !p.HasNextPage()) + } + return p.Err() } const opFailoverDBCluster = "FailoverDBCluster" @@ -5258,8 +6584,23 @@ func (c *RDS) FailoverDBClusterRequest(input *FailoverDBClusterInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/FailoverDBCluster func (c *RDS) FailoverDBCluster(input *FailoverDBClusterInput) (*FailoverDBClusterOutput, error) { req, out := c.FailoverDBClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// FailoverDBClusterWithContext is the same as FailoverDBCluster with the addition of +// the ability to pass a context and additional request options. +// +// See FailoverDBCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) FailoverDBClusterWithContext(ctx aws.Context, input *FailoverDBClusterInput, opts ...request.Option) (*FailoverDBClusterOutput, error) { + req, out := c.FailoverDBClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTagsForResource = "ListTagsForResource" @@ -5332,8 +6673,23 @@ func (c *RDS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ListTagsForResource func (c *RDS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyDBCluster = "ModifyDBCluster" @@ -5435,8 +6791,23 @@ func (c *RDS) ModifyDBClusterRequest(input *ModifyDBClusterInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBCluster func (c *RDS) ModifyDBCluster(input *ModifyDBClusterInput) (*ModifyDBClusterOutput, error) { req, out := c.ModifyDBClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyDBClusterWithContext is the same as ModifyDBCluster with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyDBClusterWithContext(ctx aws.Context, input *ModifyDBClusterInput, opts ...request.Option) (*ModifyDBClusterOutput, error) { + req, out := c.ModifyDBClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyDBClusterParameterGroup = "ModifyDBClusterParameterGroup" @@ -5523,8 +6894,23 @@ func (c *RDS) ModifyDBClusterParameterGroupRequest(input *ModifyDBClusterParamet // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterParameterGroup func (c *RDS) ModifyDBClusterParameterGroup(input *ModifyDBClusterParameterGroupInput) (*DBClusterParameterGroupNameMessage, error) { req, out := c.ModifyDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyDBClusterParameterGroupWithContext is the same as ModifyDBClusterParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBClusterParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyDBClusterParameterGroupWithContext(ctx aws.Context, input *ModifyDBClusterParameterGroupInput, opts ...request.Option) (*DBClusterParameterGroupNameMessage, error) { + req, out := c.ModifyDBClusterParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyDBClusterSnapshotAttribute = "ModifyDBClusterSnapshotAttribute" @@ -5610,8 +6996,23 @@ func (c *RDS) ModifyDBClusterSnapshotAttributeRequest(input *ModifyDBClusterSnap // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterSnapshotAttribute func (c *RDS) ModifyDBClusterSnapshotAttribute(input *ModifyDBClusterSnapshotAttributeInput) (*ModifyDBClusterSnapshotAttributeOutput, error) { req, out := c.ModifyDBClusterSnapshotAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyDBClusterSnapshotAttributeWithContext is the same as ModifyDBClusterSnapshotAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBClusterSnapshotAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyDBClusterSnapshotAttributeWithContext(ctx aws.Context, input *ModifyDBClusterSnapshotAttributeInput, opts ...request.Option) (*ModifyDBClusterSnapshotAttributeOutput, error) { + req, out := c.ModifyDBClusterSnapshotAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyDBInstance = "ModifyDBInstance" @@ -5729,8 +7130,23 @@ func (c *RDS) ModifyDBInstanceRequest(input *ModifyDBInstanceInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBInstance func (c *RDS) ModifyDBInstance(input *ModifyDBInstanceInput) (*ModifyDBInstanceOutput, error) { req, out := c.ModifyDBInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyDBInstanceWithContext is the same as ModifyDBInstance with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyDBInstanceWithContext(ctx aws.Context, input *ModifyDBInstanceInput, opts ...request.Option) (*ModifyDBInstanceOutput, error) { + req, out := c.ModifyDBInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyDBParameterGroup = "ModifyDBParameterGroup" @@ -5814,8 +7230,23 @@ func (c *RDS) ModifyDBParameterGroupRequest(input *ModifyDBParameterGroupInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBParameterGroup func (c *RDS) ModifyDBParameterGroup(input *ModifyDBParameterGroupInput) (*DBParameterGroupNameMessage, error) { req, out := c.ModifyDBParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyDBParameterGroupWithContext is the same as ModifyDBParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyDBParameterGroupWithContext(ctx aws.Context, input *ModifyDBParameterGroupInput, opts ...request.Option) (*DBParameterGroupNameMessage, error) { + req, out := c.ModifyDBParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyDBSnapshot = "ModifyDBSnapshot" @@ -5884,8 +7315,23 @@ func (c *RDS) ModifyDBSnapshotRequest(input *ModifyDBSnapshotInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshot func (c *RDS) ModifyDBSnapshot(input *ModifyDBSnapshotInput) (*ModifyDBSnapshotOutput, error) { req, out := c.ModifyDBSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyDBSnapshotWithContext is the same as ModifyDBSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyDBSnapshotWithContext(ctx aws.Context, input *ModifyDBSnapshotInput, opts ...request.Option) (*ModifyDBSnapshotOutput, error) { + req, out := c.ModifyDBSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyDBSnapshotAttribute = "ModifyDBSnapshotAttribute" @@ -5971,8 +7417,23 @@ func (c *RDS) ModifyDBSnapshotAttributeRequest(input *ModifyDBSnapshotAttributeI // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshotAttribute func (c *RDS) ModifyDBSnapshotAttribute(input *ModifyDBSnapshotAttributeInput) (*ModifyDBSnapshotAttributeOutput, error) { req, out := c.ModifyDBSnapshotAttributeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyDBSnapshotAttributeWithContext is the same as ModifyDBSnapshotAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBSnapshotAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyDBSnapshotAttributeWithContext(ctx aws.Context, input *ModifyDBSnapshotAttributeInput, opts ...request.Option) (*ModifyDBSnapshotAttributeOutput, error) { + req, out := c.ModifyDBSnapshotAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyDBSubnetGroup = "ModifyDBSubnetGroup" @@ -6052,8 +7513,23 @@ func (c *RDS) ModifyDBSubnetGroupRequest(input *ModifyDBSubnetGroupInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSubnetGroup func (c *RDS) ModifyDBSubnetGroup(input *ModifyDBSubnetGroupInput) (*ModifyDBSubnetGroupOutput, error) { req, out := c.ModifyDBSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyDBSubnetGroupWithContext is the same as ModifyDBSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyDBSubnetGroupWithContext(ctx aws.Context, input *ModifyDBSubnetGroupInput, opts ...request.Option) (*ModifyDBSubnetGroupOutput, error) { + req, out := c.ModifyDBSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyEventSubscription = "ModifyEventSubscription" @@ -6140,8 +7616,23 @@ func (c *RDS) ModifyEventSubscriptionRequest(input *ModifyEventSubscriptionInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyEventSubscription func (c *RDS) ModifyEventSubscription(input *ModifyEventSubscriptionInput) (*ModifyEventSubscriptionOutput, error) { req, out := c.ModifyEventSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyEventSubscriptionWithContext is the same as ModifyEventSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyEventSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyEventSubscriptionWithContext(ctx aws.Context, input *ModifyEventSubscriptionInput, opts ...request.Option) (*ModifyEventSubscriptionOutput, error) { + req, out := c.ModifyEventSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyOptionGroup = "ModifyOptionGroup" @@ -6208,8 +7699,23 @@ func (c *RDS) ModifyOptionGroupRequest(input *ModifyOptionGroupInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyOptionGroup func (c *RDS) ModifyOptionGroup(input *ModifyOptionGroupInput) (*ModifyOptionGroupOutput, error) { req, out := c.ModifyOptionGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyOptionGroupWithContext is the same as ModifyOptionGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyOptionGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyOptionGroupWithContext(ctx aws.Context, input *ModifyOptionGroupInput, opts ...request.Option) (*ModifyOptionGroupOutput, error) { + req, out := c.ModifyOptionGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPromoteReadReplica = "PromoteReadReplica" @@ -6281,8 +7787,23 @@ func (c *RDS) PromoteReadReplicaRequest(input *PromoteReadReplicaInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplica func (c *RDS) PromoteReadReplica(input *PromoteReadReplicaInput) (*PromoteReadReplicaOutput, error) { req, out := c.PromoteReadReplicaRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PromoteReadReplicaWithContext is the same as PromoteReadReplica with the addition of +// the ability to pass a context and additional request options. +// +// See PromoteReadReplica for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PromoteReadReplicaWithContext(ctx aws.Context, input *PromoteReadReplicaInput, opts ...request.Option) (*PromoteReadReplicaOutput, error) { + req, out := c.PromoteReadReplicaRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPromoteReadReplicaDBCluster = "PromoteReadReplicaDBCluster" @@ -6349,8 +7870,23 @@ func (c *RDS) PromoteReadReplicaDBClusterRequest(input *PromoteReadReplicaDBClus // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplicaDBCluster func (c *RDS) PromoteReadReplicaDBCluster(input *PromoteReadReplicaDBClusterInput) (*PromoteReadReplicaDBClusterOutput, error) { req, out := c.PromoteReadReplicaDBClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PromoteReadReplicaDBClusterWithContext is the same as PromoteReadReplicaDBCluster with the addition of +// the ability to pass a context and additional request options. +// +// See PromoteReadReplicaDBCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PromoteReadReplicaDBClusterWithContext(ctx aws.Context, input *PromoteReadReplicaDBClusterInput, opts ...request.Option) (*PromoteReadReplicaDBClusterOutput, error) { + req, out := c.PromoteReadReplicaDBClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPurchaseReservedDBInstancesOffering = "PurchaseReservedDBInstancesOffering" @@ -6420,8 +7956,23 @@ func (c *RDS) PurchaseReservedDBInstancesOfferingRequest(input *PurchaseReserved // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PurchaseReservedDBInstancesOffering func (c *RDS) PurchaseReservedDBInstancesOffering(input *PurchaseReservedDBInstancesOfferingInput) (*PurchaseReservedDBInstancesOfferingOutput, error) { req, out := c.PurchaseReservedDBInstancesOfferingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PurchaseReservedDBInstancesOfferingWithContext is the same as PurchaseReservedDBInstancesOffering with the addition of +// the ability to pass a context and additional request options. +// +// See PurchaseReservedDBInstancesOffering for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PurchaseReservedDBInstancesOfferingWithContext(ctx aws.Context, input *PurchaseReservedDBInstancesOfferingInput, opts ...request.Option) (*PurchaseReservedDBInstancesOfferingOutput, error) { + req, out := c.PurchaseReservedDBInstancesOfferingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRebootDBInstance = "RebootDBInstance" @@ -6504,8 +8055,23 @@ func (c *RDS) RebootDBInstanceRequest(input *RebootDBInstanceInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RebootDBInstance func (c *RDS) RebootDBInstance(input *RebootDBInstanceInput) (*RebootDBInstanceOutput, error) { req, out := c.RebootDBInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RebootDBInstanceWithContext is the same as RebootDBInstance with the addition of +// the ability to pass a context and additional request options. +// +// See RebootDBInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RebootDBInstanceWithContext(ctx aws.Context, input *RebootDBInstanceInput, opts ...request.Option) (*RebootDBInstanceOutput, error) { + req, out := c.RebootDBInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveRoleFromDBCluster = "RemoveRoleFromDBCluster" @@ -6580,8 +8146,23 @@ func (c *RDS) RemoveRoleFromDBClusterRequest(input *RemoveRoleFromDBClusterInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveRoleFromDBCluster func (c *RDS) RemoveRoleFromDBCluster(input *RemoveRoleFromDBClusterInput) (*RemoveRoleFromDBClusterOutput, error) { req, out := c.RemoveRoleFromDBClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveRoleFromDBClusterWithContext is the same as RemoveRoleFromDBCluster with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveRoleFromDBCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveRoleFromDBClusterWithContext(ctx aws.Context, input *RemoveRoleFromDBClusterInput, opts ...request.Option) (*RemoveRoleFromDBClusterOutput, error) { + req, out := c.RemoveRoleFromDBClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveSourceIdentifierFromSubscription = "RemoveSourceIdentifierFromSubscription" @@ -6648,8 +8229,23 @@ func (c *RDS) RemoveSourceIdentifierFromSubscriptionRequest(input *RemoveSourceI // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveSourceIdentifierFromSubscription func (c *RDS) RemoveSourceIdentifierFromSubscription(input *RemoveSourceIdentifierFromSubscriptionInput) (*RemoveSourceIdentifierFromSubscriptionOutput, error) { req, out := c.RemoveSourceIdentifierFromSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveSourceIdentifierFromSubscriptionWithContext is the same as RemoveSourceIdentifierFromSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveSourceIdentifierFromSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveSourceIdentifierFromSubscriptionWithContext(ctx aws.Context, input *RemoveSourceIdentifierFromSubscriptionInput, opts ...request.Option) (*RemoveSourceIdentifierFromSubscriptionOutput, error) { + req, out := c.RemoveSourceIdentifierFromSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -6724,8 +8320,23 @@ func (c *RDS) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveTagsFromResource func (c *RDS) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*RemoveTagsFromResourceOutput, error) { req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsFromResourceWithContext is the same as RemoveTagsFromResource with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTagsFromResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsFromResourceWithContext(ctx aws.Context, input *RemoveTagsFromResourceInput, opts ...request.Option) (*RemoveTagsFromResourceOutput, error) { + req, out := c.RemoveTagsFromResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResetDBClusterParameterGroup = "ResetDBClusterParameterGroup" @@ -6804,8 +8415,23 @@ func (c *RDS) ResetDBClusterParameterGroupRequest(input *ResetDBClusterParameter // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ResetDBClusterParameterGroup func (c *RDS) ResetDBClusterParameterGroup(input *ResetDBClusterParameterGroupInput) (*DBClusterParameterGroupNameMessage, error) { req, out := c.ResetDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResetDBClusterParameterGroupWithContext is the same as ResetDBClusterParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ResetDBClusterParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResetDBClusterParameterGroupWithContext(ctx aws.Context, input *ResetDBClusterParameterGroupInput, opts ...request.Option) (*DBClusterParameterGroupNameMessage, error) { + req, out := c.ResetDBClusterParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResetDBParameterGroup = "ResetDBParameterGroup" @@ -6878,8 +8504,23 @@ func (c *RDS) ResetDBParameterGroupRequest(input *ResetDBParameterGroupInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ResetDBParameterGroup func (c *RDS) ResetDBParameterGroup(input *ResetDBParameterGroupInput) (*DBParameterGroupNameMessage, error) { req, out := c.ResetDBParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResetDBParameterGroupWithContext is the same as ResetDBParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ResetDBParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResetDBParameterGroupWithContext(ctx aws.Context, input *ResetDBParameterGroupInput, opts ...request.Option) (*DBParameterGroupNameMessage, error) { + req, out := c.ResetDBParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreDBClusterFromS3 = "RestoreDBClusterFromS3" @@ -6991,8 +8632,23 @@ func (c *RDS) RestoreDBClusterFromS3Request(input *RestoreDBClusterFromS3Input) // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromS3 func (c *RDS) RestoreDBClusterFromS3(input *RestoreDBClusterFromS3Input) (*RestoreDBClusterFromS3Output, error) { req, out := c.RestoreDBClusterFromS3Request(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreDBClusterFromS3WithContext is the same as RestoreDBClusterFromS3 with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreDBClusterFromS3 for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreDBClusterFromS3WithContext(ctx aws.Context, input *RestoreDBClusterFromS3Input, opts ...request.Option) (*RestoreDBClusterFromS3Output, error) { + req, out := c.RestoreDBClusterFromS3Request(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreDBClusterFromSnapshot = "RestoreDBClusterFromSnapshot" @@ -7117,8 +8773,23 @@ func (c *RDS) RestoreDBClusterFromSnapshotRequest(input *RestoreDBClusterFromSna // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromSnapshot func (c *RDS) RestoreDBClusterFromSnapshot(input *RestoreDBClusterFromSnapshotInput) (*RestoreDBClusterFromSnapshotOutput, error) { req, out := c.RestoreDBClusterFromSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreDBClusterFromSnapshotWithContext is the same as RestoreDBClusterFromSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreDBClusterFromSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreDBClusterFromSnapshotWithContext(ctx aws.Context, input *RestoreDBClusterFromSnapshotInput, opts ...request.Option) (*RestoreDBClusterFromSnapshotOutput, error) { + req, out := c.RestoreDBClusterFromSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreDBClusterToPointInTime = "RestoreDBClusterToPointInTime" @@ -7244,8 +8915,23 @@ func (c *RDS) RestoreDBClusterToPointInTimeRequest(input *RestoreDBClusterToPoin // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterToPointInTime func (c *RDS) RestoreDBClusterToPointInTime(input *RestoreDBClusterToPointInTimeInput) (*RestoreDBClusterToPointInTimeOutput, error) { req, out := c.RestoreDBClusterToPointInTimeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreDBClusterToPointInTimeWithContext is the same as RestoreDBClusterToPointInTime with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreDBClusterToPointInTime for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreDBClusterToPointInTimeWithContext(ctx aws.Context, input *RestoreDBClusterToPointInTimeInput, opts ...request.Option) (*RestoreDBClusterToPointInTimeOutput, error) { + req, out := c.RestoreDBClusterToPointInTimeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreDBInstanceFromDBSnapshot = "RestoreDBInstanceFromDBSnapshot" @@ -7387,8 +9073,23 @@ func (c *RDS) RestoreDBInstanceFromDBSnapshotRequest(input *RestoreDBInstanceFro // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceFromDBSnapshot func (c *RDS) RestoreDBInstanceFromDBSnapshot(input *RestoreDBInstanceFromDBSnapshotInput) (*RestoreDBInstanceFromDBSnapshotOutput, error) { req, out := c.RestoreDBInstanceFromDBSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreDBInstanceFromDBSnapshotWithContext is the same as RestoreDBInstanceFromDBSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreDBInstanceFromDBSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreDBInstanceFromDBSnapshotWithContext(ctx aws.Context, input *RestoreDBInstanceFromDBSnapshotInput, opts ...request.Option) (*RestoreDBInstanceFromDBSnapshotOutput, error) { + req, out := c.RestoreDBInstanceFromDBSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreDBInstanceToPointInTime = "RestoreDBInstanceToPointInTime" @@ -7527,8 +9228,23 @@ func (c *RDS) RestoreDBInstanceToPointInTimeRequest(input *RestoreDBInstanceToPo // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceToPointInTime func (c *RDS) RestoreDBInstanceToPointInTime(input *RestoreDBInstanceToPointInTimeInput) (*RestoreDBInstanceToPointInTimeOutput, error) { req, out := c.RestoreDBInstanceToPointInTimeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreDBInstanceToPointInTimeWithContext is the same as RestoreDBInstanceToPointInTime with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreDBInstanceToPointInTime for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreDBInstanceToPointInTimeWithContext(ctx aws.Context, input *RestoreDBInstanceToPointInTimeInput, opts ...request.Option) (*RestoreDBInstanceToPointInTimeOutput, error) { + req, out := c.RestoreDBInstanceToPointInTimeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRevokeDBSecurityGroupIngress = "RevokeDBSecurityGroupIngress" @@ -7605,8 +9321,23 @@ func (c *RDS) RevokeDBSecurityGroupIngressRequest(input *RevokeDBSecurityGroupIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RevokeDBSecurityGroupIngress func (c *RDS) RevokeDBSecurityGroupIngress(input *RevokeDBSecurityGroupIngressInput) (*RevokeDBSecurityGroupIngressOutput, error) { req, out := c.RevokeDBSecurityGroupIngressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RevokeDBSecurityGroupIngressWithContext is the same as RevokeDBSecurityGroupIngress with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeDBSecurityGroupIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RevokeDBSecurityGroupIngressWithContext(ctx aws.Context, input *RevokeDBSecurityGroupIngressInput, opts ...request.Option) (*RevokeDBSecurityGroupIngressOutput, error) { + req, out := c.RevokeDBSecurityGroupIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Describes a quota for an AWS account, for example, the number of DB instances diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/errors.go b/vendor/github.com/aws/aws-sdk-go/service/rds/errors.go index 1ffd1a0fb..2617719ff 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/rds/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package rds diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/service.go b/vendor/github.com/aws/aws-sdk-go/service/rds/service.go index e81de9182..80fa5120a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/rds/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package rds diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/rds/waiters.go index 00f532a75..3ea78a9ba 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/rds/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package rds import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilDBInstanceAvailable uses the Amazon RDS API operation @@ -11,56 +14,70 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *RDS) WaitUntilDBInstanceAvailable(input *DescribeDBInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeDBInstances", - Delay: 30, + return c.WaitUntilDBInstanceAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilDBInstanceAvailableWithContext is an extended version of WaitUntilDBInstanceAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilDBInstanceAvailableWithContext(ctx aws.Context, input *DescribeDBInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilDBInstanceAvailable", MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "DBInstances[].DBInstanceStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "deleted", }, { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "deleting", }, { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "incompatible-restore", }, { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "incompatible-parameters", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeDBInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilDBInstanceDeleted uses the Amazon RDS API operation @@ -68,54 +85,68 @@ func (c *RDS) WaitUntilDBInstanceAvailable(input *DescribeDBInstancesInput) erro // If the condition is not meet within the max attempt window an error will // be returned. func (c *RDS) WaitUntilDBInstanceDeleted(input *DescribeDBInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeDBInstances", - Delay: 30, + return c.WaitUntilDBInstanceDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilDBInstanceDeletedWithContext is an extended version of WaitUntilDBInstanceDeleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilDBInstanceDeletedWithContext(ctx aws.Context, input *DescribeDBInstancesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilDBInstanceDeleted", MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "DBInstances[].DBInstanceStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "deleted", }, { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "DBInstanceNotFound", }, { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "creating", }, { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "modifying", }, { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "rebooting", }, { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "DBInstances[].DBInstanceStatus", Expected: "resetting-master-credentials", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeDBInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/redshift/api.go b/vendor/github.com/aws/aws-sdk-go/service/redshift/api.go index 7a9a7cf2c..cf050546d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/redshift/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package redshift provides a client for Amazon Redshift. package redshift @@ -6,6 +6,7 @@ package redshift import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -103,8 +104,23 @@ func (c *Redshift) AuthorizeClusterSecurityGroupIngressRequest(input *AuthorizeC // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeClusterSecurityGroupIngress func (c *Redshift) AuthorizeClusterSecurityGroupIngress(input *AuthorizeClusterSecurityGroupIngressInput) (*AuthorizeClusterSecurityGroupIngressOutput, error) { req, out := c.AuthorizeClusterSecurityGroupIngressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AuthorizeClusterSecurityGroupIngressWithContext is the same as AuthorizeClusterSecurityGroupIngress with the addition of +// the ability to pass a context and additional request options. +// +// See AuthorizeClusterSecurityGroupIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AuthorizeClusterSecurityGroupIngressWithContext(ctx aws.Context, input *AuthorizeClusterSecurityGroupIngressInput, opts ...request.Option) (*AuthorizeClusterSecurityGroupIngressOutput, error) { + req, out := c.AuthorizeClusterSecurityGroupIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAuthorizeSnapshotAccess = "AuthorizeSnapshotAccess" @@ -190,8 +206,23 @@ func (c *Redshift) AuthorizeSnapshotAccessRequest(input *AuthorizeSnapshotAccess // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeSnapshotAccess func (c *Redshift) AuthorizeSnapshotAccess(input *AuthorizeSnapshotAccessInput) (*AuthorizeSnapshotAccessOutput, error) { req, out := c.AuthorizeSnapshotAccessRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AuthorizeSnapshotAccessWithContext is the same as AuthorizeSnapshotAccess with the addition of +// the ability to pass a context and additional request options. +// +// See AuthorizeSnapshotAccess for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AuthorizeSnapshotAccessWithContext(ctx aws.Context, input *AuthorizeSnapshotAccessInput, opts ...request.Option) (*AuthorizeSnapshotAccessOutput, error) { + req, out := c.AuthorizeSnapshotAccessRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopyClusterSnapshot = "CopyClusterSnapshot" @@ -279,8 +310,23 @@ func (c *Redshift) CopyClusterSnapshotRequest(input *CopyClusterSnapshotInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CopyClusterSnapshot func (c *Redshift) CopyClusterSnapshot(input *CopyClusterSnapshotInput) (*CopyClusterSnapshotOutput, error) { req, out := c.CopyClusterSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopyClusterSnapshotWithContext is the same as CopyClusterSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CopyClusterSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopyClusterSnapshotWithContext(ctx aws.Context, input *CopyClusterSnapshotInput, opts ...request.Option) (*CopyClusterSnapshotOutput, error) { + req, out := c.CopyClusterSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateCluster = "CreateCluster" @@ -414,8 +460,23 @@ func (c *Redshift) CreateClusterRequest(input *CreateClusterInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateCluster func (c *Redshift) CreateCluster(input *CreateClusterInput) (*CreateClusterOutput, error) { req, out := c.CreateClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateClusterWithContext is the same as CreateCluster with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateClusterWithContext(ctx aws.Context, input *CreateClusterInput, opts ...request.Option) (*CreateClusterOutput, error) { + req, out := c.CreateClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateClusterParameterGroup = "CreateClusterParameterGroup" @@ -501,8 +562,23 @@ func (c *Redshift) CreateClusterParameterGroupRequest(input *CreateClusterParame // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterParameterGroup func (c *Redshift) CreateClusterParameterGroup(input *CreateClusterParameterGroupInput) (*CreateClusterParameterGroupOutput, error) { req, out := c.CreateClusterParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateClusterParameterGroupWithContext is the same as CreateClusterParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateClusterParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateClusterParameterGroupWithContext(ctx aws.Context, input *CreateClusterParameterGroupInput, opts ...request.Option) (*CreateClusterParameterGroupOutput, error) { + req, out := c.CreateClusterParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateClusterSecurityGroup = "CreateClusterSecurityGroup" @@ -583,8 +659,23 @@ func (c *Redshift) CreateClusterSecurityGroupRequest(input *CreateClusterSecurit // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSecurityGroup func (c *Redshift) CreateClusterSecurityGroup(input *CreateClusterSecurityGroupInput) (*CreateClusterSecurityGroupOutput, error) { req, out := c.CreateClusterSecurityGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateClusterSecurityGroupWithContext is the same as CreateClusterSecurityGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateClusterSecurityGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateClusterSecurityGroupWithContext(ctx aws.Context, input *CreateClusterSecurityGroupInput, opts ...request.Option) (*CreateClusterSecurityGroupOutput, error) { + req, out := c.CreateClusterSecurityGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateClusterSnapshot = "CreateClusterSnapshot" @@ -670,8 +761,23 @@ func (c *Redshift) CreateClusterSnapshotRequest(input *CreateClusterSnapshotInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSnapshot func (c *Redshift) CreateClusterSnapshot(input *CreateClusterSnapshotInput) (*CreateClusterSnapshotOutput, error) { req, out := c.CreateClusterSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateClusterSnapshotWithContext is the same as CreateClusterSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See CreateClusterSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateClusterSnapshotWithContext(ctx aws.Context, input *CreateClusterSnapshotInput, opts ...request.Option) (*CreateClusterSnapshotOutput, error) { + req, out := c.CreateClusterSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateClusterSubnetGroup = "CreateClusterSubnetGroup" @@ -770,8 +876,23 @@ func (c *Redshift) CreateClusterSubnetGroupRequest(input *CreateClusterSubnetGro // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSubnetGroup func (c *Redshift) CreateClusterSubnetGroup(input *CreateClusterSubnetGroupInput) (*CreateClusterSubnetGroupOutput, error) { req, out := c.CreateClusterSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateClusterSubnetGroupWithContext is the same as CreateClusterSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateClusterSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateClusterSubnetGroupWithContext(ctx aws.Context, input *CreateClusterSubnetGroupInput, opts ...request.Option) (*CreateClusterSubnetGroupOutput, error) { + req, out := c.CreateClusterSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateEventSubscription = "CreateEventSubscription" @@ -896,8 +1017,23 @@ func (c *Redshift) CreateEventSubscriptionRequest(input *CreateEventSubscription // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateEventSubscription func (c *Redshift) CreateEventSubscription(input *CreateEventSubscriptionInput) (*CreateEventSubscriptionOutput, error) { req, out := c.CreateEventSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateEventSubscriptionWithContext is the same as CreateEventSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See CreateEventSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateEventSubscriptionWithContext(ctx aws.Context, input *CreateEventSubscriptionInput, opts ...request.Option) (*CreateEventSubscriptionOutput, error) { + req, out := c.CreateEventSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateHsmClientCertificate = "CreateHsmClientCertificate" @@ -981,8 +1117,23 @@ func (c *Redshift) CreateHsmClientCertificateRequest(input *CreateHsmClientCerti // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmClientCertificate func (c *Redshift) CreateHsmClientCertificate(input *CreateHsmClientCertificateInput) (*CreateHsmClientCertificateOutput, error) { req, out := c.CreateHsmClientCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateHsmClientCertificateWithContext is the same as CreateHsmClientCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See CreateHsmClientCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateHsmClientCertificateWithContext(ctx aws.Context, input *CreateHsmClientCertificateInput, opts ...request.Option) (*CreateHsmClientCertificateOutput, error) { + req, out := c.CreateHsmClientCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateHsmConfiguration = "CreateHsmConfiguration" @@ -1067,8 +1218,23 @@ func (c *Redshift) CreateHsmConfigurationRequest(input *CreateHsmConfigurationIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmConfiguration func (c *Redshift) CreateHsmConfiguration(input *CreateHsmConfigurationInput) (*CreateHsmConfigurationOutput, error) { req, out := c.CreateHsmConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateHsmConfigurationWithContext is the same as CreateHsmConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See CreateHsmConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateHsmConfigurationWithContext(ctx aws.Context, input *CreateHsmConfigurationInput, opts ...request.Option) (*CreateHsmConfigurationOutput, error) { + req, out := c.CreateHsmConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSnapshotCopyGrant = "CreateSnapshotCopyGrant" @@ -1156,8 +1322,23 @@ func (c *Redshift) CreateSnapshotCopyGrantRequest(input *CreateSnapshotCopyGrant // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateSnapshotCopyGrant func (c *Redshift) CreateSnapshotCopyGrant(input *CreateSnapshotCopyGrantInput) (*CreateSnapshotCopyGrantOutput, error) { req, out := c.CreateSnapshotCopyGrantRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSnapshotCopyGrantWithContext is the same as CreateSnapshotCopyGrant with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSnapshotCopyGrant for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateSnapshotCopyGrantWithContext(ctx aws.Context, input *CreateSnapshotCopyGrantInput, opts ...request.Option) (*CreateSnapshotCopyGrantOutput, error) { + req, out := c.CreateSnapshotCopyGrantRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTags = "CreateTags" @@ -1235,8 +1416,23 @@ func (c *Redshift) CreateTagsRequest(input *CreateTagsInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateTags func (c *Redshift) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { req, out := c.CreateTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTagsWithContext is the same as CreateTags with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTagsWithContext(ctx aws.Context, input *CreateTagsInput, opts ...request.Option) (*CreateTagsOutput, error) { + req, out := c.CreateTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteCluster = "DeleteCluster" @@ -1327,8 +1523,23 @@ func (c *Redshift) DeleteClusterRequest(input *DeleteClusterInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteCluster func (c *Redshift) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { req, out := c.DeleteClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteClusterWithContext is the same as DeleteCluster with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) { + req, out := c.DeleteClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteClusterParameterGroup = "DeleteClusterParameterGroup" @@ -1401,8 +1612,23 @@ func (c *Redshift) DeleteClusterParameterGroupRequest(input *DeleteClusterParame // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterParameterGroup func (c *Redshift) DeleteClusterParameterGroup(input *DeleteClusterParameterGroupInput) (*DeleteClusterParameterGroupOutput, error) { req, out := c.DeleteClusterParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteClusterParameterGroupWithContext is the same as DeleteClusterParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteClusterParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteClusterParameterGroupWithContext(ctx aws.Context, input *DeleteClusterParameterGroupInput, opts ...request.Option) (*DeleteClusterParameterGroupOutput, error) { + req, out := c.DeleteClusterParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteClusterSecurityGroup = "DeleteClusterSecurityGroup" @@ -1479,8 +1705,23 @@ func (c *Redshift) DeleteClusterSecurityGroupRequest(input *DeleteClusterSecurit // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSecurityGroup func (c *Redshift) DeleteClusterSecurityGroup(input *DeleteClusterSecurityGroupInput) (*DeleteClusterSecurityGroupOutput, error) { req, out := c.DeleteClusterSecurityGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteClusterSecurityGroupWithContext is the same as DeleteClusterSecurityGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteClusterSecurityGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteClusterSecurityGroupWithContext(ctx aws.Context, input *DeleteClusterSecurityGroupInput, opts ...request.Option) (*DeleteClusterSecurityGroupOutput, error) { + req, out := c.DeleteClusterSecurityGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteClusterSnapshot = "DeleteClusterSnapshot" @@ -1555,8 +1796,23 @@ func (c *Redshift) DeleteClusterSnapshotRequest(input *DeleteClusterSnapshotInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSnapshot func (c *Redshift) DeleteClusterSnapshot(input *DeleteClusterSnapshotInput) (*DeleteClusterSnapshotOutput, error) { req, out := c.DeleteClusterSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteClusterSnapshotWithContext is the same as DeleteClusterSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteClusterSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteClusterSnapshotWithContext(ctx aws.Context, input *DeleteClusterSnapshotInput, opts ...request.Option) (*DeleteClusterSnapshotOutput, error) { + req, out := c.DeleteClusterSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteClusterSubnetGroup = "DeleteClusterSubnetGroup" @@ -1629,8 +1885,23 @@ func (c *Redshift) DeleteClusterSubnetGroupRequest(input *DeleteClusterSubnetGro // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSubnetGroup func (c *Redshift) DeleteClusterSubnetGroup(input *DeleteClusterSubnetGroupInput) (*DeleteClusterSubnetGroupOutput, error) { req, out := c.DeleteClusterSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteClusterSubnetGroupWithContext is the same as DeleteClusterSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteClusterSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteClusterSubnetGroupWithContext(ctx aws.Context, input *DeleteClusterSubnetGroupInput, opts ...request.Option) (*DeleteClusterSubnetGroupOutput, error) { + req, out := c.DeleteClusterSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteEventSubscription = "DeleteEventSubscription" @@ -1701,8 +1972,23 @@ func (c *Redshift) DeleteEventSubscriptionRequest(input *DeleteEventSubscription // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteEventSubscription func (c *Redshift) DeleteEventSubscription(input *DeleteEventSubscriptionInput) (*DeleteEventSubscriptionOutput, error) { req, out := c.DeleteEventSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteEventSubscriptionWithContext is the same as DeleteEventSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteEventSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteEventSubscriptionWithContext(ctx aws.Context, input *DeleteEventSubscriptionInput, opts ...request.Option) (*DeleteEventSubscriptionOutput, error) { + req, out := c.DeleteEventSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteHsmClientCertificate = "DeleteHsmClientCertificate" @@ -1772,8 +2058,23 @@ func (c *Redshift) DeleteHsmClientCertificateRequest(input *DeleteHsmClientCerti // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmClientCertificate func (c *Redshift) DeleteHsmClientCertificate(input *DeleteHsmClientCertificateInput) (*DeleteHsmClientCertificateOutput, error) { req, out := c.DeleteHsmClientCertificateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteHsmClientCertificateWithContext is the same as DeleteHsmClientCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteHsmClientCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteHsmClientCertificateWithContext(ctx aws.Context, input *DeleteHsmClientCertificateInput, opts ...request.Option) (*DeleteHsmClientCertificateOutput, error) { + req, out := c.DeleteHsmClientCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteHsmConfiguration = "DeleteHsmConfiguration" @@ -1843,8 +2144,23 @@ func (c *Redshift) DeleteHsmConfigurationRequest(input *DeleteHsmConfigurationIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmConfiguration func (c *Redshift) DeleteHsmConfiguration(input *DeleteHsmConfigurationInput) (*DeleteHsmConfigurationOutput, error) { req, out := c.DeleteHsmConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteHsmConfigurationWithContext is the same as DeleteHsmConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteHsmConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteHsmConfigurationWithContext(ctx aws.Context, input *DeleteHsmConfigurationInput, opts ...request.Option) (*DeleteHsmConfigurationOutput, error) { + req, out := c.DeleteHsmConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSnapshotCopyGrant = "DeleteSnapshotCopyGrant" @@ -1915,8 +2231,23 @@ func (c *Redshift) DeleteSnapshotCopyGrantRequest(input *DeleteSnapshotCopyGrant // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteSnapshotCopyGrant func (c *Redshift) DeleteSnapshotCopyGrant(input *DeleteSnapshotCopyGrantInput) (*DeleteSnapshotCopyGrantOutput, error) { req, out := c.DeleteSnapshotCopyGrantRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSnapshotCopyGrantWithContext is the same as DeleteSnapshotCopyGrant with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSnapshotCopyGrant for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteSnapshotCopyGrantWithContext(ctx aws.Context, input *DeleteSnapshotCopyGrantInput, opts ...request.Option) (*DeleteSnapshotCopyGrantOutput, error) { + req, out := c.DeleteSnapshotCopyGrantRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTags = "DeleteTags" @@ -1986,8 +2317,23 @@ func (c *Redshift) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteTags func (c *Redshift) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { req, out := c.DeleteTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTagsWithContext is the same as DeleteTags with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { + req, out := c.DeleteTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeClusterParameterGroups = "DescribeClusterParameterGroups" @@ -2078,8 +2424,23 @@ func (c *Redshift) DescribeClusterParameterGroupsRequest(input *DescribeClusterP // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterParameterGroups func (c *Redshift) DescribeClusterParameterGroups(input *DescribeClusterParameterGroupsInput) (*DescribeClusterParameterGroupsOutput, error) { req, out := c.DescribeClusterParameterGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClusterParameterGroupsWithContext is the same as DescribeClusterParameterGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeClusterParameterGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClusterParameterGroupsWithContext(ctx aws.Context, input *DescribeClusterParameterGroupsInput, opts ...request.Option) (*DescribeClusterParameterGroupsOutput, error) { + req, out := c.DescribeClusterParameterGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeClusterParameterGroupsPages iterates over the pages of a DescribeClusterParameterGroups operation, @@ -2099,12 +2460,37 @@ func (c *Redshift) DescribeClusterParameterGroups(input *DescribeClusterParamete // return pageNum <= 3 // }) // -func (c *Redshift) DescribeClusterParameterGroupsPages(input *DescribeClusterParameterGroupsInput, fn func(p *DescribeClusterParameterGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterParameterGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterParameterGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClusterParameterGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClusterParameterGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClusterParameterGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeClusterParameters = "DescribeClusterParameters" @@ -2185,8 +2571,23 @@ func (c *Redshift) DescribeClusterParametersRequest(input *DescribeClusterParame // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterParameters func (c *Redshift) DescribeClusterParameters(input *DescribeClusterParametersInput) (*DescribeClusterParametersOutput, error) { req, out := c.DescribeClusterParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClusterParametersWithContext is the same as DescribeClusterParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeClusterParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClusterParametersWithContext(ctx aws.Context, input *DescribeClusterParametersInput, opts ...request.Option) (*DescribeClusterParametersOutput, error) { + req, out := c.DescribeClusterParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeClusterParametersPages iterates over the pages of a DescribeClusterParameters operation, @@ -2206,12 +2607,37 @@ func (c *Redshift) DescribeClusterParameters(input *DescribeClusterParametersInp // return pageNum <= 3 // }) // -func (c *Redshift) DescribeClusterParametersPages(input *DescribeClusterParametersInput, fn func(p *DescribeClusterParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterParametersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClusterParametersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClusterParametersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClusterParametersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeClusterSecurityGroups = "DescribeClusterSecurityGroups" @@ -2301,8 +2727,23 @@ func (c *Redshift) DescribeClusterSecurityGroupsRequest(input *DescribeClusterSe // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSecurityGroups func (c *Redshift) DescribeClusterSecurityGroups(input *DescribeClusterSecurityGroupsInput) (*DescribeClusterSecurityGroupsOutput, error) { req, out := c.DescribeClusterSecurityGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClusterSecurityGroupsWithContext is the same as DescribeClusterSecurityGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeClusterSecurityGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClusterSecurityGroupsWithContext(ctx aws.Context, input *DescribeClusterSecurityGroupsInput, opts ...request.Option) (*DescribeClusterSecurityGroupsOutput, error) { + req, out := c.DescribeClusterSecurityGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeClusterSecurityGroupsPages iterates over the pages of a DescribeClusterSecurityGroups operation, @@ -2322,12 +2763,37 @@ func (c *Redshift) DescribeClusterSecurityGroups(input *DescribeClusterSecurityG // return pageNum <= 3 // }) // -func (c *Redshift) DescribeClusterSecurityGroupsPages(input *DescribeClusterSecurityGroupsInput, fn func(p *DescribeClusterSecurityGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterSecurityGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterSecurityGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClusterSecurityGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClusterSecurityGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClusterSecurityGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeClusterSnapshots = "DescribeClusterSnapshots" @@ -2414,8 +2880,23 @@ func (c *Redshift) DescribeClusterSnapshotsRequest(input *DescribeClusterSnapsho // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSnapshots func (c *Redshift) DescribeClusterSnapshots(input *DescribeClusterSnapshotsInput) (*DescribeClusterSnapshotsOutput, error) { req, out := c.DescribeClusterSnapshotsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClusterSnapshotsWithContext is the same as DescribeClusterSnapshots with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeClusterSnapshots for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClusterSnapshotsWithContext(ctx aws.Context, input *DescribeClusterSnapshotsInput, opts ...request.Option) (*DescribeClusterSnapshotsOutput, error) { + req, out := c.DescribeClusterSnapshotsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeClusterSnapshotsPages iterates over the pages of a DescribeClusterSnapshots operation, @@ -2435,12 +2916,37 @@ func (c *Redshift) DescribeClusterSnapshots(input *DescribeClusterSnapshotsInput // return pageNum <= 3 // }) // -func (c *Redshift) DescribeClusterSnapshotsPages(input *DescribeClusterSnapshotsInput, fn func(p *DescribeClusterSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterSnapshotsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterSnapshotsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClusterSnapshotsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClusterSnapshotsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClusterSnapshotsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeClusterSubnetGroups = "DescribeClusterSubnetGroups" @@ -2526,8 +3032,23 @@ func (c *Redshift) DescribeClusterSubnetGroupsRequest(input *DescribeClusterSubn // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSubnetGroups func (c *Redshift) DescribeClusterSubnetGroups(input *DescribeClusterSubnetGroupsInput) (*DescribeClusterSubnetGroupsOutput, error) { req, out := c.DescribeClusterSubnetGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClusterSubnetGroupsWithContext is the same as DescribeClusterSubnetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeClusterSubnetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClusterSubnetGroupsWithContext(ctx aws.Context, input *DescribeClusterSubnetGroupsInput, opts ...request.Option) (*DescribeClusterSubnetGroupsOutput, error) { + req, out := c.DescribeClusterSubnetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeClusterSubnetGroupsPages iterates over the pages of a DescribeClusterSubnetGroups operation, @@ -2547,12 +3068,37 @@ func (c *Redshift) DescribeClusterSubnetGroups(input *DescribeClusterSubnetGroup // return pageNum <= 3 // }) // -func (c *Redshift) DescribeClusterSubnetGroupsPages(input *DescribeClusterSubnetGroupsInput, fn func(p *DescribeClusterSubnetGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterSubnetGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterSubnetGroupsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClusterSubnetGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClusterSubnetGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClusterSubnetGroupsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeClusterVersions = "DescribeClusterVersions" @@ -2621,8 +3167,23 @@ func (c *Redshift) DescribeClusterVersionsRequest(input *DescribeClusterVersions // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterVersions func (c *Redshift) DescribeClusterVersions(input *DescribeClusterVersionsInput) (*DescribeClusterVersionsOutput, error) { req, out := c.DescribeClusterVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClusterVersionsWithContext is the same as DescribeClusterVersions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeClusterVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClusterVersionsWithContext(ctx aws.Context, input *DescribeClusterVersionsInput, opts ...request.Option) (*DescribeClusterVersionsOutput, error) { + req, out := c.DescribeClusterVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeClusterVersionsPages iterates over the pages of a DescribeClusterVersions operation, @@ -2642,12 +3203,37 @@ func (c *Redshift) DescribeClusterVersions(input *DescribeClusterVersionsInput) // return pageNum <= 3 // }) // -func (c *Redshift) DescribeClusterVersionsPages(input *DescribeClusterVersionsInput, fn func(p *DescribeClusterVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterVersionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClusterVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClusterVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClusterVersionsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeClusters = "DescribeClusters" @@ -2733,8 +3319,23 @@ func (c *Redshift) DescribeClustersRequest(input *DescribeClustersInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusters func (c *Redshift) DescribeClusters(input *DescribeClustersInput) (*DescribeClustersOutput, error) { req, out := c.DescribeClustersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeClustersWithContext is the same as DescribeClusters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeClusters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeClustersWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.Option) (*DescribeClustersOutput, error) { + req, out := c.DescribeClustersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeClustersPages iterates over the pages of a DescribeClusters operation, @@ -2754,12 +3355,37 @@ func (c *Redshift) DescribeClusters(input *DescribeClustersInput) (*DescribeClus // return pageNum <= 3 // }) // -func (c *Redshift) DescribeClustersPages(input *DescribeClustersInput, fn func(p *DescribeClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClustersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClustersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeDefaultClusterParameters = "DescribeDefaultClusterParameters" @@ -2828,8 +3454,23 @@ func (c *Redshift) DescribeDefaultClusterParametersRequest(input *DescribeDefaul // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeDefaultClusterParameters func (c *Redshift) DescribeDefaultClusterParameters(input *DescribeDefaultClusterParametersInput) (*DescribeDefaultClusterParametersOutput, error) { req, out := c.DescribeDefaultClusterParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDefaultClusterParametersWithContext is the same as DescribeDefaultClusterParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDefaultClusterParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDefaultClusterParametersWithContext(ctx aws.Context, input *DescribeDefaultClusterParametersInput, opts ...request.Option) (*DescribeDefaultClusterParametersOutput, error) { + req, out := c.DescribeDefaultClusterParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeDefaultClusterParametersPages iterates over the pages of a DescribeDefaultClusterParameters operation, @@ -2849,12 +3490,37 @@ func (c *Redshift) DescribeDefaultClusterParameters(input *DescribeDefaultCluste // return pageNum <= 3 // }) // -func (c *Redshift) DescribeDefaultClusterParametersPages(input *DescribeDefaultClusterParametersInput, fn func(p *DescribeDefaultClusterParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDefaultClusterParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDefaultClusterParametersOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDefaultClusterParametersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDefaultClusterParametersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeDefaultClusterParametersOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeEventCategories = "DescribeEventCategories" @@ -2915,8 +3581,23 @@ func (c *Redshift) DescribeEventCategoriesRequest(input *DescribeEventCategories // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEventCategories func (c *Redshift) DescribeEventCategories(input *DescribeEventCategoriesInput) (*DescribeEventCategoriesOutput, error) { req, out := c.DescribeEventCategoriesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEventCategoriesWithContext is the same as DescribeEventCategories with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEventCategories for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEventCategoriesWithContext(ctx aws.Context, input *DescribeEventCategoriesInput, opts ...request.Option) (*DescribeEventCategoriesOutput, error) { + req, out := c.DescribeEventCategoriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEventSubscriptions = "DescribeEventSubscriptions" @@ -2989,8 +3670,23 @@ func (c *Redshift) DescribeEventSubscriptionsRequest(input *DescribeEventSubscri // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEventSubscriptions func (c *Redshift) DescribeEventSubscriptions(input *DescribeEventSubscriptionsInput) (*DescribeEventSubscriptionsOutput, error) { req, out := c.DescribeEventSubscriptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEventSubscriptionsWithContext is the same as DescribeEventSubscriptions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEventSubscriptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEventSubscriptionsWithContext(ctx aws.Context, input *DescribeEventSubscriptionsInput, opts ...request.Option) (*DescribeEventSubscriptionsOutput, error) { + req, out := c.DescribeEventSubscriptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeEventSubscriptionsPages iterates over the pages of a DescribeEventSubscriptions operation, @@ -3010,12 +3706,37 @@ func (c *Redshift) DescribeEventSubscriptions(input *DescribeEventSubscriptionsI // return pageNum <= 3 // }) // -func (c *Redshift) DescribeEventSubscriptionsPages(input *DescribeEventSubscriptionsInput, fn func(p *DescribeEventSubscriptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventSubscriptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventSubscriptionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEventSubscriptionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEventSubscriptionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeEvents = "DescribeEvents" @@ -3083,8 +3804,23 @@ func (c *Redshift) DescribeEventsRequest(input *DescribeEventsInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEvents func (c *Redshift) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, error) { req, out := c.DescribeEventsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEventsWithContext is the same as DescribeEvents with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEventsWithContext(ctx aws.Context, input *DescribeEventsInput, opts ...request.Option) (*DescribeEventsOutput, error) { + req, out := c.DescribeEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeEventsPages iterates over the pages of a DescribeEvents operation, @@ -3104,12 +3840,37 @@ func (c *Redshift) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOu // return pageNum <= 3 // }) // -func (c *Redshift) DescribeEventsPages(input *DescribeEventsInput, fn func(p *DescribeEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeHsmClientCertificates = "DescribeHsmClientCertificates" @@ -3194,8 +3955,23 @@ func (c *Redshift) DescribeHsmClientCertificatesRequest(input *DescribeHsmClient // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeHsmClientCertificates func (c *Redshift) DescribeHsmClientCertificates(input *DescribeHsmClientCertificatesInput) (*DescribeHsmClientCertificatesOutput, error) { req, out := c.DescribeHsmClientCertificatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeHsmClientCertificatesWithContext is the same as DescribeHsmClientCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeHsmClientCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeHsmClientCertificatesWithContext(ctx aws.Context, input *DescribeHsmClientCertificatesInput, opts ...request.Option) (*DescribeHsmClientCertificatesOutput, error) { + req, out := c.DescribeHsmClientCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeHsmClientCertificatesPages iterates over the pages of a DescribeHsmClientCertificates operation, @@ -3215,12 +3991,37 @@ func (c *Redshift) DescribeHsmClientCertificates(input *DescribeHsmClientCertifi // return pageNum <= 3 // }) // -func (c *Redshift) DescribeHsmClientCertificatesPages(input *DescribeHsmClientCertificatesInput, fn func(p *DescribeHsmClientCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeHsmClientCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeHsmClientCertificatesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeHsmClientCertificatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeHsmClientCertificatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeHsmClientCertificatesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeHsmConfigurations = "DescribeHsmConfigurations" @@ -3305,8 +4106,23 @@ func (c *Redshift) DescribeHsmConfigurationsRequest(input *DescribeHsmConfigurat // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeHsmConfigurations func (c *Redshift) DescribeHsmConfigurations(input *DescribeHsmConfigurationsInput) (*DescribeHsmConfigurationsOutput, error) { req, out := c.DescribeHsmConfigurationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeHsmConfigurationsWithContext is the same as DescribeHsmConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeHsmConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeHsmConfigurationsWithContext(ctx aws.Context, input *DescribeHsmConfigurationsInput, opts ...request.Option) (*DescribeHsmConfigurationsOutput, error) { + req, out := c.DescribeHsmConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeHsmConfigurationsPages iterates over the pages of a DescribeHsmConfigurations operation, @@ -3326,12 +4142,37 @@ func (c *Redshift) DescribeHsmConfigurations(input *DescribeHsmConfigurationsInp // return pageNum <= 3 // }) // -func (c *Redshift) DescribeHsmConfigurationsPages(input *DescribeHsmConfigurationsInput, fn func(p *DescribeHsmConfigurationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeHsmConfigurationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeHsmConfigurationsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeHsmConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeHsmConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeHsmConfigurationsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeLoggingStatus = "DescribeLoggingStatus" @@ -3396,8 +4237,23 @@ func (c *Redshift) DescribeLoggingStatusRequest(input *DescribeLoggingStatusInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeLoggingStatus func (c *Redshift) DescribeLoggingStatus(input *DescribeLoggingStatusInput) (*LoggingStatus, error) { req, out := c.DescribeLoggingStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeLoggingStatusWithContext is the same as DescribeLoggingStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoggingStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeLoggingStatusWithContext(ctx aws.Context, input *DescribeLoggingStatusInput, opts ...request.Option) (*LoggingStatus, error) { + req, out := c.DescribeLoggingStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeOrderableClusterOptions = "DescribeOrderableClusterOptions" @@ -3470,8 +4326,23 @@ func (c *Redshift) DescribeOrderableClusterOptionsRequest(input *DescribeOrderab // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeOrderableClusterOptions func (c *Redshift) DescribeOrderableClusterOptions(input *DescribeOrderableClusterOptionsInput) (*DescribeOrderableClusterOptionsOutput, error) { req, out := c.DescribeOrderableClusterOptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeOrderableClusterOptionsWithContext is the same as DescribeOrderableClusterOptions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeOrderableClusterOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeOrderableClusterOptionsWithContext(ctx aws.Context, input *DescribeOrderableClusterOptionsInput, opts ...request.Option) (*DescribeOrderableClusterOptionsOutput, error) { + req, out := c.DescribeOrderableClusterOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeOrderableClusterOptionsPages iterates over the pages of a DescribeOrderableClusterOptions operation, @@ -3491,12 +4362,37 @@ func (c *Redshift) DescribeOrderableClusterOptions(input *DescribeOrderableClust // return pageNum <= 3 // }) // -func (c *Redshift) DescribeOrderableClusterOptionsPages(input *DescribeOrderableClusterOptionsInput, fn func(p *DescribeOrderableClusterOptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeOrderableClusterOptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeOrderableClusterOptionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeOrderableClusterOptionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeOrderableClusterOptionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeOrderableClusterOptionsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeReservedNodeOfferings = "DescribeReservedNodeOfferings" @@ -3578,8 +4474,23 @@ func (c *Redshift) DescribeReservedNodeOfferingsRequest(input *DescribeReservedN // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeReservedNodeOfferings func (c *Redshift) DescribeReservedNodeOfferings(input *DescribeReservedNodeOfferingsInput) (*DescribeReservedNodeOfferingsOutput, error) { req, out := c.DescribeReservedNodeOfferingsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedNodeOfferingsWithContext is the same as DescribeReservedNodeOfferings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedNodeOfferings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedNodeOfferingsWithContext(ctx aws.Context, input *DescribeReservedNodeOfferingsInput, opts ...request.Option) (*DescribeReservedNodeOfferingsOutput, error) { + req, out := c.DescribeReservedNodeOfferingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeReservedNodeOfferingsPages iterates over the pages of a DescribeReservedNodeOfferings operation, @@ -3599,12 +4510,37 @@ func (c *Redshift) DescribeReservedNodeOfferings(input *DescribeReservedNodeOffe // return pageNum <= 3 // }) // -func (c *Redshift) DescribeReservedNodeOfferingsPages(input *DescribeReservedNodeOfferingsInput, fn func(p *DescribeReservedNodeOfferingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedNodeOfferingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedNodeOfferingsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReservedNodeOfferingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReservedNodeOfferingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeReservedNodeOfferingsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeReservedNodes = "DescribeReservedNodes" @@ -3674,8 +4610,23 @@ func (c *Redshift) DescribeReservedNodesRequest(input *DescribeReservedNodesInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeReservedNodes func (c *Redshift) DescribeReservedNodes(input *DescribeReservedNodesInput) (*DescribeReservedNodesOutput, error) { req, out := c.DescribeReservedNodesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReservedNodesWithContext is the same as DescribeReservedNodes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReservedNodes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReservedNodesWithContext(ctx aws.Context, input *DescribeReservedNodesInput, opts ...request.Option) (*DescribeReservedNodesOutput, error) { + req, out := c.DescribeReservedNodesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeReservedNodesPages iterates over the pages of a DescribeReservedNodes operation, @@ -3695,12 +4646,37 @@ func (c *Redshift) DescribeReservedNodes(input *DescribeReservedNodesInput) (*De // return pageNum <= 3 // }) // -func (c *Redshift) DescribeReservedNodesPages(input *DescribeReservedNodesInput, fn func(p *DescribeReservedNodesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedNodesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedNodesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReservedNodesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReservedNodesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeReservedNodesOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeResize = "DescribeResize" @@ -3773,8 +4749,23 @@ func (c *Redshift) DescribeResizeRequest(input *DescribeResizeInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeResize func (c *Redshift) DescribeResize(input *DescribeResizeInput) (*DescribeResizeOutput, error) { req, out := c.DescribeResizeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeResizeWithContext is the same as DescribeResize with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeResize for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeResizeWithContext(ctx aws.Context, input *DescribeResizeInput, opts ...request.Option) (*DescribeResizeOutput, error) { + req, out := c.DescribeResizeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeSnapshotCopyGrants = "DescribeSnapshotCopyGrants" @@ -3847,8 +4838,23 @@ func (c *Redshift) DescribeSnapshotCopyGrantsRequest(input *DescribeSnapshotCopy // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeSnapshotCopyGrants func (c *Redshift) DescribeSnapshotCopyGrants(input *DescribeSnapshotCopyGrantsInput) (*DescribeSnapshotCopyGrantsOutput, error) { req, out := c.DescribeSnapshotCopyGrantsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeSnapshotCopyGrantsWithContext is the same as DescribeSnapshotCopyGrants with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSnapshotCopyGrants for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeSnapshotCopyGrantsWithContext(ctx aws.Context, input *DescribeSnapshotCopyGrantsInput, opts ...request.Option) (*DescribeSnapshotCopyGrantsOutput, error) { + req, out := c.DescribeSnapshotCopyGrantsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTableRestoreStatus = "DescribeTableRestoreStatus" @@ -3919,8 +4925,23 @@ func (c *Redshift) DescribeTableRestoreStatusRequest(input *DescribeTableRestore // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeTableRestoreStatus func (c *Redshift) DescribeTableRestoreStatus(input *DescribeTableRestoreStatusInput) (*DescribeTableRestoreStatusOutput, error) { req, out := c.DescribeTableRestoreStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTableRestoreStatusWithContext is the same as DescribeTableRestoreStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTableRestoreStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTableRestoreStatusWithContext(ctx aws.Context, input *DescribeTableRestoreStatusInput, opts ...request.Option) (*DescribeTableRestoreStatusOutput, error) { + req, out := c.DescribeTableRestoreStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeTags = "DescribeTags" @@ -4009,8 +5030,23 @@ func (c *Redshift) DescribeTagsRequest(input *DescribeTagsInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeTags func (c *Redshift) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeTagsWithContext is the same as DescribeTags with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { + req, out := c.DescribeTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableLogging = "DisableLogging" @@ -4075,8 +5111,23 @@ func (c *Redshift) DisableLoggingRequest(input *DisableLoggingInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DisableLogging func (c *Redshift) DisableLogging(input *DisableLoggingInput) (*LoggingStatus, error) { req, out := c.DisableLoggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableLoggingWithContext is the same as DisableLogging with the addition of +// the ability to pass a context and additional request options. +// +// See DisableLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableLoggingWithContext(ctx aws.Context, input *DisableLoggingInput, opts ...request.Option) (*LoggingStatus, error) { + req, out := c.DisableLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisableSnapshotCopy = "DisableSnapshotCopy" @@ -4154,8 +5205,23 @@ func (c *Redshift) DisableSnapshotCopyRequest(input *DisableSnapshotCopyInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DisableSnapshotCopy func (c *Redshift) DisableSnapshotCopy(input *DisableSnapshotCopyInput) (*DisableSnapshotCopyOutput, error) { req, out := c.DisableSnapshotCopyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisableSnapshotCopyWithContext is the same as DisableSnapshotCopy with the addition of +// the ability to pass a context and additional request options. +// +// See DisableSnapshotCopy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisableSnapshotCopyWithContext(ctx aws.Context, input *DisableSnapshotCopyInput, opts ...request.Option) (*DisableSnapshotCopyOutput, error) { + req, out := c.DisableSnapshotCopyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableLogging = "EnableLogging" @@ -4236,8 +5302,23 @@ func (c *Redshift) EnableLoggingRequest(input *EnableLoggingInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EnableLogging func (c *Redshift) EnableLogging(input *EnableLoggingInput) (*LoggingStatus, error) { req, out := c.EnableLoggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableLoggingWithContext is the same as EnableLogging with the addition of +// the ability to pass a context and additional request options. +// +// See EnableLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableLoggingWithContext(ctx aws.Context, input *EnableLoggingInput, opts ...request.Option) (*LoggingStatus, error) { + req, out := c.EnableLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opEnableSnapshotCopy = "EnableSnapshotCopy" @@ -4331,8 +5412,23 @@ func (c *Redshift) EnableSnapshotCopyRequest(input *EnableSnapshotCopyInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EnableSnapshotCopy func (c *Redshift) EnableSnapshotCopy(input *EnableSnapshotCopyInput) (*EnableSnapshotCopyOutput, error) { req, out := c.EnableSnapshotCopyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// EnableSnapshotCopyWithContext is the same as EnableSnapshotCopy with the addition of +// the ability to pass a context and additional request options. +// +// See EnableSnapshotCopy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) EnableSnapshotCopyWithContext(ctx aws.Context, input *EnableSnapshotCopyInput, opts ...request.Option) (*EnableSnapshotCopyOutput, error) { + req, out := c.EnableSnapshotCopyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyCluster = "ModifyCluster" @@ -4453,8 +5549,23 @@ func (c *Redshift) ModifyClusterRequest(input *ModifyClusterInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyCluster func (c *Redshift) ModifyCluster(input *ModifyClusterInput) (*ModifyClusterOutput, error) { req, out := c.ModifyClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyClusterWithContext is the same as ModifyCluster with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyClusterWithContext(ctx aws.Context, input *ModifyClusterInput, opts ...request.Option) (*ModifyClusterOutput, error) { + req, out := c.ModifyClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyClusterIamRoles = "ModifyClusterIamRoles" @@ -4524,8 +5635,23 @@ func (c *Redshift) ModifyClusterIamRolesRequest(input *ModifyClusterIamRolesInpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterIamRoles func (c *Redshift) ModifyClusterIamRoles(input *ModifyClusterIamRolesInput) (*ModifyClusterIamRolesOutput, error) { req, out := c.ModifyClusterIamRolesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyClusterIamRolesWithContext is the same as ModifyClusterIamRoles with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyClusterIamRoles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyClusterIamRolesWithContext(ctx aws.Context, input *ModifyClusterIamRolesInput, opts ...request.Option) (*ModifyClusterIamRolesOutput, error) { + req, out := c.ModifyClusterIamRolesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyClusterParameterGroup = "ModifyClusterParameterGroup" @@ -4598,8 +5724,23 @@ func (c *Redshift) ModifyClusterParameterGroupRequest(input *ModifyClusterParame // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterParameterGroup func (c *Redshift) ModifyClusterParameterGroup(input *ModifyClusterParameterGroupInput) (*ClusterParameterGroupNameMessage, error) { req, out := c.ModifyClusterParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyClusterParameterGroupWithContext is the same as ModifyClusterParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyClusterParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyClusterParameterGroupWithContext(ctx aws.Context, input *ModifyClusterParameterGroupInput, opts ...request.Option) (*ClusterParameterGroupNameMessage, error) { + req, out := c.ModifyClusterParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyClusterSubnetGroup = "ModifyClusterSubnetGroup" @@ -4686,8 +5827,23 @@ func (c *Redshift) ModifyClusterSubnetGroupRequest(input *ModifyClusterSubnetGro // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterSubnetGroup func (c *Redshift) ModifyClusterSubnetGroup(input *ModifyClusterSubnetGroupInput) (*ModifyClusterSubnetGroupOutput, error) { req, out := c.ModifyClusterSubnetGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyClusterSubnetGroupWithContext is the same as ModifyClusterSubnetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyClusterSubnetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyClusterSubnetGroupWithContext(ctx aws.Context, input *ModifyClusterSubnetGroupInput, opts ...request.Option) (*ModifyClusterSubnetGroupOutput, error) { + req, out := c.ModifyClusterSubnetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyEventSubscription = "ModifyEventSubscription" @@ -4783,8 +5939,23 @@ func (c *Redshift) ModifyEventSubscriptionRequest(input *ModifyEventSubscription // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyEventSubscription func (c *Redshift) ModifyEventSubscription(input *ModifyEventSubscriptionInput) (*ModifyEventSubscriptionOutput, error) { req, out := c.ModifyEventSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyEventSubscriptionWithContext is the same as ModifyEventSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyEventSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyEventSubscriptionWithContext(ctx aws.Context, input *ModifyEventSubscriptionInput, opts ...request.Option) (*ModifyEventSubscriptionOutput, error) { + req, out := c.ModifyEventSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifySnapshotCopyRetentionPeriod = "ModifySnapshotCopyRetentionPeriod" @@ -4858,8 +6029,23 @@ func (c *Redshift) ModifySnapshotCopyRetentionPeriodRequest(input *ModifySnapsho // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifySnapshotCopyRetentionPeriod func (c *Redshift) ModifySnapshotCopyRetentionPeriod(input *ModifySnapshotCopyRetentionPeriodInput) (*ModifySnapshotCopyRetentionPeriodOutput, error) { req, out := c.ModifySnapshotCopyRetentionPeriodRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifySnapshotCopyRetentionPeriodWithContext is the same as ModifySnapshotCopyRetentionPeriod with the addition of +// the ability to pass a context and additional request options. +// +// See ModifySnapshotCopyRetentionPeriod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifySnapshotCopyRetentionPeriodWithContext(ctx aws.Context, input *ModifySnapshotCopyRetentionPeriodInput, opts ...request.Option) (*ModifySnapshotCopyRetentionPeriodOutput, error) { + req, out := c.ModifySnapshotCopyRetentionPeriodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPurchaseReservedNodeOffering = "PurchaseReservedNodeOffering" @@ -4942,8 +6128,23 @@ func (c *Redshift) PurchaseReservedNodeOfferingRequest(input *PurchaseReservedNo // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/PurchaseReservedNodeOffering func (c *Redshift) PurchaseReservedNodeOffering(input *PurchaseReservedNodeOfferingInput) (*PurchaseReservedNodeOfferingOutput, error) { req, out := c.PurchaseReservedNodeOfferingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PurchaseReservedNodeOfferingWithContext is the same as PurchaseReservedNodeOffering with the addition of +// the ability to pass a context and additional request options. +// +// See PurchaseReservedNodeOffering for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PurchaseReservedNodeOfferingWithContext(ctx aws.Context, input *PurchaseReservedNodeOfferingInput, opts ...request.Option) (*PurchaseReservedNodeOfferingOutput, error) { + req, out := c.PurchaseReservedNodeOfferingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRebootCluster = "RebootCluster" @@ -5016,8 +6217,23 @@ func (c *Redshift) RebootClusterRequest(input *RebootClusterInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RebootCluster func (c *Redshift) RebootCluster(input *RebootClusterInput) (*RebootClusterOutput, error) { req, out := c.RebootClusterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RebootClusterWithContext is the same as RebootCluster with the addition of +// the ability to pass a context and additional request options. +// +// See RebootCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RebootClusterWithContext(ctx aws.Context, input *RebootClusterInput, opts ...request.Option) (*RebootClusterOutput, error) { + req, out := c.RebootClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opResetClusterParameterGroup = "ResetClusterParameterGroup" @@ -5089,8 +6305,23 @@ func (c *Redshift) ResetClusterParameterGroupRequest(input *ResetClusterParamete // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ResetClusterParameterGroup func (c *Redshift) ResetClusterParameterGroup(input *ResetClusterParameterGroupInput) (*ClusterParameterGroupNameMessage, error) { req, out := c.ResetClusterParameterGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ResetClusterParameterGroupWithContext is the same as ResetClusterParameterGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ResetClusterParameterGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ResetClusterParameterGroupWithContext(ctx aws.Context, input *ResetClusterParameterGroupInput, opts ...request.Option) (*ClusterParameterGroupNameMessage, error) { + req, out := c.ResetClusterParameterGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreFromClusterSnapshot = "RestoreFromClusterSnapshot" @@ -5240,8 +6471,23 @@ func (c *Redshift) RestoreFromClusterSnapshotRequest(input *RestoreFromClusterSn // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreFromClusterSnapshot func (c *Redshift) RestoreFromClusterSnapshot(input *RestoreFromClusterSnapshotInput) (*RestoreFromClusterSnapshotOutput, error) { req, out := c.RestoreFromClusterSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreFromClusterSnapshotWithContext is the same as RestoreFromClusterSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreFromClusterSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreFromClusterSnapshotWithContext(ctx aws.Context, input *RestoreFromClusterSnapshotInput, opts ...request.Option) (*RestoreFromClusterSnapshotOutput, error) { + req, out := c.RestoreFromClusterSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreTableFromClusterSnapshot = "RestoreTableFromClusterSnapshot" @@ -5338,8 +6584,23 @@ func (c *Redshift) RestoreTableFromClusterSnapshotRequest(input *RestoreTableFro // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreTableFromClusterSnapshot func (c *Redshift) RestoreTableFromClusterSnapshot(input *RestoreTableFromClusterSnapshotInput) (*RestoreTableFromClusterSnapshotOutput, error) { req, out := c.RestoreTableFromClusterSnapshotRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreTableFromClusterSnapshotWithContext is the same as RestoreTableFromClusterSnapshot with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreTableFromClusterSnapshot for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreTableFromClusterSnapshotWithContext(ctx aws.Context, input *RestoreTableFromClusterSnapshotInput, opts ...request.Option) (*RestoreTableFromClusterSnapshotOutput, error) { + req, out := c.RestoreTableFromClusterSnapshotRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRevokeClusterSecurityGroupIngress = "RevokeClusterSecurityGroupIngress" @@ -5415,8 +6676,23 @@ func (c *Redshift) RevokeClusterSecurityGroupIngressRequest(input *RevokeCluster // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeClusterSecurityGroupIngress func (c *Redshift) RevokeClusterSecurityGroupIngress(input *RevokeClusterSecurityGroupIngressInput) (*RevokeClusterSecurityGroupIngressOutput, error) { req, out := c.RevokeClusterSecurityGroupIngressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RevokeClusterSecurityGroupIngressWithContext is the same as RevokeClusterSecurityGroupIngress with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeClusterSecurityGroupIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RevokeClusterSecurityGroupIngressWithContext(ctx aws.Context, input *RevokeClusterSecurityGroupIngressInput, opts ...request.Option) (*RevokeClusterSecurityGroupIngressOutput, error) { + req, out := c.RevokeClusterSecurityGroupIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRevokeSnapshotAccess = "RevokeSnapshotAccess" @@ -5494,8 +6770,23 @@ func (c *Redshift) RevokeSnapshotAccessRequest(input *RevokeSnapshotAccessInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeSnapshotAccess func (c *Redshift) RevokeSnapshotAccess(input *RevokeSnapshotAccessInput) (*RevokeSnapshotAccessOutput, error) { req, out := c.RevokeSnapshotAccessRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RevokeSnapshotAccessWithContext is the same as RevokeSnapshotAccess with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeSnapshotAccess for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RevokeSnapshotAccessWithContext(ctx aws.Context, input *RevokeSnapshotAccessInput, opts ...request.Option) (*RevokeSnapshotAccessOutput, error) { + req, out := c.RevokeSnapshotAccessRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRotateEncryptionKey = "RotateEncryptionKey" @@ -5566,8 +6857,23 @@ func (c *Redshift) RotateEncryptionKeyRequest(input *RotateEncryptionKeyInput) ( // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RotateEncryptionKey func (c *Redshift) RotateEncryptionKey(input *RotateEncryptionKeyInput) (*RotateEncryptionKeyOutput, error) { req, out := c.RotateEncryptionKeyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RotateEncryptionKeyWithContext is the same as RotateEncryptionKey with the addition of +// the ability to pass a context and additional request options. +// +// See RotateEncryptionKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RotateEncryptionKeyWithContext(ctx aws.Context, input *RotateEncryptionKeyInput, opts ...request.Option) (*RotateEncryptionKeyOutput, error) { + req, out := c.RotateEncryptionKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Describes an AWS customer account authorized to restore a snapshot. diff --git a/vendor/github.com/aws/aws-sdk-go/service/redshift/errors.go b/vendor/github.com/aws/aws-sdk-go/service/redshift/errors.go index b59f68d88..74b4ef87c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/redshift/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package redshift diff --git a/vendor/github.com/aws/aws-sdk-go/service/redshift/service.go b/vendor/github.com/aws/aws-sdk-go/service/redshift/service.go index 904e408df..fd96e4bbc 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/redshift/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package redshift diff --git a/vendor/github.com/aws/aws-sdk-go/service/redshift/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/redshift/waiters.go index 59e26ed59..21ce4ee92 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/redshift/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package redshift import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilClusterAvailable uses the Amazon Redshift API operation @@ -11,38 +14,55 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *Redshift) WaitUntilClusterAvailable(input *DescribeClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeClusters", - Delay: 60, + return c.WaitUntilClusterAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilClusterAvailableWithContext is an extended version of WaitUntilClusterAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilClusterAvailableWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilClusterAvailable", MaxAttempts: 30, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(60 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Clusters[].ClusterStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Clusters[].ClusterStatus", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Clusters[].ClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Clusters[].ClusterStatus", Expected: "deleting", }, { - State: "retry", - Matcher: "error", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ClusterNotFound", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilClusterDeleted uses the Amazon Redshift API operation @@ -50,38 +70,55 @@ func (c *Redshift) WaitUntilClusterAvailable(input *DescribeClustersInput) error // If the condition is not meet within the max attempt window an error will // be returned. func (c *Redshift) WaitUntilClusterDeleted(input *DescribeClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeClusters", - Delay: 60, + return c.WaitUntilClusterDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilClusterDeletedWithContext is an extended version of WaitUntilClusterDeleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilClusterDeletedWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilClusterDeleted", MaxAttempts: 30, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(60 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "error", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, Expected: "ClusterNotFound", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Clusters[].ClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Clusters[].ClusterStatus", Expected: "creating", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Clusters[].ClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Clusters[].ClusterStatus", Expected: "modifying", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilClusterRestored uses the Amazon Redshift API operation @@ -89,32 +126,50 @@ func (c *Redshift) WaitUntilClusterDeleted(input *DescribeClustersInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *Redshift) WaitUntilClusterRestored(input *DescribeClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeClusters", - Delay: 60, + return c.WaitUntilClusterRestoredWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilClusterRestoredWithContext is an extended version of WaitUntilClusterRestored. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilClusterRestoredWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilClusterRestored", MaxAttempts: 30, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(60 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Clusters[].RestoreStatus.Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Clusters[].RestoreStatus.Status", Expected: "completed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Clusters[].ClusterStatus", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Clusters[].ClusterStatus", Expected: "deleting", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilSnapshotAvailable uses the Amazon Redshift API operation @@ -122,36 +177,53 @@ func (c *Redshift) WaitUntilClusterRestored(input *DescribeClustersInput) error // If the condition is not meet within the max attempt window an error will // be returned. func (c *Redshift) WaitUntilSnapshotAvailable(input *DescribeClusterSnapshotsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeClusterSnapshots", - Delay: 15, + return c.WaitUntilSnapshotAvailableWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilSnapshotAvailableWithContext is an extended version of WaitUntilSnapshotAvailable. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilSnapshotAvailableWithContext(ctx aws.Context, input *DescribeClusterSnapshotsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilSnapshotAvailable", MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "Snapshots[].Status", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Snapshots[].Status", Expected: "available", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Snapshots[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Snapshots[].Status", Expected: "failed", }, { - State: "failure", - Matcher: "pathAny", - Argument: "Snapshots[].Status", + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Snapshots[].Status", Expected: "deleted", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeClusterSnapshotsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClusterSnapshotsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go index acbc1eaab..d967d9bb5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package route53 provides a client for Amazon Route 53. package route53 @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -111,8 +112,23 @@ func (c *Route53) AssociateVPCWithHostedZoneRequest(input *AssociateVPCWithHoste // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AssociateVPCWithHostedZone func (c *Route53) AssociateVPCWithHostedZone(input *AssociateVPCWithHostedZoneInput) (*AssociateVPCWithHostedZoneOutput, error) { req, out := c.AssociateVPCWithHostedZoneRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssociateVPCWithHostedZoneWithContext is the same as AssociateVPCWithHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateVPCWithHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssociateVPCWithHostedZoneWithContext(ctx aws.Context, input *AssociateVPCWithHostedZoneInput, opts ...request.Option) (*AssociateVPCWithHostedZoneOutput, error) { + req, out := c.AssociateVPCWithHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opChangeResourceRecordSets = "ChangeResourceRecordSets" @@ -271,8 +287,23 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeResourceRecordSets func (c *Route53) ChangeResourceRecordSets(input *ChangeResourceRecordSetsInput) (*ChangeResourceRecordSetsOutput, error) { req, out := c.ChangeResourceRecordSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ChangeResourceRecordSetsWithContext is the same as ChangeResourceRecordSets with the addition of +// the ability to pass a context and additional request options. +// +// See ChangeResourceRecordSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ChangeResourceRecordSetsWithContext(ctx aws.Context, input *ChangeResourceRecordSetsInput, opts ...request.Option) (*ChangeResourceRecordSetsOutput, error) { + req, out := c.ChangeResourceRecordSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opChangeTagsForResource = "ChangeTagsForResource" @@ -357,8 +388,23 @@ func (c *Route53) ChangeTagsForResourceRequest(input *ChangeTagsForResourceInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeTagsForResource func (c *Route53) ChangeTagsForResource(input *ChangeTagsForResourceInput) (*ChangeTagsForResourceOutput, error) { req, out := c.ChangeTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ChangeTagsForResourceWithContext is the same as ChangeTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ChangeTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ChangeTagsForResourceWithContext(ctx aws.Context, input *ChangeTagsForResourceInput, opts ...request.Option) (*ChangeTagsForResourceOutput, error) { + req, out := c.ChangeTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateHealthCheck = "CreateHealthCheck" @@ -463,8 +509,23 @@ func (c *Route53) CreateHealthCheckRequest(input *CreateHealthCheckInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHealthCheck func (c *Route53) CreateHealthCheck(input *CreateHealthCheckInput) (*CreateHealthCheckOutput, error) { req, out := c.CreateHealthCheckRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateHealthCheckWithContext is the same as CreateHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See CreateHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateHealthCheckWithContext(ctx aws.Context, input *CreateHealthCheckInput, opts ...request.Option) (*CreateHealthCheckOutput, error) { + req, out := c.CreateHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateHostedZone = "CreateHostedZone" @@ -604,8 +665,23 @@ func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHostedZone func (c *Route53) CreateHostedZone(input *CreateHostedZoneInput) (*CreateHostedZoneOutput, error) { req, out := c.CreateHostedZoneRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateHostedZoneWithContext is the same as CreateHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See CreateHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateHostedZoneWithContext(ctx aws.Context, input *CreateHostedZoneInput, opts ...request.Option) (*CreateHostedZoneOutput, error) { + req, out := c.CreateHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateReusableDelegationSet = "CreateReusableDelegationSet" @@ -703,8 +779,23 @@ func (c *Route53) CreateReusableDelegationSetRequest(input *CreateReusableDelega // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateReusableDelegationSet func (c *Route53) CreateReusableDelegationSet(input *CreateReusableDelegationSetInput) (*CreateReusableDelegationSetOutput, error) { req, out := c.CreateReusableDelegationSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateReusableDelegationSetWithContext is the same as CreateReusableDelegationSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReusableDelegationSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateReusableDelegationSetWithContext(ctx aws.Context, input *CreateReusableDelegationSetInput, opts ...request.Option) (*CreateReusableDelegationSetOutput, error) { + req, out := c.CreateReusableDelegationSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTrafficPolicy = "CreateTrafficPolicy" @@ -787,8 +878,23 @@ func (c *Route53) CreateTrafficPolicyRequest(input *CreateTrafficPolicyInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicy func (c *Route53) CreateTrafficPolicy(input *CreateTrafficPolicyInput) (*CreateTrafficPolicyOutput, error) { req, out := c.CreateTrafficPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTrafficPolicyWithContext is the same as CreateTrafficPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTrafficPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTrafficPolicyWithContext(ctx aws.Context, input *CreateTrafficPolicyInput, opts ...request.Option) (*CreateTrafficPolicyOutput, error) { + req, out := c.CreateTrafficPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTrafficPolicyInstance = "CreateTrafficPolicyInstance" @@ -876,8 +982,23 @@ func (c *Route53) CreateTrafficPolicyInstanceRequest(input *CreateTrafficPolicyI // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyInstance func (c *Route53) CreateTrafficPolicyInstance(input *CreateTrafficPolicyInstanceInput) (*CreateTrafficPolicyInstanceOutput, error) { req, out := c.CreateTrafficPolicyInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTrafficPolicyInstanceWithContext is the same as CreateTrafficPolicyInstance with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTrafficPolicyInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTrafficPolicyInstanceWithContext(ctx aws.Context, input *CreateTrafficPolicyInstanceInput, opts ...request.Option) (*CreateTrafficPolicyInstanceOutput, error) { + req, out := c.CreateTrafficPolicyInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTrafficPolicyVersion = "CreateTrafficPolicyVersion" @@ -964,8 +1085,23 @@ func (c *Route53) CreateTrafficPolicyVersionRequest(input *CreateTrafficPolicyVe // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyVersion func (c *Route53) CreateTrafficPolicyVersion(input *CreateTrafficPolicyVersionInput) (*CreateTrafficPolicyVersionOutput, error) { req, out := c.CreateTrafficPolicyVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTrafficPolicyVersionWithContext is the same as CreateTrafficPolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTrafficPolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTrafficPolicyVersionWithContext(ctx aws.Context, input *CreateTrafficPolicyVersionInput, opts ...request.Option) (*CreateTrafficPolicyVersionOutput, error) { + req, out := c.CreateTrafficPolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateVPCAssociationAuthorization = "CreateVPCAssociationAuthorization" @@ -1060,8 +1196,23 @@ func (c *Route53) CreateVPCAssociationAuthorizationRequest(input *CreateVPCAssoc // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateVPCAssociationAuthorization func (c *Route53) CreateVPCAssociationAuthorization(input *CreateVPCAssociationAuthorizationInput) (*CreateVPCAssociationAuthorizationOutput, error) { req, out := c.CreateVPCAssociationAuthorizationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateVPCAssociationAuthorizationWithContext is the same as CreateVPCAssociationAuthorization with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVPCAssociationAuthorization for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateVPCAssociationAuthorizationWithContext(ctx aws.Context, input *CreateVPCAssociationAuthorizationInput, opts ...request.Option) (*CreateVPCAssociationAuthorizationOutput, error) { + req, out := c.CreateVPCAssociationAuthorizationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteHealthCheck = "DeleteHealthCheck" @@ -1143,8 +1294,23 @@ func (c *Route53) DeleteHealthCheckRequest(input *DeleteHealthCheckInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHealthCheck func (c *Route53) DeleteHealthCheck(input *DeleteHealthCheckInput) (*DeleteHealthCheckOutput, error) { req, out := c.DeleteHealthCheckRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteHealthCheckWithContext is the same as DeleteHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteHealthCheckWithContext(ctx aws.Context, input *DeleteHealthCheckInput, opts ...request.Option) (*DeleteHealthCheckOutput, error) { + req, out := c.DeleteHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteHostedZone = "DeleteHostedZone" @@ -1232,8 +1398,23 @@ func (c *Route53) DeleteHostedZoneRequest(input *DeleteHostedZoneInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHostedZone func (c *Route53) DeleteHostedZone(input *DeleteHostedZoneInput) (*DeleteHostedZoneOutput, error) { req, out := c.DeleteHostedZoneRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteHostedZoneWithContext is the same as DeleteHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteHostedZoneWithContext(ctx aws.Context, input *DeleteHostedZoneInput, opts ...request.Option) (*DeleteHostedZoneOutput, error) { + req, out := c.DeleteHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteReusableDelegationSet = "DeleteReusableDelegationSet" @@ -1315,8 +1496,23 @@ func (c *Route53) DeleteReusableDelegationSetRequest(input *DeleteReusableDelega // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteReusableDelegationSet func (c *Route53) DeleteReusableDelegationSet(input *DeleteReusableDelegationSetInput) (*DeleteReusableDelegationSetOutput, error) { req, out := c.DeleteReusableDelegationSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteReusableDelegationSetWithContext is the same as DeleteReusableDelegationSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteReusableDelegationSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteReusableDelegationSetWithContext(ctx aws.Context, input *DeleteReusableDelegationSetInput, opts ...request.Option) (*DeleteReusableDelegationSetOutput, error) { + req, out := c.DeleteReusableDelegationSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTrafficPolicy = "DeleteTrafficPolicy" @@ -1393,8 +1589,23 @@ func (c *Route53) DeleteTrafficPolicyRequest(input *DeleteTrafficPolicyInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicy func (c *Route53) DeleteTrafficPolicy(input *DeleteTrafficPolicyInput) (*DeleteTrafficPolicyOutput, error) { req, out := c.DeleteTrafficPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTrafficPolicyWithContext is the same as DeleteTrafficPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTrafficPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTrafficPolicyWithContext(ctx aws.Context, input *DeleteTrafficPolicyInput, opts ...request.Option) (*DeleteTrafficPolicyOutput, error) { + req, out := c.DeleteTrafficPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTrafficPolicyInstance = "DeleteTrafficPolicyInstance" @@ -1475,8 +1686,23 @@ func (c *Route53) DeleteTrafficPolicyInstanceRequest(input *DeleteTrafficPolicyI // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyInstance func (c *Route53) DeleteTrafficPolicyInstance(input *DeleteTrafficPolicyInstanceInput) (*DeleteTrafficPolicyInstanceOutput, error) { req, out := c.DeleteTrafficPolicyInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTrafficPolicyInstanceWithContext is the same as DeleteTrafficPolicyInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTrafficPolicyInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTrafficPolicyInstanceWithContext(ctx aws.Context, input *DeleteTrafficPolicyInstanceInput, opts ...request.Option) (*DeleteTrafficPolicyInstanceOutput, error) { + req, out := c.DeleteTrafficPolicyInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVPCAssociationAuthorization = "DeleteVPCAssociationAuthorization" @@ -1568,8 +1794,23 @@ func (c *Route53) DeleteVPCAssociationAuthorizationRequest(input *DeleteVPCAssoc // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteVPCAssociationAuthorization func (c *Route53) DeleteVPCAssociationAuthorization(input *DeleteVPCAssociationAuthorizationInput) (*DeleteVPCAssociationAuthorizationOutput, error) { req, out := c.DeleteVPCAssociationAuthorizationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVPCAssociationAuthorizationWithContext is the same as DeleteVPCAssociationAuthorization with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVPCAssociationAuthorization for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVPCAssociationAuthorizationWithContext(ctx aws.Context, input *DeleteVPCAssociationAuthorizationInput, opts ...request.Option) (*DeleteVPCAssociationAuthorizationOutput, error) { + req, out := c.DeleteVPCAssociationAuthorizationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDisassociateVPCFromHostedZone = "DisassociateVPCFromHostedZone" @@ -1658,8 +1899,23 @@ func (c *Route53) DisassociateVPCFromHostedZoneRequest(input *DisassociateVPCFro // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DisassociateVPCFromHostedZone func (c *Route53) DisassociateVPCFromHostedZone(input *DisassociateVPCFromHostedZoneInput) (*DisassociateVPCFromHostedZoneOutput, error) { req, out := c.DisassociateVPCFromHostedZoneRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DisassociateVPCFromHostedZoneWithContext is the same as DisassociateVPCFromHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateVPCFromHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DisassociateVPCFromHostedZoneWithContext(ctx aws.Context, input *DisassociateVPCFromHostedZoneInput, opts ...request.Option) (*DisassociateVPCFromHostedZoneOutput, error) { + req, out := c.DisassociateVPCFromHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetChange = "GetChange" @@ -1734,8 +1990,23 @@ func (c *Route53) GetChangeRequest(input *GetChangeInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetChange func (c *Route53) GetChange(input *GetChangeInput) (*GetChangeOutput, error) { req, out := c.GetChangeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetChangeWithContext is the same as GetChange with the addition of +// the ability to pass a context and additional request options. +// +// See GetChange for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetChangeWithContext(ctx aws.Context, input *GetChangeInput, opts ...request.Option) (*GetChangeOutput, error) { + req, out := c.GetChangeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetCheckerIpRanges = "GetCheckerIpRanges" @@ -1797,8 +2068,23 @@ func (c *Route53) GetCheckerIpRangesRequest(input *GetCheckerIpRangesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetCheckerIpRanges func (c *Route53) GetCheckerIpRanges(input *GetCheckerIpRangesInput) (*GetCheckerIpRangesOutput, error) { req, out := c.GetCheckerIpRangesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetCheckerIpRangesWithContext is the same as GetCheckerIpRanges with the addition of +// the ability to pass a context and additional request options. +// +// See GetCheckerIpRanges for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetCheckerIpRangesWithContext(ctx aws.Context, input *GetCheckerIpRangesInput, opts ...request.Option) (*GetCheckerIpRangesOutput, error) { + req, out := c.GetCheckerIpRangesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetGeoLocation = "GetGeoLocation" @@ -1867,8 +2153,23 @@ func (c *Route53) GetGeoLocationRequest(input *GetGeoLocationInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetGeoLocation func (c *Route53) GetGeoLocation(input *GetGeoLocationInput) (*GetGeoLocationOutput, error) { req, out := c.GetGeoLocationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetGeoLocationWithContext is the same as GetGeoLocation with the addition of +// the ability to pass a context and additional request options. +// +// See GetGeoLocation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetGeoLocationWithContext(ctx aws.Context, input *GetGeoLocationInput, opts ...request.Option) (*GetGeoLocationOutput, error) { + req, out := c.GetGeoLocationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetHealthCheck = "GetHealthCheck" @@ -1944,8 +2245,23 @@ func (c *Route53) GetHealthCheckRequest(input *GetHealthCheckInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheck func (c *Route53) GetHealthCheck(input *GetHealthCheckInput) (*GetHealthCheckOutput, error) { req, out := c.GetHealthCheckRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetHealthCheckWithContext is the same as GetHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See GetHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetHealthCheckWithContext(ctx aws.Context, input *GetHealthCheckInput, opts ...request.Option) (*GetHealthCheckOutput, error) { + req, out := c.GetHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetHealthCheckCount = "GetHealthCheckCount" @@ -2005,8 +2321,23 @@ func (c *Route53) GetHealthCheckCountRequest(input *GetHealthCheckCountInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckCount func (c *Route53) GetHealthCheckCount(input *GetHealthCheckCountInput) (*GetHealthCheckCountOutput, error) { req, out := c.GetHealthCheckCountRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetHealthCheckCountWithContext is the same as GetHealthCheckCount with the addition of +// the ability to pass a context and additional request options. +// +// See GetHealthCheckCount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetHealthCheckCountWithContext(ctx aws.Context, input *GetHealthCheckCountInput, opts ...request.Option) (*GetHealthCheckCountOutput, error) { + req, out := c.GetHealthCheckCountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetHealthCheckLastFailureReason = "GetHealthCheckLastFailureReason" @@ -2077,8 +2408,23 @@ func (c *Route53) GetHealthCheckLastFailureReasonRequest(input *GetHealthCheckLa // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckLastFailureReason func (c *Route53) GetHealthCheckLastFailureReason(input *GetHealthCheckLastFailureReasonInput) (*GetHealthCheckLastFailureReasonOutput, error) { req, out := c.GetHealthCheckLastFailureReasonRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetHealthCheckLastFailureReasonWithContext is the same as GetHealthCheckLastFailureReason with the addition of +// the ability to pass a context and additional request options. +// +// See GetHealthCheckLastFailureReason for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetHealthCheckLastFailureReasonWithContext(ctx aws.Context, input *GetHealthCheckLastFailureReasonInput, opts ...request.Option) (*GetHealthCheckLastFailureReasonOutput, error) { + req, out := c.GetHealthCheckLastFailureReasonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetHealthCheckStatus = "GetHealthCheckStatus" @@ -2148,8 +2494,23 @@ func (c *Route53) GetHealthCheckStatusRequest(input *GetHealthCheckStatusInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckStatus func (c *Route53) GetHealthCheckStatus(input *GetHealthCheckStatusInput) (*GetHealthCheckStatusOutput, error) { req, out := c.GetHealthCheckStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetHealthCheckStatusWithContext is the same as GetHealthCheckStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetHealthCheckStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetHealthCheckStatusWithContext(ctx aws.Context, input *GetHealthCheckStatusInput, opts ...request.Option) (*GetHealthCheckStatusOutput, error) { + req, out := c.GetHealthCheckStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetHostedZone = "GetHostedZone" @@ -2218,8 +2579,23 @@ func (c *Route53) GetHostedZoneRequest(input *GetHostedZoneInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZone func (c *Route53) GetHostedZone(input *GetHostedZoneInput) (*GetHostedZoneOutput, error) { req, out := c.GetHostedZoneRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetHostedZoneWithContext is the same as GetHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See GetHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetHostedZoneWithContext(ctx aws.Context, input *GetHostedZoneInput, opts ...request.Option) (*GetHostedZoneOutput, error) { + req, out := c.GetHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetHostedZoneCount = "GetHostedZoneCount" @@ -2284,8 +2660,23 @@ func (c *Route53) GetHostedZoneCountRequest(input *GetHostedZoneCountInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneCount func (c *Route53) GetHostedZoneCount(input *GetHostedZoneCountInput) (*GetHostedZoneCountOutput, error) { req, out := c.GetHostedZoneCountRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetHostedZoneCountWithContext is the same as GetHostedZoneCount with the addition of +// the ability to pass a context and additional request options. +// +// See GetHostedZoneCount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetHostedZoneCountWithContext(ctx aws.Context, input *GetHostedZoneCountInput, opts ...request.Option) (*GetHostedZoneCountOutput, error) { + req, out := c.GetHostedZoneCountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetReusableDelegationSet = "GetReusableDelegationSet" @@ -2356,8 +2747,23 @@ func (c *Route53) GetReusableDelegationSetRequest(input *GetReusableDelegationSe // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetReusableDelegationSet func (c *Route53) GetReusableDelegationSet(input *GetReusableDelegationSetInput) (*GetReusableDelegationSetOutput, error) { req, out := c.GetReusableDelegationSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetReusableDelegationSetWithContext is the same as GetReusableDelegationSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetReusableDelegationSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetReusableDelegationSetWithContext(ctx aws.Context, input *GetReusableDelegationSetInput, opts ...request.Option) (*GetReusableDelegationSetOutput, error) { + req, out := c.GetReusableDelegationSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetTrafficPolicy = "GetTrafficPolicy" @@ -2426,8 +2832,23 @@ func (c *Route53) GetTrafficPolicyRequest(input *GetTrafficPolicyInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicy func (c *Route53) GetTrafficPolicy(input *GetTrafficPolicyInput) (*GetTrafficPolicyOutput, error) { req, out := c.GetTrafficPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetTrafficPolicyWithContext is the same as GetTrafficPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetTrafficPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetTrafficPolicyWithContext(ctx aws.Context, input *GetTrafficPolicyInput, opts ...request.Option) (*GetTrafficPolicyOutput, error) { + req, out := c.GetTrafficPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetTrafficPolicyInstance = "GetTrafficPolicyInstance" @@ -2505,8 +2926,23 @@ func (c *Route53) GetTrafficPolicyInstanceRequest(input *GetTrafficPolicyInstanc // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstance func (c *Route53) GetTrafficPolicyInstance(input *GetTrafficPolicyInstanceInput) (*GetTrafficPolicyInstanceOutput, error) { req, out := c.GetTrafficPolicyInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetTrafficPolicyInstanceWithContext is the same as GetTrafficPolicyInstance with the addition of +// the ability to pass a context and additional request options. +// +// See GetTrafficPolicyInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetTrafficPolicyInstanceWithContext(ctx aws.Context, input *GetTrafficPolicyInstanceInput, opts ...request.Option) (*GetTrafficPolicyInstanceOutput, error) { + req, out := c.GetTrafficPolicyInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetTrafficPolicyInstanceCount = "GetTrafficPolicyInstanceCount" @@ -2569,8 +3005,23 @@ func (c *Route53) GetTrafficPolicyInstanceCountRequest(input *GetTrafficPolicyIn // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceCount func (c *Route53) GetTrafficPolicyInstanceCount(input *GetTrafficPolicyInstanceCountInput) (*GetTrafficPolicyInstanceCountOutput, error) { req, out := c.GetTrafficPolicyInstanceCountRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetTrafficPolicyInstanceCountWithContext is the same as GetTrafficPolicyInstanceCount with the addition of +// the ability to pass a context and additional request options. +// +// See GetTrafficPolicyInstanceCount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetTrafficPolicyInstanceCountWithContext(ctx aws.Context, input *GetTrafficPolicyInstanceCountInput, opts ...request.Option) (*GetTrafficPolicyInstanceCountOutput, error) { + req, out := c.GetTrafficPolicyInstanceCountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListGeoLocations = "ListGeoLocations" @@ -2641,8 +3092,23 @@ func (c *Route53) ListGeoLocationsRequest(input *ListGeoLocationsInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListGeoLocations func (c *Route53) ListGeoLocations(input *ListGeoLocationsInput) (*ListGeoLocationsOutput, error) { req, out := c.ListGeoLocationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListGeoLocationsWithContext is the same as ListGeoLocations with the addition of +// the ability to pass a context and additional request options. +// +// See ListGeoLocations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListGeoLocationsWithContext(ctx aws.Context, input *ListGeoLocationsInput, opts ...request.Option) (*ListGeoLocationsOutput, error) { + req, out := c.ListGeoLocationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListHealthChecks = "ListHealthChecks" @@ -2724,8 +3190,23 @@ func (c *Route53) ListHealthChecksRequest(input *ListHealthChecksInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHealthChecks func (c *Route53) ListHealthChecks(input *ListHealthChecksInput) (*ListHealthChecksOutput, error) { req, out := c.ListHealthChecksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListHealthChecksWithContext is the same as ListHealthChecks with the addition of +// the ability to pass a context and additional request options. +// +// See ListHealthChecks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListHealthChecksWithContext(ctx aws.Context, input *ListHealthChecksInput, opts ...request.Option) (*ListHealthChecksOutput, error) { + req, out := c.ListHealthChecksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListHealthChecksPages iterates over the pages of a ListHealthChecks operation, @@ -2745,12 +3226,37 @@ func (c *Route53) ListHealthChecks(input *ListHealthChecksInput) (*ListHealthChe // return pageNum <= 3 // }) // -func (c *Route53) ListHealthChecksPages(input *ListHealthChecksInput, fn func(p *ListHealthChecksOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListHealthChecksRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListHealthChecksOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListHealthChecksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListHealthChecksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListHealthChecksOutput), !p.HasNextPage()) + } + return p.Err() } const opListHostedZones = "ListHostedZones" @@ -2851,8 +3357,23 @@ func (c *Route53) ListHostedZonesRequest(input *ListHostedZonesInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZones func (c *Route53) ListHostedZones(input *ListHostedZonesInput) (*ListHostedZonesOutput, error) { req, out := c.ListHostedZonesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListHostedZonesWithContext is the same as ListHostedZones with the addition of +// the ability to pass a context and additional request options. +// +// See ListHostedZones for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListHostedZonesWithContext(ctx aws.Context, input *ListHostedZonesInput, opts ...request.Option) (*ListHostedZonesOutput, error) { + req, out := c.ListHostedZonesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListHostedZonesPages iterates over the pages of a ListHostedZones operation, @@ -2872,12 +3393,37 @@ func (c *Route53) ListHostedZones(input *ListHostedZonesInput) (*ListHostedZones // return pageNum <= 3 // }) // -func (c *Route53) ListHostedZonesPages(input *ListHostedZonesInput, fn func(p *ListHostedZonesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListHostedZonesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListHostedZonesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListHostedZonesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListHostedZonesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListHostedZonesOutput), !p.HasNextPage()) + } + return p.Err() } const opListHostedZonesByName = "ListHostedZonesByName" @@ -2994,8 +3540,23 @@ func (c *Route53) ListHostedZonesByNameRequest(input *ListHostedZonesByNameInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesByName func (c *Route53) ListHostedZonesByName(input *ListHostedZonesByNameInput) (*ListHostedZonesByNameOutput, error) { req, out := c.ListHostedZonesByNameRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListHostedZonesByNameWithContext is the same as ListHostedZonesByName with the addition of +// the ability to pass a context and additional request options. +// +// See ListHostedZonesByName for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListHostedZonesByNameWithContext(ctx aws.Context, input *ListHostedZonesByNameInput, opts ...request.Option) (*ListHostedZonesByNameOutput, error) { + req, out := c.ListHostedZonesByNameRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListResourceRecordSets = "ListResourceRecordSets" @@ -3106,8 +3667,23 @@ func (c *Route53) ListResourceRecordSetsRequest(input *ListResourceRecordSetsInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListResourceRecordSets func (c *Route53) ListResourceRecordSets(input *ListResourceRecordSetsInput) (*ListResourceRecordSetsOutput, error) { req, out := c.ListResourceRecordSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListResourceRecordSetsWithContext is the same as ListResourceRecordSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListResourceRecordSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListResourceRecordSetsWithContext(ctx aws.Context, input *ListResourceRecordSetsInput, opts ...request.Option) (*ListResourceRecordSetsOutput, error) { + req, out := c.ListResourceRecordSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListResourceRecordSetsPages iterates over the pages of a ListResourceRecordSets operation, @@ -3127,12 +3703,37 @@ func (c *Route53) ListResourceRecordSets(input *ListResourceRecordSetsInput) (*L // return pageNum <= 3 // }) // -func (c *Route53) ListResourceRecordSetsPages(input *ListResourceRecordSetsInput, fn func(p *ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListResourceRecordSetsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListResourceRecordSetsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListResourceRecordSetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListResourceRecordSetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListResourceRecordSetsOutput), !p.HasNextPage()) + } + return p.Err() } const opListReusableDelegationSets = "ListReusableDelegationSets" @@ -3205,8 +3806,23 @@ func (c *Route53) ListReusableDelegationSetsRequest(input *ListReusableDelegatio // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListReusableDelegationSets func (c *Route53) ListReusableDelegationSets(input *ListReusableDelegationSetsInput) (*ListReusableDelegationSetsOutput, error) { req, out := c.ListReusableDelegationSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListReusableDelegationSetsWithContext is the same as ListReusableDelegationSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListReusableDelegationSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListReusableDelegationSetsWithContext(ctx aws.Context, input *ListReusableDelegationSetsInput, opts ...request.Option) (*ListReusableDelegationSetsOutput, error) { + req, out := c.ListReusableDelegationSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTagsForResource = "ListTagsForResource" @@ -3291,8 +3907,23 @@ func (c *Route53) ListTagsForResourceRequest(input *ListTagsForResourceInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResource func (c *Route53) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTagsForResources = "ListTagsForResources" @@ -3377,8 +4008,23 @@ func (c *Route53) ListTagsForResourcesRequest(input *ListTagsForResourcesInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResources func (c *Route53) ListTagsForResources(input *ListTagsForResourcesInput) (*ListTagsForResourcesOutput, error) { req, out := c.ListTagsForResourcesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForResourcesWithContext is the same as ListTagsForResources with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForResourcesWithContext(ctx aws.Context, input *ListTagsForResourcesInput, opts ...request.Option) (*ListTagsForResourcesOutput, error) { + req, out := c.ListTagsForResourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTrafficPolicies = "ListTrafficPolicies" @@ -3475,8 +4121,23 @@ func (c *Route53) ListTrafficPoliciesRequest(input *ListTrafficPoliciesInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicies func (c *Route53) ListTrafficPolicies(input *ListTrafficPoliciesInput) (*ListTrafficPoliciesOutput, error) { req, out := c.ListTrafficPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTrafficPoliciesWithContext is the same as ListTrafficPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTrafficPoliciesWithContext(ctx aws.Context, input *ListTrafficPoliciesInput, opts ...request.Option) (*ListTrafficPoliciesOutput, error) { + req, out := c.ListTrafficPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTrafficPolicyInstances = "ListTrafficPolicyInstances" @@ -3582,8 +4243,23 @@ func (c *Route53) ListTrafficPolicyInstancesRequest(input *ListTrafficPolicyInst // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstances func (c *Route53) ListTrafficPolicyInstances(input *ListTrafficPolicyInstancesInput) (*ListTrafficPolicyInstancesOutput, error) { req, out := c.ListTrafficPolicyInstancesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTrafficPolicyInstancesWithContext is the same as ListTrafficPolicyInstances with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicyInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTrafficPolicyInstancesWithContext(ctx aws.Context, input *ListTrafficPolicyInstancesInput, opts ...request.Option) (*ListTrafficPolicyInstancesOutput, error) { + req, out := c.ListTrafficPolicyInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTrafficPolicyInstancesByHostedZone = "ListTrafficPolicyInstancesByHostedZone" @@ -3692,8 +4368,23 @@ func (c *Route53) ListTrafficPolicyInstancesByHostedZoneRequest(input *ListTraff // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByHostedZone func (c *Route53) ListTrafficPolicyInstancesByHostedZone(input *ListTrafficPolicyInstancesByHostedZoneInput) (*ListTrafficPolicyInstancesByHostedZoneOutput, error) { req, out := c.ListTrafficPolicyInstancesByHostedZoneRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTrafficPolicyInstancesByHostedZoneWithContext is the same as ListTrafficPolicyInstancesByHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicyInstancesByHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTrafficPolicyInstancesByHostedZoneWithContext(ctx aws.Context, input *ListTrafficPolicyInstancesByHostedZoneInput, opts ...request.Option) (*ListTrafficPolicyInstancesByHostedZoneOutput, error) { + req, out := c.ListTrafficPolicyInstancesByHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTrafficPolicyInstancesByPolicy = "ListTrafficPolicyInstancesByPolicy" @@ -3801,8 +4492,23 @@ func (c *Route53) ListTrafficPolicyInstancesByPolicyRequest(input *ListTrafficPo // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByPolicy func (c *Route53) ListTrafficPolicyInstancesByPolicy(input *ListTrafficPolicyInstancesByPolicyInput) (*ListTrafficPolicyInstancesByPolicyOutput, error) { req, out := c.ListTrafficPolicyInstancesByPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTrafficPolicyInstancesByPolicyWithContext is the same as ListTrafficPolicyInstancesByPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicyInstancesByPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTrafficPolicyInstancesByPolicyWithContext(ctx aws.Context, input *ListTrafficPolicyInstancesByPolicyInput, opts ...request.Option) (*ListTrafficPolicyInstancesByPolicyOutput, error) { + req, out := c.ListTrafficPolicyInstancesByPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTrafficPolicyVersions = "ListTrafficPolicyVersions" @@ -3902,8 +4608,23 @@ func (c *Route53) ListTrafficPolicyVersionsRequest(input *ListTrafficPolicyVersi // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyVersions func (c *Route53) ListTrafficPolicyVersions(input *ListTrafficPolicyVersionsInput) (*ListTrafficPolicyVersionsOutput, error) { req, out := c.ListTrafficPolicyVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTrafficPolicyVersionsWithContext is the same as ListTrafficPolicyVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicyVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTrafficPolicyVersionsWithContext(ctx aws.Context, input *ListTrafficPolicyVersionsInput, opts ...request.Option) (*ListTrafficPolicyVersionsOutput, error) { + req, out := c.ListTrafficPolicyVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListVPCAssociationAuthorizations = "ListVPCAssociationAuthorizations" @@ -3992,8 +4713,23 @@ func (c *Route53) ListVPCAssociationAuthorizationsRequest(input *ListVPCAssociat // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListVPCAssociationAuthorizations func (c *Route53) ListVPCAssociationAuthorizations(input *ListVPCAssociationAuthorizationsInput) (*ListVPCAssociationAuthorizationsOutput, error) { req, out := c.ListVPCAssociationAuthorizationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListVPCAssociationAuthorizationsWithContext is the same as ListVPCAssociationAuthorizations with the addition of +// the ability to pass a context and additional request options. +// +// See ListVPCAssociationAuthorizations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListVPCAssociationAuthorizationsWithContext(ctx aws.Context, input *ListVPCAssociationAuthorizationsInput, opts ...request.Option) (*ListVPCAssociationAuthorizationsOutput, error) { + req, out := c.ListVPCAssociationAuthorizationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opTestDNSAnswer = "TestDNSAnswer" @@ -4062,8 +4798,23 @@ func (c *Route53) TestDNSAnswerRequest(input *TestDNSAnswerInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TestDNSAnswer func (c *Route53) TestDNSAnswer(input *TestDNSAnswerInput) (*TestDNSAnswerOutput, error) { req, out := c.TestDNSAnswerRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// TestDNSAnswerWithContext is the same as TestDNSAnswer with the addition of +// the ability to pass a context and additional request options. +// +// See TestDNSAnswer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) TestDNSAnswerWithContext(ctx aws.Context, input *TestDNSAnswerInput, opts ...request.Option) (*TestDNSAnswerOutput, error) { + req, out := c.TestDNSAnswerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateHealthCheck = "UpdateHealthCheck" @@ -4141,8 +4892,23 @@ func (c *Route53) UpdateHealthCheckRequest(input *UpdateHealthCheckInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHealthCheck func (c *Route53) UpdateHealthCheck(input *UpdateHealthCheckInput) (*UpdateHealthCheckOutput, error) { req, out := c.UpdateHealthCheckRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateHealthCheckWithContext is the same as UpdateHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateHealthCheckWithContext(ctx aws.Context, input *UpdateHealthCheckInput, opts ...request.Option) (*UpdateHealthCheckOutput, error) { + req, out := c.UpdateHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateHostedZoneComment = "UpdateHostedZoneComment" @@ -4210,8 +4976,23 @@ func (c *Route53) UpdateHostedZoneCommentRequest(input *UpdateHostedZoneCommentI // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHostedZoneComment func (c *Route53) UpdateHostedZoneComment(input *UpdateHostedZoneCommentInput) (*UpdateHostedZoneCommentOutput, error) { req, out := c.UpdateHostedZoneCommentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateHostedZoneCommentWithContext is the same as UpdateHostedZoneComment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateHostedZoneComment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateHostedZoneCommentWithContext(ctx aws.Context, input *UpdateHostedZoneCommentInput, opts ...request.Option) (*UpdateHostedZoneCommentOutput, error) { + req, out := c.UpdateHostedZoneCommentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateTrafficPolicyComment = "UpdateTrafficPolicyComment" @@ -4287,8 +5068,23 @@ func (c *Route53) UpdateTrafficPolicyCommentRequest(input *UpdateTrafficPolicyCo // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyComment func (c *Route53) UpdateTrafficPolicyComment(input *UpdateTrafficPolicyCommentInput) (*UpdateTrafficPolicyCommentOutput, error) { req, out := c.UpdateTrafficPolicyCommentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateTrafficPolicyCommentWithContext is the same as UpdateTrafficPolicyComment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTrafficPolicyComment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateTrafficPolicyCommentWithContext(ctx aws.Context, input *UpdateTrafficPolicyCommentInput, opts ...request.Option) (*UpdateTrafficPolicyCommentOutput, error) { + req, out := c.UpdateTrafficPolicyCommentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateTrafficPolicyInstance = "UpdateTrafficPolicyInstance" @@ -4392,8 +5188,23 @@ func (c *Route53) UpdateTrafficPolicyInstanceRequest(input *UpdateTrafficPolicyI // Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyInstance func (c *Route53) UpdateTrafficPolicyInstance(input *UpdateTrafficPolicyInstanceInput) (*UpdateTrafficPolicyInstanceOutput, error) { req, out := c.UpdateTrafficPolicyInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateTrafficPolicyInstanceWithContext is the same as UpdateTrafficPolicyInstance with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTrafficPolicyInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateTrafficPolicyInstanceWithContext(ctx aws.Context, input *UpdateTrafficPolicyInstanceInput, opts ...request.Option) (*UpdateTrafficPolicyInstanceOutput, error) { + req, out := c.UpdateTrafficPolicyInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // A complex type that identifies the CloudWatch alarm that you want Amazon diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go b/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go index cbd875e70..6dcbc3f03 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package route53 diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/service.go b/vendor/github.com/aws/aws-sdk-go/service/route53/service.go index 287e7db7e..9b2e767ce 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package route53 diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go index 85a70ab5a..71d99e6ea 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package route53 import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilResourceRecordSetsChanged uses the Route 53 API operation @@ -11,24 +14,43 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *Route53) WaitUntilResourceRecordSetsChanged(input *GetChangeInput) error { - waiterCfg := waiter.Config{ - Operation: "GetChange", - Delay: 30, + return c.WaitUntilResourceRecordSetsChangedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilResourceRecordSetsChangedWithContext is an extended version of WaitUntilResourceRecordSetsChanged. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilResourceRecordSetsChangedWithContext(ctx aws.Context, input *GetChangeInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilResourceRecordSetsChanged", MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "path", - Argument: "ChangeInfo.Status", + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "ChangeInfo.Status", Expected: "INSYNC", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetChangeInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetChangeRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go index 9b205f3f0..3f0fc2fdc 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package s3 provides a client for Amazon Simple Storage Service. package s3 @@ -8,6 +8,7 @@ import ( "io" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -79,8 +80,23 @@ func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload func (c *S3) AbortMultipartUpload(input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error) { req, out := c.AbortMultipartUploadRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AbortMultipartUploadWithContext is the same as AbortMultipartUpload with the addition of +// the ability to pass a context and additional request options. +// +// See AbortMultipartUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AbortMultipartUploadWithContext(ctx aws.Context, input *AbortMultipartUploadInput, opts ...request.Option) (*AbortMultipartUploadOutput, error) { + req, out := c.AbortMultipartUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCompleteMultipartUpload = "CompleteMultipartUpload" @@ -139,8 +155,23 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload func (c *S3) CompleteMultipartUpload(input *CompleteMultipartUploadInput) (*CompleteMultipartUploadOutput, error) { req, out := c.CompleteMultipartUploadRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CompleteMultipartUploadWithContext is the same as CompleteMultipartUpload with the addition of +// the ability to pass a context and additional request options. +// +// See CompleteMultipartUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CompleteMultipartUploadWithContext(ctx aws.Context, input *CompleteMultipartUploadInput, opts ...request.Option) (*CompleteMultipartUploadOutput, error) { + req, out := c.CompleteMultipartUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCopyObject = "CopyObject" @@ -205,8 +236,23 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject func (c *S3) CopyObject(input *CopyObjectInput) (*CopyObjectOutput, error) { req, out := c.CopyObjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CopyObjectWithContext is the same as CopyObject with the addition of +// the ability to pass a context and additional request options. +// +// See CopyObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CopyObjectWithContext(ctx aws.Context, input *CopyObjectInput, opts ...request.Option) (*CopyObjectOutput, error) { + req, out := c.CopyObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateBucket = "CreateBucket" @@ -273,8 +319,23 @@ func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket func (c *S3) CreateBucket(input *CreateBucketInput) (*CreateBucketOutput, error) { req, out := c.CreateBucketRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateBucketWithContext is the same as CreateBucket with the addition of +// the ability to pass a context and additional request options. +// +// See CreateBucket for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateBucketWithContext(ctx aws.Context, input *CreateBucketInput, opts ...request.Option) (*CreateBucketOutput, error) { + req, out := c.CreateBucketRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateMultipartUpload = "CreateMultipartUpload" @@ -339,8 +400,23 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload func (c *S3) CreateMultipartUpload(input *CreateMultipartUploadInput) (*CreateMultipartUploadOutput, error) { req, out := c.CreateMultipartUploadRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateMultipartUploadWithContext is the same as CreateMultipartUpload with the addition of +// the ability to pass a context and additional request options. +// +// See CreateMultipartUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateMultipartUploadWithContext(ctx aws.Context, input *CreateMultipartUploadInput, opts ...request.Option) (*CreateMultipartUploadOutput, error) { + req, out := c.CreateMultipartUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucket = "DeleteBucket" @@ -402,8 +478,23 @@ func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket func (c *S3) DeleteBucket(input *DeleteBucketInput) (*DeleteBucketOutput, error) { req, out := c.DeleteBucketRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketWithContext is the same as DeleteBucket with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucket for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketWithContext(ctx aws.Context, input *DeleteBucketInput, opts ...request.Option) (*DeleteBucketOutput, error) { + req, out := c.DeleteBucketRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucketAnalyticsConfiguration = "DeleteBucketAnalyticsConfiguration" @@ -465,8 +556,23 @@ func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyt // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration func (c *S3) DeleteBucketAnalyticsConfiguration(input *DeleteBucketAnalyticsConfigurationInput) (*DeleteBucketAnalyticsConfigurationOutput, error) { req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketAnalyticsConfigurationWithContext is the same as DeleteBucketAnalyticsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketAnalyticsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *DeleteBucketAnalyticsConfigurationInput, opts ...request.Option) (*DeleteBucketAnalyticsConfigurationOutput, error) { + req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucketCors = "DeleteBucketCors" @@ -527,8 +633,23 @@ func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors func (c *S3) DeleteBucketCors(input *DeleteBucketCorsInput) (*DeleteBucketCorsOutput, error) { req, out := c.DeleteBucketCorsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketCorsWithContext is the same as DeleteBucketCors with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketCors for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketCorsWithContext(ctx aws.Context, input *DeleteBucketCorsInput, opts ...request.Option) (*DeleteBucketCorsOutput, error) { + req, out := c.DeleteBucketCorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucketInventoryConfiguration = "DeleteBucketInventoryConfiguration" @@ -590,8 +711,23 @@ func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInvent // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration func (c *S3) DeleteBucketInventoryConfiguration(input *DeleteBucketInventoryConfigurationInput) (*DeleteBucketInventoryConfigurationOutput, error) { req, out := c.DeleteBucketInventoryConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketInventoryConfigurationWithContext is the same as DeleteBucketInventoryConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketInventoryConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketInventoryConfigurationWithContext(ctx aws.Context, input *DeleteBucketInventoryConfigurationInput, opts ...request.Option) (*DeleteBucketInventoryConfigurationOutput, error) { + req, out := c.DeleteBucketInventoryConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucketLifecycle = "DeleteBucketLifecycle" @@ -652,8 +788,23 @@ func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle func (c *S3) DeleteBucketLifecycle(input *DeleteBucketLifecycleInput) (*DeleteBucketLifecycleOutput, error) { req, out := c.DeleteBucketLifecycleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketLifecycleWithContext is the same as DeleteBucketLifecycle with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketLifecycle for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketLifecycleWithContext(ctx aws.Context, input *DeleteBucketLifecycleInput, opts ...request.Option) (*DeleteBucketLifecycleOutput, error) { + req, out := c.DeleteBucketLifecycleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucketMetricsConfiguration = "DeleteBucketMetricsConfiguration" @@ -715,8 +866,23 @@ func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsC // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration func (c *S3) DeleteBucketMetricsConfiguration(input *DeleteBucketMetricsConfigurationInput) (*DeleteBucketMetricsConfigurationOutput, error) { req, out := c.DeleteBucketMetricsConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketMetricsConfigurationWithContext is the same as DeleteBucketMetricsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketMetricsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketMetricsConfigurationWithContext(ctx aws.Context, input *DeleteBucketMetricsConfigurationInput, opts ...request.Option) (*DeleteBucketMetricsConfigurationOutput, error) { + req, out := c.DeleteBucketMetricsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucketPolicy = "DeleteBucketPolicy" @@ -777,8 +943,23 @@ func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy func (c *S3) DeleteBucketPolicy(input *DeleteBucketPolicyInput) (*DeleteBucketPolicyOutput, error) { req, out := c.DeleteBucketPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketPolicyWithContext is the same as DeleteBucketPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketPolicyWithContext(ctx aws.Context, input *DeleteBucketPolicyInput, opts ...request.Option) (*DeleteBucketPolicyOutput, error) { + req, out := c.DeleteBucketPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucketReplication = "DeleteBucketReplication" @@ -839,8 +1020,23 @@ func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication func (c *S3) DeleteBucketReplication(input *DeleteBucketReplicationInput) (*DeleteBucketReplicationOutput, error) { req, out := c.DeleteBucketReplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketReplicationWithContext is the same as DeleteBucketReplication with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketReplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketReplicationWithContext(ctx aws.Context, input *DeleteBucketReplicationInput, opts ...request.Option) (*DeleteBucketReplicationOutput, error) { + req, out := c.DeleteBucketReplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucketTagging = "DeleteBucketTagging" @@ -901,8 +1097,23 @@ func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging func (c *S3) DeleteBucketTagging(input *DeleteBucketTaggingInput) (*DeleteBucketTaggingOutput, error) { req, out := c.DeleteBucketTaggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketTaggingWithContext is the same as DeleteBucketTagging with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketTaggingWithContext(ctx aws.Context, input *DeleteBucketTaggingInput, opts ...request.Option) (*DeleteBucketTaggingOutput, error) { + req, out := c.DeleteBucketTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteBucketWebsite = "DeleteBucketWebsite" @@ -963,8 +1174,23 @@ func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite func (c *S3) DeleteBucketWebsite(input *DeleteBucketWebsiteInput) (*DeleteBucketWebsiteOutput, error) { req, out := c.DeleteBucketWebsiteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteBucketWebsiteWithContext is the same as DeleteBucketWebsite with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketWebsite for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteBucketWebsiteWithContext(ctx aws.Context, input *DeleteBucketWebsiteInput, opts ...request.Option) (*DeleteBucketWebsiteOutput, error) { + req, out := c.DeleteBucketWebsiteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteObject = "DeleteObject" @@ -1025,8 +1251,23 @@ func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject func (c *S3) DeleteObject(input *DeleteObjectInput) (*DeleteObjectOutput, error) { req, out := c.DeleteObjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteObjectWithContext is the same as DeleteObject with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteObjectWithContext(ctx aws.Context, input *DeleteObjectInput, opts ...request.Option) (*DeleteObjectOutput, error) { + req, out := c.DeleteObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteObjectTagging = "DeleteObjectTagging" @@ -1085,8 +1326,23 @@ func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging func (c *S3) DeleteObjectTagging(input *DeleteObjectTaggingInput) (*DeleteObjectTaggingOutput, error) { req, out := c.DeleteObjectTaggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteObjectTaggingWithContext is the same as DeleteObjectTagging with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteObjectTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteObjectTaggingWithContext(ctx aws.Context, input *DeleteObjectTaggingInput, opts ...request.Option) (*DeleteObjectTaggingOutput, error) { + req, out := c.DeleteObjectTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteObjects = "DeleteObjects" @@ -1146,8 +1402,23 @@ func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects func (c *S3) DeleteObjects(input *DeleteObjectsInput) (*DeleteObjectsOutput, error) { req, out := c.DeleteObjectsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteObjectsWithContext is the same as DeleteObjects with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteObjects for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteObjectsWithContext(ctx aws.Context, input *DeleteObjectsInput, opts ...request.Option) (*DeleteObjectsOutput, error) { + req, out := c.DeleteObjectsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketAccelerateConfiguration = "GetBucketAccelerateConfiguration" @@ -1206,8 +1477,23 @@ func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateC // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration func (c *S3) GetBucketAccelerateConfiguration(input *GetBucketAccelerateConfigurationInput) (*GetBucketAccelerateConfigurationOutput, error) { req, out := c.GetBucketAccelerateConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketAccelerateConfigurationWithContext is the same as GetBucketAccelerateConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketAccelerateConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketAccelerateConfigurationWithContext(ctx aws.Context, input *GetBucketAccelerateConfigurationInput, opts ...request.Option) (*GetBucketAccelerateConfigurationOutput, error) { + req, out := c.GetBucketAccelerateConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketAcl = "GetBucketAcl" @@ -1266,8 +1552,23 @@ func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl func (c *S3) GetBucketAcl(input *GetBucketAclInput) (*GetBucketAclOutput, error) { req, out := c.GetBucketAclRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketAclWithContext is the same as GetBucketAcl with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketAclWithContext(ctx aws.Context, input *GetBucketAclInput, opts ...request.Option) (*GetBucketAclOutput, error) { + req, out := c.GetBucketAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketAnalyticsConfiguration = "GetBucketAnalyticsConfiguration" @@ -1327,8 +1628,23 @@ func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsCon // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration func (c *S3) GetBucketAnalyticsConfiguration(input *GetBucketAnalyticsConfigurationInput) (*GetBucketAnalyticsConfigurationOutput, error) { req, out := c.GetBucketAnalyticsConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketAnalyticsConfigurationWithContext is the same as GetBucketAnalyticsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketAnalyticsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *GetBucketAnalyticsConfigurationInput, opts ...request.Option) (*GetBucketAnalyticsConfigurationOutput, error) { + req, out := c.GetBucketAnalyticsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketCors = "GetBucketCors" @@ -1387,8 +1703,23 @@ func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors func (c *S3) GetBucketCors(input *GetBucketCorsInput) (*GetBucketCorsOutput, error) { req, out := c.GetBucketCorsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketCorsWithContext is the same as GetBucketCors with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketCors for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketCorsWithContext(ctx aws.Context, input *GetBucketCorsInput, opts ...request.Option) (*GetBucketCorsOutput, error) { + req, out := c.GetBucketCorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketInventoryConfiguration = "GetBucketInventoryConfiguration" @@ -1448,8 +1779,23 @@ func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryCon // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration func (c *S3) GetBucketInventoryConfiguration(input *GetBucketInventoryConfigurationInput) (*GetBucketInventoryConfigurationOutput, error) { req, out := c.GetBucketInventoryConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketInventoryConfigurationWithContext is the same as GetBucketInventoryConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketInventoryConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketInventoryConfigurationWithContext(ctx aws.Context, input *GetBucketInventoryConfigurationInput, opts ...request.Option) (*GetBucketInventoryConfigurationOutput, error) { + req, out := c.GetBucketInventoryConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketLifecycle = "GetBucketLifecycle" @@ -1511,8 +1857,23 @@ func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle func (c *S3) GetBucketLifecycle(input *GetBucketLifecycleInput) (*GetBucketLifecycleOutput, error) { req, out := c.GetBucketLifecycleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketLifecycleWithContext is the same as GetBucketLifecycle with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketLifecycle for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketLifecycleWithContext(ctx aws.Context, input *GetBucketLifecycleInput, opts ...request.Option) (*GetBucketLifecycleOutput, error) { + req, out := c.GetBucketLifecycleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketLifecycleConfiguration = "GetBucketLifecycleConfiguration" @@ -1571,8 +1932,23 @@ func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleCon // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration func (c *S3) GetBucketLifecycleConfiguration(input *GetBucketLifecycleConfigurationInput) (*GetBucketLifecycleConfigurationOutput, error) { req, out := c.GetBucketLifecycleConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketLifecycleConfigurationWithContext is the same as GetBucketLifecycleConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketLifecycleConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketLifecycleConfigurationWithContext(ctx aws.Context, input *GetBucketLifecycleConfigurationInput, opts ...request.Option) (*GetBucketLifecycleConfigurationOutput, error) { + req, out := c.GetBucketLifecycleConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketLocation = "GetBucketLocation" @@ -1631,8 +2007,23 @@ func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) (req *reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation func (c *S3) GetBucketLocation(input *GetBucketLocationInput) (*GetBucketLocationOutput, error) { req, out := c.GetBucketLocationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketLocationWithContext is the same as GetBucketLocation with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketLocation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketLocationWithContext(ctx aws.Context, input *GetBucketLocationInput, opts ...request.Option) (*GetBucketLocationOutput, error) { + req, out := c.GetBucketLocationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketLogging = "GetBucketLogging" @@ -1692,8 +2083,23 @@ func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging func (c *S3) GetBucketLogging(input *GetBucketLoggingInput) (*GetBucketLoggingOutput, error) { req, out := c.GetBucketLoggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketLoggingWithContext is the same as GetBucketLogging with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketLoggingWithContext(ctx aws.Context, input *GetBucketLoggingInput, opts ...request.Option) (*GetBucketLoggingOutput, error) { + req, out := c.GetBucketLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketMetricsConfiguration = "GetBucketMetricsConfiguration" @@ -1753,8 +2159,23 @@ func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigu // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration func (c *S3) GetBucketMetricsConfiguration(input *GetBucketMetricsConfigurationInput) (*GetBucketMetricsConfigurationOutput, error) { req, out := c.GetBucketMetricsConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketMetricsConfigurationWithContext is the same as GetBucketMetricsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketMetricsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketMetricsConfigurationWithContext(ctx aws.Context, input *GetBucketMetricsConfigurationInput, opts ...request.Option) (*GetBucketMetricsConfigurationOutput, error) { + req, out := c.GetBucketMetricsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketNotification = "GetBucketNotification" @@ -1816,8 +2237,23 @@ func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurat // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification func (c *S3) GetBucketNotification(input *GetBucketNotificationConfigurationRequest) (*NotificationConfigurationDeprecated, error) { req, out := c.GetBucketNotificationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketNotificationWithContext is the same as GetBucketNotification with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketNotification for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketNotificationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfigurationDeprecated, error) { + req, out := c.GetBucketNotificationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketNotificationConfiguration = "GetBucketNotificationConfiguration" @@ -1876,8 +2312,23 @@ func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificat // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration func (c *S3) GetBucketNotificationConfiguration(input *GetBucketNotificationConfigurationRequest) (*NotificationConfiguration, error) { req, out := c.GetBucketNotificationConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketNotificationConfigurationWithContext is the same as GetBucketNotificationConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketNotificationConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketNotificationConfigurationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfiguration, error) { + req, out := c.GetBucketNotificationConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketPolicy = "GetBucketPolicy" @@ -1936,8 +2387,23 @@ func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy func (c *S3) GetBucketPolicy(input *GetBucketPolicyInput) (*GetBucketPolicyOutput, error) { req, out := c.GetBucketPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketPolicyWithContext is the same as GetBucketPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketPolicyWithContext(ctx aws.Context, input *GetBucketPolicyInput, opts ...request.Option) (*GetBucketPolicyOutput, error) { + req, out := c.GetBucketPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketReplication = "GetBucketReplication" @@ -1996,8 +2462,23 @@ func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication func (c *S3) GetBucketReplication(input *GetBucketReplicationInput) (*GetBucketReplicationOutput, error) { req, out := c.GetBucketReplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketReplicationWithContext is the same as GetBucketReplication with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketReplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketReplicationWithContext(ctx aws.Context, input *GetBucketReplicationInput, opts ...request.Option) (*GetBucketReplicationOutput, error) { + req, out := c.GetBucketReplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketRequestPayment = "GetBucketRequestPayment" @@ -2056,8 +2537,23 @@ func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment func (c *S3) GetBucketRequestPayment(input *GetBucketRequestPaymentInput) (*GetBucketRequestPaymentOutput, error) { req, out := c.GetBucketRequestPaymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketRequestPaymentWithContext is the same as GetBucketRequestPayment with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketRequestPayment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketRequestPaymentWithContext(ctx aws.Context, input *GetBucketRequestPaymentInput, opts ...request.Option) (*GetBucketRequestPaymentOutput, error) { + req, out := c.GetBucketRequestPaymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketTagging = "GetBucketTagging" @@ -2116,8 +2612,23 @@ func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging func (c *S3) GetBucketTagging(input *GetBucketTaggingInput) (*GetBucketTaggingOutput, error) { req, out := c.GetBucketTaggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketTaggingWithContext is the same as GetBucketTagging with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketTaggingWithContext(ctx aws.Context, input *GetBucketTaggingInput, opts ...request.Option) (*GetBucketTaggingOutput, error) { + req, out := c.GetBucketTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketVersioning = "GetBucketVersioning" @@ -2176,8 +2687,23 @@ func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning func (c *S3) GetBucketVersioning(input *GetBucketVersioningInput) (*GetBucketVersioningOutput, error) { req, out := c.GetBucketVersioningRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketVersioningWithContext is the same as GetBucketVersioning with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketVersioning for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketVersioningWithContext(ctx aws.Context, input *GetBucketVersioningInput, opts ...request.Option) (*GetBucketVersioningOutput, error) { + req, out := c.GetBucketVersioningRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetBucketWebsite = "GetBucketWebsite" @@ -2236,8 +2762,23 @@ func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite func (c *S3) GetBucketWebsite(input *GetBucketWebsiteInput) (*GetBucketWebsiteOutput, error) { req, out := c.GetBucketWebsiteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetBucketWebsiteWithContext is the same as GetBucketWebsite with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketWebsite for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetBucketWebsiteWithContext(ctx aws.Context, input *GetBucketWebsiteInput, opts ...request.Option) (*GetBucketWebsiteOutput, error) { + req, out := c.GetBucketWebsiteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetObject = "GetObject" @@ -2301,8 +2842,23 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject func (c *S3) GetObject(input *GetObjectInput) (*GetObjectOutput, error) { req, out := c.GetObjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetObjectWithContext is the same as GetObject with the addition of +// the ability to pass a context and additional request options. +// +// See GetObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetObjectWithContext(ctx aws.Context, input *GetObjectInput, opts ...request.Option) (*GetObjectOutput, error) { + req, out := c.GetObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetObjectAcl = "GetObjectAcl" @@ -2366,8 +2922,23 @@ func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl func (c *S3) GetObjectAcl(input *GetObjectAclInput) (*GetObjectAclOutput, error) { req, out := c.GetObjectAclRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetObjectAclWithContext is the same as GetObjectAcl with the addition of +// the ability to pass a context and additional request options. +// +// See GetObjectAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetObjectAclWithContext(ctx aws.Context, input *GetObjectAclInput, opts ...request.Option) (*GetObjectAclOutput, error) { + req, out := c.GetObjectAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetObjectTagging = "GetObjectTagging" @@ -2426,8 +2997,23 @@ func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging func (c *S3) GetObjectTagging(input *GetObjectTaggingInput) (*GetObjectTaggingOutput, error) { req, out := c.GetObjectTaggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetObjectTaggingWithContext is the same as GetObjectTagging with the addition of +// the ability to pass a context and additional request options. +// +// See GetObjectTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetObjectTaggingWithContext(ctx aws.Context, input *GetObjectTaggingInput, opts ...request.Option) (*GetObjectTaggingOutput, error) { + req, out := c.GetObjectTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetObjectTorrent = "GetObjectTorrent" @@ -2486,8 +3072,23 @@ func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent func (c *S3) GetObjectTorrent(input *GetObjectTorrentInput) (*GetObjectTorrentOutput, error) { req, out := c.GetObjectTorrentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetObjectTorrentWithContext is the same as GetObjectTorrent with the addition of +// the ability to pass a context and additional request options. +// +// See GetObjectTorrent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetObjectTorrentWithContext(ctx aws.Context, input *GetObjectTorrentInput, opts ...request.Option) (*GetObjectTorrentOutput, error) { + req, out := c.GetObjectTorrentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opHeadBucket = "HeadBucket" @@ -2554,8 +3155,23 @@ func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, ou // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket func (c *S3) HeadBucket(input *HeadBucketInput) (*HeadBucketOutput, error) { req, out := c.HeadBucketRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// HeadBucketWithContext is the same as HeadBucket with the addition of +// the ability to pass a context and additional request options. +// +// See HeadBucket for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) HeadBucketWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.Option) (*HeadBucketOutput, error) { + req, out := c.HeadBucketRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opHeadObject = "HeadObject" @@ -2621,8 +3237,23 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, ou // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject func (c *S3) HeadObject(input *HeadObjectInput) (*HeadObjectOutput, error) { req, out := c.HeadObjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// HeadObjectWithContext is the same as HeadObject with the addition of +// the ability to pass a context and additional request options. +// +// See HeadObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) HeadObjectWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.Option) (*HeadObjectOutput, error) { + req, out := c.HeadObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListBucketAnalyticsConfigurations = "ListBucketAnalyticsConfigurations" @@ -2681,8 +3312,23 @@ func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalytics // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations func (c *S3) ListBucketAnalyticsConfigurations(input *ListBucketAnalyticsConfigurationsInput) (*ListBucketAnalyticsConfigurationsOutput, error) { req, out := c.ListBucketAnalyticsConfigurationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListBucketAnalyticsConfigurationsWithContext is the same as ListBucketAnalyticsConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListBucketAnalyticsConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListBucketAnalyticsConfigurationsWithContext(ctx aws.Context, input *ListBucketAnalyticsConfigurationsInput, opts ...request.Option) (*ListBucketAnalyticsConfigurationsOutput, error) { + req, out := c.ListBucketAnalyticsConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListBucketInventoryConfigurations = "ListBucketInventoryConfigurations" @@ -2741,8 +3387,23 @@ func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventory // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations func (c *S3) ListBucketInventoryConfigurations(input *ListBucketInventoryConfigurationsInput) (*ListBucketInventoryConfigurationsOutput, error) { req, out := c.ListBucketInventoryConfigurationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListBucketInventoryConfigurationsWithContext is the same as ListBucketInventoryConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListBucketInventoryConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListBucketInventoryConfigurationsWithContext(ctx aws.Context, input *ListBucketInventoryConfigurationsInput, opts ...request.Option) (*ListBucketInventoryConfigurationsOutput, error) { + req, out := c.ListBucketInventoryConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListBucketMetricsConfigurations = "ListBucketMetricsConfigurations" @@ -2801,8 +3462,23 @@ func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConf // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations func (c *S3) ListBucketMetricsConfigurations(input *ListBucketMetricsConfigurationsInput) (*ListBucketMetricsConfigurationsOutput, error) { req, out := c.ListBucketMetricsConfigurationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListBucketMetricsConfigurationsWithContext is the same as ListBucketMetricsConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListBucketMetricsConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListBucketMetricsConfigurationsWithContext(ctx aws.Context, input *ListBucketMetricsConfigurationsInput, opts ...request.Option) (*ListBucketMetricsConfigurationsOutput, error) { + req, out := c.ListBucketMetricsConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListBuckets = "ListBuckets" @@ -2861,8 +3537,23 @@ func (c *S3) ListBucketsRequest(input *ListBucketsInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets func (c *S3) ListBuckets(input *ListBucketsInput) (*ListBucketsOutput, error) { req, out := c.ListBucketsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListBucketsWithContext is the same as ListBuckets with the addition of +// the ability to pass a context and additional request options. +// +// See ListBuckets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput, opts ...request.Option) (*ListBucketsOutput, error) { + req, out := c.ListBucketsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListMultipartUploads = "ListMultipartUploads" @@ -2927,8 +3618,23 @@ func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads func (c *S3) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultipartUploadsOutput, error) { req, out := c.ListMultipartUploadsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListMultipartUploadsWithContext is the same as ListMultipartUploads with the addition of +// the ability to pass a context and additional request options. +// +// See ListMultipartUploads for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListMultipartUploadsWithContext(ctx aws.Context, input *ListMultipartUploadsInput, opts ...request.Option) (*ListMultipartUploadsOutput, error) { + req, out := c.ListMultipartUploadsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListMultipartUploadsPages iterates over the pages of a ListMultipartUploads operation, @@ -2948,12 +3654,37 @@ func (c *S3) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultip // return pageNum <= 3 // }) // -func (c *S3) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(p *ListMultipartUploadsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListMultipartUploadsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListMultipartUploadsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMultipartUploadsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMultipartUploadsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) + } + return p.Err() } const opListObjectVersions = "ListObjectVersions" @@ -3018,8 +3749,23 @@ func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions func (c *S3) ListObjectVersions(input *ListObjectVersionsInput) (*ListObjectVersionsOutput, error) { req, out := c.ListObjectVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListObjectVersionsWithContext is the same as ListObjectVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListObjectVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListObjectVersionsWithContext(ctx aws.Context, input *ListObjectVersionsInput, opts ...request.Option) (*ListObjectVersionsOutput, error) { + req, out := c.ListObjectVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListObjectVersionsPages iterates over the pages of a ListObjectVersions operation, @@ -3039,12 +3785,37 @@ func (c *S3) ListObjectVersions(input *ListObjectVersionsInput) (*ListObjectVers // return pageNum <= 3 // }) // -func (c *S3) ListObjectVersionsPages(input *ListObjectVersionsInput, fn func(p *ListObjectVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListObjectVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListObjectVersionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListObjectVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListObjectVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListObjectVersionsOutput), !p.HasNextPage()) + } + return p.Err() } const opListObjects = "ListObjects" @@ -3116,8 +3887,23 @@ func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects func (c *S3) ListObjects(input *ListObjectsInput) (*ListObjectsOutput, error) { req, out := c.ListObjectsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListObjectsWithContext is the same as ListObjects with the addition of +// the ability to pass a context and additional request options. +// +// See ListObjects for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListObjectsWithContext(ctx aws.Context, input *ListObjectsInput, opts ...request.Option) (*ListObjectsOutput, error) { + req, out := c.ListObjectsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListObjectsPages iterates over the pages of a ListObjects operation, @@ -3137,12 +3923,37 @@ func (c *S3) ListObjects(input *ListObjectsInput) (*ListObjectsOutput, error) { // return pageNum <= 3 // }) // -func (c *S3) ListObjectsPages(input *ListObjectsInput, fn func(p *ListObjectsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListObjectsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListObjectsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListObjectsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListObjectsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListObjectsOutput), !p.HasNextPage()) + } + return p.Err() } const opListObjectsV2 = "ListObjectsV2" @@ -3215,8 +4026,23 @@ func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 func (c *S3) ListObjectsV2(input *ListObjectsV2Input) (*ListObjectsV2Output, error) { req, out := c.ListObjectsV2Request(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListObjectsV2WithContext is the same as ListObjectsV2 with the addition of +// the ability to pass a context and additional request options. +// +// See ListObjectsV2 for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListObjectsV2WithContext(ctx aws.Context, input *ListObjectsV2Input, opts ...request.Option) (*ListObjectsV2Output, error) { + req, out := c.ListObjectsV2Request(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListObjectsV2Pages iterates over the pages of a ListObjectsV2 operation, @@ -3236,12 +4062,37 @@ func (c *S3) ListObjectsV2(input *ListObjectsV2Input) (*ListObjectsV2Output, err // return pageNum <= 3 // }) // -func (c *S3) ListObjectsV2Pages(input *ListObjectsV2Input, fn func(p *ListObjectsV2Output, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListObjectsV2Request(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListObjectsV2Output), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListObjectsV2Input + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListObjectsV2Request(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListObjectsV2Output), !p.HasNextPage()) + } + return p.Err() } const opListParts = "ListParts" @@ -3306,8 +4157,23 @@ func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, outp // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts func (c *S3) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { req, out := c.ListPartsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPartsWithContext is the same as ListParts with the addition of +// the ability to pass a context and additional request options. +// +// See ListParts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPartsWithContext(ctx aws.Context, input *ListPartsInput, opts ...request.Option) (*ListPartsOutput, error) { + req, out := c.ListPartsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListPartsPages iterates over the pages of a ListParts operation, @@ -3327,12 +4193,37 @@ func (c *S3) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { // return pageNum <= 3 // }) // -func (c *S3) ListPartsPages(input *ListPartsInput, fn func(p *ListPartsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPartsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPartsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPartsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPartsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) + } + return p.Err() } const opPutBucketAccelerateConfiguration = "PutBucketAccelerateConfiguration" @@ -3393,8 +4284,23 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration func (c *S3) PutBucketAccelerateConfiguration(input *PutBucketAccelerateConfigurationInput) (*PutBucketAccelerateConfigurationOutput, error) { req, out := c.PutBucketAccelerateConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketAccelerateConfigurationWithContext is the same as PutBucketAccelerateConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketAccelerateConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketAccelerateConfigurationWithContext(ctx aws.Context, input *PutBucketAccelerateConfigurationInput, opts ...request.Option) (*PutBucketAccelerateConfigurationOutput, error) { + req, out := c.PutBucketAccelerateConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketAcl = "PutBucketAcl" @@ -3455,8 +4361,23 @@ func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl func (c *S3) PutBucketAcl(input *PutBucketAclInput) (*PutBucketAclOutput, error) { req, out := c.PutBucketAclRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketAclWithContext is the same as PutBucketAcl with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketAclWithContext(ctx aws.Context, input *PutBucketAclInput, opts ...request.Option) (*PutBucketAclOutput, error) { + req, out := c.PutBucketAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketAnalyticsConfiguration = "PutBucketAnalyticsConfiguration" @@ -3518,8 +4439,23 @@ func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsCon // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration func (c *S3) PutBucketAnalyticsConfiguration(input *PutBucketAnalyticsConfigurationInput) (*PutBucketAnalyticsConfigurationOutput, error) { req, out := c.PutBucketAnalyticsConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketAnalyticsConfigurationWithContext is the same as PutBucketAnalyticsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketAnalyticsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *PutBucketAnalyticsConfigurationInput, opts ...request.Option) (*PutBucketAnalyticsConfigurationOutput, error) { + req, out := c.PutBucketAnalyticsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketCors = "PutBucketCors" @@ -3580,8 +4516,23 @@ func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors func (c *S3) PutBucketCors(input *PutBucketCorsInput) (*PutBucketCorsOutput, error) { req, out := c.PutBucketCorsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketCorsWithContext is the same as PutBucketCors with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketCors for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketCorsWithContext(ctx aws.Context, input *PutBucketCorsInput, opts ...request.Option) (*PutBucketCorsOutput, error) { + req, out := c.PutBucketCorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketInventoryConfiguration = "PutBucketInventoryConfiguration" @@ -3643,8 +4594,23 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration func (c *S3) PutBucketInventoryConfiguration(input *PutBucketInventoryConfigurationInput) (*PutBucketInventoryConfigurationOutput, error) { req, out := c.PutBucketInventoryConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketInventoryConfigurationWithContext is the same as PutBucketInventoryConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketInventoryConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketInventoryConfigurationWithContext(ctx aws.Context, input *PutBucketInventoryConfigurationInput, opts ...request.Option) (*PutBucketInventoryConfigurationOutput, error) { + req, out := c.PutBucketInventoryConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketLifecycle = "PutBucketLifecycle" @@ -3708,8 +4674,23 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle func (c *S3) PutBucketLifecycle(input *PutBucketLifecycleInput) (*PutBucketLifecycleOutput, error) { req, out := c.PutBucketLifecycleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketLifecycleWithContext is the same as PutBucketLifecycle with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketLifecycle for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketLifecycleWithContext(ctx aws.Context, input *PutBucketLifecycleInput, opts ...request.Option) (*PutBucketLifecycleOutput, error) { + req, out := c.PutBucketLifecycleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketLifecycleConfiguration = "PutBucketLifecycleConfiguration" @@ -3771,8 +4752,23 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration func (c *S3) PutBucketLifecycleConfiguration(input *PutBucketLifecycleConfigurationInput) (*PutBucketLifecycleConfigurationOutput, error) { req, out := c.PutBucketLifecycleConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketLifecycleConfigurationWithContext is the same as PutBucketLifecycleConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketLifecycleConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketLifecycleConfigurationWithContext(ctx aws.Context, input *PutBucketLifecycleConfigurationInput, opts ...request.Option) (*PutBucketLifecycleConfigurationOutput, error) { + req, out := c.PutBucketLifecycleConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketLogging = "PutBucketLogging" @@ -3835,8 +4831,23 @@ func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging func (c *S3) PutBucketLogging(input *PutBucketLoggingInput) (*PutBucketLoggingOutput, error) { req, out := c.PutBucketLoggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketLoggingWithContext is the same as PutBucketLogging with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketLoggingWithContext(ctx aws.Context, input *PutBucketLoggingInput, opts ...request.Option) (*PutBucketLoggingOutput, error) { + req, out := c.PutBucketLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketMetricsConfiguration = "PutBucketMetricsConfiguration" @@ -3898,8 +4909,23 @@ func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigu // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration func (c *S3) PutBucketMetricsConfiguration(input *PutBucketMetricsConfigurationInput) (*PutBucketMetricsConfigurationOutput, error) { req, out := c.PutBucketMetricsConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketMetricsConfigurationWithContext is the same as PutBucketMetricsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketMetricsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketMetricsConfigurationWithContext(ctx aws.Context, input *PutBucketMetricsConfigurationInput, opts ...request.Option) (*PutBucketMetricsConfigurationOutput, error) { + req, out := c.PutBucketMetricsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketNotification = "PutBucketNotification" @@ -3963,8 +4989,23 @@ func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (re // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification func (c *S3) PutBucketNotification(input *PutBucketNotificationInput) (*PutBucketNotificationOutput, error) { req, out := c.PutBucketNotificationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketNotificationWithContext is the same as PutBucketNotification with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketNotification for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketNotificationWithContext(ctx aws.Context, input *PutBucketNotificationInput, opts ...request.Option) (*PutBucketNotificationOutput, error) { + req, out := c.PutBucketNotificationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketNotificationConfiguration = "PutBucketNotificationConfiguration" @@ -4025,8 +5066,23 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration func (c *S3) PutBucketNotificationConfiguration(input *PutBucketNotificationConfigurationInput) (*PutBucketNotificationConfigurationOutput, error) { req, out := c.PutBucketNotificationConfigurationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketNotificationConfigurationWithContext is the same as PutBucketNotificationConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketNotificationConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketNotificationConfigurationWithContext(ctx aws.Context, input *PutBucketNotificationConfigurationInput, opts ...request.Option) (*PutBucketNotificationConfigurationOutput, error) { + req, out := c.PutBucketNotificationConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketPolicy = "PutBucketPolicy" @@ -4088,8 +5144,23 @@ func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.R // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy func (c *S3) PutBucketPolicy(input *PutBucketPolicyInput) (*PutBucketPolicyOutput, error) { req, out := c.PutBucketPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketPolicyWithContext is the same as PutBucketPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketPolicyWithContext(ctx aws.Context, input *PutBucketPolicyInput, opts ...request.Option) (*PutBucketPolicyOutput, error) { + req, out := c.PutBucketPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketReplication = "PutBucketReplication" @@ -4151,8 +5222,23 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication func (c *S3) PutBucketReplication(input *PutBucketReplicationInput) (*PutBucketReplicationOutput, error) { req, out := c.PutBucketReplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketReplicationWithContext is the same as PutBucketReplication with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketReplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketReplicationWithContext(ctx aws.Context, input *PutBucketReplicationInput, opts ...request.Option) (*PutBucketReplicationOutput, error) { + req, out := c.PutBucketReplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketRequestPayment = "PutBucketRequestPayment" @@ -4217,8 +5303,23 @@ func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment func (c *S3) PutBucketRequestPayment(input *PutBucketRequestPaymentInput) (*PutBucketRequestPaymentOutput, error) { req, out := c.PutBucketRequestPaymentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketRequestPaymentWithContext is the same as PutBucketRequestPayment with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketRequestPayment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketRequestPaymentWithContext(ctx aws.Context, input *PutBucketRequestPaymentInput, opts ...request.Option) (*PutBucketRequestPaymentOutput, error) { + req, out := c.PutBucketRequestPaymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketTagging = "PutBucketTagging" @@ -4279,8 +5380,23 @@ func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging func (c *S3) PutBucketTagging(input *PutBucketTaggingInput) (*PutBucketTaggingOutput, error) { req, out := c.PutBucketTaggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketTaggingWithContext is the same as PutBucketTagging with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketTaggingWithContext(ctx aws.Context, input *PutBucketTaggingInput, opts ...request.Option) (*PutBucketTaggingOutput, error) { + req, out := c.PutBucketTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketVersioning = "PutBucketVersioning" @@ -4342,8 +5458,23 @@ func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *r // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning func (c *S3) PutBucketVersioning(input *PutBucketVersioningInput) (*PutBucketVersioningOutput, error) { req, out := c.PutBucketVersioningRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketVersioningWithContext is the same as PutBucketVersioning with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketVersioning for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketVersioningWithContext(ctx aws.Context, input *PutBucketVersioningInput, opts ...request.Option) (*PutBucketVersioningOutput, error) { + req, out := c.PutBucketVersioningRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutBucketWebsite = "PutBucketWebsite" @@ -4404,8 +5535,23 @@ func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite func (c *S3) PutBucketWebsite(input *PutBucketWebsiteInput) (*PutBucketWebsiteOutput, error) { req, out := c.PutBucketWebsiteRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutBucketWebsiteWithContext is the same as PutBucketWebsite with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketWebsite for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketWebsiteWithContext(ctx aws.Context, input *PutBucketWebsiteInput, opts ...request.Option) (*PutBucketWebsiteOutput, error) { + req, out := c.PutBucketWebsiteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutObject = "PutObject" @@ -4464,8 +5610,23 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, outp // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject func (c *S3) PutObject(input *PutObjectInput) (*PutObjectOutput, error) { req, out := c.PutObjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutObjectWithContext is the same as PutObject with the addition of +// the ability to pass a context and additional request options. +// +// See PutObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutObjectWithContext(ctx aws.Context, input *PutObjectInput, opts ...request.Option) (*PutObjectOutput, error) { + req, out := c.PutObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutObjectAcl = "PutObjectAcl" @@ -4530,8 +5691,23 @@ func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl func (c *S3) PutObjectAcl(input *PutObjectAclInput) (*PutObjectAclOutput, error) { req, out := c.PutObjectAclRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutObjectAclWithContext is the same as PutObjectAcl with the addition of +// the ability to pass a context and additional request options. +// +// See PutObjectAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutObjectAclWithContext(ctx aws.Context, input *PutObjectAclInput, opts ...request.Option) (*PutObjectAclOutput, error) { + req, out := c.PutObjectAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutObjectTagging = "PutObjectTagging" @@ -4590,8 +5766,23 @@ func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging func (c *S3) PutObjectTagging(input *PutObjectTaggingInput) (*PutObjectTaggingOutput, error) { req, out := c.PutObjectTaggingRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutObjectTaggingWithContext is the same as PutObjectTagging with the addition of +// the ability to pass a context and additional request options. +// +// See PutObjectTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutObjectTaggingWithContext(ctx aws.Context, input *PutObjectTaggingInput, opts ...request.Option) (*PutObjectTaggingOutput, error) { + req, out := c.PutObjectTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRestoreObject = "RestoreObject" @@ -4655,8 +5846,23 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject func (c *S3) RestoreObject(input *RestoreObjectInput) (*RestoreObjectOutput, error) { req, out := c.RestoreObjectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RestoreObjectWithContext is the same as RestoreObject with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RestoreObjectWithContext(ctx aws.Context, input *RestoreObjectInput, opts ...request.Option) (*RestoreObjectOutput, error) { + req, out := c.RestoreObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUploadPart = "UploadPart" @@ -4721,8 +5927,23 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, ou // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart func (c *S3) UploadPart(input *UploadPartInput) (*UploadPartOutput, error) { req, out := c.UploadPartRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UploadPartWithContext is the same as UploadPart with the addition of +// the ability to pass a context and additional request options. +// +// See UploadPart for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UploadPartWithContext(ctx aws.Context, input *UploadPartInput, opts ...request.Option) (*UploadPartOutput, error) { + req, out := c.UploadPartRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUploadPartCopy = "UploadPartCopy" @@ -4781,8 +6002,23 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Req // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy func (c *S3) UploadPartCopy(input *UploadPartCopyInput) (*UploadPartCopyOutput, error) { req, out := c.UploadPartCopyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UploadPartCopyWithContext is the same as UploadPartCopy with the addition of +// the ability to pass a context and additional request options. +// +// See UploadPartCopy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UploadPartCopyWithContext(ctx aws.Context, input *UploadPartCopyInput, opts ...request.Option) (*UploadPartCopyOutput, error) { + req, out := c.UploadPartCopyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Specifies the days since the initiation of an Incomplete Multipart Upload diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go index 13ebbdad9..931cb17bb 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package s3 diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go index 5e6f2299e..3fb5b3be7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package s3 diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go index ed91c5872..bcca8627a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go @@ -23,17 +23,22 @@ func unmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() defer io.Copy(ioutil.Discard, r.HTTPResponse.Body) + hostID := r.HTTPResponse.Header.Get("X-Amz-Id-2") + // Bucket exists in a different region, and request needs // to be made to the correct region. if r.HTTPResponse.StatusCode == http.StatusMovedPermanently { - r.Error = awserr.NewRequestFailure( - awserr.New("BucketRegionError", - fmt.Sprintf("incorrect region, the bucket is not in '%s' region", - aws.StringValue(r.Config.Region)), - nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) + r.Error = requestFailure{ + RequestFailure: awserr.NewRequestFailure( + awserr.New("BucketRegionError", + fmt.Sprintf("incorrect region, the bucket is not in '%s' region", + aws.StringValue(r.Config.Region)), + nil), + r.HTTPResponse.StatusCode, + r.RequestID, + ), + hostID: hostID, + } return } @@ -48,6 +53,7 @@ func unmarshalError(r *request.Request) { } else { errCode = resp.Code errMsg = resp.Message + err = nil } // Fallback to status code converted to message if still no error code @@ -57,9 +63,41 @@ func unmarshalError(r *request.Request) { errMsg = statusText } - r.Error = awserr.NewRequestFailure( - awserr.New(errCode, errMsg, nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) + r.Error = requestFailure{ + RequestFailure: awserr.NewRequestFailure( + awserr.New(errCode, errMsg, err), + r.HTTPResponse.StatusCode, + r.RequestID, + ), + hostID: hostID, + } +} + +// A RequestFailure provides access to the S3 Request ID and Host ID values +// returned from API operation errors. Getting the error as a string will +// return the formated error with the same information as awserr.RequestFailure, +// while also adding the HostID value from the response. +type RequestFailure interface { + awserr.RequestFailure + + // Host ID is the S3 Host ID needed for debug, and contacting support + HostID() string +} + +type requestFailure struct { + awserr.RequestFailure + + hostID string +} + +func (r requestFailure) Error() string { + extra := fmt.Sprintf("status code: %d, request id: %s, host id: %s", + r.StatusCode(), r.RequestID(), r.hostID) + return awserr.SprintError(r.Code(), r.Message(), extra, r.OrigErr()) +} +func (r requestFailure) String() string { + return r.Error() +} +func (r requestFailure) HostID() string { + return r.hostID } diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go index 5e16be4ba..cccfa8c2b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package s3 import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilBucketExists uses the Amazon S3 API operation @@ -11,44 +14,60 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error { - waiterCfg := waiter.Config{ - Operation: "HeadBucket", - Delay: 5, + return c.WaitUntilBucketExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilBucketExistsWithContext is an extended version of WaitUntilBucketExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilBucketExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilBucketExists", MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 301, }, { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 403, }, { - State: "retry", - Matcher: "status", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 404, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *HeadBucketInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.HeadBucketRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilBucketNotExists uses the Amazon S3 API operation @@ -56,26 +75,45 @@ func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error { - waiterCfg := waiter.Config{ - Operation: "HeadBucket", - Delay: 5, + return c.WaitUntilBucketNotExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilBucketNotExistsWithContext is an extended version of WaitUntilBucketNotExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilBucketNotExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilBucketNotExists", MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 404, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *HeadBucketInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.HeadBucketRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilObjectExists uses the Amazon S3 API operation @@ -83,32 +121,50 @@ func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error { - waiterCfg := waiter.Config{ - Operation: "HeadObject", - Delay: 5, + return c.WaitUntilObjectExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilObjectExistsWithContext is an extended version of WaitUntilObjectExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilObjectExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilObjectExists", MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "retry", - Matcher: "status", - Argument: "", + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 404, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *HeadObjectInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.HeadObjectRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } // WaitUntilObjectNotExists uses the Amazon S3 API operation @@ -116,24 +172,43 @@ func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error { // If the condition is not meet within the max attempt window an error will // be returned. func (c *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error { - waiterCfg := waiter.Config{ - Operation: "HeadObject", - Delay: 5, + return c.WaitUntilObjectNotExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilObjectNotExistsWithContext is an extended version of WaitUntilObjectNotExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilObjectNotExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilObjectNotExists", MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 404, }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *HeadObjectInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.HeadObjectRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/ses/api.go b/vendor/github.com/aws/aws-sdk-go/service/ses/api.go index 79253784a..30156443a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ses/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package ses provides a client for Amazon Simple Email Service. package ses @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -88,8 +89,23 @@ func (c *SES) CloneReceiptRuleSetRequest(input *CloneReceiptRuleSetInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CloneReceiptRuleSet func (c *SES) CloneReceiptRuleSet(input *CloneReceiptRuleSetInput) (*CloneReceiptRuleSetOutput, error) { req, out := c.CloneReceiptRuleSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CloneReceiptRuleSetWithContext is the same as CloneReceiptRuleSet with the addition of +// the ability to pass a context and additional request options. +// +// See CloneReceiptRuleSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CloneReceiptRuleSetWithContext(ctx aws.Context, input *CloneReceiptRuleSetInput, opts ...request.Option) (*CloneReceiptRuleSetOutput, error) { + req, out := c.CloneReceiptRuleSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateConfigurationSet = "CreateConfigurationSet" @@ -167,8 +183,23 @@ func (c *SES) CreateConfigurationSetRequest(input *CreateConfigurationSetInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSet func (c *SES) CreateConfigurationSet(input *CreateConfigurationSetInput) (*CreateConfigurationSetOutput, error) { req, out := c.CreateConfigurationSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateConfigurationSetWithContext is the same as CreateConfigurationSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateConfigurationSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateConfigurationSetWithContext(ctx aws.Context, input *CreateConfigurationSetInput, opts ...request.Option) (*CreateConfigurationSetOutput, error) { + req, out := c.CreateConfigurationSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateConfigurationSetEventDestination = "CreateConfigurationSetEventDestination" @@ -258,8 +289,23 @@ func (c *SES) CreateConfigurationSetEventDestinationRequest(input *CreateConfigu // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSetEventDestination func (c *SES) CreateConfigurationSetEventDestination(input *CreateConfigurationSetEventDestinationInput) (*CreateConfigurationSetEventDestinationOutput, error) { req, out := c.CreateConfigurationSetEventDestinationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateConfigurationSetEventDestinationWithContext is the same as CreateConfigurationSetEventDestination with the addition of +// the ability to pass a context and additional request options. +// +// See CreateConfigurationSetEventDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateConfigurationSetEventDestinationWithContext(ctx aws.Context, input *CreateConfigurationSetEventDestinationInput, opts ...request.Option) (*CreateConfigurationSetEventDestinationOutput, error) { + req, out := c.CreateConfigurationSetEventDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateReceiptFilter = "CreateReceiptFilter" @@ -332,8 +378,23 @@ func (c *SES) CreateReceiptFilterRequest(input *CreateReceiptFilterInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptFilter func (c *SES) CreateReceiptFilter(input *CreateReceiptFilterInput) (*CreateReceiptFilterOutput, error) { req, out := c.CreateReceiptFilterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateReceiptFilterWithContext is the same as CreateReceiptFilter with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReceiptFilter for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateReceiptFilterWithContext(ctx aws.Context, input *CreateReceiptFilterInput, opts ...request.Option) (*CreateReceiptFilterOutput, error) { + req, out := c.CreateReceiptFilterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateReceiptRule = "CreateReceiptRule" @@ -429,8 +490,23 @@ func (c *SES) CreateReceiptRuleRequest(input *CreateReceiptRuleInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRule func (c *SES) CreateReceiptRule(input *CreateReceiptRuleInput) (*CreateReceiptRuleOutput, error) { req, out := c.CreateReceiptRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateReceiptRuleWithContext is the same as CreateReceiptRule with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReceiptRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateReceiptRuleWithContext(ctx aws.Context, input *CreateReceiptRuleInput, opts ...request.Option) (*CreateReceiptRuleOutput, error) { + req, out := c.CreateReceiptRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateReceiptRuleSet = "CreateReceiptRuleSet" @@ -503,8 +579,23 @@ func (c *SES) CreateReceiptRuleSetRequest(input *CreateReceiptRuleSetInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRuleSet func (c *SES) CreateReceiptRuleSet(input *CreateReceiptRuleSetInput) (*CreateReceiptRuleSetOutput, error) { req, out := c.CreateReceiptRuleSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateReceiptRuleSetWithContext is the same as CreateReceiptRuleSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReceiptRuleSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateReceiptRuleSetWithContext(ctx aws.Context, input *CreateReceiptRuleSetInput, opts ...request.Option) (*CreateReceiptRuleSetOutput, error) { + req, out := c.CreateReceiptRuleSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteConfigurationSet = "DeleteConfigurationSet" @@ -573,8 +664,23 @@ func (c *SES) DeleteConfigurationSetRequest(input *DeleteConfigurationSetInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSet func (c *SES) DeleteConfigurationSet(input *DeleteConfigurationSetInput) (*DeleteConfigurationSetOutput, error) { req, out := c.DeleteConfigurationSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteConfigurationSetWithContext is the same as DeleteConfigurationSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteConfigurationSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteConfigurationSetWithContext(ctx aws.Context, input *DeleteConfigurationSetInput, opts ...request.Option) (*DeleteConfigurationSetOutput, error) { + req, out := c.DeleteConfigurationSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteConfigurationSetEventDestination = "DeleteConfigurationSetEventDestination" @@ -647,8 +753,23 @@ func (c *SES) DeleteConfigurationSetEventDestinationRequest(input *DeleteConfigu // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSetEventDestination func (c *SES) DeleteConfigurationSetEventDestination(input *DeleteConfigurationSetEventDestinationInput) (*DeleteConfigurationSetEventDestinationOutput, error) { req, out := c.DeleteConfigurationSetEventDestinationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteConfigurationSetEventDestinationWithContext is the same as DeleteConfigurationSetEventDestination with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteConfigurationSetEventDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteConfigurationSetEventDestinationWithContext(ctx aws.Context, input *DeleteConfigurationSetEventDestinationInput, opts ...request.Option) (*DeleteConfigurationSetEventDestinationOutput, error) { + req, out := c.DeleteConfigurationSetEventDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteIdentity = "DeleteIdentity" @@ -710,8 +831,23 @@ func (c *SES) DeleteIdentityRequest(input *DeleteIdentityInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentity func (c *SES) DeleteIdentity(input *DeleteIdentityInput) (*DeleteIdentityOutput, error) { req, out := c.DeleteIdentityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteIdentityWithContext is the same as DeleteIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteIdentityWithContext(ctx aws.Context, input *DeleteIdentityInput, opts ...request.Option) (*DeleteIdentityOutput, error) { + req, out := c.DeleteIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteIdentityPolicy = "DeleteIdentityPolicy" @@ -781,8 +917,23 @@ func (c *SES) DeleteIdentityPolicyRequest(input *DeleteIdentityPolicyInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentityPolicy func (c *SES) DeleteIdentityPolicy(input *DeleteIdentityPolicyInput) (*DeleteIdentityPolicyOutput, error) { req, out := c.DeleteIdentityPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteIdentityPolicyWithContext is the same as DeleteIdentityPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteIdentityPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteIdentityPolicyWithContext(ctx aws.Context, input *DeleteIdentityPolicyInput, opts ...request.Option) (*DeleteIdentityPolicyOutput, error) { + req, out := c.DeleteIdentityPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteReceiptFilter = "DeleteReceiptFilter" @@ -846,8 +997,23 @@ func (c *SES) DeleteReceiptFilterRequest(input *DeleteReceiptFilterInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptFilter func (c *SES) DeleteReceiptFilter(input *DeleteReceiptFilterInput) (*DeleteReceiptFilterOutput, error) { req, out := c.DeleteReceiptFilterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteReceiptFilterWithContext is the same as DeleteReceiptFilter with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteReceiptFilter for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteReceiptFilterWithContext(ctx aws.Context, input *DeleteReceiptFilterInput, opts ...request.Option) (*DeleteReceiptFilterOutput, error) { + req, out := c.DeleteReceiptFilterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteReceiptRule = "DeleteReceiptRule" @@ -916,8 +1082,23 @@ func (c *SES) DeleteReceiptRuleRequest(input *DeleteReceiptRuleInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRule func (c *SES) DeleteReceiptRule(input *DeleteReceiptRuleInput) (*DeleteReceiptRuleOutput, error) { req, out := c.DeleteReceiptRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteReceiptRuleWithContext is the same as DeleteReceiptRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteReceiptRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteReceiptRuleWithContext(ctx aws.Context, input *DeleteReceiptRuleInput, opts ...request.Option) (*DeleteReceiptRuleOutput, error) { + req, out := c.DeleteReceiptRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteReceiptRuleSet = "DeleteReceiptRuleSet" @@ -988,8 +1169,23 @@ func (c *SES) DeleteReceiptRuleSetRequest(input *DeleteReceiptRuleSetInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRuleSet func (c *SES) DeleteReceiptRuleSet(input *DeleteReceiptRuleSetInput) (*DeleteReceiptRuleSetOutput, error) { req, out := c.DeleteReceiptRuleSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteReceiptRuleSetWithContext is the same as DeleteReceiptRuleSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteReceiptRuleSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteReceiptRuleSetWithContext(ctx aws.Context, input *DeleteReceiptRuleSetInput, opts ...request.Option) (*DeleteReceiptRuleSetOutput, error) { + req, out := c.DeleteReceiptRuleSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteVerifiedEmailAddress = "DeleteVerifiedEmailAddress" @@ -1055,8 +1251,23 @@ func (c *SES) DeleteVerifiedEmailAddressRequest(input *DeleteVerifiedEmailAddres // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteVerifiedEmailAddress func (c *SES) DeleteVerifiedEmailAddress(input *DeleteVerifiedEmailAddressInput) (*DeleteVerifiedEmailAddressOutput, error) { req, out := c.DeleteVerifiedEmailAddressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteVerifiedEmailAddressWithContext is the same as DeleteVerifiedEmailAddress with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVerifiedEmailAddress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteVerifiedEmailAddressWithContext(ctx aws.Context, input *DeleteVerifiedEmailAddressInput, opts ...request.Option) (*DeleteVerifiedEmailAddressOutput, error) { + req, out := c.DeleteVerifiedEmailAddressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeActiveReceiptRuleSet = "DescribeActiveReceiptRuleSet" @@ -1121,8 +1332,23 @@ func (c *SES) DescribeActiveReceiptRuleSetRequest(input *DescribeActiveReceiptRu // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeActiveReceiptRuleSet func (c *SES) DescribeActiveReceiptRuleSet(input *DescribeActiveReceiptRuleSetInput) (*DescribeActiveReceiptRuleSetOutput, error) { req, out := c.DescribeActiveReceiptRuleSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeActiveReceiptRuleSetWithContext is the same as DescribeActiveReceiptRuleSet with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeActiveReceiptRuleSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeActiveReceiptRuleSetWithContext(ctx aws.Context, input *DescribeActiveReceiptRuleSetInput, opts ...request.Option) (*DescribeActiveReceiptRuleSetOutput, error) { + req, out := c.DescribeActiveReceiptRuleSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeConfigurationSet = "DescribeConfigurationSet" @@ -1191,8 +1417,23 @@ func (c *SES) DescribeConfigurationSetRequest(input *DescribeConfigurationSetInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeConfigurationSet func (c *SES) DescribeConfigurationSet(input *DescribeConfigurationSetInput) (*DescribeConfigurationSetOutput, error) { req, out := c.DescribeConfigurationSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeConfigurationSetWithContext is the same as DescribeConfigurationSet with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConfigurationSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeConfigurationSetWithContext(ctx aws.Context, input *DescribeConfigurationSetInput, opts ...request.Option) (*DescribeConfigurationSetOutput, error) { + req, out := c.DescribeConfigurationSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeReceiptRule = "DescribeReceiptRule" @@ -1264,8 +1505,23 @@ func (c *SES) DescribeReceiptRuleRequest(input *DescribeReceiptRuleInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRule func (c *SES) DescribeReceiptRule(input *DescribeReceiptRuleInput) (*DescribeReceiptRuleOutput, error) { req, out := c.DescribeReceiptRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReceiptRuleWithContext is the same as DescribeReceiptRule with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReceiptRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReceiptRuleWithContext(ctx aws.Context, input *DescribeReceiptRuleInput, opts ...request.Option) (*DescribeReceiptRuleOutput, error) { + req, out := c.DescribeReceiptRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeReceiptRuleSet = "DescribeReceiptRuleSet" @@ -1334,8 +1590,23 @@ func (c *SES) DescribeReceiptRuleSetRequest(input *DescribeReceiptRuleSetInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRuleSet func (c *SES) DescribeReceiptRuleSet(input *DescribeReceiptRuleSetInput) (*DescribeReceiptRuleSetOutput, error) { req, out := c.DescribeReceiptRuleSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeReceiptRuleSetWithContext is the same as DescribeReceiptRuleSet with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReceiptRuleSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeReceiptRuleSetWithContext(ctx aws.Context, input *DescribeReceiptRuleSetInput, opts ...request.Option) (*DescribeReceiptRuleSetOutput, error) { + req, out := c.DescribeReceiptRuleSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetIdentityDkimAttributes = "GetIdentityDkimAttributes" @@ -1415,8 +1686,23 @@ func (c *SES) GetIdentityDkimAttributesRequest(input *GetIdentityDkimAttributesI // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityDkimAttributes func (c *SES) GetIdentityDkimAttributes(input *GetIdentityDkimAttributesInput) (*GetIdentityDkimAttributesOutput, error) { req, out := c.GetIdentityDkimAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetIdentityDkimAttributesWithContext is the same as GetIdentityDkimAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetIdentityDkimAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetIdentityDkimAttributesWithContext(ctx aws.Context, input *GetIdentityDkimAttributesInput, opts ...request.Option) (*GetIdentityDkimAttributesOutput, error) { + req, out := c.GetIdentityDkimAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetIdentityMailFromDomainAttributes = "GetIdentityMailFromDomainAttributes" @@ -1479,8 +1765,23 @@ func (c *SES) GetIdentityMailFromDomainAttributesRequest(input *GetIdentityMailF // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityMailFromDomainAttributes func (c *SES) GetIdentityMailFromDomainAttributes(input *GetIdentityMailFromDomainAttributesInput) (*GetIdentityMailFromDomainAttributesOutput, error) { req, out := c.GetIdentityMailFromDomainAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetIdentityMailFromDomainAttributesWithContext is the same as GetIdentityMailFromDomainAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetIdentityMailFromDomainAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetIdentityMailFromDomainAttributesWithContext(ctx aws.Context, input *GetIdentityMailFromDomainAttributesInput, opts ...request.Option) (*GetIdentityMailFromDomainAttributesOutput, error) { + req, out := c.GetIdentityMailFromDomainAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetIdentityNotificationAttributes = "GetIdentityNotificationAttributes" @@ -1546,8 +1847,23 @@ func (c *SES) GetIdentityNotificationAttributesRequest(input *GetIdentityNotific // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityNotificationAttributes func (c *SES) GetIdentityNotificationAttributes(input *GetIdentityNotificationAttributesInput) (*GetIdentityNotificationAttributesOutput, error) { req, out := c.GetIdentityNotificationAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetIdentityNotificationAttributesWithContext is the same as GetIdentityNotificationAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetIdentityNotificationAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetIdentityNotificationAttributesWithContext(ctx aws.Context, input *GetIdentityNotificationAttributesInput, opts ...request.Option) (*GetIdentityNotificationAttributesOutput, error) { + req, out := c.GetIdentityNotificationAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetIdentityPolicies = "GetIdentityPolicies" @@ -1618,8 +1934,23 @@ func (c *SES) GetIdentityPoliciesRequest(input *GetIdentityPoliciesInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityPolicies func (c *SES) GetIdentityPolicies(input *GetIdentityPoliciesInput) (*GetIdentityPoliciesOutput, error) { req, out := c.GetIdentityPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetIdentityPoliciesWithContext is the same as GetIdentityPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See GetIdentityPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetIdentityPoliciesWithContext(ctx aws.Context, input *GetIdentityPoliciesInput, opts ...request.Option) (*GetIdentityPoliciesOutput, error) { + req, out := c.GetIdentityPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetIdentityVerificationAttributes = "GetIdentityVerificationAttributes" @@ -1683,8 +2014,23 @@ func (c *SES) GetIdentityVerificationAttributesRequest(input *GetIdentityVerific // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityVerificationAttributes func (c *SES) GetIdentityVerificationAttributes(input *GetIdentityVerificationAttributesInput) (*GetIdentityVerificationAttributesOutput, error) { req, out := c.GetIdentityVerificationAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetIdentityVerificationAttributesWithContext is the same as GetIdentityVerificationAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetIdentityVerificationAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetIdentityVerificationAttributesWithContext(ctx aws.Context, input *GetIdentityVerificationAttributesInput, opts ...request.Option) (*GetIdentityVerificationAttributesOutput, error) { + req, out := c.GetIdentityVerificationAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSendQuota = "GetSendQuota" @@ -1745,8 +2091,23 @@ func (c *SES) GetSendQuotaRequest(input *GetSendQuotaInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendQuota func (c *SES) GetSendQuota(input *GetSendQuotaInput) (*GetSendQuotaOutput, error) { req, out := c.GetSendQuotaRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSendQuotaWithContext is the same as GetSendQuota with the addition of +// the ability to pass a context and additional request options. +// +// See GetSendQuota for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSendQuotaWithContext(ctx aws.Context, input *GetSendQuotaInput, opts ...request.Option) (*GetSendQuotaOutput, error) { + req, out := c.GetSendQuotaRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSendStatistics = "GetSendStatistics" @@ -1810,8 +2171,23 @@ func (c *SES) GetSendStatisticsRequest(input *GetSendStatisticsInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendStatistics func (c *SES) GetSendStatistics(input *GetSendStatisticsInput) (*GetSendStatisticsOutput, error) { req, out := c.GetSendStatisticsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSendStatisticsWithContext is the same as GetSendStatistics with the addition of +// the ability to pass a context and additional request options. +// +// See GetSendStatistics for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSendStatisticsWithContext(ctx aws.Context, input *GetSendStatisticsInput, opts ...request.Option) (*GetSendStatisticsOutput, error) { + req, out := c.GetSendStatisticsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListConfigurationSets = "ListConfigurationSets" @@ -1876,8 +2252,23 @@ func (c *SES) ListConfigurationSetsRequest(input *ListConfigurationSetsInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListConfigurationSets func (c *SES) ListConfigurationSets(input *ListConfigurationSetsInput) (*ListConfigurationSetsOutput, error) { req, out := c.ListConfigurationSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListConfigurationSetsWithContext is the same as ListConfigurationSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListConfigurationSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListConfigurationSetsWithContext(ctx aws.Context, input *ListConfigurationSetsInput, opts ...request.Option) (*ListConfigurationSetsOutput, error) { + req, out := c.ListConfigurationSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListIdentities = "ListIdentities" @@ -1945,8 +2336,23 @@ func (c *SES) ListIdentitiesRequest(input *ListIdentitiesInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentities func (c *SES) ListIdentities(input *ListIdentitiesInput) (*ListIdentitiesOutput, error) { req, out := c.ListIdentitiesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListIdentitiesWithContext is the same as ListIdentities with the addition of +// the ability to pass a context and additional request options. +// +// See ListIdentities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListIdentitiesWithContext(ctx aws.Context, input *ListIdentitiesInput, opts ...request.Option) (*ListIdentitiesOutput, error) { + req, out := c.ListIdentitiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListIdentitiesPages iterates over the pages of a ListIdentities operation, @@ -1966,12 +2372,37 @@ func (c *SES) ListIdentities(input *ListIdentitiesInput) (*ListIdentitiesOutput, // return pageNum <= 3 // }) // -func (c *SES) ListIdentitiesPages(input *ListIdentitiesInput, fn func(p *ListIdentitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListIdentitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListIdentitiesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListIdentitiesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListIdentitiesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListIdentitiesOutput), !p.HasNextPage()) + } + return p.Err() } const opListIdentityPolicies = "ListIdentityPolicies" @@ -2041,8 +2472,23 @@ func (c *SES) ListIdentityPoliciesRequest(input *ListIdentityPoliciesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentityPolicies func (c *SES) ListIdentityPolicies(input *ListIdentityPoliciesInput) (*ListIdentityPoliciesOutput, error) { req, out := c.ListIdentityPoliciesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListIdentityPoliciesWithContext is the same as ListIdentityPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListIdentityPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListIdentityPoliciesWithContext(ctx aws.Context, input *ListIdentityPoliciesInput, opts ...request.Option) (*ListIdentityPoliciesOutput, error) { + req, out := c.ListIdentityPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListReceiptFilters = "ListReceiptFilters" @@ -2106,8 +2552,23 @@ func (c *SES) ListReceiptFiltersRequest(input *ListReceiptFiltersInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptFilters func (c *SES) ListReceiptFilters(input *ListReceiptFiltersInput) (*ListReceiptFiltersOutput, error) { req, out := c.ListReceiptFiltersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListReceiptFiltersWithContext is the same as ListReceiptFilters with the addition of +// the ability to pass a context and additional request options. +// +// See ListReceiptFilters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListReceiptFiltersWithContext(ctx aws.Context, input *ListReceiptFiltersInput, opts ...request.Option) (*ListReceiptFiltersOutput, error) { + req, out := c.ListReceiptFiltersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListReceiptRuleSets = "ListReceiptRuleSets" @@ -2174,8 +2635,23 @@ func (c *SES) ListReceiptRuleSetsRequest(input *ListReceiptRuleSetsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptRuleSets func (c *SES) ListReceiptRuleSets(input *ListReceiptRuleSetsInput) (*ListReceiptRuleSetsOutput, error) { req, out := c.ListReceiptRuleSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListReceiptRuleSetsWithContext is the same as ListReceiptRuleSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListReceiptRuleSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListReceiptRuleSetsWithContext(ctx aws.Context, input *ListReceiptRuleSetsInput, opts ...request.Option) (*ListReceiptRuleSetsOutput, error) { + req, out := c.ListReceiptRuleSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListVerifiedEmailAddresses = "ListVerifiedEmailAddresses" @@ -2239,8 +2715,23 @@ func (c *SES) ListVerifiedEmailAddressesRequest(input *ListVerifiedEmailAddresse // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListVerifiedEmailAddresses func (c *SES) ListVerifiedEmailAddresses(input *ListVerifiedEmailAddressesInput) (*ListVerifiedEmailAddressesOutput, error) { req, out := c.ListVerifiedEmailAddressesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListVerifiedEmailAddressesWithContext is the same as ListVerifiedEmailAddresses with the addition of +// the ability to pass a context and additional request options. +// +// See ListVerifiedEmailAddresses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListVerifiedEmailAddressesWithContext(ctx aws.Context, input *ListVerifiedEmailAddressesInput, opts ...request.Option) (*ListVerifiedEmailAddressesOutput, error) { + req, out := c.ListVerifiedEmailAddressesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutIdentityPolicy = "PutIdentityPolicy" @@ -2315,8 +2806,23 @@ func (c *SES) PutIdentityPolicyRequest(input *PutIdentityPolicyInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/PutIdentityPolicy func (c *SES) PutIdentityPolicy(input *PutIdentityPolicyInput) (*PutIdentityPolicyOutput, error) { req, out := c.PutIdentityPolicyRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutIdentityPolicyWithContext is the same as PutIdentityPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutIdentityPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutIdentityPolicyWithContext(ctx aws.Context, input *PutIdentityPolicyInput, opts ...request.Option) (*PutIdentityPolicyOutput, error) { + req, out := c.PutIdentityPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReorderReceiptRuleSet = "ReorderReceiptRuleSet" @@ -2392,8 +2898,23 @@ func (c *SES) ReorderReceiptRuleSetRequest(input *ReorderReceiptRuleSetInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReorderReceiptRuleSet func (c *SES) ReorderReceiptRuleSet(input *ReorderReceiptRuleSetInput) (*ReorderReceiptRuleSetOutput, error) { req, out := c.ReorderReceiptRuleSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReorderReceiptRuleSetWithContext is the same as ReorderReceiptRuleSet with the addition of +// the ability to pass a context and additional request options. +// +// See ReorderReceiptRuleSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ReorderReceiptRuleSetWithContext(ctx aws.Context, input *ReorderReceiptRuleSetInput, opts ...request.Option) (*ReorderReceiptRuleSetOutput, error) { + req, out := c.ReorderReceiptRuleSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSendBounce = "SendBounce" @@ -2468,8 +2989,23 @@ func (c *SES) SendBounceRequest(input *SendBounceInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendBounce func (c *SES) SendBounce(input *SendBounceInput) (*SendBounceOutput, error) { req, out := c.SendBounceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SendBounceWithContext is the same as SendBounce with the addition of +// the ability to pass a context and additional request options. +// +// See SendBounce for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SendBounceWithContext(ctx aws.Context, input *SendBounceInput, opts ...request.Option) (*SendBounceOutput, error) { + req, out := c.SendBounceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSendEmail = "SendEmail" @@ -2567,8 +3103,23 @@ func (c *SES) SendEmailRequest(input *SendEmailInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendEmail func (c *SES) SendEmail(input *SendEmailInput) (*SendEmailOutput, error) { req, out := c.SendEmailRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SendEmailWithContext is the same as SendEmail with the addition of +// the ability to pass a context and additional request options. +// +// See SendEmail for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SendEmailWithContext(ctx aws.Context, input *SendEmailInput, opts ...request.Option) (*SendEmailOutput, error) { + req, out := c.SendEmailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSendRawEmail = "SendRawEmail" @@ -2698,8 +3249,23 @@ func (c *SES) SendRawEmailRequest(input *SendRawEmailInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendRawEmail func (c *SES) SendRawEmail(input *SendRawEmailInput) (*SendRawEmailOutput, error) { req, out := c.SendRawEmailRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SendRawEmailWithContext is the same as SendRawEmail with the addition of +// the ability to pass a context and additional request options. +// +// See SendRawEmail for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SendRawEmailWithContext(ctx aws.Context, input *SendRawEmailInput, opts ...request.Option) (*SendRawEmailOutput, error) { + req, out := c.SendRawEmailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetActiveReceiptRuleSet = "SetActiveReceiptRuleSet" @@ -2771,8 +3337,23 @@ func (c *SES) SetActiveReceiptRuleSetRequest(input *SetActiveReceiptRuleSetInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetActiveReceiptRuleSet func (c *SES) SetActiveReceiptRuleSet(input *SetActiveReceiptRuleSetInput) (*SetActiveReceiptRuleSetOutput, error) { req, out := c.SetActiveReceiptRuleSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetActiveReceiptRuleSetWithContext is the same as SetActiveReceiptRuleSet with the addition of +// the ability to pass a context and additional request options. +// +// See SetActiveReceiptRuleSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetActiveReceiptRuleSetWithContext(ctx aws.Context, input *SetActiveReceiptRuleSetInput, opts ...request.Option) (*SetActiveReceiptRuleSetOutput, error) { + req, out := c.SetActiveReceiptRuleSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetIdentityDkimEnabled = "SetIdentityDkimEnabled" @@ -2847,8 +3428,23 @@ func (c *SES) SetIdentityDkimEnabledRequest(input *SetIdentityDkimEnabledInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityDkimEnabled func (c *SES) SetIdentityDkimEnabled(input *SetIdentityDkimEnabledInput) (*SetIdentityDkimEnabledOutput, error) { req, out := c.SetIdentityDkimEnabledRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetIdentityDkimEnabledWithContext is the same as SetIdentityDkimEnabled with the addition of +// the ability to pass a context and additional request options. +// +// See SetIdentityDkimEnabled for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetIdentityDkimEnabledWithContext(ctx aws.Context, input *SetIdentityDkimEnabledInput, opts ...request.Option) (*SetIdentityDkimEnabledOutput, error) { + req, out := c.SetIdentityDkimEnabledRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetIdentityFeedbackForwardingEnabled = "SetIdentityFeedbackForwardingEnabled" @@ -2918,8 +3514,23 @@ func (c *SES) SetIdentityFeedbackForwardingEnabledRequest(input *SetIdentityFeed // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityFeedbackForwardingEnabled func (c *SES) SetIdentityFeedbackForwardingEnabled(input *SetIdentityFeedbackForwardingEnabledInput) (*SetIdentityFeedbackForwardingEnabledOutput, error) { req, out := c.SetIdentityFeedbackForwardingEnabledRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetIdentityFeedbackForwardingEnabledWithContext is the same as SetIdentityFeedbackForwardingEnabled with the addition of +// the ability to pass a context and additional request options. +// +// See SetIdentityFeedbackForwardingEnabled for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetIdentityFeedbackForwardingEnabledWithContext(ctx aws.Context, input *SetIdentityFeedbackForwardingEnabledInput, opts ...request.Option) (*SetIdentityFeedbackForwardingEnabledOutput, error) { + req, out := c.SetIdentityFeedbackForwardingEnabledRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetIdentityHeadersInNotificationsEnabled = "SetIdentityHeadersInNotificationsEnabled" @@ -2985,8 +3596,23 @@ func (c *SES) SetIdentityHeadersInNotificationsEnabledRequest(input *SetIdentity // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityHeadersInNotificationsEnabled func (c *SES) SetIdentityHeadersInNotificationsEnabled(input *SetIdentityHeadersInNotificationsEnabledInput) (*SetIdentityHeadersInNotificationsEnabledOutput, error) { req, out := c.SetIdentityHeadersInNotificationsEnabledRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetIdentityHeadersInNotificationsEnabledWithContext is the same as SetIdentityHeadersInNotificationsEnabled with the addition of +// the ability to pass a context and additional request options. +// +// See SetIdentityHeadersInNotificationsEnabled for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetIdentityHeadersInNotificationsEnabledWithContext(ctx aws.Context, input *SetIdentityHeadersInNotificationsEnabledInput, opts ...request.Option) (*SetIdentityHeadersInNotificationsEnabledOutput, error) { + req, out := c.SetIdentityHeadersInNotificationsEnabledRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetIdentityMailFromDomain = "SetIdentityMailFromDomain" @@ -3053,8 +3679,23 @@ func (c *SES) SetIdentityMailFromDomainRequest(input *SetIdentityMailFromDomainI // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityMailFromDomain func (c *SES) SetIdentityMailFromDomain(input *SetIdentityMailFromDomainInput) (*SetIdentityMailFromDomainOutput, error) { req, out := c.SetIdentityMailFromDomainRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetIdentityMailFromDomainWithContext is the same as SetIdentityMailFromDomain with the addition of +// the ability to pass a context and additional request options. +// +// See SetIdentityMailFromDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetIdentityMailFromDomainWithContext(ctx aws.Context, input *SetIdentityMailFromDomainInput, opts ...request.Option) (*SetIdentityMailFromDomainOutput, error) { + req, out := c.SetIdentityMailFromDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetIdentityNotificationTopic = "SetIdentityNotificationTopic" @@ -3124,8 +3765,23 @@ func (c *SES) SetIdentityNotificationTopicRequest(input *SetIdentityNotification // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityNotificationTopic func (c *SES) SetIdentityNotificationTopic(input *SetIdentityNotificationTopicInput) (*SetIdentityNotificationTopicOutput, error) { req, out := c.SetIdentityNotificationTopicRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetIdentityNotificationTopicWithContext is the same as SetIdentityNotificationTopic with the addition of +// the ability to pass a context and additional request options. +// +// See SetIdentityNotificationTopic for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetIdentityNotificationTopicWithContext(ctx aws.Context, input *SetIdentityNotificationTopicInput, opts ...request.Option) (*SetIdentityNotificationTopicOutput, error) { + req, out := c.SetIdentityNotificationTopicRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetReceiptRulePosition = "SetReceiptRulePosition" @@ -3197,8 +3853,23 @@ func (c *SES) SetReceiptRulePositionRequest(input *SetReceiptRulePositionInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetReceiptRulePosition func (c *SES) SetReceiptRulePosition(input *SetReceiptRulePositionInput) (*SetReceiptRulePositionOutput, error) { req, out := c.SetReceiptRulePositionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetReceiptRulePositionWithContext is the same as SetReceiptRulePosition with the addition of +// the ability to pass a context and additional request options. +// +// See SetReceiptRulePosition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetReceiptRulePositionWithContext(ctx aws.Context, input *SetReceiptRulePositionInput, opts ...request.Option) (*SetReceiptRulePositionOutput, error) { + req, out := c.SetReceiptRulePositionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateConfigurationSetEventDestination = "UpdateConfigurationSetEventDestination" @@ -3284,8 +3955,23 @@ func (c *SES) UpdateConfigurationSetEventDestinationRequest(input *UpdateConfigu // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateConfigurationSetEventDestination func (c *SES) UpdateConfigurationSetEventDestination(input *UpdateConfigurationSetEventDestinationInput) (*UpdateConfigurationSetEventDestinationOutput, error) { req, out := c.UpdateConfigurationSetEventDestinationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateConfigurationSetEventDestinationWithContext is the same as UpdateConfigurationSetEventDestination with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateConfigurationSetEventDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateConfigurationSetEventDestinationWithContext(ctx aws.Context, input *UpdateConfigurationSetEventDestinationInput, opts ...request.Option) (*UpdateConfigurationSetEventDestinationOutput, error) { + req, out := c.UpdateConfigurationSetEventDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateReceiptRule = "UpdateReceiptRule" @@ -3378,8 +4064,23 @@ func (c *SES) UpdateReceiptRuleRequest(input *UpdateReceiptRuleInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateReceiptRule func (c *SES) UpdateReceiptRule(input *UpdateReceiptRuleInput) (*UpdateReceiptRuleOutput, error) { req, out := c.UpdateReceiptRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateReceiptRuleWithContext is the same as UpdateReceiptRule with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateReceiptRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateReceiptRuleWithContext(ctx aws.Context, input *UpdateReceiptRuleInput, opts ...request.Option) (*UpdateReceiptRuleOutput, error) { + req, out := c.UpdateReceiptRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opVerifyDomainDkim = "VerifyDomainDkim" @@ -3452,8 +4153,23 @@ func (c *SES) VerifyDomainDkimRequest(input *VerifyDomainDkimInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainDkim func (c *SES) VerifyDomainDkim(input *VerifyDomainDkimInput) (*VerifyDomainDkimOutput, error) { req, out := c.VerifyDomainDkimRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// VerifyDomainDkimWithContext is the same as VerifyDomainDkim with the addition of +// the ability to pass a context and additional request options. +// +// See VerifyDomainDkim for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) VerifyDomainDkimWithContext(ctx aws.Context, input *VerifyDomainDkimInput, opts ...request.Option) (*VerifyDomainDkimOutput, error) { + req, out := c.VerifyDomainDkimRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opVerifyDomainIdentity = "VerifyDomainIdentity" @@ -3514,8 +4230,23 @@ func (c *SES) VerifyDomainIdentityRequest(input *VerifyDomainIdentityInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainIdentity func (c *SES) VerifyDomainIdentity(input *VerifyDomainIdentityInput) (*VerifyDomainIdentityOutput, error) { req, out := c.VerifyDomainIdentityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// VerifyDomainIdentityWithContext is the same as VerifyDomainIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See VerifyDomainIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) VerifyDomainIdentityWithContext(ctx aws.Context, input *VerifyDomainIdentityInput, opts ...request.Option) (*VerifyDomainIdentityOutput, error) { + req, out := c.VerifyDomainIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opVerifyEmailAddress = "VerifyEmailAddress" @@ -3582,8 +4313,23 @@ func (c *SES) VerifyEmailAddressRequest(input *VerifyEmailAddressInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailAddress func (c *SES) VerifyEmailAddress(input *VerifyEmailAddressInput) (*VerifyEmailAddressOutput, error) { req, out := c.VerifyEmailAddressRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// VerifyEmailAddressWithContext is the same as VerifyEmailAddress with the addition of +// the ability to pass a context and additional request options. +// +// See VerifyEmailAddress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) VerifyEmailAddressWithContext(ctx aws.Context, input *VerifyEmailAddressInput, opts ...request.Option) (*VerifyEmailAddressOutput, error) { + req, out := c.VerifyEmailAddressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opVerifyEmailIdentity = "VerifyEmailIdentity" @@ -3645,8 +4391,23 @@ func (c *SES) VerifyEmailIdentityRequest(input *VerifyEmailIdentityInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailIdentity func (c *SES) VerifyEmailIdentity(input *VerifyEmailIdentityInput) (*VerifyEmailIdentityOutput, error) { req, out := c.VerifyEmailIdentityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// VerifyEmailIdentityWithContext is the same as VerifyEmailIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See VerifyEmailIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) VerifyEmailIdentityWithContext(ctx aws.Context, input *VerifyEmailIdentityInput, opts ...request.Option) (*VerifyEmailIdentityOutput, error) { + req, out := c.VerifyEmailIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // When included in a receipt rule, this action adds a header to the received diff --git a/vendor/github.com/aws/aws-sdk-go/service/ses/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ses/errors.go index 704f87e6a..ef5f15819 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ses/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ses diff --git a/vendor/github.com/aws/aws-sdk-go/service/ses/service.go b/vendor/github.com/aws/aws-sdk-go/service/ses/service.go index 187c1d6af..25b20e061 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ses/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ses diff --git a/vendor/github.com/aws/aws-sdk-go/service/ses/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ses/waiters.go index bf79344b8..6597b6b77 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ses/waiters.go @@ -1,9 +1,12 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ses import ( - "github.com/aws/aws-sdk-go/private/waiter" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ) // WaitUntilIdentityExists uses the Amazon SES API operation @@ -11,24 +14,43 @@ import ( // If the condition is not meet within the max attempt window an error will // be returned. func (c *SES) WaitUntilIdentityExists(input *GetIdentityVerificationAttributesInput) error { - waiterCfg := waiter.Config{ - Operation: "GetIdentityVerificationAttributes", - Delay: 3, + return c.WaitUntilIdentityExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilIdentityExistsWithContext is an extended version of WaitUntilIdentityExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) WaitUntilIdentityExistsWithContext(ctx aws.Context, input *GetIdentityVerificationAttributesInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilIdentityExists", MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(3 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "pathAll", - Argument: "VerificationAttributes.*.VerificationStatus", + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "VerificationAttributes.*.VerificationStatus", Expected: "Success", }, }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetIdentityVerificationAttributesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetIdentityVerificationAttributesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } + w.ApplyOptions(opts...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/sfn/api.go b/vendor/github.com/aws/aws-sdk-go/service/sfn/api.go index c6b207e1c..701c3fbfb 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sfn/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sfn/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package sfn provides a client for AWS Step Functions. package sfn @@ -6,6 +6,7 @@ package sfn import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -75,8 +76,23 @@ func (c *SFN) CreateActivityRequest(input *CreateActivityInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateActivity func (c *SFN) CreateActivity(input *CreateActivityInput) (*CreateActivityOutput, error) { req, out := c.CreateActivityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateActivityWithContext is the same as CreateActivity with the addition of +// the ability to pass a context and additional request options. +// +// See CreateActivity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateActivityWithContext(ctx aws.Context, input *CreateActivityInput, opts ...request.Option) (*CreateActivityOutput, error) { + req, out := c.CreateActivityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateStateMachine = "CreateStateMachine" @@ -157,8 +173,23 @@ func (c *SFN) CreateStateMachineRequest(input *CreateStateMachineInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateStateMachine func (c *SFN) CreateStateMachine(input *CreateStateMachineInput) (*CreateStateMachineOutput, error) { req, out := c.CreateStateMachineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateStateMachineWithContext is the same as CreateStateMachine with the addition of +// the ability to pass a context and additional request options. +// +// See CreateStateMachine for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateStateMachineWithContext(ctx aws.Context, input *CreateStateMachineInput, opts ...request.Option) (*CreateStateMachineOutput, error) { + req, out := c.CreateStateMachineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteActivity = "DeleteActivity" @@ -222,8 +253,23 @@ func (c *SFN) DeleteActivityRequest(input *DeleteActivityInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteActivity func (c *SFN) DeleteActivity(input *DeleteActivityInput) (*DeleteActivityOutput, error) { req, out := c.DeleteActivityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteActivityWithContext is the same as DeleteActivity with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteActivity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteActivityWithContext(ctx aws.Context, input *DeleteActivityInput, opts ...request.Option) (*DeleteActivityOutput, error) { + req, out := c.DeleteActivityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteStateMachine = "DeleteStateMachine" @@ -288,8 +334,23 @@ func (c *SFN) DeleteStateMachineRequest(input *DeleteStateMachineInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteStateMachine func (c *SFN) DeleteStateMachine(input *DeleteStateMachineInput) (*DeleteStateMachineOutput, error) { req, out := c.DeleteStateMachineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteStateMachineWithContext is the same as DeleteStateMachine with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteStateMachine for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteStateMachineWithContext(ctx aws.Context, input *DeleteStateMachineInput, opts ...request.Option) (*DeleteStateMachineOutput, error) { + req, out := c.DeleteStateMachineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeActivity = "DescribeActivity" @@ -356,8 +417,23 @@ func (c *SFN) DescribeActivityRequest(input *DescribeActivityInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeActivity func (c *SFN) DescribeActivity(input *DescribeActivityInput) (*DescribeActivityOutput, error) { req, out := c.DescribeActivityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeActivityWithContext is the same as DescribeActivity with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeActivity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeActivityWithContext(ctx aws.Context, input *DescribeActivityInput, opts ...request.Option) (*DescribeActivityOutput, error) { + req, out := c.DescribeActivityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeExecution = "DescribeExecution" @@ -424,8 +500,23 @@ func (c *SFN) DescribeExecutionRequest(input *DescribeExecutionInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeExecution func (c *SFN) DescribeExecution(input *DescribeExecutionInput) (*DescribeExecutionOutput, error) { req, out := c.DescribeExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeExecutionWithContext is the same as DescribeExecution with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeExecutionWithContext(ctx aws.Context, input *DescribeExecutionInput, opts ...request.Option) (*DescribeExecutionOutput, error) { + req, out := c.DescribeExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeStateMachine = "DescribeStateMachine" @@ -492,8 +583,23 @@ func (c *SFN) DescribeStateMachineRequest(input *DescribeStateMachineInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeStateMachine func (c *SFN) DescribeStateMachine(input *DescribeStateMachineInput) (*DescribeStateMachineOutput, error) { req, out := c.DescribeStateMachineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeStateMachineWithContext is the same as DescribeStateMachine with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStateMachine for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeStateMachineWithContext(ctx aws.Context, input *DescribeStateMachineInput, opts ...request.Option) (*DescribeStateMachineOutput, error) { + req, out := c.DescribeStateMachineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetActivityTask = "GetActivityTask" @@ -573,8 +679,23 @@ func (c *SFN) GetActivityTaskRequest(input *GetActivityTaskInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetActivityTask func (c *SFN) GetActivityTask(input *GetActivityTaskInput) (*GetActivityTaskOutput, error) { req, out := c.GetActivityTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetActivityTaskWithContext is the same as GetActivityTask with the addition of +// the ability to pass a context and additional request options. +// +// See GetActivityTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetActivityTaskWithContext(ctx aws.Context, input *GetActivityTaskInput, opts ...request.Option) (*GetActivityTaskOutput, error) { + req, out := c.GetActivityTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetExecutionHistory = "GetExecutionHistory" @@ -654,8 +775,23 @@ func (c *SFN) GetExecutionHistoryRequest(input *GetExecutionHistoryInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetExecutionHistory func (c *SFN) GetExecutionHistory(input *GetExecutionHistoryInput) (*GetExecutionHistoryOutput, error) { req, out := c.GetExecutionHistoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetExecutionHistoryWithContext is the same as GetExecutionHistory with the addition of +// the ability to pass a context and additional request options. +// +// See GetExecutionHistory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetExecutionHistoryWithContext(ctx aws.Context, input *GetExecutionHistoryInput, opts ...request.Option) (*GetExecutionHistoryOutput, error) { + req, out := c.GetExecutionHistoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // GetExecutionHistoryPages iterates over the pages of a GetExecutionHistory operation, @@ -675,12 +811,37 @@ func (c *SFN) GetExecutionHistory(input *GetExecutionHistoryInput) (*GetExecutio // return pageNum <= 3 // }) // -func (c *SFN) GetExecutionHistoryPages(input *GetExecutionHistoryInput, fn func(p *GetExecutionHistoryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetExecutionHistoryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetExecutionHistoryOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetExecutionHistoryInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetExecutionHistoryRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetExecutionHistoryOutput), !p.HasNextPage()) + } + return p.Err() } const opListActivities = "ListActivities" @@ -752,8 +913,23 @@ func (c *SFN) ListActivitiesRequest(input *ListActivitiesInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListActivities func (c *SFN) ListActivities(input *ListActivitiesInput) (*ListActivitiesOutput, error) { req, out := c.ListActivitiesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListActivitiesWithContext is the same as ListActivities with the addition of +// the ability to pass a context and additional request options. +// +// See ListActivities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListActivitiesWithContext(ctx aws.Context, input *ListActivitiesInput, opts ...request.Option) (*ListActivitiesOutput, error) { + req, out := c.ListActivitiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListActivitiesPages iterates over the pages of a ListActivities operation, @@ -773,12 +949,37 @@ func (c *SFN) ListActivities(input *ListActivitiesInput) (*ListActivitiesOutput, // return pageNum <= 3 // }) // -func (c *SFN) ListActivitiesPages(input *ListActivitiesInput, fn func(p *ListActivitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListActivitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListActivitiesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListActivitiesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListActivitiesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListActivitiesOutput), !p.HasNextPage()) + } + return p.Err() } const opListExecutions = "ListExecutions" @@ -856,8 +1057,23 @@ func (c *SFN) ListExecutionsRequest(input *ListExecutionsInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListExecutions func (c *SFN) ListExecutions(input *ListExecutionsInput) (*ListExecutionsOutput, error) { req, out := c.ListExecutionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListExecutionsWithContext is the same as ListExecutions with the addition of +// the ability to pass a context and additional request options. +// +// See ListExecutions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListExecutionsWithContext(ctx aws.Context, input *ListExecutionsInput, opts ...request.Option) (*ListExecutionsOutput, error) { + req, out := c.ListExecutionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListExecutionsPages iterates over the pages of a ListExecutions operation, @@ -877,12 +1093,37 @@ func (c *SFN) ListExecutions(input *ListExecutionsInput) (*ListExecutionsOutput, // return pageNum <= 3 // }) // -func (c *SFN) ListExecutionsPages(input *ListExecutionsInput, fn func(p *ListExecutionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListExecutionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListExecutionsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListExecutionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListExecutionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListExecutionsOutput), !p.HasNextPage()) + } + return p.Err() } const opListStateMachines = "ListStateMachines" @@ -954,8 +1195,23 @@ func (c *SFN) ListStateMachinesRequest(input *ListStateMachinesInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListStateMachines func (c *SFN) ListStateMachines(input *ListStateMachinesInput) (*ListStateMachinesOutput, error) { req, out := c.ListStateMachinesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListStateMachinesWithContext is the same as ListStateMachines with the addition of +// the ability to pass a context and additional request options. +// +// See ListStateMachines for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListStateMachinesWithContext(ctx aws.Context, input *ListStateMachinesInput, opts ...request.Option) (*ListStateMachinesOutput, error) { + req, out := c.ListStateMachinesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListStateMachinesPages iterates over the pages of a ListStateMachines operation, @@ -975,12 +1231,37 @@ func (c *SFN) ListStateMachines(input *ListStateMachinesInput) (*ListStateMachin // return pageNum <= 3 // }) // -func (c *SFN) ListStateMachinesPages(input *ListStateMachinesInput, fn func(p *ListStateMachinesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStateMachinesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStateMachinesOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListStateMachinesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListStateMachinesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListStateMachinesOutput), !p.HasNextPage()) + } + return p.Err() } const opSendTaskFailure = "SendTaskFailure" @@ -1048,8 +1329,23 @@ func (c *SFN) SendTaskFailureRequest(input *SendTaskFailureInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskFailure func (c *SFN) SendTaskFailure(input *SendTaskFailureInput) (*SendTaskFailureOutput, error) { req, out := c.SendTaskFailureRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SendTaskFailureWithContext is the same as SendTaskFailure with the addition of +// the ability to pass a context and additional request options. +// +// See SendTaskFailure for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SendTaskFailureWithContext(ctx aws.Context, input *SendTaskFailureInput, opts ...request.Option) (*SendTaskFailureOutput, error) { + req, out := c.SendTaskFailureRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSendTaskHeartbeat = "SendTaskHeartbeat" @@ -1129,8 +1425,23 @@ func (c *SFN) SendTaskHeartbeatRequest(input *SendTaskHeartbeatInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskHeartbeat func (c *SFN) SendTaskHeartbeat(input *SendTaskHeartbeatInput) (*SendTaskHeartbeatOutput, error) { req, out := c.SendTaskHeartbeatRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SendTaskHeartbeatWithContext is the same as SendTaskHeartbeat with the addition of +// the ability to pass a context and additional request options. +// +// See SendTaskHeartbeat for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SendTaskHeartbeatWithContext(ctx aws.Context, input *SendTaskHeartbeatInput, opts ...request.Option) (*SendTaskHeartbeatOutput, error) { + req, out := c.SendTaskHeartbeatRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSendTaskSuccess = "SendTaskSuccess" @@ -1202,8 +1513,23 @@ func (c *SFN) SendTaskSuccessRequest(input *SendTaskSuccessInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskSuccess func (c *SFN) SendTaskSuccess(input *SendTaskSuccessInput) (*SendTaskSuccessOutput, error) { req, out := c.SendTaskSuccessRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SendTaskSuccessWithContext is the same as SendTaskSuccess with the addition of +// the ability to pass a context and additional request options. +// +// See SendTaskSuccess for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SendTaskSuccessWithContext(ctx aws.Context, input *SendTaskSuccessInput, opts ...request.Option) (*SendTaskSuccessOutput, error) { + req, out := c.SendTaskSuccessRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartExecution = "StartExecution" @@ -1286,8 +1612,23 @@ func (c *SFN) StartExecutionRequest(input *StartExecutionInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StartExecution func (c *SFN) StartExecution(input *StartExecutionInput) (*StartExecutionOutput, error) { req, out := c.StartExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartExecutionWithContext is the same as StartExecution with the addition of +// the ability to pass a context and additional request options. +// +// See StartExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartExecutionWithContext(ctx aws.Context, input *StartExecutionInput, opts ...request.Option) (*StartExecutionOutput, error) { + req, out := c.StartExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopExecution = "StopExecution" @@ -1354,8 +1695,23 @@ func (c *SFN) StopExecutionRequest(input *StopExecutionInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StopExecution func (c *SFN) StopExecution(input *StopExecutionInput) (*StopExecutionOutput, error) { req, out := c.StopExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopExecutionWithContext is the same as StopExecution with the addition of +// the ability to pass a context and additional request options. +// +// See StopExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopExecutionWithContext(ctx aws.Context, input *StopExecutionInput, opts ...request.Option) (*StopExecutionOutput, error) { + req, out := c.StopExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ActivityFailedEventDetails diff --git a/vendor/github.com/aws/aws-sdk-go/service/sfn/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sfn/errors.go index 2a438eb66..ee02f364d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sfn/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sfn/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sfn diff --git a/vendor/github.com/aws/aws-sdk-go/service/sfn/service.go b/vendor/github.com/aws/aws-sdk-go/service/sfn/service.go index 77bf817e7..4ac61d379 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sfn/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sfn/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sfn diff --git a/vendor/github.com/aws/aws-sdk-go/service/simpledb/api.go b/vendor/github.com/aws/aws-sdk-go/service/simpledb/api.go index 9308ec37c..1a40436de 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/simpledb/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package simpledb provides a client for Amazon SimpleDB. package simpledb @@ -6,6 +6,7 @@ package simpledb import ( "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -37,8 +38,6 @@ const opBatchDeleteAttributes = "BatchDeleteAttributes" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchDeleteAttributes func (c *SimpleDB) BatchDeleteAttributesRequest(input *BatchDeleteAttributesInput) (req *request.Request, output *BatchDeleteAttributesOutput) { op := &request.Operation{ Name: opBatchDeleteAttributes, @@ -90,11 +89,25 @@ func (c *SimpleDB) BatchDeleteAttributesRequest(input *BatchDeleteAttributesInpu // // See the AWS API reference guide for Amazon SimpleDB's // API operation BatchDeleteAttributes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchDeleteAttributes func (c *SimpleDB) BatchDeleteAttributes(input *BatchDeleteAttributesInput) (*BatchDeleteAttributesOutput, error) { req, out := c.BatchDeleteAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchDeleteAttributesWithContext is the same as BatchDeleteAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See BatchDeleteAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchDeleteAttributesWithContext(ctx aws.Context, input *BatchDeleteAttributesInput, opts ...request.Option) (*BatchDeleteAttributesOutput, error) { + req, out := c.BatchDeleteAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opBatchPutAttributes = "BatchPutAttributes" @@ -122,8 +135,6 @@ const opBatchPutAttributes = "BatchPutAttributes" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchPutAttributes func (c *SimpleDB) BatchPutAttributesRequest(input *BatchPutAttributesInput) (req *request.Request, output *BatchPutAttributesOutput) { op := &request.Operation{ Name: opBatchPutAttributes, @@ -223,11 +234,25 @@ func (c *SimpleDB) BatchPutAttributesRequest(input *BatchPutAttributesInput) (re // * ErrCodeNumberSubmittedAttributesExceeded "NumberSubmittedAttributesExceeded" // Too many attributes exist in a single call. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchPutAttributes func (c *SimpleDB) BatchPutAttributes(input *BatchPutAttributesInput) (*BatchPutAttributesOutput, error) { req, out := c.BatchPutAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// BatchPutAttributesWithContext is the same as BatchPutAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See BatchPutAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) BatchPutAttributesWithContext(ctx aws.Context, input *BatchPutAttributesInput, opts ...request.Option) (*BatchPutAttributesOutput, error) { + req, out := c.BatchPutAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDomain = "CreateDomain" @@ -255,8 +280,6 @@ const opCreateDomain = "CreateDomain" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//CreateDomain func (c *SimpleDB) CreateDomainRequest(input *CreateDomainInput) (req *request.Request, output *CreateDomainOutput) { op := &request.Operation{ Name: opCreateDomain, @@ -304,11 +327,25 @@ func (c *SimpleDB) CreateDomainRequest(input *CreateDomainInput) (req *request.R // * ErrCodeNumberDomainsExceeded "NumberDomainsExceeded" // Too many domains exist per this account. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI//CreateDomain func (c *SimpleDB) CreateDomain(input *CreateDomainInput) (*CreateDomainOutput, error) { req, out := c.CreateDomainRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDomainWithContext is the same as CreateDomain with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDomainWithContext(ctx aws.Context, input *CreateDomainInput, opts ...request.Option) (*CreateDomainOutput, error) { + req, out := c.CreateDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAttributes = "DeleteAttributes" @@ -336,8 +373,6 @@ const opDeleteAttributes = "DeleteAttributes" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteAttributes func (c *SimpleDB) DeleteAttributesRequest(input *DeleteAttributesInput) (req *request.Request, output *DeleteAttributesOutput) { op := &request.Operation{ Name: opDeleteAttributes, @@ -390,11 +425,25 @@ func (c *SimpleDB) DeleteAttributesRequest(input *DeleteAttributesInput) (req *r // * ErrCodeAttributeDoesNotExist "AttributeDoesNotExist" // The specified attribute does not exist. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteAttributes func (c *SimpleDB) DeleteAttributes(input *DeleteAttributesInput) (*DeleteAttributesOutput, error) { req, out := c.DeleteAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAttributesWithContext is the same as DeleteAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAttributesWithContext(ctx aws.Context, input *DeleteAttributesInput, opts ...request.Option) (*DeleteAttributesOutput, error) { + req, out := c.DeleteAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDomain = "DeleteDomain" @@ -422,8 +471,6 @@ const opDeleteDomain = "DeleteDomain" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteDomain func (c *SimpleDB) DeleteDomainRequest(input *DeleteDomainInput) (req *request.Request, output *DeleteDomainOutput) { op := &request.Operation{ Name: opDeleteDomain, @@ -462,11 +509,25 @@ func (c *SimpleDB) DeleteDomainRequest(input *DeleteDomainInput) (req *request.R // * ErrCodeMissingParameter "MissingParameter" // The request must contain the specified missing parameter. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteDomain func (c *SimpleDB) DeleteDomain(input *DeleteDomainInput) (*DeleteDomainOutput, error) { req, out := c.DeleteDomainRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDomainWithContext is the same as DeleteDomain with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDomainWithContext(ctx aws.Context, input *DeleteDomainInput, opts ...request.Option) (*DeleteDomainOutput, error) { + req, out := c.DeleteDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDomainMetadata = "DomainMetadata" @@ -494,8 +555,6 @@ const opDomainMetadata = "DomainMetadata" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DomainMetadata func (c *SimpleDB) DomainMetadataRequest(input *DomainMetadataInput) (req *request.Request, output *DomainMetadataOutput) { op := &request.Operation{ Name: opDomainMetadata, @@ -532,11 +591,25 @@ func (c *SimpleDB) DomainMetadataRequest(input *DomainMetadataInput) (req *reque // * ErrCodeNoSuchDomain "NoSuchDomain" // The specified domain does not exist. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DomainMetadata func (c *SimpleDB) DomainMetadata(input *DomainMetadataInput) (*DomainMetadataOutput, error) { req, out := c.DomainMetadataRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DomainMetadataWithContext is the same as DomainMetadata with the addition of +// the ability to pass a context and additional request options. +// +// See DomainMetadata for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DomainMetadataWithContext(ctx aws.Context, input *DomainMetadataInput, opts ...request.Option) (*DomainMetadataOutput, error) { + req, out := c.DomainMetadataRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetAttributes = "GetAttributes" @@ -564,8 +637,6 @@ const opGetAttributes = "GetAttributes" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//GetAttributes func (c *SimpleDB) GetAttributesRequest(input *GetAttributesInput) (req *request.Request, output *GetAttributesOutput) { op := &request.Operation{ Name: opGetAttributes, @@ -612,11 +683,25 @@ func (c *SimpleDB) GetAttributesRequest(input *GetAttributesInput) (req *request // * ErrCodeNoSuchDomain "NoSuchDomain" // The specified domain does not exist. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI//GetAttributes func (c *SimpleDB) GetAttributes(input *GetAttributesInput) (*GetAttributesOutput, error) { req, out := c.GetAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAttributesWithContext is the same as GetAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAttributesWithContext(ctx aws.Context, input *GetAttributesInput, opts ...request.Option) (*GetAttributesOutput, error) { + req, out := c.GetAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListDomains = "ListDomains" @@ -644,8 +729,6 @@ const opListDomains = "ListDomains" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ListDomains func (c *SimpleDB) ListDomainsRequest(input *ListDomainsInput) (req *request.Request, output *ListDomainsOutput) { op := &request.Operation{ Name: opListDomains, @@ -691,11 +774,25 @@ func (c *SimpleDB) ListDomainsRequest(input *ListDomainsInput) (req *request.Req // * ErrCodeInvalidNextToken "InvalidNextToken" // The specified NextToken is not valid. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ListDomains func (c *SimpleDB) ListDomains(input *ListDomainsInput) (*ListDomainsOutput, error) { req, out := c.ListDomainsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDomainsWithContext is the same as ListDomains with the addition of +// the ability to pass a context and additional request options. +// +// See ListDomains for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDomainsWithContext(ctx aws.Context, input *ListDomainsInput, opts ...request.Option) (*ListDomainsOutput, error) { + req, out := c.ListDomainsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListDomainsPages iterates over the pages of a ListDomains operation, @@ -715,12 +812,37 @@ func (c *SimpleDB) ListDomains(input *ListDomainsInput) (*ListDomainsOutput, err // return pageNum <= 3 // }) // -func (c *SimpleDB) ListDomainsPages(input *ListDomainsInput, fn func(p *ListDomainsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDomainsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDomainsOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDomainsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDomainsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) + } + return p.Err() } const opPutAttributes = "PutAttributes" @@ -748,8 +870,6 @@ const opPutAttributes = "PutAttributes" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//PutAttributes func (c *SimpleDB) PutAttributesRequest(input *PutAttributesInput) (req *request.Request, output *PutAttributesOutput) { op := &request.Operation{ Name: opPutAttributes, @@ -831,11 +951,25 @@ func (c *SimpleDB) PutAttributesRequest(input *PutAttributesInput) (req *request // * ErrCodeAttributeDoesNotExist "AttributeDoesNotExist" // The specified attribute does not exist. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI//PutAttributes func (c *SimpleDB) PutAttributes(input *PutAttributesInput) (*PutAttributesOutput, error) { req, out := c.PutAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutAttributesWithContext is the same as PutAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See PutAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutAttributesWithContext(ctx aws.Context, input *PutAttributesInput, opts ...request.Option) (*PutAttributesOutput, error) { + req, out := c.PutAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSelect = "Select" @@ -863,8 +997,6 @@ const opSelect = "Select" // if err == nil { // resp is now filled // fmt.Println(resp) // } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//Select func (c *SimpleDB) SelectRequest(input *SelectInput) (req *request.Request, output *SelectOutput) { op := &request.Operation{ Name: opSelect, @@ -937,11 +1069,25 @@ func (c *SimpleDB) SelectRequest(input *SelectInput) (req *request.Request, outp // * ErrCodeTooManyRequestedAttributes "TooManyRequestedAttributes" // Too many attributes requested. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI//Select func (c *SimpleDB) Select(input *SelectInput) (*SelectOutput, error) { req, out := c.SelectRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SelectWithContext is the same as Select with the addition of +// the ability to pass a context and additional request options. +// +// See Select for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SelectWithContext(ctx aws.Context, input *SelectInput, opts ...request.Option) (*SelectOutput, error) { + req, out := c.SelectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // SelectPages iterates over the pages of a Select operation, @@ -961,15 +1107,39 @@ func (c *SimpleDB) Select(input *SelectInput) (*SelectOutput, error) { // return pageNum <= 3 // }) // -func (c *SimpleDB) SelectPages(input *SelectInput, fn func(p *SelectOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.SelectRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*SelectOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SelectInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SelectRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*SelectOutput), !p.HasNextPage()) + } + return p.Err() } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//Attribute type Attribute struct { _ struct{} `type:"structure"` @@ -1022,7 +1192,6 @@ func (s *Attribute) SetValue(v string) *Attribute { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchDeleteAttributesRequest type BatchDeleteAttributesInput struct { _ struct{} `type:"structure"` @@ -1085,7 +1254,6 @@ func (s *BatchDeleteAttributesInput) SetItems(v []*DeletableItem) *BatchDeleteAt return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchDeleteAttributesOutput type BatchDeleteAttributesOutput struct { _ struct{} `type:"structure"` } @@ -1100,7 +1268,6 @@ func (s BatchDeleteAttributesOutput) GoString() string { return s.String() } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchPutAttributesRequest type BatchPutAttributesInput struct { _ struct{} `type:"structure"` @@ -1163,7 +1330,6 @@ func (s *BatchPutAttributesInput) SetItems(v []*ReplaceableItem) *BatchPutAttrib return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchPutAttributesOutput type BatchPutAttributesOutput struct { _ struct{} `type:"structure"` } @@ -1178,7 +1344,6 @@ func (s BatchPutAttributesOutput) GoString() string { return s.String() } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//CreateDomainRequest type CreateDomainInput struct { _ struct{} `type:"structure"` @@ -1218,7 +1383,6 @@ func (s *CreateDomainInput) SetDomainName(v string) *CreateDomainInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//CreateDomainOutput type CreateDomainOutput struct { _ struct{} `type:"structure"` } @@ -1233,7 +1397,6 @@ func (s CreateDomainOutput) GoString() string { return s.String() } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeletableAttribute type DeletableAttribute struct { _ struct{} `type:"structure"` @@ -1281,7 +1444,6 @@ func (s *DeletableAttribute) SetValue(v string) *DeletableAttribute { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeletableItem type DeletableItem struct { _ struct{} `type:"structure"` @@ -1336,7 +1498,6 @@ func (s *DeletableItem) SetName(v string) *DeletableItem { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteAttributesRequest type DeleteAttributesInput struct { _ struct{} `type:"structure"` @@ -1421,7 +1582,6 @@ func (s *DeleteAttributesInput) SetItemName(v string) *DeleteAttributesInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteAttributesOutput type DeleteAttributesOutput struct { _ struct{} `type:"structure"` } @@ -1436,7 +1596,6 @@ func (s DeleteAttributesOutput) GoString() string { return s.String() } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteDomainRequest type DeleteDomainInput struct { _ struct{} `type:"structure"` @@ -1475,7 +1634,6 @@ func (s *DeleteDomainInput) SetDomainName(v string) *DeleteDomainInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteDomainOutput type DeleteDomainOutput struct { _ struct{} `type:"structure"` } @@ -1490,7 +1648,6 @@ func (s DeleteDomainOutput) GoString() string { return s.String() } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DomainMetadataRequest type DomainMetadataInput struct { _ struct{} `type:"structure"` @@ -1529,7 +1686,6 @@ func (s *DomainMetadataInput) SetDomainName(v string) *DomainMetadataInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DomainMetadataResult type DomainMetadataOutput struct { _ struct{} `type:"structure"` @@ -1607,7 +1763,6 @@ func (s *DomainMetadataOutput) SetTimestamp(v int64) *DomainMetadataOutput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//GetAttributesRequest type GetAttributesInput struct { _ struct{} `type:"structure"` @@ -1679,7 +1834,6 @@ func (s *GetAttributesInput) SetItemName(v string) *GetAttributesInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//GetAttributesResult type GetAttributesOutput struct { _ struct{} `type:"structure"` @@ -1703,7 +1857,6 @@ func (s *GetAttributesOutput) SetAttributes(v []*Attribute) *GetAttributesOutput return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//Item type Item struct { _ struct{} `type:"structure"` @@ -1748,7 +1901,6 @@ func (s *Item) SetName(v string) *Item { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ListDomainsRequest type ListDomainsInput struct { _ struct{} `type:"structure"` @@ -1783,7 +1935,6 @@ func (s *ListDomainsInput) SetNextToken(v string) *ListDomainsInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ListDomainsResult type ListDomainsOutput struct { _ struct{} `type:"structure"` @@ -1817,7 +1968,6 @@ func (s *ListDomainsOutput) SetNextToken(v string) *ListDomainsOutput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//PutAttributesRequest type PutAttributesInput struct { _ struct{} `type:"structure"` @@ -1905,7 +2055,6 @@ func (s *PutAttributesInput) SetItemName(v string) *PutAttributesInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//PutAttributesOutput type PutAttributesOutput struct { _ struct{} `type:"structure"` } @@ -1920,7 +2069,6 @@ func (s PutAttributesOutput) GoString() string { return s.String() } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ReplaceableAttribute type ReplaceableAttribute struct { _ struct{} `type:"structure"` @@ -1983,7 +2131,6 @@ func (s *ReplaceableAttribute) SetValue(v string) *ReplaceableAttribute { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ReplaceableItem type ReplaceableItem struct { _ struct{} `type:"structure"` @@ -2046,7 +2193,6 @@ func (s *ReplaceableItem) SetName(v string) *ReplaceableItem { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//SelectRequest type SelectInput struct { _ struct{} `type:"structure"` @@ -2104,7 +2250,6 @@ func (s *SelectInput) SetSelectExpression(v string) *SelectInput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI//SelectResult type SelectOutput struct { _ struct{} `type:"structure"` @@ -2141,7 +2286,6 @@ func (s *SelectOutput) SetNextToken(v string) *SelectOutput { // condition is specified for a request, the data will only be updated if the // condition is satisfied. For example, if an attribute with a specific name // and value exists, or if a specific attribute doesn't exist. -// Please also see https://docs.aws.amazon.com/goto/WebAPI//UpdateCondition type UpdateCondition struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/simpledb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/simpledb/errors.go index f12143a0d..5fa4dd477 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/simpledb/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package simpledb diff --git a/vendor/github.com/aws/aws-sdk-go/service/simpledb/service.go b/vendor/github.com/aws/aws-sdk-go/service/simpledb/service.go index dd5bf1da3..f2bbf6af5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/simpledb/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package simpledb @@ -29,7 +29,6 @@ import ( // more information. // The service client's operations are safe to be used concurrently. // It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ type SimpleDB struct { *client.Client } diff --git a/vendor/github.com/aws/aws-sdk-go/service/sns/api.go b/vendor/github.com/aws/aws-sdk-go/service/sns/api.go index ee7f647e9..bec8fe5dd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sns/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package sns provides a client for Amazon Simple Notification Service. package sns @@ -6,6 +6,7 @@ package sns import ( "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -85,8 +86,23 @@ func (c *SNS) AddPermissionRequest(input *AddPermissionInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/AddPermission func (c *SNS) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) { req, out := c.AddPermissionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddPermissionWithContext is the same as AddPermission with the addition of +// the ability to pass a context and additional request options. +// +// See AddPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddPermissionWithContext(ctx aws.Context, input *AddPermissionInput, opts ...request.Option) (*AddPermissionOutput, error) { + req, out := c.AddPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCheckIfPhoneNumberIsOptedOut = "CheckIfPhoneNumberIsOptedOut" @@ -165,8 +181,23 @@ func (c *SNS) CheckIfPhoneNumberIsOptedOutRequest(input *CheckIfPhoneNumberIsOpt // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOut func (c *SNS) CheckIfPhoneNumberIsOptedOut(input *CheckIfPhoneNumberIsOptedOutInput) (*CheckIfPhoneNumberIsOptedOutOutput, error) { req, out := c.CheckIfPhoneNumberIsOptedOutRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CheckIfPhoneNumberIsOptedOutWithContext is the same as CheckIfPhoneNumberIsOptedOut with the addition of +// the ability to pass a context and additional request options. +// +// See CheckIfPhoneNumberIsOptedOut for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CheckIfPhoneNumberIsOptedOutWithContext(ctx aws.Context, input *CheckIfPhoneNumberIsOptedOutInput, opts ...request.Option) (*CheckIfPhoneNumberIsOptedOutOutput, error) { + req, out := c.CheckIfPhoneNumberIsOptedOutRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opConfirmSubscription = "ConfirmSubscription" @@ -246,8 +277,23 @@ func (c *SNS) ConfirmSubscriptionRequest(input *ConfirmSubscriptionInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscription func (c *SNS) ConfirmSubscription(input *ConfirmSubscriptionInput) (*ConfirmSubscriptionOutput, error) { req, out := c.ConfirmSubscriptionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ConfirmSubscriptionWithContext is the same as ConfirmSubscription with the addition of +// the ability to pass a context and additional request options. +// +// See ConfirmSubscription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ConfirmSubscriptionWithContext(ctx aws.Context, input *ConfirmSubscriptionInput, opts ...request.Option) (*ConfirmSubscriptionOutput, error) { + req, out := c.ConfirmSubscriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePlatformApplication = "CreatePlatformApplication" @@ -342,8 +388,23 @@ func (c *SNS) CreatePlatformApplicationRequest(input *CreatePlatformApplicationI // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformApplication func (c *SNS) CreatePlatformApplication(input *CreatePlatformApplicationInput) (*CreatePlatformApplicationOutput, error) { req, out := c.CreatePlatformApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePlatformApplicationWithContext is the same as CreatePlatformApplication with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePlatformApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreatePlatformApplicationWithContext(ctx aws.Context, input *CreatePlatformApplicationInput, opts ...request.Option) (*CreatePlatformApplicationOutput, error) { + req, out := c.CreatePlatformApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePlatformEndpoint = "CreatePlatformEndpoint" @@ -429,8 +490,23 @@ func (c *SNS) CreatePlatformEndpointRequest(input *CreatePlatformEndpointInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformEndpoint func (c *SNS) CreatePlatformEndpoint(input *CreatePlatformEndpointInput) (*CreatePlatformEndpointOutput, error) { req, out := c.CreatePlatformEndpointRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePlatformEndpointWithContext is the same as CreatePlatformEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePlatformEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreatePlatformEndpointWithContext(ctx aws.Context, input *CreatePlatformEndpointInput, opts ...request.Option) (*CreatePlatformEndpointOutput, error) { + req, out := c.CreatePlatformEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateTopic = "CreateTopic" @@ -507,8 +583,23 @@ func (c *SNS) CreateTopicRequest(input *CreateTopicInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopic func (c *SNS) CreateTopic(input *CreateTopicInput) (*CreateTopicOutput, error) { req, out := c.CreateTopicRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateTopicWithContext is the same as CreateTopic with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTopic for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateTopicWithContext(ctx aws.Context, input *CreateTopicInput, opts ...request.Option) (*CreateTopicOutput, error) { + req, out := c.CreateTopicRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteEndpoint = "DeleteEndpoint" @@ -585,8 +676,23 @@ func (c *SNS) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteEndpoint func (c *SNS) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) { req, out := c.DeleteEndpointRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteEndpointWithContext is the same as DeleteEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteEndpointWithContext(ctx aws.Context, input *DeleteEndpointInput, opts ...request.Option) (*DeleteEndpointOutput, error) { + req, out := c.DeleteEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePlatformApplication = "DeletePlatformApplication" @@ -660,8 +766,23 @@ func (c *SNS) DeletePlatformApplicationRequest(input *DeletePlatformApplicationI // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeletePlatformApplication func (c *SNS) DeletePlatformApplication(input *DeletePlatformApplicationInput) (*DeletePlatformApplicationOutput, error) { req, out := c.DeletePlatformApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePlatformApplicationWithContext is the same as DeletePlatformApplication with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePlatformApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeletePlatformApplicationWithContext(ctx aws.Context, input *DeletePlatformApplicationInput, opts ...request.Option) (*DeletePlatformApplicationOutput, error) { + req, out := c.DeletePlatformApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteTopic = "DeleteTopic" @@ -739,8 +860,23 @@ func (c *SNS) DeleteTopicRequest(input *DeleteTopicInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteTopic func (c *SNS) DeleteTopic(input *DeleteTopicInput) (*DeleteTopicOutput, error) { req, out := c.DeleteTopicRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteTopicWithContext is the same as DeleteTopic with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTopic for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteTopicWithContext(ctx aws.Context, input *DeleteTopicInput, opts ...request.Option) (*DeleteTopicOutput, error) { + req, out := c.DeleteTopicRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetEndpointAttributes = "GetEndpointAttributes" @@ -815,8 +951,23 @@ func (c *SNS) GetEndpointAttributesRequest(input *GetEndpointAttributesInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetEndpointAttributes func (c *SNS) GetEndpointAttributes(input *GetEndpointAttributesInput) (*GetEndpointAttributesOutput, error) { req, out := c.GetEndpointAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetEndpointAttributesWithContext is the same as GetEndpointAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetEndpointAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetEndpointAttributesWithContext(ctx aws.Context, input *GetEndpointAttributesInput, opts ...request.Option) (*GetEndpointAttributesOutput, error) { + req, out := c.GetEndpointAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPlatformApplicationAttributes = "GetPlatformApplicationAttributes" @@ -891,8 +1042,23 @@ func (c *SNS) GetPlatformApplicationAttributesRequest(input *GetPlatformApplicat // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetPlatformApplicationAttributes func (c *SNS) GetPlatformApplicationAttributes(input *GetPlatformApplicationAttributesInput) (*GetPlatformApplicationAttributesOutput, error) { req, out := c.GetPlatformApplicationAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPlatformApplicationAttributesWithContext is the same as GetPlatformApplicationAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetPlatformApplicationAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetPlatformApplicationAttributesWithContext(ctx aws.Context, input *GetPlatformApplicationAttributesInput, opts ...request.Option) (*GetPlatformApplicationAttributesOutput, error) { + req, out := c.GetPlatformApplicationAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSMSAttributes = "GetSMSAttributes" @@ -968,8 +1134,23 @@ func (c *SNS) GetSMSAttributesRequest(input *GetSMSAttributesInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSMSAttributes func (c *SNS) GetSMSAttributes(input *GetSMSAttributesInput) (*GetSMSAttributesOutput, error) { req, out := c.GetSMSAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSMSAttributesWithContext is the same as GetSMSAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetSMSAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSMSAttributesWithContext(ctx aws.Context, input *GetSMSAttributesInput, opts ...request.Option) (*GetSMSAttributesOutput, error) { + req, out := c.GetSMSAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSubscriptionAttributes = "GetSubscriptionAttributes" @@ -1042,8 +1223,23 @@ func (c *SNS) GetSubscriptionAttributesRequest(input *GetSubscriptionAttributesI // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSubscriptionAttributes func (c *SNS) GetSubscriptionAttributes(input *GetSubscriptionAttributesInput) (*GetSubscriptionAttributesOutput, error) { req, out := c.GetSubscriptionAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSubscriptionAttributesWithContext is the same as GetSubscriptionAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetSubscriptionAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSubscriptionAttributesWithContext(ctx aws.Context, input *GetSubscriptionAttributesInput, opts ...request.Option) (*GetSubscriptionAttributesOutput, error) { + req, out := c.GetSubscriptionAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetTopicAttributes = "GetTopicAttributes" @@ -1117,8 +1313,23 @@ func (c *SNS) GetTopicAttributesRequest(input *GetTopicAttributesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetTopicAttributes func (c *SNS) GetTopicAttributes(input *GetTopicAttributesInput) (*GetTopicAttributesOutput, error) { req, out := c.GetTopicAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetTopicAttributesWithContext is the same as GetTopicAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetTopicAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetTopicAttributesWithContext(ctx aws.Context, input *GetTopicAttributesInput, opts ...request.Option) (*GetTopicAttributesOutput, error) { + req, out := c.GetTopicAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListEndpointsByPlatformApplication = "ListEndpointsByPlatformApplication" @@ -1204,8 +1415,23 @@ func (c *SNS) ListEndpointsByPlatformApplicationRequest(input *ListEndpointsByPl // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListEndpointsByPlatformApplication func (c *SNS) ListEndpointsByPlatformApplication(input *ListEndpointsByPlatformApplicationInput) (*ListEndpointsByPlatformApplicationOutput, error) { req, out := c.ListEndpointsByPlatformApplicationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListEndpointsByPlatformApplicationWithContext is the same as ListEndpointsByPlatformApplication with the addition of +// the ability to pass a context and additional request options. +// +// See ListEndpointsByPlatformApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListEndpointsByPlatformApplicationWithContext(ctx aws.Context, input *ListEndpointsByPlatformApplicationInput, opts ...request.Option) (*ListEndpointsByPlatformApplicationOutput, error) { + req, out := c.ListEndpointsByPlatformApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListEndpointsByPlatformApplicationPages iterates over the pages of a ListEndpointsByPlatformApplication operation, @@ -1225,12 +1451,37 @@ func (c *SNS) ListEndpointsByPlatformApplication(input *ListEndpointsByPlatformA // return pageNum <= 3 // }) // -func (c *SNS) ListEndpointsByPlatformApplicationPages(input *ListEndpointsByPlatformApplicationInput, fn func(p *ListEndpointsByPlatformApplicationOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListEndpointsByPlatformApplicationRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListEndpointsByPlatformApplicationOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListEndpointsByPlatformApplicationInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListEndpointsByPlatformApplicationRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListEndpointsByPlatformApplicationOutput), !p.HasNextPage()) + } + return p.Err() } const opListPhoneNumbersOptedOut = "ListPhoneNumbersOptedOut" @@ -1312,8 +1563,23 @@ func (c *SNS) ListPhoneNumbersOptedOutRequest(input *ListPhoneNumbersOptedOutInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPhoneNumbersOptedOut func (c *SNS) ListPhoneNumbersOptedOut(input *ListPhoneNumbersOptedOutInput) (*ListPhoneNumbersOptedOutOutput, error) { req, out := c.ListPhoneNumbersOptedOutRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPhoneNumbersOptedOutWithContext is the same as ListPhoneNumbersOptedOut with the addition of +// the ability to pass a context and additional request options. +// +// See ListPhoneNumbersOptedOut for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPhoneNumbersOptedOutWithContext(ctx aws.Context, input *ListPhoneNumbersOptedOutInput, opts ...request.Option) (*ListPhoneNumbersOptedOutOutput, error) { + req, out := c.ListPhoneNumbersOptedOutRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListPlatformApplications = "ListPlatformApplications" @@ -1396,8 +1662,23 @@ func (c *SNS) ListPlatformApplicationsRequest(input *ListPlatformApplicationsInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPlatformApplications func (c *SNS) ListPlatformApplications(input *ListPlatformApplicationsInput) (*ListPlatformApplicationsOutput, error) { req, out := c.ListPlatformApplicationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListPlatformApplicationsWithContext is the same as ListPlatformApplications with the addition of +// the ability to pass a context and additional request options. +// +// See ListPlatformApplications for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListPlatformApplicationsWithContext(ctx aws.Context, input *ListPlatformApplicationsInput, opts ...request.Option) (*ListPlatformApplicationsOutput, error) { + req, out := c.ListPlatformApplicationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListPlatformApplicationsPages iterates over the pages of a ListPlatformApplications operation, @@ -1417,12 +1698,37 @@ func (c *SNS) ListPlatformApplications(input *ListPlatformApplicationsInput) (*L // return pageNum <= 3 // }) // -func (c *SNS) ListPlatformApplicationsPages(input *ListPlatformApplicationsInput, fn func(p *ListPlatformApplicationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPlatformApplicationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPlatformApplicationsOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPlatformApplicationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPlatformApplicationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPlatformApplicationsOutput), !p.HasNextPage()) + } + return p.Err() } const opListSubscriptions = "ListSubscriptions" @@ -1501,8 +1807,23 @@ func (c *SNS) ListSubscriptionsRequest(input *ListSubscriptionsInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptions func (c *SNS) ListSubscriptions(input *ListSubscriptionsInput) (*ListSubscriptionsOutput, error) { req, out := c.ListSubscriptionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListSubscriptionsWithContext is the same as ListSubscriptions with the addition of +// the ability to pass a context and additional request options. +// +// See ListSubscriptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListSubscriptionsWithContext(ctx aws.Context, input *ListSubscriptionsInput, opts ...request.Option) (*ListSubscriptionsOutput, error) { + req, out := c.ListSubscriptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListSubscriptionsPages iterates over the pages of a ListSubscriptions operation, @@ -1522,12 +1843,37 @@ func (c *SNS) ListSubscriptions(input *ListSubscriptionsInput) (*ListSubscriptio // return pageNum <= 3 // }) // -func (c *SNS) ListSubscriptionsPages(input *ListSubscriptionsInput, fn func(p *ListSubscriptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListSubscriptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListSubscriptionsOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListSubscriptionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListSubscriptionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListSubscriptionsOutput), !p.HasNextPage()) + } + return p.Err() } const opListSubscriptionsByTopic = "ListSubscriptionsByTopic" @@ -1609,8 +1955,23 @@ func (c *SNS) ListSubscriptionsByTopicRequest(input *ListSubscriptionsByTopicInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptionsByTopic func (c *SNS) ListSubscriptionsByTopic(input *ListSubscriptionsByTopicInput) (*ListSubscriptionsByTopicOutput, error) { req, out := c.ListSubscriptionsByTopicRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListSubscriptionsByTopicWithContext is the same as ListSubscriptionsByTopic with the addition of +// the ability to pass a context and additional request options. +// +// See ListSubscriptionsByTopic for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListSubscriptionsByTopicWithContext(ctx aws.Context, input *ListSubscriptionsByTopicInput, opts ...request.Option) (*ListSubscriptionsByTopicOutput, error) { + req, out := c.ListSubscriptionsByTopicRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListSubscriptionsByTopicPages iterates over the pages of a ListSubscriptionsByTopic operation, @@ -1630,12 +1991,37 @@ func (c *SNS) ListSubscriptionsByTopic(input *ListSubscriptionsByTopicInput) (*L // return pageNum <= 3 // }) // -func (c *SNS) ListSubscriptionsByTopicPages(input *ListSubscriptionsByTopicInput, fn func(p *ListSubscriptionsByTopicOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListSubscriptionsByTopicRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListSubscriptionsByTopicOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListSubscriptionsByTopicInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListSubscriptionsByTopicRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListSubscriptionsByTopicOutput), !p.HasNextPage()) + } + return p.Err() } const opListTopics = "ListTopics" @@ -1713,8 +2099,23 @@ func (c *SNS) ListTopicsRequest(input *ListTopicsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListTopics func (c *SNS) ListTopics(input *ListTopicsInput) (*ListTopicsOutput, error) { req, out := c.ListTopicsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTopicsWithContext is the same as ListTopics with the addition of +// the ability to pass a context and additional request options. +// +// See ListTopics for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTopicsWithContext(ctx aws.Context, input *ListTopicsInput, opts ...request.Option) (*ListTopicsOutput, error) { + req, out := c.ListTopicsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListTopicsPages iterates over the pages of a ListTopics operation, @@ -1734,12 +2135,37 @@ func (c *SNS) ListTopics(input *ListTopicsInput) (*ListTopicsOutput, error) { // return pageNum <= 3 // }) // -func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(p *ListTopicsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTopicsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTopicsOutput), lastPage) - }) +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. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTopicsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTopicsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListTopicsOutput), !p.HasNextPage()) + } + return p.Err() } const opOptInPhoneNumber = "OptInPhoneNumber" @@ -1816,8 +2242,23 @@ func (c *SNS) OptInPhoneNumberRequest(input *OptInPhoneNumberInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/OptInPhoneNumber func (c *SNS) OptInPhoneNumber(input *OptInPhoneNumberInput) (*OptInPhoneNumberOutput, error) { req, out := c.OptInPhoneNumberRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// OptInPhoneNumberWithContext is the same as OptInPhoneNumber with the addition of +// the ability to pass a context and additional request options. +// +// See OptInPhoneNumber for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) OptInPhoneNumberWithContext(ctx aws.Context, input *OptInPhoneNumberInput, opts ...request.Option) (*OptInPhoneNumberOutput, error) { + req, out := c.OptInPhoneNumberRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPublish = "Publish" @@ -1910,8 +2351,23 @@ func (c *SNS) PublishRequest(input *PublishInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Publish func (c *SNS) Publish(input *PublishInput) (*PublishOutput, error) { req, out := c.PublishRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PublishWithContext is the same as Publish with the addition of +// the ability to pass a context and additional request options. +// +// See Publish for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PublishWithContext(ctx aws.Context, input *PublishInput, opts ...request.Option) (*PublishOutput, error) { + req, out := c.PublishRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemovePermission = "RemovePermission" @@ -1986,8 +2442,23 @@ func (c *SNS) RemovePermissionRequest(input *RemovePermissionInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/RemovePermission func (c *SNS) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { req, out := c.RemovePermissionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemovePermissionWithContext is the same as RemovePermission with the addition of +// the ability to pass a context and additional request options. +// +// See RemovePermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) { + req, out := c.RemovePermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetEndpointAttributes = "SetEndpointAttributes" @@ -2064,8 +2535,23 @@ func (c *SNS) SetEndpointAttributesRequest(input *SetEndpointAttributesInput) (r // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetEndpointAttributes func (c *SNS) SetEndpointAttributes(input *SetEndpointAttributesInput) (*SetEndpointAttributesOutput, error) { req, out := c.SetEndpointAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetEndpointAttributesWithContext is the same as SetEndpointAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See SetEndpointAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetEndpointAttributesWithContext(ctx aws.Context, input *SetEndpointAttributesInput, opts ...request.Option) (*SetEndpointAttributesOutput, error) { + req, out := c.SetEndpointAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetPlatformApplicationAttributes = "SetPlatformApplicationAttributes" @@ -2144,8 +2630,23 @@ func (c *SNS) SetPlatformApplicationAttributesRequest(input *SetPlatformApplicat // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetPlatformApplicationAttributes func (c *SNS) SetPlatformApplicationAttributes(input *SetPlatformApplicationAttributesInput) (*SetPlatformApplicationAttributesOutput, error) { req, out := c.SetPlatformApplicationAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetPlatformApplicationAttributesWithContext is the same as SetPlatformApplicationAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See SetPlatformApplicationAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetPlatformApplicationAttributesWithContext(ctx aws.Context, input *SetPlatformApplicationAttributesInput, opts ...request.Option) (*SetPlatformApplicationAttributesOutput, error) { + req, out := c.SetPlatformApplicationAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetSMSAttributes = "SetSMSAttributes" @@ -2225,8 +2726,23 @@ func (c *SNS) SetSMSAttributesRequest(input *SetSMSAttributesInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSMSAttributes func (c *SNS) SetSMSAttributes(input *SetSMSAttributesInput) (*SetSMSAttributesOutput, error) { req, out := c.SetSMSAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetSMSAttributesWithContext is the same as SetSMSAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See SetSMSAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetSMSAttributesWithContext(ctx aws.Context, input *SetSMSAttributesInput, opts ...request.Option) (*SetSMSAttributesOutput, error) { + req, out := c.SetSMSAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetSubscriptionAttributes = "SetSubscriptionAttributes" @@ -2301,8 +2817,23 @@ func (c *SNS) SetSubscriptionAttributesRequest(input *SetSubscriptionAttributesI // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSubscriptionAttributes func (c *SNS) SetSubscriptionAttributes(input *SetSubscriptionAttributesInput) (*SetSubscriptionAttributesOutput, error) { req, out := c.SetSubscriptionAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetSubscriptionAttributesWithContext is the same as SetSubscriptionAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See SetSubscriptionAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetSubscriptionAttributesWithContext(ctx aws.Context, input *SetSubscriptionAttributesInput, opts ...request.Option) (*SetSubscriptionAttributesOutput, error) { + req, out := c.SetSubscriptionAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetTopicAttributes = "SetTopicAttributes" @@ -2377,8 +2908,23 @@ func (c *SNS) SetTopicAttributesRequest(input *SetTopicAttributesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetTopicAttributes func (c *SNS) SetTopicAttributes(input *SetTopicAttributesInput) (*SetTopicAttributesOutput, error) { req, out := c.SetTopicAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetTopicAttributesWithContext is the same as SetTopicAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See SetTopicAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SetTopicAttributesWithContext(ctx aws.Context, input *SetTopicAttributesInput, opts ...request.Option) (*SetTopicAttributesOutput, error) { + req, out := c.SetTopicAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSubscribe = "Subscribe" @@ -2457,8 +3003,23 @@ func (c *SNS) SubscribeRequest(input *SubscribeInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Subscribe func (c *SNS) Subscribe(input *SubscribeInput) (*SubscribeOutput, error) { req, out := c.SubscribeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SubscribeWithContext is the same as Subscribe with the addition of +// the ability to pass a context and additional request options. +// +// See Subscribe for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SubscribeWithContext(ctx aws.Context, input *SubscribeInput, opts ...request.Option) (*SubscribeOutput, error) { + req, out := c.SubscribeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUnsubscribe = "Unsubscribe" @@ -2538,8 +3099,23 @@ func (c *SNS) UnsubscribeRequest(input *UnsubscribeInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Unsubscribe func (c *SNS) Unsubscribe(input *UnsubscribeInput) (*UnsubscribeOutput, error) { req, out := c.UnsubscribeRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UnsubscribeWithContext is the same as Unsubscribe with the addition of +// the ability to pass a context and additional request options. +// +// See Unsubscribe for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UnsubscribeWithContext(ctx aws.Context, input *UnsubscribeInput, opts ...request.Option) (*UnsubscribeOutput, error) { + req, out := c.UnsubscribeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/AddPermissionInput diff --git a/vendor/github.com/aws/aws-sdk-go/service/sns/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sns/errors.go index c6e3dbe20..60e503f25 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sns/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sns diff --git a/vendor/github.com/aws/aws-sdk-go/service/sns/service.go b/vendor/github.com/aws/aws-sdk-go/service/sns/service.go index 6bb73fa7c..8c735f5a5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sns/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sns diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go index 207ef6d49..3fea4687d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package sqs provides a client for Amazon Simple Queue Service. package sqs @@ -6,6 +6,7 @@ package sqs import ( "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" @@ -97,8 +98,23 @@ func (c *SQS) AddPermissionRequest(input *AddPermissionInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermission func (c *SQS) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) { req, out := c.AddPermissionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddPermissionWithContext is the same as AddPermission with the addition of +// the ability to pass a context and additional request options. +// +// See AddPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) AddPermissionWithContext(ctx aws.Context, input *AddPermissionInput, opts ...request.Option) (*AddPermissionOutput, error) { + req, out := c.AddPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opChangeMessageVisibility = "ChangeMessageVisibility" @@ -203,8 +219,23 @@ func (c *SQS) ChangeMessageVisibilityRequest(input *ChangeMessageVisibilityInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibility func (c *SQS) ChangeMessageVisibility(input *ChangeMessageVisibilityInput) (*ChangeMessageVisibilityOutput, error) { req, out := c.ChangeMessageVisibilityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ChangeMessageVisibilityWithContext is the same as ChangeMessageVisibility with the addition of +// the ability to pass a context and additional request options. +// +// See ChangeMessageVisibility for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ChangeMessageVisibilityWithContext(ctx aws.Context, input *ChangeMessageVisibilityInput, opts ...request.Option) (*ChangeMessageVisibilityOutput, error) { + req, out := c.ChangeMessageVisibilityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opChangeMessageVisibilityBatch = "ChangeMessageVisibilityBatch" @@ -292,8 +323,23 @@ func (c *SQS) ChangeMessageVisibilityBatchRequest(input *ChangeMessageVisibility // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatch func (c *SQS) ChangeMessageVisibilityBatch(input *ChangeMessageVisibilityBatchInput) (*ChangeMessageVisibilityBatchOutput, error) { req, out := c.ChangeMessageVisibilityBatchRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ChangeMessageVisibilityBatchWithContext is the same as ChangeMessageVisibilityBatch with the addition of +// the ability to pass a context and additional request options. +// +// See ChangeMessageVisibilityBatch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ChangeMessageVisibilityBatchWithContext(ctx aws.Context, input *ChangeMessageVisibilityBatchInput, opts ...request.Option) (*ChangeMessageVisibilityBatchOutput, error) { + req, out := c.ChangeMessageVisibilityBatchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateQueue = "CreateQueue" @@ -403,8 +449,23 @@ func (c *SQS) CreateQueueRequest(input *CreateQueueInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueue func (c *SQS) CreateQueue(input *CreateQueueInput) (*CreateQueueOutput, error) { req, out := c.CreateQueueRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateQueueWithContext is the same as CreateQueue with the addition of +// the ability to pass a context and additional request options. +// +// See CreateQueue for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) CreateQueueWithContext(ctx aws.Context, input *CreateQueueInput, opts ...request.Option) (*CreateQueueOutput, error) { + req, out := c.CreateQueueRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteMessage = "DeleteMessage" @@ -492,8 +553,23 @@ func (c *SQS) DeleteMessageRequest(input *DeleteMessageInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessage func (c *SQS) DeleteMessage(input *DeleteMessageInput) (*DeleteMessageOutput, error) { req, out := c.DeleteMessageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteMessageWithContext is the same as DeleteMessage with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMessage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) DeleteMessageWithContext(ctx aws.Context, input *DeleteMessageInput, opts ...request.Option) (*DeleteMessageOutput, error) { + req, out := c.DeleteMessageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteMessageBatch = "DeleteMessageBatch" @@ -580,8 +656,23 @@ func (c *SQS) DeleteMessageBatchRequest(input *DeleteMessageBatchInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatch func (c *SQS) DeleteMessageBatch(input *DeleteMessageBatchInput) (*DeleteMessageBatchOutput, error) { req, out := c.DeleteMessageBatchRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteMessageBatchWithContext is the same as DeleteMessageBatch with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMessageBatch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) DeleteMessageBatchWithContext(ctx aws.Context, input *DeleteMessageBatchInput, opts ...request.Option) (*DeleteMessageBatchOutput, error) { + req, out := c.DeleteMessageBatchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteQueue = "DeleteQueue" @@ -654,8 +745,23 @@ func (c *SQS) DeleteQueueRequest(input *DeleteQueueInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueue func (c *SQS) DeleteQueue(input *DeleteQueueInput) (*DeleteQueueOutput, error) { req, out := c.DeleteQueueRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteQueueWithContext is the same as DeleteQueue with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteQueue for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) DeleteQueueWithContext(ctx aws.Context, input *DeleteQueueInput, opts ...request.Option) (*DeleteQueueOutput, error) { + req, out := c.DeleteQueueRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetQueueAttributes = "GetQueueAttributes" @@ -727,8 +833,23 @@ func (c *SQS) GetQueueAttributesRequest(input *GetQueueAttributesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributes func (c *SQS) GetQueueAttributes(input *GetQueueAttributesInput) (*GetQueueAttributesOutput, error) { req, out := c.GetQueueAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetQueueAttributesWithContext is the same as GetQueueAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetQueueAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) GetQueueAttributesWithContext(ctx aws.Context, input *GetQueueAttributesInput, opts ...request.Option) (*GetQueueAttributesOutput, error) { + req, out := c.GetQueueAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetQueueUrl = "GetQueueUrl" @@ -799,8 +920,23 @@ func (c *SQS) GetQueueUrlRequest(input *GetQueueUrlInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrl func (c *SQS) GetQueueUrl(input *GetQueueUrlInput) (*GetQueueUrlOutput, error) { req, out := c.GetQueueUrlRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetQueueUrlWithContext is the same as GetQueueUrl with the addition of +// the ability to pass a context and additional request options. +// +// See GetQueueUrl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) GetQueueUrlWithContext(ctx aws.Context, input *GetQueueUrlInput, opts ...request.Option) (*GetQueueUrlOutput, error) { + req, out := c.GetQueueUrlRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListDeadLetterSourceQueues = "ListDeadLetterSourceQueues" @@ -869,8 +1005,23 @@ func (c *SQS) ListDeadLetterSourceQueuesRequest(input *ListDeadLetterSourceQueue // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueues func (c *SQS) ListDeadLetterSourceQueues(input *ListDeadLetterSourceQueuesInput) (*ListDeadLetterSourceQueuesOutput, error) { req, out := c.ListDeadLetterSourceQueuesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDeadLetterSourceQueuesWithContext is the same as ListDeadLetterSourceQueues with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeadLetterSourceQueues for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ListDeadLetterSourceQueuesWithContext(ctx aws.Context, input *ListDeadLetterSourceQueuesInput, opts ...request.Option) (*ListDeadLetterSourceQueuesOutput, error) { + req, out := c.ListDeadLetterSourceQueuesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListQueues = "ListQueues" @@ -931,8 +1082,23 @@ func (c *SQS) ListQueuesRequest(input *ListQueuesInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueues func (c *SQS) ListQueues(input *ListQueuesInput) (*ListQueuesOutput, error) { req, out := c.ListQueuesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListQueuesWithContext is the same as ListQueues with the addition of +// the ability to pass a context and additional request options. +// +// See ListQueues for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ListQueuesWithContext(ctx aws.Context, input *ListQueuesInput, opts ...request.Option) (*ListQueuesOutput, error) { + req, out := c.ListQueuesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPurgeQueue = "PurgeQueue" @@ -1012,8 +1178,23 @@ func (c *SQS) PurgeQueueRequest(input *PurgeQueueInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueue func (c *SQS) PurgeQueue(input *PurgeQueueInput) (*PurgeQueueOutput, error) { req, out := c.PurgeQueueRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PurgeQueueWithContext is the same as PurgeQueue with the addition of +// the ability to pass a context and additional request options. +// +// See PurgeQueue for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) PurgeQueueWithContext(ctx aws.Context, input *PurgeQueueInput, opts ...request.Option) (*PurgeQueueOutput, error) { + req, out := c.PurgeQueueRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opReceiveMessage = "ReceiveMessage" @@ -1126,8 +1307,23 @@ func (c *SQS) ReceiveMessageRequest(input *ReceiveMessageInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessage func (c *SQS) ReceiveMessage(input *ReceiveMessageInput) (*ReceiveMessageOutput, error) { req, out := c.ReceiveMessageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ReceiveMessageWithContext is the same as ReceiveMessage with the addition of +// the ability to pass a context and additional request options. +// +// See ReceiveMessage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ReceiveMessageWithContext(ctx aws.Context, input *ReceiveMessageInput, opts ...request.Option) (*ReceiveMessageOutput, error) { + req, out := c.ReceiveMessageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemovePermission = "RemovePermission" @@ -1189,8 +1385,23 @@ func (c *SQS) RemovePermissionRequest(input *RemovePermissionInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermission func (c *SQS) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { req, out := c.RemovePermissionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemovePermissionWithContext is the same as RemovePermission with the addition of +// the ability to pass a context and additional request options. +// +// See RemovePermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) { + req, out := c.RemovePermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSendMessage = "SendMessage" @@ -1276,8 +1487,23 @@ func (c *SQS) SendMessageRequest(input *SendMessageInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessage func (c *SQS) SendMessage(input *SendMessageInput) (*SendMessageOutput, error) { req, out := c.SendMessageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SendMessageWithContext is the same as SendMessage with the addition of +// the ability to pass a context and additional request options. +// +// See SendMessage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) SendMessageWithContext(ctx aws.Context, input *SendMessageInput, opts ...request.Option) (*SendMessageOutput, error) { + req, out := c.SendMessageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSendMessageBatch = "SendMessageBatch" @@ -1397,8 +1623,23 @@ func (c *SQS) SendMessageBatchRequest(input *SendMessageBatchInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatch func (c *SQS) SendMessageBatch(input *SendMessageBatchInput) (*SendMessageBatchOutput, error) { req, out := c.SendMessageBatchRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SendMessageBatchWithContext is the same as SendMessageBatch with the addition of +// the ability to pass a context and additional request options. +// +// See SendMessageBatch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) SendMessageBatchWithContext(ctx aws.Context, input *SendMessageBatchInput, opts ...request.Option) (*SendMessageBatchOutput, error) { + req, out := c.SendMessageBatchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSetQueueAttributes = "SetQueueAttributes" @@ -1471,8 +1712,23 @@ func (c *SQS) SetQueueAttributesRequest(input *SetQueueAttributesInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributes func (c *SQS) SetQueueAttributes(input *SetQueueAttributesInput) (*SetQueueAttributesOutput, error) { req, out := c.SetQueueAttributesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SetQueueAttributesWithContext is the same as SetQueueAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See SetQueueAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) SetQueueAttributesWithContext(ctx aws.Context, input *SetQueueAttributesInput, opts ...request.Option) (*SetQueueAttributesOutput, error) { + req, out := c.SetQueueAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermissionRequest diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go index d4f394e0e..722867d32 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sqs diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go index 7df1fbc7e..0fee951c5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sqs diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go b/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go index 56bbee8ee..bd233e4ed 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package ssm provides a client for Amazon Simple Systems Manager (SSM). package ssm @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -101,8 +102,23 @@ func (c *SSM) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AddTagsToResource func (c *SSM) AddTagsToResource(input *AddTagsToResourceInput) (*AddTagsToResourceOutput, error) { req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AddTagsToResourceWithContext is the same as AddTagsToResource with the addition of +// the ability to pass a context and additional request options. +// +// See AddTagsToResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AddTagsToResourceWithContext(ctx aws.Context, input *AddTagsToResourceInput, opts ...request.Option) (*AddTagsToResourceOutput, error) { + req, out := c.AddTagsToResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCancelCommand = "CancelCommand" @@ -171,12 +187,12 @@ func (c *SSM) CancelCommandRequest(input *CancelCommandInput) (req *request.Requ // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -187,8 +203,23 @@ func (c *SSM) CancelCommandRequest(input *CancelCommandInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CancelCommand func (c *SSM) CancelCommand(input *CancelCommandInput) (*CancelCommandOutput, error) { req, out := c.CancelCommandRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CancelCommandWithContext is the same as CancelCommand with the addition of +// the ability to pass a context and additional request options. +// +// See CancelCommand for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CancelCommandWithContext(ctx aws.Context, input *CancelCommandInput, opts ...request.Option) (*CancelCommandOutput, error) { + req, out := c.CancelCommandRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateActivation = "CreateActivation" @@ -239,10 +270,8 @@ func (c *SSM) CreateActivationRequest(input *CreateActivationInput) (req *reques // Registers your on-premises server or virtual machine with Amazon EC2 so that // you can manage these resources using Run Command. An on-premises server or // virtual machine that has been registered with EC2 is called a managed instance. -// For more information about activations, see Setting Up Managed Instances -// (Linux) (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managed-instances.html) -// or Setting Up Managed Instances (Windows) (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/managed-instances.html) -// in the Amazon EC2 User Guide. +// For more information about activations, see Setting Up Systems Manager in +// Hybrid Environments (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -258,8 +287,23 @@ func (c *SSM) CreateActivationRequest(input *CreateActivationInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateActivation func (c *SSM) CreateActivation(input *CreateActivationInput) (*CreateActivationOutput, error) { req, out := c.CreateActivationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateActivationWithContext is the same as CreateActivation with the addition of +// the ability to pass a context and additional request options. +// +// See CreateActivation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateActivationWithContext(ctx aws.Context, input *CreateActivationInput, opts ...request.Option) (*CreateActivationOutput, error) { + req, out := c.CreateActivationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAssociation = "CreateAssociation" @@ -307,11 +351,12 @@ func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *requ // CreateAssociation API operation for Amazon Simple Systems Manager (SSM). // -// Associates the specified SSM document with the specified instances or targets. +// Associates the specified Systems Manager document with the specified instances +// or targets. // -// When you associate an SSM document with one or more instances using instance -// IDs or tags, the SSM agent running on the instance processes the document -// and configures the instance as specified. +// When you associate a document with one or more instances using instance IDs +// or tags, the SSM Agent running on the instance processes the document and +// configures the instance as specified. // // If you associate a document with an instance that already has an associated // document, the system throws the AssociationAlreadyExists exception. @@ -344,19 +389,19 @@ func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *requ // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // // * ErrCodeUnsupportedPlatformType "UnsupportedPlatformType" // The document does not support the platform type of the given instance ID(s). -// For example, you sent an SSM document for a Windows instance to a Linux instance. +// For example, you sent an document for a Windows instance to a Linux instance. // // * ErrCodeInvalidOutputLocation "InvalidOutputLocation" // The output location is not valid or does not exist. @@ -375,8 +420,23 @@ func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociation func (c *SSM) CreateAssociation(input *CreateAssociationInput) (*CreateAssociationOutput, error) { req, out := c.CreateAssociationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAssociationWithContext is the same as CreateAssociation with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAssociation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAssociationWithContext(ctx aws.Context, input *CreateAssociationInput, opts ...request.Option) (*CreateAssociationOutput, error) { + req, out := c.CreateAssociationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateAssociationBatch = "CreateAssociationBatch" @@ -424,11 +484,12 @@ func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) // CreateAssociationBatch API operation for Amazon Simple Systems Manager (SSM). // -// Associates the specified SSM document with the specified instances or targets. +// Associates the specified Systems Manager document with the specified instances +// or targets. // -// When you associate an SSM document with one or more instances using instance -// IDs or tags, the SSM agent running on the instance processes the document -// and configures the instance as specified. +// When you associate a document with one or more instances using instance IDs +// or tags, the SSM Agent running on the instance processes the document and +// configures the instance as specified. // // If you associate a document with an instance that already has an associated // document, the system throws the AssociationAlreadyExists exception. @@ -455,12 +516,12 @@ func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -477,7 +538,7 @@ func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) // // * ErrCodeUnsupportedPlatformType "UnsupportedPlatformType" // The document does not support the platform type of the given instance ID(s). -// For example, you sent an SSM document for a Windows instance to a Linux instance. +// For example, you sent an document for a Windows instance to a Linux instance. // // * ErrCodeInvalidOutputLocation "InvalidOutputLocation" // The output location is not valid or does not exist. @@ -492,8 +553,23 @@ func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationBatch func (c *SSM) CreateAssociationBatch(input *CreateAssociationBatchInput) (*CreateAssociationBatchOutput, error) { req, out := c.CreateAssociationBatchRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateAssociationBatchWithContext is the same as CreateAssociationBatch with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAssociationBatch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateAssociationBatchWithContext(ctx aws.Context, input *CreateAssociationBatchInput, opts ...request.Option) (*CreateAssociationBatchOutput, error) { + req, out := c.CreateAssociationBatchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateDocument = "CreateDocument" @@ -541,10 +617,10 @@ func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) (req *request.Re // CreateDocument API operation for Amazon Simple Systems Manager (SSM). // -// Creates an SSM document. +// Creates a Systems Manager document. // -// After you create an SSM document, you can use CreateAssociation to associate -// it with one or more running instances. +// After you create a document, you can use CreateAssociation to associate it +// with one or more running instances. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -555,16 +631,16 @@ func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) (req *request.Re // // Returned Error Codes: // * ErrCodeDocumentAlreadyExists "DocumentAlreadyExists" -// The specified SSM document already exists. +// The specified document already exists. // // * ErrCodeMaxDocumentSizeExceeded "MaxDocumentSizeExceeded" -// The size limit of an SSM document is 64 KB. +// The size limit of a document is 64 KB. // // * ErrCodeInternalServerError "InternalServerError" // An error occurred on the server side. // // * ErrCodeInvalidDocumentContent "InvalidDocumentContent" -// The content for the SSM document is not valid. +// The content for the document is not valid. // // * ErrCodeDocumentLimitExceeded "DocumentLimitExceeded" // You can have at most 200 active SSM documents. @@ -575,8 +651,23 @@ func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateDocument func (c *SSM) CreateDocument(input *CreateDocumentInput) (*CreateDocumentOutput, error) { req, out := c.CreateDocumentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateDocumentWithContext is the same as CreateDocument with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDocument for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateDocumentWithContext(ctx aws.Context, input *CreateDocumentInput, opts ...request.Option) (*CreateDocumentOutput, error) { + req, out := c.CreateDocumentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateMaintenanceWindow = "CreateMaintenanceWindow" @@ -648,8 +739,23 @@ func (c *SSM) CreateMaintenanceWindowRequest(input *CreateMaintenanceWindowInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateMaintenanceWindow func (c *SSM) CreateMaintenanceWindow(input *CreateMaintenanceWindowInput) (*CreateMaintenanceWindowOutput, error) { req, out := c.CreateMaintenanceWindowRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateMaintenanceWindowWithContext is the same as CreateMaintenanceWindow with the addition of +// the ability to pass a context and additional request options. +// +// See CreateMaintenanceWindow for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreateMaintenanceWindowWithContext(ctx aws.Context, input *CreateMaintenanceWindowInput, opts ...request.Option) (*CreateMaintenanceWindowOutput, error) { + req, out := c.CreateMaintenanceWindowRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreatePatchBaseline = "CreatePatchBaseline" @@ -721,8 +827,23 @@ func (c *SSM) CreatePatchBaselineRequest(input *CreatePatchBaselineInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreatePatchBaseline func (c *SSM) CreatePatchBaseline(input *CreatePatchBaselineInput) (*CreatePatchBaselineOutput, error) { req, out := c.CreatePatchBaselineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreatePatchBaselineWithContext is the same as CreatePatchBaseline with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePatchBaseline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) CreatePatchBaselineWithContext(ctx aws.Context, input *CreatePatchBaselineInput, opts ...request.Option) (*CreatePatchBaselineOutput, error) { + req, out := c.CreatePatchBaselineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteActivation = "DeleteActivation" @@ -797,8 +918,23 @@ func (c *SSM) DeleteActivationRequest(input *DeleteActivationInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteActivation func (c *SSM) DeleteActivation(input *DeleteActivationInput) (*DeleteActivationOutput, error) { req, out := c.DeleteActivationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteActivationWithContext is the same as DeleteActivation with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteActivation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteActivationWithContext(ctx aws.Context, input *DeleteActivationInput, opts ...request.Option) (*DeleteActivationOutput, error) { + req, out := c.DeleteActivationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteAssociation = "DeleteAssociation" @@ -846,12 +982,12 @@ func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *requ // DeleteAssociation API operation for Amazon Simple Systems Manager (SSM). // -// Disassociates the specified SSM document from the specified instance. +// Disassociates the specified Systems Manager document from the specified instance. // -// When you disassociate an SSM document from an instance, it does not change -// the configuration of the instance. To change the configuration state of an -// instance after you disassociate a document, you must create a new document -// with the desired configuration and associate it with the instance. +// When you disassociate a document from an instance, it does not change the +// configuration of the instance. To change the configuration state of an instance +// after you disassociate a document, you must create a new document with the +// desired configuration and associate it with the instance. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -875,12 +1011,12 @@ func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *requ // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -892,8 +1028,23 @@ func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteAssociation func (c *SSM) DeleteAssociation(input *DeleteAssociationInput) (*DeleteAssociationOutput, error) { req, out := c.DeleteAssociationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteAssociationWithContext is the same as DeleteAssociation with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAssociation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteAssociationWithContext(ctx aws.Context, input *DeleteAssociationInput, opts ...request.Option) (*DeleteAssociationOutput, error) { + req, out := c.DeleteAssociationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteDocument = "DeleteDocument" @@ -941,9 +1092,10 @@ func (c *SSM) DeleteDocumentRequest(input *DeleteDocumentInput) (req *request.Re // DeleteDocument API operation for Amazon Simple Systems Manager (SSM). // -// Deletes the SSM document and all instance associations to the document. +// Deletes the Systems Manager document and all instance associations to the +// document. // -// Before you delete the SSM document, we recommend that you use DeleteAssociation +// Before you delete the document, we recommend that you use DeleteAssociation // to disassociate all instances that are associated with the document. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -965,14 +1117,29 @@ func (c *SSM) DeleteDocumentRequest(input *DeleteDocumentInput) (req *request.Re // sharing the document before you can delete it. // // * ErrCodeAssociatedInstances "AssociatedInstances" -// You must disassociate an SSM document from all instances before you can delete +// You must disassociate a document from all instances before you can delete // it. // // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteDocument func (c *SSM) DeleteDocument(input *DeleteDocumentInput) (*DeleteDocumentOutput, error) { req, out := c.DeleteDocumentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteDocumentWithContext is the same as DeleteDocument with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDocument for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteDocumentWithContext(ctx aws.Context, input *DeleteDocumentInput, opts ...request.Option) (*DeleteDocumentOutput, error) { + req, out := c.DeleteDocumentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteMaintenanceWindow = "DeleteMaintenanceWindow" @@ -1036,8 +1203,23 @@ func (c *SSM) DeleteMaintenanceWindowRequest(input *DeleteMaintenanceWindowInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteMaintenanceWindow func (c *SSM) DeleteMaintenanceWindow(input *DeleteMaintenanceWindowInput) (*DeleteMaintenanceWindowOutput, error) { req, out := c.DeleteMaintenanceWindowRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteMaintenanceWindowWithContext is the same as DeleteMaintenanceWindow with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMaintenanceWindow for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteMaintenanceWindowWithContext(ctx aws.Context, input *DeleteMaintenanceWindowInput, opts ...request.Option) (*DeleteMaintenanceWindowOutput, error) { + req, out := c.DeleteMaintenanceWindowRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteParameter = "DeleteParameter" @@ -1104,8 +1286,23 @@ func (c *SSM) DeleteParameterRequest(input *DeleteParameterInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteParameter func (c *SSM) DeleteParameter(input *DeleteParameterInput) (*DeleteParameterOutput, error) { req, out := c.DeleteParameterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteParameterWithContext is the same as DeleteParameter with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteParameter for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeleteParameterWithContext(ctx aws.Context, input *DeleteParameterInput, opts ...request.Option) (*DeleteParameterOutput, error) { + req, out := c.DeleteParameterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeletePatchBaseline = "DeletePatchBaseline" @@ -1173,8 +1370,23 @@ func (c *SSM) DeletePatchBaselineRequest(input *DeletePatchBaselineInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeletePatchBaseline func (c *SSM) DeletePatchBaseline(input *DeletePatchBaselineInput) (*DeletePatchBaselineOutput, error) { req, out := c.DeletePatchBaselineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeletePatchBaselineWithContext is the same as DeletePatchBaseline with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePatchBaseline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeletePatchBaselineWithContext(ctx aws.Context, input *DeletePatchBaselineInput, opts ...request.Option) (*DeletePatchBaselineOutput, error) { + req, out := c.DeletePatchBaselineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterManagedInstance = "DeregisterManagedInstance" @@ -1224,7 +1436,7 @@ func (c *SSM) DeregisterManagedInstanceRequest(input *DeregisterManagedInstanceI // // Removes the server or virtual machine from the list of registered servers. // You can reregister the instance again at any time. If you don’t plan to use -// Run Command on the server, we suggest uninstalling the SSM agent first. +// Run Command on the server, we suggest uninstalling the SSM Agent first. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1239,12 +1451,12 @@ func (c *SSM) DeregisterManagedInstanceRequest(input *DeregisterManagedInstanceI // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -1255,8 +1467,23 @@ func (c *SSM) DeregisterManagedInstanceRequest(input *DeregisterManagedInstanceI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterManagedInstance func (c *SSM) DeregisterManagedInstance(input *DeregisterManagedInstanceInput) (*DeregisterManagedInstanceOutput, error) { req, out := c.DeregisterManagedInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterManagedInstanceWithContext is the same as DeregisterManagedInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterManagedInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterManagedInstanceWithContext(ctx aws.Context, input *DeregisterManagedInstanceInput, opts ...request.Option) (*DeregisterManagedInstanceOutput, error) { + req, out := c.DeregisterManagedInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterPatchBaselineForPatchGroup = "DeregisterPatchBaselineForPatchGroup" @@ -1324,8 +1551,23 @@ func (c *SSM) DeregisterPatchBaselineForPatchGroupRequest(input *DeregisterPatch // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterPatchBaselineForPatchGroup func (c *SSM) DeregisterPatchBaselineForPatchGroup(input *DeregisterPatchBaselineForPatchGroupInput) (*DeregisterPatchBaselineForPatchGroupOutput, error) { req, out := c.DeregisterPatchBaselineForPatchGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterPatchBaselineForPatchGroupWithContext is the same as DeregisterPatchBaselineForPatchGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterPatchBaselineForPatchGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterPatchBaselineForPatchGroupWithContext(ctx aws.Context, input *DeregisterPatchBaselineForPatchGroupInput, opts ...request.Option) (*DeregisterPatchBaselineForPatchGroupOutput, error) { + req, out := c.DeregisterPatchBaselineForPatchGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterTargetFromMaintenanceWindow = "DeregisterTargetFromMaintenanceWindow" @@ -1393,8 +1635,23 @@ func (c *SSM) DeregisterTargetFromMaintenanceWindowRequest(input *DeregisterTarg // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTargetFromMaintenanceWindow func (c *SSM) DeregisterTargetFromMaintenanceWindow(input *DeregisterTargetFromMaintenanceWindowInput) (*DeregisterTargetFromMaintenanceWindowOutput, error) { req, out := c.DeregisterTargetFromMaintenanceWindowRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterTargetFromMaintenanceWindowWithContext is the same as DeregisterTargetFromMaintenanceWindow with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterTargetFromMaintenanceWindow for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterTargetFromMaintenanceWindowWithContext(ctx aws.Context, input *DeregisterTargetFromMaintenanceWindowInput, opts ...request.Option) (*DeregisterTargetFromMaintenanceWindowOutput, error) { + req, out := c.DeregisterTargetFromMaintenanceWindowRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeregisterTaskFromMaintenanceWindow = "DeregisterTaskFromMaintenanceWindow" @@ -1462,8 +1719,23 @@ func (c *SSM) DeregisterTaskFromMaintenanceWindowRequest(input *DeregisterTaskFr // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTaskFromMaintenanceWindow func (c *SSM) DeregisterTaskFromMaintenanceWindow(input *DeregisterTaskFromMaintenanceWindowInput) (*DeregisterTaskFromMaintenanceWindowOutput, error) { req, out := c.DeregisterTaskFromMaintenanceWindowRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeregisterTaskFromMaintenanceWindowWithContext is the same as DeregisterTaskFromMaintenanceWindow with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterTaskFromMaintenanceWindow for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DeregisterTaskFromMaintenanceWindowWithContext(ctx aws.Context, input *DeregisterTaskFromMaintenanceWindowInput, opts ...request.Option) (*DeregisterTaskFromMaintenanceWindowOutput, error) { + req, out := c.DeregisterTaskFromMaintenanceWindowRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeActivations = "DescribeActivations" @@ -1542,8 +1814,23 @@ func (c *SSM) DescribeActivationsRequest(input *DescribeActivationsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeActivations func (c *SSM) DescribeActivations(input *DescribeActivationsInput) (*DescribeActivationsOutput, error) { req, out := c.DescribeActivationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeActivationsWithContext is the same as DescribeActivations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeActivations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeActivationsWithContext(ctx aws.Context, input *DescribeActivationsInput, opts ...request.Option) (*DescribeActivationsOutput, error) { + req, out := c.DescribeActivationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeActivationsPages iterates over the pages of a DescribeActivations operation, @@ -1563,12 +1850,37 @@ func (c *SSM) DescribeActivations(input *DescribeActivationsInput) (*DescribeAct // return pageNum <= 3 // }) // -func (c *SSM) DescribeActivationsPages(input *DescribeActivationsInput, fn func(p *DescribeActivationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeActivationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeActivationsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeActivationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeActivationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeActivationsOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeAssociation = "DescribeAssociation" @@ -1616,7 +1928,8 @@ func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) (req * // DescribeAssociation API operation for Amazon Simple Systems Manager (SSM). // -// Describes the associations for the specified SSM document or instance. +// Describes the associations for the specified Systems Manager document or +// instance. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1640,12 +1953,12 @@ func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) (req * // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -1653,8 +1966,23 @@ func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociation func (c *SSM) DescribeAssociation(input *DescribeAssociationInput) (*DescribeAssociationOutput, error) { req, out := c.DescribeAssociationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAssociationWithContext is the same as DescribeAssociation with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAssociation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAssociationWithContext(ctx aws.Context, input *DescribeAssociationInput, opts ...request.Option) (*DescribeAssociationOutput, error) { + req, out := c.DescribeAssociationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAutomationExecutions = "DescribeAutomationExecutions" @@ -1721,8 +2049,23 @@ func (c *SSM) DescribeAutomationExecutionsRequest(input *DescribeAutomationExecu // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAutomationExecutions func (c *SSM) DescribeAutomationExecutions(input *DescribeAutomationExecutionsInput) (*DescribeAutomationExecutionsOutput, error) { req, out := c.DescribeAutomationExecutionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAutomationExecutionsWithContext is the same as DescribeAutomationExecutions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAutomationExecutions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAutomationExecutionsWithContext(ctx aws.Context, input *DescribeAutomationExecutionsInput, opts ...request.Option) (*DescribeAutomationExecutionsOutput, error) { + req, out := c.DescribeAutomationExecutionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeAvailablePatches = "DescribeAvailablePatches" @@ -1786,8 +2129,23 @@ func (c *SSM) DescribeAvailablePatchesRequest(input *DescribeAvailablePatchesInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAvailablePatches func (c *SSM) DescribeAvailablePatches(input *DescribeAvailablePatchesInput) (*DescribeAvailablePatchesOutput, error) { req, out := c.DescribeAvailablePatchesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeAvailablePatchesWithContext is the same as DescribeAvailablePatches with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAvailablePatches for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeAvailablePatchesWithContext(ctx aws.Context, input *DescribeAvailablePatchesInput, opts ...request.Option) (*DescribeAvailablePatchesOutput, error) { + req, out := c.DescribeAvailablePatchesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDocument = "DescribeDocument" @@ -1857,8 +2215,23 @@ func (c *SSM) DescribeDocumentRequest(input *DescribeDocumentInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocument func (c *SSM) DescribeDocument(input *DescribeDocumentInput) (*DescribeDocumentOutput, error) { req, out := c.DescribeDocumentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDocumentWithContext is the same as DescribeDocument with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDocument for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDocumentWithContext(ctx aws.Context, input *DescribeDocumentInput, opts ...request.Option) (*DescribeDocumentOutput, error) { + req, out := c.DescribeDocumentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeDocumentPermission = "DescribeDocumentPermission" @@ -1906,9 +2279,9 @@ func (c *SSM) DescribeDocumentPermissionRequest(input *DescribeDocumentPermissio // DescribeDocumentPermission API operation for Amazon Simple Systems Manager (SSM). // -// Describes the permissions for an SSM document. If you created the document, -// you are the owner. If a document is shared, it can either be shared privately -// (by specifying a user’s AWS account ID) or publicly (All). +// Describes the permissions for a Systems Manager document. If you created +// the document, you are the owner. If a document is shared, it can either be +// shared privately (by specifying a user’s AWS account ID) or publicly (All). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1931,8 +2304,23 @@ func (c *SSM) DescribeDocumentPermissionRequest(input *DescribeDocumentPermissio // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocumentPermission func (c *SSM) DescribeDocumentPermission(input *DescribeDocumentPermissionInput) (*DescribeDocumentPermissionOutput, error) { req, out := c.DescribeDocumentPermissionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeDocumentPermissionWithContext is the same as DescribeDocumentPermission with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDocumentPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeDocumentPermissionWithContext(ctx aws.Context, input *DescribeDocumentPermissionInput, opts ...request.Option) (*DescribeDocumentPermissionOutput, error) { + req, out := c.DescribeDocumentPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEffectiveInstanceAssociations = "DescribeEffectiveInstanceAssociations" @@ -1998,12 +2386,12 @@ func (c *SSM) DescribeEffectiveInstanceAssociationsRequest(input *DescribeEffect // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -2014,8 +2402,23 @@ func (c *SSM) DescribeEffectiveInstanceAssociationsRequest(input *DescribeEffect // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectiveInstanceAssociations func (c *SSM) DescribeEffectiveInstanceAssociations(input *DescribeEffectiveInstanceAssociationsInput) (*DescribeEffectiveInstanceAssociationsOutput, error) { req, out := c.DescribeEffectiveInstanceAssociationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEffectiveInstanceAssociationsWithContext is the same as DescribeEffectiveInstanceAssociations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEffectiveInstanceAssociations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEffectiveInstanceAssociationsWithContext(ctx aws.Context, input *DescribeEffectiveInstanceAssociationsInput, opts ...request.Option) (*DescribeEffectiveInstanceAssociationsOutput, error) { + req, out := c.DescribeEffectiveInstanceAssociationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeEffectivePatchesForPatchBaseline = "DescribeEffectivePatchesForPatchBaseline" @@ -2088,8 +2491,23 @@ func (c *SSM) DescribeEffectivePatchesForPatchBaselineRequest(input *DescribeEff // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectivePatchesForPatchBaseline func (c *SSM) DescribeEffectivePatchesForPatchBaseline(input *DescribeEffectivePatchesForPatchBaselineInput) (*DescribeEffectivePatchesForPatchBaselineOutput, error) { req, out := c.DescribeEffectivePatchesForPatchBaselineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeEffectivePatchesForPatchBaselineWithContext is the same as DescribeEffectivePatchesForPatchBaseline with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEffectivePatchesForPatchBaseline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeEffectivePatchesForPatchBaselineWithContext(ctx aws.Context, input *DescribeEffectivePatchesForPatchBaselineInput, opts ...request.Option) (*DescribeEffectivePatchesForPatchBaselineOutput, error) { + req, out := c.DescribeEffectivePatchesForPatchBaselineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeInstanceAssociationsStatus = "DescribeInstanceAssociationsStatus" @@ -2155,12 +2573,12 @@ func (c *SSM) DescribeInstanceAssociationsStatusRequest(input *DescribeInstanceA // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -2171,8 +2589,23 @@ func (c *SSM) DescribeInstanceAssociationsStatusRequest(input *DescribeInstanceA // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceAssociationsStatus func (c *SSM) DescribeInstanceAssociationsStatus(input *DescribeInstanceAssociationsStatusInput) (*DescribeInstanceAssociationsStatusOutput, error) { req, out := c.DescribeInstanceAssociationsStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstanceAssociationsStatusWithContext is the same as DescribeInstanceAssociationsStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstanceAssociationsStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstanceAssociationsStatusWithContext(ctx aws.Context, input *DescribeInstanceAssociationsStatusInput, opts ...request.Option) (*DescribeInstanceAssociationsStatusOutput, error) { + req, out := c.DescribeInstanceAssociationsStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeInstanceInformation = "DescribeInstanceInformation" @@ -2227,7 +2660,7 @@ func (c *SSM) DescribeInstanceInformationRequest(input *DescribeInstanceInformat // DescribeInstanceInformation API operation for Amazon Simple Systems Manager (SSM). // // Describes one or more of your instances. You can use this to get information -// about instances like the operating system platform, the SSM agent version +// about instances like the operating system platform, the SSM Agent version // (Linux), status etc. If you specify one or more instance IDs, it returns // information for those instances. If you do not specify instance IDs, it returns // information for all your instances. If you specify an instance ID that is @@ -2249,12 +2682,12 @@ func (c *SSM) DescribeInstanceInformationRequest(input *DescribeInstanceInformat // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -2271,8 +2704,23 @@ func (c *SSM) DescribeInstanceInformationRequest(input *DescribeInstanceInformat // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceInformation func (c *SSM) DescribeInstanceInformation(input *DescribeInstanceInformationInput) (*DescribeInstanceInformationOutput, error) { req, out := c.DescribeInstanceInformationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstanceInformationWithContext is the same as DescribeInstanceInformation with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstanceInformation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstanceInformationWithContext(ctx aws.Context, input *DescribeInstanceInformationInput, opts ...request.Option) (*DescribeInstanceInformationOutput, error) { + req, out := c.DescribeInstanceInformationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // DescribeInstanceInformationPages iterates over the pages of a DescribeInstanceInformation operation, @@ -2292,12 +2740,37 @@ func (c *SSM) DescribeInstanceInformation(input *DescribeInstanceInformationInpu // return pageNum <= 3 // }) // -func (c *SSM) DescribeInstanceInformationPages(input *DescribeInstanceInformationInput, fn func(p *DescribeInstanceInformationOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeInstanceInformationRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeInstanceInformationOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInstanceInformationInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceInformationRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeInstanceInformationOutput), !p.HasNextPage()) + } + return p.Err() } const opDescribeInstancePatchStates = "DescribeInstancePatchStates" @@ -2364,8 +2837,23 @@ func (c *SSM) DescribeInstancePatchStatesRequest(input *DescribeInstancePatchSta // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStates func (c *SSM) DescribeInstancePatchStates(input *DescribeInstancePatchStatesInput) (*DescribeInstancePatchStatesOutput, error) { req, out := c.DescribeInstancePatchStatesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstancePatchStatesWithContext is the same as DescribeInstancePatchStates with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstancePatchStates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstancePatchStatesWithContext(ctx aws.Context, input *DescribeInstancePatchStatesInput, opts ...request.Option) (*DescribeInstancePatchStatesOutput, error) { + req, out := c.DescribeInstancePatchStatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeInstancePatchStatesForPatchGroup = "DescribeInstancePatchStatesForPatchGroup" @@ -2437,8 +2925,23 @@ func (c *SSM) DescribeInstancePatchStatesForPatchGroupRequest(input *DescribeIns // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStatesForPatchGroup func (c *SSM) DescribeInstancePatchStatesForPatchGroup(input *DescribeInstancePatchStatesForPatchGroupInput) (*DescribeInstancePatchStatesForPatchGroupOutput, error) { req, out := c.DescribeInstancePatchStatesForPatchGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstancePatchStatesForPatchGroupWithContext is the same as DescribeInstancePatchStatesForPatchGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstancePatchStatesForPatchGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstancePatchStatesForPatchGroupWithContext(ctx aws.Context, input *DescribeInstancePatchStatesForPatchGroupInput, opts ...request.Option) (*DescribeInstancePatchStatesForPatchGroupOutput, error) { + req, out := c.DescribeInstancePatchStatesForPatchGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeInstancePatches = "DescribeInstancePatches" @@ -2505,12 +3008,12 @@ func (c *SSM) DescribeInstancePatchesRequest(input *DescribeInstancePatchesInput // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -2525,8 +3028,23 @@ func (c *SSM) DescribeInstancePatchesRequest(input *DescribeInstancePatchesInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatches func (c *SSM) DescribeInstancePatches(input *DescribeInstancePatchesInput) (*DescribeInstancePatchesOutput, error) { req, out := c.DescribeInstancePatchesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeInstancePatchesWithContext is the same as DescribeInstancePatches with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstancePatches for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeInstancePatchesWithContext(ctx aws.Context, input *DescribeInstancePatchesInput, opts ...request.Option) (*DescribeInstancePatchesOutput, error) { + req, out := c.DescribeInstancePatchesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMaintenanceWindowExecutionTaskInvocations = "DescribeMaintenanceWindowExecutionTaskInvocations" @@ -2595,8 +3113,23 @@ func (c *SSM) DescribeMaintenanceWindowExecutionTaskInvocationsRequest(input *De // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTaskInvocations func (c *SSM) DescribeMaintenanceWindowExecutionTaskInvocations(input *DescribeMaintenanceWindowExecutionTaskInvocationsInput) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) { req, out := c.DescribeMaintenanceWindowExecutionTaskInvocationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMaintenanceWindowExecutionTaskInvocationsWithContext is the same as DescribeMaintenanceWindowExecutionTaskInvocations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMaintenanceWindowExecutionTaskInvocations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMaintenanceWindowExecutionTaskInvocationsWithContext(ctx aws.Context, input *DescribeMaintenanceWindowExecutionTaskInvocationsInput, opts ...request.Option) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) { + req, out := c.DescribeMaintenanceWindowExecutionTaskInvocationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMaintenanceWindowExecutionTasks = "DescribeMaintenanceWindowExecutionTasks" @@ -2664,8 +3197,23 @@ func (c *SSM) DescribeMaintenanceWindowExecutionTasksRequest(input *DescribeMain // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTasks func (c *SSM) DescribeMaintenanceWindowExecutionTasks(input *DescribeMaintenanceWindowExecutionTasksInput) (*DescribeMaintenanceWindowExecutionTasksOutput, error) { req, out := c.DescribeMaintenanceWindowExecutionTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMaintenanceWindowExecutionTasksWithContext is the same as DescribeMaintenanceWindowExecutionTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMaintenanceWindowExecutionTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMaintenanceWindowExecutionTasksWithContext(ctx aws.Context, input *DescribeMaintenanceWindowExecutionTasksInput, opts ...request.Option) (*DescribeMaintenanceWindowExecutionTasksOutput, error) { + req, out := c.DescribeMaintenanceWindowExecutionTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMaintenanceWindowExecutions = "DescribeMaintenanceWindowExecutions" @@ -2731,8 +3279,23 @@ func (c *SSM) DescribeMaintenanceWindowExecutionsRequest(input *DescribeMaintena // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutions func (c *SSM) DescribeMaintenanceWindowExecutions(input *DescribeMaintenanceWindowExecutionsInput) (*DescribeMaintenanceWindowExecutionsOutput, error) { req, out := c.DescribeMaintenanceWindowExecutionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMaintenanceWindowExecutionsWithContext is the same as DescribeMaintenanceWindowExecutions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMaintenanceWindowExecutions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMaintenanceWindowExecutionsWithContext(ctx aws.Context, input *DescribeMaintenanceWindowExecutionsInput, opts ...request.Option) (*DescribeMaintenanceWindowExecutionsOutput, error) { + req, out := c.DescribeMaintenanceWindowExecutionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMaintenanceWindowTargets = "DescribeMaintenanceWindowTargets" @@ -2800,8 +3363,23 @@ func (c *SSM) DescribeMaintenanceWindowTargetsRequest(input *DescribeMaintenance // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTargets func (c *SSM) DescribeMaintenanceWindowTargets(input *DescribeMaintenanceWindowTargetsInput) (*DescribeMaintenanceWindowTargetsOutput, error) { req, out := c.DescribeMaintenanceWindowTargetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMaintenanceWindowTargetsWithContext is the same as DescribeMaintenanceWindowTargets with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMaintenanceWindowTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMaintenanceWindowTargetsWithContext(ctx aws.Context, input *DescribeMaintenanceWindowTargetsInput, opts ...request.Option) (*DescribeMaintenanceWindowTargetsOutput, error) { + req, out := c.DescribeMaintenanceWindowTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMaintenanceWindowTasks = "DescribeMaintenanceWindowTasks" @@ -2869,8 +3447,23 @@ func (c *SSM) DescribeMaintenanceWindowTasksRequest(input *DescribeMaintenanceWi // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTasks func (c *SSM) DescribeMaintenanceWindowTasks(input *DescribeMaintenanceWindowTasksInput) (*DescribeMaintenanceWindowTasksOutput, error) { req, out := c.DescribeMaintenanceWindowTasksRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMaintenanceWindowTasksWithContext is the same as DescribeMaintenanceWindowTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMaintenanceWindowTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMaintenanceWindowTasksWithContext(ctx aws.Context, input *DescribeMaintenanceWindowTasksInput, opts ...request.Option) (*DescribeMaintenanceWindowTasksOutput, error) { + req, out := c.DescribeMaintenanceWindowTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeMaintenanceWindows = "DescribeMaintenanceWindows" @@ -2934,8 +3527,23 @@ func (c *SSM) DescribeMaintenanceWindowsRequest(input *DescribeMaintenanceWindow // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindows func (c *SSM) DescribeMaintenanceWindows(input *DescribeMaintenanceWindowsInput) (*DescribeMaintenanceWindowsOutput, error) { req, out := c.DescribeMaintenanceWindowsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeMaintenanceWindowsWithContext is the same as DescribeMaintenanceWindows with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMaintenanceWindows for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeMaintenanceWindowsWithContext(ctx aws.Context, input *DescribeMaintenanceWindowsInput, opts ...request.Option) (*DescribeMaintenanceWindowsOutput, error) { + req, out := c.DescribeMaintenanceWindowsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribeParameters = "DescribeParameters" @@ -3005,8 +3613,23 @@ func (c *SSM) DescribeParametersRequest(input *DescribeParametersInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeParameters func (c *SSM) DescribeParameters(input *DescribeParametersInput) (*DescribeParametersOutput, error) { req, out := c.DescribeParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribeParametersWithContext is the same as DescribeParameters with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribeParametersWithContext(ctx aws.Context, input *DescribeParametersInput, opts ...request.Option) (*DescribeParametersOutput, error) { + req, out := c.DescribeParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribePatchBaselines = "DescribePatchBaselines" @@ -3070,8 +3693,23 @@ func (c *SSM) DescribePatchBaselinesRequest(input *DescribePatchBaselinesInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchBaselines func (c *SSM) DescribePatchBaselines(input *DescribePatchBaselinesInput) (*DescribePatchBaselinesOutput, error) { req, out := c.DescribePatchBaselinesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribePatchBaselinesWithContext is the same as DescribePatchBaselines with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePatchBaselines for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribePatchBaselinesWithContext(ctx aws.Context, input *DescribePatchBaselinesInput, opts ...request.Option) (*DescribePatchBaselinesOutput, error) { + req, out := c.DescribePatchBaselinesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribePatchGroupState = "DescribePatchGroupState" @@ -3138,8 +3776,23 @@ func (c *SSM) DescribePatchGroupStateRequest(input *DescribePatchGroupStateInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroupState func (c *SSM) DescribePatchGroupState(input *DescribePatchGroupStateInput) (*DescribePatchGroupStateOutput, error) { req, out := c.DescribePatchGroupStateRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribePatchGroupStateWithContext is the same as DescribePatchGroupState with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePatchGroupState for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribePatchGroupStateWithContext(ctx aws.Context, input *DescribePatchGroupStateInput, opts ...request.Option) (*DescribePatchGroupStateOutput, error) { + req, out := c.DescribePatchGroupStateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDescribePatchGroups = "DescribePatchGroups" @@ -3203,8 +3856,23 @@ func (c *SSM) DescribePatchGroupsRequest(input *DescribePatchGroupsInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroups func (c *SSM) DescribePatchGroups(input *DescribePatchGroupsInput) (*DescribePatchGroupsOutput, error) { req, out := c.DescribePatchGroupsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DescribePatchGroupsWithContext is the same as DescribePatchGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePatchGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DescribePatchGroupsWithContext(ctx aws.Context, input *DescribePatchGroupsInput, opts ...request.Option) (*DescribePatchGroupsOutput, error) { + req, out := c.DescribePatchGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetAutomationExecution = "GetAutomationExecution" @@ -3272,8 +3940,23 @@ func (c *SSM) GetAutomationExecutionRequest(input *GetAutomationExecutionInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetAutomationExecution func (c *SSM) GetAutomationExecution(input *GetAutomationExecutionInput) (*GetAutomationExecutionOutput, error) { req, out := c.GetAutomationExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetAutomationExecutionWithContext is the same as GetAutomationExecution with the addition of +// the ability to pass a context and additional request options. +// +// See GetAutomationExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetAutomationExecutionWithContext(ctx aws.Context, input *GetAutomationExecutionInput, opts ...request.Option) (*GetAutomationExecutionOutput, error) { + req, out := c.GetAutomationExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetCommandInvocation = "GetCommandInvocation" @@ -3342,12 +4025,12 @@ func (c *SSM) GetCommandInvocationRequest(input *GetCommandInvocationInput) (req // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -3362,8 +4045,23 @@ func (c *SSM) GetCommandInvocationRequest(input *GetCommandInvocationInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetCommandInvocation func (c *SSM) GetCommandInvocation(input *GetCommandInvocationInput) (*GetCommandInvocationOutput, error) { req, out := c.GetCommandInvocationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetCommandInvocationWithContext is the same as GetCommandInvocation with the addition of +// the ability to pass a context and additional request options. +// +// See GetCommandInvocation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetCommandInvocationWithContext(ctx aws.Context, input *GetCommandInvocationInput, opts ...request.Option) (*GetCommandInvocationOutput, error) { + req, out := c.GetCommandInvocationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDefaultPatchBaseline = "GetDefaultPatchBaseline" @@ -3427,8 +4125,23 @@ func (c *SSM) GetDefaultPatchBaselineRequest(input *GetDefaultPatchBaselineInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDefaultPatchBaseline func (c *SSM) GetDefaultPatchBaseline(input *GetDefaultPatchBaselineInput) (*GetDefaultPatchBaselineOutput, error) { req, out := c.GetDefaultPatchBaselineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDefaultPatchBaselineWithContext is the same as GetDefaultPatchBaseline with the addition of +// the ability to pass a context and additional request options. +// +// See GetDefaultPatchBaseline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDefaultPatchBaselineWithContext(ctx aws.Context, input *GetDefaultPatchBaselineInput, opts ...request.Option) (*GetDefaultPatchBaselineOutput, error) { + req, out := c.GetDefaultPatchBaselineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDeployablePatchSnapshotForInstance = "GetDeployablePatchSnapshotForInstance" @@ -3494,8 +4207,23 @@ func (c *SSM) GetDeployablePatchSnapshotForInstanceRequest(input *GetDeployableP // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDeployablePatchSnapshotForInstance func (c *SSM) GetDeployablePatchSnapshotForInstance(input *GetDeployablePatchSnapshotForInstanceInput) (*GetDeployablePatchSnapshotForInstanceOutput, error) { req, out := c.GetDeployablePatchSnapshotForInstanceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDeployablePatchSnapshotForInstanceWithContext is the same as GetDeployablePatchSnapshotForInstance with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeployablePatchSnapshotForInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDeployablePatchSnapshotForInstanceWithContext(ctx aws.Context, input *GetDeployablePatchSnapshotForInstanceInput, opts ...request.Option) (*GetDeployablePatchSnapshotForInstanceOutput, error) { + req, out := c.GetDeployablePatchSnapshotForInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetDocument = "GetDocument" @@ -3565,8 +4293,23 @@ func (c *SSM) GetDocumentRequest(input *GetDocumentInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDocument func (c *SSM) GetDocument(input *GetDocumentInput) (*GetDocumentOutput, error) { req, out := c.GetDocumentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetDocumentWithContext is the same as GetDocument with the addition of +// the ability to pass a context and additional request options. +// +// See GetDocument for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetDocumentWithContext(ctx aws.Context, input *GetDocumentInput, opts ...request.Option) (*GetDocumentOutput, error) { + req, out := c.GetDocumentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInventory = "GetInventory" @@ -3643,8 +4386,23 @@ func (c *SSM) GetInventoryRequest(input *GetInventoryInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventory func (c *SSM) GetInventory(input *GetInventoryInput) (*GetInventoryOutput, error) { req, out := c.GetInventoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInventoryWithContext is the same as GetInventory with the addition of +// the ability to pass a context and additional request options. +// +// See GetInventory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetInventoryWithContext(ctx aws.Context, input *GetInventoryInput, opts ...request.Option) (*GetInventoryOutput, error) { + req, out := c.GetInventoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetInventorySchema = "GetInventorySchema" @@ -3715,8 +4473,23 @@ func (c *SSM) GetInventorySchemaRequest(input *GetInventorySchemaInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventorySchema func (c *SSM) GetInventorySchema(input *GetInventorySchemaInput) (*GetInventorySchemaOutput, error) { req, out := c.GetInventorySchemaRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetInventorySchemaWithContext is the same as GetInventorySchema with the addition of +// the ability to pass a context and additional request options. +// +// See GetInventorySchema for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetInventorySchemaWithContext(ctx aws.Context, input *GetInventorySchemaInput, opts ...request.Option) (*GetInventorySchemaOutput, error) { + req, out := c.GetInventorySchemaRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetMaintenanceWindow = "GetMaintenanceWindow" @@ -3784,8 +4557,23 @@ func (c *SSM) GetMaintenanceWindowRequest(input *GetMaintenanceWindowInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindow func (c *SSM) GetMaintenanceWindow(input *GetMaintenanceWindowInput) (*GetMaintenanceWindowOutput, error) { req, out := c.GetMaintenanceWindowRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetMaintenanceWindowWithContext is the same as GetMaintenanceWindow with the addition of +// the ability to pass a context and additional request options. +// +// See GetMaintenanceWindow for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetMaintenanceWindowWithContext(ctx aws.Context, input *GetMaintenanceWindowInput, opts ...request.Option) (*GetMaintenanceWindowOutput, error) { + req, out := c.GetMaintenanceWindowRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetMaintenanceWindowExecution = "GetMaintenanceWindowExecution" @@ -3854,8 +4642,23 @@ func (c *SSM) GetMaintenanceWindowExecutionRequest(input *GetMaintenanceWindowEx // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecution func (c *SSM) GetMaintenanceWindowExecution(input *GetMaintenanceWindowExecutionInput) (*GetMaintenanceWindowExecutionOutput, error) { req, out := c.GetMaintenanceWindowExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetMaintenanceWindowExecutionWithContext is the same as GetMaintenanceWindowExecution with the addition of +// the ability to pass a context and additional request options. +// +// See GetMaintenanceWindowExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetMaintenanceWindowExecutionWithContext(ctx aws.Context, input *GetMaintenanceWindowExecutionInput, opts ...request.Option) (*GetMaintenanceWindowExecutionOutput, error) { + req, out := c.GetMaintenanceWindowExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetMaintenanceWindowExecutionTask = "GetMaintenanceWindowExecutionTask" @@ -3924,8 +4727,23 @@ func (c *SSM) GetMaintenanceWindowExecutionTaskRequest(input *GetMaintenanceWind // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionTask func (c *SSM) GetMaintenanceWindowExecutionTask(input *GetMaintenanceWindowExecutionTaskInput) (*GetMaintenanceWindowExecutionTaskOutput, error) { req, out := c.GetMaintenanceWindowExecutionTaskRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetMaintenanceWindowExecutionTaskWithContext is the same as GetMaintenanceWindowExecutionTask with the addition of +// the ability to pass a context and additional request options. +// +// See GetMaintenanceWindowExecutionTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetMaintenanceWindowExecutionTaskWithContext(ctx aws.Context, input *GetMaintenanceWindowExecutionTaskInput, opts ...request.Option) (*GetMaintenanceWindowExecutionTaskOutput, error) { + req, out := c.GetMaintenanceWindowExecutionTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetParameterHistory = "GetParameterHistory" @@ -3995,8 +4813,23 @@ func (c *SSM) GetParameterHistoryRequest(input *GetParameterHistoryInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameterHistory func (c *SSM) GetParameterHistory(input *GetParameterHistoryInput) (*GetParameterHistoryOutput, error) { req, out := c.GetParameterHistoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetParameterHistoryWithContext is the same as GetParameterHistory with the addition of +// the ability to pass a context and additional request options. +// +// See GetParameterHistory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetParameterHistoryWithContext(ctx aws.Context, input *GetParameterHistoryInput, opts ...request.Option) (*GetParameterHistoryOutput, error) { + req, out := c.GetParameterHistoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetParameters = "GetParameters" @@ -4044,7 +4877,7 @@ func (c *SSM) GetParametersRequest(input *GetParametersInput) (req *request.Requ // GetParameters API operation for Amazon Simple Systems Manager (SSM). // -// Get a list of parameters used by the AWS account.> +// Get details of a parameter. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4060,8 +4893,23 @@ func (c *SSM) GetParametersRequest(input *GetParametersInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameters func (c *SSM) GetParameters(input *GetParametersInput) (*GetParametersOutput, error) { req, out := c.GetParametersRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetParametersWithContext is the same as GetParameters with the addition of +// the ability to pass a context and additional request options. +// +// See GetParameters for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetParametersWithContext(ctx aws.Context, input *GetParametersInput, opts ...request.Option) (*GetParametersOutput, error) { + req, out := c.GetParametersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPatchBaseline = "GetPatchBaseline" @@ -4133,8 +4981,23 @@ func (c *SSM) GetPatchBaselineRequest(input *GetPatchBaselineInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaseline func (c *SSM) GetPatchBaseline(input *GetPatchBaselineInput) (*GetPatchBaselineOutput, error) { req, out := c.GetPatchBaselineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPatchBaselineWithContext is the same as GetPatchBaseline with the addition of +// the ability to pass a context and additional request options. +// +// See GetPatchBaseline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetPatchBaselineWithContext(ctx aws.Context, input *GetPatchBaselineInput, opts ...request.Option) (*GetPatchBaselineOutput, error) { + req, out := c.GetPatchBaselineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetPatchBaselineForPatchGroup = "GetPatchBaselineForPatchGroup" @@ -4199,8 +5062,23 @@ func (c *SSM) GetPatchBaselineForPatchGroupRequest(input *GetPatchBaselineForPat // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaselineForPatchGroup func (c *SSM) GetPatchBaselineForPatchGroup(input *GetPatchBaselineForPatchGroupInput) (*GetPatchBaselineForPatchGroupOutput, error) { req, out := c.GetPatchBaselineForPatchGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetPatchBaselineForPatchGroupWithContext is the same as GetPatchBaselineForPatchGroup with the addition of +// the ability to pass a context and additional request options. +// +// See GetPatchBaselineForPatchGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetPatchBaselineForPatchGroupWithContext(ctx aws.Context, input *GetPatchBaselineForPatchGroupInput, opts ...request.Option) (*GetPatchBaselineForPatchGroupOutput, error) { + req, out := c.GetPatchBaselineForPatchGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListAssociations = "ListAssociations" @@ -4254,7 +5132,7 @@ func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) (req *reques // ListAssociations API operation for Amazon Simple Systems Manager (SSM). // -// Lists the associations for the specified SSM document or instance. +// Lists the associations for the specified Systems Manager document or instance. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4273,8 +5151,23 @@ func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListAssociations func (c *SSM) ListAssociations(input *ListAssociationsInput) (*ListAssociationsOutput, error) { req, out := c.ListAssociationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListAssociationsWithContext is the same as ListAssociations with the addition of +// the ability to pass a context and additional request options. +// +// See ListAssociations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListAssociationsWithContext(ctx aws.Context, input *ListAssociationsInput, opts ...request.Option) (*ListAssociationsOutput, error) { + req, out := c.ListAssociationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListAssociationsPages iterates over the pages of a ListAssociations operation, @@ -4294,12 +5187,37 @@ func (c *SSM) ListAssociations(input *ListAssociationsInput) (*ListAssociationsO // return pageNum <= 3 // }) // -func (c *SSM) ListAssociationsPages(input *ListAssociationsInput, fn func(p *ListAssociationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAssociationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAssociationsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAssociationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAssociationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAssociationsOutput), !p.HasNextPage()) + } + return p.Err() } const opListCommandInvocations = "ListCommandInvocations" @@ -4377,12 +5295,12 @@ func (c *SSM) ListCommandInvocationsRequest(input *ListCommandInvocationsInput) // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -4396,8 +5314,23 @@ func (c *SSM) ListCommandInvocationsRequest(input *ListCommandInvocationsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommandInvocations func (c *SSM) ListCommandInvocations(input *ListCommandInvocationsInput) (*ListCommandInvocationsOutput, error) { req, out := c.ListCommandInvocationsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListCommandInvocationsWithContext is the same as ListCommandInvocations with the addition of +// the ability to pass a context and additional request options. +// +// See ListCommandInvocations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListCommandInvocationsWithContext(ctx aws.Context, input *ListCommandInvocationsInput, opts ...request.Option) (*ListCommandInvocationsOutput, error) { + req, out := c.ListCommandInvocationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListCommandInvocationsPages iterates over the pages of a ListCommandInvocations operation, @@ -4417,12 +5350,37 @@ func (c *SSM) ListCommandInvocations(input *ListCommandInvocationsInput) (*ListC // return pageNum <= 3 // }) // -func (c *SSM) ListCommandInvocationsPages(input *ListCommandInvocationsInput, fn func(p *ListCommandInvocationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListCommandInvocationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListCommandInvocationsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListCommandInvocationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListCommandInvocationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListCommandInvocationsOutput), !p.HasNextPage()) + } + return p.Err() } const opListCommands = "ListCommands" @@ -4496,12 +5454,12 @@ func (c *SSM) ListCommandsRequest(input *ListCommandsInput) (req *request.Reques // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -4515,8 +5473,23 @@ func (c *SSM) ListCommandsRequest(input *ListCommandsInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommands func (c *SSM) ListCommands(input *ListCommandsInput) (*ListCommandsOutput, error) { req, out := c.ListCommandsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListCommandsWithContext is the same as ListCommands with the addition of +// the ability to pass a context and additional request options. +// +// See ListCommands for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListCommandsWithContext(ctx aws.Context, input *ListCommandsInput, opts ...request.Option) (*ListCommandsOutput, error) { + req, out := c.ListCommandsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListCommandsPages iterates over the pages of a ListCommands operation, @@ -4536,12 +5509,37 @@ func (c *SSM) ListCommands(input *ListCommandsInput) (*ListCommandsOutput, error // return pageNum <= 3 // }) // -func (c *SSM) ListCommandsPages(input *ListCommandsInput, fn func(p *ListCommandsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListCommandsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListCommandsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListCommandsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListCommandsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListCommandsOutput), !p.HasNextPage()) + } + return p.Err() } const opListDocumentVersions = "ListDocumentVersions" @@ -4611,8 +5609,23 @@ func (c *SSM) ListDocumentVersionsRequest(input *ListDocumentVersionsInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocumentVersions func (c *SSM) ListDocumentVersions(input *ListDocumentVersionsInput) (*ListDocumentVersionsOutput, error) { req, out := c.ListDocumentVersionsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDocumentVersionsWithContext is the same as ListDocumentVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListDocumentVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDocumentVersionsWithContext(ctx aws.Context, input *ListDocumentVersionsInput, opts ...request.Option) (*ListDocumentVersionsOutput, error) { + req, out := c.ListDocumentVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListDocuments = "ListDocuments" @@ -4688,8 +5701,23 @@ func (c *SSM) ListDocumentsRequest(input *ListDocumentsInput) (req *request.Requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocuments func (c *SSM) ListDocuments(input *ListDocumentsInput) (*ListDocumentsOutput, error) { req, out := c.ListDocumentsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListDocumentsWithContext is the same as ListDocuments with the addition of +// the ability to pass a context and additional request options. +// +// See ListDocuments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListDocumentsWithContext(ctx aws.Context, input *ListDocumentsInput, opts ...request.Option) (*ListDocumentsOutput, error) { + req, out := c.ListDocumentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // ListDocumentsPages iterates over the pages of a ListDocuments operation, @@ -4709,12 +5737,37 @@ func (c *SSM) ListDocuments(input *ListDocumentsInput) (*ListDocumentsOutput, er // return pageNum <= 3 // }) // -func (c *SSM) ListDocumentsPages(input *ListDocumentsInput, fn func(p *ListDocumentsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDocumentsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDocumentsOutput), lastPage) - }) +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 ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDocumentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDocumentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListDocumentsOutput), !p.HasNextPage()) + } + return p.Err() } const opListInventoryEntries = "ListInventoryEntries" @@ -4780,12 +5833,12 @@ func (c *SSM) ListInventoryEntriesRequest(input *ListInventoryEntriesInput) (req // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -4803,8 +5856,23 @@ func (c *SSM) ListInventoryEntriesRequest(input *ListInventoryEntriesInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListInventoryEntries func (c *SSM) ListInventoryEntries(input *ListInventoryEntriesInput) (*ListInventoryEntriesOutput, error) { req, out := c.ListInventoryEntriesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListInventoryEntriesWithContext is the same as ListInventoryEntries with the addition of +// the ability to pass a context and additional request options. +// +// See ListInventoryEntries for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListInventoryEntriesWithContext(ctx aws.Context, input *ListInventoryEntriesInput, opts ...request.Option) (*ListInventoryEntriesOutput, error) { + req, out := c.ListInventoryEntriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListTagsForResource = "ListTagsForResource" @@ -4876,8 +5944,23 @@ func (c *SSM) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListTagsForResource func (c *SSM) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opModifyDocumentPermission = "ModifyDocumentPermission" @@ -4925,10 +6008,10 @@ func (c *SSM) ModifyDocumentPermissionRequest(input *ModifyDocumentPermissionInp // ModifyDocumentPermission API operation for Amazon Simple Systems Manager (SSM). // -// Share a document publicly or privately. If you share a document privately, -// you must specify the AWS user account IDs for those people who can use the -// document. If you share a document publicly, you must specify All as the account -// ID. +// Shares a Systems Manager document publicly or privately. If you share a document +// privately, you must specify the AWS user account IDs for those people who +// can use the document. If you share a document publicly, you must specify +// All as the account ID. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4959,8 +6042,23 @@ func (c *SSM) ModifyDocumentPermissionRequest(input *ModifyDocumentPermissionInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ModifyDocumentPermission func (c *SSM) ModifyDocumentPermission(input *ModifyDocumentPermissionInput) (*ModifyDocumentPermissionOutput, error) { req, out := c.ModifyDocumentPermissionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ModifyDocumentPermissionWithContext is the same as ModifyDocumentPermission with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDocumentPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ModifyDocumentPermissionWithContext(ctx aws.Context, input *ModifyDocumentPermissionInput, opts ...request.Option) (*ModifyDocumentPermissionOutput, error) { + req, out := c.ModifyDocumentPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutInventory = "PutInventory" @@ -5028,12 +6126,12 @@ func (c *SSM) PutInventoryRequest(input *PutInventoryInput) (req *request.Reques // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -5065,8 +6163,23 @@ func (c *SSM) PutInventoryRequest(input *PutInventoryInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutInventory func (c *SSM) PutInventory(input *PutInventoryInput) (*PutInventoryOutput, error) { req, out := c.PutInventoryRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutInventoryWithContext is the same as PutInventory with the addition of +// the ability to pass a context and additional request options. +// +// See PutInventory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutInventoryWithContext(ctx aws.Context, input *PutInventoryInput, opts ...request.Option) (*PutInventoryOutput, error) { + req, out := c.PutInventoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opPutParameter = "PutParameter" @@ -5147,8 +6260,23 @@ func (c *SSM) PutParameterRequest(input *PutParameterInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutParameter func (c *SSM) PutParameter(input *PutParameterInput) (*PutParameterOutput, error) { req, out := c.PutParameterRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// PutParameterWithContext is the same as PutParameter with the addition of +// the ability to pass a context and additional request options. +// +// See PutParameter for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutParameterWithContext(ctx aws.Context, input *PutParameterInput, opts ...request.Option) (*PutParameterOutput, error) { + req, out := c.PutParameterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterDefaultPatchBaseline = "RegisterDefaultPatchBaseline" @@ -5220,8 +6348,23 @@ func (c *SSM) RegisterDefaultPatchBaselineRequest(input *RegisterDefaultPatchBas // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterDefaultPatchBaseline func (c *SSM) RegisterDefaultPatchBaseline(input *RegisterDefaultPatchBaselineInput) (*RegisterDefaultPatchBaselineOutput, error) { req, out := c.RegisterDefaultPatchBaselineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterDefaultPatchBaselineWithContext is the same as RegisterDefaultPatchBaseline with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterDefaultPatchBaseline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterDefaultPatchBaselineWithContext(ctx aws.Context, input *RegisterDefaultPatchBaselineInput, opts ...request.Option) (*RegisterDefaultPatchBaselineOutput, error) { + req, out := c.RegisterDefaultPatchBaselineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterPatchBaselineForPatchGroup = "RegisterPatchBaselineForPatchGroup" @@ -5301,8 +6444,23 @@ func (c *SSM) RegisterPatchBaselineForPatchGroupRequest(input *RegisterPatchBase // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterPatchBaselineForPatchGroup func (c *SSM) RegisterPatchBaselineForPatchGroup(input *RegisterPatchBaselineForPatchGroupInput) (*RegisterPatchBaselineForPatchGroupOutput, error) { req, out := c.RegisterPatchBaselineForPatchGroupRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterPatchBaselineForPatchGroupWithContext is the same as RegisterPatchBaselineForPatchGroup with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterPatchBaselineForPatchGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterPatchBaselineForPatchGroupWithContext(ctx aws.Context, input *RegisterPatchBaselineForPatchGroupInput, opts ...request.Option) (*RegisterPatchBaselineForPatchGroupOutput, error) { + req, out := c.RegisterPatchBaselineForPatchGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterTargetWithMaintenanceWindow = "RegisterTargetWithMaintenanceWindow" @@ -5378,8 +6536,23 @@ func (c *SSM) RegisterTargetWithMaintenanceWindowRequest(input *RegisterTargetWi // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTargetWithMaintenanceWindow func (c *SSM) RegisterTargetWithMaintenanceWindow(input *RegisterTargetWithMaintenanceWindowInput) (*RegisterTargetWithMaintenanceWindowOutput, error) { req, out := c.RegisterTargetWithMaintenanceWindowRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterTargetWithMaintenanceWindowWithContext is the same as RegisterTargetWithMaintenanceWindow with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterTargetWithMaintenanceWindow for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterTargetWithMaintenanceWindowWithContext(ctx aws.Context, input *RegisterTargetWithMaintenanceWindowInput, opts ...request.Option) (*RegisterTargetWithMaintenanceWindowOutput, error) { + req, out := c.RegisterTargetWithMaintenanceWindowRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRegisterTaskWithMaintenanceWindow = "RegisterTaskWithMaintenanceWindow" @@ -5455,8 +6628,23 @@ func (c *SSM) RegisterTaskWithMaintenanceWindowRequest(input *RegisterTaskWithMa // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTaskWithMaintenanceWindow func (c *SSM) RegisterTaskWithMaintenanceWindow(input *RegisterTaskWithMaintenanceWindowInput) (*RegisterTaskWithMaintenanceWindowOutput, error) { req, out := c.RegisterTaskWithMaintenanceWindowRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RegisterTaskWithMaintenanceWindowWithContext is the same as RegisterTaskWithMaintenanceWindow with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterTaskWithMaintenanceWindow for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RegisterTaskWithMaintenanceWindowWithContext(ctx aws.Context, input *RegisterTaskWithMaintenanceWindowInput, opts ...request.Option) (*RegisterTaskWithMaintenanceWindowOutput, error) { + req, out := c.RegisterTaskWithMaintenanceWindowRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opRemoveTagsFromResource = "RemoveTagsFromResource" @@ -5528,8 +6716,23 @@ func (c *SSM) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RemoveTagsFromResource func (c *SSM) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*RemoveTagsFromResourceOutput, error) { req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// RemoveTagsFromResourceWithContext is the same as RemoveTagsFromResource with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTagsFromResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) RemoveTagsFromResourceWithContext(ctx aws.Context, input *RemoveTagsFromResourceInput, opts ...request.Option) (*RemoveTagsFromResourceOutput, error) { + req, out := c.RemoveTagsFromResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opSendCommand = "SendCommand" @@ -5598,12 +6801,12 @@ func (c *SSM) SendCommandRequest(input *SendCommandInput) (req *request.Request, // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -5620,17 +6823,17 @@ func (c *SSM) SendCommandRequest(input *SendCommandInput) (req *request.Request, // // * ErrCodeUnsupportedPlatformType "UnsupportedPlatformType" // The document does not support the platform type of the given instance ID(s). -// For example, you sent an SSM document for a Windows instance to a Linux instance. +// For example, you sent an document for a Windows instance to a Linux instance. // // * ErrCodeMaxDocumentSizeExceeded "MaxDocumentSizeExceeded" -// The size limit of an SSM document is 64 KB. +// The size limit of a document is 64 KB. // // * ErrCodeInvalidRole "InvalidRole" // The role name can't contain invalid characters. Also verify that you specified // an IAM role for notifications that includes the required trust policy. For // information about configuring the IAM role for Run Command notifications, -// see Getting Amazon SNS Notifications When a Command Changes Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/rc-sns.html) -// in the Amazon Elastic Compute Cloud User Guide . +// see Configuring Amazon SNS Notifications for Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/rc-sns-notifications.html) +// in the Amazon EC2 Systems Manager User Guide. // // * ErrCodeInvalidNotificationConfig "InvalidNotificationConfig" // One or more configuration items is not valid. Verify that a valid Amazon @@ -5639,8 +6842,23 @@ func (c *SSM) SendCommandRequest(input *SendCommandInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/SendCommand func (c *SSM) SendCommand(input *SendCommandInput) (*SendCommandOutput, error) { req, out := c.SendCommandRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// SendCommandWithContext is the same as SendCommand with the addition of +// the ability to pass a context and additional request options. +// +// See SendCommand for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) SendCommandWithContext(ctx aws.Context, input *SendCommandInput, opts ...request.Option) (*SendCommandOutput, error) { + req, out := c.SendCommandRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStartAutomationExecution = "StartAutomationExecution" @@ -5719,8 +6937,23 @@ func (c *SSM) StartAutomationExecutionRequest(input *StartAutomationExecutionInp // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartAutomationExecution func (c *SSM) StartAutomationExecution(input *StartAutomationExecutionInput) (*StartAutomationExecutionOutput, error) { req, out := c.StartAutomationExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StartAutomationExecutionWithContext is the same as StartAutomationExecution with the addition of +// the ability to pass a context and additional request options. +// +// See StartAutomationExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StartAutomationExecutionWithContext(ctx aws.Context, input *StartAutomationExecutionInput, opts ...request.Option) (*StartAutomationExecutionOutput, error) { + req, out := c.StartAutomationExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opStopAutomationExecution = "StopAutomationExecution" @@ -5788,8 +7021,23 @@ func (c *SSM) StopAutomationExecutionRequest(input *StopAutomationExecutionInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StopAutomationExecution func (c *SSM) StopAutomationExecution(input *StopAutomationExecutionInput) (*StopAutomationExecutionOutput, error) { req, out := c.StopAutomationExecutionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// StopAutomationExecutionWithContext is the same as StopAutomationExecution with the addition of +// the ability to pass a context and additional request options. +// +// See StopAutomationExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) StopAutomationExecutionWithContext(ctx aws.Context, input *StopAutomationExecutionInput, opts ...request.Option) (*StopAutomationExecutionOutput, error) { + req, out := c.StopAutomationExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAssociation = "UpdateAssociation" @@ -5877,8 +7125,23 @@ func (c *SSM) UpdateAssociationRequest(input *UpdateAssociationInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociation func (c *SSM) UpdateAssociation(input *UpdateAssociationInput) (*UpdateAssociationOutput, error) { req, out := c.UpdateAssociationRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAssociationWithContext is the same as UpdateAssociation with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAssociation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAssociationWithContext(ctx aws.Context, input *UpdateAssociationInput, opts ...request.Option) (*UpdateAssociationOutput, error) { + req, out := c.UpdateAssociationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateAssociationStatus = "UpdateAssociationStatus" @@ -5926,7 +7189,8 @@ func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput // UpdateAssociationStatus API operation for Amazon Simple Systems Manager (SSM). // -// Updates the status of the SSM document associated with the specified instance. +// Updates the status of the Systems Manager document associated with the specified +// instance. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5944,12 +7208,12 @@ func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -5970,8 +7234,23 @@ func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociationStatus func (c *SSM) UpdateAssociationStatus(input *UpdateAssociationStatusInput) (*UpdateAssociationStatusOutput, error) { req, out := c.UpdateAssociationStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateAssociationStatusWithContext is the same as UpdateAssociationStatus with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAssociationStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateAssociationStatusWithContext(ctx aws.Context, input *UpdateAssociationStatusInput, opts ...request.Option) (*UpdateAssociationStatusOutput, error) { + req, out := c.UpdateAssociationStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDocument = "UpdateDocument" @@ -6030,7 +7309,7 @@ func (c *SSM) UpdateDocumentRequest(input *UpdateDocumentInput) (req *request.Re // // Returned Error Codes: // * ErrCodeMaxDocumentSizeExceeded "MaxDocumentSizeExceeded" -// The size limit of an SSM document is 64 KB. +// The size limit of a document is 64 KB. // // * ErrCodeDocumentVersionLimitExceeded "DocumentVersionLimitExceeded" // The document has too many versions. Delete one or more document versions @@ -6044,7 +7323,7 @@ func (c *SSM) UpdateDocumentRequest(input *UpdateDocumentInput) (req *request.Re // the content of the document and try again. // // * ErrCodeInvalidDocumentContent "InvalidDocumentContent" -// The content for the SSM document is not valid. +// The content for the document is not valid. // // * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" // The document version is not valid or does not exist. @@ -6058,8 +7337,23 @@ func (c *SSM) UpdateDocumentRequest(input *UpdateDocumentInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocument func (c *SSM) UpdateDocument(input *UpdateDocumentInput) (*UpdateDocumentOutput, error) { req, out := c.UpdateDocumentRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDocumentWithContext is the same as UpdateDocument with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDocument for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateDocumentWithContext(ctx aws.Context, input *UpdateDocumentInput, opts ...request.Option) (*UpdateDocumentOutput, error) { + req, out := c.UpdateDocumentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateDocumentDefaultVersion = "UpdateDocumentDefaultVersion" @@ -6132,8 +7426,23 @@ func (c *SSM) UpdateDocumentDefaultVersionRequest(input *UpdateDocumentDefaultVe // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocumentDefaultVersion func (c *SSM) UpdateDocumentDefaultVersion(input *UpdateDocumentDefaultVersionInput) (*UpdateDocumentDefaultVersionOutput, error) { req, out := c.UpdateDocumentDefaultVersionRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateDocumentDefaultVersionWithContext is the same as UpdateDocumentDefaultVersion with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDocumentDefaultVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateDocumentDefaultVersionWithContext(ctx aws.Context, input *UpdateDocumentDefaultVersionInput, opts ...request.Option) (*UpdateDocumentDefaultVersionOutput, error) { + req, out := c.UpdateDocumentDefaultVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateMaintenanceWindow = "UpdateMaintenanceWindow" @@ -6201,8 +7510,23 @@ func (c *SSM) UpdateMaintenanceWindowRequest(input *UpdateMaintenanceWindowInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindow func (c *SSM) UpdateMaintenanceWindow(input *UpdateMaintenanceWindowInput) (*UpdateMaintenanceWindowOutput, error) { req, out := c.UpdateMaintenanceWindowRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateMaintenanceWindowWithContext is the same as UpdateMaintenanceWindow with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateMaintenanceWindow for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateMaintenanceWindowWithContext(ctx aws.Context, input *UpdateMaintenanceWindowInput, opts ...request.Option) (*UpdateMaintenanceWindowOutput, error) { + req, out := c.UpdateMaintenanceWindowRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateManagedInstanceRole = "UpdateManagedInstanceRole" @@ -6266,12 +7590,12 @@ func (c *SSM) UpdateManagedInstanceRoleRequest(input *UpdateManagedInstanceRoleI // // You do not have permission to access the instance. // -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the +// The SSM Agent is not running. On managed instances and Linux instances, verify +// that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. +// The SSM Agent or EC2Config service is not registered to the SSM endpoint. +// Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -6282,8 +7606,23 @@ func (c *SSM) UpdateManagedInstanceRoleRequest(input *UpdateManagedInstanceRoleI // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateManagedInstanceRole func (c *SSM) UpdateManagedInstanceRole(input *UpdateManagedInstanceRoleInput) (*UpdateManagedInstanceRoleOutput, error) { req, out := c.UpdateManagedInstanceRoleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateManagedInstanceRoleWithContext is the same as UpdateManagedInstanceRole with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateManagedInstanceRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdateManagedInstanceRoleWithContext(ctx aws.Context, input *UpdateManagedInstanceRoleInput, opts ...request.Option) (*UpdateManagedInstanceRoleOutput, error) { + req, out := c.UpdateManagedInstanceRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdatePatchBaseline = "UpdatePatchBaseline" @@ -6352,8 +7691,23 @@ func (c *SSM) UpdatePatchBaselineRequest(input *UpdatePatchBaselineInput) (req * // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdatePatchBaseline func (c *SSM) UpdatePatchBaseline(input *UpdatePatchBaselineInput) (*UpdatePatchBaselineOutput, error) { req, out := c.UpdatePatchBaselineRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdatePatchBaselineWithContext is the same as UpdatePatchBaseline with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePatchBaseline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) UpdatePatchBaselineWithContext(ctx aws.Context, input *UpdatePatchBaselineInput, opts ...request.Option) (*UpdatePatchBaselineOutput, error) { + req, out := c.UpdatePatchBaselineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // An activation registers one or more on-premises servers or virtual machines @@ -6551,7 +7905,7 @@ func (s AddTagsToResourceOutput) GoString() string { return s.String() } -// Describes an association of an SSM document and an instance. +// Describes an association of a Systems Manager document and an instance. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/Association type Association struct { _ struct{} `type:"structure"` @@ -7319,7 +8673,7 @@ type Command struct { // Timed Out, Delivery Timed Out, Canceled, Terminated, or Undeliverable. CompletedCount *int64 `type:"integer"` - // The name of the SSM document requested for execution. + // The name of the document requested for execution. DocumentName *string `type:"string"` // The number of targets for which the status is Failed or Execution Timed Out. @@ -7336,19 +8690,15 @@ type Command struct { // The maximum number of instances that are allowed to execute the command at // the same time. You can specify a number of instances, such as 10, or a percentage // of instances, such as 10%. The default value is 50. For more information - // about how to use MaxConcurrency, see Executing a Command Using Amazon EC2 - // Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). + // about how to use MaxConcurrency, see Executing a Command Using Systems Manager + // Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html). MaxConcurrency *string `min:"1" type:"string"` // The maximum number of errors allowed before the system stops sending the // command to additional targets. You can specify a number of errors, such as // 10, or a percentage or errors, such as 10%. The default value is 50. For // more information about how to use MaxErrors, see Executing a Command Using - // Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). + // Systems Manager Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html). MaxErrors *string `min:"1" type:"string"` // Configurations for sending notifications about command status changes. @@ -7366,8 +8716,7 @@ type Command struct { // is located. The default value is the region where Run Command is being called. OutputS3Region *string `min:"3" type:"string"` - // The parameter values to be inserted in the SSM document when executing the - // command. + // The parameter values to be inserted in the document when executing the command. Parameters map[string][]*string `type:"map"` // The date and time the command was requested. @@ -7383,9 +8732,8 @@ type Command struct { // A detailed status of the command execution. StatusDetails includes more information // than Status because it includes states resulting from error and concurrency // control parameters. StatusDetails can show different results than Status. - // For more information about these statuses, see Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // (Linux) or Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/monitor-commands.html) - // (Windows). StatusDetails can be one of the following values: + // For more information about these statuses, see Run Command Status (http://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-about-status.html). + // StatusDetails can be one of the following values: // // * Pending – The command has not been sent to any instances. // @@ -7419,7 +8767,7 @@ type Command struct { // The number of targets for the command. TargetCount *int64 `type:"integer"` - // An array of search criteria that targets instances using a Key;Value combination + // An array of search criteria that targets instances using a Key,Value combination // that you specify. Targets is required if you don't provide one or more instance // IDs in the call. Targets []*Target `type:"list"` @@ -7671,9 +9019,8 @@ type CommandInvocation struct { // targeted by the command). StatusDetails includes more information than Status // because it includes states resulting from error and concurrency control parameters. // StatusDetails can show different results than Status. For more information - // about these statuses, see Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // (Linux) or Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/monitor-commands.html) - // (Windows). StatusDetails can be one of the following values: + // about these statuses, see Run Command Status (http://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-about-status.html). + // StatusDetails can be one of the following values: // // * Pending – The command has not been sent to the instance. // @@ -7881,9 +9228,8 @@ type CommandPlugin struct { // A detailed status of the plugin execution. StatusDetails includes more information // than Status because it includes states resulting from error and concurrency // control parameters. StatusDetails can show different results than Status. - // For more information about these statuses, see Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // (Linux) or Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/monitor-commands.html) - // (Windows). StatusDetails can be one of the following values: + // For more information about these statuses, see Run Command Status (http://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-about-status.html). + // StatusDetails can be one of the following values: // // * Pending – The command has not been sent to the instance. // @@ -8208,7 +9554,7 @@ func (s *CreateAssociationBatchOutput) SetSuccessful(v []*AssociationDescription return s } -// Describes the association of an SSM document and an instance. +// Describes the association of a Systems Manager document and an instance. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationBatchRequestEntry type CreateAssociationBatchRequestEntry struct { _ struct{} `type:"structure"` @@ -8331,7 +9677,7 @@ type CreateAssociationInput struct { // The instance ID. InstanceId *string `type:"string"` - // The name of the SSM document. + // The name of the Systems Manager document. // // Name is a required field Name *string `type:"string" required:"true"` @@ -8479,7 +9825,7 @@ type CreateDocumentInput struct { // and Command. DocumentType *string `type:"string" enum:"DocumentType"` - // A name for the SSM document. + // A name for the Systems Manager document. // // Name is a required field Name *string `type:"string" required:"true"` @@ -8536,7 +9882,7 @@ func (s *CreateDocumentInput) SetName(v string) *CreateDocumentInput { type CreateDocumentOutput struct { _ struct{} `type:"structure"` - // Information about the SSM document. + // Information about the Systems Manager document. DocumentDescription *DocumentDescription `type:"structure"` } @@ -8898,7 +10244,7 @@ type DeleteAssociationInput struct { // The ID of the instance. InstanceId *string `type:"string"` - // The name of the SSM document. + // The name of the Systems Manager document. Name *string `type:"string"` } @@ -8949,7 +10295,7 @@ func (s DeleteAssociationOutput) GoString() string { type DeleteDocumentInput struct { _ struct{} `type:"structure"` - // The name of the SSM document. + // The name of the document. // // Name is a required field Name *string `type:"string" required:"true"` @@ -12005,7 +13351,7 @@ func (s *DocumentDefaultVersionDescription) SetName(v string) *DocumentDefaultVe type DocumentDescription struct { _ struct{} `type:"structure"` - // The date when the SSM document was created. + // The date when the document was created. CreatedDate *time.Time `type:"timestamp" timestampFormat:"unix"` // The default version. @@ -12282,8 +13628,8 @@ func (s *DocumentIdentifier) SetSchemaVersion(v string) *DocumentIdentifier { return s } -// Parameters specified in the SSM document that execute on the server when -// the command is run. +// Parameters specified in a System Manager document that execute on the server +// when the command is run. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DocumentParameter type DocumentParameter struct { _ struct{} `type:"structure"` @@ -12559,8 +13905,8 @@ type GetCommandInvocationInput struct { InstanceId *string `type:"string" required:"true"` // (Optional) The name of the plugin for which you want detailed results. If - // the SSM document contains only one plugin, the name can be omitted and the - // details will be returned. + // the document contains only one plugin, the name can be omitted and the details + // will be returned. PluginName *string `min:"4" type:"string"` } @@ -12624,8 +13970,7 @@ type GetCommandInvocationOutput struct { // The comment text for the command. Comment *string `type:"string"` - // The name of the SSM document that was executed. For example, AWS-RunShellScript - // is an SSM document. + // The name of the document that was executed. For example, AWS-RunShellScript. DocumentName *string `type:"string"` // Duration since ExecutionStartDateTime. @@ -12679,10 +14024,9 @@ type GetCommandInvocationOutput struct { // A detailed status of the command execution for an invocation. StatusDetails // includes more information than Status because it includes states resulting // from error and concurrency control parameters. StatusDetails can show different - // results than Status. For more information about these statuses, see Monitor - // Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // (Linux) or Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/monitor-commands.html) - // (Windows). StatusDetails can be one of the following values: + // results than Status. For more information about these statuses, see Run Command + // Status (http://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-about-status.html). + // StatusDetails can be one of the following values: // // * Pending – The command has not been sent to the instance. // @@ -13904,7 +15248,7 @@ type GetParametersOutput struct { // executed. InvalidParameters []*string `min:"1" type:"list"` - // A list of parameters used by the AWS account. + // A list of details for a parameter. Parameters []*Parameter `type:"list"` } @@ -14409,7 +15753,7 @@ type InstanceInformation struct { // The activation ID created by Systems Manager when the server or VM was registered. ActivationId *string `type:"string"` - // The version of the SSM agent running on your Linux instance. + // The version of the SSM Agent running on your Linux instance. AgentVersion *string `type:"string"` // Information about the association. @@ -14431,7 +15775,7 @@ type InstanceInformation struct { // The instance ID. InstanceId *string `type:"string"` - // Indicates whether latest version of the SSM agent is running on your instance. + // Indicates whether latest version of the SSM Agent is running on your instance. IsLatestVersion *bool `type:"boolean"` // The date the association was last executed. @@ -14446,7 +15790,7 @@ type InstanceInformation struct { // The name of the managed instance. Name *string `type:"string"` - // Connection status of the SSM agent. + // Connection status of the SSM Agent. PingStatus *string `type:"string" enum:"PingStatus"` // The name of the operating system platform running on your instance. @@ -16894,8 +18238,9 @@ type NotificationConfig struct { // The different events for which you can receive notifications. These events // include the following: All (events), InProgress, Success, TimedOut, Cancelled, - // Failed. To learn more about these events, see Monitoring Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // in the Amazon Elastic Compute Cloud User Guide . + // Failed. To learn more about these events, see Setting Up Events and Notifications + // (http://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) + // in the Amazon EC2 Systems Manager User Guide. NotificationEvents []*string `type:"list"` // Command: Receive notification when the status of a command changes. Invocation: @@ -17879,7 +19224,7 @@ type PutParameterInput struct { // Name is a required field Name *string `min:"1" type:"string" required:"true"` - // Overwrite an existing parameter. + // Overwrite an existing parameter. If not specified, will default to "false". Overwrite *bool `type:"boolean"` // The type of parameter that you want to add to the system. @@ -18720,8 +20065,8 @@ type SendCommandInput struct { // Sha1 hashes have been deprecated. DocumentHashType *string `type:"string" enum:"DocumentHashType"` - // Required. The name of the SSM document to execute. This can be an SSM public - // document or a custom document. + // Required. The name of the Systems Manager document to execute. This can be + // a public document or a custom document. // // DocumentName is a required field DocumentName *string `type:"string" required:"true"` @@ -18733,20 +20078,16 @@ type SendCommandInput struct { // (Optional) The maximum number of instances that are allowed to execute the // command at the same time. You can specify a number such as “10” or a percentage // such as “10%”. The default value is 50. For more information about how to - // use MaxConcurrency, see Executing a Command Using Amazon EC2 Run Command - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) (Linux) - // or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). + // use MaxConcurrency, see Executing a Command Using Systems Manager Run Command + // (http://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html). MaxConcurrency *string `min:"1" type:"string"` // The maximum number of errors allowed without the command failing. When the // command fails one more time beyond the value of MaxErrors, the systems stops // sending the command to additional targets. You can specify a number like // “10” or a percentage like “10%”. The default value is 50. For more information - // about how to use MaxErrors, see Executing a Command Using Amazon EC2 Run - // Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). + // about how to use MaxErrors, see Executing a Command Using Systems Manager + // Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html). MaxErrors *string `min:"1" type:"string"` // Configurations for sending notifications. @@ -18764,19 +20105,16 @@ type SendCommandInput struct { // is being called. OutputS3Region *string `min:"3" type:"string"` - // The required and optional parameters specified in the SSM document being - // executed. + // The required and optional parameters specified in the document being executed. Parameters map[string][]*string `type:"map"` // The IAM role that Systems Manager uses to send notifications. ServiceRoleArn *string `type:"string"` - // (Optional) An array of search criteria that targets instances using a Key;Value + // (Optional) An array of search criteria that targets instances using a Key,Value // combination that you specify. Targets is required if you don't provide one // or more instance IDs in the call. For more information about how to use Targets, - // see Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). + // see Executing a Command Using Systems Manager Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html). Targets []*Target `type:"list"` // If this time is reached and the command has not already started executing, @@ -19261,7 +20599,7 @@ func (s *Tag) SetValue(v string) *Tag { return s } -// An array of search criteria that targets instances using a Key;Value combination +// An array of search criteria that targets instances using a Key,Value combination // that you specify. Targets is required if you don't provide one or more instance // IDs in the call. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/Target @@ -19269,21 +20607,16 @@ type Target struct { _ struct{} `type:"structure"` // User-defined criteria for sending commands that target instances that meet - // the criteria. Key can be tag: or name:. For example, tag:ServerRole or name:0123456789012345. For more information - // about how to send commands that target instances using Key;Value parameters, - // see Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). + // the criteria. Key can be tag: or InstanceIds. For more information + // about how to send commands that target instances using Key,Value parameters, + // see Executing a Command Using Systems Manager Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html). Key *string `min:"1" type:"string"` // User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, // you could specify value:WebServer to execute a command on instances that - // include Amazon EC2 tags of ServerRole;WebServer. For more information about - // how to send commands that target instances using Key;Value parameters, see - // Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). + // include Amazon EC2 tags of ServerRole,WebServer. For more information about + // how to send commands that target instances using Key,Value parameters, see + // Executing a Command Using Systems Manager Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html). Values []*string `type:"list"` } diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go index bea03cfa9..2107a874f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ssm @@ -14,7 +14,7 @@ const ( // ErrCodeAssociatedInstances for service response error code // "AssociatedInstances". // - // You must disassociate an SSM document from all instances before you can delete + // You must disassociate a document from all instances before you can delete // it. ErrCodeAssociatedInstances = "AssociatedInstances" @@ -72,7 +72,7 @@ const ( // ErrCodeDocumentAlreadyExists for service response error code // "DocumentAlreadyExists". // - // The specified SSM document already exists. + // The specified document already exists. ErrCodeDocumentAlreadyExists = "DocumentAlreadyExists" // ErrCodeDocumentLimitExceeded for service response error code @@ -164,7 +164,7 @@ const ( // ErrCodeInvalidDocumentContent for service response error code // "InvalidDocumentContent". // - // The content for the SSM document is not valid. + // The content for the document is not valid. ErrCodeInvalidDocumentContent = "InvalidDocumentContent" // ErrCodeInvalidDocumentOperation for service response error code @@ -212,12 +212,12 @@ const ( // // You do not have permission to access the instance. // - // The SSM agent is not running. On managed instances and Linux instances, verify - // that the SSM agent is running. On EC2 Windows instances, verify that the + // The SSM Agent is not running. On managed instances and Linux instances, verify + // that the SSM Agent is running. On EC2 Windows instances, verify that the // EC2Config service is running. // - // The SSM agent or EC2Config service is not registered to the SSM endpoint. - // Try reinstalling the SSM agent or EC2Config service. + // The SSM Agent or EC2Config service is not registered to the SSM endpoint. + // Try reinstalling the SSM Agent or EC2Config service. // // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. @@ -312,8 +312,8 @@ const ( // The role name can't contain invalid characters. Also verify that you specified // an IAM role for notifications that includes the required trust policy. For // information about configuring the IAM role for Run Command notifications, - // see Getting Amazon SNS Notifications When a Command Changes Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/rc-sns.html) - // in the Amazon Elastic Compute Cloud User Guide . + // see Configuring Amazon SNS Notifications for Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/rc-sns-notifications.html) + // in the Amazon EC2 Systems Manager User Guide. ErrCodeInvalidRole = "InvalidRole" // ErrCodeInvalidSchedule for service response error code @@ -363,7 +363,7 @@ const ( // ErrCodeMaxDocumentSizeExceeded for service response error code // "MaxDocumentSizeExceeded". // - // The size limit of an SSM document is 64 KB. + // The size limit of a document is 64 KB. ErrCodeMaxDocumentSizeExceeded = "MaxDocumentSizeExceeded" // ErrCodeParameterAlreadyExists for service response error code @@ -443,6 +443,6 @@ const ( // "UnsupportedPlatformType". // // The document does not support the platform type of the given instance ID(s). - // For example, you sent an SSM document for a Windows instance to a Linux instance. + // For example, you sent an document for a Windows instance to a Linux instance. ErrCodeUnsupportedPlatformType = "UnsupportedPlatformType" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssm/service.go b/vendor/github.com/aws/aws-sdk-go/service/ssm/service.go index 9e9026883..7fa443f98 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ssm/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ssm @@ -15,17 +15,15 @@ import ( // automate management tasks such as collecting system inventory, applying operating // system (OS) patches, automating the creation of Amazon Machine Images (AMIs), // and configuring operating systems (OSs) and applications at scale. Systems -// Manager works with managed instances: Amazon EC2 instances and servers or -// virtual machines (VMs) in your on-premises environment that are configured -// for Systems Manager. +// Manager lets you remotely and securely manage the configuration of your managed +// instances. A managed instance is any Amazon EC2 instance or on-premises machine +// in your hybrid environment that has been configured for Systems Manager. // -// This references is intended to be used with the EC2 Systems Manager User -// Guide (Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/systems-manager.html)) -// (Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/systems-manager.html)). +// This reference is intended to be used with the Amazon EC2 Systems Manager +// User Guide (http://docs.aws.amazon.com/systems-manager/latest/userguide/). // -// To get started, verify prerequisites and configure managed instances (Linux -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/systems-manager-prereqs.html)) -// (Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/systems-manager-prereqs.html)). +// To get started, verify prerequisites and configure managed instances. For +// more information, see Systems Manager Prerequisites (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-prereqs.html). // The service client's operations are safe to be used concurrently. // It is not safe to mutate any of the client's properties though. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06 diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go index ad42b4c97..19dd0bf8e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package sts provides a client for AWS Security Token Service. package sts @@ -6,6 +6,7 @@ package sts import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -172,8 +173,23 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error) { req, out := c.AssumeRoleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssumeRoleWithContext is the same as AssumeRole with the addition of +// the ability to pass a context and additional request options. +// +// See AssumeRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *STS) AssumeRoleWithContext(ctx aws.Context, input *AssumeRoleInput, opts ...request.Option) (*AssumeRoleOutput, error) { + req, out := c.AssumeRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssumeRoleWithSAML = "AssumeRoleWithSAML" @@ -331,8 +347,23 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML func (c *STS) AssumeRoleWithSAML(input *AssumeRoleWithSAMLInput) (*AssumeRoleWithSAMLOutput, error) { req, out := c.AssumeRoleWithSAMLRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssumeRoleWithSAMLWithContext is the same as AssumeRoleWithSAML with the addition of +// the ability to pass a context and additional request options. +// +// See AssumeRoleWithSAML for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *STS) AssumeRoleWithSAMLWithContext(ctx aws.Context, input *AssumeRoleWithSAMLInput, opts ...request.Option) (*AssumeRoleWithSAMLOutput, error) { + req, out := c.AssumeRoleWithSAMLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity" @@ -519,8 +550,23 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity func (c *STS) AssumeRoleWithWebIdentity(input *AssumeRoleWithWebIdentityInput) (*AssumeRoleWithWebIdentityOutput, error) { req, out := c.AssumeRoleWithWebIdentityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssumeRoleWithWebIdentityWithContext is the same as AssumeRoleWithWebIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See AssumeRoleWithWebIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *STS) AssumeRoleWithWebIdentityWithContext(ctx aws.Context, input *AssumeRoleWithWebIdentityInput, opts ...request.Option) (*AssumeRoleWithWebIdentityOutput, error) { + req, out := c.AssumeRoleWithWebIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage" @@ -617,8 +663,23 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage func (c *STS) DecodeAuthorizationMessage(input *DecodeAuthorizationMessageInput) (*DecodeAuthorizationMessageOutput, error) { req, out := c.DecodeAuthorizationMessageRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DecodeAuthorizationMessageWithContext is the same as DecodeAuthorizationMessage with the addition of +// the ability to pass a context and additional request options. +// +// See DecodeAuthorizationMessage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *STS) DecodeAuthorizationMessageWithContext(ctx aws.Context, input *DecodeAuthorizationMessageInput, opts ...request.Option) (*DecodeAuthorizationMessageOutput, error) { + req, out := c.DecodeAuthorizationMessageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetCallerIdentity = "GetCallerIdentity" @@ -678,8 +739,23 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity func (c *STS) GetCallerIdentity(input *GetCallerIdentityInput) (*GetCallerIdentityOutput, error) { req, out := c.GetCallerIdentityRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetCallerIdentityWithContext is the same as GetCallerIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See GetCallerIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *STS) GetCallerIdentityWithContext(ctx aws.Context, input *GetCallerIdentityInput, opts ...request.Option) (*GetCallerIdentityOutput, error) { + req, out := c.GetCallerIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetFederationToken = "GetFederationToken" @@ -833,8 +909,23 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken func (c *STS) GetFederationToken(input *GetFederationTokenInput) (*GetFederationTokenOutput, error) { req, out := c.GetFederationTokenRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetFederationTokenWithContext is the same as GetFederationToken with the addition of +// the ability to pass a context and additional request options. +// +// See GetFederationToken for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *STS) GetFederationTokenWithContext(ctx aws.Context, input *GetFederationTokenInput, opts ...request.Option) (*GetFederationTokenOutput, error) { + req, out := c.GetFederationTokenRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSessionToken = "GetSessionToken" @@ -947,8 +1038,23 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken func (c *STS) GetSessionToken(input *GetSessionTokenInput) (*GetSessionTokenOutput, error) { req, out := c.GetSessionTokenRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSessionTokenWithContext is the same as GetSessionToken with the addition of +// the ability to pass a context and additional request options. +// +// See GetSessionToken for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *STS) GetSessionTokenWithContext(ctx aws.Context, input *GetSessionTokenInput, opts ...request.Option) (*GetSessionTokenOutput, error) { + req, out := c.GetSessionTokenRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleRequest diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go index dbcd66759..e24884ef3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sts diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go index 9c4bfb838..be2183846 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sts diff --git a/vendor/github.com/aws/aws-sdk-go/service/waf/api.go b/vendor/github.com/aws/aws-sdk-go/service/waf/api.go index 153e3a71e..62d8d7f40 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/waf/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/waf/api.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package waf provides a client for AWS WAF. package waf @@ -7,6 +7,7 @@ import ( "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -137,8 +138,23 @@ func (c *WAF) CreateByteMatchSetRequest(input *CreateByteMatchSetInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateByteMatchSet func (c *WAF) CreateByteMatchSet(input *CreateByteMatchSetInput) (*CreateByteMatchSetOutput, error) { req, out := c.CreateByteMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateByteMatchSetWithContext is the same as CreateByteMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateByteMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) CreateByteMatchSetWithContext(ctx aws.Context, input *CreateByteMatchSetInput, opts ...request.Option) (*CreateByteMatchSetOutput, error) { + req, out := c.CreateByteMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateIPSet = "CreateIPSet" @@ -267,8 +283,23 @@ func (c *WAF) CreateIPSetRequest(input *CreateIPSetInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateIPSet func (c *WAF) CreateIPSet(input *CreateIPSetInput) (*CreateIPSetOutput, error) { req, out := c.CreateIPSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateIPSetWithContext is the same as CreateIPSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateIPSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) CreateIPSetWithContext(ctx aws.Context, input *CreateIPSetInput, opts ...request.Option) (*CreateIPSetOutput, error) { + req, out := c.CreateIPSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateRule = "CreateRule" @@ -407,8 +438,23 @@ func (c *WAF) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRule func (c *WAF) CreateRule(input *CreateRuleInput) (*CreateRuleOutput, error) { req, out := c.CreateRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateRuleWithContext is the same as CreateRule with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) CreateRuleWithContext(ctx aws.Context, input *CreateRuleInput, opts ...request.Option) (*CreateRuleOutput, error) { + req, out := c.CreateRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSizeConstraintSet = "CreateSizeConstraintSet" @@ -538,8 +584,23 @@ func (c *WAF) CreateSizeConstraintSetRequest(input *CreateSizeConstraintSetInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSizeConstraintSet func (c *WAF) CreateSizeConstraintSet(input *CreateSizeConstraintSetInput) (*CreateSizeConstraintSetOutput, error) { req, out := c.CreateSizeConstraintSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSizeConstraintSetWithContext is the same as CreateSizeConstraintSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSizeConstraintSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) CreateSizeConstraintSetWithContext(ctx aws.Context, input *CreateSizeConstraintSetInput, opts ...request.Option) (*CreateSizeConstraintSetOutput, error) { + req, out := c.CreateSizeConstraintSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateSqlInjectionMatchSet = "CreateSqlInjectionMatchSet" @@ -665,8 +726,23 @@ func (c *WAF) CreateSqlInjectionMatchSetRequest(input *CreateSqlInjectionMatchSe // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSqlInjectionMatchSet func (c *WAF) CreateSqlInjectionMatchSet(input *CreateSqlInjectionMatchSetInput) (*CreateSqlInjectionMatchSetOutput, error) { req, out := c.CreateSqlInjectionMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateSqlInjectionMatchSetWithContext is the same as CreateSqlInjectionMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSqlInjectionMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) CreateSqlInjectionMatchSetWithContext(ctx aws.Context, input *CreateSqlInjectionMatchSetInput, opts ...request.Option) (*CreateSqlInjectionMatchSetOutput, error) { + req, out := c.CreateSqlInjectionMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateWebACL = "CreateWebACL" @@ -804,8 +880,23 @@ func (c *WAF) CreateWebACLRequest(input *CreateWebACLInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACL func (c *WAF) CreateWebACL(input *CreateWebACLInput) (*CreateWebACLOutput, error) { req, out := c.CreateWebACLRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateWebACLWithContext is the same as CreateWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See CreateWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) CreateWebACLWithContext(ctx aws.Context, input *CreateWebACLInput, opts ...request.Option) (*CreateWebACLOutput, error) { + req, out := c.CreateWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opCreateXssMatchSet = "CreateXssMatchSet" @@ -932,8 +1023,23 @@ func (c *WAF) CreateXssMatchSetRequest(input *CreateXssMatchSetInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateXssMatchSet func (c *WAF) CreateXssMatchSet(input *CreateXssMatchSetInput) (*CreateXssMatchSetOutput, error) { req, out := c.CreateXssMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// CreateXssMatchSetWithContext is the same as CreateXssMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateXssMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) CreateXssMatchSetWithContext(ctx aws.Context, input *CreateXssMatchSetInput, opts ...request.Option) (*CreateXssMatchSetOutput, error) { + req, out := c.CreateXssMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteByteMatchSet = "DeleteByteMatchSet" @@ -1045,8 +1151,23 @@ func (c *WAF) DeleteByteMatchSetRequest(input *DeleteByteMatchSetInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteByteMatchSet func (c *WAF) DeleteByteMatchSet(input *DeleteByteMatchSetInput) (*DeleteByteMatchSetOutput, error) { req, out := c.DeleteByteMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteByteMatchSetWithContext is the same as DeleteByteMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteByteMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) DeleteByteMatchSetWithContext(ctx aws.Context, input *DeleteByteMatchSetInput, opts ...request.Option) (*DeleteByteMatchSetOutput, error) { + req, out := c.DeleteByteMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteIPSet = "DeleteIPSet" @@ -1157,8 +1278,23 @@ func (c *WAF) DeleteIPSetRequest(input *DeleteIPSetInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteIPSet func (c *WAF) DeleteIPSet(input *DeleteIPSetInput) (*DeleteIPSetOutput, error) { req, out := c.DeleteIPSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteIPSetWithContext is the same as DeleteIPSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteIPSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) DeleteIPSetWithContext(ctx aws.Context, input *DeleteIPSetInput, opts ...request.Option) (*DeleteIPSetOutput, error) { + req, out := c.DeleteIPSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteRule = "DeleteRule" @@ -1269,8 +1405,23 @@ func (c *WAF) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRule func (c *WAF) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { req, out := c.DeleteRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteRuleWithContext is the same as DeleteRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) DeleteRuleWithContext(ctx aws.Context, input *DeleteRuleInput, opts ...request.Option) (*DeleteRuleOutput, error) { + req, out := c.DeleteRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSizeConstraintSet = "DeleteSizeConstraintSet" @@ -1382,8 +1533,23 @@ func (c *WAF) DeleteSizeConstraintSetRequest(input *DeleteSizeConstraintSetInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSizeConstraintSet func (c *WAF) DeleteSizeConstraintSet(input *DeleteSizeConstraintSetInput) (*DeleteSizeConstraintSetOutput, error) { req, out := c.DeleteSizeConstraintSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSizeConstraintSetWithContext is the same as DeleteSizeConstraintSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSizeConstraintSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) DeleteSizeConstraintSetWithContext(ctx aws.Context, input *DeleteSizeConstraintSetInput, opts ...request.Option) (*DeleteSizeConstraintSetOutput, error) { + req, out := c.DeleteSizeConstraintSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteSqlInjectionMatchSet = "DeleteSqlInjectionMatchSet" @@ -1496,8 +1662,23 @@ func (c *WAF) DeleteSqlInjectionMatchSetRequest(input *DeleteSqlInjectionMatchSe // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSqlInjectionMatchSet func (c *WAF) DeleteSqlInjectionMatchSet(input *DeleteSqlInjectionMatchSetInput) (*DeleteSqlInjectionMatchSetOutput, error) { req, out := c.DeleteSqlInjectionMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteSqlInjectionMatchSetWithContext is the same as DeleteSqlInjectionMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSqlInjectionMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) DeleteSqlInjectionMatchSetWithContext(ctx aws.Context, input *DeleteSqlInjectionMatchSetInput, opts ...request.Option) (*DeleteSqlInjectionMatchSetOutput, error) { + req, out := c.DeleteSqlInjectionMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteWebACL = "DeleteWebACL" @@ -1605,8 +1786,23 @@ func (c *WAF) DeleteWebACLRequest(input *DeleteWebACLInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACL func (c *WAF) DeleteWebACL(input *DeleteWebACLInput) (*DeleteWebACLOutput, error) { req, out := c.DeleteWebACLRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteWebACLWithContext is the same as DeleteWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) DeleteWebACLWithContext(ctx aws.Context, input *DeleteWebACLInput, opts ...request.Option) (*DeleteWebACLOutput, error) { + req, out := c.DeleteWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opDeleteXssMatchSet = "DeleteXssMatchSet" @@ -1718,8 +1914,23 @@ func (c *WAF) DeleteXssMatchSetRequest(input *DeleteXssMatchSetInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteXssMatchSet func (c *WAF) DeleteXssMatchSet(input *DeleteXssMatchSetInput) (*DeleteXssMatchSetOutput, error) { req, out := c.DeleteXssMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// DeleteXssMatchSetWithContext is the same as DeleteXssMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteXssMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) DeleteXssMatchSetWithContext(ctx aws.Context, input *DeleteXssMatchSetInput, opts ...request.Option) (*DeleteXssMatchSetOutput, error) { + req, out := c.DeleteXssMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetByteMatchSet = "GetByteMatchSet" @@ -1791,8 +2002,23 @@ func (c *WAF) GetByteMatchSetRequest(input *GetByteMatchSetInput) (req *request. // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSet func (c *WAF) GetByteMatchSet(input *GetByteMatchSetInput) (*GetByteMatchSetOutput, error) { req, out := c.GetByteMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetByteMatchSetWithContext is the same as GetByteMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetByteMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetByteMatchSetWithContext(ctx aws.Context, input *GetByteMatchSetInput, opts ...request.Option) (*GetByteMatchSetOutput, error) { + req, out := c.GetByteMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetChangeToken = "GetChangeToken" @@ -1871,8 +2097,23 @@ func (c *WAF) GetChangeTokenRequest(input *GetChangeTokenInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeToken func (c *WAF) GetChangeToken(input *GetChangeTokenInput) (*GetChangeTokenOutput, error) { req, out := c.GetChangeTokenRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetChangeTokenWithContext is the same as GetChangeToken with the addition of +// the ability to pass a context and additional request options. +// +// See GetChangeToken for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetChangeTokenWithContext(ctx aws.Context, input *GetChangeTokenInput, opts ...request.Option) (*GetChangeTokenOutput, error) { + req, out := c.GetChangeTokenRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetChangeTokenStatus = "GetChangeTokenStatus" @@ -1950,8 +2191,23 @@ func (c *WAF) GetChangeTokenStatusRequest(input *GetChangeTokenStatusInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenStatus func (c *WAF) GetChangeTokenStatus(input *GetChangeTokenStatusInput) (*GetChangeTokenStatusOutput, error) { req, out := c.GetChangeTokenStatusRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetChangeTokenStatusWithContext is the same as GetChangeTokenStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetChangeTokenStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetChangeTokenStatusWithContext(ctx aws.Context, input *GetChangeTokenStatusInput, opts ...request.Option) (*GetChangeTokenStatusOutput, error) { + req, out := c.GetChangeTokenStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetIPSet = "GetIPSet" @@ -2023,8 +2279,23 @@ func (c *WAF) GetIPSetRequest(input *GetIPSetInput) (req *request.Request, outpu // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSet func (c *WAF) GetIPSet(input *GetIPSetInput) (*GetIPSetOutput, error) { req, out := c.GetIPSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetIPSetWithContext is the same as GetIPSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetIPSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetIPSetWithContext(ctx aws.Context, input *GetIPSetInput, opts ...request.Option) (*GetIPSetOutput, error) { + req, out := c.GetIPSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetRule = "GetRule" @@ -2097,8 +2368,23 @@ func (c *WAF) GetRuleRequest(input *GetRuleInput) (req *request.Request, output // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRule func (c *WAF) GetRule(input *GetRuleInput) (*GetRuleOutput, error) { req, out := c.GetRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetRuleWithContext is the same as GetRule with the addition of +// the ability to pass a context and additional request options. +// +// See GetRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetRuleWithContext(ctx aws.Context, input *GetRuleInput, opts ...request.Option) (*GetRuleOutput, error) { + req, out := c.GetRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSampledRequests = "GetSampledRequests" @@ -2176,8 +2462,23 @@ func (c *WAF) GetSampledRequestsRequest(input *GetSampledRequestsInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSampledRequests func (c *WAF) GetSampledRequests(input *GetSampledRequestsInput) (*GetSampledRequestsOutput, error) { req, out := c.GetSampledRequestsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSampledRequestsWithContext is the same as GetSampledRequests with the addition of +// the ability to pass a context and additional request options. +// +// See GetSampledRequests for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetSampledRequestsWithContext(ctx aws.Context, input *GetSampledRequestsInput, opts ...request.Option) (*GetSampledRequestsOutput, error) { + req, out := c.GetSampledRequestsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSizeConstraintSet = "GetSizeConstraintSet" @@ -2249,8 +2550,23 @@ func (c *WAF) GetSizeConstraintSetRequest(input *GetSizeConstraintSetInput) (req // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSizeConstraintSet func (c *WAF) GetSizeConstraintSet(input *GetSizeConstraintSetInput) (*GetSizeConstraintSetOutput, error) { req, out := c.GetSizeConstraintSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSizeConstraintSetWithContext is the same as GetSizeConstraintSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetSizeConstraintSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetSizeConstraintSetWithContext(ctx aws.Context, input *GetSizeConstraintSetInput, opts ...request.Option) (*GetSizeConstraintSetOutput, error) { + req, out := c.GetSizeConstraintSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetSqlInjectionMatchSet = "GetSqlInjectionMatchSet" @@ -2322,8 +2638,23 @@ func (c *WAF) GetSqlInjectionMatchSetRequest(input *GetSqlInjectionMatchSetInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSet func (c *WAF) GetSqlInjectionMatchSet(input *GetSqlInjectionMatchSetInput) (*GetSqlInjectionMatchSetOutput, error) { req, out := c.GetSqlInjectionMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSqlInjectionMatchSetWithContext is the same as GetSqlInjectionMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetSqlInjectionMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetSqlInjectionMatchSetWithContext(ctx aws.Context, input *GetSqlInjectionMatchSetInput, opts ...request.Option) (*GetSqlInjectionMatchSetOutput, error) { + req, out := c.GetSqlInjectionMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetWebACL = "GetWebACL" @@ -2395,8 +2726,23 @@ func (c *WAF) GetWebACLRequest(input *GetWebACLInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACL func (c *WAF) GetWebACL(input *GetWebACLInput) (*GetWebACLOutput, error) { req, out := c.GetWebACLRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetWebACLWithContext is the same as GetWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See GetWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetWebACLWithContext(ctx aws.Context, input *GetWebACLInput, opts ...request.Option) (*GetWebACLOutput, error) { + req, out := c.GetWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opGetXssMatchSet = "GetXssMatchSet" @@ -2468,8 +2814,23 @@ func (c *WAF) GetXssMatchSetRequest(input *GetXssMatchSetInput) (req *request.Re // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetXssMatchSet func (c *WAF) GetXssMatchSet(input *GetXssMatchSetInput) (*GetXssMatchSetOutput, error) { req, out := c.GetXssMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetXssMatchSetWithContext is the same as GetXssMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetXssMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) GetXssMatchSetWithContext(ctx aws.Context, input *GetXssMatchSetInput, opts ...request.Option) (*GetXssMatchSetOutput, error) { + req, out := c.GetXssMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListByteMatchSets = "ListByteMatchSets" @@ -2538,8 +2899,23 @@ func (c *WAF) ListByteMatchSetsRequest(input *ListByteMatchSetsInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListByteMatchSets func (c *WAF) ListByteMatchSets(input *ListByteMatchSetsInput) (*ListByteMatchSetsOutput, error) { req, out := c.ListByteMatchSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListByteMatchSetsWithContext is the same as ListByteMatchSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListByteMatchSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) ListByteMatchSetsWithContext(ctx aws.Context, input *ListByteMatchSetsInput, opts ...request.Option) (*ListByteMatchSetsOutput, error) { + req, out := c.ListByteMatchSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListIPSets = "ListIPSets" @@ -2608,8 +2984,23 @@ func (c *WAF) ListIPSetsRequest(input *ListIPSetsInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListIPSets func (c *WAF) ListIPSets(input *ListIPSetsInput) (*ListIPSetsOutput, error) { req, out := c.ListIPSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListIPSetsWithContext is the same as ListIPSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListIPSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) ListIPSetsWithContext(ctx aws.Context, input *ListIPSetsInput, opts ...request.Option) (*ListIPSetsOutput, error) { + req, out := c.ListIPSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListRules = "ListRules" @@ -2678,8 +3069,23 @@ func (c *WAF) ListRulesRequest(input *ListRulesInput) (req *request.Request, out // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRules func (c *WAF) ListRules(input *ListRulesInput) (*ListRulesOutput, error) { req, out := c.ListRulesRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListRulesWithContext is the same as ListRules with the addition of +// the ability to pass a context and additional request options. +// +// See ListRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) ListRulesWithContext(ctx aws.Context, input *ListRulesInput, opts ...request.Option) (*ListRulesOutput, error) { + req, out := c.ListRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListSizeConstraintSets = "ListSizeConstraintSets" @@ -2748,8 +3154,23 @@ func (c *WAF) ListSizeConstraintSetsRequest(input *ListSizeConstraintSetsInput) // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSizeConstraintSets func (c *WAF) ListSizeConstraintSets(input *ListSizeConstraintSetsInput) (*ListSizeConstraintSetsOutput, error) { req, out := c.ListSizeConstraintSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListSizeConstraintSetsWithContext is the same as ListSizeConstraintSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListSizeConstraintSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) ListSizeConstraintSetsWithContext(ctx aws.Context, input *ListSizeConstraintSetsInput, opts ...request.Option) (*ListSizeConstraintSetsOutput, error) { + req, out := c.ListSizeConstraintSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListSqlInjectionMatchSets = "ListSqlInjectionMatchSets" @@ -2818,8 +3239,23 @@ func (c *WAF) ListSqlInjectionMatchSetsRequest(input *ListSqlInjectionMatchSetsI // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSqlInjectionMatchSets func (c *WAF) ListSqlInjectionMatchSets(input *ListSqlInjectionMatchSetsInput) (*ListSqlInjectionMatchSetsOutput, error) { req, out := c.ListSqlInjectionMatchSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListSqlInjectionMatchSetsWithContext is the same as ListSqlInjectionMatchSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListSqlInjectionMatchSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) ListSqlInjectionMatchSetsWithContext(ctx aws.Context, input *ListSqlInjectionMatchSetsInput, opts ...request.Option) (*ListSqlInjectionMatchSetsOutput, error) { + req, out := c.ListSqlInjectionMatchSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListWebACLs = "ListWebACLs" @@ -2888,8 +3324,23 @@ func (c *WAF) ListWebACLsRequest(input *ListWebACLsInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListWebACLs func (c *WAF) ListWebACLs(input *ListWebACLsInput) (*ListWebACLsOutput, error) { req, out := c.ListWebACLsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListWebACLsWithContext is the same as ListWebACLs with the addition of +// the ability to pass a context and additional request options. +// +// See ListWebACLs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) ListWebACLsWithContext(ctx aws.Context, input *ListWebACLsInput, opts ...request.Option) (*ListWebACLsOutput, error) { + req, out := c.ListWebACLsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opListXssMatchSets = "ListXssMatchSets" @@ -2958,8 +3409,23 @@ func (c *WAF) ListXssMatchSetsRequest(input *ListXssMatchSetsInput) (req *reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListXssMatchSets func (c *WAF) ListXssMatchSets(input *ListXssMatchSetsInput) (*ListXssMatchSetsOutput, error) { req, out := c.ListXssMatchSetsRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// ListXssMatchSetsWithContext is the same as ListXssMatchSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListXssMatchSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) ListXssMatchSetsWithContext(ctx aws.Context, input *ListXssMatchSetsInput, opts ...request.Option) (*ListXssMatchSetsOutput, error) { + req, out := c.ListXssMatchSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateByteMatchSet = "UpdateByteMatchSet" @@ -3140,8 +3606,23 @@ func (c *WAF) UpdateByteMatchSetRequest(input *UpdateByteMatchSetInput) (req *re // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateByteMatchSet func (c *WAF) UpdateByteMatchSet(input *UpdateByteMatchSetInput) (*UpdateByteMatchSetOutput, error) { req, out := c.UpdateByteMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateByteMatchSetWithContext is the same as UpdateByteMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateByteMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) UpdateByteMatchSetWithContext(ctx aws.Context, input *UpdateByteMatchSetInput, opts ...request.Option) (*UpdateByteMatchSetOutput, error) { + req, out := c.UpdateByteMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateIPSet = "UpdateIPSet" @@ -3342,8 +3823,23 @@ func (c *WAF) UpdateIPSetRequest(input *UpdateIPSetInput) (req *request.Request, // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateIPSet func (c *WAF) UpdateIPSet(input *UpdateIPSetInput) (*UpdateIPSetOutput, error) { req, out := c.UpdateIPSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateIPSetWithContext is the same as UpdateIPSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateIPSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) UpdateIPSetWithContext(ctx aws.Context, input *UpdateIPSetInput, opts ...request.Option) (*UpdateIPSetOutput, error) { + req, out := c.UpdateIPSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateRule = "UpdateRule" @@ -3528,8 +4024,23 @@ func (c *WAF) UpdateRuleRequest(input *UpdateRuleInput) (req *request.Request, o // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRule func (c *WAF) UpdateRule(input *UpdateRuleInput) (*UpdateRuleOutput, error) { req, out := c.UpdateRuleRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateRuleWithContext is the same as UpdateRule with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) UpdateRuleWithContext(ctx aws.Context, input *UpdateRuleInput, opts ...request.Option) (*UpdateRuleOutput, error) { + req, out := c.UpdateRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateSizeConstraintSet = "UpdateSizeConstraintSet" @@ -3720,8 +4231,23 @@ func (c *WAF) UpdateSizeConstraintSetRequest(input *UpdateSizeConstraintSetInput // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSizeConstraintSet func (c *WAF) UpdateSizeConstraintSet(input *UpdateSizeConstraintSetInput) (*UpdateSizeConstraintSetOutput, error) { req, out := c.UpdateSizeConstraintSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateSizeConstraintSetWithContext is the same as UpdateSizeConstraintSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSizeConstraintSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) UpdateSizeConstraintSetWithContext(ctx aws.Context, input *UpdateSizeConstraintSetInput, opts ...request.Option) (*UpdateSizeConstraintSetOutput, error) { + req, out := c.UpdateSizeConstraintSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateSqlInjectionMatchSet = "UpdateSqlInjectionMatchSet" @@ -3897,8 +4423,23 @@ func (c *WAF) UpdateSqlInjectionMatchSetRequest(input *UpdateSqlInjectionMatchSe // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSqlInjectionMatchSet func (c *WAF) UpdateSqlInjectionMatchSet(input *UpdateSqlInjectionMatchSetInput) (*UpdateSqlInjectionMatchSetOutput, error) { req, out := c.UpdateSqlInjectionMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateSqlInjectionMatchSetWithContext is the same as UpdateSqlInjectionMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSqlInjectionMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) UpdateSqlInjectionMatchSetWithContext(ctx aws.Context, input *UpdateSqlInjectionMatchSetInput, opts ...request.Option) (*UpdateSqlInjectionMatchSetOutput, error) { + req, out := c.UpdateSqlInjectionMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateWebACL = "UpdateWebACL" @@ -4093,8 +4634,23 @@ func (c *WAF) UpdateWebACLRequest(input *UpdateWebACLInput) (req *request.Reques // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateWebACL func (c *WAF) UpdateWebACL(input *UpdateWebACLInput) (*UpdateWebACLOutput, error) { req, out := c.UpdateWebACLRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateWebACLWithContext is the same as UpdateWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) UpdateWebACLWithContext(ctx aws.Context, input *UpdateWebACLInput, opts ...request.Option) (*UpdateWebACLOutput, error) { + req, out := c.UpdateWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } const opUpdateXssMatchSet = "UpdateXssMatchSet" @@ -4270,8 +4826,23 @@ func (c *WAF) UpdateXssMatchSetRequest(input *UpdateXssMatchSetInput) (req *requ // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateXssMatchSet func (c *WAF) UpdateXssMatchSet(input *UpdateXssMatchSetInput) (*UpdateXssMatchSetOutput, error) { req, out := c.UpdateXssMatchSetRequest(input) - err := req.Send() - return out, err + return out, req.Send() +} + +// UpdateXssMatchSetWithContext is the same as UpdateXssMatchSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateXssMatchSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAF) UpdateXssMatchSetWithContext(ctx aws.Context, input *UpdateXssMatchSetInput, opts ...request.Option) (*UpdateXssMatchSetOutput, error) { + req, out := c.UpdateXssMatchSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // The ActivatedRule object in an UpdateWebACL request specifies a Rule that diff --git a/vendor/github.com/aws/aws-sdk-go/service/waf/errors.go b/vendor/github.com/aws/aws-sdk-go/service/waf/errors.go index e5671e050..9a4b8884f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/waf/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/waf/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package waf diff --git a/vendor/github.com/aws/aws-sdk-go/service/waf/service.go b/vendor/github.com/aws/aws-sdk-go/service/waf/service.go index 700ef9cfd..dadb9ca7b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/waf/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/waf/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package waf diff --git a/vendor/vendor.json b/vendor/vendor.json index 71ab6e7e7..18d669dda 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -50,6 +50,14 @@ "version": "v8.1.0-beta", "versionExact": "v8.1.0-beta" }, + { + "checksumSHA1": "iAZi+Mh1Tivk3bdBbAEz+bd5nPg=", + "path": "github.com/Azure/azure-sdk-for-go/arm/disk", + "revision": "ecf40e315d5ab0ca6d7b3b7f7fbb5c1577814813", + "revisionTime": "2017-03-02T00:14:02Z", + "version": "v8.1.0-beta", + "versionExact": "v8.1.0-beta" + }, { "checksumSHA1": "ro1i9qoJcSgbWgV7D93wXhBwoL8=", "comment": "v2.1.1-beta-8-gca4d906", @@ -486,636 +494,628 @@ "revisionTime": "2017-01-23T00:46:44Z" }, { - "checksumSHA1": "vgQ6NEtijFyvN0+Ulc48KPhRLQ8=", + "checksumSHA1": "YSO8t4sb+6eeyWkhGWZmhdrcT5w=", "path": "github.com/aws/aws-sdk-go", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "TZ18dAT4T7uCQT1XESgmvLuyG9I=", + "checksumSHA1": "7N25Nj1APtvRF3NElp7gNrHYJkE=", "path": "github.com/aws/aws-sdk-go/aws", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "Y9W+4GimK4Fuxq+vyIskVYFRnX4=", "path": "github.com/aws/aws-sdk-go/aws/awserr", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "yyYr41HZ1Aq0hWc3J5ijXwYEcac=", "path": "github.com/aws/aws-sdk-go/aws/awsutil", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "iThCyNRL/oQFD9CF2SYgBGl+aww=", "path": "github.com/aws/aws-sdk-go/aws/client", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "ieAJ+Cvp/PKv1LpUEnUXpc3OI6E=", "path": "github.com/aws/aws-sdk-go/aws/client/metadata", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "Fl8vRSCY0MbM04cmiz/0MID+goA=", + "checksumSHA1": "0Gfk83qXYimO87ZoK1lL9+ifWHo=", "path": "github.com/aws/aws-sdk-go/aws/corehandlers", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "zu5C95rmCZff6NYZb62lEaT5ibE=", + "checksumSHA1": "P7gt3PNk6bDOoTZ2N9QOonkaGWw=", "path": "github.com/aws/aws-sdk-go/aws/credentials", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "u3GOAJLmdvbuNUeUEcZSEAOeL/0=", "path": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "NUJUTWlc1sV8b7WjfiYc4JZbXl0=", "path": "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "6cj/zsRmcxkE1TLS+v910GbQYg0=", "path": "github.com/aws/aws-sdk-go/aws/credentials/stscreds", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "lqh3fG7wCochvB4iHAZJuhhEJW0=", + "checksumSHA1": "l2O7P/kvovK2zxKhuFehFNXLk+Q=", "path": "github.com/aws/aws-sdk-go/aws/defaults", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "/EXbk/z2TWjWc1Hvb4QYs3Wmhb8=", "path": "github.com/aws/aws-sdk-go/aws/ec2metadata", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "Y/H3JXynvwx55rAbQg6g2hCouB8=", + "checksumSHA1": "+yCOae0vRONrO27QiITkGWblOKk=", "path": "github.com/aws/aws-sdk-go/aws/endpoints", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "M78rTxU55Qagqr3MYj91im2031E=", + "checksumSHA1": "f5/e+cN80DRK0I2gqbZ0ikSJqhM=", "path": "github.com/aws/aws-sdk-go/aws/request", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "5pzA5afgeU1alfACFh8z2CDUMao=", "path": "github.com/aws/aws-sdk-go/aws/session", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "0FvPLvkBUpTElfUc/FZtPsJfuV0=", + "checksumSHA1": "SvIsunO8D9MEKbetMENA4WRnyeE=", "path": "github.com/aws/aws-sdk-go/aws/signer/v4", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "wk7EyvDaHwb5qqoOP/4d3cV0708=", "path": "github.com/aws/aws-sdk-go/private/protocol", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "1QmQ3FqV37w0Zi44qv8pA1GeR0A=", "path": "github.com/aws/aws-sdk-go/private/protocol/ec2query", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "O6hcK24yI6w7FA+g4Pbr+eQ7pys=", "path": "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "R00RL5jJXRYq1iiK1+PGvMfvXyM=", "path": "github.com/aws/aws-sdk-go/private/protocol/jsonrpc", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "ZqY5RWavBLWTo6j9xqdyBEaNFRk=", "path": "github.com/aws/aws-sdk-go/private/protocol/query", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "Drt1JfLMa0DQEZLWrnMlTWaIcC8=", "path": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "szZSLm3BlYkL3vqlZhNAlYk8iwM=", + "checksumSHA1": "VCTh+dEaqqhog5ncy/WTt9+/gFM=", "path": "github.com/aws/aws-sdk-go/private/protocol/rest", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "Rpu8KBtHZgvhkwHxUfaky+qW+G4=", "path": "github.com/aws/aws-sdk-go/private/protocol/restjson", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "ODo+ko8D6unAxZuN1jGzMcN4QCc=", "path": "github.com/aws/aws-sdk-go/private/protocol/restxml", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "lZ1z4xAbT8euCzKoAsnEYic60VE=", "path": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "F6mth+G7dXN1GI+nktaGo8Lx8aE=", "path": "github.com/aws/aws-sdk-go/private/signer/v2", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "Eo9yODN5U99BK0pMzoqnBm7PCrY=", - "path": "github.com/aws/aws-sdk-go/private/waiter", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" - }, - { - "checksumSHA1": "9n/Gdm1mNIxB7eXRZR+LP2pLjr8=", + "checksumSHA1": "ZmojxECvjM6BeI752BPyZAmOhlo=", "path": "github.com/aws/aws-sdk-go/service/acm", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "Ykf7vcT+gAM+nsZ2vfRbWR51iqM=", + "checksumSHA1": "H3h5AMX7c9oT50oovfJIfmkvoBg=", "path": "github.com/aws/aws-sdk-go/service/apigateway", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "vywzqp8jtu1rUKkb/4LEld2yOgQ=", + "checksumSHA1": "3ykAVetHFs9T3YivIPvRyiNFdys=", "path": "github.com/aws/aws-sdk-go/service/applicationautoscaling", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "0/2niio3ok72EAFl/s3S/E/yabc=", + "checksumSHA1": "/d8U22aF2+qYhWYscPzClHTDCP4=", "path": "github.com/aws/aws-sdk-go/service/autoscaling", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "rKlCBX8p5aFkljRSWug8chDKOsU=", + "checksumSHA1": "n6v4S6jPpkHsS59Oj1EZPQIdRNg=", "path": "github.com/aws/aws-sdk-go/service/cloudformation", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "FKms6qE/E3ZLLV90G877CrXJwpk=", + "checksumSHA1": "QLEaEFA3V4n+ohwENEoWV+AXBj4=", "path": "github.com/aws/aws-sdk-go/service/cloudfront", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "JkCPEbRbVHODZ8hw8fRRB0ow0+s=", + "checksumSHA1": "Vh3PtQEwIUabpoE7PsCZItUZuVc=", "path": "github.com/aws/aws-sdk-go/service/cloudtrail", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "ZnIZiTYeRgS2393kOcYxNL0qAUQ=", + "checksumSHA1": "aGx2atOHEXSowjXUQ3UoJ/t2LSI=", "path": "github.com/aws/aws-sdk-go/service/cloudwatch", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "eil1c4KFMkqPN+ng7GsMlBV8TFc=", + "checksumSHA1": "Ez3+aU0QGRe4isLDFQuHNRyF3zA=", "path": "github.com/aws/aws-sdk-go/service/cloudwatchevents", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "TMRiIJYbg0/5naYSnYk3DQnaDkk=", + "checksumSHA1": "+AjVMO3KUY7Wkh0vHRnJqRG8kGc=", "path": "github.com/aws/aws-sdk-go/service/cloudwatchlogs", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "8T0+kiovp+vGclOMZMajizGsG54=", + "checksumSHA1": "uTt6pA8eB+udA7tC8ElLbr2eeK4=", "path": "github.com/aws/aws-sdk-go/service/codebuild", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "JKGhzZ6hg3myUEnNndjUyamloN4=", + "checksumSHA1": "sqppuUIMPMBOnTRVR4BhHAoaTrY=", "path": "github.com/aws/aws-sdk-go/service/codecommit", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "Lw5wzTslFwdkfXupmArobCYb6G8=", + "checksumSHA1": "u6cK2krOuDqi8gy5V316FvH34t0=", "path": "github.com/aws/aws-sdk-go/service/codedeploy", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "LXjLQyMAadcANG0UURWuw4di2YE=", + "checksumSHA1": "fK7MOfX/cV2DJ176+umySuuYh2s=", "path": "github.com/aws/aws-sdk-go/service/codepipeline", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "NYRd4lqocAcZdkEvLHAZYyXz8Bs=", + "checksumSHA1": "gSm1lj0J4klQMw7jHE0fU/RV+4Y=", "path": "github.com/aws/aws-sdk-go/service/configservice", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "fcYSy6jPQjLB7mtOfxsMqWnjobU=", + "checksumSHA1": "SP6m/hn+Hj72wkgaAZ8NM/7s/18=", "path": "github.com/aws/aws-sdk-go/service/databasemigrationservice", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "efnIi8bx7cQJ46T9mtzg/SFRqLI=", + "checksumSHA1": "2Su2xzCbUPbCdVkyWuXcmxAI2Rs=", "path": "github.com/aws/aws-sdk-go/service/directoryservice", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "D5tbr+FKR8BUU0HxxGB9pS9Dlrc=", + "checksumSHA1": "Y4Wg7dxPIU3W1dqN3vnpSLA1ChQ=", "path": "github.com/aws/aws-sdk-go/service/dynamodb", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "ecCVL8+SptmQlojrGtL8mQdaJ6E=", + "checksumSHA1": "2PIG7uhrvvDAjiNZINBVCgW/Uds=", "path": "github.com/aws/aws-sdk-go/service/ec2", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "B6qHy1+Rrp9lQCBR/JDRT72kuCI=", + "checksumSHA1": "ClGPl4TLpf457zUeOEWyTvqBRjc=", "path": "github.com/aws/aws-sdk-go/service/ecr", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "UFpKfwRxhzQk3pCbBrBa2RsPL24=", + "checksumSHA1": "c6KWQtc1bRCFs/IuIe/jgZXalBw=", "path": "github.com/aws/aws-sdk-go/service/ecs", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "jTTOfudaj/nYDyLCig9SKlDFFHk=", + "checksumSHA1": "4mBZS9FSCW73hcjj0CikPqpikag=", "path": "github.com/aws/aws-sdk-go/service/efs", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "5ZYWoEnb0SID/9cKRb1oGPrrhsA=", + "checksumSHA1": "i1XF+NR9mzU/ftbzd2zoxl07x1A=", "path": "github.com/aws/aws-sdk-go/service/elasticache", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "oVV/BlLfwPI+iycKd9PIQ7oLm/4=", + "checksumSHA1": "DXs9Zpa2Db2adBjDi/EyFp6913E=", "path": "github.com/aws/aws-sdk-go/service/elasticbeanstalk", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "yvQhmYq5ZKkKooTgkZ+M6032Vr0=", + "checksumSHA1": "dv1QkeLjDyUlMQkbnLjm6l0mJHo=", "path": "github.com/aws/aws-sdk-go/service/elasticsearchservice", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "M1+iJ/A2Ml8bxSJFrBr/jWsv9w0=", + "checksumSHA1": "ir6xGAYAwIdWKgk7BVHNQWvlA/g=", "path": "github.com/aws/aws-sdk-go/service/elastictranscoder", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "BjzlDfZp1UvDoFfFnkwBxJxtylg=", + "checksumSHA1": "sdFllfq+lllwyk0yMFmWzg+qs9Y=", "path": "github.com/aws/aws-sdk-go/service/elb", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "42TACCjZnJKGuF4ijfLpKUpw4/I=", + "checksumSHA1": "ky/x/8q7MyKV495TI9wkMKXZFp0=", "path": "github.com/aws/aws-sdk-go/service/elbv2", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "lJcieoov9dRhwpuEBasKweL7Mzo=", + "checksumSHA1": "tLfj5mQiTOOhWdeU6hL5PYRAEP0=", "path": "github.com/aws/aws-sdk-go/service/emr", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "1O87s9AddHMbwCu6ooNULcW9iE8=", + "checksumSHA1": "Yy7CkVZR1/vrcdMPWJmQMC2i5hk=", "path": "github.com/aws/aws-sdk-go/service/firehose", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "g5xmBO7nAUGV2yT8SAL2tfP8DUU=", + "checksumSHA1": "tuoOAm2gCN2txnIq1jKbCHqeQQM=", "path": "github.com/aws/aws-sdk-go/service/glacier", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "7JybKGBdRMLcnHP+126VLsnVghM=", + "checksumSHA1": "NoG5QpuGo3iLNk6DwwWsDCogfGY=", "path": "github.com/aws/aws-sdk-go/service/iam", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "Bk6ExT97T4NMOyXthMr6Avm34mg=", + "checksumSHA1": "5ElupFtEcDvKa1yXTh6nR9HijMU=", "path": "github.com/aws/aws-sdk-go/service/inspector", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "lUmFKbtBQn9S4qrD5GOd57PIU1c=", + "checksumSHA1": "g36tdw9s90aUjSoUmpcLViHKQdI=", "path": "github.com/aws/aws-sdk-go/service/kinesis", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "l1NpLkHXS+eDybfk4Al9Afhyf/4=", + "checksumSHA1": "zeEh/FDxM81fU3X2ftWU2Z++iQg=", "path": "github.com/aws/aws-sdk-go/service/kms", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "8kUY3AExG/gcAJ2I2a5RCSoxx5I=", + "checksumSHA1": "bHA5BLaVmAq8G5R40tv/X3HF5J0=", "path": "github.com/aws/aws-sdk-go/service/lambda", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "Ab4YFGFLtEBEIpr8kHkLjB7ydGY=", + "checksumSHA1": "GFXjkh1wWzohbefi1k0N+zbkmU4=", "path": "github.com/aws/aws-sdk-go/service/lightsail", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "c3N3uwWuXjwio6NNDAlDr0oUUXk=", + "checksumSHA1": "AB2pSc+tsnoNxFg0fSMDn7rFZbM=", "path": "github.com/aws/aws-sdk-go/service/opsworks", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "ra0UNwqr9Ic/fsEGk41dvl5jqbs=", + "checksumSHA1": "5Br7nJBgOm6y67Z95CGZtOaxlFY=", "path": "github.com/aws/aws-sdk-go/service/rds", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "09fncNHyk8Tcw9Ailvi0pi9F1Xc=", + "checksumSHA1": "COvVop5UbeJ4P0cMu+0ekubPLtE=", "path": "github.com/aws/aws-sdk-go/service/redshift", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "VWVMEqjfDDgB14lgsv0Zq3dQclU=", + "checksumSHA1": "e/lUvi2TAO9hms6HOzpX61exefw=", "path": "github.com/aws/aws-sdk-go/service/route53", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "eEWM4wKzVbRqAwIy3MdMCDUGs2s=", + "checksumSHA1": "o7qpn0kxj43Ej/RwfCb9JbzfbfQ=", "path": "github.com/aws/aws-sdk-go/service/s3", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "4NNi2Ab0iPu/MRGo/kn20mTNxg4=", + "checksumSHA1": "/2UKYWNc/LRv+M/LQRpJqukcXzc=", "path": "github.com/aws/aws-sdk-go/service/ses", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "KpqdFUB/0gBsouCqZmflQ4YPXB0=", + "checksumSHA1": "eUrUJOZg3sQHWyYKPRPO9OeN+a4=", "path": "github.com/aws/aws-sdk-go/service/sfn", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "cRGam+7Yt9Ys4WQH6TNYg+Fjf20=", + "checksumSHA1": "CVWvzoJ3YBvEI8TdQWlqUxOt9lk=", "path": "github.com/aws/aws-sdk-go/service/simpledb", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "3wN8qn+1be7xe/0zXrOM502s+8M=", + "checksumSHA1": "bJ8g3OhBAkxM+QaFrQCD0L0eWY8=", "path": "github.com/aws/aws-sdk-go/service/sns", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "pMyhp8ffTMnHDoF+Wu0rcvhVoNE=", + "checksumSHA1": "jzKBnso2Psx3CyS+0VR1BzvuccU=", "path": "github.com/aws/aws-sdk-go/service/sqs", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "UEVVPCLpzuLRBIZI7X1A8mIpSuA=", + "checksumSHA1": "GPD+dDmDtseJFG8lB8aU58aszDg=", "path": "github.com/aws/aws-sdk-go/service/ssm", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "Knj17ZMPWkGYTm2hZxEgnuboMM4=", + "checksumSHA1": "SdsHiTUR9eRarThv/i7y6/rVyF4=", "path": "github.com/aws/aws-sdk-go/service/sts", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { - "checksumSHA1": "C99KOCRh6qMcFwKFZy3r8we9NNE=", + "checksumSHA1": "w3+CyiPRk1WUFFmueIRZkgQuHH0=", "path": "github.com/aws/aws-sdk-go/service/waf", - "revision": "695fe24acaf9afe80b0ce261d4637f42ba0b4c7d", - "revisionTime": "2017-03-13T22:48:26Z", - "version": "v1", - "versionExact": "v1.7.9" + "revision": "3a4119172097bf8725eb7c1b96b7957cfe2d92dc", + "revisionTime": "2017-04-04T17:58:04Z", + "version": "v1.8.8", + "versionExact": "v1.8.8" }, { "checksumSHA1": "nqw2Qn5xUklssHTubS5HDvEL9L4=", diff --git a/website/Gemfile b/website/Gemfile index 08e6fe65e..405a8c992 100644 --- a/website/Gemfile +++ b/website/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -gem "middleman-hashicorp", "0.3.13" +gem "middleman-hashicorp", "0.3.22" diff --git a/website/Gemfile.lock b/website/Gemfile.lock index 0811f6d62..229218ac9 100644 --- a/website/Gemfile.lock +++ b/website/Gemfile.lock @@ -6,7 +6,7 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - autoprefixer-rails (6.7.6) + autoprefixer-rails (6.7.7.1) execjs bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) @@ -77,7 +77,7 @@ GEM rack (>= 1.4.5, < 2.0) thor (>= 0.15.2, < 2.0) tilt (~> 1.4.1, < 2.0) - middleman-hashicorp (0.3.13) + middleman-hashicorp (0.3.22) bootstrap-sass (~> 3.3) builder (~> 3.2) middleman (~> 3.4) @@ -103,7 +103,7 @@ GEM mini_portile2 (2.1.0) minitest (5.10.1) multi_json (1.12.1) - nokogiri (1.7.0.1) + nokogiri (1.7.1) mini_portile2 (~> 2.1.0) padrino-helpers (0.12.8.1) i18n (~> 0.6, >= 0.6.7) @@ -138,7 +138,7 @@ GEM turbolinks (5.0.1) turbolinks-source (~> 5) turbolinks-source (5.0.0) - tzinfo (1.2.2) + tzinfo (1.2.3) thread_safe (~> 0.1) uber (0.0.15) uglifier (2.7.2) @@ -151,7 +151,7 @@ PLATFORMS ruby DEPENDENCIES - middleman-hashicorp (= 0.3.13) + middleman-hashicorp (= 0.3.22) BUNDLED WITH 1.14.6 diff --git a/website/Makefile b/website/Makefile index 41fcf114e..d7620d1c2 100644 --- a/website/Makefile +++ b/website/Makefile @@ -1,14 +1,24 @@ -VERSION?="0.3.13" +VERSION?="0.3.22" + +build: + @echo "==> Starting build in Docker..." + @docker run \ + --interactive \ + --rm \ + --tty \ + --volume "$(shell pwd):/website" \ + hashicorp/middleman-hashicorp:${VERSION} \ + bundle exec middleman build --verbose --clean website: @echo "==> Starting website in Docker..." @docker run \ - --interactive \ - --rm \ + --interactive \ + --rm \ --tty \ --publish "4567:4567" \ --publish "35729:35729" \ --volume "$(shell pwd):/website" \ hashicorp/middleman-hashicorp:${VERSION} -.PHONY: website +.PHONY: build website diff --git a/website/config.rb b/website/config.rb index 6e2d25511..b58df71f0 100644 --- a/website/config.rb +++ b/website/config.rb @@ -7,6 +7,15 @@ activate :hashicorp do |h| end helpers do + # Returns the FQDN of the image URL. + # + # @param [String] path + # + # @return [String] + def image_url(path) + File.join(base_url, image_path(path)) + end + # Get the title for the page. # # @param [Middleman::Page] page @@ -26,17 +35,66 @@ helpers do # # @return [String] def description_for(page) - return escape_html(page.data.description || "") + description = (page.data.description || "") + .gsub('"', '') + .gsub(/\n+/, ' ') + .squeeze(' ') + + return escape_html(description) end # This helps by setting the "active" class for sidebar nav elements # if the YAML frontmatter matches the expected value. def sidebar_current(expected) current = current_page.data.sidebar_current || "" - if current == expected or (expected.is_a?(Regexp) and expected.match(current)) + if current.start_with?(expected) return " class=\"active\"" else return "" end end + + # Returns the id for this page. + # @return [String] + def body_id_for(page) + if !(name = page.data.sidebar_current).blank? + return "page-#{name.strip}" + end + if page.url == "/" || page.url == "/index.html" + return "page-home" + end + if !(title = page.data.page_title).blank? + return title + .downcase + .gsub('"', '') + .gsub(/[^\w]+/, '-') + .gsub(/_+/, '-') + .squeeze('-') + .squeeze(' ') + end + return "" + end + + # Returns the list of classes for this page. + # @return [String] + def body_classes_for(page) + classes = [] + + if !(layout = page.data.layout).blank? + classes << "layout-#{page.data.layout}" + end + + if !(title = page.data.page_title).blank? + title = title + .downcase + .gsub('"', '') + .gsub(/[^\w]+/, '-') + .gsub(/_+/, '-') + .squeeze('-') + .squeeze(' ') + classes << "page-#{title}" + end + + return classes.join(" ") + end end diff --git a/website/packer.json b/website/packer.json index b51f63801..35de63232 100644 --- a/website/packer.json +++ b/website/packer.json @@ -8,7 +8,7 @@ "builders": [ { "type": "docker", - "image": "hashicorp/middleman-hashicorp:0.3.13", + "image": "hashicorp/middleman-hashicorp:0.3.22", "discard": "true", "run_command": ["-d", "-i", "-t", "{{ .Image }}", "/bin/sh"] } diff --git a/website/source/.gitignore b/website/source/.gitignore deleted file mode 100644 index 67550a149..000000000 --- a/website/source/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Source folder -node_modules/ diff --git a/website/source/404.html.erb b/website/source/404.html.erb deleted file mode 100644 index f49742d5d..000000000 --- a/website/source/404.html.erb +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: "inner" -noindex: true -page_title: "404" ---- - -

Page not found

- -

-Unfortunately, the page you requested can't be found. -

diff --git a/website/source/404.html.md b/website/source/404.html.md new file mode 100644 index 000000000..e99ce088b --- /dev/null +++ b/website/source/404.html.md @@ -0,0 +1,14 @@ +--- +layout: "inner" +page_title: "Not Found" +noindex: true +description: |- + Page not found! +--- + +# Page Not Found + +Sorry, the page you tried to visit does not exist. This could be our fault, +and if so we will fix that up right away. + +Please go back, or go back to get back on track. diff --git a/website/source/android-manifest.json.erb b/website/source/android-manifest.json.erb new file mode 100644 index 000000000..224636a38 --- /dev/null +++ b/website/source/android-manifest.json.erb @@ -0,0 +1,18 @@ +{ + "name": "HashiCorp Terraform", + "icons": [ + { + "src": "<%= image_path('favicons/android-chrome-192x192.png') %>", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "<%= image_path('favicons/android-chrome-512x512.png') %>", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/website/source/assets/files/press-kit.zip b/website/source/assets/files/press-kit.zip new file mode 100644 index 000000000..dde265f79 Binary files /dev/null and b/website/source/assets/files/press-kit.zip differ diff --git a/website/source/assets/images/bg-galaxy.jpg b/website/source/assets/images/bg-galaxy.jpg deleted file mode 100644 index 587004afa..000000000 Binary files a/website/source/assets/images/bg-galaxy.jpg and /dev/null differ diff --git a/website/source/assets/images/bg-static.png b/website/source/assets/images/bg-static.png deleted file mode 100644 index 7d6436172..000000000 Binary files a/website/source/assets/images/bg-static.png and /dev/null differ diff --git a/website/source/assets/images/customer-logos/capital-one.svg b/website/source/assets/images/customer-logos/capital-one.svg deleted file mode 100644 index a03474332..000000000 --- a/website/source/assets/images/customer-logos/capital-one.svg +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/website/source/assets/images/customer-logos/hbo.svg b/website/source/assets/images/customer-logos/hbo.svg deleted file mode 100644 index 784d540d0..000000000 --- a/website/source/assets/images/customer-logos/hbo.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - diff --git a/website/source/assets/images/customer-logos/home-depot.svg b/website/source/assets/images/customer-logos/home-depot.svg deleted file mode 100644 index 553b5ef97..000000000 --- a/website/source/assets/images/customer-logos/home-depot.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - diff --git a/website/source/assets/images/customer-logos/hotels-dot-com.svg b/website/source/assets/images/customer-logos/hotels-dot-com.svg deleted file mode 100644 index 1d84ec6e6..000000000 --- a/website/source/assets/images/customer-logos/hotels-dot-com.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/website/source/assets/images/customer-logos/nike.svg b/website/source/assets/images/customer-logos/nike.svg deleted file mode 100644 index 51fa23ceb..000000000 --- a/website/source/assets/images/customer-logos/nike.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/website/source/assets/images/customer-logos/target.svg b/website/source/assets/images/customer-logos/target.svg deleted file mode 100644 index 4d8094a6a..000000000 --- a/website/source/assets/images/customer-logos/target.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/website/source/assets/images/docs/atlas-workflow.png b/website/source/assets/images/docs/atlas-workflow.png deleted file mode 100644 index 144e2cedc..000000000 Binary files a/website/source/assets/images/docs/atlas-workflow.png and /dev/null differ diff --git a/website/source/assets/images/graph-example.png b/website/source/assets/images/docs/graph-example.png similarity index 100% rename from website/source/assets/images/graph-example.png rename to website/source/assets/images/docs/graph-example.png diff --git a/website/source/assets/images/enterprise-callout-bg copy.svg b/website/source/assets/images/enterprise-callout-bg copy.svg new file mode 100644 index 000000000..14a97072a --- /dev/null +++ b/website/source/assets/images/enterprise-callout-bg copy.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/website/source/assets/images/enterprise-callout-bg.svg b/website/source/assets/images/enterprise-callout-bg.svg index c7c2649f2..ee4ba0afc 100644 --- a/website/source/assets/images/enterprise-callout-bg.svg +++ b/website/source/assets/images/enterprise-callout-bg.svg @@ -1,21 +1,8 @@ - - - - - - - - - - - - - - - - + + + + + + + diff --git a/website/source/assets/images/favicon.png b/website/source/assets/images/favicon.png deleted file mode 100644 index 14d04676c..000000000 Binary files a/website/source/assets/images/favicon.png and /dev/null differ diff --git a/website/source/assets/images/favicons/android-chrome-192x192.png b/website/source/assets/images/favicons/android-chrome-192x192.png new file mode 100644 index 000000000..c35bdbed5 Binary files /dev/null and b/website/source/assets/images/favicons/android-chrome-192x192.png differ diff --git a/website/source/assets/images/favicons/android-chrome-512x512.png b/website/source/assets/images/favicons/android-chrome-512x512.png new file mode 100644 index 000000000..83a03ab49 Binary files /dev/null and b/website/source/assets/images/favicons/android-chrome-512x512.png differ diff --git a/website/source/assets/images/favicons/apple-touch-icon.png b/website/source/assets/images/favicons/apple-touch-icon.png new file mode 100644 index 000000000..91cb96176 Binary files /dev/null and b/website/source/assets/images/favicons/apple-touch-icon.png differ diff --git a/website/source/assets/images/favicons/favicon-16x16.png b/website/source/assets/images/favicons/favicon-16x16.png new file mode 100644 index 000000000..a474f146f Binary files /dev/null and b/website/source/assets/images/favicons/favicon-16x16.png differ diff --git a/website/source/assets/images/favicons/favicon-32x32.png b/website/source/assets/images/favicons/favicon-32x32.png new file mode 100644 index 000000000..576c5402f Binary files /dev/null and b/website/source/assets/images/favicons/favicon-32x32.png differ diff --git a/website/source/assets/images/favicons/favicon.ico b/website/source/assets/images/favicons/favicon.ico new file mode 100644 index 000000000..fd3d1442e Binary files /dev/null and b/website/source/assets/images/favicons/favicon.ico differ diff --git a/website/source/assets/images/favicons/mstile-150x150.png b/website/source/assets/images/favicons/mstile-150x150.png new file mode 100644 index 000000000..d81ed5df7 Binary files /dev/null and b/website/source/assets/images/favicons/mstile-150x150.png differ diff --git a/website/source/assets/images/favicons/safari-pinned-tab.svg b/website/source/assets/images/favicons/safari-pinned-tab.svg new file mode 100644 index 000000000..d331c170c --- /dev/null +++ b/website/source/assets/images/favicons/safari-pinned-tab.svg @@ -0,0 +1,22 @@ + + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + + + + diff --git a/website/source/assets/images/feature-card-create.svg b/website/source/assets/images/feature-card-create.svg index 0c77fe438..c45fc221e 100644 --- a/website/source/assets/images/feature-card-create.svg +++ b/website/source/assets/images/feature-card-create.svg @@ -1,15 +1,6 @@ - - - - - - - - - - + + + + + diff --git a/website/source/assets/images/feature-card-plan.svg b/website/source/assets/images/feature-card-plan.svg index 765579dce..c1a010733 100644 --- a/website/source/assets/images/feature-card-plan.svg +++ b/website/source/assets/images/feature-card-plan.svg @@ -1,31 +1,3 @@ - - - - - - - - - - - - - - - - - + + diff --git a/website/source/assets/images/feature-card-write.svg b/website/source/assets/images/feature-card-write.svg index 3e81bc1b2..9be021d9a 100644 --- a/website/source/assets/images/feature-card-write.svg +++ b/website/source/assets/images/feature-card-write.svg @@ -1,24 +1,3 @@ - - - - - - - - - - - - - - - - - - - - + + diff --git a/website/source/assets/images/feature-create-bg.svg b/website/source/assets/images/feature-create-bg.svg index 80d89b0f8..0392a2c6a 100644 --- a/website/source/assets/images/feature-create-bg.svg +++ b/website/source/assets/images/feature-create-bg.svg @@ -1,312 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website/source/assets/images/feature-plan-bg.svg b/website/source/assets/images/feature-plan-bg.svg index 31059abf9..9d9e3e012 100644 --- a/website/source/assets/images/feature-plan-bg.svg +++ b/website/source/assets/images/feature-plan-bg.svg @@ -1,429 +1,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website/source/assets/images/feature-plan-sm-bg.svg b/website/source/assets/images/feature-plan-sm-bg.svg deleted file mode 100644 index cf38d86f0..000000000 --- a/website/source/assets/images/feature-plan-sm-bg.svg +++ /dev/null @@ -1,398 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/website/source/assets/images/feature-write-bg.svg b/website/source/assets/images/feature-write-bg.svg index c3ecbb76b..32224066e 100644 --- a/website/source/assets/images/feature-write-bg.svg +++ b/website/source/assets/images/feature-write-bg.svg @@ -1,253 +1,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/website/source/assets/images/footer-hashicorp-logo.png b/website/source/assets/images/footer-hashicorp-logo.png deleted file mode 100644 index 96ac85814..000000000 Binary files a/website/source/assets/images/footer-hashicorp-logo.png and /dev/null differ diff --git a/website/source/assets/images/footer-hashicorp-logo@2x.png b/website/source/assets/images/footer-hashicorp-logo@2x.png deleted file mode 100644 index 34699040a..000000000 Binary files a/website/source/assets/images/footer-hashicorp-logo@2x.png and /dev/null differ diff --git a/website/source/assets/images/footer-hashicorp-white-logo.png b/website/source/assets/images/footer-hashicorp-white-logo.png deleted file mode 100644 index 9fddc9779..000000000 Binary files a/website/source/assets/images/footer-hashicorp-white-logo.png and /dev/null differ diff --git a/website/source/assets/images/footer-hashicorp-white-logo@2x.png b/website/source/assets/images/footer-hashicorp-white-logo@2x.png deleted file mode 100644 index a0b479799..000000000 Binary files a/website/source/assets/images/footer-hashicorp-white-logo@2x.png and /dev/null differ diff --git a/website/source/assets/images/header-download-icon.png b/website/source/assets/images/header-download-icon.png deleted file mode 100644 index bface9334..000000000 Binary files a/website/source/assets/images/header-download-icon.png and /dev/null differ diff --git a/website/source/assets/images/header-download-icon@2x.png b/website/source/assets/images/header-download-icon@2x.png deleted file mode 100644 index bd1c9a313..000000000 Binary files a/website/source/assets/images/header-download-icon@2x.png and /dev/null differ diff --git a/website/source/assets/images/header-github-icon.png b/website/source/assets/images/header-github-icon.png deleted file mode 100644 index 5bef9cb89..000000000 Binary files a/website/source/assets/images/header-github-icon.png and /dev/null differ diff --git a/website/source/assets/images/header-github-icon@2x.png b/website/source/assets/images/header-github-icon@2x.png deleted file mode 100644 index ab15e12df..000000000 Binary files a/website/source/assets/images/header-github-icon@2x.png and /dev/null differ diff --git a/website/source/assets/images/header-nav-divider.png b/website/source/assets/images/header-nav-divider.png deleted file mode 100644 index 130f1c71d..000000000 Binary files a/website/source/assets/images/header-nav-divider.png and /dev/null differ diff --git a/website/source/assets/images/header-nav-divider@2x.png b/website/source/assets/images/header-nav-divider@2x.png deleted file mode 100644 index a747226e5..000000000 Binary files a/website/source/assets/images/header-nav-divider@2x.png and /dev/null differ diff --git a/website/source/assets/images/hero-bg.png b/website/source/assets/images/hero-bg.png deleted file mode 100644 index 61cac8172..000000000 Binary files a/website/source/assets/images/hero-bg.png and /dev/null differ diff --git a/website/source/assets/images/latest-announce-bg.svg b/website/source/assets/images/latest-announce-bg.svg deleted file mode 100644 index 1513807fd..000000000 --- a/website/source/assets/images/latest-announce-bg.svg +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/website/source/assets/images/logo-hashicorp.svg b/website/source/assets/images/logo-hashicorp.svg new file mode 100644 index 000000000..e7dce0da4 --- /dev/null +++ b/website/source/assets/images/logo-hashicorp.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/website/source/assets/images/logo-header-black@2x.png b/website/source/assets/images/logo-header-black@2x.png deleted file mode 100644 index 312f8692e..000000000 Binary files a/website/source/assets/images/logo-header-black@2x.png and /dev/null differ diff --git a/website/source/assets/images/logo-header.png b/website/source/assets/images/logo-header.png deleted file mode 100644 index 76f5eae3a..000000000 Binary files a/website/source/assets/images/logo-header.png and /dev/null differ diff --git a/website/source/assets/images/logo-header.svg b/website/source/assets/images/logo-header.svg deleted file mode 100644 index 7f9e690f4..000000000 --- a/website/source/assets/images/logo-header.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - HashiCorp Terraform - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/website/source/assets/images/logo-header@2x.png b/website/source/assets/images/logo-header@2x.png deleted file mode 100644 index 1fc0bf2e3..000000000 Binary files a/website/source/assets/images/logo-header@2x.png and /dev/null differ diff --git a/website/source/assets/images/logo-static.png b/website/source/assets/images/logo-static.png deleted file mode 100644 index 7cfecc36a..000000000 Binary files a/website/source/assets/images/logo-static.png and /dev/null differ diff --git a/website/source/assets/images/logo-text.svg b/website/source/assets/images/logo-text.svg new file mode 100644 index 000000000..5ff7645c2 --- /dev/null +++ b/website/source/assets/images/logo-text.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website/source/assets/images/logo_large.png b/website/source/assets/images/logo_large.png deleted file mode 100644 index 94b66fdae..000000000 Binary files a/website/source/assets/images/logo_large.png and /dev/null differ diff --git a/website/source/assets/images/og-image.png b/website/source/assets/images/og-image.png new file mode 100644 index 000000000..dbc7d61cc Binary files /dev/null and b/website/source/assets/images/og-image.png differ diff --git a/website/source/assets/images/readme.png b/website/source/assets/images/readme.png deleted file mode 100644 index bec5aa7f5..000000000 Binary files a/website/source/assets/images/readme.png and /dev/null differ diff --git a/website/source/assets/images/sidebar-wire.png b/website/source/assets/images/sidebar-wire.png deleted file mode 100644 index 87ccdf351..000000000 Binary files a/website/source/assets/images/sidebar-wire.png and /dev/null differ diff --git a/website/source/assets/images/terraform-enterprise-logo.svg b/website/source/assets/images/terraform-enterprise-logo.svg index 5c1b21abe..7bbdd0055 100644 --- a/website/source/assets/images/terraform-enterprise-logo.svg +++ b/website/source/assets/images/terraform-enterprise-logo.svg @@ -1,47 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website/source/assets/images/webinar-Terraform-4-4-2017.jpg b/website/source/assets/images/webinar-Terraform-4-4-2017.jpg deleted file mode 100644 index 1bc50497c..000000000 Binary files a/website/source/assets/images/webinar-Terraform-4-4-2017.jpg and /dev/null differ diff --git a/website/source/assets/images/webinar-Terraform-4-4-2017@2x.jpg b/website/source/assets/images/webinar-Terraform-4-4-2017@2x.jpg deleted file mode 100644 index 17b3aa725..000000000 Binary files a/website/source/assets/images/webinar-Terraform-4-4-2017@2x.jpg and /dev/null differ diff --git a/website/source/assets/images/webinar-image.jpg b/website/source/assets/images/webinar-image.jpg deleted file mode 100644 index c670b8594..000000000 Binary files a/website/source/assets/images/webinar-image.jpg and /dev/null differ diff --git a/website/source/assets/images/webinar-image@2x.jpg b/website/source/assets/images/webinar-image@2x.jpg deleted file mode 100644 index f03b20ac9..000000000 Binary files a/website/source/assets/images/webinar-image@2x.jpg and /dev/null differ diff --git a/website/source/assets/images/white-wireframe.png b/website/source/assets/images/white-wireframe.png deleted file mode 100644 index 831c0145b..000000000 Binary files a/website/source/assets/images/white-wireframe.png and /dev/null differ diff --git a/website/source/assets/images/white-wireframe@2x.png b/website/source/assets/images/white-wireframe@2x.png deleted file mode 100644 index 3afe389ea..000000000 Binary files a/website/source/assets/images/white-wireframe@2x.png and /dev/null differ diff --git a/website/source/assets/javascripts/app/_Docs.js b/website/source/assets/javascripts/app/_Docs.js deleted file mode 100644 index 5f35a8cd7..000000000 --- a/website/source/assets/javascripts/app/_Docs.js +++ /dev/null @@ -1,46 +0,0 @@ -(function(){ - -var Init = { - - start: function(){ - var classname = this.hasClass(document.body, 'page-sub'); - - if (classname) { - this.addEventListeners(); - } - }, - - hasClass: function (elem, className) { - return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' '); - }, - - addEventListeners: function(){ - var _this = this; - //console.log(document.querySelectorAll('.navbar-static-top')[0]); - window.addEventListener('resize', _this.resizeImage, false); - - this.resizeImage(); - }, - - resizeImage: function(){ - - var header = document.getElementById('header'), - footer = document.getElementById('footer'), - main = document.getElementById('main-content'), - vp = window.innerHeight, - bodyHeight = document.body.clientHeight, - hHeight = header.clientHeight, - fHeight = footer.clientHeight, - withMinHeight = hHeight + fHeight + 830; - - if(withMinHeight < vp && bodyHeight < vp){ - var newHeight = (vp - (hHeight+fHeight)) + 'px'; - main.style.height = newHeight; - } - } - -}; - -Init.start(); - -})(); diff --git a/website/source/assets/javascripts/app/_Engine.Particle.Fixed.js b/website/source/assets/javascripts/app/_Engine.Particle.Fixed.js deleted file mode 100644 index 530edad9c..000000000 --- a/website/source/assets/javascripts/app/_Engine.Particle.Fixed.js +++ /dev/null @@ -1,77 +0,0 @@ -(function( - Particle, - Engine, - Vector -){ - -Particle.Fixed = function(width, height){ - var targetX, targetY; - - this.radius = Engine.getRandomFloat(0.1, 1); - // this.fillA = 'rgba(136,67,237,' + Engine.getRandomFloat(0.4, 0.5) + ')'; - // this.fillB = 'rgba(136,67,237,' + Engine.getRandomFloat(0.51, 0.6) + ')'; - this.fillA = '#3a1066'; - this.fillB = '#561799'; - this.frameMax = Engine.getRandomInt(4, 10); - - this.max = { - x: width + this.maxRadius, - y: height + this.maxRadius - }; - - this.min = { - x: 0 - this.maxRadius, - y: 0 - this.maxRadius - }; - - targetX = Engine.getRandomInt(0 + this.radius, width + this.radius); - targetY = Engine.getRandomInt(0 + this.radius, height + this.radius); - - this.pos = new Vector(targetX, targetY); -}; - -Engine.Particle.Fixed.prototype = { - - radius: 1, - - pos: { - x: 0, - y: 0 - }, - - frame: 0, - showA: false, - - update: function(engine){ - this.frame++; - if (this.frame > this.frameMax) { - this.frame = 0; - this.showA = !this.showA; - } - return this; - }, - - draw: function(ctx, scale){ - // Draw a circle - far less performant - ctx.beginPath(); - ctx.arc( - this.pos.x * scale >> 0, - this.pos.y * scale >> 0, - this.radius * scale, - 0, - Math.PI * 2, - false - ); - if (this.showA) { - ctx.fillStyle = this.fillA; - } else { - ctx.fillStyle = this.fillB; - } - ctx.fill(); - - return this; - } - -}; - -})(window.Engine.Particle, window.Engine, window.Vector); diff --git a/website/source/assets/javascripts/app/_Engine.Particle.js b/website/source/assets/javascripts/app/_Engine.Particle.js deleted file mode 100644 index 6666ac8c9..000000000 --- a/website/source/assets/javascripts/app/_Engine.Particle.js +++ /dev/null @@ -1,154 +0,0 @@ -(function( - Engine, - Vector -){ - -Engine.Particle = function(width, height){ - var side, targetX, targetY; - this.accel = Vector.coerce(this.accel); - this.vel = Vector.coerce(this.vel); - this.pos = new Vector(0, 0); - - this.maxRadius = Engine.getRandomFloat(0.1, 2.5); - // this.maxSpeed = Engine.getRandomFloat(0.01, 1000); - this.maxSpeed = Engine.getRandomFloat(20, 1000); - - // Pick a random target - side = Engine.getRandomInt(0, 3); - if (side === 0 || side === 2) { - targetY = (side === 0) ? -(height / 2) : (height / 2); - targetX = Engine.getRandomInt(-(width / 2), width / 2); - } else { - targetY = Engine.getRandomInt(-(height / 2), height / 2); - targetX = (side === 3) ? -(width / 2) : (width / 2); - } - - this.target = new Vector(targetX, targetY); - this.getAccelVector(); - - this.maxDistance = this.distanceTo(this.target); - - this.fillA = '#8750c2'; - this.fillB = '#b976ff'; - this.frameMax = Engine.getRandomInt(1, 5); -}; - -Engine.Particle.prototype = { - - radius: 1, - - frame: 0, - showA: false, - - accel: { - x: 0, - y: 0 - }, - - vel: { - x: 0, - y: 0 - }, - - pos: { - x: 0, - y: 0 - }, - - opacity: 1, - - maxSpeed: 1500, - maxForce: 1500, - - getAccelVector: function(){ - this.accel = Vector.sub(this.target, this.pos) - .normalize() - .mult(this.maxSpeed); - }, - - update: function(engine){ - var distancePercent, halfWidth, halfHeight; - - this.vel - .add(this.accel) - .limit(this.maxSpeed); - - this.pos.add(Vector.mult(this.vel, engine.tick)); - - halfWidth = engine.width / 2 + this.maxRadius; - halfHeight = engine.height / 2 + this.maxRadius; - - if ( - this.pos.x < -(halfWidth) || - this.pos.x > halfWidth || - this.pos.y < -(halfHeight) || - this.pos.y > halfHeight - ) { - this.kill(engine); - } - - distancePercent = (this.maxDistance - this.distanceTo(this.target)) / this.maxDistance; - this.radius = Math.max(0.1, this.maxRadius * distancePercent); - - this.frame++; - if (this.frame > this.frameMax) { - this.frame = 0; - this.showA = !this.showA; - } - - if (this.showA) { - engine.particlesA[engine.particlesA.length] = this; - } else { - engine.particlesB[engine.particlesB.length] = this; - } - - return this; - }, - - draw: function(ctx, scale){ - if (this.radius < 0.25) { - return; - } - - if (this.showA) { - ctx.fillStyle = this.fillA; - } else { - ctx.fillStyle = this.fillB; - } - - // Draw a square - very performant - ctx.fillRect( - this.pos.x * scale >> 0, - this.pos.y * scale >> 0, - this.radius * scale, - this.radius * scale - ); - - // Draw a circle - far less performant - // ctx.beginPath(); - // ctx.arc( - // this.pos.x * scale, - // this.pos.y * scale, - // this.radius * scale, - // 0, - // Math.PI * 2, - // false - // ); - // ctx.fill(); - - return this; - }, - - kill: function(engine){ - engine._deferredParticles.push(this); - return this; - }, - - distanceTo: function(target) { - var xd = this.pos.x - target.x; - var yd = this.pos.y - target.y; - return Math.sqrt(xd * xd + yd * yd ); - } -}; - -})(window.Engine, window.Vector); diff --git a/website/source/assets/javascripts/app/_Engine.Point.Puller.js b/website/source/assets/javascripts/app/_Engine.Point.Puller.js deleted file mode 100644 index 910093a60..000000000 --- a/website/source/assets/javascripts/app/_Engine.Point.Puller.js +++ /dev/null @@ -1,153 +0,0 @@ -(function( - Engine, - Vector -){ - -Engine.Point.Puller = function(id, x, y, shapeSize){ - this.id = id; - - this.shapeSize = shapeSize; - this.ref = new Vector(x, y); - - this.pos = new Vector( - x * shapeSize.x, - y * shapeSize.y - ); - - this.home = this.pos.clone(); - this.accel = Vector.coerce(this.accel); - this.vel = Vector.coerce(this.vel); -}; - -Engine.Point.Puller.prototype = { - - fillStyle: null, - defaultFillstyle: '#b976ff', - chasingFillstyle: '#ff6b6b', - - radius: 1, - - maxSpeed: 160, - maxForce: 50, - - pos: { - x: 0, - y: 0 - }, - - accel: { - x: 0, - y: 0 - }, - - vel: { - x: 0, - y: 0 - }, - - aRad: 200, - - safety: 0.25, - - resize: function(){ - this.home.x = this.pos.x = this.ref.x * this.shapeSize.x; - this.home.y = this.pos.y = this.ref.y * this.shapeSize.y; - - return this; - }, - - update: function(engine){ - var target = Vector.coerce(engine.mouse), - distanceToMouse, toHome, mag, safety; - - target.x += (this.shapeSize.x - engine.width) / 2; - target.y += (this.shapeSize.y - engine.height) / 2; - - distanceToMouse = this.distanceTo(target); - - this.accel.mult(0); - - if (distanceToMouse < this.aRad) { - this._chasing = true; - this.toChase(target); - this.fillStyle = this.chasingFillstyle; - } else { - this._chasing = false; - this.fillStyle = this.defaultFillstyle; - } - - this.toChase(this.home, this.maxForce / 2); - - this.vel.add(this.accel); - this.pos.add( - Vector.mult(this.vel, engine.tick) - ); - - toHome = Vector.sub(this.home, this.pos); - mag = toHome.mag(); - safety = this.aRad * (this.safety * 3); - if (mag > this.aRad - safety) { - toHome.normalize(); - toHome.mult(this.aRad - safety); - this.pos = Vector.sub(this.home, toHome); - } - - target = null; - toHome = null; - return this; - }, - - toChase: function(target, maxForce){ - var desired, steer, distance, mult, safety; - - maxForce = maxForce || this.maxForce; - - target = Vector.coerce(target); - desired = Vector.sub(target, this.pos); - distance = desired.mag(); - desired.normalize(); - - safety = this.aRad * this.safety; - - if (distance < safety) { - mult = Engine.map(distance, 0, safety, 0, this.maxSpeed); - } else if (distance > this.aRad - safety){ - mult = Engine.map(this.aRad - distance, 0, safety, 0, this.maxSpeed); - } else { - mult = this.maxSpeed; - } - - desired.mult(mult); - - steer = Vector.sub(desired, this.vel); - steer.limit(maxForce); - this.accel.add(steer); - - target = null; - desired = null; - steer = null; - }, - - draw: function(ctx, scale){ - ctx.fillStyle = this.fillStyle; - ctx.fillRect( - (this.pos.x - this.radius / 2) * scale >> 0, - (this.pos.y - this.radius / 2) * scale >> 0, - this.radius * scale, - this.radius * scale - ); - - return this; - }, - - distanceTo: function(target) { - var xd = this.home.x - target.x; - var yd = this.home.y - target.y; - return Math.sqrt(xd * xd + yd * yd ); - } -}; - -})( - window.Engine, - window.Vector -); diff --git a/website/source/assets/javascripts/app/_Engine.Point.js b/website/source/assets/javascripts/app/_Engine.Point.js deleted file mode 100644 index 4d53eb265..000000000 --- a/website/source/assets/javascripts/app/_Engine.Point.js +++ /dev/null @@ -1,118 +0,0 @@ -(function( - Engine, - Vector -){ 'use strict'; - -Engine.Point = function(id, x, y, shapeSize){ - this.id = id; - - this.shapeSize = shapeSize; - this.ref = new Vector(x, y); - - this.pos = new Vector( - x * shapeSize.x, - y * shapeSize.y - ); - - this.target = this.pos.clone(); - this.pos.x = shapeSize.x / 2; - this.pos.y = shapeSize.y / 2; - this.accel = Vector.coerce(this.accel); - this.vel = Vector.coerce(this.vel); - - this.stiffness = Engine.getRandomFloat(150, 600); - this.friction = Engine.getRandomFloat(12, 18); -}; - -Engine.Point.prototype = { - - radius: 1, - - stiffness : 200, - friction : 13, - threshold : 0.03, - - pos: { - x: 0, - y: 0 - }, - - accel: { - x: 0, - y: 0 - }, - - vel : { - x: 0, - y: 0 - }, - - target: { - x: 0, - y: 0 - }, - - resize: function(){ - this.target.x = this.pos.x = this.ref.x * this.shapeSize.x; - this.target.y = this.pos.y = this.ref.y * this.shapeSize.y; - }, - - updateBreathingPhysics: function(){ - this.stiffness = Engine.getRandomFloat(2, 4); - this.friction = Engine.getRandomFloat(1, 2); - }, - - updateTarget: function(newSize){ - var diff; - - this.target.x = this.ref.x * newSize.x; - this.target.y = this.ref.y * newSize.y; - - diff = Vector.sub(newSize, this.shapeSize).div(2); - - this.target.sub(diff); - - this.target.add({ - x: Engine.getRandomFloat(-3, 3), - y: Engine.getRandomFloat(-3, 3) - }); - }, - - update: function(engine){ - var newAccel; - - newAccel = Vector.sub(this.target, this.pos) - .mult(this.stiffness) - .sub(Vector.mult(this.vel, this.friction)); - - this.accel.set(newAccel); - - this.vel.add(Vector.mult(this.accel, engine.tick)); - - this.pos.add( - Vector.mult(this.vel, engine.tick) - ); - - newAccel = null; - - return this; - }, - - draw: function(ctx, scale){ - ctx.beginPath(); - ctx.arc( - this.pos.x * scale, - this.pos.y * scale, - this.radius * scale, - 0, - Math.PI * 2, - false - ); - ctx.fillStyle = '#ffffff'; - ctx.fill(); - return this; - } - -}; - -})(window.Engine, window.Vector); diff --git a/website/source/assets/javascripts/app/_Engine.Polygon.Puller.js b/website/source/assets/javascripts/app/_Engine.Polygon.Puller.js deleted file mode 100644 index 3ad4227b7..000000000 --- a/website/source/assets/javascripts/app/_Engine.Polygon.Puller.js +++ /dev/null @@ -1,29 +0,0 @@ -(function( - Engine, - Vector -){ - -Engine.Polygon.Puller = function(a, b, c, color, simple){ - this.a = a; - this.b = b; - this.c = c; - - this.strokeStyle = '#ffffff'; -}; - -Engine.Polygon.Puller.prototype = { - - checkChasing: function(){ - if ( - this.a._chasing === true && - this.b._chasing === true && - this.c._chasing === true - ) { - return true; - } - return false; - } - -}; - -})(window.Engine, window.Vector); diff --git a/website/source/assets/javascripts/app/_Engine.Polygon.js b/website/source/assets/javascripts/app/_Engine.Polygon.js deleted file mode 100644 index 74e80a96d..000000000 --- a/website/source/assets/javascripts/app/_Engine.Polygon.js +++ /dev/null @@ -1,80 +0,0 @@ -(function( - Engine, - Vector -){ - -Engine.Polygon = function(a, b, c, color, strokeColor){ - this.a = a; - this.b = b; - this.c = c; - - this.color = Engine.clone(color); - this.strokeColor = strokeColor ? Engine.clone(strokeColor) : Engine.clone(color); - - if (strokeColor) { - this.strokeColor = Engine.clone(strokeColor); - } else { - this.strokeColor = Engine.clone(color); - } - - this.strokeWidth = 0.25; - this.maxStrokeS = this.strokeColor.s; - this.maxStrokeL = this.strokeColor.l; - this.maxColorL = this.color.l; - - this.strokeColor.s = 0; - this.strokeColor.l = 100; - this.color.l = 0; - - this.fillStyle = this.hslaTemplate.substitute(this.color); - this.strokeStyle = this.hslaTemplate.substitute(this.strokeColor); -}; - -Engine.Polygon.prototype = { - - rgbaTemplate: 'rgba({r},{g},{b},{a})', - hslaTemplate: 'hsla({h},{s}%,{l}%,{a})', - - hueShiftSpeed: 20, - duration: 2, - delay: 0, - start: 0, - - // Determine color fill? - update: function(engine){ - var delta; - - if (this.simple) { - return; - } - - this.start += engine.tick; - - delta = this.start; - - if ( - delta > this.delay && - delta < this.delay + this.duration + 1 && - this.color.l < this.maxColorL - ) { - this.color.l = this.maxColorL * (delta - this.delay) / this.duration; - - this.strokeColor.s = this.maxStrokeS * (delta - this.delay) / this.duration; - this.strokeColor.l = (this.maxStrokeL - 100) * (delta - this.delay) / this.duration + 100; - - this.strokeWidth = 1.5 * (delta - this.delay) / this.duration + 0.25; - - if (this.color.l > this.maxColorL) { - this.color.l = this.maxColorL; - this.strokeColor.l = this.maxStrokeL; - this.strokeWidth = 1.5; - } - - this.strokeStyle = this.hslaTemplate.substitute(this.strokeColor); - this.fillStyle = this.hslaTemplate.substitute(this.color); - } - } - -}; - -})(window.Engine, window.Vector); diff --git a/website/source/assets/javascripts/app/_Engine.Shape.Puller.js b/website/source/assets/javascripts/app/_Engine.Shape.Puller.js deleted file mode 100644 index 27f7fd7d5..000000000 --- a/website/source/assets/javascripts/app/_Engine.Shape.Puller.js +++ /dev/null @@ -1,179 +0,0 @@ -(function( - Engine, - Point, - Polygon, - Vector -){ - -Engine.Shape.Puller = function(width, height, json){ - var i, ref, point, poly; - - this.pos = new Vector(0, 0); - this.size = new Vector(width, height); - this.heightRatio = json.data.width / json.data.height; - this.widthRatio = json.data.ar; - - this.resize(width, height, true); - - ref = {}; - this.points = []; - this.polygons = []; - - for (i = 0; i < json.points.length; i++) { - point = new Point( - json.points[i].id, - json.points[i].x, - json.points[i].y, - this.size - ); - ref[point.id] = point; - this.points.push(point); - } - - for (i = 0; i < json.polygons.length; i++) { - poly = json.polygons[i]; - this.polygons.push(new Polygon( - ref[poly.points[0]], - ref[poly.points[1]], - ref[poly.points[2]], - poly.color - )); - this.polygons[this.polygons.length - 1].noFill = true; - } - - this.ref = undefined; -}; - -Engine.Shape.Puller.prototype = { - - alpha: 0, - - sizeOffset: 100, - - resize: function(width, height, sizeOnly){ - var len, p, newWidth, newHeight; - - newHeight = height + this.sizeOffset; - newWidth = this.size.y * this.heightRatio; - - if (newWidth < width) { - newWidth = width + this.sizeOffset; - newHeight = newWidth * this.widthRatio; - } - - this.size.y = newHeight; - this.size.x = newWidth; - - this.pos.x = -(newWidth / 2); - this.pos.y = -(newHeight / 2); - - if (sizeOnly) { - return this; - } - - for (p = 0, len = this.points.length; p < len; p++) { - this.points[p].resize(); - } - }, - - update: function(engine){ - var p; - - for (p = 0; p < this.points.length; p++) { - this.points[p].update(engine); - } - - if (this.alpha < 1) { - this.alpha = Math.min(this.alpha + 2 * engine.tick, 1); - } - - return this; - }, - - draw: function(ctx, scale, engine){ - var p, poly; - - ctx.translate( - this.pos.x * scale >> 0, - this.pos.y * scale >> 0 - ); - - if (this.alpha < 1) { - ctx.globalAlpha = this.alpha; - } - - ctx.beginPath(); - for (p = 0; p < this.polygons.length; p++) { - poly = this.polygons[p]; - ctx.moveTo( - poly.a.pos.x * scale >> 0, - poly.a.pos.y * scale >> 0 - ); - ctx.lineTo( - poly.b.pos.x * scale >> 0, - poly.b.pos.y * scale >> 0 - ); - ctx.lineTo( - poly.c.pos.x * scale >> 0, - poly.c.pos.y * scale >> 0 - ); - ctx.lineTo( - poly.a.pos.x * scale >> 0, - poly.a.pos.y * scale >> 0 - ); - } - ctx.closePath(); - ctx.lineWidth = 0.4 * scale; - ctx.strokeStyle = 'rgba(108,0,243,0.15)'; - ctx.stroke(); - - if (this.alpha < 1) { - ctx.globalAlpha = 1; - } - - for (p = 0; p < this.points.length; p++) { - this.points[p].draw(ctx, scale); - } - - ctx.beginPath(); - for (p = 0; p < this.polygons.length; p++) { - if (this.polygons[p].checkChasing()) { - poly = this.polygons[p]; - ctx.moveTo( - poly.a.pos.x * scale >> 0, - poly.a.pos.y * scale >> 0 - ); - ctx.lineTo( - poly.b.pos.x * scale >> 0, - poly.b.pos.y * scale >> 0 - ); - ctx.lineTo( - poly.c.pos.x * scale >> 0, - poly.c.pos.y * scale >> 0 - ); - ctx.lineTo( - poly.a.pos.x * scale >> 0, - poly.a.pos.y * scale >> 0 - ); - } - } - ctx.closePath(); - ctx.fillStyle = 'rgba(108,0,243,0.05)'; - ctx.fill(); - - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.translate( - engine.width / 2 * engine.scale >> 0, - engine.height / 2 * engine.scale >> 0 - ); - return this; - } - -}; - -})( - window.Engine, - window.Engine.Point.Puller, - window.Engine.Polygon.Puller, - window.Vector -); diff --git a/website/source/assets/javascripts/app/_Engine.Shape.js b/website/source/assets/javascripts/app/_Engine.Shape.js deleted file mode 100644 index 97be30c83..000000000 --- a/website/source/assets/javascripts/app/_Engine.Shape.js +++ /dev/null @@ -1,159 +0,0 @@ -(function( - Engine, - Point, - Polygon, - Vector -){ - -Engine.Shape = function(x, y, width, height, points, polygons){ - var i, ref, point, poly; - - this.pos = new Vector(x, y); - this.size = new Vector(width, height); - this.sizeRef = this.size.clone(); - - ref = {}; - this.points = []; - this.polygons = []; - - for (i = 0; i < points.length; i++) { - point = new Point( - points[i].id, - points[i].x, - points[i].y, - this.size - ); - ref[point.id] = point; - this.points.push(point); - } - - for (i = 0; i < polygons.length; i++) { - poly = polygons[i]; - this.polygons.push(new Polygon( - ref[poly.points[0]], - ref[poly.points[1]], - ref[poly.points[2]], - poly.color, - poly.stroke - )); - } -}; - -Engine.Shape.prototype = { - - breathing: false, - - breath: 0, - breathLength: 1, - breatheIn: false, - - resize: function(newSize, offset){ - var len, p; - - this.size.x = newSize; - this.size.y = newSize; - this.sizeRef.x = newSize; - this.sizeRef.y = newSize; - - this.pos.x = -(newSize / 2); - this.pos.y = -(newSize / 2 + offset); - - for (p = 0, len = this.points.length; p < len; p++) { - this.points[p].resize(); - } - }, - - startBreathing: function(){ - var p; - - this.breathing = true; - this.breath = this.breathLength; - - for (p = 0; p < this.points.length; p++) { - this.points[p].updateBreathingPhysics(); - } - }, - - breathe: function(tick){ - var p, scale, newSize; - - this.breath += tick; - - if (this.breath < this.breathLength) { - return; - } - - scale = 1; - - newSize = Vector.mult(this.sizeRef, scale); - - for (p = 0; p < this.points.length; p++) { - this.points[p].updateTarget(newSize); - } - - this.breath = 0; - }, - - update: function(engine){ - var p; - - if (this.breathing === true) { - this.breathe(engine.tick); - } - - for (p = 0; p < this.points.length; p++) { - this.points[p].update(engine); - } - - for (p = 0; p < this.polygons.length; p++) { - this.polygons[p].update(engine); - } - - return this; - }, - - draw: function(ctx, scale, engine){ - var p, poly; - - ctx.translate( - this.pos.x * scale >> 0, - this.pos.y * scale >> 0 - ); - for (p = 0; p < this.polygons.length; p++) { - poly = this.polygons[p]; - ctx.beginPath(); - ctx.moveTo( - poly.a.pos.x * scale, - poly.a.pos.y * scale - ); - ctx.lineTo( - poly.b.pos.x * scale, - poly.b.pos.y * scale - ); - ctx.lineTo( - poly.c.pos.x * scale, - poly.c.pos.y * scale - ); - ctx.closePath(); - ctx.fillStyle = poly.fillStyle; - ctx.fill(); - ctx.lineWidth = poly.strokeWidth * scale; - ctx.strokeStyle = poly.strokeStyle; - ctx.stroke(); - } - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.translate( - engine.width / 2 * engine.scale >> 0, - engine.height / 2 * engine.scale >> 0 - ); - return this; - } - -}; - -})( - window.Engine, - window.Engine.Point, - window.Engine.Polygon, - window.Vector -); diff --git a/website/source/assets/javascripts/app/_Engine.Typewriter.js b/website/source/assets/javascripts/app/_Engine.Typewriter.js deleted file mode 100644 index 61762c41c..000000000 --- a/website/source/assets/javascripts/app/_Engine.Typewriter.js +++ /dev/null @@ -1,71 +0,0 @@ -/* jshint unused:false */ -/* global console */ -(function(Engine){ 'use strict'; - -Engine.Typewriter = function(element){ - this.element = element; - this.content = this.element.textContent.split(''); - this.element.innerHTML = ''; - this.element.style.visibility = 'visible'; -}; - -Engine.Typewriter.prototype = { - - running: false, - - letterInterval : 0.02, - spaceInterval : 0.4, - - charCount: -1, - waitSpace: false, - - toDraw: '', - - start: function(){ - if (!this.content.length) { - return this; - } - - this._last = this.letterInterval; - this.running = true; - }, - - update: function(engine){ - var newChar; - - if (!this.running) { - return this; - } - - this._last += engine.tick; - - if (this.waitSpace && this._last < this.spaceInterval) { - return this; - } - - if (!this.waitSpace && this._last < this.letterInterval){ - return this; - } - - this._last = 0; - newChar = this.content.shift(); - this.toDraw += newChar; - - if (newChar === ',') { - this.waitSpace = true; - } else { - this.waitSpace = false; - } - - this.element.innerHTML = this.toDraw + '_'; - - if (!this.content.length) { - this.running = false; - } - - return this; - } - -}; - -})(window.Engine); diff --git a/website/source/assets/javascripts/app/_Engine.js b/website/source/assets/javascripts/app/_Engine.js deleted file mode 100644 index e89d61074..000000000 --- a/website/source/assets/javascripts/app/_Engine.js +++ /dev/null @@ -1,388 +0,0 @@ -(function( - Base, - Vector, - Logo, - Grid, - Chainable -){ - -var sqrt, pow, Engine; - -if (!window.requestAnimationFrame) { - window.requestAnimationFrame = (function(){ - return window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - function( callback ){ - window.setTimeout(callback, 1000 / 60); - }; - })(); -} - -sqrt = Math.sqrt; -pow = Math.pow; - -Engine = Base.extend({ - - scale: window.devicePixelRatio || 1, - // scale:1, - - shapes : [], - particles : [], - particlesA : [], - particlesB : [], - - _deferredParticles: [], - - ticks: [], - - starGeneratorRate: 600, - - mouse: { - x: -9999, - y: -9999 - }, - - constructor: function(canvas, background, tagLine){ - this.canvas = canvas; - this.background = background; - this.tagLine = tagLine; - - if (!this.canvas.getContext) { - return null; - } - - this.context = this.canvas.getContext('2d'); - - this.setupEvents(); - this.setupStarfield(); - this.setupTessellation(); - this.setupMisc(); - - this.startEngine(); - }, - - startEngine: function(){ - var parent = this.canvas.parentNode; - - this.background.className += ' show'; - this.canvas.style.opacity = 1; - - // We have to pass the engine into Chainable to - // enable the timers to properly attach to the - // run/render loop - new Chainable(this) - .wait(1000) - .then(function(){ - this.starGeneratorRate = 200; - }, this) - .wait(500) - .then(function(){ - parent.className += ' state-one'; - }) - .wait(150) - .then(function(){ - parent.className += ' state-two'; - }) - .wait(150) - .then(function(){ - parent.className += ' state-three'; - }) - .wait(500) - .then(function(){ - parent.className += ' state-four'; - }) - .wait(100) - .then(function(){ - this.showShapes = true; - }, this) - .wait(1000) - .then(function(){ - this.logo.startBreathing(); - this.showGrid = true; - }, this) - .wait(1000) - .then(function(){ - this.typewriter.start(); - }, this); - - this.render(); - }, - - - setupMisc: function(){ - this.last = Date.now() / 1000; - this.render = this.render.bind(this); - - this.typewriter = new Engine.Typewriter(this.tagLine); - }, - - setupEvents: function(){ - this.resize = this.resize.bind(this); - this.resize(); - window.addEventListener('resize', this.resize, false); - - this._handleScroll = this._handleScroll.bind(this); - this._handleScroll(); - window.addEventListener('scroll', this._handleScroll, false); - - this._handleMouseCoords = this._handleMouseCoords.bind(this); - window.addEventListener('mousemove', this._handleMouseCoords, false); - }, - - setupStarfield: function(){ - this.particles = []; - // this.generateParticles(50, true); - this.generateParticles(400); - }, - - setupTessellation: function(canvas){ - var size, offset; - this.shapes = []; - if (window.innerWidth < 570) { - size = 300; - offset = 0; - } else { - size = 360; - offset = 40; - } - - this.logo = new Engine.Shape( - -(size / 2), - -(size / 2 + offset), - size, - size, - Logo.points, - Logo.polygons - ); - - this.grid = new Engine.Shape.Puller(this.width, this.height, Grid); - }, - - - getAverageTickTime: function(){ - var sum = 0, s; - - for (s = 0; s < this.ticks.length; s++) { - sum += this.ticks[s]; - } - - window.console.log('Average Tick Time:', sum / this.ticks.length); - }, - - getLongestTick: function(){ - var max = 0, index, s; - - for (s = 0; s < this.ticks.length; s++) { - if (this.ticks[s] > max) { - max = this.ticks[s]; - index = s; - } - } - - window.console.log('Max tick was:', max, 'at index:', index); - }, - - render: function(){ - var scale = this.scale, p, particle, index; - - if (this.paused) { - return; - } - - if (this.scrollY > this.height) { - window.requestAnimationFrame(this.render); - return; - } - - this.context.clearRect( - -(this.width / 2) * scale, - -(this.height / 2) * scale, - this.width * scale, - this.height * scale - ); - - this.now = Date.now() / 1000; - this.tick = Math.min(this.now - this.last, 0.017); - - // We must attach the chainable timer to the engine - // run/render loop or else things can get pretty - // out of wack - if (this.updateChainTimer) { - this.updateChainTimer(this.tick); - } - - // Update all particles... may need to be optimized - for (p = 0; p < this.particles.length; p++) { - this.particles[p].update(this); - } - - // Batch render particles based on color - // to prevent unneeded context state change - this.context.fillStyle = '#8750c2'; - for (p = 0; p < this.particlesA.length; p++) { - particle = this.particlesA[p]; - - if (particle.radius < 0.25) { - continue; - } - this.context.fillRect( - particle.pos.x * scale >> 0, - particle.pos.y * scale >> 0, - particle.radius * scale, - particle.radius * scale - ); - } - - this.context.fillStyle = '#b976ff'; - for (p = 0; p < this.particlesB.length; p++) { - particle = this.particlesB[p]; - - if (particle.radius < 0.25) { - continue; - } - this.context.fillRect( - particle.pos.x * scale >> 0, - particle.pos.y * scale >> 0, - particle.radius * scale, - particle.radius * scale - ); - } - - this.particlesA.length = 0; - this.particlesB.length = 0; - - // Remove destroyed particles - for (p = 0; p < this._deferredParticles.length; p++) { - index = this.particles.indexOf(this._deferredParticles.pop()); - if (index >= 0) { - this.particles.splice(index, 1); - } - } - - if (this.showGrid) { - this.grid - .update(this) - .draw(this.context, scale, this); - } - - if (this.showShapes) { - this.logo - .update(this) - .draw(this.context, scale, this); - } - - this.typewriter.update(this); - - this.last = this.now; - - this.generateParticles(this.starGeneratorRate * this.tick >> 0); - - window.requestAnimationFrame(this.render); - }, - - generateParticles: function(num, fixed){ - var p; - - for (p = 0; p < num; p++) { - if (fixed) { - this.particles.push(new Engine.Particle.Fixed(this.width, this.height)); - } else { - this.particles.push(new Engine.Particle(this.width, this.height)); - } - } - }, - - resize: function(){ - var scale = this.scale, - size, offset; - - if (window.innerWidth < 570) { - this.height = 560; - } else { - this.height = 700; - } - - this.width = window.innerWidth; - - this.canvas.width = this.width * scale; - this.canvas.height = this.height * scale; - - this.context.translate( - this.width / 2 * scale >> 0, - this.height / 2 * scale >> 0 - ); - this.context.lineJoin = 'bevel'; - - if (this.grid) { - this.grid.resize(this.width, this.height); - } - - if (this.logo) { - if (this.height === 560) { - size = 300; - offset = 0; - } else { - size = 360; - offset = 40; - } - this.logo.resize(size, offset); - } - }, - - _handleMouseCoords: function(event){ - this.mouse.x = event.pageX; - this.mouse.y = event.pageY; - }, - - _handleScroll: function(){ - this.scrollY = window.scrollY; - }, - - pause: function(){ - this.paused = true; - }, - - resume: function(){ - if (!this.paused) { - return; - } - this.paused = false; - this.render(); - }, - - getSnapshot: function(){ - window.open(this.canvas.toDataURL('image/png')); - } - -}); - -Engine.map = function(val, istart, istop, ostart, ostop) { - return ostart + (ostop - ostart) * ((val - istart) / (istop - istart)); -}; - -Engine.getRandomFloat = function(min, max) { - return Math.random() * (max - min) + min; -}; - -Engine.getRandomInt = function(min, max) { - return Math.floor(Math.random() * (max - min + 1) + min); -}; - -Engine.clone = function(ref) { - var clone = {}, key; - for (key in ref) { - clone[key] = ref[key]; - } - return clone; -}; - -window.Engine = Engine; - -})( - window.Base, - window.Vector, - window.Logo, - window.Grid, - window.Chainable -); diff --git a/website/source/assets/javascripts/app/_Grid.js b/website/source/assets/javascripts/app/_Grid.js deleted file mode 100644 index 9ea5055ec..000000000 --- a/website/source/assets/javascripts/app/_Grid.js +++ /dev/null @@ -1,2384 +0,0 @@ -var Grid = { - "data": { - "width": 1572, - "height": 979, - "ar": 0.6227735368956743 - }, - "points": [ - { - "id": "point-0", - "x": 0.01743002544529262, - "y": 0.045658835546476005 - }, - { - "id": "point-1", - "x": -0.0001272264631043257, - "y": 0.7701736465781408 - }, - { - "id": "point-2", - "x": 0.012468193384223917, - "y": 0.32665985699693567 - }, - { - "id": "point-7", - "x": 0.04052162849872774, - "y": 0.12277834525025537 - }, - { - "id": "point-12", - "x": 0.13568702290076337, - "y": 0.030847803881511746 - }, - { - "id": "point-17", - "x": 0.14465648854961832, - "y": 0.16772216547497446 - }, - { - "id": "point-22", - "x": 0.20184478371501274, - "y": 0.05536261491317671 - }, - { - "id": "point-27", - "x": 0.37099236641221384, - "y": 0.02696629213483146 - }, - { - "id": "point-32", - "x": 0.49357506361323156, - "y": 0.00020429009193054137 - }, - { - "id": "point-37", - "x": 0.1993002544529262, - "y": 0.16281920326864147 - }, - { - "id": "point-42", - "x": 0.30337150127226464, - "y": 0.05965270684371808 - }, - { - "id": "point-52", - "x": 0.32461832061068707, - "y": 0.1689479060265577 - }, - { - "id": "point-62", - "x": 0.4028625954198473, - "y": 0.12502553626149132 - }, - { - "id": "point-72", - "x": 0.5604325699745547, - "y": 0.13003064351378957 - }, - { - "id": "point-77", - "x": 0.5724554707379135, - "y": 0.01491317671092952 - }, - { - "id": "point-82", - "x": 0.8836513994910941, - "y": 0.05372829417773237 - }, - { - "id": "point-87", - "x": 0.9759541984732825, - "y": 0.061184882533197135 - }, - { - "id": "point-92", - "x": 0.7122137404580152, - "y": 0.07405515832482125 - }, - { - "id": "point-102", - "x": 0.6561704834605598, - "y": 0.218488253319714 - }, - { - "id": "point-107", - "x": 0.7784351145038169, - "y": 0.1319713993871297 - }, - { - "id": "point-112", - "x": 0.7912213740458014, - "y": 0.08672114402451482 - }, - { - "id": "point-122", - "x": 0.8616412213740458, - "y": 0.12941777323799797 - }, - { - "id": "point-132", - "x": 0.9780534351145039, - "y": 0.17242083758937693 - }, - { - "id": "point-142", - "x": 0.9898854961832061, - "y": 0.30960163432073545 - }, - { - "id": "point-152", - "x": 0.12888040712468193, - "y": 0.36149131767109294 - }, - { - "id": "point-162", - "x": 0.21743002544529266, - "y": 0.39662921348314606 - }, - { - "id": "point-167", - "x": 0.3361959287531807, - "y": 0.2868232890704801 - }, - { - "id": "point-182", - "x": 0.37220101781170484, - "y": 0.3344228804902961 - }, - { - "id": "point-187", - "x": 0.4620865139949109, - "y": 0.32533197139938713 - }, - { - "id": "point-192", - "x": 0.5159033078880407, - "y": 0.24106230847803883 - }, - { - "id": "point-202", - "x": 0.5856234096692112, - "y": 0.3547497446373851 - }, - { - "id": "point-217", - "x": 0.7061704834605598, - "y": 0.30643513789581206 - }, - { - "id": "point-227", - "x": 0.7717557251908397, - "y": 0.35556690500510724 - }, - { - "id": "point-232", - "x": 0.8581424936386769, - "y": 0.2822267620020429 - }, - { - "id": "point-252", - "x": 0.009287531806615776, - "y": 0.47477017364657814 - }, - { - "id": "point-257", - "x": 0.10756997455470736, - "y": 0.4454545454545455 - }, - { - "id": "point-267", - "x": 0.17767175572519084, - "y": 0.5234933605720122 - }, - { - "id": "point-277", - "x": 0.2962468193384224, - "y": 0.5465781409601634 - }, - { - "id": "point-292", - "x": 0.4138676844783716, - "y": 0.4349336057201226 - }, - { - "id": "point-302", - "x": 0.5194020356234097, - "y": 0.5248212461695607 - }, - { - "id": "point-307", - "x": 0.5548982188295165, - "y": 0.49836567926455566 - }, - { - "id": "point-317", - "x": 0.6503816793893129, - "y": 0.5194075587334014 - }, - { - "id": "point-327", - "x": 0.7473282442748093, - "y": 0.4626149131767109 - }, - { - "id": "point-337", - "x": 0.8691475826972009, - "y": 0.49458631256384067 - }, - { - "id": "point-352", - "x": 0.9832061068702289, - "y": 0.4917262512768131 - }, - { - "id": "point-357", - "x": 0.9990458015267175, - "y": 0.7504596527068438 - }, - { - "id": "point-362", - "x": 0.05012722646310432, - "y": 0.6356486210418795 - }, - { - "id": "point-372", - "x": 0.14440203562340967, - "y": 0.6027579162410623 - }, - { - "id": "point-382", - "x": 0.17550890585241732, - "y": 0.6821246169560776 - }, - { - "id": "point-392", - "x": 0.3370229007633587, - "y": 0.6620020429009194 - }, - { - "id": "point-397", - "x": 0.38403307888040716, - "y": 0.6074565883554648 - }, - { - "id": "point-407", - "x": 0.49141221374045796, - "y": 0.609090909090909 - }, - { - "id": "point-417", - "x": 0.6092239185750636, - "y": 0.6490296220633298 - }, - { - "id": "point-432", - "x": 0.6994910941475826, - "y": 0.6377936670071501 - }, - { - "id": "point-442", - "x": 0.8021628498727735, - "y": 0.6412665985699693 - }, - { - "id": "point-452", - "x": 0.8450381679389314, - "y": 0.6878447395301328 - }, - { - "id": "point-457", - "x": 0.9385496183206108, - "y": 0.5991828396322778 - }, - { - "id": "point-472", - "x": 0.08269720101781171, - "y": 0.8129724208375894 - }, - { - "id": "point-487", - "x": 0.19293893129770992, - "y": 0.7488253319713994 - }, - { - "id": "point-497", - "x": 0.3399491094147582, - "y": 0.7432073544433095 - }, - { - "id": "point-507", - "x": 0.4349872773536895, - "y": 0.8191011235955056 - }, - { - "id": "point-517", - "x": 0.4825699745547074, - "y": 0.8216547497446374 - }, - { - "id": "point-527", - "x": 0.6143129770992367, - "y": 0.8338100102145046 - }, - { - "id": "point-532", - "x": 0.6626590330788804, - "y": 0.7674157303370785 - }, - { - "id": "point-542", - "x": 0.80470737913486, - "y": 0.7797752808988764 - }, - { - "id": "point-557", - "x": 0.858587786259542, - "y": 0.780388151174668 - }, - { - "id": "point-571", - "x": 0.04058524173027989, - "y": 0.9923391215526047 - }, - { - "id": "point-577", - "x": 0.10038167938931299, - "y": 0.9534218590398367 - }, - { - "id": "point-587", - "x": 0.21615776081424937, - "y": 0.9832482124616956 - }, - { - "id": "point-592", - "x": 0.31653944020356234, - "y": 0.8937691521961184 - }, - { - "id": "point-602", - "x": 0.3648218829516539, - "y": 0.9393258426966292 - }, - { - "id": "point-612", - "x": 0.4798346055979643, - "y": 0.9085801838610827 - }, - { - "id": "point-627", - "x": 0.6159669211195928, - "y": 0.9221654749744637 - }, - { - "id": "point-632", - "x": 0.7001272264631042, - "y": 0.9664964249233913 - }, - { - "id": "point-647", - "x": 0.7608778625954199, - "y": 0.9989785495403473 - }, - { - "id": "point-652", - "x": 0.8911577608142494, - "y": 0.9557711950970379 - }, - { - "id": "point-667", - "x": 0.9989821882951655, - "y": 0.9853932584269665 - } - ], - "polygons": [ - { - "id": "poly-0", - "color": { - "h": 269.25373134328356, - "s": 100, - "l": 60.588235294117645, - "a": 1 - }, - "points": [ - "point-0", - "point-1", - "point-2" - ] - }, - { - "id": "poly-1", - "color": { - "h": 277.1428571428571, - "s": 100, - "l": 67.05882352941177, - "a": 1 - }, - "points": [ - "point-0", - "point-2", - "point-7" - ] - }, - { - "id": "poly-2", - "color": { - "h": 277.1428571428571, - "s": 100, - "l": 67.05882352941177, - "a": 1 - }, - "points": [ - "point-0", - "point-7", - "point-12" - ] - }, - { - "id": "poly-3", - "color": { - "h": 275.31428571428575, - "s": 100, - "l": 65.68627450980392, - "a": 1 - }, - "points": [ - "point-12", - "point-7", - "point-17" - ] - }, - { - "id": "poly-4", - "color": { - "h": 276.26373626373623, - "s": 100, - "l": 64.31372549019608, - "a": 1 - }, - "points": [ - "point-12", - "point-17", - "point-22" - ] - }, - { - "id": "poly-5", - "color": { - "h": 272.23404255319144, - "s": 100, - "l": 63.13725490196078, - "a": 1 - }, - "points": [ - "point-12", - "point-22", - "point-27" - ] - }, - { - "id": "poly-6", - "color": { - "h": 268.2692307692307, - "s": 100, - "l": 59.21568627450981, - "a": 1 - }, - "points": [ - "point-12", - "point-27", - "point-32" - ] - }, - { - "id": "poly-7", - "color": { - "h": 274.46808510638294, - "s": 100, - "l": 63.13725490196078, - "a": 1 - }, - "points": [ - "point-22", - "point-17", - "point-37" - ] - }, - { - "id": "poly-8", - "color": { - "h": 272.23404255319144, - "s": 100, - "l": 63.13725490196078, - "a": 1 - }, - "points": [ - "point-22", - "point-37", - "point-42" - ] - }, - { - "id": "poly-9", - "color": { - "h": 269.25373134328356, - "s": 100, - "l": 60.588235294117645, - "a": 1 - }, - "points": [ - "point-22", - "point-42", - "point-27" - ] - }, - { - "id": "poly-10", - "color": { - "h": 269.25373134328356, - "s": 100, - "l": 60.588235294117645, - "a": 1 - }, - "points": [ - "point-42", - "point-37", - "point-52" - ] - }, - { - "id": "poly-11", - "color": { - "h": 268.2692307692307, - "s": 100, - "l": 59.21568627450981, - "a": 1 - }, - "points": [ - "point-42", - "point-52", - "point-27" - ] - }, - { - "id": "poly-12", - "color": { - "h": 265.96153846153845, - "s": 100, - "l": 59.21568627450981, - "a": 1 - }, - "points": [ - "point-27", - "point-52", - "point-62" - ] - }, - { - "id": "poly-13", - "color": { - "h": 265.88235294117646, - "s": 86.4406779661017, - "l": 53.72549019607843, - "a": 1 - }, - "points": [ - "point-27", - "point-62", - "point-32" - ] - }, - { - "id": "poly-14", - "color": { - "h": 265.48387096774195, - "s": 76.22950819672131, - "l": 47.84313725490196, - "a": 1 - }, - "points": [ - "point-32", - "point-62", - "point-72" - ] - }, - { - "id": "poly-15", - "color": { - "h": 265.1933701657459, - "s": 83.41013824884793, - "l": 42.549019607843135, - "a": 1 - }, - "points": [ - "point-32", - "point-72", - "point-77" - ] - }, - { - "id": "poly-16", - "color": { - "h": 264.45859872611464, - "s": 96.31901840490798, - "l": 31.960784313725487, - "a": 1 - }, - "points": [ - "point-32", - "point-77", - "point-82" - ] - }, - { - "id": "poly-17", - "color": { - "h": 261.69230769230774, - "s": 100, - "l": 25.49019607843137, - "a": 1 - }, - "points": [ - "point-32", - "point-82", - "point-87" - ] - }, - { - "id": "poly-18", - "color": { - "h": 263.3532934131737, - "s": 91.2568306010929, - "l": 35.88235294117647, - "a": 1 - }, - "points": [ - "point-77", - "point-72", - "point-92" - ] - }, - { - "id": "poly-19", - "color": { - "h": 263.64963503649636, - "s": 100, - "l": 26.862745098039216, - "a": 1 - }, - "points": [ - "point-77", - "point-92", - "point-82" - ] - }, - { - "id": "poly-20", - "color": { - "h": 264.45859872611464, - "s": 96.31901840490798, - "l": 31.960784313725487, - "a": 1 - }, - "points": [ - "point-92", - "point-72", - "point-102" - ] - }, - { - "id": "poly-21", - "color": { - "h": 263.64963503649636, - "s": 100, - "l": 26.862745098039216, - "a": 1 - }, - "points": [ - "point-92", - "point-102", - "point-107" - ] - }, - { - "id": "poly-22", - "color": { - "h": 261.69230769230774, - "s": 100, - "l": 25.49019607843137, - "a": 1 - }, - "points": [ - "point-92", - "point-107", - "point-112" - ] - }, - { - "id": "poly-23", - "color": { - "h": 260, - "s": 100, - "l": 24.11764705882353, - "a": 1 - }, - "points": [ - "point-92", - "point-112", - "point-82" - ] - }, - { - "id": "poly-24", - "color": { - "h": 260, - "s": 100, - "l": 24.11764705882353, - "a": 1 - }, - "points": [ - "point-112", - "point-107", - "point-122" - ] - }, - { - "id": "poly-25", - "color": { - "h": 260, - "s": 100, - "l": 24.11764705882353, - "a": 1 - }, - "points": [ - "point-112", - "point-122", - "point-82" - ] - }, - { - "id": "poly-26", - "color": { - "h": 259.44444444444446, - "s": 100, - "l": 21.176470588235293, - "a": 1 - }, - "points": [ - "point-82", - "point-122", - "point-132" - ] - }, - { - "id": "poly-27", - "color": { - "h": 259.44444444444446, - "s": 100, - "l": 21.176470588235293, - "a": 1 - }, - "points": [ - "point-82", - "point-132", - "point-87" - ] - }, - { - "id": "poly-28", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-87", - "point-132", - "point-142" - ] - }, - { - "id": "poly-29", - "color": { - "h": 275.31428571428575, - "s": 100, - "l": 65.68627450980392, - "a": 1 - }, - "points": [ - "point-7", - "point-2", - "point-17" - ] - }, - { - "id": "poly-30", - "color": { - "h": 274.46808510638294, - "s": 100, - "l": 63.13725490196078, - "a": 1 - }, - "points": [ - "point-17", - "point-2", - "point-152" - ] - }, - { - "id": "poly-31", - "color": { - "h": 272.23404255319144, - "s": 100, - "l": 63.13725490196078, - "a": 1 - }, - "points": [ - "point-17", - "point-152", - "point-37" - ] - }, - { - "id": "poly-32", - "color": { - "h": 269.25373134328356, - "s": 100, - "l": 60.588235294117645, - "a": 1 - }, - "points": [ - "point-37", - "point-152", - "point-162" - ] - }, - { - "id": "poly-33", - "color": { - "h": 268.2692307692307, - "s": 100, - "l": 59.21568627450981, - "a": 1 - }, - "points": [ - "point-37", - "point-162", - "point-167" - ] - }, - { - "id": "poly-34", - "color": { - "h": 268.2692307692307, - "s": 100, - "l": 59.21568627450981, - "a": 1 - }, - "points": [ - "point-37", - "point-167", - "point-52" - ] - }, - { - "id": "poly-35", - "color": { - "h": 265.92233009708735, - "s": 92.7927927927928, - "l": 56.470588235294116, - "a": 1 - }, - "points": [ - "point-52", - "point-167", - "point-62" - ] - }, - { - "id": "poly-36", - "color": { - "h": 265.88235294117646, - "s": 86.4406779661017, - "l": 53.72549019607843, - "a": 1 - }, - "points": [ - "point-62", - "point-167", - "point-182" - ] - }, - { - "id": "poly-37", - "color": { - "h": 265.48387096774195, - "s": 76.22950819672131, - "l": 47.84313725490196, - "a": 1 - }, - "points": [ - "point-62", - "point-182", - "point-187" - ] - }, - { - "id": "poly-38", - "color": { - "h": 265.24590163934425, - "s": 79.22077922077922, - "l": 45.294117647058826, - "a": 1 - }, - "points": [ - "point-62", - "point-187", - "point-192" - ] - }, - { - "id": "poly-39", - "color": { - "h": 265.24590163934425, - "s": 79.22077922077922, - "l": 45.294117647058826, - "a": 1 - }, - "points": [ - "point-62", - "point-192", - "point-72" - ] - }, - { - "id": "poly-40", - "color": { - "h": 263.3532934131737, - "s": 91.2568306010929, - "l": 35.88235294117647, - "a": 1 - }, - "points": [ - "point-192", - "point-187", - "point-202" - ] - }, - { - "id": "poly-41", - "color": { - "h": 264.45859872611464, - "s": 96.31901840490798, - "l": 31.960784313725487, - "a": 1 - }, - "points": [ - "point-192", - "point-202", - "point-102" - ] - }, - { - "id": "poly-42", - "color": { - "h": 263.3532934131737, - "s": 91.2568306010929, - "l": 35.88235294117647, - "a": 1 - }, - "points": [ - "point-192", - "point-102", - "point-72" - ] - }, - { - "id": "poly-43", - "color": { - "h": 263.64963503649636, - "s": 100, - "l": 26.862745098039216, - "a": 1 - }, - "points": [ - "point-102", - "point-202", - "point-217" - ] - }, - { - "id": "poly-44", - "color": { - "h": 261.69230769230774, - "s": 100, - "l": 25.49019607843137, - "a": 1 - }, - "points": [ - "point-102", - "point-217", - "point-107" - ] - }, - { - "id": "poly-45", - "color": { - "h": 259.44444444444446, - "s": 100, - "l": 21.176470588235293, - "a": 1 - }, - "points": [ - "point-107", - "point-217", - "point-227" - ] - }, - { - "id": "poly-46", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-107", - "point-227", - "point-232" - ] - }, - { - "id": "poly-47", - "color": { - "h": 259.44444444444446, - "s": 100, - "l": 21.176470588235293, - "a": 1 - }, - "points": [ - "point-107", - "point-232", - "point-122" - ] - }, - { - "id": "poly-48", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-122", - "point-232", - "point-132" - ] - }, - { - "id": "poly-49", - "color": { - "h": 255.31914893617022, - "s": 100, - "l": 18.43137254901961, - "a": 1 - }, - "points": [ - "point-132", - "point-232", - "point-142" - ] - }, - { - "id": "poly-50", - "color": { - "h": 265.24590163934425, - "s": 79.22077922077922, - "l": 45.294117647058826, - "a": 1 - }, - "points": [ - "point-2", - "point-1", - "point-252" - ] - }, - { - "id": "poly-51", - "color": { - "h": 265.96153846153845, - "s": 100, - "l": 59.21568627450981, - "a": 1 - }, - "points": [ - "point-2", - "point-252", - "point-257" - ] - }, - { - "id": "poly-52", - "color": { - "h": 268.2692307692307, - "s": 100, - "l": 59.21568627450981, - "a": 1 - }, - "points": [ - "point-2", - "point-257", - "point-152" - ] - }, - { - "id": "poly-53", - "color": { - "h": 265.54455445544556, - "s": 80.8, - "l": 50.98039215686274, - "a": 1 - }, - "points": [ - "point-152", - "point-257", - "point-267" - ] - }, - { - "id": "poly-54", - "color": { - "h": 265.54455445544556, - "s": 80.8, - "l": 50.98039215686274, - "a": 1 - }, - "points": [ - "point-152", - "point-267", - "point-162" - ] - }, - { - "id": "poly-55", - "color": { - "h": 264.68571428571425, - "s": 91.62303664921467, - "l": 37.450980392156865, - "a": 1 - }, - "points": [ - "point-162", - "point-267", - "point-277" - ] - }, - { - "id": "poly-56", - "color": { - "h": 265.24590163934425, - "s": 79.22077922077922, - "l": 45.294117647058826, - "a": 1 - }, - "points": [ - "point-162", - "point-277", - "point-167" - ] - }, - { - "id": "poly-57", - "color": { - "h": 265.1933701657459, - "s": 83.41013824884793, - "l": 42.549019607843135, - "a": 1 - }, - "points": [ - "point-167", - "point-277", - "point-182" - ] - }, - { - "id": "poly-58", - "color": { - "h": 263.3532934131737, - "s": 91.2568306010929, - "l": 35.88235294117647, - "a": 1 - }, - "points": [ - "point-182", - "point-277", - "point-292" - ] - }, - { - "id": "poly-59", - "color": { - "h": 264.68571428571425, - "s": 91.62303664921467, - "l": 37.450980392156865, - "a": 1 - }, - "points": [ - "point-182", - "point-292", - "point-187" - ] - }, - { - "id": "poly-60", - "color": { - "h": 262.3448275862069, - "s": 100, - "l": 28.431372549019606, - "a": 1 - }, - "points": [ - "point-187", - "point-292", - "point-302" - ] - }, - { - "id": "poly-61", - "color": { - "h": 260, - "s": 100, - "l": 24.11764705882353, - "a": 1 - }, - "points": [ - "point-187", - "point-302", - "point-307" - ] - }, - { - "id": "poly-62", - "color": { - "h": 263.64963503649636, - "s": 100, - "l": 26.862745098039216, - "a": 1 - }, - "points": [ - "point-187", - "point-307", - "point-202" - ] - }, - { - "id": "poly-63", - "color": { - "h": 255.31914893617022, - "s": 100, - "l": 18.43137254901961, - "a": 1 - }, - "points": [ - "point-202", - "point-307", - "point-317" - ] - }, - { - "id": "poly-64", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-202", - "point-317", - "point-217" - ] - }, - { - "id": "poly-65", - "color": { - "h": 249.75, - "s": 100, - "l": 15.686274509803921, - "a": 1 - }, - "points": [ - "point-217", - "point-317", - "point-327" - ] - }, - { - "id": "poly-66", - "color": { - "h": 249.75, - "s": 100, - "l": 15.686274509803921, - "a": 1 - }, - "points": [ - "point-217", - "point-327", - "point-227" - ] - }, - { - "id": "poly-67", - "color": { - "h": 240, - "s": 100, - "l": 9.215686274509805, - "a": 1 - }, - "points": [ - "point-227", - "point-327", - "point-337" - ] - }, - { - "id": "poly-68", - "color": { - "h": 246.57534246575347, - "s": 100, - "l": 14.313725490196077, - "a": 1 - }, - "points": [ - "point-227", - "point-337", - "point-232" - ] - }, - { - "id": "poly-69", - "color": { - "h": 242.99999999999997, - "s": 100, - "l": 11.76470588235294, - "a": 1 - }, - "points": [ - "point-232", - "point-337", - "point-142" - ] - }, - { - "id": "poly-70", - "color": { - "h": 240, - "s": 100, - "l": 8.03921568627451, - "a": 1 - }, - "points": [ - "point-142", - "point-337", - "point-352" - ] - }, - { - "id": "poly-71", - "color": { - "h": 240, - "s": 100, - "l": 1.5686274509803921, - "a": 1 - }, - "points": [ - "point-142", - "point-352", - "point-357" - ] - }, - { - "id": "poly-72", - "color": { - "h": 264.45859872611464, - "s": 96.31901840490798, - "l": 31.960784313725487, - "a": 1 - }, - "points": [ - "point-252", - "point-1", - "point-362" - ] - }, - { - "id": "poly-73", - "color": { - "h": 265.24590163934425, - "s": 79.22077922077922, - "l": 45.294117647058826, - "a": 1 - }, - "points": [ - "point-252", - "point-362", - "point-257" - ] - }, - { - "id": "poly-74", - "color": { - "h": 264.68571428571425, - "s": 91.62303664921467, - "l": 37.450980392156865, - "a": 1 - }, - "points": [ - "point-257", - "point-362", - "point-372" - ] - }, - { - "id": "poly-75", - "color": { - "h": 264.9438202247191, - "s": 87.25490196078431, - "l": 40, - "a": 1 - }, - "points": [ - "point-257", - "point-372", - "point-267" - ] - }, - { - "id": "poly-76", - "color": { - "h": 262.3448275862069, - "s": 100, - "l": 28.431372549019606, - "a": 1 - }, - "points": [ - "point-267", - "point-372", - "point-382" - ] - }, - { - "id": "poly-77", - "color": { - "h": 263.64963503649636, - "s": 100, - "l": 26.862745098039216, - "a": 1 - }, - "points": [ - "point-267", - "point-382", - "point-277" - ] - }, - { - "id": "poly-78", - "color": { - "h": 259.44444444444446, - "s": 100, - "l": 21.176470588235293, - "a": 1 - }, - "points": [ - "point-277", - "point-382", - "point-392" - ] - }, - { - "id": "poly-79", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-277", - "point-392", - "point-397" - ] - }, - { - "id": "poly-80", - "color": { - "h": 261.69230769230774, - "s": 100, - "l": 25.49019607843137, - "a": 1 - }, - "points": [ - "point-277", - "point-397", - "point-292" - ] - }, - { - "id": "poly-81", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-292", - "point-397", - "point-407" - ] - }, - { - "id": "poly-82", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-292", - "point-407", - "point-302" - ] - }, - { - "id": "poly-83", - "color": { - "h": 240, - "s": 100, - "l": 10.588235294117647, - "a": 1 - }, - "points": [ - "point-302", - "point-407", - "point-417" - ] - }, - { - "id": "poly-84", - "color": { - "h": 242.99999999999997, - "s": 100, - "l": 11.76470588235294, - "a": 1 - }, - "points": [ - "point-302", - "point-417", - "point-307" - ] - }, - { - "id": "poly-85", - "color": { - "h": 240, - "s": 100, - "l": 9.215686274509805, - "a": 1 - }, - "points": [ - "point-307", - "point-417", - "point-317" - ] - }, - { - "id": "poly-86", - "color": { - "h": 240, - "s": 100, - "l": 4.705882352941177, - "a": 1 - }, - "points": [ - "point-317", - "point-417", - "point-432" - ] - }, - { - "id": "poly-87", - "color": { - "h": 240, - "s": 100, - "l": 6.862745098039216, - "a": 1 - }, - "points": [ - "point-317", - "point-432", - "point-327" - ] - }, - { - "id": "poly-88", - "color": { - "h": 240, - "s": 100, - "l": 1.5686274509803921, - "a": 1 - }, - "points": [ - "point-327", - "point-432", - "point-442" - ] - }, - { - "id": "poly-89", - "color": { - "h": 240, - "s": 100, - "l": 2.549019607843137, - "a": 1 - }, - "points": [ - "point-327", - "point-442", - "point-337" - ] - }, - { - "id": "poly-90", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-337", - "point-442", - "point-452" - ] - }, - { - "id": "poly-91", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-337", - "point-452", - "point-457" - ] - }, - { - "id": "poly-92", - "color": { - "h": 240, - "s": 100, - "l": 1.5686274509803921, - "a": 1 - }, - "points": [ - "point-337", - "point-457", - "point-352" - ] - }, - { - "id": "poly-93", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-352", - "point-457", - "point-357" - ] - }, - { - "id": "poly-94", - "color": { - "h": 261.69230769230774, - "s": 100, - "l": 25.49019607843137, - "a": 1 - }, - "points": [ - "point-362", - "point-1", - "point-472" - ] - }, - { - "id": "poly-95", - "color": { - "h": 260, - "s": 100, - "l": 24.11764705882353, - "a": 1 - }, - "points": [ - "point-362", - "point-472", - "point-382" - ] - }, - { - "id": "poly-96", - "color": { - "h": 263.64963503649636, - "s": 100, - "l": 26.862745098039216, - "a": 1 - }, - "points": [ - "point-362", - "point-382", - "point-372" - ] - }, - { - "id": "poly-97", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-382", - "point-472", - "point-487" - ] - }, - { - "id": "poly-98", - "color": { - "h": 255.31914893617022, - "s": 100, - "l": 18.43137254901961, - "a": 1 - }, - "points": [ - "point-382", - "point-487", - "point-392" - ] - }, - { - "id": "poly-99", - "color": { - "h": 249.75, - "s": 100, - "l": 15.686274509803921, - "a": 1 - }, - "points": [ - "point-392", - "point-487", - "point-497" - ] - }, - { - "id": "poly-100", - "color": { - "h": 246.57534246575347, - "s": 100, - "l": 14.313725490196077, - "a": 1 - }, - "points": [ - "point-392", - "point-497", - "point-397" - ] - }, - { - "id": "poly-101", - "color": { - "h": 240, - "s": 100, - "l": 10.588235294117647, - "a": 1 - }, - "points": [ - "point-397", - "point-497", - "point-507" - ] - }, - { - "id": "poly-102", - "color": { - "h": 240, - "s": 100, - "l": 9.215686274509805, - "a": 1 - }, - "points": [ - "point-397", - "point-507", - "point-407" - ] - }, - { - "id": "poly-103", - "color": { - "h": 240, - "s": 100, - "l": 6.862745098039216, - "a": 1 - }, - "points": [ - "point-407", - "point-507", - "point-517" - ] - }, - { - "id": "poly-104", - "color": { - "h": 240, - "s": 100, - "l": 5.686274509803922, - "a": 1 - }, - "points": [ - "point-407", - "point-517", - "point-417" - ] - }, - { - "id": "poly-105", - "color": { - "h": 240, - "s": 100, - "l": 1.5686274509803921, - "a": 1 - }, - "points": [ - "point-417", - "point-517", - "point-527" - ] - }, - { - "id": "poly-106", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-417", - "point-527", - "point-532" - ] - }, - { - "id": "poly-107", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-417", - "point-532", - "point-432" - ] - }, - { - "id": "poly-108", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-432", - "point-532", - "point-542" - ] - }, - { - "id": "poly-109", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-432", - "point-542", - "point-442" - ] - }, - { - "id": "poly-110", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-442", - "point-542", - "point-452" - ] - }, - { - "id": "poly-111", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-452", - "point-542", - "point-557" - ] - }, - { - "id": "poly-112", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-452", - "point-557", - "point-457" - ] - }, - { - "id": "poly-113", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-457", - "point-557", - "point-357" - ] - }, - { - "id": "poly-114", - "color": { - "h": 259.44444444444446, - "s": 100, - "l": 21.176470588235293, - "a": 1 - }, - "points": [ - "point-1", - "point-571", - "point-472" - ] - }, - { - "id": "poly-115", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-472", - "point-571", - "point-577" - ] - }, - { - "id": "poly-116", - "color": { - "h": 257.2277227722772, - "s": 100, - "l": 19.80392156862745, - "a": 1 - }, - "points": [ - "point-472", - "point-577", - "point-487" - ] - }, - { - "id": "poly-117", - "color": { - "h": 252.41379310344828, - "s": 100, - "l": 17.058823529411764, - "a": 1 - }, - "points": [ - "point-487", - "point-577", - "point-587" - ] - }, - { - "id": "poly-118", - "color": { - "h": 246.57534246575347, - "s": 100, - "l": 14.313725490196077, - "a": 1 - }, - "points": [ - "point-487", - "point-587", - "point-592" - ] - }, - { - "id": "poly-119", - "color": { - "h": 246.57534246575347, - "s": 100, - "l": 14.313725490196077, - "a": 1 - }, - "points": [ - "point-487", - "point-592", - "point-497" - ] - }, - { - "id": "poly-120", - "color": { - "h": 240, - "s": 100, - "l": 9.215686274509805, - "a": 1 - }, - "points": [ - "point-497", - "point-592", - "point-602" - ] - }, - { - "id": "poly-121", - "color": { - "h": 240, - "s": 100, - "l": 9.215686274509805, - "a": 1 - }, - "points": [ - "point-497", - "point-602", - "point-507" - ] - }, - { - "id": "poly-122", - "color": { - "h": 240, - "s": 100, - "l": 5.686274509803922, - "a": 1 - }, - "points": [ - "point-507", - "point-602", - "point-612" - ] - }, - { - "id": "poly-123", - "color": { - "h": 240, - "s": 100, - "l": 5.686274509803922, - "a": 1 - }, - "points": [ - "point-507", - "point-612", - "point-517" - ] - }, - { - "id": "poly-124", - "color": { - "h": 240, - "s": 100, - "l": 1.5686274509803921, - "a": 1 - }, - "points": [ - "point-517", - "point-612", - "point-527" - ] - }, - { - "id": "poly-125", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-527", - "point-612", - "point-627" - ] - }, - { - "id": "poly-126", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-527", - "point-627", - "point-632" - ] - }, - { - "id": "poly-127", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-527", - "point-632", - "point-532" - ] - }, - { - "id": "poly-128", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-532", - "point-632", - "point-542" - ] - }, - { - "id": "poly-129", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-542", - "point-632", - "point-647" - ] - }, - { - "id": "poly-130", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-542", - "point-647", - "point-652" - ] - }, - { - "id": "poly-131", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-542", - "point-652", - "point-557" - ] - }, - { - "id": "poly-132", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-557", - "point-652", - "point-357" - ] - }, - { - "id": "poly-133", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-357", - "point-652", - "point-667" - ] - }, - { - "id": "poly-134", - "color": { - "h": 240, - "s": 100, - "l": 6.862745098039216, - "a": 1 - }, - "points": [ - "point-571", - "point-647", - "point-587" - ] - }, - { - "id": "poly-135", - "color": { - "h": 252.41379310344828, - "s": 100, - "l": 17.058823529411764, - "a": 1 - }, - "points": [ - "point-571", - "point-587", - "point-577" - ] - }, - { - "id": "poly-136", - "color": { - "h": 240, - "s": 100, - "l": 2.549019607843137, - "a": 1 - }, - "points": [ - "point-587", - "point-647", - "point-602" - ] - }, - { - "id": "poly-137", - "color": { - "h": 240, - "s": 100, - "l": 9.215686274509805, - "a": 1 - }, - "points": [ - "point-587", - "point-602", - "point-592" - ] - }, - { - "id": "poly-138", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-602", - "point-647", - "point-632" - ] - }, - { - "id": "poly-139", - "color": { - "h": 240, - "s": 100, - "l": 0.5882352941176471, - "a": 1 - }, - "points": [ - "point-602", - "point-632", - "point-612" - ] - }, - { - "id": "poly-140", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-612", - "point-632", - "point-627" - ] - }, - { - "id": "poly-141", - "color": { - "h": 0, - "s": 0, - "l": 0, - "a": 1 - }, - "points": [ - "point-647", - "point-667", - "point-652" - ] - } - ] -}; diff --git a/website/source/assets/javascripts/app/_Init.js b/website/source/assets/javascripts/app/_Init.js deleted file mode 100644 index 06e772beb..000000000 --- a/website/source/assets/javascripts/app/_Init.js +++ /dev/null @@ -1,89 +0,0 @@ -(function( - Engine -){ - -// Quick and dirty IE detection -var isIE = (function(){ - if (window.navigator.userAgent.match('Trident')) { - return true; - } else { - return false; - } -})(); - -// isIE = true; - -var Init = { - - start: function(){ - var id = document.body.id.toLowerCase(); - - if (this.Pages[id]) { - this.Pages[id](); - } - //always init sidebar - Init.initializeSidebar(); - }, - - initializeSidebar: function(){ - new Sidebar(); - }, - - generateAnimatedLogo: function(){ - var container, x, block; - - container = document.createElement('div'); - container.className = 'animated-logo'; - - for (x = 1; x < 5; x++) { - block = document.createElement('div'); - block.className = 'white-block block-' + x; - container.appendChild(block); - } - - return container; - }, - - initializeEngine: function(){ - var jumbotron = document.getElementById('jumbotron'), - content = document.getElementById('jumbotron-content'), - tagLine = document.getElementById('tag-line'), - canvas, galaxy; - - if (!jumbotron) { - return; - } - - galaxy = document.createElement('div'); - galaxy.id = 'galaxy-bg'; - galaxy.className = 'galaxy-bg'; - jumbotron.appendChild(galaxy); - - content.appendChild( - Init.generateAnimatedLogo() - ); - - canvas = document.createElement('canvas'); - canvas.className = 'terraform-canvas'; - - jumbotron.appendChild(canvas); - new Engine(canvas, galaxy, tagLine); - }, - - Pages: { - 'page-home': function(){ - if (isIE) { - document.getElementById('jumbotron').className += ' static'; - document.getElementById('tag-line').style.visibility = 'visible'; - return; - } - - Init.initializeEngine(); - } - } - -}; - -Init.start(); - -})(window.Engine); diff --git a/website/source/assets/javascripts/app/_Logo.js b/website/source/assets/javascripts/app/_Logo.js deleted file mode 100644 index 0824b1c7e..000000000 --- a/website/source/assets/javascripts/app/_Logo.js +++ /dev/null @@ -1,1330 +0,0 @@ -// jshint unused:false -var Logo = { - "data": { - "width": 587, - "height": 587, - "ar": 1 - }, - "points": [ - { - "id": "point-0", - "x": 0.5809199318568995, - "y": 0.7478705281090289 - }, - { - "id": "point-1", - "x": 0.8160136286201022, - "y": 0.616695059625213 - }, - { - "id": "point-2", - "x": 0.6081771720613288, - "y": 0.8943781942078366 - }, - { - "id": "point-4", - "x": 0.9761499148211243, - "y": 0.6550255536626917 - }, - { - "id": "point-5", - "x": 0.848381601362862, - "y": 0.8603066439522997 - }, - { - "id": "point-12", - "x": 0.6354344122657581, - "y": 0.9829642248722317 - }, - { - "id": "point-16", - "x": 0.5536626916524702, - "y": 0.9982964224872233 - }, - { - "id": "point-20", - "x": 0.45451448040885867, - "y": 0.9463373083475298 - }, - { - "id": "point-24", - "x": 0.48126064735945484, - "y": 0.9982964224872233 - }, - { - "id": "point-28", - "x": 0.403747870528109, - "y": 0.994037478705281 - }, - { - "id": "point-32", - "x": 0.18143100511073254, - "y": 0.8858603066439524 - }, - { - "id": "point-36", - "x": 0.22998296422487224, - "y": 0.8057921635434411 - }, - { - "id": "point-40", - "x": 0.3373083475298126, - "y": 0.7052810902896082 - }, - { - "id": "point-44", - "x": 0.5143100511073253, - "y": 0.6933560477001702 - }, - { - "id": "point-56", - "x": 0.8918228279386712, - "y": 0.46337308347529815 - }, - { - "id": "point-60", - "x": 0.9974446337308348, - "y": 0.5366269165247018 - }, - { - "id": "point-64", - "x": 0.9574105621805792, - "y": 0.368824531516184 - }, - { - "id": "point-68", - "x": 0.9761499148211243, - "y": 0.36201022146507666 - }, - { - "id": "point-72", - "x": 0.6626916524701874, - "y": 0.43781942078364566 - }, - { - "id": "point-84", - "x": 0.4335604770017036, - "y": 0.5698466780238501 - }, - { - "id": "point-92", - "x": 0.11158432708688246, - "y": 0.8197614991482112 - }, - { - "id": "point-96", - "x": 0.09540034071550256, - "y": 0.6669505962521295 - }, - { - "id": "point-104", - "x": 0.05536626916524703, - "y": 0.7257240204429302 - }, - { - "id": "point-108", - "x": 0.03492333901192504, - "y": 0.6831345826235093 - }, - { - "id": "point-112", - "x": 0.15417376490630325, - "y": 0.4892674616695059 - }, - { - "id": "point-116", - "x": 0.22487223168654175, - "y": 0.4599659284497445 - }, - { - "id": "point-124", - "x": 0.2785349233390119, - "y": 0.35945485519591147 - }, - { - "id": "point-128", - "x": 0.48722316865417375, - "y": 0.35945485519591147 - }, - { - "id": "point-136", - "x": 0.5809199318568995, - "y": 0.2925042589437819 - }, - { - "id": "point-140", - "x": 0.889267461669506, - "y": 0.27649063032367976 - }, - { - "id": "point-152", - "x": 0.944633730834753, - "y": 0.2737649063032368 - }, - { - "id": "point-160", - "x": 0.8802385008517888, - "y": 0.18177172061328795 - }, - { - "id": "point-168", - "x": 0.5809199318568995, - "y": 0.19471890971039182 - }, - { - "id": "point-176", - "x": 0.7989778534923339, - "y": 0.10391822827938672 - }, - { - "id": "point-180", - "x": 0.6218057921635435, - "y": 0.018739352640545145 - }, - { - "id": "point-184", - "x": 0.5252129471890972, - "y": 0.0005110732538330494 - }, - { - "id": "point-188", - "x": 0.3889267461669506, - "y": 0.09761499148211243 - }, - { - "id": "point-192", - "x": 0.38126064735945486, - "y": 0.018739352640545145 - }, - { - "id": "point-196", - "x": 0.30153321976149916, - "y": 0.04258943781942079 - }, - { - "id": "point-200", - "x": 0.2969335604770017, - "y": 0.09761499148211243 - }, - { - "id": "point-216", - "x": 0.049403747870528106, - "y": 0.3083475298126065 - }, - { - "id": "point-228", - "x": 0.002214650766609881, - "y": 0.47155025553662694 - }, - { - "id": "point-232", - "x": 0.0005110732538330494, - "y": 0.5289608177172062 - }, - { - "id": "point-244", - "x": 0.17325383304940373, - "y": 0.12180579216354344 - } - ], - "polygons": [ - { - "id": "poly-0", - "color": { - "h": 264.688995215311, - "s": 100, - "l": 59.01960784313726, - "a": 1 - }, - "points": [ - "point-0", - "point-1", - "point-2" - ] - }, - { - "id": "poly-1", - "color": { - "h": 268.3076923076923, - "s": 100, - "l": 61.76470588235294, - "a": 1 - }, - "points": [ - "point-4", - "point-5", - "point-1" - ] - }, - { - "id": "poly-2", - "color": { - "h": 267.1641791044776, - "s": 100, - "l": 60.588235294117645, - "a": 1 - }, - "points": [ - "point-5", - "point-2", - "point-1" - ] - }, - { - "id": "poly-3", - "color": { - "h": 268.3076923076923, - "s": 100, - "l": 61.76470588235294, - "a": 1 - }, - "points": [ - "point-12", - "point-2", - "point-5" - ] - }, - { - "id": "poly-4", - "color": { - "h": 267.1641791044776, - "s": 100, - "l": 60.588235294117645, - "a": 1 - }, - "points": [ - "point-16", - "point-12", - "point-2" - ] - }, - { - "id": "poly-5", - "color": { - "h": 264.9, - "s": 92.59259259259261, - "l": 57.647058823529406, - "a": 1 - }, - "points": [ - "point-20", - "point-2", - "point-16" - ] - }, - { - "id": "poly-6", - "color": { - "h": 264.9, - "s": 92.59259259259261, - "l": 57.647058823529406, - "a": 1 - }, - "points": [ - "point-24", - "point-20", - "point-16" - ] - }, - { - "id": "poly-7", - "color": { - "h": 264.97461928934007, - "s": 85.28138528138528, - "l": 54.70588235294118, - "a": 1 - }, - "points": [ - "point-28", - "point-20", - "point-24" - ] - }, - { - "id": "poly-8", - "color": { - "h": 265.4347826086956, - "s": 80, - "l": 45.09803921568628, - "a": 1 - }, - "points": [ - "point-32", - "point-20", - "point-28" - ] - }, - { - "id": "poly-9", - "color": { - "h": 265.4347826086956, - "s": 80, - "l": 45.09803921568628, - "a": 1 - }, - "points": [ - "point-36", - "point-32", - "point-20" - ] - }, - { - "id": "poly-10", - "color": { - "h": 265.4347826086956, - "s": 80, - "l": 45.09803921568628, - "a": 1 - }, - "points": [ - "point-40", - "point-36", - "point-20" - ] - }, - { - "id": "poly-11", - "color": { - "h": 265.48387096774195, - "s": 76.22950819672131, - "l": 47.84313725490196, - "a": 1 - }, - "points": [ - "point-44", - "point-20", - "point-40" - ] - }, - { - "id": "poly-12", - "color": { - "h": 264.61538461538464, - "s": 79.59183673469387, - "l": 51.9607843137255, - "a": 1 - }, - "points": [ - "point-0", - "point-44", - "point-20" - ] - }, - { - "id": "poly-13", - "color": { - "h": 264.9, - "s": 92.59259259259261, - "l": 57.647058823529406, - "a": 1 - }, - "points": [ - "point-0", - "point-20", - "point-2" - ] - }, - { - "id": "poly-14", - "color": { - "h": 264.61538461538464, - "s": 79.59183673469387, - "l": 51.9607843137255, - "a": 1 - }, - "points": [ - "point-56", - "point-1", - "point-4" - ] - }, - { - "id": "poly-15", - "color": { - "h": 264.61538461538464, - "s": 79.59183673469387, - "l": 51.9607843137255, - "a": 1 - }, - "points": [ - "point-60", - "point-4", - "point-56" - ] - }, - { - "id": "poly-16", - "color": { - "h": 263.64705882352945, - "s": 86.73469387755101, - "l": 38.43137254901961, - "a": 1 - }, - "points": [ - "point-64", - "point-56", - "point-60" - ] - }, - { - "id": "poly-17", - "color": { - "h": 264.9056603773585, - "s": 90.85714285714286, - "l": 34.31372549019608, - "a": 1 - }, - "points": [ - "point-68", - "point-64", - "point-60" - ] - }, - { - "id": "poly-18", - "color": { - "h": 263.64705882352945, - "s": 86.73469387755101, - "l": 38.43137254901961, - "a": 1 - }, - "points": [ - "point-72", - "point-56", - "point-1" - ] - }, - { - "id": "poly-19", - "color": { - "h": 265.4347826086956, - "s": 80, - "l": 45.09803921568628, - "a": 1 - }, - "points": [ - "point-0", - "point-72", - "point-1" - ] - }, - { - "id": "poly-20", - "color": { - "h": 264.20454545454544, - "s": 79.27927927927928, - "l": 43.529411764705884, - "a": 1 - }, - "points": [ - "point-72", - "point-0", - "point-44" - ] - }, - { - "id": "poly-21", - "color": { - "h": 264.2307692307692, - "s": 95.12195121951221, - "l": 32.15686274509804, - "a": 1 - }, - "points": [ - "point-84", - "point-44", - "point-72" - ] - }, - { - "id": "poly-22", - "color": { - "h": 263.64705882352945, - "s": 86.73469387755101, - "l": 38.43137254901961, - "a": 1 - }, - "points": [ - "point-40", - "point-84", - "point-44" - ] - }, - { - "id": "poly-23", - "color": { - "h": 264.9056603773585, - "s": 90.85714285714286, - "l": 34.31372549019608, - "a": 1 - }, - "points": [ - "point-92", - "point-32", - "point-36" - ] - }, - { - "id": "poly-24", - "color": { - "h": 264.2307692307692, - "s": 95.12195121951221, - "l": 32.15686274509804, - "a": 1 - }, - "points": [ - "point-96", - "point-92", - "point-36" - ] - }, - { - "id": "poly-25", - "color": { - "h": 264.9056603773585, - "s": 90.85714285714286, - "l": 34.31372549019608, - "a": 1 - }, - "points": [ - "point-40", - "point-96", - "point-36" - ] - }, - { - "id": "poly-26", - "color": { - "h": 264.2307692307692, - "s": 95.12195121951221, - "l": 32.15686274509804, - "a": 1 - }, - "points": [ - "point-104", - "point-92", - "point-96" - ] - }, - { - "id": "poly-27", - "color": { - "h": 261.6, - "s": 100, - "l": 14.705882352941178, - "a": 1 - }, - "points": [ - "point-108", - "point-104", - "point-96" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-28", - "color": { - "h": 261.6, - "s": 100, - "l": 14.705882352941178, - "a": 1 - }, - "points": [ - "point-112", - "point-40", - "point-96" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-29", - "color": { - "h": 257.910447761194, - "s": 100, - "l": 13.137254901960786, - "a": 1 - }, - "points": [ - "point-116", - "point-112", - "point-40" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-30", - "color": { - "h": 262.8571428571429, - "s": 100, - "l": 16.470588235294116, - "a": 1 - }, - "points": [ - "point-84", - "point-40", - "point-116" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-31", - "color": { - "h": 252.00000000000003, - "s": 100, - "l": 9.803921568627452, - "a": 1 - }, - "points": [ - "point-124", - "point-84", - "point-116" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-32", - "color": { - "h": 252.00000000000003, - "s": 100, - "l": 9.803921568627452, - "a": 1 - }, - "points": [ - "point-128", - "point-84", - "point-124" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-33", - "color": { - "h": 257.910447761194, - "s": 100, - "l": 13.137254901960786, - "a": 1 - }, - "points": [ - "point-72", - "point-128", - "point-84" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-34", - "color": { - "h": 252.00000000000003, - "s": 100, - "l": 9.803921568627452, - "a": 1 - }, - "points": [ - "point-136", - "point-128", - "point-72" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-35", - "color": { - "h": 253.44827586206898, - "s": 100, - "l": 11.372549019607844, - "a": 1 - }, - "points": [ - "point-140", - "point-136", - "point-72" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-36", - "color": { - "h": 261.6, - "s": 100, - "l": 14.705882352941178, - "a": 1 - }, - "points": [ - "point-140", - "point-56", - "point-72" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-37", - "color": { - "h": 262.8571428571429, - "s": 100, - "l": 16.470588235294116, - "a": 1 - }, - "points": [ - "point-64", - "point-56", - "point-140" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-38", - "color": { - "h": 259.4366197183098, - "s": 100, - "l": 13.92156862745098, - "a": 1 - }, - "points": [ - "point-152", - "point-140", - "point-64" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-39", - "color": { - "h": 259.4366197183098, - "s": 100, - "l": 13.92156862745098, - "a": 1 - }, - "points": [ - "point-68", - "point-64", - "point-152" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-40", - "color": { - "h": 253.44827586206898, - "s": 100, - "l": 11.372549019607844, - "a": 1 - }, - "points": [ - "point-160", - "point-140", - "point-152" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-41", - "color": { - "h": 245.58139534883722, - "s": 100, - "l": 8.431372549019608, - "a": 1 - }, - "points": [ - "point-136", - "point-160", - "point-140" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-42", - "color": { - "h": 246.15384615384613, - "s": 100, - "l": 7.647058823529412, - "a": 1 - }, - "points": [ - "point-168", - "point-128", - "point-136" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-43", - "color": { - "h": 245.58139534883722, - "s": 100, - "l": 8.431372549019608, - "a": 1 - }, - "points": [ - "point-160", - "point-168", - "point-136" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-44", - "color": { - "h": 246.15384615384613, - "s": 100, - "l": 7.647058823529412, - "a": 1 - }, - "points": [ - "point-176", - "point-160", - "point-168" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-45", - "color": { - "h": 246.15384615384613, - "s": 100, - "l": 7.647058823529412, - "a": 1 - }, - "points": [ - "point-180", - "point-168", - "point-176" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-46", - "color": { - "h": 240, - "s": 100, - "l": 4.509803921568627, - "a": 1 - }, - "points": [ - "point-184", - "point-168", - "point-180" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-47", - "color": { - "h": 240, - "s": 100, - "l": 4.509803921568627, - "a": 1 - }, - "points": [ - "point-188", - "point-168", - "point-184" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-48", - "color": { - "h": 240, - "s": 100, - "l": 4.509803921568627, - "a": 1 - }, - "points": [ - "point-192", - "point-188", - "point-184" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-49", - "color": { - "h": 240, - "s": 100, - "l": 4.509803921568627, - "a": 1 - }, - "points": [ - "point-196", - "point-188", - "point-192" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-50", - "color": { - "h": 240, - "s": 100, - "l": 0.5882352941176471, - "a": 1 - }, - "points": [ - "point-200", - "point-196", - "point-188" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-51", - "color": { - "h": 240, - "s": 100, - "l": 3.3333333333333335, - "a": 1 - }, - "points": [ - "point-188", - "point-124", - "point-200" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-52", - "color": { - "h": 240, - "s": 100, - "l": 5.294117647058823, - "a": 1 - }, - "points": [ - "point-188", - "point-124", - "point-128" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-53", - "color": { - "h": 245.1428571428571, - "s": 100, - "l": 6.862745098039216, - "a": 1 - }, - "points": [ - "point-188", - "point-128", - "point-168" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-54", - "color": { - "h": 240, - "s": 100, - "l": 3.3333333333333335, - "a": 1 - }, - "points": [ - "point-216", - "point-200", - "point-124" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-55", - "color": { - "h": 240, - "s": 100, - "l": 5.294117647058823, - "a": 1 - }, - "points": [ - "point-216", - "point-116", - "point-124" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-56", - "color": { - "h": 245.1428571428571, - "s": 100, - "l": 6.862745098039216, - "a": 1 - }, - "points": [ - "point-112", - "point-216", - "point-116" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-57", - "color": { - "h": 240, - "s": 100, - "l": 5.294117647058823, - "a": 1 - }, - "points": [ - "point-228", - "point-216", - "point-112" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-58", - "color": { - "h": 249.13043478260872, - "s": 100, - "l": 9.019607843137255, - "a": 1 - }, - "points": [ - "point-232", - "point-112", - "point-96" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-59", - "color": { - "h": 253.44827586206898, - "s": 100, - "l": 11.372549019607844, - "a": 1 - }, - "points": [ - "point-108", - "point-96", - "point-232" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-60", - "color": { - "h": 240, - "s": 100, - "l": 5.294117647058823, - "a": 1 - }, - "points": [ - "point-228", - "point-112", - "point-232" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-61", - "color": { - "h": 240, - "s": 100, - "l": 0.5882352941176471, - "a": 1 - }, - "points": [ - "point-244", - "point-216", - "point-200" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - }, - { - "id": "poly-62", - "color": { - "h": 240, - "s": 100, - "l": 0.5882352941176471, - "a": 1 - }, - "points": [ - "point-196", - "point-200", - "point-244" - ], - "stroke": { - "h": 262.24719101123594, - "s": 60.544217687074834, - "l": 28.82352941176471, - "a": 0.4 - } - } - ] -}; diff --git a/website/source/assets/javascripts/app/_Puller.js b/website/source/assets/javascripts/app/_Puller.js deleted file mode 100644 index 2df85c733..000000000 --- a/website/source/assets/javascripts/app/_Puller.js +++ /dev/null @@ -1,136 +0,0 @@ -(function( - Engine, - Vector -){ - -var Puller = function(x, y){ - this.pos.x = x; - this.pos.y = y; - this.pos = Vector.coerce(this.pos); - this.home = this.pos.clone(); - this.accel = Vector.coerce(this.accel); - this.vel = Vector.coerce(this.vel); -}; - -Puller.prototype = { - - fillStyle: '#ffffff', - radius: 5, - - maxSpeed: 160, - maxForce: 50, - - pos: { - x: 0, - y: 0 - }, - - accel: { - x: 0, - y: 0 - }, - - vel: { - x: 0, - y: 0 - }, - - aRad: 200, - - safety: 0.25, - - update: function(engine){ - var distanceToMouse = this.distanceTo(engine.mouse), - toHome, mag, safety; - // distanceToHome = this.distanceTo(this.home); - - this.accel.mult(0); - - if (distanceToMouse < this.aRad) { - this.toChase(engine.mouse); - } - - this.toChase(this.home, this.maxForce / 2); - - this.vel.add(this.accel); - this.pos.add( - Vector.mult(this.vel, engine.tick) - ); - - toHome = Vector.sub(this.home, this.pos); - mag = toHome.mag(); - safety = this.aRad * (this.safety * 3); - if (mag > this.aRad - safety) { - toHome.normalize(); - toHome.mult(this.aRad - safety); - this.pos = Vector.sub(this.home, toHome); - } - }, - - toChase: function(target, maxForce){ - var desired, steer, distance, mult, safety; - - maxForce = maxForce || this.maxForce; - - target = Vector.coerce(target); - desired = Vector.sub(target, this.pos); - distance = desired.mag(); - desired.normalize(); - - safety = this.aRad * this.safety; - - if (distance < safety) { - mult = Engine.map(distance, 0, safety, 0, this.maxSpeed); - } else if (distance > this.aRad - safety){ - mult = Engine.map(this.aRad - distance, 0, safety, 0, this.maxSpeed); - } else { - mult = this.maxSpeed; - } - - desired.mult(mult); - - steer = Vector.sub(desired, this.vel); - steer.limit(maxForce); - this.accel.add(steer); - }, - - draw: function(ctx, scale){ - // ctx.beginPath(); - // ctx.arc( - // this.home.x * scale, - // this.home.y * scale, - // this.aRad * scale, - // 0, - // Math.PI * 2, - // false - // ); - // ctx.fillStyle = 'rgba(255,255,255,0.1)'; - // ctx.fill(); - - ctx.beginPath(); - ctx.arc( - this.pos.x * scale, - this.pos.y * scale, - this.radius * scale, - 0, - Math.PI * 2, - false - ); - ctx.fillStyle = this.fillStyle; - ctx.fill(); - - }, - - distanceTo: function(target) { - var xd = this.home.x - target.x; - var yd = this.home.y - target.y; - return Math.sqrt(xd * xd + yd * yd ); - } -}; - -window.Puller = Puller; - -})( - window.Engine, - window.Vector -); diff --git a/website/source/assets/javascripts/app/_Sidebar.js b/website/source/assets/javascripts/app/_Sidebar.js deleted file mode 100644 index b36e508c4..000000000 --- a/website/source/assets/javascripts/app/_Sidebar.js +++ /dev/null @@ -1,50 +0,0 @@ -(function(){ - - Sidebar = Base.extend({ - - $body: null, - $overlay: null, - $sidebar: null, - $sidebarHeader: null, - $sidebarImg: null, - $toggleButton: null, - - constructor: function(){ - this.$body = $('body'); - this.$overlay = $('.sidebar-overlay'); - this.$sidebar = $('#sidebar'); - this.$sidebarHeader = $('#sidebar .sidebar-header'); - this.$toggleButton = $('.navbar-toggle'); - this.sidebarImg = this.$sidebarHeader.css('background-image'); - - this.addEventListeners(); - }, - - addEventListeners: function(){ - var _this = this; - - _this.$toggleButton.on('click', function() { - _this.$sidebar.toggleClass('open'); - if ((_this.$sidebar.hasClass('sidebar-fixed-left') || _this.$sidebar.hasClass('sidebar-fixed-right')) && _this.$sidebar.hasClass('open')) { - _this.$overlay.addClass('active'); - _this.$body.css('overflow', 'hidden'); - } else { - _this.$overlay.removeClass('active'); - _this.$body.css('overflow', 'auto'); - } - - return false; - }); - - _this.$overlay.on('click', function() { - $(this).removeClass('active'); - _this.$body.css('overflow', 'auto'); - _this.$sidebar.removeClass('open'); - }); - } - - }); - - window.Sidebar = Sidebar; - -})(); diff --git a/website/source/assets/javascripts/application.js b/website/source/assets/javascripts/application.js index bc70be7fb..ad181b4cc 100644 --- a/website/source/assets/javascripts/application.js +++ b/website/source/assets/javascripts/application.js @@ -1,29 +1,5 @@ //= require turbolinks //= require jquery -//= require bootstrap -//= require lib/_String.substitute -//= require lib/_Vector -//= require lib/_Function.prototype.bind -//= require lib/_Base -//= require lib/_Chainable -//= require lib/_dbg - -//= require app/_Docs -//= require app/_Logo -//= require app/_Grid -//= require app/_Engine -//= require app/_Engine.Particle -//= require app/_Engine.Particle.Fixed -//= require app/_Engine.Point -//= require app/_Engine.Point.Puller -//= require app/_Engine.Polygon -//= require app/_Engine.Polygon.Puller -//= require app/_Engine.Shape -//= require app/_Engine.Shape.Puller -//= require app/_Engine.Typewriter -//= require app/_Sidebar -//= require app/_Init - -// assets/javascripts/application.js //= require hashicorp/mega-nav +//= require hashicorp/sidebar diff --git a/website/source/assets/javascripts/lib/_Base.js b/website/source/assets/javascripts/lib/_Base.js deleted file mode 100644 index 504e2beea..000000000 --- a/website/source/assets/javascripts/lib/_Base.js +++ /dev/null @@ -1,145 +0,0 @@ -/* - Based on Base.js 1.1a (c) 2006-2010, Dean Edwards - Updated to pass JSHint and converted into a module by Kenneth Powers - License: http://www.opensource.org/licenses/mit-license.php -*/ -/*global define:true module:true*/ -/*jshint eqeqeq:true*/ -(function (name, global, definition) { - if (typeof module !== 'undefined') { - module.exports = definition(); - } else if (typeof define !== 'undefined' && typeof define.amd === 'object') { - define(definition); - } else { - global[name] = definition(); - } -})('Base', this, function () { - // Base Object - var Base = function () {}; - - // Implementation - Base.extend = function (_instance, _static) { // subclass - var extend = Base.prototype.extend; - // build the prototype - Base._prototyping = true; - var proto = new this(); - extend.call(proto, _instance); - proto.base = function () { - // call this method from any other method to invoke that method's ancestor - }; - delete Base._prototyping; - // create the wrapper for the constructor function - //var constructor = proto.constructor.valueOf(); //-dean - var constructor = proto.constructor; - var klass = proto.constructor = function () { - if (!Base._prototyping) { - if (this._constructing || this.constructor === klass) { // instantiation - this._constructing = true; - constructor.apply(this, arguments); - delete this._constructing; - } else if (arguments[0] !== null) { // casting - return (arguments[0].extend || extend).call(arguments[0], proto); - } - } - }; - // build the class interface - klass.ancestor = this; - klass.extend = this.extend; - klass.forEach = this.forEach; - klass.implement = this.implement; - klass.prototype = proto; - klass.toString = this.toString; - klass.valueOf = function (type) { - return (type === 'object') ? klass : constructor.valueOf(); - }; - extend.call(klass, _static); - // class initialization - if (typeof klass.init === 'function') klass.init(); - return klass; - }; - - Base.prototype = { - extend: function (source, value) { - if (arguments.length > 1) { // extending with a name/value pair - var ancestor = this[source]; - if (ancestor && (typeof value === 'function') && // overriding a method? - // the valueOf() comparison is to avoid circular references - (!ancestor.valueOf || ancestor.valueOf() !== value.valueOf()) && /\bbase\b/.test(value)) { - // get the underlying method - var method = value.valueOf(); - // override - value = function () { - var previous = this.base || Base.prototype.base; - this.base = ancestor; - var returnValue = method.apply(this, arguments); - this.base = previous; - return returnValue; - }; - // point to the underlying method - value.valueOf = function (type) { - return (type === 'object') ? value : method; - }; - value.toString = Base.toString; - } - this[source] = value; - } else if (source) { // extending with an object literal - var extend = Base.prototype.extend; - // if this object has a customized extend method then use it - if (!Base._prototyping && typeof this !== 'function') { - extend = this.extend || extend; - } - var proto = { - toSource: null - }; - // do the "toString" and other methods manually - var hidden = ['constructor', 'toString', 'valueOf']; - // if we are prototyping then include the constructor - for (var i = Base._prototyping ? 0 : 1; i < hidden.length; i++) { - var h = hidden[i]; - if (source[h] !== proto[h]) - extend.call(this, h, source[h]); - } - // copy each of the source object's properties to this object - for (var key in source) { - if (!proto[key]) extend.call(this, key, source[key]); - } - } - return this; - } - }; - - // initialize - Base = Base.extend({ - constructor: function () { - this.extend(arguments[0]); - } - }, { - ancestor: Object, - version: '1.1', - forEach: function (object, block, context) { - for (var key in object) { - if (this.prototype[key] === undefined) { - block.call(context, object[key], key, object); - } - } - }, - implement: function () { - for (var i = 0; i < arguments.length; i++) { - if (typeof arguments[i] === 'function') { - // if it's a function, call it - arguments[i](this.prototype); - } else { - // add the interface using the extend method - this.prototype.extend(arguments[i]); - } - } - return this; - }, - toString: function () { - return String(this.valueOf()); - } - }); - - // Return Base implementation - return Base; -}); diff --git a/website/source/assets/javascripts/lib/_Chainable.js b/website/source/assets/javascripts/lib/_Chainable.js deleted file mode 100644 index dbe51dd1d..000000000 --- a/website/source/assets/javascripts/lib/_Chainable.js +++ /dev/null @@ -1,92 +0,0 @@ -(function(){ - -var Chainable = function(engine){ - this.engine = engine; - this._chain = []; - this._updateTimer = this._updateTimer.bind(this); - this._cycle = this._cycle.bind(this); -}; - -Chainable.prototype._running = false; - -Chainable.prototype._updateTimer = function(tick){ - this._timer += tick; - if (this._timer >= this._timerMax) { - this.resetTimer(); - this._cycle(); - } -}; - -Chainable.prototype.resetTimer = function(){ - this.engine.updateChainTimer = undefined; - this._timer = 0; - this._timerMax = 0; - return this; -}; - -Chainable.prototype.start = function(){ - if (this._running || !this._chain.length) { - return this; - } - this._running = true; - return this._cycle(); -}; - -Chainable.prototype.reset = function(){ - if (!this._running) { - return this; - } - this.resetTimer(); - this._timer = 0; - this._running = false; - return this; -}; - -Chainable.prototype._cycle = function(){ - var current; - if (!this._chain.length) { - return this.reset(); - } - - current = this._chain.shift(); - - if (current.type === 'function') { - current.func.apply(current.scope, current.args); - current = null; - return this._cycle(); - } - if (current.type === 'wait') { - this.resetTimer(); - // Convert timer to seconds - this._timerMax = current.time / 1000; - this.engine.updateChainTimer = this._updateTimer; - current = null; - } - - return this; -}; - -Chainable.prototype.then = Chainable.prototype.exec = function(func, scope, args){ - this._chain.push({ - type : 'function', - - func : func, - scope : scope || window, - args : args || [] - }); - - return this.start(); -}; - -Chainable.prototype.wait = function(time){ - this._chain.push({ - type : 'wait', - time : time - }); - - return this.start(); -}; - -window.Chainable = Chainable; - -})(); diff --git a/website/source/assets/javascripts/lib/_Function.prototype.bind.js b/website/source/assets/javascripts/lib/_Function.prototype.bind.js deleted file mode 100644 index 82c3cb6c6..000000000 --- a/website/source/assets/javascripts/lib/_Function.prototype.bind.js +++ /dev/null @@ -1,21 +0,0 @@ -if (!Function.prototype.bind) { - Function.prototype.bind = function (oThis) { - if (typeof this !== "function") { - throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); - } - - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, - fNOP = function () {}, - fBound = function () { - return fToBind.apply(this instanceof fNOP && oThis ? - this : oThis, - aArgs.concat(Array.prototype.slice.call(arguments))); - }; - - fNOP.prototype = this.prototype; - fBound.prototype = new fNOP(); - - return fBound; - }; -} diff --git a/website/source/assets/javascripts/lib/_String.substitute.js b/website/source/assets/javascripts/lib/_String.substitute.js deleted file mode 100644 index da2b52a38..000000000 --- a/website/source/assets/javascripts/lib/_String.substitute.js +++ /dev/null @@ -1,14 +0,0 @@ -(function(String){ - -if (String.prototype.substitute) { - return; -} - -String.prototype.substitute = function(object, regexp){ - return String(this).replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){ - if (match.charAt(0) == '\\') return match.slice(1); - return (object[name] !== null) ? object[name] : ''; - }); -}; - -})(String); diff --git a/website/source/assets/javascripts/lib/_Vector.js b/website/source/assets/javascripts/lib/_Vector.js deleted file mode 100644 index 0334c7ac7..000000000 --- a/website/source/assets/javascripts/lib/_Vector.js +++ /dev/null @@ -1,111 +0,0 @@ -(function(global){ 'use strict'; - -var Vector = function(x, y){ - this.x = x || 0; - this.y = y || 0; -}; - -Vector.prototype = { - - clone: function(){ - return new Vector(this.x, this.y); - }, - - add: function(vec){ - this.x += vec.x; - this.y += vec.y; - return this; - }, - - sub: function(vec){ - this.x -= vec.x; - this.y -= vec.y; - return this; - }, - - subVal: function(val){ - this.x -= val; - this.y -= val; - return this; - }, - - mult: function(mul){ - this.x *= mul; - this.y *= mul; - return this; - }, - - div: function(div){ - if (div === 0) { - return this; - } - this.x /= div; - this.y /= div; - return this; - }, - - mag: function(){ - return Math.sqrt( - this.x * this.x + - this.y * this.y - ); - }, - - limit: function(max){ - if (this.mag() > max) { - this.normalize(); - this.mult(max); - } - return this; - }, - - normalize: function(){ - var mag = this.mag(); - if (mag === 0) { - return this; - } - this.div(mag); - return this; - }, - - heading: function(){ - return Math.atan2(this.y, this.x); - }, - - set: function(vec){ - this.x = vec.x; - this.y = vec.y; - return this; - } - -}; - -Vector.add = function(vec1, vec2){ - return vec1.clone().add(vec2.clone()); -}; - -Vector.sub = function(vec1, vec2){ - return vec1.clone().sub(vec2.clone()); -}; - -Vector.mult = function(vec, mult){ - return vec.clone().mult(mult); -}; - -Vector.div = function(vec, div){ - return vec.clone().div(div); -}; - -// Ripped from processing -Vector.random2D = function(){ - var angle = Math.random(0, 1) * Math.PI * 2; - return new Vector(Math.cos(angle), Math.sin(angle)); -}; - -Vector.coerce = function(obj){ - return new Vector(obj.x, obj.y); -}; - -global.Vector = Vector; - -})(this); diff --git a/website/source/assets/javascripts/lib/_dbg.js b/website/source/assets/javascripts/lib/_dbg.js deleted file mode 100644 index 6df4f3762..000000000 --- a/website/source/assets/javascripts/lib/_dbg.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * name: dbg - * - * description: A bad ass little console utility, check the README for deets - * - * license: MIT-style license - * - * author: Amadeus Demarzi - * - * provides: window.dbg - * - */ - -(function(){ - - var global = this, - - // Get the real console or set to null for easy boolean checks - realConsole = global.console || null, - - // Backup / Disabled Lambda - fn = function(){}, - - // Supported console methods - methodNames = ['log', 'error', 'warn', 'info', 'count', 'debug', 'profileEnd', 'trace', 'dir', 'dirxml', 'assert', 'time', 'profile', 'timeEnd', 'group', 'groupEnd'], - - // Disabled Console - disabledConsole = { - - // Enables dbg, if it exists, otherwise it just provides disabled - enable: function(quiet){ - global.dbg = realConsole ? realConsole : disabledConsole; - }, - - // Disable dbg - disable: function(){ - global.dbg = disabledConsole; - } - - }, name, i; - - // Setup disabled console and provide fallbacks on the real console - for (i = 0; i < methodNames.length;i++){ - name = methodNames[i]; - disabledConsole[name] = fn; - if (realConsole && !realConsole[name]) - realConsole[name] = fn; - } - - // Add enable/disable methods - if (realConsole) { - realConsole.disable = disabledConsole.disable; - realConsole.enable = disabledConsole.enable; - } - - // Enable dbg - disabledConsole.enable(); - -}).call(this); diff --git a/website/source/assets/stylesheets/_buttons.scss b/website/source/assets/stylesheets/_buttons.scss index c1f44435d..e1037e818 100755 --- a/website/source/assets/stylesheets/_buttons.scss +++ b/website/source/assets/stylesheets/_buttons.scss @@ -1,137 +1,37 @@ -// -// Button Styles -// -------------------------------------------------- - -.outline-btn{ - position: relative; - display: inline-block; - // Extra 3px of bottom padding compensates for ::after content - padding: 20px 30px 23px; - background-color: transparent; - color: $white; - border: 2px solid $white; - //border-radius: $btn-border-radius; - font-size: 20px; - font-weight: 500; - text-transform: uppercase; - letter-spacing: 2px; - text-decoration: none !important; - @include transition(background-color .3s ease-in-out); - - &::after { - font-size: 1.2em; - content: "»"; - position: relative; - left: 5px; - } - - &.purple{ - color: $purple; - border: 2px solid $purple; - } - - &.small-outline-btn{ - font-size: 16px; - padding: 0px 15px 3px 10px; - letter-spacing: 0; - border: 2px solid rgba(255, 255, 255, .7); - } - - &:hover{ - color: $white; - background-color: rgba(255, 255, 255, .2); - @include transition(background-color .3s ease-in-out); - - &.purple{ - background-color: rgba(255, 255, 255, .5); - } - } -} - -.simple-btn{ - position: relative; - display: inline-block; - // Extra 3px of bottom padding compensates for ::after content - background-color: transparent; - color: $white; - font-size: 16px; - font-weight: 500; - text-transform: uppercase; - text-decoration: none !important; - @include transition(color .3s ease-in-out); - - &::after { - font-size: 1.2em; - content: "»"; - position: relative; - left: 5px; - } - - &:hover{ - color: rgba(255, 255, 255, .4); - @include transition(color .3s ease-in-out); - } -} - -.terra-btn{ - position: relative; - display: inline-block; - // Extra 3px of bottom padding compensates for ::after content - padding: 20px 30px 23px; - color: white; - background-color: $purple; - font-size: 20px; - font-weight: 500; - text-transform: uppercase; - letter-spacing: 2px; - @include transition( background-color 0.3s ease ); - - &::after { - font-size: 1.2em; - content: "»"; - position: relative; - left: 5px; - } - - &:hover{ - color: white; - background-color: rgba(130, 47, 247, 0.8); - text-decoration: none; - @include transition( background-color 0.3s ease ); - } -} - -@media (max-width: 768px) { - .outline-btn, .terra-btn{ - font-size: 16px; - text-align: center; - } -} - -//animation on header main nav link hover -/*.li-under a::after { - position: absolute; - top: 68%; - left: 50%; - margin-left: -4px; - width: 6px; - height: 6px; - background-color: white; - content: ''; - opacity: 0; +.button { + background: $button-background; + border: 1px solid $button-font-color; + box-shadow: 3px 4px 0 rgba(0,0,0,0.1); + color: $button-font-color; + display: inline-block; + font-family: $button-font-family; + font-size: $button-font-size; + font-weight: $button-font-weight; + letter-spacing: 1px; + margin-bottom: 4px; + padding: 10px 30px; + text-transform: uppercase; text-decoration: none; - -webkit-transition: height 0.3s, opacity 0.3s, -webkit-transform 0.3s; - -moz-transition: height 0.3s, opacity 0.3s, -moz-transform 0.3s; - transition: height 0.3s, opacity 0.3s, transform 0.3s; - -webkit-transform: translateY(-10px); - -moz-transform: translateY(-10px); - transform: translateY(-10px); -} -.li-under a:hover::after, -.li-under a:focus::after { - opacity: 1; - -webkit-transform: skewY(15deg) translateY(10px); - -moz-transform: skewY(15deg) translateY(10px); - transform: skewY(15deg) translateY(10px); -}*/ + &:hover, + &:active, + &:focus { + text-decoration: none; + } + + &:hover { + background: $button-font-color; + border: 1px solid $button-font-color; + color: $button-background; + } + + &.primary { + background: $button-primary-background; + border: 1px solid darken($button-primary-background, 5%); + color: $button-primary-font-color; + + &:hover { + background: lighten($button-primary-background, 5%); + } + } +} diff --git a/website/source/assets/stylesheets/_community.scss b/website/source/assets/stylesheets/_community.scss index ff8c3412e..1ff047de6 100644 --- a/website/source/assets/stylesheets/_community.scss +++ b/website/source/assets/stylesheets/_community.scss @@ -1,21 +1,22 @@ -.people { +#inner { + .people { margin-top: 30px; .person { - margin-bottom: 40px; - min-height: 165px; // enough space for five lines of bio text + &:after { + display: block; + clear: both; + content: ' '; + } - h3 { - text-transform: none; - } + img { + width: 125px; + margin: auto auto; + } - img { - width: 125px; - margin: auto auto; - } - - .bio { - padding-left: 150px; - } + .bio { + padding-left: 150px; + } } + } } diff --git a/website/source/assets/stylesheets/_docs.scss b/website/source/assets/stylesheets/_docs.scss index 16c6ae042..475aa46d8 100755 --- a/website/source/assets/stylesheets/_docs.scss +++ b/website/source/assets/stylesheets/_docs.scss @@ -1,363 +1,91 @@ -// -// Docs -// -------------------------------------------------- - -body.page-sub{ - background-color: $light-black; -} - -body.layout-backend-types, -body.layout-commands-env, -body.layout-commands-state, -body.layout-alicloud, -body.layout-archive, -body.layout-arukas, -body.layout-atlas, -body.layout-aws, -body.layout-azure, -body.layout-bitbucket, -body.layout-chef, -body.layout-azurerm, -body.layout-circonus, -body.layout-clc, -body.layout-cloudflare, -body.layout-cloudstack, -body.layout-cobbler, -body.layout-consul, -body.layout-datadog, -body.layout-digitalocean, -body.layout-dme, -body.layout-dns, -body.layout-dnsimple, -body.layout-docker, -body.layout-dyn, -body.layout-external, -body.layout-github, -body.layout-grafana, -body.layout-fastly, -body.layout-google, -body.layout-heroku, -body.layout-ignition, -body.layout-icinga2, -body.layout-influxdb, -body.layout-kubernetes, -body.layout-librato, -body.layout-logentries, -body.layout-mailgun, -body.layout-mysql, -body.layout-newrelic, -body.layout-nomad, -body.layout-ns1, -body.layout-openstack, -body.layout-opsgenie, -body.layout-opc, -body.layout-packet, -body.layout-pagerduty, -body.layout-postgresql, -body.layout-powerdns, -body.layout-profitbricks, -body.layout-rabbitmq, -body.layout-rancher, -body.layout-random, -body.layout-rundeck, -body.layout-scaleway, -body.layout-spotinst, -body.layout-statuscake, -body.layout-softlayer, -body.layout-template, -body.layout-tls, -body.layout-ultradns, -body.layout-triton, -body.layout-vault, -body.layout-vcd, -body.layout-vsphere, -body.layout-docs, -body.layout-downloads, -body.layout-inner, -body.layout-remotestate, -body.layout-terraform, -body.layout-intro{ - background: $light-black image-url('sidebar-wire.png') left 62px no-repeat; - - >.container{ - .col-md-8[role=main]{ - min-height: 800px; - background-color: white; - - >div{ - position: relative; - z-index: 10; - } - } - } -} - -.docs-sidebar{ - position: relative; - z-index: 20; +#docs-sidebar { margin-bottom: 30px; - margin-top: 50px; - margin-right: 4%; + margin-top: 50px; + overflow: hidden; - a{ - color: $purple; - } - - .docs-sidenav{ - padding-top: 15px; - padding-bottom: 15px; - font-family: $font-family-klavika; - font-size: 16px; - - :last-child{ - border-bottom: none; - } - - //all li > a - li{ - position: relative; - - > a{ - color: white; - @include transition( color 0.5s ease ); - } - - > a:hover, - > a:focus { - background-color: transparent !important; - color: white; - @include transition( color 0.5s ease ); - } - } - - - > li { - padding: 10px 0; - - >.nav{ - li{ - a{ - font-family: $font-family-open-sans; - color: white; - } - } - } - - &.active { - >a{ - color: lighten($purple, 4%); - font-weight: 600; - } - - &:before{ - content: ''; - position: absolute; - width: 6px; - height: 8px; - background-color: $purple; - font-weight: 500; - @include skewY(24deg); - top: 26px; - left: -10px; - } - > a{ - -webkit-font-smoothing: antialiased; - } - - .nav { - display: block; - - li.active a { - color: lighten($purple, 4%); - font-weight: 500; - } - } - } - - > a { - text-transform: uppercase; - letter-spacing: 1px; - -webkit-font-smoothing: antialiased; - } - } - - .nav { - display: none; - margin-bottom: 15px; - - > li{ - margin-left: 20px; - - > a{ - -webkit-font-smoothing: antialiased; - padding: 6px 15px; - } - } - } - - .nav-visible { - display: block; - } - } -} - -.bs-docs-section{ - @media(max-width: 767px){ - padding: 10px 5px 80px 5px; - } - @media(min-width: 768px){ - padding: 10px 20px 80px 20px; - } - - .lead{ - margin-bottom: 48px - } - - .doc-sectional{ - margin-bottom: 48px; - } - - p, li, .alert { - font-size: 18px; - line-height: 1.5; - margin: 0 0 18px; - -webkit-font-smoothing: antialiased; - } - - pre{ - margin: 0 0 18px; - } - - a{ - color: $purple; - &:hover{ - text-decoration: underline; - } - } - - img{ - max-width: 650px; - margin-top: 25px; - margin-bottom: 25px; - } - - h1{ - margin-top: 72px; - color: $purple; - font-weight: 400; - text-transform: uppercase; - letter-spacing: -1px; - word-wrap: break-word; - } - - h2, h3, h4{ - margin-top: 48px; - font-family: $font-family-open-sans; - text-transform: none; - } - - h2 { - margin-bottom: 16px; - padding-bottom: 10px; - border-bottom: 1px solid #eeeeee; - } - - p { - color: $light-black; - } - - #graph { + h1, + h2, + h3, + h4, + h5, + h6 { margin-top: 30px; } -} -@media (max-width: 992px) { - body.layout-docs, - body.layout-inner, - body.layout-intro{ - >.container{ - .col-md-8[role=main]{ - min-height: 0; - &::before { - border-left: 9999px solid white; - } - } - } - } + ul.nav.docs-sidenav { + display: block; + padding-bottom: 15px; - body.page-sub{ - >.container{ - background-color: white; - } - } + li { + a { + color: $sidebar-link-color; + font-size: $sidebar-font-size; + padding: 10px 0 10px 15px; - .docs-sidebar{ - margin-top: 0px; - margin-bottom: 0px; + &:before { + color: $sidebar-link-color-active; + content: '\203A'; + font-size: $font-size; + left: 0; + line-height: 100%; + opacity: 0.4; + position: absolute; - .docs-sidenav{ - padding-bottom: 0; - - //all li > a - li{ - > a{ - color: black; - @include transition( color 0.5s ease ); + height: 100%; + width: 8px } - > a:hover, - > a:focus { - color: $purple; - @include transition( color 0.5s ease ); + &:focus, + &:hover { + background-color: transparent; + color: $sidebar-link-color-hover; + + &:before { + opacity: 1; + } } - } - - > li { - >.nav{ - li{ - a{ - color: black; - - &:hover{ - color: $purple; - } - } + &.back { + &:before { + content: '\2039'; } } } - } - } - .bs-docs-section{ - h1{ - font-size: 32px; - padding-top: 24px; - border-top: 1px solid #eeeeee; + // For forcing sub-navs to appear - in the long term, this should not + // be a thing anymore... + > ul.nav-visible { + display: block; + } } - h2 { - font-size: 24px; - } + li.active { + > a { + color: $sidebar-link-color-active; - h2, h3, h4{ - margin-top: 32px; - } - - p, li, .alert { - font-size: 16px; - } - } -} - -@media (max-width: 480px) { - .bs-docs-section{ - img{ - max-width: 450px; + &:before { + opacity: 1; } + } - h1{ - font-size: 28px; - } - } + // Open nested navigations + > ul.nav { + display: block; + } + } + + // subnav + ul.nav { + display: none; + margin: 10px; + + li { + margin-left: 10px; + + a { + padding: 6px 15px; + } + } + } + } } diff --git a/website/source/assets/stylesheets/_downloads.scss b/website/source/assets/stylesheets/_downloads.scss index be2187eaf..97a4dfc66 100644 --- a/website/source/assets/stylesheets/_downloads.scss +++ b/website/source/assets/stylesheets/_downloads.scss @@ -1,59 +1,60 @@ -.downloads { - margin-top: 20px; +body.layout-downloads { + #inner { + .downloads { + margin-top: 20px; - .description { + .description { margin-bottom: 20px; - } + } - .download { + .download { + align-items: center; border-bottom: 1px solid #b2b2b2; - padding-bottom: 15px; - margin-top: 10px; - margin-bottom: 10px; + display: flex; + padding: 15px; .details { - padding-left: 95px; + padding-left: 20px; - h2 { - margin-top: 30px; + h2 { + margin-top: 4px; + border: none; + } + + ul { + padding-left: 0px; + margin: -8px 0 0 0; + } + + li { + display: inline-block; + + &:after { + content: " | "; } - ul { - padding-left: 0px; - } - - li { - display: inline-block; - - &:after { - content: " | "; - } - - &:last-child:after { - content: ""; - } + &:last-child:after { + content: ""; } + } } .icon { - img { - width: 75px; - } + svg { + width: 75px; + } } .os-name { - font-size: 40px; - margin-bottom: -3px; + font-size: 40px; + margin-bottom: -3px; } - } + } - .poweredby { + .poweredby { margin-top: 20px; - - img { - display: block; - margin: 0 auto; - width: 122px; - } + text-align: center; + } } + } } diff --git a/website/source/assets/stylesheets/_footer.scss b/website/source/assets/stylesheets/_footer.scss index 2bf21204f..ae34a057a 100644 --- a/website/source/assets/stylesheets/_footer.scss +++ b/website/source/assets/stylesheets/_footer.scss @@ -1,98 +1,22 @@ -body.page-sub{ - #footer{ - padding: 40px 0; - margin-top: 0; +#footer { + padding-top: 50px; - .hashicorp-project{ - margin-top: 24px; - &:hover{ - svg{ - .svg-bg-line{ - opacity: .4; - } + ul.footer-links { + li { + a { + color: $footer-link-color; + font-size: $footer-font-size; + font-family: $font-family-open-sans; + text-decoration: none; + + &:hover, &:focus, &:active { + background-color: transparent; + color: $footer-link-color-hover; + outline: 0; } - } - } - } -} -#footer{ - background-color: white; - padding: 150px 0 80px; - margin-top: -40px; - - &.white{ - background-color: $black; - .footer-links{ - li > a { - @include project-footer-a-subpage-style(); - } - } - } - - .footer-links{ - li > a { - @include project-footer-a-style(); - } - } - - .hashicorp-project{ - margin-top: 24px; - } - - .pull-right{ - padding-right: 15px; - } -} - -.edit-page-link{ - position: absolute; - top: -70px; - right: 30px; - z-index: 9999; - - a{ - text-transform: uppercase; - color: $black; - font-size: 13px; - } -} - -@media (max-width: 992px) { - .footer-links { - display: block; - text-align: center; - - ul{ - display: inline-block;; - float: none !important; - } - - .footer-hashi{ - display: block; - float: none !important; - } - } -} - -@media (max-width: 414px) { - #footer{ - ul{ - display: block; - li{ - display: block; - float: none; - } - - &.external-links{ - li{ - svg{ - position: relative; - left: 0; - top: 2px; - margin-top: 0; - margin-right: 4px; - } + @media (max-width: 992px) { + text-align: center; } } } diff --git a/website/source/assets/stylesheets/_global.scss b/website/source/assets/stylesheets/_global.scss index f30bbff6d..3b69c05dd 100755 --- a/website/source/assets/stylesheets/_global.scss +++ b/website/source/assets/stylesheets/_global.scss @@ -1,117 +1,35 @@ -// -// Global Site -// -------------------------------------------------- - -/*html{ +html { + height: 100%; + min-height: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -}*/ +} body { - // -webkit-font-smoothing: subpixel-antialiased; - color: $black; - font-size: 15px; - font-family: $font-family-open-sans; - font-weight: 500; + -webkit-font-smoothing: antialiased; + color: $body-font-color; + background-color: $white; + font-size: $font-size; + font-family: $font-family-open-sans; + font-weight: $font-weight-reg; + height: 100%; + min-height: 100%; } h1, h2, h3, h4, h5 { - -webkit-font-smoothing: antialiased; - font-family: $font-family-klavika; - font-weight: 600; -} -h1{ - font-size: 42px; - line-height: 40px; - margin-bottom: 24px; - text-transform: uppercase; + font-family: $font-family-klavika; + -webkit-font-smoothing: antialiased; } -h2{ - font-size: 34px; - text-transform: uppercase; +h1 { + margin-bottom: 24px; } -h3{ - font-size: 20px; - line-height: 20px; - text-transform: uppercase; -} - -h4 { - font-size: 18px; -} - -p { - margin-bottom: 30px; - font-size: 16px; - font-weight: regular; - line-height: 1.5; -} - -p.lead{ - font-size: 21px; - font-weight: 400 !important; -} - -//an alternative color for buttons in the doc body -.btn-serf{ - color: $white !important; - background-color: $btn-color; - border-radius: $btn-border-radius; - //@include box-shadow( $shadow ); -} - -.highlight{ - margin-bottom: 18px; -} - -pre { - background-color: $black; - color: $white; - font-size: 14px; - font-weight: normal; - font-family: "Courier New", Monaco, Menlo, Consolas, monospace; - border: none; - padding: 20px; - margin-bottom: 0; -} - -// Typekit utilites to hide FOUC +// Avoid FOUT .wf-loading { visibility: hidden; } + .wf-active, .wf-inactive { visibility: visible; } - - -//fixed grid below 992 to prevent smaller responsive sizes -@media (max-width: 992px) { - .container{ - max-width: 970px; - } -} - -//all below styles are overriding corrections for below (min-width: 992px) -//below (min-width: 992px) these styles change -.navbar-nav { - margin: 0; -} - -.navbar-right { - float: right !important; -} - -.navbar-nav > li { - float: left; -} - -.navbar-nav > li > a { - padding-top: 15px; - padding-bottom: 15px; -} - -.center { - text-align: center; -} diff --git a/website/source/assets/stylesheets/_header.scss b/website/source/assets/stylesheets/_header.scss index 310664235..dde70d7d6 100755 --- a/website/source/assets/stylesheets/_header.scss +++ b/website/source/assets/stylesheets/_header.scss @@ -1,57 +1,78 @@ -// -// Header -// - Project Specific -// - edits should be made here -// -------------------------------------------------- - -body.page-sub{ - #header{ - background-color: $purple; - } -} - #header { - .navbar-brand { - .logo{ - width: $project-logo-width; - height: $project-logo-height; - font-size: 0px; - font-family: $font-family-klavika; - background: image-url('logo-header.svg') 0 32% no-repeat; + background: $header-background-color; - &:hover{ - opacity: .6; + .navbar-toggle { + height: $header-height; + margin: 0; + padding-right: 15px; + border-radius: 0; + + .icon-bar { + border: 1px solid $white; + border-radius: 0; + } + } + + .navbar-brand { + display: block; + margin: 0; + padding: 0; + + a { + display: flex; + align-items: center; + height: $header-height; + line-height: $header-height; + + svg.logo { + transition: opacity 0.15s ease-in-out; + @extend svg.logo.white; + + &:hover, &:focus, &:active { + opacity: 0.6; + outline: 0; + text-decoration: none; + } } } + } - .by-hashicorp{ - margin-top: 2px; - &:hover{ - svg{ - .svg-bg-line{ - opacity: .4; + ul.nav { + li { + a { + color: $header-link-color; + font-size: $header-font-size; + font-family: $font-family-open-sans; + font-weight: $font-weight-bold; + height: $header-height; + line-height: $header-height; + padding: 0 10px; + margin: 0; + text-decoration: none; + + &:hover, &:focus, &:active { + background-color: transparent; + color: $header-link-color-hover; + outline: 0; + + svg { + fill: $header-link-color-hover; } } - } - } - } - .buttons{ - margin-top: 2px; //baseline everything - - ul.navbar-nav{ - li { - svg path{ - fill: $white; + svg { + fill: $header-link-color; + position: relative; + top: 2px; + width: 14px; + height: 14px; + margin-right: 3px; } } } } - .main-links, - .external-links { - li > a { - @include project-a-style(); - } + .buttons { + margin-top: 2px; } } diff --git a/website/source/assets/stylesheets/_home.scss b/website/source/assets/stylesheets/_home.scss old mode 100755 new mode 100644 index 807a8b542..95da9ec34 --- a/website/source/assets/stylesheets/_home.scss +++ b/website/source/assets/stylesheets/_home.scss @@ -1,823 +1,326 @@ -// -// Home -// -------------------------------------------------- - -body.page-home { - h2.tag-line { - font-size: 40px; - } - - #primary-cta{ - position: relative; - margin-top: -30px; - padding-bottom: 40px; - color: $white; - background: $black; - z-index: 99; - - .terra-btn{ - margin-top: 30px; - } - } - - .temp-skew { - position: relative; - height: 240px; - background-color: #000; - @include skewY(-3deg); - margin-top: -100px; - -webkit-backface-visibility: hidden; - border: 2px solid #000; - z-index: 0; - } - - .announcement { - margin-top: 60px; - border: 1px solid rgba(255,255,255,.3); - padding: 25px 10px; - - p { - color: $gray; - line-height: 1.2; - margin-bottom: 0; - - a { - color: $purple; - text-decoration: underline; - // inline-block ensures links doesn't text-wrap; - display: inline-block; - } - } - } - - #customer-logos{ - position: relative; - width: 100%; - margin-top: -100px; - padding: 60px 0; - color: $white; - - >.container { - z-index: 91; - } - - p { - text-transform: uppercase; - letter-spacing: 2px; - } - - #customer-logos-bg{ - z-index: 30; - background: $black; - background-size: 100%; - @include skewY(-3deg); - } - } - - ul.customer-list{ - padding-left: 15px; - - li{ - display: inline-block; - width: 16%; - height: 80px; - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - } - - #nike { - background: transparent image-url("customer-logos/nike.svg") left no-repeat; - background-size: 80px; - } - - #hbo { - background: transparent image-url("customer-logos/hbo.svg") left no-repeat; - background-size: 80px; - } - - #target { - background: transparent image-url("customer-logos/target.svg") left no-repeat; - background-size: 50px; - } - - #capital-one { - background: transparent image-url("customer-logos/capital-one.svg") left no-repeat; - background-size: 100px; - } - - #home-depot { - background: transparent image-url("customer-logos/home-depot.svg") left no-repeat; - background-size: 50px; - } - - #hotels-dot-com { - background: transparent image-url("customer-logos/hotels-dot-com.svg") left no-repeat; - background-size: 100px; - } - } - - #feature-overview{ - position: relative; - padding: 120px 0; - border-bottom: 2px solid #E6E7E8; - z-index: 80; - } - - .feature-card{ - display: block; - height: 200px; - border: 2px solid #E6E7E8; - margin-bottom: 15px; - padding:20px; - font-size: 18px; - - h3{ - margin:0; - padding: 0; - color: $purple; - font-size: 16px; - line-height: 1.2; - font-weight: 400; - text-transform: uppercase; - } - - p{ - color: #000; - font-size: 16px; - line-height: 1.2; - font-weight: 400; - text-transform: uppercase; - letter-spacing: 1px; - } - - &.feature-card-write{ - background: image-url("feature-card-write.svg") left 20px top 70% no-repeat; - background-size: 80%; - } - - &.feature-card-plan{ - background: image-url("feature-card-plan.svg") left 0 top 69% no-repeat; - background-size: 100%; - } - - &.feature-card-create{ - background: image-url("feature-card-create.svg") left 0 top 70% no-repeat; - background-size: 80%; - } - - &:hover { - border: 2px solid $purple; - text-decoration: none; - } - } - - .feature{ - - p.lead{ - max-width: 30em; - } - } - - .skew-item{ - >.container{ - position: relative; - top: 0; - z-index: 11; - } - - .feature-skew{ - position: absolute; - top: 0px; - bottom: 0px; - left: 0px; - width: 100%; - height: 100%; - } - } - - #feature-write{ - position: relative; - padding: 180px 0 120px; - margin-top: -80px; - - - >.container { - z-index: 71; - } - - // This svg appears twice in the markup and swapped for layout purposes. - // Image for small screens. Styles below are for larger screens. - #feature-image-write-sm-screen { - display: block; - position: relative; - margin: 0 auto; - width:80%; - max-width: 400px; - } - - // Image hidden, made visible for larger screens - #feature-image-write-lg-screen { - display: none; - position: absolute; - bottom: 2px; - right: 3%; - width: 581px; - @include skewY(-3deg); - } - - #feature-write-bg{ - background: $white; - z-index: 70; - @include skewY(3deg); - overflow: hidden; - } - } - - #feature-plan{ - position: relative; - color: $white; - background-size: 80%; - position: relative; - padding: 220px 0 180px; - margin-top: -80px; - - >.container { - z-index: 61; - // background: image-url("feature-plan-bg.svg") 0% 45% no-repeat; - background-size: 100%; - } - - // This svg appears twice in the markup and swapped for layout purposes. - // Image for small screens. Styles below are for larger screens. - #feature-image-plan-sm-screen { - display: block; - position: relative; - margin: 0 auto; - width: 100%; - max-width: 400px; - } - - // Image hidden, made visible for larger screens - #feature-image-plan-lg-screen { - display: none; - position: relative; - width: 100%; - } - - #feature-plan-bg{ - background: $purple; - z-index: 60; - @include skewY(-3deg); - } - } - - #feature-create{ - position: relative; - margin-top: -80px; - padding: 240px 0 180px; - - >.container{ - z-index: 51; - } - - #feature-image-create { - display: block; - max-width: 500px; - padding-left: 10px; - margin: 0 auto; - margin-bottom: 40px; - } - - #feature-image-create-lg-screen{ - display: none; - } - - #feature-create-bg{ - @include skewY(3deg); - - z-index: 50; - overflow: hidden; - } - } - - #demos{ - position: relative; - padding: 120px 0 60px; - margin-top: -80px; - - >.container{ - z-index: 41; - } - - #demo-bg{ - background-color: #E6E7E8; - @include skewY(3deg); - z-index: 40; - } - - h2{ - text-align: center; - } - - p { - margin-bottom: 20px; - } - - .terminals{ - margin-bottom: 80px; - - .terminal-item{ - margin-bottom: 80px; - - &.last{ - border-bottom: none; - } - >header{ - .left{ - span.icn{ - display: inline-block; - width: 83px; - height: 74px; - } - } - - .right{ - padding-left: 25px; - } - } - - .terminal{ - - border: 2px solid #1e1e1e; - background: $black; - //border-radius: 4px; - - header{ - position: relative; - text-align: center; - padding: 3px; - border-bottom: 2px solid #1e1e1e; - - h4{ - font-size: 14px; - letter-spacing: 1px; - color: white; - } - - ul.shell-dots{ - position: absolute; - top: 10px; - left: 8px; - padding-left: 0; - - li{ - &.d1{ - background-color: #4a08a7; - } - &.d2{ - background-color: #6517cf; - } - &.d3{ - background-color: #7b29ee; - } - - display: inline-block; - width: 12px; - height: 12px; - border-radius: 6px; - margin-left: 6px; - } - } - } - - .terminal-window{ - min-height: 140px; - padding: 20px; - font-size: 15px; - color: $white; - background-color: transparent; - overflow:auto; - font-weight: 500; - -webkit-font-smoothing: subpixel-antialiased; - - p { - font-family: "Courier New", Monaco, Menlo, Consolas, monospace; - } - - .txt-spe { - color: lighten($blue, 5%); - font-weight: 600; - } - - .txt-var { - color: lighten($purple, 8%); - font-weight: 600; - } - - .txt-str { - color: lighten($green, 2%); - } - - .txt-int { - color: lighten($orange, 2%); - font-weight: 600; - } - - p{ - margin-bottom: 2px; - white-space: pre-wrap; - } - .cursor { - background-color: lighten($purple, 5%); - } - } - } - - .feature-bullets{ - list-style-type: none; - padding-left: 35px; - - li{ - padding: 5px 0 5px 45px; - } - } - } - } - } - - #demo-cta{ - text-align: center; - } - - #latest-announcement{ - position: relative; - margin-top: -80px; - padding: 160px 0 200px; - color: $white; - text-align: left; - - >.container{ - z-index: 51; - } - - h2{ - margin-bottom: 60px; - } - - .latest-col-right{ - position: relative; - padding-left: 60px; - - &:after{ - content: ''; - position: absolute; - left: 30px; - top: 0; - width: 2px; - height: 100%; - background-color: rgba(255, 255, 255, .15); +#page-home { + // Override the main header + #header { + background: $home-header-background-color; + + .navbar-toggle { + .icon-bar { + border: 1px solid $home-header-link-color; } } - .latest-item{ - &.latest-item-text{ - border-bottom: 2px solid rgba(255, 255, 255, .15); + .navbar-brand { + a { + svg.logo { + @extend svg.logo.color; + } + } + } - &:first-child{ - h3{ - margin-top: 0; + ul.nav { + li { + a { + color: $home-header-link-color; + + &:hover, &:focus, &:active { + background-color: transparent; + color: $home-header-link-color-hover; + + svg { + fill: $home-header-link-color-hover; + } + } + + svg { + fill: $home-header-link-color; + } + } + } + } + } + + header { + .hero { + margin: 140px auto 160px auto; + text-align: center; + + .button { + margin: 5px; + + @media (max-width: 768px) { + display: block; + margin-top: 10px; + text-align: center; + } + } + + svg { + max-width: 90%; + } + } + } + + section { + background: $white; + padding: 100px 0; + } + + section.marketing { + h2 { + font-family: $font-family-klavika; + font-size: 36px; + font-weight: $font-weight-bold; + line-height: 1.25; + letter-spacing: -0.02em; + margin: 20px 0 10px 0; + padding: 0; + text-transform: uppercase; + } + + h3 { + color: $black; + font-size: 20px; + font-weight: $font-weight-bold; + line-height: 1.2; + margin: 50px 0 15px 0; + text-transform: uppercase; + } + + p { + font-family: $font-family-open-sans; + font-size: 16px; + letter-spacing: 0.01em; + line-height: 1.5; + margin: 0 0 10px; + } + + p.lead { + font-size: 20px; + margin: 15px 0 30px 0; + } + + span.callout { + background: $black; + color: $white; + display: inline-block; + font-family: $font-family-klavika; + font-size: 18px; + font-weight: $font-weight-bold; + line-height: 1; + margin: 0; + padding: 5px; + letter-spacing: 0.05em; + text-transform: uppercase; + } + + &.purple { + background: $terraform-purple; + + h2 { + color: $white; + } + + p { + color: $white; + } + + span.callout { + background: $white; + color: $terraform-purple; + } + + .button { + border: none; + } + } + + &.black { + background: $black; + + h2 { + color: $white; + } + + p { + color: $white; + } + + span.callout { + background: $white; + color: $black; + } + + .button { + border: none; + } + } + + &#features { + .feature-card { + border: 1px solid $gray-darker; + color: $gray-darker; + display: block; + height: 200px; + font-weight: $font-weight-bold; + padding: 20px; + margin-bottom: 15px; + text-transform: uppercase; + transition: all 0.1s ease-in-out; + + p { + line-height: 1.25em; + } + + span { + color: $terraform-purple; + display: block; + font-weight: $font-weight-bold; + margin-bottom: 10px; + } + + svg { + display: block; + margin-top: 20px; + max-width: 100%; + + path { + transition: all 0.1s ease-in-out; + fill: $gray-dark; } } - &:last-child{ - border-bottom: none; - } - } + &:hover, &:active, &:focus { + border: 1px solid $terraform-purple; + color: $terraform-purple; + text-decoration: none; - img{ - box-shadow: 8px 8px 8px rgba(0,0,0,.25); - margin-bottom: 10px; - max-width: 100%; - } - - h3{ - line-height: 1.2; - font-family: $font-family-open-sans; - text-transform: none; - } - - p{ - margin-bottom: 10px; - } - - a{ - margin-top: 5px; - margin-bottom: 10px; - } - } - } - - #latest-announcement-bg{ - @include skewY(-3deg); - z-index: 30; - background: $purple image-url("latest-announce-bg.svg") bottom left no-repeat; - background-size: cover; - } - - #enterprise-intro{ - position: relative; - padding: 220px 0 180px; - margin-top: -80px; - color: #fff; - - >.container{ - z-index: 31; - } - - h2{ - position: relative; - left: -5px; - margin-bottom: 20px; - background: image-url("terraform-enterprise-logo.svg") top left no-repeat; - background-size: 320px; - overflow: hidden; - - span {margin-left: -200%} - } - - .lead{ - max-width: 30em; - margin-bottom: 40px; - } - - #enterprise-intro-bg{ - background: #000 image-url("enterprise-callout-bg.svg") bottom right no-repeat; - background-size: 80%; - @include skewY(3deg); - z-index: 20; - } - } - - @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { - #demos{ - .terminals{ - .terminal-item{ - .feature-bullets{ - li{ - background-size: 12px 12px; - } - } - } - } - } - } - - @media (min-width: 768px) { - #feature-write{ - // Hide image for small screens - #feature-image-write-sm-screen { - display: none; - } - - // Image hidden, made visible for larger screens - #feature-image-write-lg-screen { - display: block; - } - } - - #feature-plan{ - // Hide image for small screens - #feature-image-plan-sm-screen { - display: none; - } - - // Image hidden, made visible for larger screens - #feature-image-plan-lg-screen { - display: block; - } - } - } - - @media (min-width: 1024px) { - #feature-write{ - #feature-image-write-lg-screen { - right: 10%; - width: 640px; - } - } - } - - @media (min-width: 1440px) { - - #feature-write{ - padding: 280px 0 200px; - margin-top: -120px; - } - - #feature-plan{ - padding: 320px 0 200px; - margin-top: -120px; - } - - #feature-create{ - padding: 320px 0 200px; - margin-top: -120px; - } - - #latest-announcement{ - margin-top: -140px; - padding: 180px 0 240px; - } - - #enterprise-intro{ - margin-top: -140px; - padding: 320px 0 180px; - } - } - - @media (max-width: 992px) { - - #demos{ - .terminals{ - .terminal-item{ - >header{ - .left{ - span.icn{ - } - } - - .right{ - padding-left: 54px; - } - } - } - } - } - - #latest-announcement{ - .latest-col-left{ - .latest-item{ - border-bottom: 2px solid rgba(255, 255, 255, .15); - } - } - - .latest-col-right{ - padding-left: 15px; - - &:after{ - width: 0; - } - } - - .latest-item{ - padding-bottom: 30px; - margin-bottom: 30px; - - &.latest-item-text{ - border-bottom: 2px solid rgba(255, 255, 255, .15); - - &:first-child{ - h3{ - margin-top: 20px; + svg { + path { + fill: $terraform-purple; + transition: all 0.1s ease-in-out; } } } } } - } - @media (max-width: 768px) { - h2{ - margin-bottom: 40px; - font-size: 28px; - line-height: 32px; - letter-spacing: 2px; - text-transform: uppercase; - font-weight: regular; - } + &#plan { + h3 { + color: $white; + } + } - h3{ - margin-bottom: 10px; - font-size: 16px; - line-height: 1.2; - letter-spacing: 1px; - text-transform: uppercase; - font-weight: bold; - } + &#news { + img { + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.25); + margin: 0 0 20px 0; + } - p{ - font-size: 14px; - } + h2 { + margin-bottom: 50px; + } - p.lead{ - font-size: 17px; - } + h3 { + color: $white; + margin-top: 0; + text-transform: none; + } - #primary-cta{ - padding-bottom: 100px; - } + div.latest-item { + border-bottom: 1px solid rgba(255, 255, 255, 0.5); + margin-bottom: 20px; + padding-bottom: 20px; - #customer-logos{ - padding: 40px 0; + &:last-child { + border: none; + margin-bottom: 0; + padding-bottom: 0; + } - p { - display: block; - position: relative; - width: 100%; - text-align: center; - } + p { + padding: 0 0 10px 0; + } - #customer-logos-bg{ - z-index: 30; - background: $black; - background-size: 100%; - @include skewY(-3deg); + .button { + &:hover { + background: $white; + color: $terraform-purple; + } + } + } + } - } + &#examples { + background: #EDEDED; - ul.customer-list{ - padding-left: 15px; + h1, h2, h3, h4, h5, h6, p { + color: $black; + } + } - li{ - display: inline-block; - width: 16%; - height: 80px; - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - } + &#enterprise { + background-image: image-url('enterprise-callout-bg.svg'); + background-position: right bottom; + background-repeat: no-repeat; + background-size: 80%; + } + } - #nike { - background: transparent image-url("customer-logos/nike.svg") left no-repeat; - background-size: 40px; - } + .terminal { + border: 1px solid $white; + background-color: $black; + box-sizing: border-box; + color: $white; + font-family: $font-family-monospace; + font-size: 16px; + line-height: 1.8; + margin: 20px auto; + padding: 10px 20px 20px 20px; - #hbo { - background: transparent image-url("customer-logos/hbo.svg") left no-repeat; - background-size: 40px; - } + .terminal-content { + margin-top: 15px; + overflow-x: scroll; + width: 100%; + white-space: nowrap; - #target { - background: transparent image-url("customer-logos/target.svg") left no-repeat; - background-size: 30px; - } + span { + display: block; + white-space: pre; - #capital-one { - background: transparent image-url("customer-logos/capital-one.svg") left no-repeat; - background-size: 40px; - } + span { + display: inline; + } - #home-depot { - background: transparent image-url("customer-logos/home-depot.svg") left no-repeat; - background-size: 30px; - } + &.text-pink { + color: lighten($consul-pink, 20%); + } + } + } - #hotels-dot-com { - background: transparent image-url("customer-logos/hotels-dot-com.svg") left no-repeat; - background-size: 40px; - } - } + span.circle { + &:before { + content: '\25CF'; + color: $white; + font-size: 28px; + line-height: 100%; + height: 100%; + } + } - ul.customer-list{ - display: block; - position: relative; - width: 100%; - margin: 0 auto; - padding: 0; - text-align: center; + span.txt-spe { + color: #7190EA; + } - li{ - display: inline-block; - position: relative; - width: 40px; - height: 40px; - margin: 0 2%; - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - } - } - } + span.txt-str { + color: #64E86C; + } + span.txt-int { + color: #E89264; + } - #demos{ - - .terminals{ - .terminal-item{ - >header{ - .left{ - span.icn{ - padding-bottom: 15px; - } - } - - .right{ - padding-left: 15px; - } - } - } - } - } - } + span.txt-var { + color: #9A56f9; + } + } } diff --git a/website/source/assets/stylesheets/_inner.scss b/website/source/assets/stylesheets/_inner.scss new file mode 100644 index 000000000..1fd41e3f3 --- /dev/null +++ b/website/source/assets/stylesheets/_inner.scss @@ -0,0 +1,95 @@ +#inner { + p, li, .alert { + font-size: $font-size; + font-family: $font-family-open-sans; + font-weight: $font-weight-reg; + line-height: 1.84em; + margin: 0 0 $font-size; + -webkit-font-smoothing: antialiased; + } + + .alert p:last-child { + margin-bottom: 0; + } + + pre, + code, + pre code, + tt { + font-family: $font-family-monospace; + font-size: $font-size - 2; + line-height: 1.6; + } + + pre { + padding: 20px; + margin: 0 0 $font-size; + + // This will force the code to scroll horizontally on small screens + // instead of wrapping. + code { + overflow-wrap: normal; + white-space: pre; + } + } + + a { + color: $body-link-color; + text-decoration: none; + + &:hover { + text-decoration: underline; + } + + code { + background: inherit; + color: $body-link-color; + } + } + + img { + display: block; + margin: 25px auto; + max-width: 650px; + height: auto; + width: 90%; + } + + h1, + h2, + h3, + h4 { + color: $body-font-color; + margin-top: 54px; + margin-bottom: $font-size; + line-height: 1.3; + } + + h2 { + padding-bottom: 3px; + border-bottom: 1px solid $gray-light; + } + + h1 > code, + h2 > code, + h3 > code, + h4 > code, + h5 > code + h6 > code, + li code, + table code, + p code, + tt, + .alert code { + font-family: $font-family-monospace; + font-size: 90%; + background-color: transparent; + color: inherit; + padding: 0; + } + + table { + @extend .table; + @extend .table-striped; + } +} diff --git a/website/source/assets/stylesheets/_jumbotron.scss b/website/source/assets/stylesheets/_jumbotron.scss deleted file mode 100755 index 52ae80a0f..000000000 --- a/website/source/assets/stylesheets/_jumbotron.scss +++ /dev/null @@ -1,439 +0,0 @@ -// -// Jumbotron -// -------------------------------------------------- - -#jumbotron-mask{ - position:relative; - z-index:0; - height:700px; - margin-top: $negative-hero-margin; - background-color: black; -} - -#jumbotron { - position: relative; - height:700px; - padding-top: 0; - padding-bottom: 0; - color: $jumbotron-color; - - &.static { - background-image:image-url("bg-galaxy.jpg"); - background-position:50% 50%; - background-repeat:no-repeat; - - .jumbotron-content { - background-image:image-url("bg-static.png"); - background-size:cover; - background-position:50% 50%; - background-repeat:no-repeat; - } - - .jumbotron-content:after { - content:''; - display:block; - position:absolute; - top:50%; - left:50%; - background:image-url("logo-static.png"); - - -webkit-background-size:100% 100%; - -moz-background-size:100% 100%; - -ms-background-size:100% 100%; - -o-background-size:100% 100%; - background-size:100% 100%; - - width:360px; - height:360px; - margin:-204px 0 0 -180px; - } - } - - .terraform-canvas { - position:absolute; - top:0; - left:0; - width:100%; - height:100%; - opacity:0; - - -webkit-transition:opacity 2s ease-out; - -moz-transition:opacity 2s ease-out; - -ms-transition:opacity 2s ease-out; - -o-transition:opacity 2s ease-out; - transition:opacity 2s ease-out; - - -webkit-transform:translate3d(0,0,0); - -moz-transform:translate3d(0,0,0); - -ms-transform:translate3d(0,0,0); - -o-transform:translate3d(0,0,0); - transform:translate3d(0,0,0); - } - - .jumbotron-content { - position:absolute; - z-index:999; - top:0; - left:0; - right:0; - bottom:0; - - -webkit-transform:translate3d(0,0,0); - -moz-transform:translate3d(0,0,0); - -ms-transform:translate3d(0,0,0); - -o-transform:translate3d(0,0,0); - transform:translate3d(0,0,0); - } - - .galaxy-bg { - position:absolute; - width:100%; - height:100%; - top:0; - left:0; - - background-image:image-url("bg-galaxy.jpg"); - /* background-size:cover; */ - background-position:50% 50%; - background-repeat: no-repeat; - opacity:0; - - -webkit-transition:opacity 2s ease-out; - -moz-transition:opacity 2s ease-out; - -ms-transition:opacity 2s ease-out; - -o-transition:opacity 2s ease-out; - transition:opacity 2s ease-out; - - -webkit-transform:translate3d(0,0,0); - -moz-transform:translate3d(0,0,0); - -ms-transform:translate3d(0,0,0); - -o-transform:translate3d(0,0,0); - transform:translate3d(0,0,0); - - &.show { - opacity:1; - } - } -} - -.tag-line { - position:absolute; - width:100%; - top:540px; - color:#fff; - visibility:hidden; - - -webkit-transform:translate3d(0,0,0); - -moz-transform:translate3d(0,0,0); - -ms-transform:translate3d(0,0,0); - -o-transform:translate3d(0,0,0); - transform:translate3d(0,0,0); -} - - -.animated-logo { - position:absolute; - z-index:200; - top:50%; - left:50%; - width:140px; - height:140px; - margin:-60px 0 0 -115px; - opacity:1; - - -webkit-transition:-webkit-transform 300ms ease-in-out; - -moz-transition: -moz-transform 300ms ease-in-out; - -ms-transition: -ms-transform 300ms ease-in-out; - -o-transition: -o-transform 300ms ease-in-out; - transition: transform 300ms ease-in-out; - - -webkit-transform-origin:50% 50%; - -moz-transform-origin:50% 50%; - -ms-transform-origin:50% 50%; - -o-transform-origin:50% 50%; - transform-origin:50% 50%; - - -webkit-transform-style:preserve-3d; - -moz-transform-style:preserve-3d; - -ms-transform-style:preserve-3d; - -o-transform-style:preserve-3d; - transform-style:preserve-3d; - - -webkit-transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); - -moz-transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); - -ms-transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); - -o-transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); - transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); -} - -.state-one .animated-logo { - -webkit-transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); - -moz-transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); - -ms-transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); - -o-transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); - transform:translate3d(0,0,0) rotateY(0deg) skewY(0deg) scale(1,1); -} - -.state-one.state-two.state-three.state-four .animated-logo { - -webkit-transform-origin:100% 0; - -moz-transform-origin:100% 0; - -ms-transform-origin:100% 0; - -o-transform-origin:100% 0; - transform-origin:100% 0; - - -webkit-transform:translate3d(0,10px,0) rotateY(-45deg) skewY(22deg) scale(1.26,1); - -moz-transform:translate3d(0,10px,0) rotateY(-45deg) skewY(22deg) scale(1.26,1); - -ms-transform:translate3d(0,10px,0) rotateY(-45deg) skewY(22deg) scale(1.26,1); - -o-transform:translate3d(0,10px,0) rotateY(-45deg) skewY(22deg) scale(1.26,1); - transform:translate3d(0,10px,0) rotateY(-45deg) skewY(22deg) scale(1.26,1); -} - -.state-one.state-two.state-three.state-four .white-block { - background-color:rgba(255,255,255,1); -} - -.white-block { - position:absolute; - width:68px; - height:68px; - - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - - /* background-color:rgba(255,0,0,0.3); */ - background-color:#fff; - background-color:rgba(255,255,255,0); - - border:1px solid #fff; - - -webkit-transition: - opacity 300ms ease-out, - -webkit-transform 300ms ease-out, - background-color 300ms ease-out; - -moz-transition: - opacity 300ms ease-out, - -moz-transform 300ms ease-out, - background-color 300ms ease-out; - -ms-transition: - opacity 300ms ease-out, - -ms-transform 300ms ease-out, - background-color 300ms ease-out; - -o-transition: - opacity 300ms ease-out, - -o-transform 300ms ease-out, - background-color 300ms ease-out; - transition: - opacity 300ms ease-out, - transform 300ms ease-out, - background-color 300ms ease-out; -} - -.block-1, -.block-2, -.block-3, -.block-4 { - top:0; - left:72px; - - -webkit-transform-origin:50% 50%; - -moz-transform-origin:50% 50%; - -ms-transform-origin:50% 50%; - -o-transform-origin:50% 50%; - transform-origin:50% 50%; - - -webkit-transform:translate3d(0,0,0); - -moz-transform:translate3d(0,0,0); - -ms-transform:translate3d(0,0,0); - -o-transform:translate3d(0,0,0); - transform:translate3d(0,0,0); -} - -.block-1 { - opacity:0; - - -webkit-transform:translate3d(0,0,0) scale(0,0); - -moz-transform:translate3d(0,0,0) scale(0,0); - -ms-transform:translate3d(0,0,0) scale(0,0); - -o-transform:translate3d(0,0,0) scale(0,0); - transform:translate3d(0,0,0) scale(0,0); -} - -.block-2 { - opacity:0; - top:0; - left:0; - - -webkit-transform:translate3d(0,0,0) scale(0,0); - -moz-transform:translate3d(0,0,0) scale(0,0); - -ms-transform:translate3d(0,0,0) scale(0,0); - -o-transform:translate3d(0,0,0) scale(0,0); - transform:translate3d(0,0,0) scale(0,0); -} - -.block-3 { - opacity:0; - top:72px; - - -webkit-transform:translate3d(0,0,0) scale(0,0); - -moz-transform:translate3d(0,0,0) scale(0,0); - -ms-transform:translate3d(0,0,0) scale(0,0); - -o-transform:translate3d(0,0,0) scale(0,0); - transform:translate3d(0,0,0) scale(0,0); -} - -.block-4 { - -webkit-transform-origin:0 0; - -moz-transform-origin:0 0; - -ms-transform-origin:0 0; - -o-transform-origin:0 0; - transform-origin:0 0; - - -webkit-transform:translate3d(72px,-2px,0) rotateY(90deg) skewY(-22deg) scaleX(1.25); - -moz-transform:translate3d(72px,-2px,0) rotateY(90deg) skewY(-22deg) scaleX(1.25); - -ms-transform:translate3d(72px,-2px,0) rotateY(90deg) skewY(-22deg) scaleX(1.25); - -o-transform:translate3d(72px,-2px,0) rotateY(90deg) skewY(-22deg) scaleX(1.25); - transform:translate3d(72px,-2px,0) rotateY(90deg) skewY(-22deg) scaleX(1.25); -} - -.state-one.state-two .block-1 { - opacity:1; - - -webkit-transform:translate3d(0,0,0) scale(1,1); - -moz-transform:translate3d(0,0,0) scale(1,1); - -ms-transform:translate3d(0,0,0) scale(1,1); - -o-transform:translate3d(0,0,0) scale(1,1); - transform:translate3d(0,0,0) scale(1,1); -} - -.state-one .block-2 { - opacity:1; - - -webkit-transform:translate3d(0,0,0) scale(1,1); - -moz-transform:translate3d(0,0,0) scale(1,1); - -ms-transform:translate3d(0,0,0) scale(1,1); - -o-transform:translate3d(0,0,0) scale(1,1); - transform:translate3d(0,0,0) scale(1,1); -} - -.state-one.state-two.state-three .block-3 { - opacity:1; - - -webkit-transform:translate3d(0,0,0) scale(1,1); - -moz-transform:translate3d(0,0,0) scale(1,1); - -ms-transform:translate3d(0,0,0) scale(1,1); - -o-transform:translate3d(0,0,0) scale(1,1); - transform:translate3d(0,0,0) scale(1,1); -} - -.cursor { - font-weight:bold; - - -webkit-animation:Blink 800ms infinite; - -moz-animation:Blink 800ms infinite; - -ms-animation:Blink 800ms infinite; - -o-animation:Blink 800ms infinite; - animation:Blink 800ms infinite; -} - -@-webkit-keyframes Blink { - 0% { - opacity:1; - } - 50% { - opacity:1; - - } - 51% { - opacity:0; - } - 100% { - opacity:0; - } -} - -@-moz-keyframes Blink { - 0% { - opacity:1; - } - 50% { - opacity:1; - } - 51% { - opacity:0; - } - 100% { - opacity:0; - } -} - -@-ms-keyframes Blink { - 0% { - opacity:1; - - } - 50% { - opacity:1; - } - 51% { - opacity:0; - } - 100% { - opacity:0; - } -} - -@-o-keyframes Blink { - 0% { - opacity:1; - - } - 50% { - opacity:1; - } - 51% { - opacity:0; - } - 100% { - opacity:0; - } -} - -@keyframes Blink { - 0% { - opacity:1; - - } - 50% { - opacity:1; - } - 51% { - opacity:0; - } - 100% { - opacity:0; - } -} - -@media (max-width: 570px) { - .tag-line { - display:none; - } - - #jumbotron .jumbotron-content { - -webkit-transform:translate3d(0, 0, 0) scale(0.8); - -moz-transform:translate3d(0, 0, 0) scale(0.8); - -ms-transform:translate3d(0, 0, 0) scale(0.8); - -o-transform:translate3d(0, 0, 0) scale(0.8); - transform:translate3d(0, 0, 0) scale(0.8); - } - - .animated-logo { - margin:-15px 0 0 -113px; - } - - #jumbotron-mask, - #jumbotron { - height:560px; - } -} diff --git a/website/source/assets/stylesheets/_logos.scss b/website/source/assets/stylesheets/_logos.scss new file mode 100644 index 000000000..6e8f39a48 --- /dev/null +++ b/website/source/assets/stylesheets/_logos.scss @@ -0,0 +1,41 @@ +svg.logo { + &.color { + opacity: 1.0; + + path.text { + fill: $black; + opacity: 1.0; + } + + path.rect-light { + fill: $terraform-purple; + opacity: 1.0; + } + + path.rect-dark { + fill: $terraform-purple-dark; + opacity: 1.0; + } + } + + // The default logo class is the colored version + @extend .color; + + &.white { + opacity: 1.0; + + path.text { + fill: $white; + } + + path.rect-light { + fill: $white; + opacity: 1.0; + } + + path.rect-dark { + fill: $white; + opacity: 0.7; + } + } +} diff --git a/website/source/assets/stylesheets/_mixins.scss b/website/source/assets/stylesheets/_mixins.scss deleted file mode 100755 index f49151e3a..000000000 --- a/website/source/assets/stylesheets/_mixins.scss +++ /dev/null @@ -1,724 +0,0 @@ -// -// Mixins -// -------------------------------------------------- - - -// Utilities -// ------------------------- - -// Clearfix -// Source: http://nicolasgallagher.com/micro-clearfix-hack/ -// -// For modern browsers -// 1. The space content is one way to avoid an Opera bug when the -// contenteditable attribute is included anywhere else in the document. -// Otherwise it causes space to appear at the top and bottom of elements -// that are clearfixed. -// 2. The use of `table` rather than `block` is only necessary if using -// `:before` to contain the top-margins of child elements. -@mixin clearfix() { - &:before, - &:after { - content: " "; /* 1 */ - display: table; /* 2 */ - } - &:after { - clear: both; - } -} - -// Webkit-style focus -@mixin tab-focus() { - // Default - outline: thin dotted #333; - // Webkit - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} - -// Center-align a block level element -@mixin center-block() { - display: block; - margin-left: auto; - margin-right: auto; -} - -// Sizing shortcuts -@mixin size($width, $height) { - width: $width; - height: $height; -} -@mixin square($size) { - @include size($size, $size); -} - -// Placeholder text -@mixin placeholder($color: $input-color-placeholder) { - &:-moz-placeholder { color: $color; } // Firefox 4-18 - &::-moz-placeholder { color: $color; } // Firefox 19+ - &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+ - &::-webkit-input-placeholder { color: $color; } // Safari and Chrome -} - -// Text overflow -// Requires inline-block or block for proper styling -@mixin text-overflow() { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -// CSS image replacement -// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 -@mixin hide-text() { - font: #{"0/0"} a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} - - - -// CSS3 PROPERTIES -// -------------------------------------------------- - -// Single side border-radius -@mixin border-top-radius($radius) { - border-top-right-radius: $radius; - border-top-left-radius: $radius; -} -@mixin border-right-radius($radius) { - border-bottom-right-radius: $radius; - border-top-right-radius: $radius; -} -@mixin border-bottom-radius($radius) { - border-bottom-right-radius: $radius; - border-bottom-left-radius: $radius; -} -@mixin border-left-radius($radius) { - border-bottom-left-radius: $radius; - border-top-left-radius: $radius; -} - -// Drop shadows -@mixin box-shadow($shadow) { - -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1 - box-shadow: $shadow; -} - -// Transitions -@mixin transition($transition) { - -webkit-transition: $transition; - transition: $transition; -} -@mixin transition-delay($transition-delay) { - -webkit-transition-delay: $transition-delay; - transition-delay: $transition-delay; -} -@mixin transition-duration($transition-duration) { - -webkit-transition-duration: $transition-duration; - transition-duration: $transition-duration; -} -@mixin transition-transform($transition) { - -webkit-transition: -webkit-transform $transition; - -moz-transition: -moz-transform $transition; - -o-transition: -o-transform $transition; - transition: transform $transition; -} - -// Transformations -@mixin rotate($degrees) { - -webkit-transform: rotate($degrees); - -ms-transform: rotate($degrees); // IE9+ - transform: rotate($degrees); -} -@mixin scale($ratio) { - -webkit-transform: scale($ratio); - -ms-transform: scale($ratio); // IE9+ - transform: scale($ratio); -} -@mixin translate($x, $y) { - -webkit-transform: translate($x, $y); - -ms-transform: translate($x, $y); // IE9+ - transform: translate($x, $y); -} -@mixin skew($x, $y) { - -webkit-transform: skew($x, $y); - -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+ - transform: skew($x, $y); -} -@mixin translate3d($x, $y, $z) { - -webkit-transform: translate3d($x, $y, $z); - transform: translate3d($x, $y, $z); -} - -// Backface visibility -// Prevent browsers from flickering when using CSS 3D transforms. -// Default value is `visible`, but can be changed to `hidden` -// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples -@mixin backface-visibility($visibility) { - -webkit-backface-visibility: $visibility; - -moz-backface-visibility: $visibility; - backface-visibility: $visibility; -} - -// Box sizing -@mixin box-sizing($boxmodel) { - -webkit-box-sizing: $boxmodel; - -moz-box-sizing: $boxmodel; - box-sizing: $boxmodel; -} - -// User select -// For selecting text on the page -@mixin user-select($select) { - -webkit-user-select: $select; - -moz-user-select: $select; - -ms-user-select: $select; // IE10+ - -o-user-select: $select; - user-select: $select; -} - -// Resize anything -@mixin resizable($direction) { - resize: $direction; // Options: horizontal, vertical, both - overflow: auto; // Safari fix -} - -// CSS3 Content Columns -@mixin content-columns($column-count, $column-gap: $grid-gutter-width) { - -webkit-column-count: $column-count; - -moz-column-count: $column-count; - column-count: $column-count; - -webkit-column-gap: $column-gap; - -moz-column-gap: $column-gap; - column-gap: $column-gap; -} - -// Optional hyphenation -@mixin hyphens($mode: auto) { - word-wrap: break-word; - -webkit-hyphens: $mode; - -moz-hyphens: $mode; - -ms-hyphens: $mode; // IE10+ - -o-hyphens: $mode; - hyphens: $mode; -} - -// Opacity -@mixin opacity($opacity) { - opacity: $opacity; - // IE8 filter - $opacity-ie: ($opacity * 100); - filter: #{"alpha(opacity=#{opacity-ie})"}; -} - - - -// GRADIENTS -// -------------------------------------------------- - -#gradient { - - // Horizontal gradient, from left to right - // - // Creates two color stops, start and end, by specifying a color and position for each color stop. - // Color stops are not available in IE9 and below. - @mixin horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) { - background-image: -webkit-gradient(linear, $start-percent top, $end-percent top, from($start-color), to($end-color)); // Safari 4+, Chrome 2+ - background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1+, Chrome 10+ - background-image: -moz-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // FF 3.6+ - background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10 - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{argb($start-color)}', endColorstr='#{argb($end-color)}', GradientType=1); // IE9 and down - } - - // Vertical gradient, from top to bottom - // - // Creates two color stops, start and end, by specifying a color and position for each color stop. - // Color stops are not available in IE9 and below. - @mixin vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) { - background-image: -webkit-gradient(linear, left $start-percent, left $end-percent, from($start-color), to($end-color)); // Safari 4+, Chrome 2+ - background-image: -webkit-linear-gradient(top, $start-color, $start-percent, $end-color, $end-percent); // Safari 5.1+, Chrome 10+ - background-image: -moz-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // FF 3.6+ - background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10 - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{argb($start-color)}', endColorstr='#{argb($end-color)}', GradientType=0); // IE9 and down - } - - @mixin directional($start-color: #555, $end-color: #333, $deg: 45deg) { - background-repeat: repeat-x; - background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1+, Chrome 10+ - background-image: -moz-linear-gradient($deg, $start-color, $end-color); // FF 3.6+ - background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10 - } - @mixin horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) { - background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color)); - background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color); - background-image: -moz-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color); - background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{argb($start-color)}', endColorstr='#{argb($end-color)}', GradientType=1); // IE9 and down - } - @mixin vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) { - background-image: -webkit-gradient(linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color)); - background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color); - background-image: -moz-linear-gradient(top, $start-color, $mid-color $color-stop, $end-color); - background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{argb($start-color)}', endColorstr='#{argb($end-color)}', GradientType=0); // IE9 and down - } - @mixin radial($inner-color: #555, $outer-color: #333) { - background-image: -webkit-gradient(radial, center center, 0, center center, 460, from($inner-color), to($outer-color)); - background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color); - background-image: -moz-radial-gradient(circle, $inner-color, $outer-color); - background-image: radial-gradient(circle, $inner-color, $outer-color); - background-repeat: no-repeat; - } - @mixin striped($color: #555, $angle: 45deg) { - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - background-image: linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - } -} - -// Reset filters for IE -// -// When you need to remove a gradient background, do not forget to use this to reset -// the IE filter for IE9 and below. -@mixin reset-filter() { - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); -} - - - -// Retina images -// -// Short retina mixin for setting background-image and -size - -@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) { - background-image: image-url("#{$file-1x}"); - background-size: $width-1x $height-1x; - - @media - only screen and (-webkit-min-device-pixel-ratio: 2), - only screen and ( min--moz-device-pixel-ratio: 2), - only screen and ( -o-min-device-pixel-ratio: 2/1), - only screen and ( min-device-pixel-ratio: 2), - only screen and ( min-resolution: 192dpi), - only screen and ( min-resolution: 2dppx) { - background-image: image-url("#{$file-2x}"); - background-size: $width-1x $height-1x; - } -} - - -// Responsive image -// -// Keep images from scaling beyond the width of their parents. - -@mixin img-responsive($display: block) { - display: $display; - max-width: 100%; // Part 1: Set a maximum relative to the parent - height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching -} - - -// COMPONENT MIXINS -// -------------------------------------------------- - -// Horizontal dividers -// ------------------------- -// Dividers (basically an hr) within dropdowns and nav lists -@mixin nav-divider($color: #e5e5e5) { - height: 1px; - margin: (($line-height-computed / 2) - 1) 0; - overflow: hidden; - background-color: $color; -} - -// Panels -// ------------------------- -@mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) { - border-color: $border; - & > .panel-heading { - color: $heading-text-color; - background-color: $heading-bg-color; - border-color: $heading-border; - + .panel-collapse .panel-body { - border-top-color: $border; - } - } - & > .panel-footer { - + .panel-collapse .panel-body { - border-bottom-color: $border; - } - } -} - -// Alerts -// ------------------------- -@mixin alert-variant($background, $border, $text-color) { - background-color: $background; - border-color: $border; - color: $text-color; - hr { - border-top-color: darken($border, 5%); - } - .alert-link { - color: darken($text-color, 10%); - } -} - -// Tables -// ------------------------- -@mixin table-row-variant($state, $background, $border) { - // Exact selectors below required to override `.table-striped` and prevent - // inheritance to nested tables. - .table > thead > tr, - .table > tbody > tr, - .table > tfoot > tr { - > td.#{state}, - > th.#{state}, - &.#{state} > td, - &.#{state} > th { - background-color: $background; - border-color: $border; - } - } - - // Hover states for `.table-hover` - // Note: this is not available for cells or rows within `thead` or `tfoot`. - .table-hover > tbody > tr { - > td.#{state}:hover, - > th.#{state}:hover, - &.#{state}:hover > td { - background-color: darken($background, 5%); - border-color: darken($border, 5%); - } - } -} - -// Button variants -// ------------------------- -// Easily pump out default styles, as well as :hover, :focus, :active, -// and disabled options for all buttons -@mixin button-variant($color, $background, $border) { - color: $color; - background-color: $background; - border-color: $border; - - &:hover, - &:focus, - &:active, - &.active, - .open .dropdown-toggle& { - color: $color; - background-color: darken($background, 8%); - border-color: darken($border, 12%); - } - &:active, - &.active, - .open .dropdown-toggle& { - background-image: none; - } - &.disabled, - &[disabled], - fieldset[disabled] & { - &, - &:hover, - &:focus, - &:active, - &.active { - background-color: $background; - border-color: $border - } - } -} - -// Button sizes -// ------------------------- -@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { - padding: $padding-vertical $padding-horizontal; - font-size: $font-size; - line-height: $line-height; - border-radius: $border-radius; -} - -// Pagination -// ------------------------- -@mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $border-radius) { - > li { - > a, - > span { - padding: $padding-vertical $padding-horizontal; - font-size: $font-size; - } - &:first-child { - > a, - > span { - @include border-left-radius($border-radius); - } - } - &:last-child { - > a, - > span { - @include border-right-radius($border-radius); - } - } - } -} - -// Labels -// ------------------------- -@mixin label-variant($color) { - background-color: $color; - &[href] { - &:hover, - &:focus { - background-color: darken($color, 10%); - } - } -} - -// Navbar vertical align -// ------------------------- -// Vertically center elements in the navbar. -// Example: an element has a height of 30px, so write out `@include navbar-vertical-align(30px);` to calculate the appropriate top margin. -@mixin navbar-vertical-align($element-height) { - margin-top: (($navbar-height - $element-height) / 2); - margin-bottom: (($navbar-height - $element-height) / 2); -} - -// Progress bars -// ------------------------- -// @mixin progress-bar-variant($color) { -// background-color: $color; -// .progress-striped & { -// #gradient > @include striped($color); -// } -// } - -// Responsive utilities -// ------------------------- -// More easily include all the states for responsive-utilities.less. -@mixin responsive-visibility() { - display: block !important; - tr& { display: table-row !important; } - th&, - td& { display: table-cell !important; } -} - -@mixin responsive-invisibility() { - display: none !important; - tr& { display: none !important; } - th&, - td& { display: none !important; } -} - -// Grid System -// ----------- - -// Centered container element -@mixin container-fixed() { - margin-right: auto; - margin-left: auto; - padding-left: ($grid-gutter-width / 2); - padding-right: ($grid-gutter-width / 2); - @include clearfix(); -} - -// Creates a wrapper for a series of columns -@mixin make-row($gutter: $grid-gutter-width) { - margin-left: ($gutter / -2); - margin-right: ($gutter / -2); - @include clearfix(); -} - -// Generate the extra small columns -@mixin make-xs-column($columns, $gutter: $grid-gutter-width) { - position: relative; - float: left; - width: percentage(($columns / $grid-columns)); - // Prevent columns from collapsing when empty - min-height: 1px; - // Inner gutter via padding - padding-left: ($gutter / 2); - padding-right: ($gutter / 2); -} - -// Generate the small columns -@mixin make-sm-column($columns, $gutter: $grid-gutter-width) { - position: relative; - // Prevent columns from collapsing when empty - min-height: 1px; - // Inner gutter via padding - padding-left: ($gutter / 2); - padding-right: ($gutter / 2); - - // Calculate width based on number of columns available - @media (min-width: $screen-sm) { - float: left; - width: percentage(($columns / $grid-columns)); - } -} - -// Generate the small column offsets -@mixin make-sm-column-offset($columns) { - @media (min-width: $screen-sm) { - margin-left: percentage(($columns / $grid-columns)); - } -} -@mixin make-sm-column-push($columns) { - @media (min-width: $screen-sm) { - left: percentage(($columns / $grid-columns)); - } -} -@mixin make-sm-column-pull($columns) { - @media (min-width: $screen-sm) { - right: percentage(($columns / $grid-columns)); - } -} - -// Generate the medium columns -@mixin make-md-column($columns, $gutter: $grid-gutter-width) { - position: relative; - // Prevent columns from collapsing when empty - min-height: 1px; - // Inner gutter via padding - padding-left: ($gutter / 2); - padding-right: ($gutter / 2); - - // Calculate width based on number of columns available - @media (min-width: $screen-md) { - float: left; - width: percentage(($columns / $grid-columns)); - } -} - -// Generate the large column offsets -@mixin make-md-column-offset($columns) { - @media (min-width: $screen-md) { - margin-left: percentage(($columns / $grid-columns)); - } -} -@mixin make-md-column-push($columns) { - @media (min-width: $screen-md) { - left: percentage(($columns / $grid-columns)); - } -} -@mixin make-md-column-pull($columns) { - @media (min-width: $screen-md) { - right: percentage(($columns / $grid-columns)); - } -} - -// Generate the large columns -@mixin make-lg-column($columns, $gutter: $grid-gutter-width) { - position: relative; - // Prevent columns from collapsing when empty - min-height: 1px; - // Inner gutter via padding - padding-left: ($gutter / 2); - padding-right: ($gutter / 2); - - // Calculate width based on number of columns available - @media (min-width: $screen-lg) { - float: left; - width: percentage(($columns / $grid-columns)); - } -} - -// Generate the large column offsets -@mixin make-lg-column-offset($columns) { - @media (min-width: $screen-lg) { - margin-left: percentage(($columns / $grid-columns)); - } -} -@mixin make-lg-column-push($columns) { - @media (min-width: $screen-lg) { - left: percentage(($columns / $grid-columns)); - } -} -@mixin make-lg-column-pull($columns) { - @media (min-width: $screen-lg) { - right: percentage(($columns / $grid-columns)); - } -} - - -// Form validation states -// -// Used in forms.less to generate the form validation CSS for warnings, errors, -// and successes. - -@mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) { - // Color the label and help text - .help-block, - .control-label { - color: $text-color; - } - // Set the border and box shadow on specific inputs to match - .form-control { - border-color: $border-color; - @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work - &:focus { - border-color: darken($border-color, 10%); - $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%); - @include box-shadow($shadow); - } - } - // Set validation states also for addons - .input-group-addon { - color: $text-color; - border-color: $border-color; - background-color: $background-color; - } -} - -// Form control focus state -// -// Generate a customized focus state and for any input with the specified color, -// which defaults to the `$input-focus-border` variable. -// -// We highly encourage you to not customize the default value, but instead use -// this to tweak colors on an as-needed basis. This aesthetic change is based on -// WebKit's default styles, but applicable to a wider range of browsers. Its -// usability and accessibility should be taken into account with any change. -// -// Example usage: change the default blue border and shadow to white for better -// contrast against a dark gray background. - -@mixin form-control-focus($color: $input-border-focus) { - $color-rgba: rgba(red($color), green($color), blue($color), .6); - &:focus { - border-color: $color; - outline: 0; - @include box-shadow(#{"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px #{color-rgba}"}); - } -} - -// Form control sizing -// -// Relative text size, padding, and border-radii changes for form controls. For -// horizontal sizing, wrap controls in the predefined grid classes. `