From b9a4d5002f587231aa28be6dff14486eafd4f8bb Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Sun, 5 May 2019 11:39:25 +0100 Subject: [PATCH 01/19] Initial skeleton of aws_xray_sampling_rules resorce --- aws/resource_aws_xray_sampling_rule.go | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 aws/resource_aws_xray_sampling_rule.go diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go new file mode 100644 index 00000000000..067ff3fbb95 --- /dev/null +++ b/aws/resource_aws_xray_sampling_rule.go @@ -0,0 +1,43 @@ +package aws + +import ( + "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform/helper/validation" +) + +func resourceAwsXraySamplingRule() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsXraySamplingRuleCreate, + Read: resourceAwsXraySamplingRuleRead, + Update: resourceAwsXraySamplingRuleUpdate, + Delete: resourceAwsXraySamplingRuleDelete, + + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(1, 128), + }, + }, + } +} + +func resourceAwsXraySamplingRuleCreate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsXraySamplingRuleUpdate(d *schema.ResourceData, meta interface{}) error { + return resourceAwsXraySamplingRuleRead(d, meta) +} + +func resourceAwsXraySamplingRuleDelete(d *schema.ResourceData, meta interface{}) error { + return nil +} From ff1743d72c00c4ee13a5d2717a7a0e23441011a2 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Sun, 5 May 2019 12:02:07 +0100 Subject: [PATCH 02/19] Introduces aws_xray_sampling_rule schema --- aws/resource_aws_xray_sampling_rule.go | 60 ++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index 067ff3fbb95..b5c47ef6264 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -18,9 +18,63 @@ func resourceAwsXraySamplingRule() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringLenBetween(1, 128), + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(1, 128), + ConflictsWith: []string{"rule_arn"}, + }, + "rule_arn": { + Type: schema.TypeString, + Required: true, + ConflictsWith: []string{"name"}, + }, + "resource_arn": { + Type: schema.TypeString, + Required: true, + }, + "priority": { + Type: schema.TypeInt, + Required: true, + }, + "fixed_rate": { + Type: schema.TypeFloat, + Required: true, + }, + "reservoir_size": { + Type: schema.TypeInt, + Required: true, + }, + "service_type": { + Type: schema.TypeString, + Required: true, + }, + "host": { + Type: schema.TypeString, + Required: true, + }, + "http_method": { + Type: schema.TypeString, + Required: true, + }, + "url_path": { + Type: schema.TypeString, + Required: true, + }, + "version": { + Type: schema.TypeInt, + Required: true, + }, + "attributes": { + Type: schema.TypeMap, + Optional: true, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + }, + "modified_at": { + Type: schema.TypeString, + Computed: true, }, }, } From aada9c266020a4d4562d3e0886ef1faf3d246164 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Sun, 5 May 2019 18:10:31 +0100 Subject: [PATCH 03/19] Adds xray client in config, and aws_xray_sampling_rules in provider --- aws/config.go | 3 + aws/provider.go | 1 + aws/resource_aws_xray_sampling_rule.go | 83 +++++++++++++++++++++++++- 3 files changed, 84 insertions(+), 3 deletions(-) diff --git a/aws/config.go b/aws/config.go index bd969f9f7d8..9135c30eb77 100644 --- a/aws/config.go +++ b/aws/config.go @@ -123,6 +123,7 @@ import ( "github.com/aws/aws-sdk-go/service/wafregional" "github.com/aws/aws-sdk-go/service/worklink" "github.com/aws/aws-sdk-go/service/workspaces" + "github.com/aws/aws-sdk-go/service/xray" awsbase "github.com/hashicorp/aws-sdk-go-base" "github.com/hashicorp/terraform/helper/logging" "github.com/hashicorp/terraform/terraform" @@ -276,6 +277,7 @@ type AWSClient struct { wafregionalconn *wafregional.WAFRegional worklinkconn *worklink.WorkLink workspacesconn *workspaces.WorkSpaces + xrayconn *xray.XRay } // Client configures and returns a fully initialized AWSClient @@ -447,6 +449,7 @@ func (c *Config) Client() (interface{}, error) { wafregionalconn: wafregional.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["wafregional"])})), worklinkconn: worklink.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["worklink"])})), workspacesconn: workspaces.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["workspaces"])})), + xrayconn: xray.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["xray"])})), } // Handle deprecated endpoint configurations diff --git a/aws/provider.go b/aws/provider.go index 2a272e04cb1..7de2ade6572 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -759,6 +759,7 @@ func Provider() terraform.ResourceProvider { "aws_pinpoint_event_stream": resourceAwsPinpointEventStream(), "aws_pinpoint_gcm_channel": resourceAwsPinpointGCMChannel(), "aws_pinpoint_sms_channel": resourceAwsPinpointSMSChannel(), + "aws_xray_sampling_rule": resourceAwsXraySamplingRule(), // ALBs are actually LBs because they can be type `network` or `application` // To avoid regressions, we will add a new resource for each and they both point diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index b5c47ef6264..c7c357933ec 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -1,6 +1,10 @@ package aws import ( + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/xray" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" ) @@ -19,13 +23,13 @@ func resourceAwsXraySamplingRule() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, - Required: true, + Optional: true, ValidateFunc: validation.StringLenBetween(1, 128), ConflictsWith: []string{"rule_arn"}, }, "rule_arn": { Type: schema.TypeString, - Required: true, + Optional: true, ConflictsWith: []string{"name"}, }, "resource_arn": { @@ -44,6 +48,10 @@ func resourceAwsXraySamplingRule() *schema.Resource { Type: schema.TypeInt, Required: true, }, + "service_name": { + Type: schema.TypeString, + Required: true, + }, "service_type": { Type: schema.TypeString, Required: true, @@ -81,10 +89,79 @@ func resourceAwsXraySamplingRule() *schema.Resource { } func resourceAwsXraySamplingRuleCreate(d *schema.ResourceData, meta interface{}) error { - return nil + conn := meta.(*AWSClient).xrayconn + samplingRule := &xray.SamplingRule{ + ResourceARN: aws.String(d.Get("resource_arn").(string)), + Priority: aws.Int64(int64(d.Get("priority").(int))), + FixedRate: aws.Float64(d.Get("fixed_rate").(float64)), + ReservoirSize: aws.Int64(int64(d.Get("reservoir_size").(int))), + ServiceName: aws.String(d.Get("service_name").(string)), + ServiceType: aws.String(d.Get("service_type").(string)), + Host: aws.String(d.Get("host").(string)), + HTTPMethod: aws.String(d.Get("http_method").(string)), + URLPath: aws.String(d.Get("url_path").(string)), + Version: aws.Int64(int64(d.Get("version").(int))), + } + + if v, ok := d.GetOk("name"); ok { + samplingRule.RuleName = aws.String(v.(string)) + } else { + samplingRule.RuleARN = aws.String(d.Get("rule_arn").(string)) + } + + if v, ok := d.GetOk("attributes"); ok { + samplingRule.Attributes = stringMapToPointers(v.(map[string]interface{})) + } + + params := &xray.CreateSamplingRuleInput{ + SamplingRule: samplingRule, + } + + out, err := conn.CreateSamplingRule(params) + if err != nil { + return err + } + + d.SetId(*out.SamplingRuleRecord.SamplingRule.RuleName) + + return resourceAwsXraySamplingRuleRead(d, meta) } func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).xrayconn + params := &xray.GetSamplingRulesInput{} + + for { + out, err := conn.GetSamplingRules(params) + log.Printf("[DEBUG] Retrieved Rules: %s", out.SamplingRuleRecords) + if err != nil { + d.SetId("") + return err + } + for _, samplingRuleRecord := range out.SamplingRuleRecords { + sampingRule := samplingRuleRecord.SamplingRule + if aws.StringValue(sampingRule.RuleName) == d.Id() { + d.Set("name", sampingRule.RuleName) + d.Set("rule_arn", sampingRule.RuleARN) + d.Set("resource_arn", sampingRule.ResourceARN) + d.Set("priority", sampingRule.Priority) + d.Set("fixed_rate", sampingRule.FixedRate) + d.Set("reservoir_size", sampingRule.ReservoirSize) + d.Set("service_name", sampingRule.ServiceName) + d.Set("service_type", sampingRule.ServiceType) + d.Set("host", sampingRule.Host) + d.Set("http_method", sampingRule.HTTPMethod) + d.Set("url_path", sampingRule.URLPath) + d.Set("version", sampingRule.Version) + d.Set("attributes", aws.StringValueMap(sampingRule.Attributes)) + break + } + } + if out.NextToken == nil { + break + } + params.NextToken = out.NextToken + } return nil } From 842351176c47dc419545b8f3a3c996e6f4aa647e Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Sun, 5 May 2019 21:50:15 +0100 Subject: [PATCH 04/19] Implements update function for aws_xray_sampling_rule --- aws/resource_aws_xray_sampling_rule.go | 93 +++++++++++++++++--------- 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index c7c357933ec..9d2185d3fc9 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -1,6 +1,7 @@ package aws import ( + "fmt" "log" "github.com/aws/aws-sdk-go/aws" @@ -22,15 +23,10 @@ func resourceAwsXraySamplingRule() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringLenBetween(1, 128), - ConflictsWith: []string{"rule_arn"}, - }, - "rule_arn": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"name"}, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringLenBetween(1, 128), }, "resource_arn": { Type: schema.TypeString, @@ -84,6 +80,10 @@ func resourceAwsXraySamplingRule() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -91,6 +91,7 @@ func resourceAwsXraySamplingRule() *schema.Resource { func resourceAwsXraySamplingRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).xrayconn samplingRule := &xray.SamplingRule{ + RuleName: aws.String(d.Get("name").(string)), ResourceARN: aws.String(d.Get("resource_arn").(string)), Priority: aws.Int64(int64(d.Get("priority").(int))), FixedRate: aws.Float64(d.Get("fixed_rate").(float64)), @@ -103,12 +104,6 @@ func resourceAwsXraySamplingRuleCreate(d *schema.ResourceData, meta interface{}) Version: aws.Int64(int64(d.Get("version").(int))), } - if v, ok := d.GetOk("name"); ok { - samplingRule.RuleName = aws.String(v.(string)) - } else { - samplingRule.RuleARN = aws.String(d.Get("rule_arn").(string)) - } - if v, ok := d.GetOk("attributes"); ok { samplingRule.Attributes = stringMapToPointers(v.(map[string]interface{})) } @@ -139,21 +134,23 @@ func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) e return err } for _, samplingRuleRecord := range out.SamplingRuleRecords { - sampingRule := samplingRuleRecord.SamplingRule - if aws.StringValue(sampingRule.RuleName) == d.Id() { - d.Set("name", sampingRule.RuleName) - d.Set("rule_arn", sampingRule.RuleARN) - d.Set("resource_arn", sampingRule.ResourceARN) - d.Set("priority", sampingRule.Priority) - d.Set("fixed_rate", sampingRule.FixedRate) - d.Set("reservoir_size", sampingRule.ReservoirSize) - d.Set("service_name", sampingRule.ServiceName) - d.Set("service_type", sampingRule.ServiceType) - d.Set("host", sampingRule.Host) - d.Set("http_method", sampingRule.HTTPMethod) - d.Set("url_path", sampingRule.URLPath) - d.Set("version", sampingRule.Version) - d.Set("attributes", aws.StringValueMap(sampingRule.Attributes)) + samplingRule := samplingRuleRecord.SamplingRule + if aws.StringValue(samplingRule.RuleName) == d.Id() { + d.Set("name", samplingRule.RuleName) + d.Set("resource_arn", samplingRule.ResourceARN) + d.Set("priority", samplingRule.Priority) + d.Set("fixed_rate", samplingRule.FixedRate) + d.Set("reservoir_size", samplingRule.ReservoirSize) + d.Set("service_name", samplingRule.ServiceName) + d.Set("service_type", samplingRule.ServiceType) + d.Set("host", samplingRule.Host) + d.Set("http_method", samplingRule.HTTPMethod) + d.Set("url_path", samplingRule.URLPath) + d.Set("version", samplingRule.Version) + d.Set("attributes", aws.StringValueMap(samplingRule.Attributes)) + d.Set("created_at", samplingRuleRecord.CreatedAt) + d.Set("modified_at", samplingRuleRecord.ModifiedAt) + d.Set("arn", samplingRule.RuleARN) break } } @@ -166,6 +163,42 @@ func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) e } func resourceAwsXraySamplingRuleUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).xrayconn + samplingRuleUpdate := &xray.SamplingRuleUpdate{ + RuleName: aws.String(d.Get("name").(string)), + Priority: aws.Int64(int64(d.Get("priority").(int))), + FixedRate: aws.Float64(d.Get("fixed_rate").(float64)), + ReservoirSize: aws.Int64(int64(d.Get("reservoir_size").(int))), + ServiceName: aws.String(d.Get("service_name").(string)), + ServiceType: aws.String(d.Get("service_type").(string)), + Host: aws.String(d.Get("host").(string)), + HTTPMethod: aws.String(d.Get("http_method").(string)), + URLPath: aws.String(d.Get("url_path").(string)), + } + + if d.HasChange("version") { + return fmt.Errorf("Version cannot be modified") + } + + if d.HasChange("attributes") { + attributes := map[string]*string{} + if v, ok := d.GetOk("attributes"); ok { + if m, ok := v.(map[string]interface{}); ok { + attributes = stringMapToPointers(m) + } + } + samplingRuleUpdate.Attributes = attributes + } + + params := &xray.UpdateSamplingRuleInput{ + SamplingRuleUpdate: samplingRuleUpdate, + } + + _, err := conn.UpdateSamplingRule(params) + if err != nil { + return err + } + return resourceAwsXraySamplingRuleRead(d, meta) } From 09f935bbad571cc6a9b30aa98364782a76b05751 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 13:41:33 +0100 Subject: [PATCH 05/19] Adds delete function of resource_aws_xray_sampling_rule --- aws/resource_aws_xray_sampling_rule.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index 9d2185d3fc9..e779dd99bc0 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -165,7 +165,7 @@ func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) e func resourceAwsXraySamplingRuleUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).xrayconn samplingRuleUpdate := &xray.SamplingRuleUpdate{ - RuleName: aws.String(d.Get("name").(string)), + RuleName: aws.String(d.Id()), Priority: aws.Int64(int64(d.Get("priority").(int))), FixedRate: aws.Float64(d.Get("fixed_rate").(float64)), ReservoirSize: aws.Int64(int64(d.Get("reservoir_size").(int))), @@ -203,5 +203,18 @@ func resourceAwsXraySamplingRuleUpdate(d *schema.ResourceData, meta interface{}) } func resourceAwsXraySamplingRuleDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).xrayconn + + log.Printf("[INFO] Deleting XRay Sampling Rule: %s", d.Id()) + + params := &xray.DeleteSamplingRuleInput{ + RuleName: aws.String(d.Id()), + } + _, err := conn.DeleteSamplingRule(params) + if err != nil { + return fmt.Errorf("Error deleting XRay Sampling Rule: %s", d.Id()) + } + return nil + } From fa109ff77c7319b500f5bd57598881eb15557b51 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 17:50:01 +0100 Subject: [PATCH 06/19] Resource XRay Sampling Rule basic tests --- aws/resource_aws_xray_sampling_rule.go | 10 +- aws/resource_aws_xray_sampling_rule_test.go | 113 ++++++++++++++++++++ 2 files changed, 118 insertions(+), 5 deletions(-) create mode 100644 aws/resource_aws_xray_sampling_rule_test.go diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index e779dd99bc0..469b119e418 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -22,7 +22,7 @@ func resourceAwsXraySamplingRule() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "name": { + "rule_name": { Type: schema.TypeString, Optional: true, ForceNew: true, @@ -80,7 +80,7 @@ func resourceAwsXraySamplingRule() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "arn": { + "rule_arn": { Type: schema.TypeString, Computed: true, }, @@ -91,7 +91,7 @@ func resourceAwsXraySamplingRule() *schema.Resource { func resourceAwsXraySamplingRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).xrayconn samplingRule := &xray.SamplingRule{ - RuleName: aws.String(d.Get("name").(string)), + RuleName: aws.String(d.Get("rule_name").(string)), ResourceARN: aws.String(d.Get("resource_arn").(string)), Priority: aws.Int64(int64(d.Get("priority").(int))), FixedRate: aws.Float64(d.Get("fixed_rate").(float64)), @@ -136,7 +136,7 @@ func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) e for _, samplingRuleRecord := range out.SamplingRuleRecords { samplingRule := samplingRuleRecord.SamplingRule if aws.StringValue(samplingRule.RuleName) == d.Id() { - d.Set("name", samplingRule.RuleName) + d.Set("rule_name", samplingRule.RuleName) d.Set("resource_arn", samplingRule.ResourceARN) d.Set("priority", samplingRule.Priority) d.Set("fixed_rate", samplingRule.FixedRate) @@ -150,7 +150,7 @@ func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) e d.Set("attributes", aws.StringValueMap(samplingRule.Attributes)) d.Set("created_at", samplingRuleRecord.CreatedAt) d.Set("modified_at", samplingRuleRecord.ModifiedAt) - d.Set("arn", samplingRule.RuleARN) + d.Set("rule_arn", samplingRule.RuleARN) break } } diff --git a/aws/resource_aws_xray_sampling_rule_test.go b/aws/resource_aws_xray_sampling_rule_test.go new file mode 100644 index 00000000000..420a8b67f5b --- /dev/null +++ b/aws/resource_aws_xray_sampling_rule_test.go @@ -0,0 +1,113 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/xray" + "github.com/hashicorp/terraform/helper/acctest" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" +) + +func TestAccAWSXraySamplingRule_basic(t *testing.T) { + var samplingRule xray.SamplingRule + resourceName := "aws_xray_sampling_rule.test" + rString := acctest.RandString(8) + ruleName := fmt.Sprintf("tf_acc_sampling_rule_%s", rString) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSXraySamplingRule_basic(ruleName, acctest.RandIntRange(0, 9999), acctest.RandIntRange(0, 2147483647)), + Check: resource.ComposeTestCheckFunc( + testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), + testAccCheckResourceAttrRegionalARN(resourceName, "rule_arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), + ), + }, + }, + }) +} + +func testAccAWSXraySamplingRule_basic(ruleName string, priority int, reservoirSize int) string { + return fmt.Sprintf(` +resource "aws_xray_sampling_rule" "test" { + rule_name = "%s" + priority = %d + version = 1 + reservoir_size = %d + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" +} +`, ruleName, priority, reservoirSize) +} + +func testAccCheckXraySamplingRuleExists(n string, samplingRule *xray.SamplingRule) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No XRay Sampling Rule ID is set") + } + + rule, err := getSamplingRule(rs.Primary.ID) + + if err != nil { + return err + } + + *samplingRule = *rule + + return nil + } +} + +func testAccCheckAWSXraySamplingRuleDestroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_xray_sampling_rule" { + continue + } + + _, err := getSamplingRule(rs.Primary.ID) + + if err == nil { + return fmt.Errorf("Expected XRay Sampling Rule to be destroyed, %s found", rs.Primary.ID) + } + } + + return nil +} + +func getSamplingRule(ruleName string) (*xray.SamplingRule, error) { + conn := testAccProvider.Meta().(*AWSClient).xrayconn + params := &xray.GetSamplingRulesInput{} + for { + out, err := conn.GetSamplingRules(params) + if err != nil { + return nil, err + } + for _, samplingRuleRecord := range out.SamplingRuleRecords { + samplingRule := samplingRuleRecord.SamplingRule + if aws.StringValue(samplingRule.RuleName) == ruleName { + return samplingRule, nil + } + } + if out.NextToken == nil { + break + } + params.NextToken = out.NextToken + } + return nil, fmt.Errorf("XRay Sampling Rule: %s not found found", ruleName) +} From cea2f4cdb6ce8beff623f6422f97f983d10c0d2f Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 18:34:09 +0100 Subject: [PATCH 07/19] Includes update and import tests for aws_xray_sampling_rule --- aws/resource_aws_xray_sampling_rule_test.go | 121 +++++++++++++++++--- 1 file changed, 105 insertions(+), 16 deletions(-) diff --git a/aws/resource_aws_xray_sampling_rule_test.go b/aws/resource_aws_xray_sampling_rule_test.go index 420a8b67f5b..acc41639f9e 100644 --- a/aws/resource_aws_xray_sampling_rule_test.go +++ b/aws/resource_aws_xray_sampling_rule_test.go @@ -23,32 +23,82 @@ func TestAccAWSXraySamplingRule_basic(t *testing.T) { CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSXraySamplingRule_basic(ruleName, acctest.RandIntRange(0, 9999), acctest.RandIntRange(0, 2147483647)), + Config: testAccAWSXraySamplingRuleConfig_basic(ruleName), Check: resource.ComposeTestCheckFunc( testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), testAccCheckResourceAttrRegionalARN(resourceName, "rule_arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), + resource.TestCheckResourceAttrSet(resourceName, "priority"), + resource.TestCheckResourceAttrSet(resourceName, "version"), + resource.TestCheckResourceAttrSet(resourceName, "reservoir_size"), + resource.TestCheckResourceAttrSet(resourceName, "url_path"), + resource.TestCheckResourceAttrSet(resourceName, "host"), + resource.TestCheckResourceAttrSet(resourceName, "http_method"), + resource.TestCheckResourceAttrSet(resourceName, "fixed_rate"), + resource.TestCheckResourceAttrSet(resourceName, "resource_arn"), + resource.TestCheckResourceAttrSet(resourceName, "service_name"), + resource.TestCheckResourceAttrSet(resourceName, "service_type"), + resource.TestCheckResourceAttr(resourceName, "attributes.%", "1"), ), }, }, }) } -func testAccAWSXraySamplingRule_basic(ruleName string, priority int, reservoirSize int) string { - return fmt.Sprintf(` -resource "aws_xray_sampling_rule" "test" { - rule_name = "%s" - priority = %d - version = 1 - reservoir_size = %d - url_path = "*" - host = "*" - http_method = "GET" - service_type = "*" - service_name = "*" - fixed_rate = 0.3 - resource_arn = "*" +func TestAccAWSXraySamplingRule_update(t *testing.T) { + var samplingRule xray.SamplingRule + resourceName := "aws_xray_sampling_rule.test" + rString := acctest.RandString(8) + ruleName := fmt.Sprintf("tf_acc_sampling_rule_%s", rString) + updatedPriority := acctest.RandIntRange(0, 9999) + updatedReservoirSize := acctest.RandIntRange(0, 2147483647) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSXraySamplingRuleConfig_update(ruleName, acctest.RandIntRange(0, 9999), acctest.RandIntRange(0, 2147483647)), + Check: resource.ComposeTestCheckFunc( + testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), + testAccCheckResourceAttrRegionalARN(resourceName, "rule_arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), + resource.TestCheckResourceAttr(resourceName, "attributes.%", "0"), + ), + }, + { // Update attributes + Config: testAccAWSXraySamplingRuleConfig_update(ruleName, updatedPriority, updatedReservoirSize), + Check: resource.ComposeTestCheckFunc( + testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), + testAccCheckResourceAttrRegionalARN(resourceName, "rule_arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), + resource.TestCheckResourceAttr(resourceName, "priority", fmt.Sprintf("%d", updatedPriority)), + resource.TestCheckResourceAttr(resourceName, "reservoir_size", fmt.Sprintf("%d", updatedReservoirSize)), + resource.TestCheckResourceAttr(resourceName, "attributes.%", "0"), + ), + }, + }, + }) } -`, ruleName, priority, reservoirSize) + +func TestAccAWSXraySamplingRule_import(t *testing.T) { + resourceName := "aws_xray_sampling_rule.test" + rString := acctest.RandString(8) + ruleName := fmt.Sprintf("tf_acc_sampling_rule_%s", rString) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSIotThingTypeDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSXraySamplingRuleConfig_basic(ruleName), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) } func testAccCheckXraySamplingRuleExists(n string, samplingRule *xray.SamplingRule) resource.TestCheckFunc { @@ -111,3 +161,42 @@ func getSamplingRule(ruleName string) (*xray.SamplingRule, error) { } return nil, fmt.Errorf("XRay Sampling Rule: %s not found found", ruleName) } + +func testAccAWSXraySamplingRuleConfig_basic(ruleName string) string { + return fmt.Sprintf(` +resource "aws_xray_sampling_rule" "test" { + rule_name = "%s" + priority = 5 + version = 1 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + attributes = { + Hello = "World" + } +} +`, ruleName) +} + +func testAccAWSXraySamplingRuleConfig_update(ruleName string, priority int, reservoirSize int) string { + return fmt.Sprintf(` +resource "aws_xray_sampling_rule" "test" { + rule_name = "%s" + priority = %d + version = 1 + reservoir_size = %d + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" +} +`, ruleName, priority, reservoirSize) +} From 024f274ce7aa1f25752be052266a08715bbb48cc Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 18:47:48 +0100 Subject: [PATCH 08/19] Xray sampling rule tests version increment on update --- aws/resource_aws_xray_sampling_rule_test.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/aws/resource_aws_xray_sampling_rule_test.go b/aws/resource_aws_xray_sampling_rule_test.go index acc41639f9e..7128a17f758 100644 --- a/aws/resource_aws_xray_sampling_rule_test.go +++ b/aws/resource_aws_xray_sampling_rule_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -49,6 +50,8 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { resourceName := "aws_xray_sampling_rule.test" rString := acctest.RandString(8) ruleName := fmt.Sprintf("tf_acc_sampling_rule_%s", rString) + initialVersion := acctest.RandIntRange(1, 3) + updatedVersion := initialVersion + 1 updatedPriority := acctest.RandIntRange(0, 9999) updatedReservoirSize := acctest.RandIntRange(0, 2147483647) @@ -58,7 +61,7 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSXraySamplingRuleConfig_update(ruleName, acctest.RandIntRange(0, 9999), acctest.RandIntRange(0, 2147483647)), + Config: testAccAWSXraySamplingRuleConfig_update(ruleName, acctest.RandIntRange(0, 9999), acctest.RandIntRange(0, 2147483647), initialVersion), Check: resource.ComposeTestCheckFunc( testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), testAccCheckResourceAttrRegionalARN(resourceName, "rule_arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), @@ -66,7 +69,7 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { ), }, { // Update attributes - Config: testAccAWSXraySamplingRuleConfig_update(ruleName, updatedPriority, updatedReservoirSize), + Config: testAccAWSXraySamplingRuleConfig_update(ruleName, updatedPriority, updatedReservoirSize, initialVersion), Check: resource.ComposeTestCheckFunc( testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), testAccCheckResourceAttrRegionalARN(resourceName, "rule_arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), @@ -75,6 +78,10 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "attributes.%", "0"), ), }, + { // Increment version + Config: testAccAWSXraySamplingRuleConfig_update(ruleName, updatedPriority, updatedReservoirSize, updatedVersion), + ExpectError: regexp.MustCompile(`Version cannot be modified`), + }, }, }) } @@ -167,7 +174,6 @@ func testAccAWSXraySamplingRuleConfig_basic(ruleName string) string { resource "aws_xray_sampling_rule" "test" { rule_name = "%s" priority = 5 - version = 1 reservoir_size = 10 url_path = "*" host = "*" @@ -176,6 +182,7 @@ resource "aws_xray_sampling_rule" "test" { service_name = "*" fixed_rate = 0.3 resource_arn = "*" + version = 1 attributes = { Hello = "World" } @@ -183,12 +190,11 @@ resource "aws_xray_sampling_rule" "test" { `, ruleName) } -func testAccAWSXraySamplingRuleConfig_update(ruleName string, priority int, reservoirSize int) string { +func testAccAWSXraySamplingRuleConfig_update(ruleName string, priority int, reservoirSize int, version int) string { return fmt.Sprintf(` resource "aws_xray_sampling_rule" "test" { rule_name = "%s" priority = %d - version = 1 reservoir_size = %d url_path = "*" host = "*" @@ -197,6 +203,7 @@ resource "aws_xray_sampling_rule" "test" { service_name = "*" fixed_rate = 0.3 resource_arn = "*" + version = %d } -`, ruleName, priority, reservoirSize) +`, ruleName, priority, reservoirSize, version) } From cd6de394010831dd69d14a213e7ca316aa894fb4 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 19:22:27 +0100 Subject: [PATCH 09/19] XRay resources docs --- website/aws.erb | 9 +++ .../docs/r/xray_sampling_rule.html.markdown | 61 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 website/docs/r/xray_sampling_rule.html.markdown diff --git a/website/aws.erb b/website/aws.erb index 33c096031b7..f82fc2b86e5 100644 --- a/website/aws.erb +++ b/website/aws.erb @@ -2869,6 +2869,15 @@ +
  • + XRay Resources + +
  • + <% end %> diff --git a/website/docs/r/xray_sampling_rule.html.markdown b/website/docs/r/xray_sampling_rule.html.markdown new file mode 100644 index 00000000000..a88f133afcc --- /dev/null +++ b/website/docs/r/xray_sampling_rule.html.markdown @@ -0,0 +1,61 @@ +--- +layout: "aws" +page_title: "AWS: aws_xray_sampling_rule" +sidebar_current: "docs-aws-resource-xray-sampling-rule" +description: |- + Creates and manages an AWS XRay Sampling Rule. +--- + +# Resource: aws_xray_sampling_rule + +Creates and manages an AWS XRay Sampling Rule. + +## Example Usage + +```hcl +resource "aws_xray_sampling_rule" "example" { + rule_name = "example" + priority = 10000 + version = 1 + reservoir_size = 1 + fixed_rate = 0.05, + url_path = "*" + host = "*" + http_method = "*" + service_type = "*" + service_name = "*" + resource_arn = "*" + attributes = { + Hello = "Tris" + } +} +``` + +## Argument Reference + +* `rule_name` - (Required) The name of the sampling rule. +* `resource_arn` - (Required) Matches the ARN of the AWS resource on which the service runs. +* `priority` - (Required) The priority of the sampling rule. +* `fixed_rate` - (Required) The percentage of matching requests to instrument, after the reservoir is exhausted. +* `reservoir_size` - (Required) A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively. +* `service_name` - (Required) Matches the `name` that the service uses to identify itself in segments. +* `service_type` - (Required) Matches the `origin` that the service uses to identify its type in segments. +* `host` - (Required) Matches the hostname from a request URL. +* `http_method` - (Required) Matches the HTTP method of a request. +* `url_path` - (Required) Matches the path from a request URL. +* `version` - (Required) The version of the sampling rule format (`1` ) +* `attributes` - (Optional) Matches attributes derived from the request. + +## Attributes Reference + +In addition to the arguments above, the following attributes are exported: + +* `rule_arn` - The ARN of the sampling rule. + +## Import + +XRay Sampling Rules can be imported using the name, e.g. + +``` +$ terraform import aws_xray_sampling_rule.example example +``` From 8c8e0e8b3775a0afb1e402e3cf9d3eb5947a2000 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 19:33:09 +0100 Subject: [PATCH 10/19] Xray sampling rule initial version to be 1 in acceptance tests --- aws/resource_aws_xray_sampling_rule_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_xray_sampling_rule_test.go b/aws/resource_aws_xray_sampling_rule_test.go index 7128a17f758..693b4c0fd6c 100644 --- a/aws/resource_aws_xray_sampling_rule_test.go +++ b/aws/resource_aws_xray_sampling_rule_test.go @@ -50,7 +50,7 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { resourceName := "aws_xray_sampling_rule.test" rString := acctest.RandString(8) ruleName := fmt.Sprintf("tf_acc_sampling_rule_%s", rString) - initialVersion := acctest.RandIntRange(1, 3) + initialVersion := 1 updatedVersion := initialVersion + 1 updatedPriority := acctest.RandIntRange(0, 9999) updatedReservoirSize := acctest.RandIntRange(0, 2147483647) From e5f9b47777fadb47986a192c379907d3d676993f Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 19:43:58 +0100 Subject: [PATCH 11/19] Adds Xray service in vendor dir --- vendor/modules.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/vendor/modules.txt b/vendor/modules.txt index 610b94c7e5d..75753d11463 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -137,6 +137,7 @@ github.com/aws/aws-sdk-go/service/waf github.com/aws/aws-sdk-go/service/wafregional github.com/aws/aws-sdk-go/service/worklink github.com/aws/aws-sdk-go/service/workspaces +github.com/aws/aws-sdk-go/service/xray github.com/aws/aws-sdk-go/aws/credentials github.com/aws/aws-sdk-go/internal/sdkio github.com/aws/aws-sdk-go/aws/client/metadata From b549d8d61a59f5f332aa3b0047f5a90534a44851 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 19:56:01 +0100 Subject: [PATCH 12/19] Remove timestamp attributes from aws_xray_sampling_rules --- aws/resource_aws_xray_sampling_rule.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index 469b119e418..babff5a6390 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -72,14 +72,6 @@ func resourceAwsXraySamplingRule() *schema.Resource { Type: schema.TypeMap, Optional: true, }, - "created_at": { - Type: schema.TypeString, - Computed: true, - }, - "modified_at": { - Type: schema.TypeString, - Computed: true, - }, "rule_arn": { Type: schema.TypeString, Computed: true, From c909e8b4f03c5b3538c9c339e2f596314639054b Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 20:08:02 +0100 Subject: [PATCH 13/19] Adds xray service vendor --- .../aws/aws-sdk-go/service/xray/api.go | 5837 +++++++++++++++++ .../aws/aws-sdk-go/service/xray/doc.go | 29 + .../aws/aws-sdk-go/service/xray/errors.go | 24 + .../aws/aws-sdk-go/service/xray/service.go | 95 + 4 files changed, 5985 insertions(+) create mode 100644 vendor/github.com/aws/aws-sdk-go/service/xray/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/xray/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/xray/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/xray/service.go diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/api.go b/vendor/github.com/aws/aws-sdk-go/service/xray/api.go new file mode 100644 index 00000000000..592de2f7b56 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/xray/api.go @@ -0,0 +1,5837 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package xray + +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/restjson" +) + +const opBatchGetTraces = "BatchGetTraces" + +// BatchGetTracesRequest generates a "aws/request.Request" representing the +// client's request for the BatchGetTraces operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See BatchGetTraces for more information on using the BatchGetTraces +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the BatchGetTracesRequest method. +// req, resp := client.BatchGetTracesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTraces +func (c *XRay) BatchGetTracesRequest(input *BatchGetTracesInput) (req *request.Request, output *BatchGetTracesOutput) { + op := &request.Operation{ + Name: opBatchGetTraces, + HTTPMethod: "POST", + HTTPPath: "/Traces", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &BatchGetTracesInput{} + } + + output = &BatchGetTracesOutput{} + req = c.newRequest(op, input, output) + return +} + +// BatchGetTraces API operation for AWS X-Ray. +// +// Retrieves a list of traces specified by ID. Each trace is a collection of +// segment documents that originates from a single request. Use GetTraceSummaries +// to get a list of trace IDs. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation BatchGetTraces for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTraces +func (c *XRay) BatchGetTraces(input *BatchGetTracesInput) (*BatchGetTracesOutput, error) { + req, out := c.BatchGetTracesRequest(input) + return out, req.Send() +} + +// BatchGetTracesWithContext is the same as BatchGetTraces with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetTraces for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) BatchGetTracesWithContext(ctx aws.Context, input *BatchGetTracesInput, opts ...request.Option) (*BatchGetTracesOutput, error) { + req, out := c.BatchGetTracesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// BatchGetTracesPages iterates over the pages of a BatchGetTraces operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See BatchGetTraces method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a BatchGetTraces operation. +// pageNum := 0 +// err := client.BatchGetTracesPages(params, +// func(page *BatchGetTracesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *XRay) BatchGetTracesPages(input *BatchGetTracesInput, fn func(*BatchGetTracesOutput, bool) bool) error { + return c.BatchGetTracesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// BatchGetTracesPagesWithContext same as BatchGetTracesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) BatchGetTracesPagesWithContext(ctx aws.Context, input *BatchGetTracesInput, fn func(*BatchGetTracesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *BatchGetTracesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.BatchGetTracesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*BatchGetTracesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opCreateGroup = "CreateGroup" + +// CreateGroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateGroup for more information on using the CreateGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateGroupRequest method. +// req, resp := client.CreateGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateGroup +func (c *XRay) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput) { + op := &request.Operation{ + Name: opCreateGroup, + HTTPMethod: "POST", + HTTPPath: "/CreateGroup", + } + + if input == nil { + input = &CreateGroupInput{} + } + + output = &CreateGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateGroup API operation for AWS X-Ray. +// +// Creates a group resource with a name and a filter expression. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation CreateGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateGroup +func (c *XRay) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) + 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 *XRay) 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 opCreateSamplingRule = "CreateSamplingRule" + +// CreateSamplingRuleRequest generates a "aws/request.Request" representing the +// client's request for the CreateSamplingRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateSamplingRule for more information on using the CreateSamplingRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateSamplingRuleRequest method. +// req, resp := client.CreateSamplingRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateSamplingRule +func (c *XRay) CreateSamplingRuleRequest(input *CreateSamplingRuleInput) (req *request.Request, output *CreateSamplingRuleOutput) { + op := &request.Operation{ + Name: opCreateSamplingRule, + HTTPMethod: "POST", + HTTPPath: "/CreateSamplingRule", + } + + if input == nil { + input = &CreateSamplingRuleInput{} + } + + output = &CreateSamplingRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateSamplingRule API operation for AWS X-Ray. +// +// Creates a rule to control sampling behavior for instrumented applications. +// Services retrieve rules with GetSamplingRules, and evaluate each rule in +// ascending order of priority for each request. If a rule matches, the service +// records a trace, borrowing it from the reservoir size. After 10 seconds, +// the service reports back to X-Ray with GetSamplingTargets to get updated +// versions of each in-use rule. The updated rule contains a trace quota that +// the service can use instead of borrowing from the reservoir. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation CreateSamplingRule for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// * ErrCodeRuleLimitExceededException "RuleLimitExceededException" +// You have reached the maximum number of sampling rules. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateSamplingRule +func (c *XRay) CreateSamplingRule(input *CreateSamplingRuleInput) (*CreateSamplingRuleOutput, error) { + req, out := c.CreateSamplingRuleRequest(input) + return out, req.Send() +} + +// CreateSamplingRuleWithContext is the same as CreateSamplingRule with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSamplingRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) CreateSamplingRuleWithContext(ctx aws.Context, input *CreateSamplingRuleInput, opts ...request.Option) (*CreateSamplingRuleOutput, error) { + req, out := c.CreateSamplingRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteGroup = "DeleteGroup" + +// DeleteGroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteGroup for more information on using the DeleteGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteGroupRequest method. +// req, resp := client.DeleteGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteGroup +func (c *XRay) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) { + op := &request.Operation{ + Name: opDeleteGroup, + HTTPMethod: "POST", + HTTPPath: "/DeleteGroup", + } + + if input == nil { + input = &DeleteGroupInput{} + } + + output = &DeleteGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteGroup API operation for AWS X-Ray. +// +// Deletes a group resource. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation DeleteGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteGroup +func (c *XRay) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) + 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 *XRay) 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 opDeleteSamplingRule = "DeleteSamplingRule" + +// DeleteSamplingRuleRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSamplingRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteSamplingRule for more information on using the DeleteSamplingRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteSamplingRuleRequest method. +// req, resp := client.DeleteSamplingRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteSamplingRule +func (c *XRay) DeleteSamplingRuleRequest(input *DeleteSamplingRuleInput) (req *request.Request, output *DeleteSamplingRuleOutput) { + op := &request.Operation{ + Name: opDeleteSamplingRule, + HTTPMethod: "POST", + HTTPPath: "/DeleteSamplingRule", + } + + if input == nil { + input = &DeleteSamplingRuleInput{} + } + + output = &DeleteSamplingRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteSamplingRule API operation for AWS X-Ray. +// +// Deletes a sampling rule. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation DeleteSamplingRule for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteSamplingRule +func (c *XRay) DeleteSamplingRule(input *DeleteSamplingRuleInput) (*DeleteSamplingRuleOutput, error) { + req, out := c.DeleteSamplingRuleRequest(input) + return out, req.Send() +} + +// DeleteSamplingRuleWithContext is the same as DeleteSamplingRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSamplingRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) DeleteSamplingRuleWithContext(ctx aws.Context, input *DeleteSamplingRuleInput, opts ...request.Option) (*DeleteSamplingRuleOutput, error) { + req, out := c.DeleteSamplingRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetEncryptionConfig = "GetEncryptionConfig" + +// GetEncryptionConfigRequest generates a "aws/request.Request" representing the +// client's request for the GetEncryptionConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetEncryptionConfig for more information on using the GetEncryptionConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetEncryptionConfigRequest method. +// req, resp := client.GetEncryptionConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetEncryptionConfig +func (c *XRay) GetEncryptionConfigRequest(input *GetEncryptionConfigInput) (req *request.Request, output *GetEncryptionConfigOutput) { + op := &request.Operation{ + Name: opGetEncryptionConfig, + HTTPMethod: "POST", + HTTPPath: "/EncryptionConfig", + } + + if input == nil { + input = &GetEncryptionConfigInput{} + } + + output = &GetEncryptionConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetEncryptionConfig API operation for AWS X-Ray. +// +// Retrieves the current encryption configuration for X-Ray data. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation GetEncryptionConfig for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetEncryptionConfig +func (c *XRay) GetEncryptionConfig(input *GetEncryptionConfigInput) (*GetEncryptionConfigOutput, error) { + req, out := c.GetEncryptionConfigRequest(input) + return out, req.Send() +} + +// GetEncryptionConfigWithContext is the same as GetEncryptionConfig with the addition of +// the ability to pass a context and additional request options. +// +// See GetEncryptionConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetEncryptionConfigWithContext(ctx aws.Context, input *GetEncryptionConfigInput, opts ...request.Option) (*GetEncryptionConfigOutput, error) { + req, out := c.GetEncryptionConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetGroup = "GetGroup" + +// GetGroupRequest generates a "aws/request.Request" representing the +// client's request for the GetGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGroup for more information on using the GetGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGroupRequest method. +// req, resp := client.GetGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroup +func (c *XRay) GetGroupRequest(input *GetGroupInput) (req *request.Request, output *GetGroupOutput) { + op := &request.Operation{ + Name: opGetGroup, + HTTPMethod: "POST", + HTTPPath: "/GetGroup", + } + + if input == nil { + input = &GetGroupInput{} + } + + output = &GetGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGroup API operation for AWS X-Ray. +// +// Retrieves group resource details. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation GetGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroup +func (c *XRay) GetGroup(input *GetGroupInput) (*GetGroupOutput, error) { + req, out := c.GetGroupRequest(input) + 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 *XRay) 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() +} + +const opGetGroups = "GetGroups" + +// GetGroupsRequest generates a "aws/request.Request" representing the +// client's request for the GetGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGroups for more information on using the GetGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGroupsRequest method. +// req, resp := client.GetGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroups +func (c *XRay) GetGroupsRequest(input *GetGroupsInput) (req *request.Request, output *GetGroupsOutput) { + op := &request.Operation{ + Name: opGetGroups, + HTTPMethod: "POST", + HTTPPath: "/Groups", + } + + if input == nil { + input = &GetGroupsInput{} + } + + output = &GetGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGroups API operation for AWS X-Ray. +// +// Retrieves all active group details. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation GetGroups for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroups +func (c *XRay) GetGroups(input *GetGroupsInput) (*GetGroupsOutput, error) { + req, out := c.GetGroupsRequest(input) + return out, req.Send() +} + +// GetGroupsWithContext is the same as GetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetGroupsWithContext(ctx aws.Context, input *GetGroupsInput, opts ...request.Option) (*GetGroupsOutput, error) { + req, out := c.GetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetSamplingRules = "GetSamplingRules" + +// GetSamplingRulesRequest generates a "aws/request.Request" representing the +// client's request for the GetSamplingRules operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetSamplingRules for more information on using the GetSamplingRules +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetSamplingRulesRequest method. +// req, resp := client.GetSamplingRulesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingRules +func (c *XRay) GetSamplingRulesRequest(input *GetSamplingRulesInput) (req *request.Request, output *GetSamplingRulesOutput) { + op := &request.Operation{ + Name: opGetSamplingRules, + HTTPMethod: "POST", + HTTPPath: "/GetSamplingRules", + } + + if input == nil { + input = &GetSamplingRulesInput{} + } + + output = &GetSamplingRulesOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetSamplingRules API operation for AWS X-Ray. +// +// Retrieves all sampling rules. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation GetSamplingRules for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingRules +func (c *XRay) GetSamplingRules(input *GetSamplingRulesInput) (*GetSamplingRulesOutput, error) { + req, out := c.GetSamplingRulesRequest(input) + return out, req.Send() +} + +// GetSamplingRulesWithContext is the same as GetSamplingRules with the addition of +// the ability to pass a context and additional request options. +// +// See GetSamplingRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetSamplingRulesWithContext(ctx aws.Context, input *GetSamplingRulesInput, opts ...request.Option) (*GetSamplingRulesOutput, error) { + req, out := c.GetSamplingRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetSamplingStatisticSummaries = "GetSamplingStatisticSummaries" + +// GetSamplingStatisticSummariesRequest generates a "aws/request.Request" representing the +// client's request for the GetSamplingStatisticSummaries operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetSamplingStatisticSummaries for more information on using the GetSamplingStatisticSummaries +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetSamplingStatisticSummariesRequest method. +// req, resp := client.GetSamplingStatisticSummariesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingStatisticSummaries +func (c *XRay) GetSamplingStatisticSummariesRequest(input *GetSamplingStatisticSummariesInput) (req *request.Request, output *GetSamplingStatisticSummariesOutput) { + op := &request.Operation{ + Name: opGetSamplingStatisticSummaries, + HTTPMethod: "POST", + HTTPPath: "/SamplingStatisticSummaries", + } + + if input == nil { + input = &GetSamplingStatisticSummariesInput{} + } + + output = &GetSamplingStatisticSummariesOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetSamplingStatisticSummaries API operation for AWS X-Ray. +// +// Retrieves information about recent sampling results for all sampling rules. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation GetSamplingStatisticSummaries for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingStatisticSummaries +func (c *XRay) GetSamplingStatisticSummaries(input *GetSamplingStatisticSummariesInput) (*GetSamplingStatisticSummariesOutput, error) { + req, out := c.GetSamplingStatisticSummariesRequest(input) + return out, req.Send() +} + +// GetSamplingStatisticSummariesWithContext is the same as GetSamplingStatisticSummaries with the addition of +// the ability to pass a context and additional request options. +// +// See GetSamplingStatisticSummaries for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetSamplingStatisticSummariesWithContext(ctx aws.Context, input *GetSamplingStatisticSummariesInput, opts ...request.Option) (*GetSamplingStatisticSummariesOutput, error) { + req, out := c.GetSamplingStatisticSummariesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetSamplingTargets = "GetSamplingTargets" + +// GetSamplingTargetsRequest generates a "aws/request.Request" representing the +// client's request for the GetSamplingTargets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetSamplingTargets for more information on using the GetSamplingTargets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetSamplingTargetsRequest method. +// req, resp := client.GetSamplingTargetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingTargets +func (c *XRay) GetSamplingTargetsRequest(input *GetSamplingTargetsInput) (req *request.Request, output *GetSamplingTargetsOutput) { + op := &request.Operation{ + Name: opGetSamplingTargets, + HTTPMethod: "POST", + HTTPPath: "/SamplingTargets", + } + + if input == nil { + input = &GetSamplingTargetsInput{} + } + + output = &GetSamplingTargetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetSamplingTargets API operation for AWS X-Ray. +// +// Requests a sampling quota for rules that the service is using to sample requests. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation GetSamplingTargets for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingTargets +func (c *XRay) GetSamplingTargets(input *GetSamplingTargetsInput) (*GetSamplingTargetsOutput, error) { + req, out := c.GetSamplingTargetsRequest(input) + return out, req.Send() +} + +// GetSamplingTargetsWithContext is the same as GetSamplingTargets with the addition of +// the ability to pass a context and additional request options. +// +// See GetSamplingTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetSamplingTargetsWithContext(ctx aws.Context, input *GetSamplingTargetsInput, opts ...request.Option) (*GetSamplingTargetsOutput, error) { + req, out := c.GetSamplingTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetServiceGraph = "GetServiceGraph" + +// GetServiceGraphRequest generates a "aws/request.Request" representing the +// client's request for the GetServiceGraph operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetServiceGraph for more information on using the GetServiceGraph +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetServiceGraphRequest method. +// req, resp := client.GetServiceGraphRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetServiceGraph +func (c *XRay) GetServiceGraphRequest(input *GetServiceGraphInput) (req *request.Request, output *GetServiceGraphOutput) { + op := &request.Operation{ + Name: opGetServiceGraph, + HTTPMethod: "POST", + HTTPPath: "/ServiceGraph", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &GetServiceGraphInput{} + } + + output = &GetServiceGraphOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetServiceGraph API operation for AWS X-Ray. +// +// Retrieves a document that describes services that process incoming requests, +// and downstream services that they call as a result. Root services process +// incoming requests and make calls to downstream services. Root services are +// applications that use the AWS X-Ray SDK. Downstream services can be other +// applications, AWS resources, HTTP web APIs, or SQL databases. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation GetServiceGraph for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetServiceGraph +func (c *XRay) GetServiceGraph(input *GetServiceGraphInput) (*GetServiceGraphOutput, error) { + req, out := c.GetServiceGraphRequest(input) + return out, req.Send() +} + +// GetServiceGraphWithContext is the same as GetServiceGraph with the addition of +// the ability to pass a context and additional request options. +// +// See GetServiceGraph for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetServiceGraphWithContext(ctx aws.Context, input *GetServiceGraphInput, opts ...request.Option) (*GetServiceGraphOutput, error) { + req, out := c.GetServiceGraphRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// GetServiceGraphPages iterates over the pages of a GetServiceGraph operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetServiceGraph method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetServiceGraph operation. +// pageNum := 0 +// err := client.GetServiceGraphPages(params, +// func(page *GetServiceGraphOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *XRay) GetServiceGraphPages(input *GetServiceGraphInput, fn func(*GetServiceGraphOutput, bool) bool) error { + return c.GetServiceGraphPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetServiceGraphPagesWithContext same as GetServiceGraphPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetServiceGraphPagesWithContext(ctx aws.Context, input *GetServiceGraphInput, fn func(*GetServiceGraphOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetServiceGraphInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetServiceGraphRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetServiceGraphOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opGetTraceGraph = "GetTraceGraph" + +// GetTraceGraphRequest generates a "aws/request.Request" representing the +// client's request for the GetTraceGraph operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetTraceGraph for more information on using the GetTraceGraph +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetTraceGraphRequest method. +// req, resp := client.GetTraceGraphRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceGraph +func (c *XRay) GetTraceGraphRequest(input *GetTraceGraphInput) (req *request.Request, output *GetTraceGraphOutput) { + op := &request.Operation{ + Name: opGetTraceGraph, + HTTPMethod: "POST", + HTTPPath: "/TraceGraph", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &GetTraceGraphInput{} + } + + output = &GetTraceGraphOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetTraceGraph API operation for AWS X-Ray. +// +// Retrieves a service graph for one or more specific trace IDs. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation GetTraceGraph for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceGraph +func (c *XRay) GetTraceGraph(input *GetTraceGraphInput) (*GetTraceGraphOutput, error) { + req, out := c.GetTraceGraphRequest(input) + return out, req.Send() +} + +// GetTraceGraphWithContext is the same as GetTraceGraph with the addition of +// the ability to pass a context and additional request options. +// +// See GetTraceGraph for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetTraceGraphWithContext(ctx aws.Context, input *GetTraceGraphInput, opts ...request.Option) (*GetTraceGraphOutput, error) { + req, out := c.GetTraceGraphRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// GetTraceGraphPages iterates over the pages of a GetTraceGraph operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTraceGraph method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetTraceGraph operation. +// pageNum := 0 +// err := client.GetTraceGraphPages(params, +// func(page *GetTraceGraphOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *XRay) GetTraceGraphPages(input *GetTraceGraphInput, fn func(*GetTraceGraphOutput, bool) bool) error { + return c.GetTraceGraphPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTraceGraphPagesWithContext same as GetTraceGraphPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetTraceGraphPagesWithContext(ctx aws.Context, input *GetTraceGraphInput, fn func(*GetTraceGraphOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTraceGraphInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTraceGraphRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetTraceGraphOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opGetTraceSummaries = "GetTraceSummaries" + +// GetTraceSummariesRequest generates a "aws/request.Request" representing the +// client's request for the GetTraceSummaries operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetTraceSummaries for more information on using the GetTraceSummaries +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetTraceSummariesRequest method. +// req, resp := client.GetTraceSummariesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceSummaries +func (c *XRay) GetTraceSummariesRequest(input *GetTraceSummariesInput) (req *request.Request, output *GetTraceSummariesOutput) { + op := &request.Operation{ + Name: opGetTraceSummaries, + HTTPMethod: "POST", + HTTPPath: "/TraceSummaries", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &GetTraceSummariesInput{} + } + + output = &GetTraceSummariesOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetTraceSummaries API operation for AWS X-Ray. +// +// Retrieves IDs and metadata for traces available for a specified time frame +// using an optional filter. To get the full traces, pass the trace IDs to BatchGetTraces. +// +// A filter expression can target traced requests that hit specific service +// nodes or edges, have errors, or come from a known user. For example, the +// following filter expression targets traces that pass through api.example.com: +// +// service("api.example.com") +// +// This filter expression finds traces that have an annotation named account +// with the value 12345: +// +// annotation.account = "12345" +// +// For a full list of indexed fields and keywords that you can use in filter +// expressions, see Using Filter Expressions (http://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html) +// in the AWS X-Ray Developer Guide. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation GetTraceSummaries for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceSummaries +func (c *XRay) GetTraceSummaries(input *GetTraceSummariesInput) (*GetTraceSummariesOutput, error) { + req, out := c.GetTraceSummariesRequest(input) + return out, req.Send() +} + +// GetTraceSummariesWithContext is the same as GetTraceSummaries with the addition of +// the ability to pass a context and additional request options. +// +// See GetTraceSummaries for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetTraceSummariesWithContext(ctx aws.Context, input *GetTraceSummariesInput, opts ...request.Option) (*GetTraceSummariesOutput, error) { + req, out := c.GetTraceSummariesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// GetTraceSummariesPages iterates over the pages of a GetTraceSummaries operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTraceSummaries method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetTraceSummaries operation. +// pageNum := 0 +// err := client.GetTraceSummariesPages(params, +// func(page *GetTraceSummariesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *XRay) GetTraceSummariesPages(input *GetTraceSummariesInput, fn func(*GetTraceSummariesOutput, bool) bool) error { + return c.GetTraceSummariesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTraceSummariesPagesWithContext same as GetTraceSummariesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) GetTraceSummariesPagesWithContext(ctx aws.Context, input *GetTraceSummariesInput, fn func(*GetTraceSummariesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTraceSummariesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTraceSummariesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetTraceSummariesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opPutEncryptionConfig = "PutEncryptionConfig" + +// PutEncryptionConfigRequest generates a "aws/request.Request" representing the +// client's request for the PutEncryptionConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutEncryptionConfig for more information on using the PutEncryptionConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutEncryptionConfigRequest method. +// req, resp := client.PutEncryptionConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutEncryptionConfig +func (c *XRay) PutEncryptionConfigRequest(input *PutEncryptionConfigInput) (req *request.Request, output *PutEncryptionConfigOutput) { + op := &request.Operation{ + Name: opPutEncryptionConfig, + HTTPMethod: "POST", + HTTPPath: "/PutEncryptionConfig", + } + + if input == nil { + input = &PutEncryptionConfigInput{} + } + + output = &PutEncryptionConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutEncryptionConfig API operation for AWS X-Ray. +// +// Updates the encryption configuration for X-Ray data. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation PutEncryptionConfig for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutEncryptionConfig +func (c *XRay) PutEncryptionConfig(input *PutEncryptionConfigInput) (*PutEncryptionConfigOutput, error) { + req, out := c.PutEncryptionConfigRequest(input) + return out, req.Send() +} + +// PutEncryptionConfigWithContext is the same as PutEncryptionConfig with the addition of +// the ability to pass a context and additional request options. +// +// See PutEncryptionConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) PutEncryptionConfigWithContext(ctx aws.Context, input *PutEncryptionConfigInput, opts ...request.Option) (*PutEncryptionConfigOutput, error) { + req, out := c.PutEncryptionConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutTelemetryRecords = "PutTelemetryRecords" + +// PutTelemetryRecordsRequest generates a "aws/request.Request" representing the +// client's request for the PutTelemetryRecords operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutTelemetryRecords for more information on using the PutTelemetryRecords +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutTelemetryRecordsRequest method. +// req, resp := client.PutTelemetryRecordsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTelemetryRecords +func (c *XRay) PutTelemetryRecordsRequest(input *PutTelemetryRecordsInput) (req *request.Request, output *PutTelemetryRecordsOutput) { + op := &request.Operation{ + Name: opPutTelemetryRecords, + HTTPMethod: "POST", + HTTPPath: "/TelemetryRecords", + } + + if input == nil { + input = &PutTelemetryRecordsInput{} + } + + output = &PutTelemetryRecordsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutTelemetryRecords API operation for AWS X-Ray. +// +// Used by the AWS X-Ray daemon to upload telemetry. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation PutTelemetryRecords for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTelemetryRecords +func (c *XRay) PutTelemetryRecords(input *PutTelemetryRecordsInput) (*PutTelemetryRecordsOutput, error) { + req, out := c.PutTelemetryRecordsRequest(input) + return out, req.Send() +} + +// PutTelemetryRecordsWithContext is the same as PutTelemetryRecords with the addition of +// the ability to pass a context and additional request options. +// +// See PutTelemetryRecords for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) PutTelemetryRecordsWithContext(ctx aws.Context, input *PutTelemetryRecordsInput, opts ...request.Option) (*PutTelemetryRecordsOutput, error) { + req, out := c.PutTelemetryRecordsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutTraceSegments = "PutTraceSegments" + +// PutTraceSegmentsRequest generates a "aws/request.Request" representing the +// client's request for the PutTraceSegments operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutTraceSegments for more information on using the PutTraceSegments +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutTraceSegmentsRequest method. +// req, resp := client.PutTraceSegmentsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTraceSegments +func (c *XRay) PutTraceSegmentsRequest(input *PutTraceSegmentsInput) (req *request.Request, output *PutTraceSegmentsOutput) { + op := &request.Operation{ + Name: opPutTraceSegments, + HTTPMethod: "POST", + HTTPPath: "/TraceSegments", + } + + if input == nil { + input = &PutTraceSegmentsInput{} + } + + output = &PutTraceSegmentsOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutTraceSegments API operation for AWS X-Ray. +// +// Uploads segment documents to AWS X-Ray. The X-Ray SDK generates segment documents +// and sends them to the X-Ray daemon, which uploads them in batches. A segment +// document can be a completed segment, an in-progress segment, or an array +// of subsegments. +// +// Segments must include the following fields. For the full segment document +// schema, see AWS X-Ray Segment Documents (https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html) +// in the AWS X-Ray Developer Guide. +// +// Required Segment Document Fields +// +// * name - The name of the service that handled the request. +// +// * id - A 64-bit identifier for the segment, unique among segments in the +// same trace, in 16 hexadecimal digits. +// +// * trace_id - A unique identifier that connects all segments and subsegments +// originating from a single client request. +// +// * start_time - Time the segment or subsegment was created, in floating +// point seconds in epoch time, accurate to milliseconds. For example, 1480615200.010 +// or 1.480615200010E9. +// +// * end_time - Time the segment or subsegment was closed. For example, 1480615200.090 +// or 1.480615200090E9. Specify either an end_time or in_progress. +// +// * in_progress - Set to true instead of specifying an end_time to record +// that a segment has been started, but is not complete. Send an in progress +// segment when your application receives a request that will take a long +// time to serve, to trace the fact that the request was received. When the +// response is sent, send the complete segment to overwrite the in-progress +// segment. +// +// A trace_id consists of three numbers separated by hyphens. For example, 1-58406520-a006649127e371903a2de979. +// This includes: +// +// Trace ID Format +// +// * The version number, i.e. 1. +// +// * The time of the original request, in Unix epoch time, in 8 hexadecimal +// digits. For example, 10:00AM December 2nd, 2016 PST in epoch time is 1480615200 +// seconds, or 58406520 in hexadecimal. +// +// * A 96-bit identifier for the trace, globally unique, in 24 hexadecimal +// digits. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation PutTraceSegments for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTraceSegments +func (c *XRay) PutTraceSegments(input *PutTraceSegmentsInput) (*PutTraceSegmentsOutput, error) { + req, out := c.PutTraceSegmentsRequest(input) + return out, req.Send() +} + +// PutTraceSegmentsWithContext is the same as PutTraceSegments with the addition of +// the ability to pass a context and additional request options. +// +// See PutTraceSegments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) PutTraceSegmentsWithContext(ctx aws.Context, input *PutTraceSegmentsInput, opts ...request.Option) (*PutTraceSegmentsOutput, error) { + req, out := c.PutTraceSegmentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateGroup = "UpdateGroup" + +// UpdateGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateGroup for more information on using the UpdateGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateGroupRequest method. +// req, resp := client.UpdateGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateGroup +func (c *XRay) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, output *UpdateGroupOutput) { + op := &request.Operation{ + Name: opUpdateGroup, + HTTPMethod: "POST", + HTTPPath: "/UpdateGroup", + } + + if input == nil { + input = &UpdateGroupInput{} + } + + output = &UpdateGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateGroup API operation for AWS X-Ray. +// +// Updates a group resource. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation UpdateGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateGroup +func (c *XRay) UpdateGroup(input *UpdateGroupInput) (*UpdateGroupOutput, error) { + req, out := c.UpdateGroupRequest(input) + 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 *XRay) 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 opUpdateSamplingRule = "UpdateSamplingRule" + +// UpdateSamplingRuleRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSamplingRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSamplingRule for more information on using the UpdateSamplingRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSamplingRuleRequest method. +// req, resp := client.UpdateSamplingRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateSamplingRule +func (c *XRay) UpdateSamplingRuleRequest(input *UpdateSamplingRuleInput) (req *request.Request, output *UpdateSamplingRuleOutput) { + op := &request.Operation{ + Name: opUpdateSamplingRule, + HTTPMethod: "POST", + HTTPPath: "/UpdateSamplingRule", + } + + if input == nil { + input = &UpdateSamplingRuleInput{} + } + + output = &UpdateSamplingRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateSamplingRule API operation for AWS X-Ray. +// +// Modifies a sampling rule's configuration. +// +// 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. +// +// See the AWS API reference guide for AWS X-Ray's +// API operation UpdateSamplingRule for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is missing required parameters or has invalid parameters. +// +// * ErrCodeThrottledException "ThrottledException" +// The request exceeds the maximum number of requests per second. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateSamplingRule +func (c *XRay) UpdateSamplingRule(input *UpdateSamplingRuleInput) (*UpdateSamplingRuleOutput, error) { + req, out := c.UpdateSamplingRuleRequest(input) + return out, req.Send() +} + +// UpdateSamplingRuleWithContext is the same as UpdateSamplingRule with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSamplingRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *XRay) UpdateSamplingRuleWithContext(ctx aws.Context, input *UpdateSamplingRuleInput, opts ...request.Option) (*UpdateSamplingRuleOutput, error) { + req, out := c.UpdateSamplingRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// An alias for an edge. +type Alias struct { + _ struct{} `type:"structure"` + + // The canonical name of the alias. + Name *string `type:"string"` + + // A list of names for the alias, including the canonical name. + Names []*string `type:"list"` + + // The type of the alias. + Type *string `type:"string"` +} + +// String returns the string representation +func (s Alias) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Alias) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *Alias) SetName(v string) *Alias { + s.Name = &v + return s +} + +// SetNames sets the Names field's value. +func (s *Alias) SetNames(v []*string) *Alias { + s.Names = v + return s +} + +// SetType sets the Type field's value. +func (s *Alias) SetType(v string) *Alias { + s.Type = &v + return s +} + +// Value of a segment annotation. Has one of three value types: Number, Boolean +// or String. +type AnnotationValue struct { + _ struct{} `type:"structure"` + + // Value for a Boolean annotation. + BooleanValue *bool `type:"boolean"` + + // Value for a Number annotation. + NumberValue *float64 `type:"double"` + + // Value for a String annotation. + StringValue *string `type:"string"` +} + +// String returns the string representation +func (s AnnotationValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnnotationValue) GoString() string { + return s.String() +} + +// SetBooleanValue sets the BooleanValue field's value. +func (s *AnnotationValue) SetBooleanValue(v bool) *AnnotationValue { + s.BooleanValue = &v + return s +} + +// SetNumberValue sets the NumberValue field's value. +func (s *AnnotationValue) SetNumberValue(v float64) *AnnotationValue { + s.NumberValue = &v + return s +} + +// SetStringValue sets the StringValue field's value. +func (s *AnnotationValue) SetStringValue(v string) *AnnotationValue { + s.StringValue = &v + return s +} + +// A list of availability zones corresponding to the segments in a trace. +type AvailabilityZoneDetail struct { + _ struct{} `type:"structure"` + + // The name of a corresponding availability zone. + Name *string `type:"string"` +} + +// String returns the string representation +func (s AvailabilityZoneDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AvailabilityZoneDetail) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *AvailabilityZoneDetail) SetName(v string) *AvailabilityZoneDetail { + s.Name = &v + return s +} + +type BackendConnectionErrors struct { + _ struct{} `type:"structure"` + + ConnectionRefusedCount *int64 `type:"integer"` + + HTTPCode4XXCount *int64 `type:"integer"` + + HTTPCode5XXCount *int64 `type:"integer"` + + OtherCount *int64 `type:"integer"` + + TimeoutCount *int64 `type:"integer"` + + UnknownHostCount *int64 `type:"integer"` +} + +// String returns the string representation +func (s BackendConnectionErrors) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackendConnectionErrors) GoString() string { + return s.String() +} + +// SetConnectionRefusedCount sets the ConnectionRefusedCount field's value. +func (s *BackendConnectionErrors) SetConnectionRefusedCount(v int64) *BackendConnectionErrors { + s.ConnectionRefusedCount = &v + return s +} + +// SetHTTPCode4XXCount sets the HTTPCode4XXCount field's value. +func (s *BackendConnectionErrors) SetHTTPCode4XXCount(v int64) *BackendConnectionErrors { + s.HTTPCode4XXCount = &v + return s +} + +// SetHTTPCode5XXCount sets the HTTPCode5XXCount field's value. +func (s *BackendConnectionErrors) SetHTTPCode5XXCount(v int64) *BackendConnectionErrors { + s.HTTPCode5XXCount = &v + return s +} + +// SetOtherCount sets the OtherCount field's value. +func (s *BackendConnectionErrors) SetOtherCount(v int64) *BackendConnectionErrors { + s.OtherCount = &v + return s +} + +// SetTimeoutCount sets the TimeoutCount field's value. +func (s *BackendConnectionErrors) SetTimeoutCount(v int64) *BackendConnectionErrors { + s.TimeoutCount = &v + return s +} + +// SetUnknownHostCount sets the UnknownHostCount field's value. +func (s *BackendConnectionErrors) SetUnknownHostCount(v int64) *BackendConnectionErrors { + s.UnknownHostCount = &v + return s +} + +type BatchGetTracesInput struct { + _ struct{} `type:"structure"` + + // Pagination token. Not used. + NextToken *string `type:"string"` + + // Specify the trace IDs of requests for which to retrieve segments. + // + // TraceIds is a required field + TraceIds []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchGetTracesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetTracesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchGetTracesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchGetTracesInput"} + if s.TraceIds == nil { + invalidParams.Add(request.NewErrParamRequired("TraceIds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNextToken sets the NextToken field's value. +func (s *BatchGetTracesInput) SetNextToken(v string) *BatchGetTracesInput { + s.NextToken = &v + return s +} + +// SetTraceIds sets the TraceIds field's value. +func (s *BatchGetTracesInput) SetTraceIds(v []*string) *BatchGetTracesInput { + s.TraceIds = v + return s +} + +type BatchGetTracesOutput struct { + _ struct{} `type:"structure"` + + // Pagination token. Not used. + NextToken *string `type:"string"` + + // Full traces for the specified requests. + Traces []*Trace `type:"list"` + + // Trace IDs of requests that haven't been processed. + UnprocessedTraceIds []*string `type:"list"` +} + +// String returns the string representation +func (s BatchGetTracesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetTracesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *BatchGetTracesOutput) SetNextToken(v string) *BatchGetTracesOutput { + s.NextToken = &v + return s +} + +// SetTraces sets the Traces field's value. +func (s *BatchGetTracesOutput) SetTraces(v []*Trace) *BatchGetTracesOutput { + s.Traces = v + return s +} + +// SetUnprocessedTraceIds sets the UnprocessedTraceIds field's value. +func (s *BatchGetTracesOutput) SetUnprocessedTraceIds(v []*string) *BatchGetTracesOutput { + s.UnprocessedTraceIds = v + return s +} + +type CreateGroupInput struct { + _ struct{} `type:"structure"` + + // The filter expression defining criteria by which to group traces. + FilterExpression *string `min:"1" type:"string"` + + // The case-sensitive name of the new group. Default is a reserved name and + // names must be unique. + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateGroupInput"} + if s.FilterExpression != nil && len(*s.FilterExpression) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FilterExpression", 1)) + } + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilterExpression sets the FilterExpression field's value. +func (s *CreateGroupInput) SetFilterExpression(v string) *CreateGroupInput { + s.FilterExpression = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *CreateGroupInput) SetGroupName(v string) *CreateGroupInput { + s.GroupName = &v + return s +} + +type CreateGroupOutput struct { + _ struct{} `type:"structure"` + + // The group that was created. Contains the name of the group that was created, + // the ARN of the group that was generated based on the group name, and the + // filter expression that was assigned to the group. + Group *Group `type:"structure"` +} + +// String returns the string representation +func (s CreateGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupOutput) GoString() string { + return s.String() +} + +// SetGroup sets the Group field's value. +func (s *CreateGroupOutput) SetGroup(v *Group) *CreateGroupOutput { + s.Group = v + return s +} + +type CreateSamplingRuleInput struct { + _ struct{} `type:"structure"` + + // The rule definition. + // + // SamplingRule is a required field + SamplingRule *SamplingRule `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateSamplingRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSamplingRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSamplingRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSamplingRuleInput"} + if s.SamplingRule == nil { + invalidParams.Add(request.NewErrParamRequired("SamplingRule")) + } + if s.SamplingRule != nil { + if err := s.SamplingRule.Validate(); err != nil { + invalidParams.AddNested("SamplingRule", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSamplingRule sets the SamplingRule field's value. +func (s *CreateSamplingRuleInput) SetSamplingRule(v *SamplingRule) *CreateSamplingRuleInput { + s.SamplingRule = v + return s +} + +type CreateSamplingRuleOutput struct { + _ struct{} `type:"structure"` + + // The saved rule definition and metadata. + SamplingRuleRecord *SamplingRuleRecord `type:"structure"` +} + +// String returns the string representation +func (s CreateSamplingRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSamplingRuleOutput) GoString() string { + return s.String() +} + +// SetSamplingRuleRecord sets the SamplingRuleRecord field's value. +func (s *CreateSamplingRuleOutput) SetSamplingRuleRecord(v *SamplingRuleRecord) *CreateSamplingRuleOutput { + s.SamplingRuleRecord = v + return s +} + +type DeleteGroupInput struct { + _ struct{} `type:"structure"` + + // The ARN of the group that was generated on creation. + GroupARN *string `min:"1" type:"string"` + + // The case-sensitive name of the group. + GroupName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteGroupInput"} + if s.GroupARN != nil && len(*s.GroupARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupARN", 1)) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupARN sets the GroupARN field's value. +func (s *DeleteGroupInput) SetGroupARN(v string) *DeleteGroupInput { + s.GroupARN = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *DeleteGroupInput) SetGroupName(v string) *DeleteGroupInput { + s.GroupName = &v + return s +} + +type DeleteGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteGroupOutput) GoString() string { + return s.String() +} + +type DeleteSamplingRuleInput struct { + _ struct{} `type:"structure"` + + // The ARN of the sampling rule. Specify a rule by either name or ARN, but not + // both. + RuleARN *string `type:"string"` + + // The name of the sampling rule. Specify a rule by either name or ARN, but + // not both. + RuleName *string `type:"string"` +} + +// String returns the string representation +func (s DeleteSamplingRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSamplingRuleInput) GoString() string { + return s.String() +} + +// SetRuleARN sets the RuleARN field's value. +func (s *DeleteSamplingRuleInput) SetRuleARN(v string) *DeleteSamplingRuleInput { + s.RuleARN = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *DeleteSamplingRuleInput) SetRuleName(v string) *DeleteSamplingRuleInput { + s.RuleName = &v + return s +} + +type DeleteSamplingRuleOutput struct { + _ struct{} `type:"structure"` + + // The deleted rule definition and metadata. + SamplingRuleRecord *SamplingRuleRecord `type:"structure"` +} + +// String returns the string representation +func (s DeleteSamplingRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSamplingRuleOutput) GoString() string { + return s.String() +} + +// SetSamplingRuleRecord sets the SamplingRuleRecord field's value. +func (s *DeleteSamplingRuleOutput) SetSamplingRuleRecord(v *SamplingRuleRecord) *DeleteSamplingRuleOutput { + s.SamplingRuleRecord = v + return s +} + +// Information about a connection between two services. +type Edge struct { + _ struct{} `type:"structure"` + + // Aliases for the edge. + Aliases []*Alias `type:"list"` + + // The end time of the last segment on the edge. + EndTime *time.Time `type:"timestamp"` + + // Identifier of the edge. Unique within a service map. + ReferenceId *int64 `type:"integer"` + + // A histogram that maps the spread of client response times on an edge. + ResponseTimeHistogram []*HistogramEntry `type:"list"` + + // The start time of the first segment on the edge. + StartTime *time.Time `type:"timestamp"` + + // Response statistics for segments on the edge. + SummaryStatistics *EdgeStatistics `type:"structure"` +} + +// String returns the string representation +func (s Edge) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Edge) GoString() string { + return s.String() +} + +// SetAliases sets the Aliases field's value. +func (s *Edge) SetAliases(v []*Alias) *Edge { + s.Aliases = v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *Edge) SetEndTime(v time.Time) *Edge { + s.EndTime = &v + return s +} + +// SetReferenceId sets the ReferenceId field's value. +func (s *Edge) SetReferenceId(v int64) *Edge { + s.ReferenceId = &v + return s +} + +// SetResponseTimeHistogram sets the ResponseTimeHistogram field's value. +func (s *Edge) SetResponseTimeHistogram(v []*HistogramEntry) *Edge { + s.ResponseTimeHistogram = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *Edge) SetStartTime(v time.Time) *Edge { + s.StartTime = &v + return s +} + +// SetSummaryStatistics sets the SummaryStatistics field's value. +func (s *Edge) SetSummaryStatistics(v *EdgeStatistics) *Edge { + s.SummaryStatistics = v + return s +} + +// Response statistics for an edge. +type EdgeStatistics struct { + _ struct{} `type:"structure"` + + // Information about requests that failed with a 4xx Client Error status code. + ErrorStatistics *ErrorStatistics `type:"structure"` + + // Information about requests that failed with a 5xx Server Error status code. + FaultStatistics *FaultStatistics `type:"structure"` + + // The number of requests that completed with a 2xx Success status code. + OkCount *int64 `type:"long"` + + // The total number of completed requests. + TotalCount *int64 `type:"long"` + + // The aggregate response time of completed requests. + TotalResponseTime *float64 `type:"double"` +} + +// String returns the string representation +func (s EdgeStatistics) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EdgeStatistics) GoString() string { + return s.String() +} + +// SetErrorStatistics sets the ErrorStatistics field's value. +func (s *EdgeStatistics) SetErrorStatistics(v *ErrorStatistics) *EdgeStatistics { + s.ErrorStatistics = v + return s +} + +// SetFaultStatistics sets the FaultStatistics field's value. +func (s *EdgeStatistics) SetFaultStatistics(v *FaultStatistics) *EdgeStatistics { + s.FaultStatistics = v + return s +} + +// SetOkCount sets the OkCount field's value. +func (s *EdgeStatistics) SetOkCount(v int64) *EdgeStatistics { + s.OkCount = &v + return s +} + +// SetTotalCount sets the TotalCount field's value. +func (s *EdgeStatistics) SetTotalCount(v int64) *EdgeStatistics { + s.TotalCount = &v + return s +} + +// SetTotalResponseTime sets the TotalResponseTime field's value. +func (s *EdgeStatistics) SetTotalResponseTime(v float64) *EdgeStatistics { + s.TotalResponseTime = &v + return s +} + +// A configuration document that specifies encryption configuration settings. +type EncryptionConfig struct { + _ struct{} `type:"structure"` + + // The ID of the customer master key (CMK) used for encryption, if applicable. + KeyId *string `type:"string"` + + // The encryption status. While the status is UPDATING, X-Ray may encrypt data + // with a combination of the new and old settings. + Status *string `type:"string" enum:"EncryptionStatus"` + + // The type of encryption. Set to KMS for encryption with CMKs. Set to NONE + // for default encryption. + Type *string `type:"string" enum:"EncryptionType"` +} + +// String returns the string representation +func (s EncryptionConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EncryptionConfig) GoString() string { + return s.String() +} + +// SetKeyId sets the KeyId field's value. +func (s *EncryptionConfig) SetKeyId(v string) *EncryptionConfig { + s.KeyId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *EncryptionConfig) SetStatus(v string) *EncryptionConfig { + s.Status = &v + return s +} + +// SetType sets the Type field's value. +func (s *EncryptionConfig) SetType(v string) *EncryptionConfig { + s.Type = &v + return s +} + +// The root cause of a trace summary error. +type ErrorRootCause struct { + _ struct{} `type:"structure"` + + // A list of services corresponding to an error. A service identifies a segment + // and it contains a name, account ID, type, and inferred flag. + Services []*ErrorRootCauseService `type:"list"` +} + +// String returns the string representation +func (s ErrorRootCause) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorRootCause) GoString() string { + return s.String() +} + +// SetServices sets the Services field's value. +func (s *ErrorRootCause) SetServices(v []*ErrorRootCauseService) *ErrorRootCause { + s.Services = v + return s +} + +// A collection of segments and corresponding subsegments associated to a trace +// summary error. +type ErrorRootCauseEntity struct { + _ struct{} `type:"structure"` + + // The types and messages of the exceptions. + Exceptions []*RootCauseException `type:"list"` + + // The name of the entity. + Name *string `type:"string"` + + // A flag that denotes a remote subsegment. + Remote *bool `type:"boolean"` +} + +// String returns the string representation +func (s ErrorRootCauseEntity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorRootCauseEntity) GoString() string { + return s.String() +} + +// SetExceptions sets the Exceptions field's value. +func (s *ErrorRootCauseEntity) SetExceptions(v []*RootCauseException) *ErrorRootCauseEntity { + s.Exceptions = v + return s +} + +// SetName sets the Name field's value. +func (s *ErrorRootCauseEntity) SetName(v string) *ErrorRootCauseEntity { + s.Name = &v + return s +} + +// SetRemote sets the Remote field's value. +func (s *ErrorRootCauseEntity) SetRemote(v bool) *ErrorRootCauseEntity { + s.Remote = &v + return s +} + +// A collection of fields identifying the services in a trace summary error. +type ErrorRootCauseService struct { + _ struct{} `type:"structure"` + + // The account ID associated to the service. + AccountId *string `type:"string"` + + // The path of root cause entities found on the service. + EntityPath []*ErrorRootCauseEntity `type:"list"` + + // A Boolean value indicating if the service is inferred from the trace. + Inferred *bool `type:"boolean"` + + // The service name. + Name *string `type:"string"` + + // A collection of associated service names. + Names []*string `type:"list"` + + // The type associated to the service. + Type *string `type:"string"` +} + +// String returns the string representation +func (s ErrorRootCauseService) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorRootCauseService) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *ErrorRootCauseService) SetAccountId(v string) *ErrorRootCauseService { + s.AccountId = &v + return s +} + +// SetEntityPath sets the EntityPath field's value. +func (s *ErrorRootCauseService) SetEntityPath(v []*ErrorRootCauseEntity) *ErrorRootCauseService { + s.EntityPath = v + return s +} + +// SetInferred sets the Inferred field's value. +func (s *ErrorRootCauseService) SetInferred(v bool) *ErrorRootCauseService { + s.Inferred = &v + return s +} + +// SetName sets the Name field's value. +func (s *ErrorRootCauseService) SetName(v string) *ErrorRootCauseService { + s.Name = &v + return s +} + +// SetNames sets the Names field's value. +func (s *ErrorRootCauseService) SetNames(v []*string) *ErrorRootCauseService { + s.Names = v + return s +} + +// SetType sets the Type field's value. +func (s *ErrorRootCauseService) SetType(v string) *ErrorRootCauseService { + s.Type = &v + return s +} + +// Information about requests that failed with a 4xx Client Error status code. +type ErrorStatistics struct { + _ struct{} `type:"structure"` + + // The number of requests that failed with untracked 4xx Client Error status + // codes. + OtherCount *int64 `type:"long"` + + // The number of requests that failed with a 419 throttling status code. + ThrottleCount *int64 `type:"long"` + + // The total number of requests that failed with a 4xx Client Error status code. + TotalCount *int64 `type:"long"` +} + +// String returns the string representation +func (s ErrorStatistics) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorStatistics) GoString() string { + return s.String() +} + +// SetOtherCount sets the OtherCount field's value. +func (s *ErrorStatistics) SetOtherCount(v int64) *ErrorStatistics { + s.OtherCount = &v + return s +} + +// SetThrottleCount sets the ThrottleCount field's value. +func (s *ErrorStatistics) SetThrottleCount(v int64) *ErrorStatistics { + s.ThrottleCount = &v + return s +} + +// SetTotalCount sets the TotalCount field's value. +func (s *ErrorStatistics) SetTotalCount(v int64) *ErrorStatistics { + s.TotalCount = &v + return s +} + +// The root cause information for a trace summary fault. +type FaultRootCause struct { + _ struct{} `type:"structure"` + + // A list of corresponding services. A service identifies a segment and it contains + // a name, account ID, type, and inferred flag. + Services []*FaultRootCauseService `type:"list"` +} + +// String returns the string representation +func (s FaultRootCause) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FaultRootCause) GoString() string { + return s.String() +} + +// SetServices sets the Services field's value. +func (s *FaultRootCause) SetServices(v []*FaultRootCauseService) *FaultRootCause { + s.Services = v + return s +} + +// A collection of segments and corresponding subsegments associated to a trace +// summary fault error. +type FaultRootCauseEntity struct { + _ struct{} `type:"structure"` + + // The types and messages of the exceptions. + Exceptions []*RootCauseException `type:"list"` + + // The name of the entity. + Name *string `type:"string"` + + // A flag that denotes a remote subsegment. + Remote *bool `type:"boolean"` +} + +// String returns the string representation +func (s FaultRootCauseEntity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FaultRootCauseEntity) GoString() string { + return s.String() +} + +// SetExceptions sets the Exceptions field's value. +func (s *FaultRootCauseEntity) SetExceptions(v []*RootCauseException) *FaultRootCauseEntity { + s.Exceptions = v + return s +} + +// SetName sets the Name field's value. +func (s *FaultRootCauseEntity) SetName(v string) *FaultRootCauseEntity { + s.Name = &v + return s +} + +// SetRemote sets the Remote field's value. +func (s *FaultRootCauseEntity) SetRemote(v bool) *FaultRootCauseEntity { + s.Remote = &v + return s +} + +// A collection of fields identifying the services in a trace summary fault. +type FaultRootCauseService struct { + _ struct{} `type:"structure"` + + // The account ID associated to the service. + AccountId *string `type:"string"` + + // The path of root cause entities found on the service. + EntityPath []*FaultRootCauseEntity `type:"list"` + + // A Boolean value indicating if the service is inferred from the trace. + Inferred *bool `type:"boolean"` + + // The service name. + Name *string `type:"string"` + + // A collection of associated service names. + Names []*string `type:"list"` + + // The type associated to the service. + Type *string `type:"string"` +} + +// String returns the string representation +func (s FaultRootCauseService) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FaultRootCauseService) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *FaultRootCauseService) SetAccountId(v string) *FaultRootCauseService { + s.AccountId = &v + return s +} + +// SetEntityPath sets the EntityPath field's value. +func (s *FaultRootCauseService) SetEntityPath(v []*FaultRootCauseEntity) *FaultRootCauseService { + s.EntityPath = v + return s +} + +// SetInferred sets the Inferred field's value. +func (s *FaultRootCauseService) SetInferred(v bool) *FaultRootCauseService { + s.Inferred = &v + return s +} + +// SetName sets the Name field's value. +func (s *FaultRootCauseService) SetName(v string) *FaultRootCauseService { + s.Name = &v + return s +} + +// SetNames sets the Names field's value. +func (s *FaultRootCauseService) SetNames(v []*string) *FaultRootCauseService { + s.Names = v + return s +} + +// SetType sets the Type field's value. +func (s *FaultRootCauseService) SetType(v string) *FaultRootCauseService { + s.Type = &v + return s +} + +// Information about requests that failed with a 5xx Server Error status code. +type FaultStatistics struct { + _ struct{} `type:"structure"` + + // The number of requests that failed with untracked 5xx Server Error status + // codes. + OtherCount *int64 `type:"long"` + + // The total number of requests that failed with a 5xx Server Error status code. + TotalCount *int64 `type:"long"` +} + +// String returns the string representation +func (s FaultStatistics) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FaultStatistics) GoString() string { + return s.String() +} + +// SetOtherCount sets the OtherCount field's value. +func (s *FaultStatistics) SetOtherCount(v int64) *FaultStatistics { + s.OtherCount = &v + return s +} + +// SetTotalCount sets the TotalCount field's value. +func (s *FaultStatistics) SetTotalCount(v int64) *FaultStatistics { + s.TotalCount = &v + return s +} + +type GetEncryptionConfigInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetEncryptionConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetEncryptionConfigInput) GoString() string { + return s.String() +} + +type GetEncryptionConfigOutput struct { + _ struct{} `type:"structure"` + + // The encryption configuration document. + EncryptionConfig *EncryptionConfig `type:"structure"` +} + +// String returns the string representation +func (s GetEncryptionConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetEncryptionConfigOutput) GoString() string { + return s.String() +} + +// SetEncryptionConfig sets the EncryptionConfig field's value. +func (s *GetEncryptionConfigOutput) SetEncryptionConfig(v *EncryptionConfig) *GetEncryptionConfigOutput { + s.EncryptionConfig = v + return s +} + +type GetGroupInput struct { + _ struct{} `type:"structure"` + + // The ARN of the group that was generated on creation. + GroupARN *string `min:"1" type:"string"` + + // The case-sensitive name of the group. + GroupName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GetGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGroupInput"} + if s.GroupARN != nil && len(*s.GroupARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupARN", 1)) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupARN sets the GroupARN field's value. +func (s *GetGroupInput) SetGroupARN(v string) *GetGroupInput { + s.GroupARN = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *GetGroupInput) SetGroupName(v string) *GetGroupInput { + s.GroupName = &v + return s +} + +type GetGroupOutput struct { + _ struct{} `type:"structure"` + + // The group that was requested. Contains the name of the group, the ARN of + // the group, and the filter expression that assigned to the group. + Group *Group `type:"structure"` +} + +// String returns the string representation +func (s GetGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupOutput) GoString() string { + return s.String() +} + +// SetGroup sets the Group field's value. +func (s *GetGroupOutput) SetGroup(v *Group) *GetGroupOutput { + s.Group = v + return s +} + +type GetGroupsInput struct { + _ struct{} `type:"structure"` + + // Pagination token. Not used. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GetGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGroupsInput"} + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNextToken sets the NextToken field's value. +func (s *GetGroupsInput) SetNextToken(v string) *GetGroupsInput { + s.NextToken = &v + return s +} + +type GetGroupsOutput struct { + _ struct{} `type:"structure"` + + // The collection of all active groups. + Groups []*GroupSummary `type:"list"` + + // Pagination token. Not used. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s GetGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupsOutput) GoString() string { + return s.String() +} + +// SetGroups sets the Groups field's value. +func (s *GetGroupsOutput) SetGroups(v []*GroupSummary) *GetGroupsOutput { + s.Groups = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetGroupsOutput) SetNextToken(v string) *GetGroupsOutput { + s.NextToken = &v + return s +} + +type GetSamplingRulesInput struct { + _ struct{} `type:"structure"` + + // Pagination token. Not used. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s GetSamplingRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSamplingRulesInput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *GetSamplingRulesInput) SetNextToken(v string) *GetSamplingRulesInput { + s.NextToken = &v + return s +} + +type GetSamplingRulesOutput struct { + _ struct{} `type:"structure"` + + // Pagination token. Not used. + NextToken *string `type:"string"` + + // Rule definitions and metadata. + SamplingRuleRecords []*SamplingRuleRecord `type:"list"` +} + +// String returns the string representation +func (s GetSamplingRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSamplingRulesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *GetSamplingRulesOutput) SetNextToken(v string) *GetSamplingRulesOutput { + s.NextToken = &v + return s +} + +// SetSamplingRuleRecords sets the SamplingRuleRecords field's value. +func (s *GetSamplingRulesOutput) SetSamplingRuleRecords(v []*SamplingRuleRecord) *GetSamplingRulesOutput { + s.SamplingRuleRecords = v + return s +} + +type GetSamplingStatisticSummariesInput struct { + _ struct{} `type:"structure"` + + // Pagination token. Not used. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s GetSamplingStatisticSummariesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSamplingStatisticSummariesInput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *GetSamplingStatisticSummariesInput) SetNextToken(v string) *GetSamplingStatisticSummariesInput { + s.NextToken = &v + return s +} + +type GetSamplingStatisticSummariesOutput struct { + _ struct{} `type:"structure"` + + // Pagination token. Not used. + NextToken *string `type:"string"` + + // Information about the number of requests instrumented for each sampling rule. + SamplingStatisticSummaries []*SamplingStatisticSummary `type:"list"` +} + +// String returns the string representation +func (s GetSamplingStatisticSummariesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSamplingStatisticSummariesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *GetSamplingStatisticSummariesOutput) SetNextToken(v string) *GetSamplingStatisticSummariesOutput { + s.NextToken = &v + return s +} + +// SetSamplingStatisticSummaries sets the SamplingStatisticSummaries field's value. +func (s *GetSamplingStatisticSummariesOutput) SetSamplingStatisticSummaries(v []*SamplingStatisticSummary) *GetSamplingStatisticSummariesOutput { + s.SamplingStatisticSummaries = v + return s +} + +type GetSamplingTargetsInput struct { + _ struct{} `type:"structure"` + + // Information about rules that the service is using to sample requests. + // + // SamplingStatisticsDocuments is a required field + SamplingStatisticsDocuments []*SamplingStatisticsDocument `type:"list" required:"true"` +} + +// String returns the string representation +func (s GetSamplingTargetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSamplingTargetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetSamplingTargetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSamplingTargetsInput"} + if s.SamplingStatisticsDocuments == nil { + invalidParams.Add(request.NewErrParamRequired("SamplingStatisticsDocuments")) + } + if s.SamplingStatisticsDocuments != nil { + for i, v := range s.SamplingStatisticsDocuments { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SamplingStatisticsDocuments", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSamplingStatisticsDocuments sets the SamplingStatisticsDocuments field's value. +func (s *GetSamplingTargetsInput) SetSamplingStatisticsDocuments(v []*SamplingStatisticsDocument) *GetSamplingTargetsInput { + s.SamplingStatisticsDocuments = v + return s +} + +type GetSamplingTargetsOutput struct { + _ struct{} `type:"structure"` + + // The last time a user changed the sampling rule configuration. If the sampling + // rule configuration changed since the service last retrieved it, the service + // should call GetSamplingRules to get the latest version. + LastRuleModification *time.Time `type:"timestamp"` + + // Updated rules that the service should use to sample requests. + SamplingTargetDocuments []*SamplingTargetDocument `type:"list"` + + // Information about SamplingStatisticsDocument that X-Ray could not process. + UnprocessedStatistics []*UnprocessedStatistics `type:"list"` +} + +// String returns the string representation +func (s GetSamplingTargetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSamplingTargetsOutput) GoString() string { + return s.String() +} + +// SetLastRuleModification sets the LastRuleModification field's value. +func (s *GetSamplingTargetsOutput) SetLastRuleModification(v time.Time) *GetSamplingTargetsOutput { + s.LastRuleModification = &v + return s +} + +// SetSamplingTargetDocuments sets the SamplingTargetDocuments field's value. +func (s *GetSamplingTargetsOutput) SetSamplingTargetDocuments(v []*SamplingTargetDocument) *GetSamplingTargetsOutput { + s.SamplingTargetDocuments = v + return s +} + +// SetUnprocessedStatistics sets the UnprocessedStatistics field's value. +func (s *GetSamplingTargetsOutput) SetUnprocessedStatistics(v []*UnprocessedStatistics) *GetSamplingTargetsOutput { + s.UnprocessedStatistics = v + return s +} + +type GetServiceGraphInput struct { + _ struct{} `type:"structure"` + + // The end of the timeframe for which to generate a graph. + // + // EndTime is a required field + EndTime *time.Time `type:"timestamp" required:"true"` + + // The ARN of a group to generate a graph based on. + GroupARN *string `min:"1" type:"string"` + + // The name of a group to generate a graph based on. + GroupName *string `min:"1" type:"string"` + + // Pagination token. Not used. + NextToken *string `type:"string"` + + // The start of the time frame for which to generate a graph. + // + // StartTime is a required field + StartTime *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s GetServiceGraphInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServiceGraphInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetServiceGraphInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetServiceGraphInput"} + if s.EndTime == nil { + invalidParams.Add(request.NewErrParamRequired("EndTime")) + } + if s.GroupARN != nil && len(*s.GroupARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupARN", 1)) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.StartTime == nil { + invalidParams.Add(request.NewErrParamRequired("StartTime")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndTime sets the EndTime field's value. +func (s *GetServiceGraphInput) SetEndTime(v time.Time) *GetServiceGraphInput { + s.EndTime = &v + return s +} + +// SetGroupARN sets the GroupARN field's value. +func (s *GetServiceGraphInput) SetGroupARN(v string) *GetServiceGraphInput { + s.GroupARN = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *GetServiceGraphInput) SetGroupName(v string) *GetServiceGraphInput { + s.GroupName = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetServiceGraphInput) SetNextToken(v string) *GetServiceGraphInput { + s.NextToken = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *GetServiceGraphInput) SetStartTime(v time.Time) *GetServiceGraphInput { + s.StartTime = &v + return s +} + +type GetServiceGraphOutput struct { + _ struct{} `type:"structure"` + + // A flag indicating whether the group's filter expression has been consistent, + // or if the returned service graph may show traces from an older version of + // the group's filter expression. + ContainsOldGroupVersions *bool `type:"boolean"` + + // The end of the time frame for which the graph was generated. + EndTime *time.Time `type:"timestamp"` + + // Pagination token. Not used. + NextToken *string `type:"string"` + + // The services that have processed a traced request during the specified time + // frame. + Services []*Service `type:"list"` + + // The start of the time frame for which the graph was generated. + StartTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s GetServiceGraphOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServiceGraphOutput) GoString() string { + return s.String() +} + +// SetContainsOldGroupVersions sets the ContainsOldGroupVersions field's value. +func (s *GetServiceGraphOutput) SetContainsOldGroupVersions(v bool) *GetServiceGraphOutput { + s.ContainsOldGroupVersions = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *GetServiceGraphOutput) SetEndTime(v time.Time) *GetServiceGraphOutput { + s.EndTime = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetServiceGraphOutput) SetNextToken(v string) *GetServiceGraphOutput { + s.NextToken = &v + return s +} + +// SetServices sets the Services field's value. +func (s *GetServiceGraphOutput) SetServices(v []*Service) *GetServiceGraphOutput { + s.Services = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *GetServiceGraphOutput) SetStartTime(v time.Time) *GetServiceGraphOutput { + s.StartTime = &v + return s +} + +type GetTraceGraphInput struct { + _ struct{} `type:"structure"` + + // Pagination token. Not used. + NextToken *string `type:"string"` + + // Trace IDs of requests for which to generate a service graph. + // + // TraceIds is a required field + TraceIds []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s GetTraceGraphInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTraceGraphInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTraceGraphInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTraceGraphInput"} + if s.TraceIds == nil { + invalidParams.Add(request.NewErrParamRequired("TraceIds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNextToken sets the NextToken field's value. +func (s *GetTraceGraphInput) SetNextToken(v string) *GetTraceGraphInput { + s.NextToken = &v + return s +} + +// SetTraceIds sets the TraceIds field's value. +func (s *GetTraceGraphInput) SetTraceIds(v []*string) *GetTraceGraphInput { + s.TraceIds = v + return s +} + +type GetTraceGraphOutput struct { + _ struct{} `type:"structure"` + + // Pagination token. Not used. + NextToken *string `type:"string"` + + // The services that have processed one of the specified requests. + Services []*Service `type:"list"` +} + +// String returns the string representation +func (s GetTraceGraphOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTraceGraphOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *GetTraceGraphOutput) SetNextToken(v string) *GetTraceGraphOutput { + s.NextToken = &v + return s +} + +// SetServices sets the Services field's value. +func (s *GetTraceGraphOutput) SetServices(v []*Service) *GetTraceGraphOutput { + s.Services = v + return s +} + +type GetTraceSummariesInput struct { + _ struct{} `type:"structure"` + + // The end of the time frame for which to retrieve traces. + // + // EndTime is a required field + EndTime *time.Time `type:"timestamp" required:"true"` + + // Specify a filter expression to retrieve trace summaries for services or requests + // that meet certain requirements. + FilterExpression *string `min:"1" type:"string"` + + // Specify the pagination token returned by a previous request to retrieve the + // next page of results. + NextToken *string `type:"string"` + + // Set to true to get summaries for only a subset of available traces. + Sampling *bool `type:"boolean"` + + // The start of the time frame for which to retrieve traces. + // + // StartTime is a required field + StartTime *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s GetTraceSummariesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTraceSummariesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTraceSummariesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTraceSummariesInput"} + if s.EndTime == nil { + invalidParams.Add(request.NewErrParamRequired("EndTime")) + } + if s.FilterExpression != nil && len(*s.FilterExpression) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FilterExpression", 1)) + } + if s.StartTime == nil { + invalidParams.Add(request.NewErrParamRequired("StartTime")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndTime sets the EndTime field's value. +func (s *GetTraceSummariesInput) SetEndTime(v time.Time) *GetTraceSummariesInput { + s.EndTime = &v + return s +} + +// SetFilterExpression sets the FilterExpression field's value. +func (s *GetTraceSummariesInput) SetFilterExpression(v string) *GetTraceSummariesInput { + s.FilterExpression = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetTraceSummariesInput) SetNextToken(v string) *GetTraceSummariesInput { + s.NextToken = &v + return s +} + +// SetSampling sets the Sampling field's value. +func (s *GetTraceSummariesInput) SetSampling(v bool) *GetTraceSummariesInput { + s.Sampling = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *GetTraceSummariesInput) SetStartTime(v time.Time) *GetTraceSummariesInput { + s.StartTime = &v + return s +} + +type GetTraceSummariesOutput struct { + _ struct{} `type:"structure"` + + // The start time of this page of results. + ApproximateTime *time.Time `type:"timestamp"` + + // If the requested time frame contained more than one page of results, you + // can use this token to retrieve the next page. The first page contains the + // most most recent results, closest to the end of the time frame. + NextToken *string `type:"string"` + + // Trace IDs and metadata for traces that were found in the specified time frame. + TraceSummaries []*TraceSummary `type:"list"` + + // The total number of traces processed, including traces that did not match + // the specified filter expression. + TracesProcessedCount *int64 `type:"long"` +} + +// String returns the string representation +func (s GetTraceSummariesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTraceSummariesOutput) GoString() string { + return s.String() +} + +// SetApproximateTime sets the ApproximateTime field's value. +func (s *GetTraceSummariesOutput) SetApproximateTime(v time.Time) *GetTraceSummariesOutput { + s.ApproximateTime = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetTraceSummariesOutput) SetNextToken(v string) *GetTraceSummariesOutput { + s.NextToken = &v + return s +} + +// SetTraceSummaries sets the TraceSummaries field's value. +func (s *GetTraceSummariesOutput) SetTraceSummaries(v []*TraceSummary) *GetTraceSummariesOutput { + s.TraceSummaries = v + return s +} + +// SetTracesProcessedCount sets the TracesProcessedCount field's value. +func (s *GetTraceSummariesOutput) SetTracesProcessedCount(v int64) *GetTraceSummariesOutput { + s.TracesProcessedCount = &v + return s +} + +// Details and metadata for a group. +type Group struct { + _ struct{} `type:"structure"` + + // The filter expression defining the parameters to include traces. + FilterExpression *string `type:"string"` + + // The ARN of the group generated based on the GroupName. + GroupARN *string `type:"string"` + + // The unique case-sensitive name of the group. + GroupName *string `type:"string"` +} + +// String returns the string representation +func (s Group) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Group) GoString() string { + return s.String() +} + +// SetFilterExpression sets the FilterExpression field's value. +func (s *Group) SetFilterExpression(v string) *Group { + s.FilterExpression = &v + return s +} + +// SetGroupARN sets the GroupARN field's value. +func (s *Group) SetGroupARN(v string) *Group { + s.GroupARN = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *Group) SetGroupName(v string) *Group { + s.GroupName = &v + return s +} + +// Details for a group without metadata. +type GroupSummary struct { + _ struct{} `type:"structure"` + + // The filter expression defining the parameters to include traces. + FilterExpression *string `type:"string"` + + // The ARN of the group generated based on the GroupName. + GroupARN *string `type:"string"` + + // The unique case-sensitive name of the group. + GroupName *string `type:"string"` +} + +// String returns the string representation +func (s GroupSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GroupSummary) GoString() string { + return s.String() +} + +// SetFilterExpression sets the FilterExpression field's value. +func (s *GroupSummary) SetFilterExpression(v string) *GroupSummary { + s.FilterExpression = &v + return s +} + +// SetGroupARN sets the GroupARN field's value. +func (s *GroupSummary) SetGroupARN(v string) *GroupSummary { + s.GroupARN = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *GroupSummary) SetGroupName(v string) *GroupSummary { + s.GroupName = &v + return s +} + +// An entry in a histogram for a statistic. A histogram maps the range of observed +// values on the X axis, and the prevalence of each value on the Y axis. +type HistogramEntry struct { + _ struct{} `type:"structure"` + + // The prevalence of the entry. + Count *int64 `type:"integer"` + + // The value of the entry. + Value *float64 `type:"double"` +} + +// String returns the string representation +func (s HistogramEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HistogramEntry) GoString() string { + return s.String() +} + +// SetCount sets the Count field's value. +func (s *HistogramEntry) SetCount(v int64) *HistogramEntry { + s.Count = &v + return s +} + +// SetValue sets the Value field's value. +func (s *HistogramEntry) SetValue(v float64) *HistogramEntry { + s.Value = &v + return s +} + +// Information about an HTTP request. +type Http struct { + _ struct{} `type:"structure"` + + // The IP address of the requestor. + ClientIp *string `type:"string"` + + // The request method. + HttpMethod *string `type:"string"` + + // The response status. + HttpStatus *int64 `type:"integer"` + + // The request URL. + HttpURL *string `type:"string"` + + // The request's user agent string. + UserAgent *string `type:"string"` +} + +// String returns the string representation +func (s Http) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Http) GoString() string { + return s.String() +} + +// SetClientIp sets the ClientIp field's value. +func (s *Http) SetClientIp(v string) *Http { + s.ClientIp = &v + return s +} + +// SetHttpMethod sets the HttpMethod field's value. +func (s *Http) SetHttpMethod(v string) *Http { + s.HttpMethod = &v + return s +} + +// SetHttpStatus sets the HttpStatus field's value. +func (s *Http) SetHttpStatus(v int64) *Http { + s.HttpStatus = &v + return s +} + +// SetHttpURL sets the HttpURL field's value. +func (s *Http) SetHttpURL(v string) *Http { + s.HttpURL = &v + return s +} + +// SetUserAgent sets the UserAgent field's value. +func (s *Http) SetUserAgent(v string) *Http { + s.UserAgent = &v + return s +} + +// A list of EC2 instance IDs corresponding to the segments in a trace. +type InstanceIdDetail struct { + _ struct{} `type:"structure"` + + // The ID of a corresponding EC2 instance. + Id *string `type:"string"` +} + +// String returns the string representation +func (s InstanceIdDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceIdDetail) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *InstanceIdDetail) SetId(v string) *InstanceIdDetail { + s.Id = &v + return s +} + +type PutEncryptionConfigInput struct { + _ struct{} `type:"structure"` + + // An AWS KMS customer master key (CMK) in one of the following formats: + // + // * Alias - The name of the key. For example, alias/MyKey. + // + // * Key ID - The KMS key ID of the key. For example, ae4aa6d49-a4d8-9df9-a475-4ff6d7898456. + // + // * ARN - The full Amazon Resource Name of the key ID or alias. For example, + // arn:aws:kms:us-east-2:123456789012:key/ae4aa6d49-a4d8-9df9-a475-4ff6d7898456. + // Use this format to specify a key in a different account. + // + // Omit this key if you set Type to NONE. + KeyId *string `min:"1" type:"string"` + + // The type of encryption. Set to KMS to use your own key for encryption. Set + // to NONE for default encryption. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"EncryptionType"` +} + +// String returns the string representation +func (s PutEncryptionConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutEncryptionConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutEncryptionConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutEncryptionConfigInput"} + if s.KeyId != nil && len(*s.KeyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKeyId sets the KeyId field's value. +func (s *PutEncryptionConfigInput) SetKeyId(v string) *PutEncryptionConfigInput { + s.KeyId = &v + return s +} + +// SetType sets the Type field's value. +func (s *PutEncryptionConfigInput) SetType(v string) *PutEncryptionConfigInput { + s.Type = &v + return s +} + +type PutEncryptionConfigOutput struct { + _ struct{} `type:"structure"` + + // The new encryption configuration. + EncryptionConfig *EncryptionConfig `type:"structure"` +} + +// String returns the string representation +func (s PutEncryptionConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutEncryptionConfigOutput) GoString() string { + return s.String() +} + +// SetEncryptionConfig sets the EncryptionConfig field's value. +func (s *PutEncryptionConfigOutput) SetEncryptionConfig(v *EncryptionConfig) *PutEncryptionConfigOutput { + s.EncryptionConfig = v + return s +} + +type PutTelemetryRecordsInput struct { + _ struct{} `type:"structure"` + + EC2InstanceId *string `type:"string"` + + Hostname *string `type:"string"` + + ResourceARN *string `type:"string"` + + // TelemetryRecords is a required field + TelemetryRecords []*TelemetryRecord `type:"list" required:"true"` +} + +// String returns the string representation +func (s PutTelemetryRecordsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutTelemetryRecordsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutTelemetryRecordsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutTelemetryRecordsInput"} + if s.TelemetryRecords == nil { + invalidParams.Add(request.NewErrParamRequired("TelemetryRecords")) + } + if s.TelemetryRecords != nil { + for i, v := range s.TelemetryRecords { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TelemetryRecords", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEC2InstanceId sets the EC2InstanceId field's value. +func (s *PutTelemetryRecordsInput) SetEC2InstanceId(v string) *PutTelemetryRecordsInput { + s.EC2InstanceId = &v + return s +} + +// SetHostname sets the Hostname field's value. +func (s *PutTelemetryRecordsInput) SetHostname(v string) *PutTelemetryRecordsInput { + s.Hostname = &v + return s +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *PutTelemetryRecordsInput) SetResourceARN(v string) *PutTelemetryRecordsInput { + s.ResourceARN = &v + return s +} + +// SetTelemetryRecords sets the TelemetryRecords field's value. +func (s *PutTelemetryRecordsInput) SetTelemetryRecords(v []*TelemetryRecord) *PutTelemetryRecordsInput { + s.TelemetryRecords = v + return s +} + +type PutTelemetryRecordsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutTelemetryRecordsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutTelemetryRecordsOutput) GoString() string { + return s.String() +} + +type PutTraceSegmentsInput struct { + _ struct{} `type:"structure"` + + // A string containing a JSON document defining one or more segments or subsegments. + // + // TraceSegmentDocuments is a required field + TraceSegmentDocuments []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s PutTraceSegmentsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutTraceSegmentsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutTraceSegmentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutTraceSegmentsInput"} + if s.TraceSegmentDocuments == nil { + invalidParams.Add(request.NewErrParamRequired("TraceSegmentDocuments")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTraceSegmentDocuments sets the TraceSegmentDocuments field's value. +func (s *PutTraceSegmentsInput) SetTraceSegmentDocuments(v []*string) *PutTraceSegmentsInput { + s.TraceSegmentDocuments = v + return s +} + +type PutTraceSegmentsOutput struct { + _ struct{} `type:"structure"` + + // Segments that failed processing. + UnprocessedTraceSegments []*UnprocessedTraceSegment `type:"list"` +} + +// String returns the string representation +func (s PutTraceSegmentsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutTraceSegmentsOutput) GoString() string { + return s.String() +} + +// SetUnprocessedTraceSegments sets the UnprocessedTraceSegments field's value. +func (s *PutTraceSegmentsOutput) SetUnprocessedTraceSegments(v []*UnprocessedTraceSegment) *PutTraceSegmentsOutput { + s.UnprocessedTraceSegments = v + return s +} + +// A list of resources ARNs corresponding to the segments in a trace. +type ResourceARNDetail struct { + _ struct{} `type:"structure"` + + // The ARN of a corresponding resource. + ARN *string `type:"string"` +} + +// String returns the string representation +func (s ResourceARNDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceARNDetail) GoString() string { + return s.String() +} + +// SetARN sets the ARN field's value. +func (s *ResourceARNDetail) SetARN(v string) *ResourceARNDetail { + s.ARN = &v + return s +} + +// The root cause information for a response time warning. +type ResponseTimeRootCause struct { + _ struct{} `type:"structure"` + + // A list of corresponding services. A service identifies a segment and contains + // a name, account ID, type, and inferred flag. + Services []*ResponseTimeRootCauseService `type:"list"` +} + +// String returns the string representation +func (s ResponseTimeRootCause) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResponseTimeRootCause) GoString() string { + return s.String() +} + +// SetServices sets the Services field's value. +func (s *ResponseTimeRootCause) SetServices(v []*ResponseTimeRootCauseService) *ResponseTimeRootCause { + s.Services = v + return s +} + +// A collection of segments and corresponding subsegments associated to a response +// time warning. +type ResponseTimeRootCauseEntity struct { + _ struct{} `type:"structure"` + + // The types and messages of the exceptions. + Coverage *float64 `type:"double"` + + // The name of the entity. + Name *string `type:"string"` + + // A flag that denotes a remote subsegment. + Remote *bool `type:"boolean"` +} + +// String returns the string representation +func (s ResponseTimeRootCauseEntity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResponseTimeRootCauseEntity) GoString() string { + return s.String() +} + +// SetCoverage sets the Coverage field's value. +func (s *ResponseTimeRootCauseEntity) SetCoverage(v float64) *ResponseTimeRootCauseEntity { + s.Coverage = &v + return s +} + +// SetName sets the Name field's value. +func (s *ResponseTimeRootCauseEntity) SetName(v string) *ResponseTimeRootCauseEntity { + s.Name = &v + return s +} + +// SetRemote sets the Remote field's value. +func (s *ResponseTimeRootCauseEntity) SetRemote(v bool) *ResponseTimeRootCauseEntity { + s.Remote = &v + return s +} + +// A collection of fields identifying the service in a response time warning. +type ResponseTimeRootCauseService struct { + _ struct{} `type:"structure"` + + // The account ID associated to the service. + AccountId *string `type:"string"` + + // The path of root cause entities found on the service. + EntityPath []*ResponseTimeRootCauseEntity `type:"list"` + + // A Boolean value indicating if the service is inferred from the trace. + Inferred *bool `type:"boolean"` + + // The service name. + Name *string `type:"string"` + + // A collection of associated service names. + Names []*string `type:"list"` + + // The type associated to the service. + Type *string `type:"string"` +} + +// String returns the string representation +func (s ResponseTimeRootCauseService) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResponseTimeRootCauseService) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *ResponseTimeRootCauseService) SetAccountId(v string) *ResponseTimeRootCauseService { + s.AccountId = &v + return s +} + +// SetEntityPath sets the EntityPath field's value. +func (s *ResponseTimeRootCauseService) SetEntityPath(v []*ResponseTimeRootCauseEntity) *ResponseTimeRootCauseService { + s.EntityPath = v + return s +} + +// SetInferred sets the Inferred field's value. +func (s *ResponseTimeRootCauseService) SetInferred(v bool) *ResponseTimeRootCauseService { + s.Inferred = &v + return s +} + +// SetName sets the Name field's value. +func (s *ResponseTimeRootCauseService) SetName(v string) *ResponseTimeRootCauseService { + s.Name = &v + return s +} + +// SetNames sets the Names field's value. +func (s *ResponseTimeRootCauseService) SetNames(v []*string) *ResponseTimeRootCauseService { + s.Names = v + return s +} + +// SetType sets the Type field's value. +func (s *ResponseTimeRootCauseService) SetType(v string) *ResponseTimeRootCauseService { + s.Type = &v + return s +} + +// The exception associated with a root cause. +type RootCauseException struct { + _ struct{} `type:"structure"` + + // The message of the exception. + Message *string `type:"string"` + + // The name of the exception. + Name *string `type:"string"` +} + +// String returns the string representation +func (s RootCauseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RootCauseException) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *RootCauseException) SetMessage(v string) *RootCauseException { + s.Message = &v + return s +} + +// SetName sets the Name field's value. +func (s *RootCauseException) SetName(v string) *RootCauseException { + s.Name = &v + return s +} + +// A sampling rule that services use to decide whether to instrument a request. +// Rule fields can match properties of the service, or properties of a request. +// The service can ignore rules that don't match its properties. +type SamplingRule struct { + _ struct{} `type:"structure"` + + // Matches attributes derived from the request. + Attributes map[string]*string `type:"map"` + + // The percentage of matching requests to instrument, after the reservoir is + // exhausted. + // + // FixedRate is a required field + FixedRate *float64 `type:"double" required:"true"` + + // Matches the HTTP method of a request. + // + // HTTPMethod is a required field + HTTPMethod *string `type:"string" required:"true"` + + // Matches the hostname from a request URL. + // + // Host is a required field + Host *string `type:"string" required:"true"` + + // The priority of the sampling rule. + // + // Priority is a required field + Priority *int64 `min:"1" type:"integer" required:"true"` + + // A fixed number of matching requests to instrument per second, prior to applying + // the fixed rate. The reservoir is not used directly by services, but applies + // to all services using the rule collectively. + // + // ReservoirSize is a required field + ReservoirSize *int64 `type:"integer" required:"true"` + + // Matches the ARN of the AWS resource on which the service runs. + // + // ResourceARN is a required field + ResourceARN *string `type:"string" required:"true"` + + // The ARN of the sampling rule. Specify a rule by either name or ARN, but not + // both. + RuleARN *string `type:"string"` + + // The name of the sampling rule. Specify a rule by either name or ARN, but + // not both. + RuleName *string `min:"1" type:"string"` + + // Matches the name that the service uses to identify itself in segments. + // + // ServiceName is a required field + ServiceName *string `type:"string" required:"true"` + + // Matches the origin that the service uses to identify its type in segments. + // + // ServiceType is a required field + ServiceType *string `type:"string" required:"true"` + + // Matches the path from a request URL. + // + // URLPath is a required field + URLPath *string `type:"string" required:"true"` + + // The version of the sampling rule format (1). + // + // Version is a required field + Version *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s SamplingRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SamplingRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SamplingRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SamplingRule"} + if s.FixedRate == nil { + invalidParams.Add(request.NewErrParamRequired("FixedRate")) + } + if s.HTTPMethod == nil { + invalidParams.Add(request.NewErrParamRequired("HTTPMethod")) + } + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Priority == nil { + invalidParams.Add(request.NewErrParamRequired("Priority")) + } + if s.Priority != nil && *s.Priority < 1 { + invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) + } + if s.ReservoirSize == nil { + invalidParams.Add(request.NewErrParamRequired("ReservoirSize")) + } + if s.ResourceARN == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceARN")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.ServiceName == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceName")) + } + if s.ServiceType == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceType")) + } + if s.URLPath == nil { + invalidParams.Add(request.NewErrParamRequired("URLPath")) + } + if s.Version == nil { + invalidParams.Add(request.NewErrParamRequired("Version")) + } + if s.Version != nil && *s.Version < 1 { + invalidParams.Add(request.NewErrParamMinValue("Version", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAttributes sets the Attributes field's value. +func (s *SamplingRule) SetAttributes(v map[string]*string) *SamplingRule { + s.Attributes = v + return s +} + +// SetFixedRate sets the FixedRate field's value. +func (s *SamplingRule) SetFixedRate(v float64) *SamplingRule { + s.FixedRate = &v + return s +} + +// SetHTTPMethod sets the HTTPMethod field's value. +func (s *SamplingRule) SetHTTPMethod(v string) *SamplingRule { + s.HTTPMethod = &v + return s +} + +// SetHost sets the Host field's value. +func (s *SamplingRule) SetHost(v string) *SamplingRule { + s.Host = &v + return s +} + +// SetPriority sets the Priority field's value. +func (s *SamplingRule) SetPriority(v int64) *SamplingRule { + s.Priority = &v + return s +} + +// SetReservoirSize sets the ReservoirSize field's value. +func (s *SamplingRule) SetReservoirSize(v int64) *SamplingRule { + s.ReservoirSize = &v + return s +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *SamplingRule) SetResourceARN(v string) *SamplingRule { + s.ResourceARN = &v + return s +} + +// SetRuleARN sets the RuleARN field's value. +func (s *SamplingRule) SetRuleARN(v string) *SamplingRule { + s.RuleARN = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *SamplingRule) SetRuleName(v string) *SamplingRule { + s.RuleName = &v + return s +} + +// SetServiceName sets the ServiceName field's value. +func (s *SamplingRule) SetServiceName(v string) *SamplingRule { + s.ServiceName = &v + return s +} + +// SetServiceType sets the ServiceType field's value. +func (s *SamplingRule) SetServiceType(v string) *SamplingRule { + s.ServiceType = &v + return s +} + +// SetURLPath sets the URLPath field's value. +func (s *SamplingRule) SetURLPath(v string) *SamplingRule { + s.URLPath = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *SamplingRule) SetVersion(v int64) *SamplingRule { + s.Version = &v + return s +} + +// A SamplingRule and its metadata. +type SamplingRuleRecord struct { + _ struct{} `type:"structure"` + + // When the rule was created. + CreatedAt *time.Time `type:"timestamp"` + + // When the rule was last modified. + ModifiedAt *time.Time `type:"timestamp"` + + // The sampling rule. + SamplingRule *SamplingRule `type:"structure"` +} + +// String returns the string representation +func (s SamplingRuleRecord) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SamplingRuleRecord) GoString() string { + return s.String() +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *SamplingRuleRecord) SetCreatedAt(v time.Time) *SamplingRuleRecord { + s.CreatedAt = &v + return s +} + +// SetModifiedAt sets the ModifiedAt field's value. +func (s *SamplingRuleRecord) SetModifiedAt(v time.Time) *SamplingRuleRecord { + s.ModifiedAt = &v + return s +} + +// SetSamplingRule sets the SamplingRule field's value. +func (s *SamplingRuleRecord) SetSamplingRule(v *SamplingRule) *SamplingRuleRecord { + s.SamplingRule = v + return s +} + +// A document specifying changes to a sampling rule's configuration. +type SamplingRuleUpdate struct { + _ struct{} `type:"structure"` + + // Matches attributes derived from the request. + Attributes map[string]*string `type:"map"` + + // The percentage of matching requests to instrument, after the reservoir is + // exhausted. + FixedRate *float64 `type:"double"` + + // Matches the HTTP method of a request. + HTTPMethod *string `type:"string"` + + // Matches the hostname from a request URL. + Host *string `type:"string"` + + // The priority of the sampling rule. + Priority *int64 `type:"integer"` + + // A fixed number of matching requests to instrument per second, prior to applying + // the fixed rate. The reservoir is not used directly by services, but applies + // to all services using the rule collectively. + ReservoirSize *int64 `type:"integer"` + + // Matches the ARN of the AWS resource on which the service runs. + ResourceARN *string `type:"string"` + + // The ARN of the sampling rule. Specify a rule by either name or ARN, but not + // both. + RuleARN *string `type:"string"` + + // The name of the sampling rule. Specify a rule by either name or ARN, but + // not both. + RuleName *string `min:"1" type:"string"` + + // Matches the name that the service uses to identify itself in segments. + ServiceName *string `type:"string"` + + // Matches the origin that the service uses to identify its type in segments. + ServiceType *string `type:"string"` + + // Matches the path from a request URL. + URLPath *string `type:"string"` +} + +// String returns the string representation +func (s SamplingRuleUpdate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SamplingRuleUpdate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SamplingRuleUpdate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SamplingRuleUpdate"} + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAttributes sets the Attributes field's value. +func (s *SamplingRuleUpdate) SetAttributes(v map[string]*string) *SamplingRuleUpdate { + s.Attributes = v + return s +} + +// SetFixedRate sets the FixedRate field's value. +func (s *SamplingRuleUpdate) SetFixedRate(v float64) *SamplingRuleUpdate { + s.FixedRate = &v + return s +} + +// SetHTTPMethod sets the HTTPMethod field's value. +func (s *SamplingRuleUpdate) SetHTTPMethod(v string) *SamplingRuleUpdate { + s.HTTPMethod = &v + return s +} + +// SetHost sets the Host field's value. +func (s *SamplingRuleUpdate) SetHost(v string) *SamplingRuleUpdate { + s.Host = &v + return s +} + +// SetPriority sets the Priority field's value. +func (s *SamplingRuleUpdate) SetPriority(v int64) *SamplingRuleUpdate { + s.Priority = &v + return s +} + +// SetReservoirSize sets the ReservoirSize field's value. +func (s *SamplingRuleUpdate) SetReservoirSize(v int64) *SamplingRuleUpdate { + s.ReservoirSize = &v + return s +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *SamplingRuleUpdate) SetResourceARN(v string) *SamplingRuleUpdate { + s.ResourceARN = &v + return s +} + +// SetRuleARN sets the RuleARN field's value. +func (s *SamplingRuleUpdate) SetRuleARN(v string) *SamplingRuleUpdate { + s.RuleARN = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *SamplingRuleUpdate) SetRuleName(v string) *SamplingRuleUpdate { + s.RuleName = &v + return s +} + +// SetServiceName sets the ServiceName field's value. +func (s *SamplingRuleUpdate) SetServiceName(v string) *SamplingRuleUpdate { + s.ServiceName = &v + return s +} + +// SetServiceType sets the ServiceType field's value. +func (s *SamplingRuleUpdate) SetServiceType(v string) *SamplingRuleUpdate { + s.ServiceType = &v + return s +} + +// SetURLPath sets the URLPath field's value. +func (s *SamplingRuleUpdate) SetURLPath(v string) *SamplingRuleUpdate { + s.URLPath = &v + return s +} + +// Aggregated request sampling data for a sampling rule across all services +// for a 10 second window. +type SamplingStatisticSummary struct { + _ struct{} `type:"structure"` + + // The number of requests recorded with borrowed reservoir quota. + BorrowCount *int64 `type:"integer"` + + // The number of requests that matched the rule. + RequestCount *int64 `type:"integer"` + + // The name of the sampling rule. + RuleName *string `type:"string"` + + // The number of requests recorded. + SampledCount *int64 `type:"integer"` + + // The start time of the reporting window. + Timestamp *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s SamplingStatisticSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SamplingStatisticSummary) GoString() string { + return s.String() +} + +// SetBorrowCount sets the BorrowCount field's value. +func (s *SamplingStatisticSummary) SetBorrowCount(v int64) *SamplingStatisticSummary { + s.BorrowCount = &v + return s +} + +// SetRequestCount sets the RequestCount field's value. +func (s *SamplingStatisticSummary) SetRequestCount(v int64) *SamplingStatisticSummary { + s.RequestCount = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *SamplingStatisticSummary) SetRuleName(v string) *SamplingStatisticSummary { + s.RuleName = &v + return s +} + +// SetSampledCount sets the SampledCount field's value. +func (s *SamplingStatisticSummary) SetSampledCount(v int64) *SamplingStatisticSummary { + s.SampledCount = &v + return s +} + +// SetTimestamp sets the Timestamp field's value. +func (s *SamplingStatisticSummary) SetTimestamp(v time.Time) *SamplingStatisticSummary { + s.Timestamp = &v + return s +} + +// Request sampling results for a single rule from a service. Results are for +// the last 10 seconds unless the service has been assigned a longer reporting +// interval after a previous call to GetSamplingTargets. +type SamplingStatisticsDocument struct { + _ struct{} `type:"structure"` + + // The number of requests recorded with borrowed reservoir quota. + BorrowCount *int64 `type:"integer"` + + // A unique identifier for the service in hexadecimal. + // + // ClientID is a required field + ClientID *string `min:"24" type:"string" required:"true"` + + // The number of requests that matched the rule. + // + // RequestCount is a required field + RequestCount *int64 `type:"integer" required:"true"` + + // The name of the sampling rule. + // + // RuleName is a required field + RuleName *string `min:"1" type:"string" required:"true"` + + // The number of requests recorded. + // + // SampledCount is a required field + SampledCount *int64 `type:"integer" required:"true"` + + // The current time. + // + // Timestamp is a required field + Timestamp *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s SamplingStatisticsDocument) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SamplingStatisticsDocument) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SamplingStatisticsDocument) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SamplingStatisticsDocument"} + if s.ClientID == nil { + invalidParams.Add(request.NewErrParamRequired("ClientID")) + } + if s.ClientID != nil && len(*s.ClientID) < 24 { + invalidParams.Add(request.NewErrParamMinLen("ClientID", 24)) + } + if s.RequestCount == nil { + invalidParams.Add(request.NewErrParamRequired("RequestCount")) + } + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.SampledCount == nil { + invalidParams.Add(request.NewErrParamRequired("SampledCount")) + } + if s.Timestamp == nil { + invalidParams.Add(request.NewErrParamRequired("Timestamp")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBorrowCount sets the BorrowCount field's value. +func (s *SamplingStatisticsDocument) SetBorrowCount(v int64) *SamplingStatisticsDocument { + s.BorrowCount = &v + return s +} + +// SetClientID sets the ClientID field's value. +func (s *SamplingStatisticsDocument) SetClientID(v string) *SamplingStatisticsDocument { + s.ClientID = &v + return s +} + +// SetRequestCount sets the RequestCount field's value. +func (s *SamplingStatisticsDocument) SetRequestCount(v int64) *SamplingStatisticsDocument { + s.RequestCount = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *SamplingStatisticsDocument) SetRuleName(v string) *SamplingStatisticsDocument { + s.RuleName = &v + return s +} + +// SetSampledCount sets the SampledCount field's value. +func (s *SamplingStatisticsDocument) SetSampledCount(v int64) *SamplingStatisticsDocument { + s.SampledCount = &v + return s +} + +// SetTimestamp sets the Timestamp field's value. +func (s *SamplingStatisticsDocument) SetTimestamp(v time.Time) *SamplingStatisticsDocument { + s.Timestamp = &v + return s +} + +// Temporary changes to a sampling rule configuration. To meet the global sampling +// target for a rule, X-Ray calculates a new reservoir for each service based +// on the recent sampling results of all services that called GetSamplingTargets. +type SamplingTargetDocument struct { + _ struct{} `type:"structure"` + + // The percentage of matching requests to instrument, after the reservoir is + // exhausted. + FixedRate *float64 `type:"double"` + + // The number of seconds for the service to wait before getting sampling targets + // again. + Interval *int64 `type:"integer"` + + // The number of requests per second that X-Ray allocated this service. + ReservoirQuota *int64 `type:"integer"` + + // When the reservoir quota expires. + ReservoirQuotaTTL *time.Time `type:"timestamp"` + + // The name of the sampling rule. + RuleName *string `type:"string"` +} + +// String returns the string representation +func (s SamplingTargetDocument) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SamplingTargetDocument) GoString() string { + return s.String() +} + +// SetFixedRate sets the FixedRate field's value. +func (s *SamplingTargetDocument) SetFixedRate(v float64) *SamplingTargetDocument { + s.FixedRate = &v + return s +} + +// SetInterval sets the Interval field's value. +func (s *SamplingTargetDocument) SetInterval(v int64) *SamplingTargetDocument { + s.Interval = &v + return s +} + +// SetReservoirQuota sets the ReservoirQuota field's value. +func (s *SamplingTargetDocument) SetReservoirQuota(v int64) *SamplingTargetDocument { + s.ReservoirQuota = &v + return s +} + +// SetReservoirQuotaTTL sets the ReservoirQuotaTTL field's value. +func (s *SamplingTargetDocument) SetReservoirQuotaTTL(v time.Time) *SamplingTargetDocument { + s.ReservoirQuotaTTL = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *SamplingTargetDocument) SetRuleName(v string) *SamplingTargetDocument { + s.RuleName = &v + return s +} + +// A segment from a trace that has been ingested by the X-Ray service. The segment +// can be compiled from documents uploaded with PutTraceSegments, or an inferred +// segment for a downstream service, generated from a subsegment sent by the +// service that called it. +// +// For the full segment document schema, see AWS X-Ray Segment Documents (https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html) +// in the AWS X-Ray Developer Guide. +type Segment struct { + _ struct{} `type:"structure"` + + // The segment document. + Document *string `min:"1" type:"string"` + + // The segment's ID. + Id *string `type:"string"` +} + +// String returns the string representation +func (s Segment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Segment) GoString() string { + return s.String() +} + +// SetDocument sets the Document field's value. +func (s *Segment) SetDocument(v string) *Segment { + s.Document = &v + return s +} + +// SetId sets the Id field's value. +func (s *Segment) SetId(v string) *Segment { + s.Id = &v + return s +} + +// Information about an application that processed requests, users that made +// requests, or downstream services, resources and applications that an application +// used. +type Service struct { + _ struct{} `type:"structure"` + + // Identifier of the AWS account in which the service runs. + AccountId *string `type:"string"` + + // A histogram that maps the spread of service durations. + DurationHistogram []*HistogramEntry `type:"list"` + + // Connections to downstream services. + Edges []*Edge `type:"list"` + + // The end time of the last segment that the service generated. + EndTime *time.Time `type:"timestamp"` + + // The canonical name of the service. + Name *string `type:"string"` + + // A list of names for the service, including the canonical name. + Names []*string `type:"list"` + + // Identifier for the service. Unique within the service map. + ReferenceId *int64 `type:"integer"` + + // A histogram that maps the spread of service response times. + ResponseTimeHistogram []*HistogramEntry `type:"list"` + + // Indicates that the service was the first service to process a request. + Root *bool `type:"boolean"` + + // The start time of the first segment that the service generated. + StartTime *time.Time `type:"timestamp"` + + // The service's state. + State *string `type:"string"` + + // Aggregated statistics for the service. + SummaryStatistics *ServiceStatistics `type:"structure"` + + // The type of service. + // + // * AWS Resource - The type of an AWS resource. For example, AWS::EC2::Instance + // for a application running on Amazon EC2 or AWS::DynamoDB::Table for an + // Amazon DynamoDB table that the application used. + // + // * AWS Service - The type of an AWS service. For example, AWS::DynamoDB + // for downstream calls to Amazon DynamoDB that didn't target a specific + // table. + // + // * client - Represents the clients that sent requests to a root service. + // + // * remote - A downstream service of indeterminate type. + Type *string `type:"string"` +} + +// String returns the string representation +func (s Service) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Service) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *Service) SetAccountId(v string) *Service { + s.AccountId = &v + return s +} + +// SetDurationHistogram sets the DurationHistogram field's value. +func (s *Service) SetDurationHistogram(v []*HistogramEntry) *Service { + s.DurationHistogram = v + return s +} + +// SetEdges sets the Edges field's value. +func (s *Service) SetEdges(v []*Edge) *Service { + s.Edges = v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *Service) SetEndTime(v time.Time) *Service { + s.EndTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *Service) SetName(v string) *Service { + s.Name = &v + return s +} + +// SetNames sets the Names field's value. +func (s *Service) SetNames(v []*string) *Service { + s.Names = v + return s +} + +// SetReferenceId sets the ReferenceId field's value. +func (s *Service) SetReferenceId(v int64) *Service { + s.ReferenceId = &v + return s +} + +// SetResponseTimeHistogram sets the ResponseTimeHistogram field's value. +func (s *Service) SetResponseTimeHistogram(v []*HistogramEntry) *Service { + s.ResponseTimeHistogram = v + return s +} + +// SetRoot sets the Root field's value. +func (s *Service) SetRoot(v bool) *Service { + s.Root = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *Service) SetStartTime(v time.Time) *Service { + s.StartTime = &v + return s +} + +// SetState sets the State field's value. +func (s *Service) SetState(v string) *Service { + s.State = &v + return s +} + +// SetSummaryStatistics sets the SummaryStatistics field's value. +func (s *Service) SetSummaryStatistics(v *ServiceStatistics) *Service { + s.SummaryStatistics = v + return s +} + +// SetType sets the Type field's value. +func (s *Service) SetType(v string) *Service { + s.Type = &v + return s +} + +type ServiceId struct { + _ struct{} `type:"structure"` + + AccountId *string `type:"string"` + + Name *string `type:"string"` + + Names []*string `type:"list"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s ServiceId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceId) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *ServiceId) SetAccountId(v string) *ServiceId { + s.AccountId = &v + return s +} + +// SetName sets the Name field's value. +func (s *ServiceId) SetName(v string) *ServiceId { + s.Name = &v + return s +} + +// SetNames sets the Names field's value. +func (s *ServiceId) SetNames(v []*string) *ServiceId { + s.Names = v + return s +} + +// SetType sets the Type field's value. +func (s *ServiceId) SetType(v string) *ServiceId { + s.Type = &v + return s +} + +// Response statistics for a service. +type ServiceStatistics struct { + _ struct{} `type:"structure"` + + // Information about requests that failed with a 4xx Client Error status code. + ErrorStatistics *ErrorStatistics `type:"structure"` + + // Information about requests that failed with a 5xx Server Error status code. + FaultStatistics *FaultStatistics `type:"structure"` + + // The number of requests that completed with a 2xx Success status code. + OkCount *int64 `type:"long"` + + // The total number of completed requests. + TotalCount *int64 `type:"long"` + + // The aggregate response time of completed requests. + TotalResponseTime *float64 `type:"double"` +} + +// String returns the string representation +func (s ServiceStatistics) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceStatistics) GoString() string { + return s.String() +} + +// SetErrorStatistics sets the ErrorStatistics field's value. +func (s *ServiceStatistics) SetErrorStatistics(v *ErrorStatistics) *ServiceStatistics { + s.ErrorStatistics = v + return s +} + +// SetFaultStatistics sets the FaultStatistics field's value. +func (s *ServiceStatistics) SetFaultStatistics(v *FaultStatistics) *ServiceStatistics { + s.FaultStatistics = v + return s +} + +// SetOkCount sets the OkCount field's value. +func (s *ServiceStatistics) SetOkCount(v int64) *ServiceStatistics { + s.OkCount = &v + return s +} + +// SetTotalCount sets the TotalCount field's value. +func (s *ServiceStatistics) SetTotalCount(v int64) *ServiceStatistics { + s.TotalCount = &v + return s +} + +// SetTotalResponseTime sets the TotalResponseTime field's value. +func (s *ServiceStatistics) SetTotalResponseTime(v float64) *ServiceStatistics { + s.TotalResponseTime = &v + return s +} + +type TelemetryRecord struct { + _ struct{} `type:"structure"` + + BackendConnectionErrors *BackendConnectionErrors `type:"structure"` + + SegmentsReceivedCount *int64 `type:"integer"` + + SegmentsRejectedCount *int64 `type:"integer"` + + SegmentsSentCount *int64 `type:"integer"` + + SegmentsSpilloverCount *int64 `type:"integer"` + + // Timestamp is a required field + Timestamp *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s TelemetryRecord) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TelemetryRecord) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TelemetryRecord) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TelemetryRecord"} + if s.Timestamp == nil { + invalidParams.Add(request.NewErrParamRequired("Timestamp")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBackendConnectionErrors sets the BackendConnectionErrors field's value. +func (s *TelemetryRecord) SetBackendConnectionErrors(v *BackendConnectionErrors) *TelemetryRecord { + s.BackendConnectionErrors = v + return s +} + +// SetSegmentsReceivedCount sets the SegmentsReceivedCount field's value. +func (s *TelemetryRecord) SetSegmentsReceivedCount(v int64) *TelemetryRecord { + s.SegmentsReceivedCount = &v + return s +} + +// SetSegmentsRejectedCount sets the SegmentsRejectedCount field's value. +func (s *TelemetryRecord) SetSegmentsRejectedCount(v int64) *TelemetryRecord { + s.SegmentsRejectedCount = &v + return s +} + +// SetSegmentsSentCount sets the SegmentsSentCount field's value. +func (s *TelemetryRecord) SetSegmentsSentCount(v int64) *TelemetryRecord { + s.SegmentsSentCount = &v + return s +} + +// SetSegmentsSpilloverCount sets the SegmentsSpilloverCount field's value. +func (s *TelemetryRecord) SetSegmentsSpilloverCount(v int64) *TelemetryRecord { + s.SegmentsSpilloverCount = &v + return s +} + +// SetTimestamp sets the Timestamp field's value. +func (s *TelemetryRecord) SetTimestamp(v time.Time) *TelemetryRecord { + s.Timestamp = &v + return s +} + +// A collection of segment documents with matching trace IDs. +type Trace struct { + _ struct{} `type:"structure"` + + // The length of time in seconds between the start time of the root segment + // and the end time of the last segment that completed. + Duration *float64 `type:"double"` + + // The unique identifier for the request that generated the trace's segments + // and subsegments. + Id *string `min:"1" type:"string"` + + // Segment documents for the segments and subsegments that comprise the trace. + Segments []*Segment `type:"list"` +} + +// String returns the string representation +func (s Trace) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Trace) GoString() string { + return s.String() +} + +// SetDuration sets the Duration field's value. +func (s *Trace) SetDuration(v float64) *Trace { + s.Duration = &v + return s +} + +// SetId sets the Id field's value. +func (s *Trace) SetId(v string) *Trace { + s.Id = &v + return s +} + +// SetSegments sets the Segments field's value. +func (s *Trace) SetSegments(v []*Segment) *Trace { + s.Segments = v + return s +} + +// Metadata generated from the segment documents in a trace. +type TraceSummary struct { + _ struct{} `type:"structure"` + + // Annotations from the trace's segment documents. + Annotations map[string][]*ValueWithServiceIds `type:"map"` + + // A list of availability zones for any zone corresponding to the trace segments. + AvailabilityZones []*AvailabilityZoneDetail `type:"list"` + + // The length of time in seconds between the start time of the root segment + // and the end time of the last segment that completed. + Duration *float64 `type:"double"` + + // The root of a trace. + EntryPoint *ServiceId `type:"structure"` + + // A collection of ErrorRootCause structures corresponding to the trace segments. + ErrorRootCauses []*ErrorRootCause `type:"list"` + + // A collection of FaultRootCause structures corresponding to the the trace + // segments. + FaultRootCauses []*FaultRootCause `type:"list"` + + // One or more of the segment documents has a 400 series error. + HasError *bool `type:"boolean"` + + // One or more of the segment documents has a 500 series error. + HasFault *bool `type:"boolean"` + + // One or more of the segment documents has a 429 throttling error. + HasThrottle *bool `type:"boolean"` + + // Information about the HTTP request served by the trace. + Http *Http `type:"structure"` + + // The unique identifier for the request that generated the trace's segments + // and subsegments. + Id *string `min:"1" type:"string"` + + // A list of EC2 instance IDs for any instance corresponding to the trace segments. + InstanceIds []*InstanceIdDetail `type:"list"` + + // One or more of the segment documents is in progress. + IsPartial *bool `type:"boolean"` + + // A list of resource ARNs for any resource corresponding to the trace segments. + ResourceARNs []*ResourceARNDetail `type:"list"` + + // The length of time in seconds between the start and end times of the root + // segment. If the service performs work asynchronously, the response time measures + // the time before the response is sent to the user, while the duration measures + // the amount of time before the last traced activity completes. + ResponseTime *float64 `type:"double"` + + // A collection of ResponseTimeRootCause structures corresponding to the trace + // segments. + ResponseTimeRootCauses []*ResponseTimeRootCause `type:"list"` + + // The revision number of a trace. + Revision *int64 `type:"integer"` + + // Service IDs from the trace's segment documents. + ServiceIds []*ServiceId `type:"list"` + + // Users from the trace's segment documents. + Users []*TraceUser `type:"list"` +} + +// String returns the string representation +func (s TraceSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TraceSummary) GoString() string { + return s.String() +} + +// SetAnnotations sets the Annotations field's value. +func (s *TraceSummary) SetAnnotations(v map[string][]*ValueWithServiceIds) *TraceSummary { + s.Annotations = v + return s +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *TraceSummary) SetAvailabilityZones(v []*AvailabilityZoneDetail) *TraceSummary { + s.AvailabilityZones = v + return s +} + +// SetDuration sets the Duration field's value. +func (s *TraceSummary) SetDuration(v float64) *TraceSummary { + s.Duration = &v + return s +} + +// SetEntryPoint sets the EntryPoint field's value. +func (s *TraceSummary) SetEntryPoint(v *ServiceId) *TraceSummary { + s.EntryPoint = v + return s +} + +// SetErrorRootCauses sets the ErrorRootCauses field's value. +func (s *TraceSummary) SetErrorRootCauses(v []*ErrorRootCause) *TraceSummary { + s.ErrorRootCauses = v + return s +} + +// SetFaultRootCauses sets the FaultRootCauses field's value. +func (s *TraceSummary) SetFaultRootCauses(v []*FaultRootCause) *TraceSummary { + s.FaultRootCauses = v + return s +} + +// SetHasError sets the HasError field's value. +func (s *TraceSummary) SetHasError(v bool) *TraceSummary { + s.HasError = &v + return s +} + +// SetHasFault sets the HasFault field's value. +func (s *TraceSummary) SetHasFault(v bool) *TraceSummary { + s.HasFault = &v + return s +} + +// SetHasThrottle sets the HasThrottle field's value. +func (s *TraceSummary) SetHasThrottle(v bool) *TraceSummary { + s.HasThrottle = &v + return s +} + +// SetHttp sets the Http field's value. +func (s *TraceSummary) SetHttp(v *Http) *TraceSummary { + s.Http = v + return s +} + +// SetId sets the Id field's value. +func (s *TraceSummary) SetId(v string) *TraceSummary { + s.Id = &v + return s +} + +// SetInstanceIds sets the InstanceIds field's value. +func (s *TraceSummary) SetInstanceIds(v []*InstanceIdDetail) *TraceSummary { + s.InstanceIds = v + return s +} + +// SetIsPartial sets the IsPartial field's value. +func (s *TraceSummary) SetIsPartial(v bool) *TraceSummary { + s.IsPartial = &v + return s +} + +// SetResourceARNs sets the ResourceARNs field's value. +func (s *TraceSummary) SetResourceARNs(v []*ResourceARNDetail) *TraceSummary { + s.ResourceARNs = v + return s +} + +// SetResponseTime sets the ResponseTime field's value. +func (s *TraceSummary) SetResponseTime(v float64) *TraceSummary { + s.ResponseTime = &v + return s +} + +// SetResponseTimeRootCauses sets the ResponseTimeRootCauses field's value. +func (s *TraceSummary) SetResponseTimeRootCauses(v []*ResponseTimeRootCause) *TraceSummary { + s.ResponseTimeRootCauses = v + return s +} + +// SetRevision sets the Revision field's value. +func (s *TraceSummary) SetRevision(v int64) *TraceSummary { + s.Revision = &v + return s +} + +// SetServiceIds sets the ServiceIds field's value. +func (s *TraceSummary) SetServiceIds(v []*ServiceId) *TraceSummary { + s.ServiceIds = v + return s +} + +// SetUsers sets the Users field's value. +func (s *TraceSummary) SetUsers(v []*TraceUser) *TraceSummary { + s.Users = v + return s +} + +// Information about a user recorded in segment documents. +type TraceUser struct { + _ struct{} `type:"structure"` + + // Services that the user's request hit. + ServiceIds []*ServiceId `type:"list"` + + // The user's name. + UserName *string `type:"string"` +} + +// String returns the string representation +func (s TraceUser) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TraceUser) GoString() string { + return s.String() +} + +// SetServiceIds sets the ServiceIds field's value. +func (s *TraceUser) SetServiceIds(v []*ServiceId) *TraceUser { + s.ServiceIds = v + return s +} + +// SetUserName sets the UserName field's value. +func (s *TraceUser) SetUserName(v string) *TraceUser { + s.UserName = &v + return s +} + +// Sampling statistics from a call to GetSamplingTargets that X-Ray could not +// process. +type UnprocessedStatistics struct { + _ struct{} `type:"structure"` + + // The error code. + ErrorCode *string `type:"string"` + + // The error message. + Message *string `type:"string"` + + // The name of the sampling rule. + RuleName *string `type:"string"` +} + +// String returns the string representation +func (s UnprocessedStatistics) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnprocessedStatistics) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *UnprocessedStatistics) SetErrorCode(v string) *UnprocessedStatistics { + s.ErrorCode = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *UnprocessedStatistics) SetMessage(v string) *UnprocessedStatistics { + s.Message = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *UnprocessedStatistics) SetRuleName(v string) *UnprocessedStatistics { + s.RuleName = &v + return s +} + +// Information about a segment that failed processing. +type UnprocessedTraceSegment struct { + _ struct{} `type:"structure"` + + // The error that caused processing to fail. + ErrorCode *string `type:"string"` + + // The segment's ID. + Id *string `type:"string"` + + // The error message. + Message *string `type:"string"` +} + +// String returns the string representation +func (s UnprocessedTraceSegment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnprocessedTraceSegment) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *UnprocessedTraceSegment) SetErrorCode(v string) *UnprocessedTraceSegment { + s.ErrorCode = &v + return s +} + +// SetId sets the Id field's value. +func (s *UnprocessedTraceSegment) SetId(v string) *UnprocessedTraceSegment { + s.Id = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *UnprocessedTraceSegment) SetMessage(v string) *UnprocessedTraceSegment { + s.Message = &v + return s +} + +type UpdateGroupInput struct { + _ struct{} `type:"structure"` + + // The updated filter expression defining criteria by which to group traces. + FilterExpression *string `min:"1" type:"string"` + + // The ARN that was generated upon creation. + GroupARN *string `min:"1" type:"string"` + + // The case-sensitive name of the group. + GroupName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateGroupInput"} + if s.FilterExpression != nil && len(*s.FilterExpression) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FilterExpression", 1)) + } + if s.GroupARN != nil && len(*s.GroupARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupARN", 1)) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilterExpression sets the FilterExpression field's value. +func (s *UpdateGroupInput) SetFilterExpression(v string) *UpdateGroupInput { + s.FilterExpression = &v + return s +} + +// SetGroupARN sets the GroupARN field's value. +func (s *UpdateGroupInput) SetGroupARN(v string) *UpdateGroupInput { + s.GroupARN = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *UpdateGroupInput) SetGroupName(v string) *UpdateGroupInput { + s.GroupName = &v + return s +} + +type UpdateGroupOutput struct { + _ struct{} `type:"structure"` + + // The group that was updated. Contains the name of the group that was updated, + // the ARN of the group that was updated, and the updated filter expression + // assigned to the group. + Group *Group `type:"structure"` +} + +// String returns the string representation +func (s UpdateGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateGroupOutput) GoString() string { + return s.String() +} + +// SetGroup sets the Group field's value. +func (s *UpdateGroupOutput) SetGroup(v *Group) *UpdateGroupOutput { + s.Group = v + return s +} + +type UpdateSamplingRuleInput struct { + _ struct{} `type:"structure"` + + // The rule and fields to change. + // + // SamplingRuleUpdate is a required field + SamplingRuleUpdate *SamplingRuleUpdate `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateSamplingRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSamplingRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateSamplingRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateSamplingRuleInput"} + if s.SamplingRuleUpdate == nil { + invalidParams.Add(request.NewErrParamRequired("SamplingRuleUpdate")) + } + if s.SamplingRuleUpdate != nil { + if err := s.SamplingRuleUpdate.Validate(); err != nil { + invalidParams.AddNested("SamplingRuleUpdate", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSamplingRuleUpdate sets the SamplingRuleUpdate field's value. +func (s *UpdateSamplingRuleInput) SetSamplingRuleUpdate(v *SamplingRuleUpdate) *UpdateSamplingRuleInput { + s.SamplingRuleUpdate = v + return s +} + +type UpdateSamplingRuleOutput struct { + _ struct{} `type:"structure"` + + // The updated rule definition and metadata. + SamplingRuleRecord *SamplingRuleRecord `type:"structure"` +} + +// String returns the string representation +func (s UpdateSamplingRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSamplingRuleOutput) GoString() string { + return s.String() +} + +// SetSamplingRuleRecord sets the SamplingRuleRecord field's value. +func (s *UpdateSamplingRuleOutput) SetSamplingRuleRecord(v *SamplingRuleRecord) *UpdateSamplingRuleOutput { + s.SamplingRuleRecord = v + return s +} + +// Information about a segment annotation. +type ValueWithServiceIds struct { + _ struct{} `type:"structure"` + + // Values of the annotation. + AnnotationValue *AnnotationValue `type:"structure"` + + // Services to which the annotation applies. + ServiceIds []*ServiceId `type:"list"` +} + +// String returns the string representation +func (s ValueWithServiceIds) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValueWithServiceIds) GoString() string { + return s.String() +} + +// SetAnnotationValue sets the AnnotationValue field's value. +func (s *ValueWithServiceIds) SetAnnotationValue(v *AnnotationValue) *ValueWithServiceIds { + s.AnnotationValue = v + return s +} + +// SetServiceIds sets the ServiceIds field's value. +func (s *ValueWithServiceIds) SetServiceIds(v []*ServiceId) *ValueWithServiceIds { + s.ServiceIds = v + return s +} + +const ( + // EncryptionStatusUpdating is a EncryptionStatus enum value + EncryptionStatusUpdating = "UPDATING" + + // EncryptionStatusActive is a EncryptionStatus enum value + EncryptionStatusActive = "ACTIVE" +) + +const ( + // EncryptionTypeNone is a EncryptionType enum value + EncryptionTypeNone = "NONE" + + // EncryptionTypeKms is a EncryptionType enum value + EncryptionTypeKms = "KMS" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/doc.go b/vendor/github.com/aws/aws-sdk-go/service/xray/doc.go new file mode 100644 index 00000000000..a33a8cc95b5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/xray/doc.go @@ -0,0 +1,29 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package xray provides the client and types for making API +// requests to AWS X-Ray. +// +// AWS X-Ray provides APIs for managing debug traces and retrieving service +// maps and other data created by processing those traces. +// +// See https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12 for more information on this service. +// +// See xray package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/xray/ +// +// Using the Client +// +// To contact AWS X-Ray with the SDK use the New function to create +// a new service client. With that client you can make API requests to the service. +// These clients are safe to use concurrently. +// +// See the SDK's documentation for more information on how to use the SDK. +// https://docs.aws.amazon.com/sdk-for-go/api/ +// +// See aws.Config documentation for more information on configuring SDK clients. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config +// +// See the AWS X-Ray client XRay for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/xray/#New +package xray diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go b/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go new file mode 100644 index 00000000000..7888dd20464 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go @@ -0,0 +1,24 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package xray + +const ( + + // ErrCodeInvalidRequestException for service response error code + // "InvalidRequestException". + // + // The request is missing required parameters or has invalid parameters. + ErrCodeInvalidRequestException = "InvalidRequestException" + + // ErrCodeRuleLimitExceededException for service response error code + // "RuleLimitExceededException". + // + // You have reached the maximum number of sampling rules. + ErrCodeRuleLimitExceededException = "RuleLimitExceededException" + + // ErrCodeThrottledException for service response error code + // "ThrottledException". + // + // The request exceeds the maximum number of requests per second. + ErrCodeThrottledException = "ThrottledException" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/service.go b/vendor/github.com/aws/aws-sdk-go/service/xray/service.go new file mode 100644 index 00000000000..fdc5ea32958 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/xray/service.go @@ -0,0 +1,95 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package xray + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +// XRay provides the API operation methods for making requests to +// AWS X-Ray. See this package's package overview docs +// for details on the service. +// +// XRay methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type XRay struct { + *client.Client +} + +// Used for custom client initialization logic +var initClient func(*client.Client) + +// Used for custom request initialization logic +var initRequest func(*request.Request) + +// Service information constants +const ( + ServiceName = "xray" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "XRay" // ServiceID is a unique identifer of a specific service. +) + +// New creates a new instance of the XRay client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a XRay client from just a session. +// svc := xray.New(mySession) +// +// // Create a XRay client with additional configuration +// svc := xray.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *XRay { + c := p.ClientConfig(EndpointsID, cfgs...) + return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *XRay { + svc := &XRay{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2016-04-12", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a XRay operation and runs any +// custom request initialization. +func (c *XRay) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(req) + } + + return req +} From 53286d8ec02a8115d086ef3f1dcb26560569359b Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 20:19:21 +0100 Subject: [PATCH 14/19] Add Xray in customizable endpoints --- website/docs/guides/custom-service-endpoints.html.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index eda8483e562..a56c74686ef 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -159,6 +159,7 @@ The Terraform AWS Provider allows the following endpoints to be customized: - `wafregional` - `worklink` - `workspaces` +- `xray` ## Connecting to Local AWS Compatible Solutions From d728cdfb462f54cd7bacf2449c18b68110def932 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 22:21:43 +0100 Subject: [PATCH 15/19] Revert to remove vendor changes --- aws/resource_aws_xray_sampling_rule.go | 8 + .../aws/aws-sdk-go/service/xray/api.go | 5837 ----------------- .../aws/aws-sdk-go/service/xray/doc.go | 29 - .../aws/aws-sdk-go/service/xray/errors.go | 24 - .../aws/aws-sdk-go/service/xray/service.go | 95 - vendor/modules.txt | 1 - .../guides/custom-service-endpoints.html.md | 1 - 7 files changed, 8 insertions(+), 5987 deletions(-) delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/xray/api.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/xray/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/xray/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/xray/service.go diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index babff5a6390..469b119e418 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -72,6 +72,14 @@ func resourceAwsXraySamplingRule() *schema.Resource { Type: schema.TypeMap, Optional: true, }, + "created_at": { + Type: schema.TypeString, + Computed: true, + }, + "modified_at": { + Type: schema.TypeString, + Computed: true, + }, "rule_arn": { Type: schema.TypeString, Computed: true, diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/api.go b/vendor/github.com/aws/aws-sdk-go/service/xray/api.go deleted file mode 100644 index 592de2f7b56..00000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/xray/api.go +++ /dev/null @@ -1,5837 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package xray - -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/restjson" -) - -const opBatchGetTraces = "BatchGetTraces" - -// BatchGetTracesRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetTraces operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See BatchGetTraces for more information on using the BatchGetTraces -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the BatchGetTracesRequest method. -// req, resp := client.BatchGetTracesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTraces -func (c *XRay) BatchGetTracesRequest(input *BatchGetTracesInput) (req *request.Request, output *BatchGetTracesOutput) { - op := &request.Operation{ - Name: opBatchGetTraces, - HTTPMethod: "POST", - HTTPPath: "/Traces", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &BatchGetTracesInput{} - } - - output = &BatchGetTracesOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetTraces API operation for AWS X-Ray. -// -// Retrieves a list of traces specified by ID. Each trace is a collection of -// segment documents that originates from a single request. Use GetTraceSummaries -// to get a list of trace IDs. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation BatchGetTraces for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTraces -func (c *XRay) BatchGetTraces(input *BatchGetTracesInput) (*BatchGetTracesOutput, error) { - req, out := c.BatchGetTracesRequest(input) - return out, req.Send() -} - -// BatchGetTracesWithContext is the same as BatchGetTraces with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetTraces for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) BatchGetTracesWithContext(ctx aws.Context, input *BatchGetTracesInput, opts ...request.Option) (*BatchGetTracesOutput, error) { - req, out := c.BatchGetTracesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// BatchGetTracesPages iterates over the pages of a BatchGetTraces operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See BatchGetTraces method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a BatchGetTraces operation. -// pageNum := 0 -// err := client.BatchGetTracesPages(params, -// func(page *BatchGetTracesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *XRay) BatchGetTracesPages(input *BatchGetTracesInput, fn func(*BatchGetTracesOutput, bool) bool) error { - return c.BatchGetTracesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// BatchGetTracesPagesWithContext same as BatchGetTracesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) BatchGetTracesPagesWithContext(ctx aws.Context, input *BatchGetTracesInput, fn func(*BatchGetTracesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *BatchGetTracesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.BatchGetTracesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*BatchGetTracesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opCreateGroup = "CreateGroup" - -// CreateGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateGroup for more information on using the CreateGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateGroupRequest method. -// req, resp := client.CreateGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateGroup -func (c *XRay) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput) { - op := &request.Operation{ - Name: opCreateGroup, - HTTPMethod: "POST", - HTTPPath: "/CreateGroup", - } - - if input == nil { - input = &CreateGroupInput{} - } - - output = &CreateGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateGroup API operation for AWS X-Ray. -// -// Creates a group resource with a name and a filter expression. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation CreateGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateGroup -func (c *XRay) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) { - req, out := c.CreateGroupRequest(input) - 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 *XRay) 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 opCreateSamplingRule = "CreateSamplingRule" - -// CreateSamplingRuleRequest generates a "aws/request.Request" representing the -// client's request for the CreateSamplingRule operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateSamplingRule for more information on using the CreateSamplingRule -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateSamplingRuleRequest method. -// req, resp := client.CreateSamplingRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateSamplingRule -func (c *XRay) CreateSamplingRuleRequest(input *CreateSamplingRuleInput) (req *request.Request, output *CreateSamplingRuleOutput) { - op := &request.Operation{ - Name: opCreateSamplingRule, - HTTPMethod: "POST", - HTTPPath: "/CreateSamplingRule", - } - - if input == nil { - input = &CreateSamplingRuleInput{} - } - - output = &CreateSamplingRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSamplingRule API operation for AWS X-Ray. -// -// Creates a rule to control sampling behavior for instrumented applications. -// Services retrieve rules with GetSamplingRules, and evaluate each rule in -// ascending order of priority for each request. If a rule matches, the service -// records a trace, borrowing it from the reservoir size. After 10 seconds, -// the service reports back to X-Ray with GetSamplingTargets to get updated -// versions of each in-use rule. The updated rule contains a trace quota that -// the service can use instead of borrowing from the reservoir. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation CreateSamplingRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// * ErrCodeRuleLimitExceededException "RuleLimitExceededException" -// You have reached the maximum number of sampling rules. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateSamplingRule -func (c *XRay) CreateSamplingRule(input *CreateSamplingRuleInput) (*CreateSamplingRuleOutput, error) { - req, out := c.CreateSamplingRuleRequest(input) - return out, req.Send() -} - -// CreateSamplingRuleWithContext is the same as CreateSamplingRule with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSamplingRule for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) CreateSamplingRuleWithContext(ctx aws.Context, input *CreateSamplingRuleInput, opts ...request.Option) (*CreateSamplingRuleOutput, error) { - req, out := c.CreateSamplingRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteGroup = "DeleteGroup" - -// DeleteGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteGroup for more information on using the DeleteGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteGroupRequest method. -// req, resp := client.DeleteGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteGroup -func (c *XRay) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) { - op := &request.Operation{ - Name: opDeleteGroup, - HTTPMethod: "POST", - HTTPPath: "/DeleteGroup", - } - - if input == nil { - input = &DeleteGroupInput{} - } - - output = &DeleteGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteGroup API operation for AWS X-Ray. -// -// Deletes a group resource. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation DeleteGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteGroup -func (c *XRay) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { - req, out := c.DeleteGroupRequest(input) - 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 *XRay) 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 opDeleteSamplingRule = "DeleteSamplingRule" - -// DeleteSamplingRuleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSamplingRule operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteSamplingRule for more information on using the DeleteSamplingRule -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteSamplingRuleRequest method. -// req, resp := client.DeleteSamplingRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteSamplingRule -func (c *XRay) DeleteSamplingRuleRequest(input *DeleteSamplingRuleInput) (req *request.Request, output *DeleteSamplingRuleOutput) { - op := &request.Operation{ - Name: opDeleteSamplingRule, - HTTPMethod: "POST", - HTTPPath: "/DeleteSamplingRule", - } - - if input == nil { - input = &DeleteSamplingRuleInput{} - } - - output = &DeleteSamplingRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteSamplingRule API operation for AWS X-Ray. -// -// Deletes a sampling rule. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation DeleteSamplingRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteSamplingRule -func (c *XRay) DeleteSamplingRule(input *DeleteSamplingRuleInput) (*DeleteSamplingRuleOutput, error) { - req, out := c.DeleteSamplingRuleRequest(input) - return out, req.Send() -} - -// DeleteSamplingRuleWithContext is the same as DeleteSamplingRule with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSamplingRule for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) DeleteSamplingRuleWithContext(ctx aws.Context, input *DeleteSamplingRuleInput, opts ...request.Option) (*DeleteSamplingRuleOutput, error) { - req, out := c.DeleteSamplingRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEncryptionConfig = "GetEncryptionConfig" - -// GetEncryptionConfigRequest generates a "aws/request.Request" representing the -// client's request for the GetEncryptionConfig operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetEncryptionConfig for more information on using the GetEncryptionConfig -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetEncryptionConfigRequest method. -// req, resp := client.GetEncryptionConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetEncryptionConfig -func (c *XRay) GetEncryptionConfigRequest(input *GetEncryptionConfigInput) (req *request.Request, output *GetEncryptionConfigOutput) { - op := &request.Operation{ - Name: opGetEncryptionConfig, - HTTPMethod: "POST", - HTTPPath: "/EncryptionConfig", - } - - if input == nil { - input = &GetEncryptionConfigInput{} - } - - output = &GetEncryptionConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEncryptionConfig API operation for AWS X-Ray. -// -// Retrieves the current encryption configuration for X-Ray data. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation GetEncryptionConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetEncryptionConfig -func (c *XRay) GetEncryptionConfig(input *GetEncryptionConfigInput) (*GetEncryptionConfigOutput, error) { - req, out := c.GetEncryptionConfigRequest(input) - return out, req.Send() -} - -// GetEncryptionConfigWithContext is the same as GetEncryptionConfig with the addition of -// the ability to pass a context and additional request options. -// -// See GetEncryptionConfig for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetEncryptionConfigWithContext(ctx aws.Context, input *GetEncryptionConfigInput, opts ...request.Option) (*GetEncryptionConfigOutput, error) { - req, out := c.GetEncryptionConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetGroup = "GetGroup" - -// GetGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetGroup for more information on using the GetGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetGroupRequest method. -// req, resp := client.GetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroup -func (c *XRay) GetGroupRequest(input *GetGroupInput) (req *request.Request, output *GetGroupOutput) { - op := &request.Operation{ - Name: opGetGroup, - HTTPMethod: "POST", - HTTPPath: "/GetGroup", - } - - if input == nil { - input = &GetGroupInput{} - } - - output = &GetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGroup API operation for AWS X-Ray. -// -// Retrieves group resource details. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation GetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroup -func (c *XRay) GetGroup(input *GetGroupInput) (*GetGroupOutput, error) { - req, out := c.GetGroupRequest(input) - 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 *XRay) 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() -} - -const opGetGroups = "GetGroups" - -// GetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the GetGroups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetGroups for more information on using the GetGroups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetGroupsRequest method. -// req, resp := client.GetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroups -func (c *XRay) GetGroupsRequest(input *GetGroupsInput) (req *request.Request, output *GetGroupsOutput) { - op := &request.Operation{ - Name: opGetGroups, - HTTPMethod: "POST", - HTTPPath: "/Groups", - } - - if input == nil { - input = &GetGroupsInput{} - } - - output = &GetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGroups API operation for AWS X-Ray. -// -// Retrieves all active group details. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation GetGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroups -func (c *XRay) GetGroups(input *GetGroupsInput) (*GetGroupsOutput, error) { - req, out := c.GetGroupsRequest(input) - return out, req.Send() -} - -// GetGroupsWithContext is the same as GetGroups with the addition of -// the ability to pass a context and additional request options. -// -// See GetGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetGroupsWithContext(ctx aws.Context, input *GetGroupsInput, opts ...request.Option) (*GetGroupsOutput, error) { - req, out := c.GetGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSamplingRules = "GetSamplingRules" - -// GetSamplingRulesRequest generates a "aws/request.Request" representing the -// client's request for the GetSamplingRules operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetSamplingRules for more information on using the GetSamplingRules -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetSamplingRulesRequest method. -// req, resp := client.GetSamplingRulesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingRules -func (c *XRay) GetSamplingRulesRequest(input *GetSamplingRulesInput) (req *request.Request, output *GetSamplingRulesOutput) { - op := &request.Operation{ - Name: opGetSamplingRules, - HTTPMethod: "POST", - HTTPPath: "/GetSamplingRules", - } - - if input == nil { - input = &GetSamplingRulesInput{} - } - - output = &GetSamplingRulesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSamplingRules API operation for AWS X-Ray. -// -// Retrieves all sampling rules. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation GetSamplingRules for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingRules -func (c *XRay) GetSamplingRules(input *GetSamplingRulesInput) (*GetSamplingRulesOutput, error) { - req, out := c.GetSamplingRulesRequest(input) - return out, req.Send() -} - -// GetSamplingRulesWithContext is the same as GetSamplingRules with the addition of -// the ability to pass a context and additional request options. -// -// See GetSamplingRules for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetSamplingRulesWithContext(ctx aws.Context, input *GetSamplingRulesInput, opts ...request.Option) (*GetSamplingRulesOutput, error) { - req, out := c.GetSamplingRulesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSamplingStatisticSummaries = "GetSamplingStatisticSummaries" - -// GetSamplingStatisticSummariesRequest generates a "aws/request.Request" representing the -// client's request for the GetSamplingStatisticSummaries operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetSamplingStatisticSummaries for more information on using the GetSamplingStatisticSummaries -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetSamplingStatisticSummariesRequest method. -// req, resp := client.GetSamplingStatisticSummariesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingStatisticSummaries -func (c *XRay) GetSamplingStatisticSummariesRequest(input *GetSamplingStatisticSummariesInput) (req *request.Request, output *GetSamplingStatisticSummariesOutput) { - op := &request.Operation{ - Name: opGetSamplingStatisticSummaries, - HTTPMethod: "POST", - HTTPPath: "/SamplingStatisticSummaries", - } - - if input == nil { - input = &GetSamplingStatisticSummariesInput{} - } - - output = &GetSamplingStatisticSummariesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSamplingStatisticSummaries API operation for AWS X-Ray. -// -// Retrieves information about recent sampling results for all sampling rules. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation GetSamplingStatisticSummaries for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingStatisticSummaries -func (c *XRay) GetSamplingStatisticSummaries(input *GetSamplingStatisticSummariesInput) (*GetSamplingStatisticSummariesOutput, error) { - req, out := c.GetSamplingStatisticSummariesRequest(input) - return out, req.Send() -} - -// GetSamplingStatisticSummariesWithContext is the same as GetSamplingStatisticSummaries with the addition of -// the ability to pass a context and additional request options. -// -// See GetSamplingStatisticSummaries for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetSamplingStatisticSummariesWithContext(ctx aws.Context, input *GetSamplingStatisticSummariesInput, opts ...request.Option) (*GetSamplingStatisticSummariesOutput, error) { - req, out := c.GetSamplingStatisticSummariesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSamplingTargets = "GetSamplingTargets" - -// GetSamplingTargetsRequest generates a "aws/request.Request" representing the -// client's request for the GetSamplingTargets operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetSamplingTargets for more information on using the GetSamplingTargets -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetSamplingTargetsRequest method. -// req, resp := client.GetSamplingTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingTargets -func (c *XRay) GetSamplingTargetsRequest(input *GetSamplingTargetsInput) (req *request.Request, output *GetSamplingTargetsOutput) { - op := &request.Operation{ - Name: opGetSamplingTargets, - HTTPMethod: "POST", - HTTPPath: "/SamplingTargets", - } - - if input == nil { - input = &GetSamplingTargetsInput{} - } - - output = &GetSamplingTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSamplingTargets API operation for AWS X-Ray. -// -// Requests a sampling quota for rules that the service is using to sample requests. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation GetSamplingTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingTargets -func (c *XRay) GetSamplingTargets(input *GetSamplingTargetsInput) (*GetSamplingTargetsOutput, error) { - req, out := c.GetSamplingTargetsRequest(input) - return out, req.Send() -} - -// GetSamplingTargetsWithContext is the same as GetSamplingTargets with the addition of -// the ability to pass a context and additional request options. -// -// See GetSamplingTargets for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetSamplingTargetsWithContext(ctx aws.Context, input *GetSamplingTargetsInput, opts ...request.Option) (*GetSamplingTargetsOutput, error) { - req, out := c.GetSamplingTargetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetServiceGraph = "GetServiceGraph" - -// GetServiceGraphRequest generates a "aws/request.Request" representing the -// client's request for the GetServiceGraph operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetServiceGraph for more information on using the GetServiceGraph -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetServiceGraphRequest method. -// req, resp := client.GetServiceGraphRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetServiceGraph -func (c *XRay) GetServiceGraphRequest(input *GetServiceGraphInput) (req *request.Request, output *GetServiceGraphOutput) { - op := &request.Operation{ - Name: opGetServiceGraph, - HTTPMethod: "POST", - HTTPPath: "/ServiceGraph", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetServiceGraphInput{} - } - - output = &GetServiceGraphOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetServiceGraph API operation for AWS X-Ray. -// -// Retrieves a document that describes services that process incoming requests, -// and downstream services that they call as a result. Root services process -// incoming requests and make calls to downstream services. Root services are -// applications that use the AWS X-Ray SDK. Downstream services can be other -// applications, AWS resources, HTTP web APIs, or SQL databases. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation GetServiceGraph for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetServiceGraph -func (c *XRay) GetServiceGraph(input *GetServiceGraphInput) (*GetServiceGraphOutput, error) { - req, out := c.GetServiceGraphRequest(input) - return out, req.Send() -} - -// GetServiceGraphWithContext is the same as GetServiceGraph with the addition of -// the ability to pass a context and additional request options. -// -// See GetServiceGraph for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetServiceGraphWithContext(ctx aws.Context, input *GetServiceGraphInput, opts ...request.Option) (*GetServiceGraphOutput, error) { - req, out := c.GetServiceGraphRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetServiceGraphPages iterates over the pages of a GetServiceGraph operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetServiceGraph method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetServiceGraph operation. -// pageNum := 0 -// err := client.GetServiceGraphPages(params, -// func(page *GetServiceGraphOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *XRay) GetServiceGraphPages(input *GetServiceGraphInput, fn func(*GetServiceGraphOutput, bool) bool) error { - return c.GetServiceGraphPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetServiceGraphPagesWithContext same as GetServiceGraphPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetServiceGraphPagesWithContext(ctx aws.Context, input *GetServiceGraphInput, fn func(*GetServiceGraphOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetServiceGraphInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetServiceGraphRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetServiceGraphOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opGetTraceGraph = "GetTraceGraph" - -// GetTraceGraphRequest generates a "aws/request.Request" representing the -// client's request for the GetTraceGraph operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetTraceGraph for more information on using the GetTraceGraph -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetTraceGraphRequest method. -// req, resp := client.GetTraceGraphRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceGraph -func (c *XRay) GetTraceGraphRequest(input *GetTraceGraphInput) (req *request.Request, output *GetTraceGraphOutput) { - op := &request.Operation{ - Name: opGetTraceGraph, - HTTPMethod: "POST", - HTTPPath: "/TraceGraph", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetTraceGraphInput{} - } - - output = &GetTraceGraphOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTraceGraph API operation for AWS X-Ray. -// -// Retrieves a service graph for one or more specific trace IDs. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation GetTraceGraph for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceGraph -func (c *XRay) GetTraceGraph(input *GetTraceGraphInput) (*GetTraceGraphOutput, error) { - req, out := c.GetTraceGraphRequest(input) - return out, req.Send() -} - -// GetTraceGraphWithContext is the same as GetTraceGraph with the addition of -// the ability to pass a context and additional request options. -// -// See GetTraceGraph for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetTraceGraphWithContext(ctx aws.Context, input *GetTraceGraphInput, opts ...request.Option) (*GetTraceGraphOutput, error) { - req, out := c.GetTraceGraphRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetTraceGraphPages iterates over the pages of a GetTraceGraph operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTraceGraph method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetTraceGraph operation. -// pageNum := 0 -// err := client.GetTraceGraphPages(params, -// func(page *GetTraceGraphOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *XRay) GetTraceGraphPages(input *GetTraceGraphInput, fn func(*GetTraceGraphOutput, bool) bool) error { - return c.GetTraceGraphPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTraceGraphPagesWithContext same as GetTraceGraphPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetTraceGraphPagesWithContext(ctx aws.Context, input *GetTraceGraphInput, fn func(*GetTraceGraphOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetTraceGraphInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetTraceGraphRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTraceGraphOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opGetTraceSummaries = "GetTraceSummaries" - -// GetTraceSummariesRequest generates a "aws/request.Request" representing the -// client's request for the GetTraceSummaries operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetTraceSummaries for more information on using the GetTraceSummaries -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetTraceSummariesRequest method. -// req, resp := client.GetTraceSummariesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceSummaries -func (c *XRay) GetTraceSummariesRequest(input *GetTraceSummariesInput) (req *request.Request, output *GetTraceSummariesOutput) { - op := &request.Operation{ - Name: opGetTraceSummaries, - HTTPMethod: "POST", - HTTPPath: "/TraceSummaries", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetTraceSummariesInput{} - } - - output = &GetTraceSummariesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTraceSummaries API operation for AWS X-Ray. -// -// Retrieves IDs and metadata for traces available for a specified time frame -// using an optional filter. To get the full traces, pass the trace IDs to BatchGetTraces. -// -// A filter expression can target traced requests that hit specific service -// nodes or edges, have errors, or come from a known user. For example, the -// following filter expression targets traces that pass through api.example.com: -// -// service("api.example.com") -// -// This filter expression finds traces that have an annotation named account -// with the value 12345: -// -// annotation.account = "12345" -// -// For a full list of indexed fields and keywords that you can use in filter -// expressions, see Using Filter Expressions (http://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html) -// in the AWS X-Ray Developer Guide. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation GetTraceSummaries for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceSummaries -func (c *XRay) GetTraceSummaries(input *GetTraceSummariesInput) (*GetTraceSummariesOutput, error) { - req, out := c.GetTraceSummariesRequest(input) - return out, req.Send() -} - -// GetTraceSummariesWithContext is the same as GetTraceSummaries with the addition of -// the ability to pass a context and additional request options. -// -// See GetTraceSummaries for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetTraceSummariesWithContext(ctx aws.Context, input *GetTraceSummariesInput, opts ...request.Option) (*GetTraceSummariesOutput, error) { - req, out := c.GetTraceSummariesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetTraceSummariesPages iterates over the pages of a GetTraceSummaries operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTraceSummaries method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetTraceSummaries operation. -// pageNum := 0 -// err := client.GetTraceSummariesPages(params, -// func(page *GetTraceSummariesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *XRay) GetTraceSummariesPages(input *GetTraceSummariesInput, fn func(*GetTraceSummariesOutput, bool) bool) error { - return c.GetTraceSummariesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTraceSummariesPagesWithContext same as GetTraceSummariesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) GetTraceSummariesPagesWithContext(ctx aws.Context, input *GetTraceSummariesInput, fn func(*GetTraceSummariesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetTraceSummariesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetTraceSummariesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTraceSummariesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opPutEncryptionConfig = "PutEncryptionConfig" - -// PutEncryptionConfigRequest generates a "aws/request.Request" representing the -// client's request for the PutEncryptionConfig operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutEncryptionConfig for more information on using the PutEncryptionConfig -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the PutEncryptionConfigRequest method. -// req, resp := client.PutEncryptionConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutEncryptionConfig -func (c *XRay) PutEncryptionConfigRequest(input *PutEncryptionConfigInput) (req *request.Request, output *PutEncryptionConfigOutput) { - op := &request.Operation{ - Name: opPutEncryptionConfig, - HTTPMethod: "POST", - HTTPPath: "/PutEncryptionConfig", - } - - if input == nil { - input = &PutEncryptionConfigInput{} - } - - output = &PutEncryptionConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutEncryptionConfig API operation for AWS X-Ray. -// -// Updates the encryption configuration for X-Ray data. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation PutEncryptionConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutEncryptionConfig -func (c *XRay) PutEncryptionConfig(input *PutEncryptionConfigInput) (*PutEncryptionConfigOutput, error) { - req, out := c.PutEncryptionConfigRequest(input) - return out, req.Send() -} - -// PutEncryptionConfigWithContext is the same as PutEncryptionConfig with the addition of -// the ability to pass a context and additional request options. -// -// See PutEncryptionConfig for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) PutEncryptionConfigWithContext(ctx aws.Context, input *PutEncryptionConfigInput, opts ...request.Option) (*PutEncryptionConfigOutput, error) { - req, out := c.PutEncryptionConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutTelemetryRecords = "PutTelemetryRecords" - -// PutTelemetryRecordsRequest generates a "aws/request.Request" representing the -// client's request for the PutTelemetryRecords operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutTelemetryRecords for more information on using the PutTelemetryRecords -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the PutTelemetryRecordsRequest method. -// req, resp := client.PutTelemetryRecordsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTelemetryRecords -func (c *XRay) PutTelemetryRecordsRequest(input *PutTelemetryRecordsInput) (req *request.Request, output *PutTelemetryRecordsOutput) { - op := &request.Operation{ - Name: opPutTelemetryRecords, - HTTPMethod: "POST", - HTTPPath: "/TelemetryRecords", - } - - if input == nil { - input = &PutTelemetryRecordsInput{} - } - - output = &PutTelemetryRecordsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutTelemetryRecords API operation for AWS X-Ray. -// -// Used by the AWS X-Ray daemon to upload telemetry. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation PutTelemetryRecords for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTelemetryRecords -func (c *XRay) PutTelemetryRecords(input *PutTelemetryRecordsInput) (*PutTelemetryRecordsOutput, error) { - req, out := c.PutTelemetryRecordsRequest(input) - return out, req.Send() -} - -// PutTelemetryRecordsWithContext is the same as PutTelemetryRecords with the addition of -// the ability to pass a context and additional request options. -// -// See PutTelemetryRecords for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) PutTelemetryRecordsWithContext(ctx aws.Context, input *PutTelemetryRecordsInput, opts ...request.Option) (*PutTelemetryRecordsOutput, error) { - req, out := c.PutTelemetryRecordsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutTraceSegments = "PutTraceSegments" - -// PutTraceSegmentsRequest generates a "aws/request.Request" representing the -// client's request for the PutTraceSegments operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutTraceSegments for more information on using the PutTraceSegments -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the PutTraceSegmentsRequest method. -// req, resp := client.PutTraceSegmentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTraceSegments -func (c *XRay) PutTraceSegmentsRequest(input *PutTraceSegmentsInput) (req *request.Request, output *PutTraceSegmentsOutput) { - op := &request.Operation{ - Name: opPutTraceSegments, - HTTPMethod: "POST", - HTTPPath: "/TraceSegments", - } - - if input == nil { - input = &PutTraceSegmentsInput{} - } - - output = &PutTraceSegmentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutTraceSegments API operation for AWS X-Ray. -// -// Uploads segment documents to AWS X-Ray. The X-Ray SDK generates segment documents -// and sends them to the X-Ray daemon, which uploads them in batches. A segment -// document can be a completed segment, an in-progress segment, or an array -// of subsegments. -// -// Segments must include the following fields. For the full segment document -// schema, see AWS X-Ray Segment Documents (https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html) -// in the AWS X-Ray Developer Guide. -// -// Required Segment Document Fields -// -// * name - The name of the service that handled the request. -// -// * id - A 64-bit identifier for the segment, unique among segments in the -// same trace, in 16 hexadecimal digits. -// -// * trace_id - A unique identifier that connects all segments and subsegments -// originating from a single client request. -// -// * start_time - Time the segment or subsegment was created, in floating -// point seconds in epoch time, accurate to milliseconds. For example, 1480615200.010 -// or 1.480615200010E9. -// -// * end_time - Time the segment or subsegment was closed. For example, 1480615200.090 -// or 1.480615200090E9. Specify either an end_time or in_progress. -// -// * in_progress - Set to true instead of specifying an end_time to record -// that a segment has been started, but is not complete. Send an in progress -// segment when your application receives a request that will take a long -// time to serve, to trace the fact that the request was received. When the -// response is sent, send the complete segment to overwrite the in-progress -// segment. -// -// A trace_id consists of three numbers separated by hyphens. For example, 1-58406520-a006649127e371903a2de979. -// This includes: -// -// Trace ID Format -// -// * The version number, i.e. 1. -// -// * The time of the original request, in Unix epoch time, in 8 hexadecimal -// digits. For example, 10:00AM December 2nd, 2016 PST in epoch time is 1480615200 -// seconds, or 58406520 in hexadecimal. -// -// * A 96-bit identifier for the trace, globally unique, in 24 hexadecimal -// digits. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation PutTraceSegments for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTraceSegments -func (c *XRay) PutTraceSegments(input *PutTraceSegmentsInput) (*PutTraceSegmentsOutput, error) { - req, out := c.PutTraceSegmentsRequest(input) - return out, req.Send() -} - -// PutTraceSegmentsWithContext is the same as PutTraceSegments with the addition of -// the ability to pass a context and additional request options. -// -// See PutTraceSegments for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) PutTraceSegmentsWithContext(ctx aws.Context, input *PutTraceSegmentsInput, opts ...request.Option) (*PutTraceSegmentsOutput, error) { - req, out := c.PutTraceSegmentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateGroup = "UpdateGroup" - -// UpdateGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateGroup for more information on using the UpdateGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateGroupRequest method. -// req, resp := client.UpdateGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateGroup -func (c *XRay) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, output *UpdateGroupOutput) { - op := &request.Operation{ - Name: opUpdateGroup, - HTTPMethod: "POST", - HTTPPath: "/UpdateGroup", - } - - if input == nil { - input = &UpdateGroupInput{} - } - - output = &UpdateGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateGroup API operation for AWS X-Ray. -// -// Updates a group resource. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation UpdateGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateGroup -func (c *XRay) UpdateGroup(input *UpdateGroupInput) (*UpdateGroupOutput, error) { - req, out := c.UpdateGroupRequest(input) - 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 *XRay) 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 opUpdateSamplingRule = "UpdateSamplingRule" - -// UpdateSamplingRuleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSamplingRule operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateSamplingRule for more information on using the UpdateSamplingRule -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateSamplingRuleRequest method. -// req, resp := client.UpdateSamplingRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateSamplingRule -func (c *XRay) UpdateSamplingRuleRequest(input *UpdateSamplingRuleInput) (req *request.Request, output *UpdateSamplingRuleOutput) { - op := &request.Operation{ - Name: opUpdateSamplingRule, - HTTPMethod: "POST", - HTTPPath: "/UpdateSamplingRule", - } - - if input == nil { - input = &UpdateSamplingRuleInput{} - } - - output = &UpdateSamplingRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSamplingRule API operation for AWS X-Ray. -// -// Modifies a sampling rule's configuration. -// -// 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. -// -// See the AWS API reference guide for AWS X-Ray's -// API operation UpdateSamplingRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is missing required parameters or has invalid parameters. -// -// * ErrCodeThrottledException "ThrottledException" -// The request exceeds the maximum number of requests per second. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateSamplingRule -func (c *XRay) UpdateSamplingRule(input *UpdateSamplingRuleInput) (*UpdateSamplingRuleOutput, error) { - req, out := c.UpdateSamplingRuleRequest(input) - return out, req.Send() -} - -// UpdateSamplingRuleWithContext is the same as UpdateSamplingRule with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSamplingRule for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *XRay) UpdateSamplingRuleWithContext(ctx aws.Context, input *UpdateSamplingRuleInput, opts ...request.Option) (*UpdateSamplingRuleOutput, error) { - req, out := c.UpdateSamplingRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// An alias for an edge. -type Alias struct { - _ struct{} `type:"structure"` - - // The canonical name of the alias. - Name *string `type:"string"` - - // A list of names for the alias, including the canonical name. - Names []*string `type:"list"` - - // The type of the alias. - Type *string `type:"string"` -} - -// String returns the string representation -func (s Alias) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Alias) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Alias) SetName(v string) *Alias { - s.Name = &v - return s -} - -// SetNames sets the Names field's value. -func (s *Alias) SetNames(v []*string) *Alias { - s.Names = v - return s -} - -// SetType sets the Type field's value. -func (s *Alias) SetType(v string) *Alias { - s.Type = &v - return s -} - -// Value of a segment annotation. Has one of three value types: Number, Boolean -// or String. -type AnnotationValue struct { - _ struct{} `type:"structure"` - - // Value for a Boolean annotation. - BooleanValue *bool `type:"boolean"` - - // Value for a Number annotation. - NumberValue *float64 `type:"double"` - - // Value for a String annotation. - StringValue *string `type:"string"` -} - -// String returns the string representation -func (s AnnotationValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AnnotationValue) GoString() string { - return s.String() -} - -// SetBooleanValue sets the BooleanValue field's value. -func (s *AnnotationValue) SetBooleanValue(v bool) *AnnotationValue { - s.BooleanValue = &v - return s -} - -// SetNumberValue sets the NumberValue field's value. -func (s *AnnotationValue) SetNumberValue(v float64) *AnnotationValue { - s.NumberValue = &v - return s -} - -// SetStringValue sets the StringValue field's value. -func (s *AnnotationValue) SetStringValue(v string) *AnnotationValue { - s.StringValue = &v - return s -} - -// A list of availability zones corresponding to the segments in a trace. -type AvailabilityZoneDetail struct { - _ struct{} `type:"structure"` - - // The name of a corresponding availability zone. - Name *string `type:"string"` -} - -// String returns the string representation -func (s AvailabilityZoneDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AvailabilityZoneDetail) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *AvailabilityZoneDetail) SetName(v string) *AvailabilityZoneDetail { - s.Name = &v - return s -} - -type BackendConnectionErrors struct { - _ struct{} `type:"structure"` - - ConnectionRefusedCount *int64 `type:"integer"` - - HTTPCode4XXCount *int64 `type:"integer"` - - HTTPCode5XXCount *int64 `type:"integer"` - - OtherCount *int64 `type:"integer"` - - TimeoutCount *int64 `type:"integer"` - - UnknownHostCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s BackendConnectionErrors) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BackendConnectionErrors) GoString() string { - return s.String() -} - -// SetConnectionRefusedCount sets the ConnectionRefusedCount field's value. -func (s *BackendConnectionErrors) SetConnectionRefusedCount(v int64) *BackendConnectionErrors { - s.ConnectionRefusedCount = &v - return s -} - -// SetHTTPCode4XXCount sets the HTTPCode4XXCount field's value. -func (s *BackendConnectionErrors) SetHTTPCode4XXCount(v int64) *BackendConnectionErrors { - s.HTTPCode4XXCount = &v - return s -} - -// SetHTTPCode5XXCount sets the HTTPCode5XXCount field's value. -func (s *BackendConnectionErrors) SetHTTPCode5XXCount(v int64) *BackendConnectionErrors { - s.HTTPCode5XXCount = &v - return s -} - -// SetOtherCount sets the OtherCount field's value. -func (s *BackendConnectionErrors) SetOtherCount(v int64) *BackendConnectionErrors { - s.OtherCount = &v - return s -} - -// SetTimeoutCount sets the TimeoutCount field's value. -func (s *BackendConnectionErrors) SetTimeoutCount(v int64) *BackendConnectionErrors { - s.TimeoutCount = &v - return s -} - -// SetUnknownHostCount sets the UnknownHostCount field's value. -func (s *BackendConnectionErrors) SetUnknownHostCount(v int64) *BackendConnectionErrors { - s.UnknownHostCount = &v - return s -} - -type BatchGetTracesInput struct { - _ struct{} `type:"structure"` - - // Pagination token. Not used. - NextToken *string `type:"string"` - - // Specify the trace IDs of requests for which to retrieve segments. - // - // TraceIds is a required field - TraceIds []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s BatchGetTracesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetTracesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetTracesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetTracesInput"} - if s.TraceIds == nil { - invalidParams.Add(request.NewErrParamRequired("TraceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *BatchGetTracesInput) SetNextToken(v string) *BatchGetTracesInput { - s.NextToken = &v - return s -} - -// SetTraceIds sets the TraceIds field's value. -func (s *BatchGetTracesInput) SetTraceIds(v []*string) *BatchGetTracesInput { - s.TraceIds = v - return s -} - -type BatchGetTracesOutput struct { - _ struct{} `type:"structure"` - - // Pagination token. Not used. - NextToken *string `type:"string"` - - // Full traces for the specified requests. - Traces []*Trace `type:"list"` - - // Trace IDs of requests that haven't been processed. - UnprocessedTraceIds []*string `type:"list"` -} - -// String returns the string representation -func (s BatchGetTracesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetTracesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *BatchGetTracesOutput) SetNextToken(v string) *BatchGetTracesOutput { - s.NextToken = &v - return s -} - -// SetTraces sets the Traces field's value. -func (s *BatchGetTracesOutput) SetTraces(v []*Trace) *BatchGetTracesOutput { - s.Traces = v - return s -} - -// SetUnprocessedTraceIds sets the UnprocessedTraceIds field's value. -func (s *BatchGetTracesOutput) SetUnprocessedTraceIds(v []*string) *BatchGetTracesOutput { - s.UnprocessedTraceIds = v - return s -} - -type CreateGroupInput struct { - _ struct{} `type:"structure"` - - // The filter expression defining criteria by which to group traces. - FilterExpression *string `min:"1" type:"string"` - - // The case-sensitive name of the new group. Default is a reserved name and - // names must be unique. - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGroupInput"} - if s.FilterExpression != nil && len(*s.FilterExpression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterExpression", 1)) - } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterExpression sets the FilterExpression field's value. -func (s *CreateGroupInput) SetFilterExpression(v string) *CreateGroupInput { - s.FilterExpression = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *CreateGroupInput) SetGroupName(v string) *CreateGroupInput { - s.GroupName = &v - return s -} - -type CreateGroupOutput struct { - _ struct{} `type:"structure"` - - // The group that was created. Contains the name of the group that was created, - // the ARN of the group that was generated based on the group name, and the - // filter expression that was assigned to the group. - Group *Group `type:"structure"` -} - -// String returns the string representation -func (s CreateGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGroupOutput) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *CreateGroupOutput) SetGroup(v *Group) *CreateGroupOutput { - s.Group = v - return s -} - -type CreateSamplingRuleInput struct { - _ struct{} `type:"structure"` - - // The rule definition. - // - // SamplingRule is a required field - SamplingRule *SamplingRule `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateSamplingRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSamplingRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSamplingRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSamplingRuleInput"} - if s.SamplingRule == nil { - invalidParams.Add(request.NewErrParamRequired("SamplingRule")) - } - if s.SamplingRule != nil { - if err := s.SamplingRule.Validate(); err != nil { - invalidParams.AddNested("SamplingRule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSamplingRule sets the SamplingRule field's value. -func (s *CreateSamplingRuleInput) SetSamplingRule(v *SamplingRule) *CreateSamplingRuleInput { - s.SamplingRule = v - return s -} - -type CreateSamplingRuleOutput struct { - _ struct{} `type:"structure"` - - // The saved rule definition and metadata. - SamplingRuleRecord *SamplingRuleRecord `type:"structure"` -} - -// String returns the string representation -func (s CreateSamplingRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSamplingRuleOutput) GoString() string { - return s.String() -} - -// SetSamplingRuleRecord sets the SamplingRuleRecord field's value. -func (s *CreateSamplingRuleOutput) SetSamplingRuleRecord(v *SamplingRuleRecord) *CreateSamplingRuleOutput { - s.SamplingRuleRecord = v - return s -} - -type DeleteGroupInput struct { - _ struct{} `type:"structure"` - - // The ARN of the group that was generated on creation. - GroupARN *string `min:"1" type:"string"` - - // The case-sensitive name of the group. - GroupName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGroupInput"} - if s.GroupARN != nil && len(*s.GroupARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupARN", 1)) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupARN sets the GroupARN field's value. -func (s *DeleteGroupInput) SetGroupARN(v string) *DeleteGroupInput { - s.GroupARN = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *DeleteGroupInput) SetGroupName(v string) *DeleteGroupInput { - s.GroupName = &v - return s -} - -type DeleteGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteGroupOutput) GoString() string { - return s.String() -} - -type DeleteSamplingRuleInput struct { - _ struct{} `type:"structure"` - - // The ARN of the sampling rule. Specify a rule by either name or ARN, but not - // both. - RuleARN *string `type:"string"` - - // The name of the sampling rule. Specify a rule by either name or ARN, but - // not both. - RuleName *string `type:"string"` -} - -// String returns the string representation -func (s DeleteSamplingRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSamplingRuleInput) GoString() string { - return s.String() -} - -// SetRuleARN sets the RuleARN field's value. -func (s *DeleteSamplingRuleInput) SetRuleARN(v string) *DeleteSamplingRuleInput { - s.RuleARN = &v - return s -} - -// SetRuleName sets the RuleName field's value. -func (s *DeleteSamplingRuleInput) SetRuleName(v string) *DeleteSamplingRuleInput { - s.RuleName = &v - return s -} - -type DeleteSamplingRuleOutput struct { - _ struct{} `type:"structure"` - - // The deleted rule definition and metadata. - SamplingRuleRecord *SamplingRuleRecord `type:"structure"` -} - -// String returns the string representation -func (s DeleteSamplingRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSamplingRuleOutput) GoString() string { - return s.String() -} - -// SetSamplingRuleRecord sets the SamplingRuleRecord field's value. -func (s *DeleteSamplingRuleOutput) SetSamplingRuleRecord(v *SamplingRuleRecord) *DeleteSamplingRuleOutput { - s.SamplingRuleRecord = v - return s -} - -// Information about a connection between two services. -type Edge struct { - _ struct{} `type:"structure"` - - // Aliases for the edge. - Aliases []*Alias `type:"list"` - - // The end time of the last segment on the edge. - EndTime *time.Time `type:"timestamp"` - - // Identifier of the edge. Unique within a service map. - ReferenceId *int64 `type:"integer"` - - // A histogram that maps the spread of client response times on an edge. - ResponseTimeHistogram []*HistogramEntry `type:"list"` - - // The start time of the first segment on the edge. - StartTime *time.Time `type:"timestamp"` - - // Response statistics for segments on the edge. - SummaryStatistics *EdgeStatistics `type:"structure"` -} - -// String returns the string representation -func (s Edge) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Edge) GoString() string { - return s.String() -} - -// SetAliases sets the Aliases field's value. -func (s *Edge) SetAliases(v []*Alias) *Edge { - s.Aliases = v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *Edge) SetEndTime(v time.Time) *Edge { - s.EndTime = &v - return s -} - -// SetReferenceId sets the ReferenceId field's value. -func (s *Edge) SetReferenceId(v int64) *Edge { - s.ReferenceId = &v - return s -} - -// SetResponseTimeHistogram sets the ResponseTimeHistogram field's value. -func (s *Edge) SetResponseTimeHistogram(v []*HistogramEntry) *Edge { - s.ResponseTimeHistogram = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Edge) SetStartTime(v time.Time) *Edge { - s.StartTime = &v - return s -} - -// SetSummaryStatistics sets the SummaryStatistics field's value. -func (s *Edge) SetSummaryStatistics(v *EdgeStatistics) *Edge { - s.SummaryStatistics = v - return s -} - -// Response statistics for an edge. -type EdgeStatistics struct { - _ struct{} `type:"structure"` - - // Information about requests that failed with a 4xx Client Error status code. - ErrorStatistics *ErrorStatistics `type:"structure"` - - // Information about requests that failed with a 5xx Server Error status code. - FaultStatistics *FaultStatistics `type:"structure"` - - // The number of requests that completed with a 2xx Success status code. - OkCount *int64 `type:"long"` - - // The total number of completed requests. - TotalCount *int64 `type:"long"` - - // The aggregate response time of completed requests. - TotalResponseTime *float64 `type:"double"` -} - -// String returns the string representation -func (s EdgeStatistics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EdgeStatistics) GoString() string { - return s.String() -} - -// SetErrorStatistics sets the ErrorStatistics field's value. -func (s *EdgeStatistics) SetErrorStatistics(v *ErrorStatistics) *EdgeStatistics { - s.ErrorStatistics = v - return s -} - -// SetFaultStatistics sets the FaultStatistics field's value. -func (s *EdgeStatistics) SetFaultStatistics(v *FaultStatistics) *EdgeStatistics { - s.FaultStatistics = v - return s -} - -// SetOkCount sets the OkCount field's value. -func (s *EdgeStatistics) SetOkCount(v int64) *EdgeStatistics { - s.OkCount = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *EdgeStatistics) SetTotalCount(v int64) *EdgeStatistics { - s.TotalCount = &v - return s -} - -// SetTotalResponseTime sets the TotalResponseTime field's value. -func (s *EdgeStatistics) SetTotalResponseTime(v float64) *EdgeStatistics { - s.TotalResponseTime = &v - return s -} - -// A configuration document that specifies encryption configuration settings. -type EncryptionConfig struct { - _ struct{} `type:"structure"` - - // The ID of the customer master key (CMK) used for encryption, if applicable. - KeyId *string `type:"string"` - - // The encryption status. While the status is UPDATING, X-Ray may encrypt data - // with a combination of the new and old settings. - Status *string `type:"string" enum:"EncryptionStatus"` - - // The type of encryption. Set to KMS for encryption with CMKs. Set to NONE - // for default encryption. - Type *string `type:"string" enum:"EncryptionType"` -} - -// String returns the string representation -func (s EncryptionConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EncryptionConfig) GoString() string { - return s.String() -} - -// SetKeyId sets the KeyId field's value. -func (s *EncryptionConfig) SetKeyId(v string) *EncryptionConfig { - s.KeyId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EncryptionConfig) SetStatus(v string) *EncryptionConfig { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *EncryptionConfig) SetType(v string) *EncryptionConfig { - s.Type = &v - return s -} - -// The root cause of a trace summary error. -type ErrorRootCause struct { - _ struct{} `type:"structure"` - - // A list of services corresponding to an error. A service identifies a segment - // and it contains a name, account ID, type, and inferred flag. - Services []*ErrorRootCauseService `type:"list"` -} - -// String returns the string representation -func (s ErrorRootCause) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorRootCause) GoString() string { - return s.String() -} - -// SetServices sets the Services field's value. -func (s *ErrorRootCause) SetServices(v []*ErrorRootCauseService) *ErrorRootCause { - s.Services = v - return s -} - -// A collection of segments and corresponding subsegments associated to a trace -// summary error. -type ErrorRootCauseEntity struct { - _ struct{} `type:"structure"` - - // The types and messages of the exceptions. - Exceptions []*RootCauseException `type:"list"` - - // The name of the entity. - Name *string `type:"string"` - - // A flag that denotes a remote subsegment. - Remote *bool `type:"boolean"` -} - -// String returns the string representation -func (s ErrorRootCauseEntity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorRootCauseEntity) GoString() string { - return s.String() -} - -// SetExceptions sets the Exceptions field's value. -func (s *ErrorRootCauseEntity) SetExceptions(v []*RootCauseException) *ErrorRootCauseEntity { - s.Exceptions = v - return s -} - -// SetName sets the Name field's value. -func (s *ErrorRootCauseEntity) SetName(v string) *ErrorRootCauseEntity { - s.Name = &v - return s -} - -// SetRemote sets the Remote field's value. -func (s *ErrorRootCauseEntity) SetRemote(v bool) *ErrorRootCauseEntity { - s.Remote = &v - return s -} - -// A collection of fields identifying the services in a trace summary error. -type ErrorRootCauseService struct { - _ struct{} `type:"structure"` - - // The account ID associated to the service. - AccountId *string `type:"string"` - - // The path of root cause entities found on the service. - EntityPath []*ErrorRootCauseEntity `type:"list"` - - // A Boolean value indicating if the service is inferred from the trace. - Inferred *bool `type:"boolean"` - - // The service name. - Name *string `type:"string"` - - // A collection of associated service names. - Names []*string `type:"list"` - - // The type associated to the service. - Type *string `type:"string"` -} - -// String returns the string representation -func (s ErrorRootCauseService) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorRootCauseService) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *ErrorRootCauseService) SetAccountId(v string) *ErrorRootCauseService { - s.AccountId = &v - return s -} - -// SetEntityPath sets the EntityPath field's value. -func (s *ErrorRootCauseService) SetEntityPath(v []*ErrorRootCauseEntity) *ErrorRootCauseService { - s.EntityPath = v - return s -} - -// SetInferred sets the Inferred field's value. -func (s *ErrorRootCauseService) SetInferred(v bool) *ErrorRootCauseService { - s.Inferred = &v - return s -} - -// SetName sets the Name field's value. -func (s *ErrorRootCauseService) SetName(v string) *ErrorRootCauseService { - s.Name = &v - return s -} - -// SetNames sets the Names field's value. -func (s *ErrorRootCauseService) SetNames(v []*string) *ErrorRootCauseService { - s.Names = v - return s -} - -// SetType sets the Type field's value. -func (s *ErrorRootCauseService) SetType(v string) *ErrorRootCauseService { - s.Type = &v - return s -} - -// Information about requests that failed with a 4xx Client Error status code. -type ErrorStatistics struct { - _ struct{} `type:"structure"` - - // The number of requests that failed with untracked 4xx Client Error status - // codes. - OtherCount *int64 `type:"long"` - - // The number of requests that failed with a 419 throttling status code. - ThrottleCount *int64 `type:"long"` - - // The total number of requests that failed with a 4xx Client Error status code. - TotalCount *int64 `type:"long"` -} - -// String returns the string representation -func (s ErrorStatistics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorStatistics) GoString() string { - return s.String() -} - -// SetOtherCount sets the OtherCount field's value. -func (s *ErrorStatistics) SetOtherCount(v int64) *ErrorStatistics { - s.OtherCount = &v - return s -} - -// SetThrottleCount sets the ThrottleCount field's value. -func (s *ErrorStatistics) SetThrottleCount(v int64) *ErrorStatistics { - s.ThrottleCount = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *ErrorStatistics) SetTotalCount(v int64) *ErrorStatistics { - s.TotalCount = &v - return s -} - -// The root cause information for a trace summary fault. -type FaultRootCause struct { - _ struct{} `type:"structure"` - - // A list of corresponding services. A service identifies a segment and it contains - // a name, account ID, type, and inferred flag. - Services []*FaultRootCauseService `type:"list"` -} - -// String returns the string representation -func (s FaultRootCause) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FaultRootCause) GoString() string { - return s.String() -} - -// SetServices sets the Services field's value. -func (s *FaultRootCause) SetServices(v []*FaultRootCauseService) *FaultRootCause { - s.Services = v - return s -} - -// A collection of segments and corresponding subsegments associated to a trace -// summary fault error. -type FaultRootCauseEntity struct { - _ struct{} `type:"structure"` - - // The types and messages of the exceptions. - Exceptions []*RootCauseException `type:"list"` - - // The name of the entity. - Name *string `type:"string"` - - // A flag that denotes a remote subsegment. - Remote *bool `type:"boolean"` -} - -// String returns the string representation -func (s FaultRootCauseEntity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FaultRootCauseEntity) GoString() string { - return s.String() -} - -// SetExceptions sets the Exceptions field's value. -func (s *FaultRootCauseEntity) SetExceptions(v []*RootCauseException) *FaultRootCauseEntity { - s.Exceptions = v - return s -} - -// SetName sets the Name field's value. -func (s *FaultRootCauseEntity) SetName(v string) *FaultRootCauseEntity { - s.Name = &v - return s -} - -// SetRemote sets the Remote field's value. -func (s *FaultRootCauseEntity) SetRemote(v bool) *FaultRootCauseEntity { - s.Remote = &v - return s -} - -// A collection of fields identifying the services in a trace summary fault. -type FaultRootCauseService struct { - _ struct{} `type:"structure"` - - // The account ID associated to the service. - AccountId *string `type:"string"` - - // The path of root cause entities found on the service. - EntityPath []*FaultRootCauseEntity `type:"list"` - - // A Boolean value indicating if the service is inferred from the trace. - Inferred *bool `type:"boolean"` - - // The service name. - Name *string `type:"string"` - - // A collection of associated service names. - Names []*string `type:"list"` - - // The type associated to the service. - Type *string `type:"string"` -} - -// String returns the string representation -func (s FaultRootCauseService) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FaultRootCauseService) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *FaultRootCauseService) SetAccountId(v string) *FaultRootCauseService { - s.AccountId = &v - return s -} - -// SetEntityPath sets the EntityPath field's value. -func (s *FaultRootCauseService) SetEntityPath(v []*FaultRootCauseEntity) *FaultRootCauseService { - s.EntityPath = v - return s -} - -// SetInferred sets the Inferred field's value. -func (s *FaultRootCauseService) SetInferred(v bool) *FaultRootCauseService { - s.Inferred = &v - return s -} - -// SetName sets the Name field's value. -func (s *FaultRootCauseService) SetName(v string) *FaultRootCauseService { - s.Name = &v - return s -} - -// SetNames sets the Names field's value. -func (s *FaultRootCauseService) SetNames(v []*string) *FaultRootCauseService { - s.Names = v - return s -} - -// SetType sets the Type field's value. -func (s *FaultRootCauseService) SetType(v string) *FaultRootCauseService { - s.Type = &v - return s -} - -// Information about requests that failed with a 5xx Server Error status code. -type FaultStatistics struct { - _ struct{} `type:"structure"` - - // The number of requests that failed with untracked 5xx Server Error status - // codes. - OtherCount *int64 `type:"long"` - - // The total number of requests that failed with a 5xx Server Error status code. - TotalCount *int64 `type:"long"` -} - -// String returns the string representation -func (s FaultStatistics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FaultStatistics) GoString() string { - return s.String() -} - -// SetOtherCount sets the OtherCount field's value. -func (s *FaultStatistics) SetOtherCount(v int64) *FaultStatistics { - s.OtherCount = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *FaultStatistics) SetTotalCount(v int64) *FaultStatistics { - s.TotalCount = &v - return s -} - -type GetEncryptionConfigInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetEncryptionConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetEncryptionConfigInput) GoString() string { - return s.String() -} - -type GetEncryptionConfigOutput struct { - _ struct{} `type:"structure"` - - // The encryption configuration document. - EncryptionConfig *EncryptionConfig `type:"structure"` -} - -// String returns the string representation -func (s GetEncryptionConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetEncryptionConfigOutput) GoString() string { - return s.String() -} - -// SetEncryptionConfig sets the EncryptionConfig field's value. -func (s *GetEncryptionConfigOutput) SetEncryptionConfig(v *EncryptionConfig) *GetEncryptionConfigOutput { - s.EncryptionConfig = v - return s -} - -type GetGroupInput struct { - _ struct{} `type:"structure"` - - // The ARN of the group that was generated on creation. - GroupARN *string `min:"1" type:"string"` - - // The case-sensitive name of the group. - GroupName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGroupInput"} - if s.GroupARN != nil && len(*s.GroupARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupARN", 1)) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupARN sets the GroupARN field's value. -func (s *GetGroupInput) SetGroupARN(v string) *GetGroupInput { - s.GroupARN = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GetGroupInput) SetGroupName(v string) *GetGroupInput { - s.GroupName = &v - return s -} - -type GetGroupOutput struct { - _ struct{} `type:"structure"` - - // The group that was requested. Contains the name of the group, the ARN of - // the group, and the filter expression that assigned to the group. - Group *Group `type:"structure"` -} - -// String returns the string representation -func (s GetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGroupOutput) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *GetGroupOutput) SetGroup(v *Group) *GetGroupOutput { - s.Group = v - return s -} - -type GetGroupsInput struct { - _ struct{} `type:"structure"` - - // Pagination token. Not used. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGroupsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *GetGroupsInput) SetNextToken(v string) *GetGroupsInput { - s.NextToken = &v - return s -} - -type GetGroupsOutput struct { - _ struct{} `type:"structure"` - - // The collection of all active groups. - Groups []*GroupSummary `type:"list"` - - // Pagination token. Not used. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s GetGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGroupsOutput) GoString() string { - return s.String() -} - -// SetGroups sets the Groups field's value. -func (s *GetGroupsOutput) SetGroups(v []*GroupSummary) *GetGroupsOutput { - s.Groups = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetGroupsOutput) SetNextToken(v string) *GetGroupsOutput { - s.NextToken = &v - return s -} - -type GetSamplingRulesInput struct { - _ struct{} `type:"structure"` - - // Pagination token. Not used. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s GetSamplingRulesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSamplingRulesInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *GetSamplingRulesInput) SetNextToken(v string) *GetSamplingRulesInput { - s.NextToken = &v - return s -} - -type GetSamplingRulesOutput struct { - _ struct{} `type:"structure"` - - // Pagination token. Not used. - NextToken *string `type:"string"` - - // Rule definitions and metadata. - SamplingRuleRecords []*SamplingRuleRecord `type:"list"` -} - -// String returns the string representation -func (s GetSamplingRulesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSamplingRulesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *GetSamplingRulesOutput) SetNextToken(v string) *GetSamplingRulesOutput { - s.NextToken = &v - return s -} - -// SetSamplingRuleRecords sets the SamplingRuleRecords field's value. -func (s *GetSamplingRulesOutput) SetSamplingRuleRecords(v []*SamplingRuleRecord) *GetSamplingRulesOutput { - s.SamplingRuleRecords = v - return s -} - -type GetSamplingStatisticSummariesInput struct { - _ struct{} `type:"structure"` - - // Pagination token. Not used. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s GetSamplingStatisticSummariesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSamplingStatisticSummariesInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *GetSamplingStatisticSummariesInput) SetNextToken(v string) *GetSamplingStatisticSummariesInput { - s.NextToken = &v - return s -} - -type GetSamplingStatisticSummariesOutput struct { - _ struct{} `type:"structure"` - - // Pagination token. Not used. - NextToken *string `type:"string"` - - // Information about the number of requests instrumented for each sampling rule. - SamplingStatisticSummaries []*SamplingStatisticSummary `type:"list"` -} - -// String returns the string representation -func (s GetSamplingStatisticSummariesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSamplingStatisticSummariesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *GetSamplingStatisticSummariesOutput) SetNextToken(v string) *GetSamplingStatisticSummariesOutput { - s.NextToken = &v - return s -} - -// SetSamplingStatisticSummaries sets the SamplingStatisticSummaries field's value. -func (s *GetSamplingStatisticSummariesOutput) SetSamplingStatisticSummaries(v []*SamplingStatisticSummary) *GetSamplingStatisticSummariesOutput { - s.SamplingStatisticSummaries = v - return s -} - -type GetSamplingTargetsInput struct { - _ struct{} `type:"structure"` - - // Information about rules that the service is using to sample requests. - // - // SamplingStatisticsDocuments is a required field - SamplingStatisticsDocuments []*SamplingStatisticsDocument `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetSamplingTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSamplingTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSamplingTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSamplingTargetsInput"} - if s.SamplingStatisticsDocuments == nil { - invalidParams.Add(request.NewErrParamRequired("SamplingStatisticsDocuments")) - } - if s.SamplingStatisticsDocuments != nil { - for i, v := range s.SamplingStatisticsDocuments { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SamplingStatisticsDocuments", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSamplingStatisticsDocuments sets the SamplingStatisticsDocuments field's value. -func (s *GetSamplingTargetsInput) SetSamplingStatisticsDocuments(v []*SamplingStatisticsDocument) *GetSamplingTargetsInput { - s.SamplingStatisticsDocuments = v - return s -} - -type GetSamplingTargetsOutput struct { - _ struct{} `type:"structure"` - - // The last time a user changed the sampling rule configuration. If the sampling - // rule configuration changed since the service last retrieved it, the service - // should call GetSamplingRules to get the latest version. - LastRuleModification *time.Time `type:"timestamp"` - - // Updated rules that the service should use to sample requests. - SamplingTargetDocuments []*SamplingTargetDocument `type:"list"` - - // Information about SamplingStatisticsDocument that X-Ray could not process. - UnprocessedStatistics []*UnprocessedStatistics `type:"list"` -} - -// String returns the string representation -func (s GetSamplingTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSamplingTargetsOutput) GoString() string { - return s.String() -} - -// SetLastRuleModification sets the LastRuleModification field's value. -func (s *GetSamplingTargetsOutput) SetLastRuleModification(v time.Time) *GetSamplingTargetsOutput { - s.LastRuleModification = &v - return s -} - -// SetSamplingTargetDocuments sets the SamplingTargetDocuments field's value. -func (s *GetSamplingTargetsOutput) SetSamplingTargetDocuments(v []*SamplingTargetDocument) *GetSamplingTargetsOutput { - s.SamplingTargetDocuments = v - return s -} - -// SetUnprocessedStatistics sets the UnprocessedStatistics field's value. -func (s *GetSamplingTargetsOutput) SetUnprocessedStatistics(v []*UnprocessedStatistics) *GetSamplingTargetsOutput { - s.UnprocessedStatistics = v - return s -} - -type GetServiceGraphInput struct { - _ struct{} `type:"structure"` - - // The end of the timeframe for which to generate a graph. - // - // EndTime is a required field - EndTime *time.Time `type:"timestamp" required:"true"` - - // The ARN of a group to generate a graph based on. - GroupARN *string `min:"1" type:"string"` - - // The name of a group to generate a graph based on. - GroupName *string `min:"1" type:"string"` - - // Pagination token. Not used. - NextToken *string `type:"string"` - - // The start of the time frame for which to generate a graph. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" required:"true"` -} - -// String returns the string representation -func (s GetServiceGraphInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetServiceGraphInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetServiceGraphInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetServiceGraphInput"} - if s.EndTime == nil { - invalidParams.Add(request.NewErrParamRequired("EndTime")) - } - if s.GroupARN != nil && len(*s.GroupARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupARN", 1)) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *GetServiceGraphInput) SetEndTime(v time.Time) *GetServiceGraphInput { - s.EndTime = &v - return s -} - -// SetGroupARN sets the GroupARN field's value. -func (s *GetServiceGraphInput) SetGroupARN(v string) *GetServiceGraphInput { - s.GroupARN = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GetServiceGraphInput) SetGroupName(v string) *GetServiceGraphInput { - s.GroupName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetServiceGraphInput) SetNextToken(v string) *GetServiceGraphInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetServiceGraphInput) SetStartTime(v time.Time) *GetServiceGraphInput { - s.StartTime = &v - return s -} - -type GetServiceGraphOutput struct { - _ struct{} `type:"structure"` - - // A flag indicating whether the group's filter expression has been consistent, - // or if the returned service graph may show traces from an older version of - // the group's filter expression. - ContainsOldGroupVersions *bool `type:"boolean"` - - // The end of the time frame for which the graph was generated. - EndTime *time.Time `type:"timestamp"` - - // Pagination token. Not used. - NextToken *string `type:"string"` - - // The services that have processed a traced request during the specified time - // frame. - Services []*Service `type:"list"` - - // The start of the time frame for which the graph was generated. - StartTime *time.Time `type:"timestamp"` -} - -// String returns the string representation -func (s GetServiceGraphOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetServiceGraphOutput) GoString() string { - return s.String() -} - -// SetContainsOldGroupVersions sets the ContainsOldGroupVersions field's value. -func (s *GetServiceGraphOutput) SetContainsOldGroupVersions(v bool) *GetServiceGraphOutput { - s.ContainsOldGroupVersions = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *GetServiceGraphOutput) SetEndTime(v time.Time) *GetServiceGraphOutput { - s.EndTime = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetServiceGraphOutput) SetNextToken(v string) *GetServiceGraphOutput { - s.NextToken = &v - return s -} - -// SetServices sets the Services field's value. -func (s *GetServiceGraphOutput) SetServices(v []*Service) *GetServiceGraphOutput { - s.Services = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetServiceGraphOutput) SetStartTime(v time.Time) *GetServiceGraphOutput { - s.StartTime = &v - return s -} - -type GetTraceGraphInput struct { - _ struct{} `type:"structure"` - - // Pagination token. Not used. - NextToken *string `type:"string"` - - // Trace IDs of requests for which to generate a service graph. - // - // TraceIds is a required field - TraceIds []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetTraceGraphInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTraceGraphInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTraceGraphInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTraceGraphInput"} - if s.TraceIds == nil { - invalidParams.Add(request.NewErrParamRequired("TraceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *GetTraceGraphInput) SetNextToken(v string) *GetTraceGraphInput { - s.NextToken = &v - return s -} - -// SetTraceIds sets the TraceIds field's value. -func (s *GetTraceGraphInput) SetTraceIds(v []*string) *GetTraceGraphInput { - s.TraceIds = v - return s -} - -type GetTraceGraphOutput struct { - _ struct{} `type:"structure"` - - // Pagination token. Not used. - NextToken *string `type:"string"` - - // The services that have processed one of the specified requests. - Services []*Service `type:"list"` -} - -// String returns the string representation -func (s GetTraceGraphOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTraceGraphOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *GetTraceGraphOutput) SetNextToken(v string) *GetTraceGraphOutput { - s.NextToken = &v - return s -} - -// SetServices sets the Services field's value. -func (s *GetTraceGraphOutput) SetServices(v []*Service) *GetTraceGraphOutput { - s.Services = v - return s -} - -type GetTraceSummariesInput struct { - _ struct{} `type:"structure"` - - // The end of the time frame for which to retrieve traces. - // - // EndTime is a required field - EndTime *time.Time `type:"timestamp" required:"true"` - - // Specify a filter expression to retrieve trace summaries for services or requests - // that meet certain requirements. - FilterExpression *string `min:"1" type:"string"` - - // Specify the pagination token returned by a previous request to retrieve the - // next page of results. - NextToken *string `type:"string"` - - // Set to true to get summaries for only a subset of available traces. - Sampling *bool `type:"boolean"` - - // The start of the time frame for which to retrieve traces. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" required:"true"` -} - -// String returns the string representation -func (s GetTraceSummariesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTraceSummariesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTraceSummariesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTraceSummariesInput"} - if s.EndTime == nil { - invalidParams.Add(request.NewErrParamRequired("EndTime")) - } - if s.FilterExpression != nil && len(*s.FilterExpression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterExpression", 1)) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *GetTraceSummariesInput) SetEndTime(v time.Time) *GetTraceSummariesInput { - s.EndTime = &v - return s -} - -// SetFilterExpression sets the FilterExpression field's value. -func (s *GetTraceSummariesInput) SetFilterExpression(v string) *GetTraceSummariesInput { - s.FilterExpression = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetTraceSummariesInput) SetNextToken(v string) *GetTraceSummariesInput { - s.NextToken = &v - return s -} - -// SetSampling sets the Sampling field's value. -func (s *GetTraceSummariesInput) SetSampling(v bool) *GetTraceSummariesInput { - s.Sampling = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetTraceSummariesInput) SetStartTime(v time.Time) *GetTraceSummariesInput { - s.StartTime = &v - return s -} - -type GetTraceSummariesOutput struct { - _ struct{} `type:"structure"` - - // The start time of this page of results. - ApproximateTime *time.Time `type:"timestamp"` - - // If the requested time frame contained more than one page of results, you - // can use this token to retrieve the next page. The first page contains the - // most most recent results, closest to the end of the time frame. - NextToken *string `type:"string"` - - // Trace IDs and metadata for traces that were found in the specified time frame. - TraceSummaries []*TraceSummary `type:"list"` - - // The total number of traces processed, including traces that did not match - // the specified filter expression. - TracesProcessedCount *int64 `type:"long"` -} - -// String returns the string representation -func (s GetTraceSummariesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTraceSummariesOutput) GoString() string { - return s.String() -} - -// SetApproximateTime sets the ApproximateTime field's value. -func (s *GetTraceSummariesOutput) SetApproximateTime(v time.Time) *GetTraceSummariesOutput { - s.ApproximateTime = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetTraceSummariesOutput) SetNextToken(v string) *GetTraceSummariesOutput { - s.NextToken = &v - return s -} - -// SetTraceSummaries sets the TraceSummaries field's value. -func (s *GetTraceSummariesOutput) SetTraceSummaries(v []*TraceSummary) *GetTraceSummariesOutput { - s.TraceSummaries = v - return s -} - -// SetTracesProcessedCount sets the TracesProcessedCount field's value. -func (s *GetTraceSummariesOutput) SetTracesProcessedCount(v int64) *GetTraceSummariesOutput { - s.TracesProcessedCount = &v - return s -} - -// Details and metadata for a group. -type Group struct { - _ struct{} `type:"structure"` - - // The filter expression defining the parameters to include traces. - FilterExpression *string `type:"string"` - - // The ARN of the group generated based on the GroupName. - GroupARN *string `type:"string"` - - // The unique case-sensitive name of the group. - GroupName *string `type:"string"` -} - -// String returns the string representation -func (s Group) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Group) GoString() string { - return s.String() -} - -// SetFilterExpression sets the FilterExpression field's value. -func (s *Group) SetFilterExpression(v string) *Group { - s.FilterExpression = &v - return s -} - -// SetGroupARN sets the GroupARN field's value. -func (s *Group) SetGroupARN(v string) *Group { - s.GroupARN = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *Group) SetGroupName(v string) *Group { - s.GroupName = &v - return s -} - -// Details for a group without metadata. -type GroupSummary struct { - _ struct{} `type:"structure"` - - // The filter expression defining the parameters to include traces. - FilterExpression *string `type:"string"` - - // The ARN of the group generated based on the GroupName. - GroupARN *string `type:"string"` - - // The unique case-sensitive name of the group. - GroupName *string `type:"string"` -} - -// String returns the string representation -func (s GroupSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GroupSummary) GoString() string { - return s.String() -} - -// SetFilterExpression sets the FilterExpression field's value. -func (s *GroupSummary) SetFilterExpression(v string) *GroupSummary { - s.FilterExpression = &v - return s -} - -// SetGroupARN sets the GroupARN field's value. -func (s *GroupSummary) SetGroupARN(v string) *GroupSummary { - s.GroupARN = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GroupSummary) SetGroupName(v string) *GroupSummary { - s.GroupName = &v - return s -} - -// An entry in a histogram for a statistic. A histogram maps the range of observed -// values on the X axis, and the prevalence of each value on the Y axis. -type HistogramEntry struct { - _ struct{} `type:"structure"` - - // The prevalence of the entry. - Count *int64 `type:"integer"` - - // The value of the entry. - Value *float64 `type:"double"` -} - -// String returns the string representation -func (s HistogramEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HistogramEntry) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *HistogramEntry) SetCount(v int64) *HistogramEntry { - s.Count = &v - return s -} - -// SetValue sets the Value field's value. -func (s *HistogramEntry) SetValue(v float64) *HistogramEntry { - s.Value = &v - return s -} - -// Information about an HTTP request. -type Http struct { - _ struct{} `type:"structure"` - - // The IP address of the requestor. - ClientIp *string `type:"string"` - - // The request method. - HttpMethod *string `type:"string"` - - // The response status. - HttpStatus *int64 `type:"integer"` - - // The request URL. - HttpURL *string `type:"string"` - - // The request's user agent string. - UserAgent *string `type:"string"` -} - -// String returns the string representation -func (s Http) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Http) GoString() string { - return s.String() -} - -// SetClientIp sets the ClientIp field's value. -func (s *Http) SetClientIp(v string) *Http { - s.ClientIp = &v - return s -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *Http) SetHttpMethod(v string) *Http { - s.HttpMethod = &v - return s -} - -// SetHttpStatus sets the HttpStatus field's value. -func (s *Http) SetHttpStatus(v int64) *Http { - s.HttpStatus = &v - return s -} - -// SetHttpURL sets the HttpURL field's value. -func (s *Http) SetHttpURL(v string) *Http { - s.HttpURL = &v - return s -} - -// SetUserAgent sets the UserAgent field's value. -func (s *Http) SetUserAgent(v string) *Http { - s.UserAgent = &v - return s -} - -// A list of EC2 instance IDs corresponding to the segments in a trace. -type InstanceIdDetail struct { - _ struct{} `type:"structure"` - - // The ID of a corresponding EC2 instance. - Id *string `type:"string"` -} - -// String returns the string representation -func (s InstanceIdDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceIdDetail) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *InstanceIdDetail) SetId(v string) *InstanceIdDetail { - s.Id = &v - return s -} - -type PutEncryptionConfigInput struct { - _ struct{} `type:"structure"` - - // An AWS KMS customer master key (CMK) in one of the following formats: - // - // * Alias - The name of the key. For example, alias/MyKey. - // - // * Key ID - The KMS key ID of the key. For example, ae4aa6d49-a4d8-9df9-a475-4ff6d7898456. - // - // * ARN - The full Amazon Resource Name of the key ID or alias. For example, - // arn:aws:kms:us-east-2:123456789012:key/ae4aa6d49-a4d8-9df9-a475-4ff6d7898456. - // Use this format to specify a key in a different account. - // - // Omit this key if you set Type to NONE. - KeyId *string `min:"1" type:"string"` - - // The type of encryption. Set to KMS to use your own key for encryption. Set - // to NONE for default encryption. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"EncryptionType"` -} - -// String returns the string representation -func (s PutEncryptionConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEncryptionConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutEncryptionConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutEncryptionConfigInput"} - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *PutEncryptionConfigInput) SetKeyId(v string) *PutEncryptionConfigInput { - s.KeyId = &v - return s -} - -// SetType sets the Type field's value. -func (s *PutEncryptionConfigInput) SetType(v string) *PutEncryptionConfigInput { - s.Type = &v - return s -} - -type PutEncryptionConfigOutput struct { - _ struct{} `type:"structure"` - - // The new encryption configuration. - EncryptionConfig *EncryptionConfig `type:"structure"` -} - -// String returns the string representation -func (s PutEncryptionConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEncryptionConfigOutput) GoString() string { - return s.String() -} - -// SetEncryptionConfig sets the EncryptionConfig field's value. -func (s *PutEncryptionConfigOutput) SetEncryptionConfig(v *EncryptionConfig) *PutEncryptionConfigOutput { - s.EncryptionConfig = v - return s -} - -type PutTelemetryRecordsInput struct { - _ struct{} `type:"structure"` - - EC2InstanceId *string `type:"string"` - - Hostname *string `type:"string"` - - ResourceARN *string `type:"string"` - - // TelemetryRecords is a required field - TelemetryRecords []*TelemetryRecord `type:"list" required:"true"` -} - -// String returns the string representation -func (s PutTelemetryRecordsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutTelemetryRecordsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutTelemetryRecordsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutTelemetryRecordsInput"} - if s.TelemetryRecords == nil { - invalidParams.Add(request.NewErrParamRequired("TelemetryRecords")) - } - if s.TelemetryRecords != nil { - for i, v := range s.TelemetryRecords { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TelemetryRecords", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEC2InstanceId sets the EC2InstanceId field's value. -func (s *PutTelemetryRecordsInput) SetEC2InstanceId(v string) *PutTelemetryRecordsInput { - s.EC2InstanceId = &v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *PutTelemetryRecordsInput) SetHostname(v string) *PutTelemetryRecordsInput { - s.Hostname = &v - return s -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *PutTelemetryRecordsInput) SetResourceARN(v string) *PutTelemetryRecordsInput { - s.ResourceARN = &v - return s -} - -// SetTelemetryRecords sets the TelemetryRecords field's value. -func (s *PutTelemetryRecordsInput) SetTelemetryRecords(v []*TelemetryRecord) *PutTelemetryRecordsInput { - s.TelemetryRecords = v - return s -} - -type PutTelemetryRecordsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutTelemetryRecordsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutTelemetryRecordsOutput) GoString() string { - return s.String() -} - -type PutTraceSegmentsInput struct { - _ struct{} `type:"structure"` - - // A string containing a JSON document defining one or more segments or subsegments. - // - // TraceSegmentDocuments is a required field - TraceSegmentDocuments []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s PutTraceSegmentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutTraceSegmentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutTraceSegmentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutTraceSegmentsInput"} - if s.TraceSegmentDocuments == nil { - invalidParams.Add(request.NewErrParamRequired("TraceSegmentDocuments")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTraceSegmentDocuments sets the TraceSegmentDocuments field's value. -func (s *PutTraceSegmentsInput) SetTraceSegmentDocuments(v []*string) *PutTraceSegmentsInput { - s.TraceSegmentDocuments = v - return s -} - -type PutTraceSegmentsOutput struct { - _ struct{} `type:"structure"` - - // Segments that failed processing. - UnprocessedTraceSegments []*UnprocessedTraceSegment `type:"list"` -} - -// String returns the string representation -func (s PutTraceSegmentsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutTraceSegmentsOutput) GoString() string { - return s.String() -} - -// SetUnprocessedTraceSegments sets the UnprocessedTraceSegments field's value. -func (s *PutTraceSegmentsOutput) SetUnprocessedTraceSegments(v []*UnprocessedTraceSegment) *PutTraceSegmentsOutput { - s.UnprocessedTraceSegments = v - return s -} - -// A list of resources ARNs corresponding to the segments in a trace. -type ResourceARNDetail struct { - _ struct{} `type:"structure"` - - // The ARN of a corresponding resource. - ARN *string `type:"string"` -} - -// String returns the string representation -func (s ResourceARNDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceARNDetail) GoString() string { - return s.String() -} - -// SetARN sets the ARN field's value. -func (s *ResourceARNDetail) SetARN(v string) *ResourceARNDetail { - s.ARN = &v - return s -} - -// The root cause information for a response time warning. -type ResponseTimeRootCause struct { - _ struct{} `type:"structure"` - - // A list of corresponding services. A service identifies a segment and contains - // a name, account ID, type, and inferred flag. - Services []*ResponseTimeRootCauseService `type:"list"` -} - -// String returns the string representation -func (s ResponseTimeRootCause) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResponseTimeRootCause) GoString() string { - return s.String() -} - -// SetServices sets the Services field's value. -func (s *ResponseTimeRootCause) SetServices(v []*ResponseTimeRootCauseService) *ResponseTimeRootCause { - s.Services = v - return s -} - -// A collection of segments and corresponding subsegments associated to a response -// time warning. -type ResponseTimeRootCauseEntity struct { - _ struct{} `type:"structure"` - - // The types and messages of the exceptions. - Coverage *float64 `type:"double"` - - // The name of the entity. - Name *string `type:"string"` - - // A flag that denotes a remote subsegment. - Remote *bool `type:"boolean"` -} - -// String returns the string representation -func (s ResponseTimeRootCauseEntity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResponseTimeRootCauseEntity) GoString() string { - return s.String() -} - -// SetCoverage sets the Coverage field's value. -func (s *ResponseTimeRootCauseEntity) SetCoverage(v float64) *ResponseTimeRootCauseEntity { - s.Coverage = &v - return s -} - -// SetName sets the Name field's value. -func (s *ResponseTimeRootCauseEntity) SetName(v string) *ResponseTimeRootCauseEntity { - s.Name = &v - return s -} - -// SetRemote sets the Remote field's value. -func (s *ResponseTimeRootCauseEntity) SetRemote(v bool) *ResponseTimeRootCauseEntity { - s.Remote = &v - return s -} - -// A collection of fields identifying the service in a response time warning. -type ResponseTimeRootCauseService struct { - _ struct{} `type:"structure"` - - // The account ID associated to the service. - AccountId *string `type:"string"` - - // The path of root cause entities found on the service. - EntityPath []*ResponseTimeRootCauseEntity `type:"list"` - - // A Boolean value indicating if the service is inferred from the trace. - Inferred *bool `type:"boolean"` - - // The service name. - Name *string `type:"string"` - - // A collection of associated service names. - Names []*string `type:"list"` - - // The type associated to the service. - Type *string `type:"string"` -} - -// String returns the string representation -func (s ResponseTimeRootCauseService) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResponseTimeRootCauseService) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *ResponseTimeRootCauseService) SetAccountId(v string) *ResponseTimeRootCauseService { - s.AccountId = &v - return s -} - -// SetEntityPath sets the EntityPath field's value. -func (s *ResponseTimeRootCauseService) SetEntityPath(v []*ResponseTimeRootCauseEntity) *ResponseTimeRootCauseService { - s.EntityPath = v - return s -} - -// SetInferred sets the Inferred field's value. -func (s *ResponseTimeRootCauseService) SetInferred(v bool) *ResponseTimeRootCauseService { - s.Inferred = &v - return s -} - -// SetName sets the Name field's value. -func (s *ResponseTimeRootCauseService) SetName(v string) *ResponseTimeRootCauseService { - s.Name = &v - return s -} - -// SetNames sets the Names field's value. -func (s *ResponseTimeRootCauseService) SetNames(v []*string) *ResponseTimeRootCauseService { - s.Names = v - return s -} - -// SetType sets the Type field's value. -func (s *ResponseTimeRootCauseService) SetType(v string) *ResponseTimeRootCauseService { - s.Type = &v - return s -} - -// The exception associated with a root cause. -type RootCauseException struct { - _ struct{} `type:"structure"` - - // The message of the exception. - Message *string `type:"string"` - - // The name of the exception. - Name *string `type:"string"` -} - -// String returns the string representation -func (s RootCauseException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RootCauseException) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *RootCauseException) SetMessage(v string) *RootCauseException { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *RootCauseException) SetName(v string) *RootCauseException { - s.Name = &v - return s -} - -// A sampling rule that services use to decide whether to instrument a request. -// Rule fields can match properties of the service, or properties of a request. -// The service can ignore rules that don't match its properties. -type SamplingRule struct { - _ struct{} `type:"structure"` - - // Matches attributes derived from the request. - Attributes map[string]*string `type:"map"` - - // The percentage of matching requests to instrument, after the reservoir is - // exhausted. - // - // FixedRate is a required field - FixedRate *float64 `type:"double" required:"true"` - - // Matches the HTTP method of a request. - // - // HTTPMethod is a required field - HTTPMethod *string `type:"string" required:"true"` - - // Matches the hostname from a request URL. - // - // Host is a required field - Host *string `type:"string" required:"true"` - - // The priority of the sampling rule. - // - // Priority is a required field - Priority *int64 `min:"1" type:"integer" required:"true"` - - // A fixed number of matching requests to instrument per second, prior to applying - // the fixed rate. The reservoir is not used directly by services, but applies - // to all services using the rule collectively. - // - // ReservoirSize is a required field - ReservoirSize *int64 `type:"integer" required:"true"` - - // Matches the ARN of the AWS resource on which the service runs. - // - // ResourceARN is a required field - ResourceARN *string `type:"string" required:"true"` - - // The ARN of the sampling rule. Specify a rule by either name or ARN, but not - // both. - RuleARN *string `type:"string"` - - // The name of the sampling rule. Specify a rule by either name or ARN, but - // not both. - RuleName *string `min:"1" type:"string"` - - // Matches the name that the service uses to identify itself in segments. - // - // ServiceName is a required field - ServiceName *string `type:"string" required:"true"` - - // Matches the origin that the service uses to identify its type in segments. - // - // ServiceType is a required field - ServiceType *string `type:"string" required:"true"` - - // Matches the path from a request URL. - // - // URLPath is a required field - URLPath *string `type:"string" required:"true"` - - // The version of the sampling rule format (1). - // - // Version is a required field - Version *int64 `min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s SamplingRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SamplingRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SamplingRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SamplingRule"} - if s.FixedRate == nil { - invalidParams.Add(request.NewErrParamRequired("FixedRate")) - } - if s.HTTPMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HTTPMethod")) - } - if s.Host == nil { - invalidParams.Add(request.NewErrParamRequired("Host")) - } - if s.Priority == nil { - invalidParams.Add(request.NewErrParamRequired("Priority")) - } - if s.Priority != nil && *s.Priority < 1 { - invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) - } - if s.ReservoirSize == nil { - invalidParams.Add(request.NewErrParamRequired("ReservoirSize")) - } - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.RuleName != nil && len(*s.RuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) - } - if s.ServiceName == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceName")) - } - if s.ServiceType == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceType")) - } - if s.URLPath == nil { - invalidParams.Add(request.NewErrParamRequired("URLPath")) - } - if s.Version == nil { - invalidParams.Add(request.NewErrParamRequired("Version")) - } - if s.Version != nil && *s.Version < 1 { - invalidParams.Add(request.NewErrParamMinValue("Version", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *SamplingRule) SetAttributes(v map[string]*string) *SamplingRule { - s.Attributes = v - return s -} - -// SetFixedRate sets the FixedRate field's value. -func (s *SamplingRule) SetFixedRate(v float64) *SamplingRule { - s.FixedRate = &v - return s -} - -// SetHTTPMethod sets the HTTPMethod field's value. -func (s *SamplingRule) SetHTTPMethod(v string) *SamplingRule { - s.HTTPMethod = &v - return s -} - -// SetHost sets the Host field's value. -func (s *SamplingRule) SetHost(v string) *SamplingRule { - s.Host = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *SamplingRule) SetPriority(v int64) *SamplingRule { - s.Priority = &v - return s -} - -// SetReservoirSize sets the ReservoirSize field's value. -func (s *SamplingRule) SetReservoirSize(v int64) *SamplingRule { - s.ReservoirSize = &v - return s -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *SamplingRule) SetResourceARN(v string) *SamplingRule { - s.ResourceARN = &v - return s -} - -// SetRuleARN sets the RuleARN field's value. -func (s *SamplingRule) SetRuleARN(v string) *SamplingRule { - s.RuleARN = &v - return s -} - -// SetRuleName sets the RuleName field's value. -func (s *SamplingRule) SetRuleName(v string) *SamplingRule { - s.RuleName = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *SamplingRule) SetServiceName(v string) *SamplingRule { - s.ServiceName = &v - return s -} - -// SetServiceType sets the ServiceType field's value. -func (s *SamplingRule) SetServiceType(v string) *SamplingRule { - s.ServiceType = &v - return s -} - -// SetURLPath sets the URLPath field's value. -func (s *SamplingRule) SetURLPath(v string) *SamplingRule { - s.URLPath = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *SamplingRule) SetVersion(v int64) *SamplingRule { - s.Version = &v - return s -} - -// A SamplingRule and its metadata. -type SamplingRuleRecord struct { - _ struct{} `type:"structure"` - - // When the rule was created. - CreatedAt *time.Time `type:"timestamp"` - - // When the rule was last modified. - ModifiedAt *time.Time `type:"timestamp"` - - // The sampling rule. - SamplingRule *SamplingRule `type:"structure"` -} - -// String returns the string representation -func (s SamplingRuleRecord) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SamplingRuleRecord) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SamplingRuleRecord) SetCreatedAt(v time.Time) *SamplingRuleRecord { - s.CreatedAt = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *SamplingRuleRecord) SetModifiedAt(v time.Time) *SamplingRuleRecord { - s.ModifiedAt = &v - return s -} - -// SetSamplingRule sets the SamplingRule field's value. -func (s *SamplingRuleRecord) SetSamplingRule(v *SamplingRule) *SamplingRuleRecord { - s.SamplingRule = v - return s -} - -// A document specifying changes to a sampling rule's configuration. -type SamplingRuleUpdate struct { - _ struct{} `type:"structure"` - - // Matches attributes derived from the request. - Attributes map[string]*string `type:"map"` - - // The percentage of matching requests to instrument, after the reservoir is - // exhausted. - FixedRate *float64 `type:"double"` - - // Matches the HTTP method of a request. - HTTPMethod *string `type:"string"` - - // Matches the hostname from a request URL. - Host *string `type:"string"` - - // The priority of the sampling rule. - Priority *int64 `type:"integer"` - - // A fixed number of matching requests to instrument per second, prior to applying - // the fixed rate. The reservoir is not used directly by services, but applies - // to all services using the rule collectively. - ReservoirSize *int64 `type:"integer"` - - // Matches the ARN of the AWS resource on which the service runs. - ResourceARN *string `type:"string"` - - // The ARN of the sampling rule. Specify a rule by either name or ARN, but not - // both. - RuleARN *string `type:"string"` - - // The name of the sampling rule. Specify a rule by either name or ARN, but - // not both. - RuleName *string `min:"1" type:"string"` - - // Matches the name that the service uses to identify itself in segments. - ServiceName *string `type:"string"` - - // Matches the origin that the service uses to identify its type in segments. - ServiceType *string `type:"string"` - - // Matches the path from a request URL. - URLPath *string `type:"string"` -} - -// String returns the string representation -func (s SamplingRuleUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SamplingRuleUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SamplingRuleUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SamplingRuleUpdate"} - if s.RuleName != nil && len(*s.RuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *SamplingRuleUpdate) SetAttributes(v map[string]*string) *SamplingRuleUpdate { - s.Attributes = v - return s -} - -// SetFixedRate sets the FixedRate field's value. -func (s *SamplingRuleUpdate) SetFixedRate(v float64) *SamplingRuleUpdate { - s.FixedRate = &v - return s -} - -// SetHTTPMethod sets the HTTPMethod field's value. -func (s *SamplingRuleUpdate) SetHTTPMethod(v string) *SamplingRuleUpdate { - s.HTTPMethod = &v - return s -} - -// SetHost sets the Host field's value. -func (s *SamplingRuleUpdate) SetHost(v string) *SamplingRuleUpdate { - s.Host = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *SamplingRuleUpdate) SetPriority(v int64) *SamplingRuleUpdate { - s.Priority = &v - return s -} - -// SetReservoirSize sets the ReservoirSize field's value. -func (s *SamplingRuleUpdate) SetReservoirSize(v int64) *SamplingRuleUpdate { - s.ReservoirSize = &v - return s -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *SamplingRuleUpdate) SetResourceARN(v string) *SamplingRuleUpdate { - s.ResourceARN = &v - return s -} - -// SetRuleARN sets the RuleARN field's value. -func (s *SamplingRuleUpdate) SetRuleARN(v string) *SamplingRuleUpdate { - s.RuleARN = &v - return s -} - -// SetRuleName sets the RuleName field's value. -func (s *SamplingRuleUpdate) SetRuleName(v string) *SamplingRuleUpdate { - s.RuleName = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *SamplingRuleUpdate) SetServiceName(v string) *SamplingRuleUpdate { - s.ServiceName = &v - return s -} - -// SetServiceType sets the ServiceType field's value. -func (s *SamplingRuleUpdate) SetServiceType(v string) *SamplingRuleUpdate { - s.ServiceType = &v - return s -} - -// SetURLPath sets the URLPath field's value. -func (s *SamplingRuleUpdate) SetURLPath(v string) *SamplingRuleUpdate { - s.URLPath = &v - return s -} - -// Aggregated request sampling data for a sampling rule across all services -// for a 10 second window. -type SamplingStatisticSummary struct { - _ struct{} `type:"structure"` - - // The number of requests recorded with borrowed reservoir quota. - BorrowCount *int64 `type:"integer"` - - // The number of requests that matched the rule. - RequestCount *int64 `type:"integer"` - - // The name of the sampling rule. - RuleName *string `type:"string"` - - // The number of requests recorded. - SampledCount *int64 `type:"integer"` - - // The start time of the reporting window. - Timestamp *time.Time `type:"timestamp"` -} - -// String returns the string representation -func (s SamplingStatisticSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SamplingStatisticSummary) GoString() string { - return s.String() -} - -// SetBorrowCount sets the BorrowCount field's value. -func (s *SamplingStatisticSummary) SetBorrowCount(v int64) *SamplingStatisticSummary { - s.BorrowCount = &v - return s -} - -// SetRequestCount sets the RequestCount field's value. -func (s *SamplingStatisticSummary) SetRequestCount(v int64) *SamplingStatisticSummary { - s.RequestCount = &v - return s -} - -// SetRuleName sets the RuleName field's value. -func (s *SamplingStatisticSummary) SetRuleName(v string) *SamplingStatisticSummary { - s.RuleName = &v - return s -} - -// SetSampledCount sets the SampledCount field's value. -func (s *SamplingStatisticSummary) SetSampledCount(v int64) *SamplingStatisticSummary { - s.SampledCount = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *SamplingStatisticSummary) SetTimestamp(v time.Time) *SamplingStatisticSummary { - s.Timestamp = &v - return s -} - -// Request sampling results for a single rule from a service. Results are for -// the last 10 seconds unless the service has been assigned a longer reporting -// interval after a previous call to GetSamplingTargets. -type SamplingStatisticsDocument struct { - _ struct{} `type:"structure"` - - // The number of requests recorded with borrowed reservoir quota. - BorrowCount *int64 `type:"integer"` - - // A unique identifier for the service in hexadecimal. - // - // ClientID is a required field - ClientID *string `min:"24" type:"string" required:"true"` - - // The number of requests that matched the rule. - // - // RequestCount is a required field - RequestCount *int64 `type:"integer" required:"true"` - - // The name of the sampling rule. - // - // RuleName is a required field - RuleName *string `min:"1" type:"string" required:"true"` - - // The number of requests recorded. - // - // SampledCount is a required field - SampledCount *int64 `type:"integer" required:"true"` - - // The current time. - // - // Timestamp is a required field - Timestamp *time.Time `type:"timestamp" required:"true"` -} - -// String returns the string representation -func (s SamplingStatisticsDocument) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SamplingStatisticsDocument) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SamplingStatisticsDocument) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SamplingStatisticsDocument"} - if s.ClientID == nil { - invalidParams.Add(request.NewErrParamRequired("ClientID")) - } - if s.ClientID != nil && len(*s.ClientID) < 24 { - invalidParams.Add(request.NewErrParamMinLen("ClientID", 24)) - } - if s.RequestCount == nil { - invalidParams.Add(request.NewErrParamRequired("RequestCount")) - } - if s.RuleName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleName")) - } - if s.RuleName != nil && len(*s.RuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) - } - if s.SampledCount == nil { - invalidParams.Add(request.NewErrParamRequired("SampledCount")) - } - if s.Timestamp == nil { - invalidParams.Add(request.NewErrParamRequired("Timestamp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBorrowCount sets the BorrowCount field's value. -func (s *SamplingStatisticsDocument) SetBorrowCount(v int64) *SamplingStatisticsDocument { - s.BorrowCount = &v - return s -} - -// SetClientID sets the ClientID field's value. -func (s *SamplingStatisticsDocument) SetClientID(v string) *SamplingStatisticsDocument { - s.ClientID = &v - return s -} - -// SetRequestCount sets the RequestCount field's value. -func (s *SamplingStatisticsDocument) SetRequestCount(v int64) *SamplingStatisticsDocument { - s.RequestCount = &v - return s -} - -// SetRuleName sets the RuleName field's value. -func (s *SamplingStatisticsDocument) SetRuleName(v string) *SamplingStatisticsDocument { - s.RuleName = &v - return s -} - -// SetSampledCount sets the SampledCount field's value. -func (s *SamplingStatisticsDocument) SetSampledCount(v int64) *SamplingStatisticsDocument { - s.SampledCount = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *SamplingStatisticsDocument) SetTimestamp(v time.Time) *SamplingStatisticsDocument { - s.Timestamp = &v - return s -} - -// Temporary changes to a sampling rule configuration. To meet the global sampling -// target for a rule, X-Ray calculates a new reservoir for each service based -// on the recent sampling results of all services that called GetSamplingTargets. -type SamplingTargetDocument struct { - _ struct{} `type:"structure"` - - // The percentage of matching requests to instrument, after the reservoir is - // exhausted. - FixedRate *float64 `type:"double"` - - // The number of seconds for the service to wait before getting sampling targets - // again. - Interval *int64 `type:"integer"` - - // The number of requests per second that X-Ray allocated this service. - ReservoirQuota *int64 `type:"integer"` - - // When the reservoir quota expires. - ReservoirQuotaTTL *time.Time `type:"timestamp"` - - // The name of the sampling rule. - RuleName *string `type:"string"` -} - -// String returns the string representation -func (s SamplingTargetDocument) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SamplingTargetDocument) GoString() string { - return s.String() -} - -// SetFixedRate sets the FixedRate field's value. -func (s *SamplingTargetDocument) SetFixedRate(v float64) *SamplingTargetDocument { - s.FixedRate = &v - return s -} - -// SetInterval sets the Interval field's value. -func (s *SamplingTargetDocument) SetInterval(v int64) *SamplingTargetDocument { - s.Interval = &v - return s -} - -// SetReservoirQuota sets the ReservoirQuota field's value. -func (s *SamplingTargetDocument) SetReservoirQuota(v int64) *SamplingTargetDocument { - s.ReservoirQuota = &v - return s -} - -// SetReservoirQuotaTTL sets the ReservoirQuotaTTL field's value. -func (s *SamplingTargetDocument) SetReservoirQuotaTTL(v time.Time) *SamplingTargetDocument { - s.ReservoirQuotaTTL = &v - return s -} - -// SetRuleName sets the RuleName field's value. -func (s *SamplingTargetDocument) SetRuleName(v string) *SamplingTargetDocument { - s.RuleName = &v - return s -} - -// A segment from a trace that has been ingested by the X-Ray service. The segment -// can be compiled from documents uploaded with PutTraceSegments, or an inferred -// segment for a downstream service, generated from a subsegment sent by the -// service that called it. -// -// For the full segment document schema, see AWS X-Ray Segment Documents (https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html) -// in the AWS X-Ray Developer Guide. -type Segment struct { - _ struct{} `type:"structure"` - - // The segment document. - Document *string `min:"1" type:"string"` - - // The segment's ID. - Id *string `type:"string"` -} - -// String returns the string representation -func (s Segment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Segment) GoString() string { - return s.String() -} - -// SetDocument sets the Document field's value. -func (s *Segment) SetDocument(v string) *Segment { - s.Document = &v - return s -} - -// SetId sets the Id field's value. -func (s *Segment) SetId(v string) *Segment { - s.Id = &v - return s -} - -// Information about an application that processed requests, users that made -// requests, or downstream services, resources and applications that an application -// used. -type Service struct { - _ struct{} `type:"structure"` - - // Identifier of the AWS account in which the service runs. - AccountId *string `type:"string"` - - // A histogram that maps the spread of service durations. - DurationHistogram []*HistogramEntry `type:"list"` - - // Connections to downstream services. - Edges []*Edge `type:"list"` - - // The end time of the last segment that the service generated. - EndTime *time.Time `type:"timestamp"` - - // The canonical name of the service. - Name *string `type:"string"` - - // A list of names for the service, including the canonical name. - Names []*string `type:"list"` - - // Identifier for the service. Unique within the service map. - ReferenceId *int64 `type:"integer"` - - // A histogram that maps the spread of service response times. - ResponseTimeHistogram []*HistogramEntry `type:"list"` - - // Indicates that the service was the first service to process a request. - Root *bool `type:"boolean"` - - // The start time of the first segment that the service generated. - StartTime *time.Time `type:"timestamp"` - - // The service's state. - State *string `type:"string"` - - // Aggregated statistics for the service. - SummaryStatistics *ServiceStatistics `type:"structure"` - - // The type of service. - // - // * AWS Resource - The type of an AWS resource. For example, AWS::EC2::Instance - // for a application running on Amazon EC2 or AWS::DynamoDB::Table for an - // Amazon DynamoDB table that the application used. - // - // * AWS Service - The type of an AWS service. For example, AWS::DynamoDB - // for downstream calls to Amazon DynamoDB that didn't target a specific - // table. - // - // * client - Represents the clients that sent requests to a root service. - // - // * remote - A downstream service of indeterminate type. - Type *string `type:"string"` -} - -// String returns the string representation -func (s Service) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Service) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *Service) SetAccountId(v string) *Service { - s.AccountId = &v - return s -} - -// SetDurationHistogram sets the DurationHistogram field's value. -func (s *Service) SetDurationHistogram(v []*HistogramEntry) *Service { - s.DurationHistogram = v - return s -} - -// SetEdges sets the Edges field's value. -func (s *Service) SetEdges(v []*Edge) *Service { - s.Edges = v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *Service) SetEndTime(v time.Time) *Service { - s.EndTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *Service) SetName(v string) *Service { - s.Name = &v - return s -} - -// SetNames sets the Names field's value. -func (s *Service) SetNames(v []*string) *Service { - s.Names = v - return s -} - -// SetReferenceId sets the ReferenceId field's value. -func (s *Service) SetReferenceId(v int64) *Service { - s.ReferenceId = &v - return s -} - -// SetResponseTimeHistogram sets the ResponseTimeHistogram field's value. -func (s *Service) SetResponseTimeHistogram(v []*HistogramEntry) *Service { - s.ResponseTimeHistogram = v - return s -} - -// SetRoot sets the Root field's value. -func (s *Service) SetRoot(v bool) *Service { - s.Root = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Service) SetStartTime(v time.Time) *Service { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *Service) SetState(v string) *Service { - s.State = &v - return s -} - -// SetSummaryStatistics sets the SummaryStatistics field's value. -func (s *Service) SetSummaryStatistics(v *ServiceStatistics) *Service { - s.SummaryStatistics = v - return s -} - -// SetType sets the Type field's value. -func (s *Service) SetType(v string) *Service { - s.Type = &v - return s -} - -type ServiceId struct { - _ struct{} `type:"structure"` - - AccountId *string `type:"string"` - - Name *string `type:"string"` - - Names []*string `type:"list"` - - Type *string `type:"string"` -} - -// String returns the string representation -func (s ServiceId) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceId) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *ServiceId) SetAccountId(v string) *ServiceId { - s.AccountId = &v - return s -} - -// SetName sets the Name field's value. -func (s *ServiceId) SetName(v string) *ServiceId { - s.Name = &v - return s -} - -// SetNames sets the Names field's value. -func (s *ServiceId) SetNames(v []*string) *ServiceId { - s.Names = v - return s -} - -// SetType sets the Type field's value. -func (s *ServiceId) SetType(v string) *ServiceId { - s.Type = &v - return s -} - -// Response statistics for a service. -type ServiceStatistics struct { - _ struct{} `type:"structure"` - - // Information about requests that failed with a 4xx Client Error status code. - ErrorStatistics *ErrorStatistics `type:"structure"` - - // Information about requests that failed with a 5xx Server Error status code. - FaultStatistics *FaultStatistics `type:"structure"` - - // The number of requests that completed with a 2xx Success status code. - OkCount *int64 `type:"long"` - - // The total number of completed requests. - TotalCount *int64 `type:"long"` - - // The aggregate response time of completed requests. - TotalResponseTime *float64 `type:"double"` -} - -// String returns the string representation -func (s ServiceStatistics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceStatistics) GoString() string { - return s.String() -} - -// SetErrorStatistics sets the ErrorStatistics field's value. -func (s *ServiceStatistics) SetErrorStatistics(v *ErrorStatistics) *ServiceStatistics { - s.ErrorStatistics = v - return s -} - -// SetFaultStatistics sets the FaultStatistics field's value. -func (s *ServiceStatistics) SetFaultStatistics(v *FaultStatistics) *ServiceStatistics { - s.FaultStatistics = v - return s -} - -// SetOkCount sets the OkCount field's value. -func (s *ServiceStatistics) SetOkCount(v int64) *ServiceStatistics { - s.OkCount = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *ServiceStatistics) SetTotalCount(v int64) *ServiceStatistics { - s.TotalCount = &v - return s -} - -// SetTotalResponseTime sets the TotalResponseTime field's value. -func (s *ServiceStatistics) SetTotalResponseTime(v float64) *ServiceStatistics { - s.TotalResponseTime = &v - return s -} - -type TelemetryRecord struct { - _ struct{} `type:"structure"` - - BackendConnectionErrors *BackendConnectionErrors `type:"structure"` - - SegmentsReceivedCount *int64 `type:"integer"` - - SegmentsRejectedCount *int64 `type:"integer"` - - SegmentsSentCount *int64 `type:"integer"` - - SegmentsSpilloverCount *int64 `type:"integer"` - - // Timestamp is a required field - Timestamp *time.Time `type:"timestamp" required:"true"` -} - -// String returns the string representation -func (s TelemetryRecord) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TelemetryRecord) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TelemetryRecord) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TelemetryRecord"} - if s.Timestamp == nil { - invalidParams.Add(request.NewErrParamRequired("Timestamp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackendConnectionErrors sets the BackendConnectionErrors field's value. -func (s *TelemetryRecord) SetBackendConnectionErrors(v *BackendConnectionErrors) *TelemetryRecord { - s.BackendConnectionErrors = v - return s -} - -// SetSegmentsReceivedCount sets the SegmentsReceivedCount field's value. -func (s *TelemetryRecord) SetSegmentsReceivedCount(v int64) *TelemetryRecord { - s.SegmentsReceivedCount = &v - return s -} - -// SetSegmentsRejectedCount sets the SegmentsRejectedCount field's value. -func (s *TelemetryRecord) SetSegmentsRejectedCount(v int64) *TelemetryRecord { - s.SegmentsRejectedCount = &v - return s -} - -// SetSegmentsSentCount sets the SegmentsSentCount field's value. -func (s *TelemetryRecord) SetSegmentsSentCount(v int64) *TelemetryRecord { - s.SegmentsSentCount = &v - return s -} - -// SetSegmentsSpilloverCount sets the SegmentsSpilloverCount field's value. -func (s *TelemetryRecord) SetSegmentsSpilloverCount(v int64) *TelemetryRecord { - s.SegmentsSpilloverCount = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *TelemetryRecord) SetTimestamp(v time.Time) *TelemetryRecord { - s.Timestamp = &v - return s -} - -// A collection of segment documents with matching trace IDs. -type Trace struct { - _ struct{} `type:"structure"` - - // The length of time in seconds between the start time of the root segment - // and the end time of the last segment that completed. - Duration *float64 `type:"double"` - - // The unique identifier for the request that generated the trace's segments - // and subsegments. - Id *string `min:"1" type:"string"` - - // Segment documents for the segments and subsegments that comprise the trace. - Segments []*Segment `type:"list"` -} - -// String returns the string representation -func (s Trace) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Trace) GoString() string { - return s.String() -} - -// SetDuration sets the Duration field's value. -func (s *Trace) SetDuration(v float64) *Trace { - s.Duration = &v - return s -} - -// SetId sets the Id field's value. -func (s *Trace) SetId(v string) *Trace { - s.Id = &v - return s -} - -// SetSegments sets the Segments field's value. -func (s *Trace) SetSegments(v []*Segment) *Trace { - s.Segments = v - return s -} - -// Metadata generated from the segment documents in a trace. -type TraceSummary struct { - _ struct{} `type:"structure"` - - // Annotations from the trace's segment documents. - Annotations map[string][]*ValueWithServiceIds `type:"map"` - - // A list of availability zones for any zone corresponding to the trace segments. - AvailabilityZones []*AvailabilityZoneDetail `type:"list"` - - // The length of time in seconds between the start time of the root segment - // and the end time of the last segment that completed. - Duration *float64 `type:"double"` - - // The root of a trace. - EntryPoint *ServiceId `type:"structure"` - - // A collection of ErrorRootCause structures corresponding to the trace segments. - ErrorRootCauses []*ErrorRootCause `type:"list"` - - // A collection of FaultRootCause structures corresponding to the the trace - // segments. - FaultRootCauses []*FaultRootCause `type:"list"` - - // One or more of the segment documents has a 400 series error. - HasError *bool `type:"boolean"` - - // One or more of the segment documents has a 500 series error. - HasFault *bool `type:"boolean"` - - // One or more of the segment documents has a 429 throttling error. - HasThrottle *bool `type:"boolean"` - - // Information about the HTTP request served by the trace. - Http *Http `type:"structure"` - - // The unique identifier for the request that generated the trace's segments - // and subsegments. - Id *string `min:"1" type:"string"` - - // A list of EC2 instance IDs for any instance corresponding to the trace segments. - InstanceIds []*InstanceIdDetail `type:"list"` - - // One or more of the segment documents is in progress. - IsPartial *bool `type:"boolean"` - - // A list of resource ARNs for any resource corresponding to the trace segments. - ResourceARNs []*ResourceARNDetail `type:"list"` - - // The length of time in seconds between the start and end times of the root - // segment. If the service performs work asynchronously, the response time measures - // the time before the response is sent to the user, while the duration measures - // the amount of time before the last traced activity completes. - ResponseTime *float64 `type:"double"` - - // A collection of ResponseTimeRootCause structures corresponding to the trace - // segments. - ResponseTimeRootCauses []*ResponseTimeRootCause `type:"list"` - - // The revision number of a trace. - Revision *int64 `type:"integer"` - - // Service IDs from the trace's segment documents. - ServiceIds []*ServiceId `type:"list"` - - // Users from the trace's segment documents. - Users []*TraceUser `type:"list"` -} - -// String returns the string representation -func (s TraceSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TraceSummary) GoString() string { - return s.String() -} - -// SetAnnotations sets the Annotations field's value. -func (s *TraceSummary) SetAnnotations(v map[string][]*ValueWithServiceIds) *TraceSummary { - s.Annotations = v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *TraceSummary) SetAvailabilityZones(v []*AvailabilityZoneDetail) *TraceSummary { - s.AvailabilityZones = v - return s -} - -// SetDuration sets the Duration field's value. -func (s *TraceSummary) SetDuration(v float64) *TraceSummary { - s.Duration = &v - return s -} - -// SetEntryPoint sets the EntryPoint field's value. -func (s *TraceSummary) SetEntryPoint(v *ServiceId) *TraceSummary { - s.EntryPoint = v - return s -} - -// SetErrorRootCauses sets the ErrorRootCauses field's value. -func (s *TraceSummary) SetErrorRootCauses(v []*ErrorRootCause) *TraceSummary { - s.ErrorRootCauses = v - return s -} - -// SetFaultRootCauses sets the FaultRootCauses field's value. -func (s *TraceSummary) SetFaultRootCauses(v []*FaultRootCause) *TraceSummary { - s.FaultRootCauses = v - return s -} - -// SetHasError sets the HasError field's value. -func (s *TraceSummary) SetHasError(v bool) *TraceSummary { - s.HasError = &v - return s -} - -// SetHasFault sets the HasFault field's value. -func (s *TraceSummary) SetHasFault(v bool) *TraceSummary { - s.HasFault = &v - return s -} - -// SetHasThrottle sets the HasThrottle field's value. -func (s *TraceSummary) SetHasThrottle(v bool) *TraceSummary { - s.HasThrottle = &v - return s -} - -// SetHttp sets the Http field's value. -func (s *TraceSummary) SetHttp(v *Http) *TraceSummary { - s.Http = v - return s -} - -// SetId sets the Id field's value. -func (s *TraceSummary) SetId(v string) *TraceSummary { - s.Id = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *TraceSummary) SetInstanceIds(v []*InstanceIdDetail) *TraceSummary { - s.InstanceIds = v - return s -} - -// SetIsPartial sets the IsPartial field's value. -func (s *TraceSummary) SetIsPartial(v bool) *TraceSummary { - s.IsPartial = &v - return s -} - -// SetResourceARNs sets the ResourceARNs field's value. -func (s *TraceSummary) SetResourceARNs(v []*ResourceARNDetail) *TraceSummary { - s.ResourceARNs = v - return s -} - -// SetResponseTime sets the ResponseTime field's value. -func (s *TraceSummary) SetResponseTime(v float64) *TraceSummary { - s.ResponseTime = &v - return s -} - -// SetResponseTimeRootCauses sets the ResponseTimeRootCauses field's value. -func (s *TraceSummary) SetResponseTimeRootCauses(v []*ResponseTimeRootCause) *TraceSummary { - s.ResponseTimeRootCauses = v - return s -} - -// SetRevision sets the Revision field's value. -func (s *TraceSummary) SetRevision(v int64) *TraceSummary { - s.Revision = &v - return s -} - -// SetServiceIds sets the ServiceIds field's value. -func (s *TraceSummary) SetServiceIds(v []*ServiceId) *TraceSummary { - s.ServiceIds = v - return s -} - -// SetUsers sets the Users field's value. -func (s *TraceSummary) SetUsers(v []*TraceUser) *TraceSummary { - s.Users = v - return s -} - -// Information about a user recorded in segment documents. -type TraceUser struct { - _ struct{} `type:"structure"` - - // Services that the user's request hit. - ServiceIds []*ServiceId `type:"list"` - - // The user's name. - UserName *string `type:"string"` -} - -// String returns the string representation -func (s TraceUser) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TraceUser) GoString() string { - return s.String() -} - -// SetServiceIds sets the ServiceIds field's value. -func (s *TraceUser) SetServiceIds(v []*ServiceId) *TraceUser { - s.ServiceIds = v - return s -} - -// SetUserName sets the UserName field's value. -func (s *TraceUser) SetUserName(v string) *TraceUser { - s.UserName = &v - return s -} - -// Sampling statistics from a call to GetSamplingTargets that X-Ray could not -// process. -type UnprocessedStatistics struct { - _ struct{} `type:"structure"` - - // The error code. - ErrorCode *string `type:"string"` - - // The error message. - Message *string `type:"string"` - - // The name of the sampling rule. - RuleName *string `type:"string"` -} - -// String returns the string representation -func (s UnprocessedStatistics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnprocessedStatistics) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *UnprocessedStatistics) SetErrorCode(v string) *UnprocessedStatistics { - s.ErrorCode = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *UnprocessedStatistics) SetMessage(v string) *UnprocessedStatistics { - s.Message = &v - return s -} - -// SetRuleName sets the RuleName field's value. -func (s *UnprocessedStatistics) SetRuleName(v string) *UnprocessedStatistics { - s.RuleName = &v - return s -} - -// Information about a segment that failed processing. -type UnprocessedTraceSegment struct { - _ struct{} `type:"structure"` - - // The error that caused processing to fail. - ErrorCode *string `type:"string"` - - // The segment's ID. - Id *string `type:"string"` - - // The error message. - Message *string `type:"string"` -} - -// String returns the string representation -func (s UnprocessedTraceSegment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnprocessedTraceSegment) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *UnprocessedTraceSegment) SetErrorCode(v string) *UnprocessedTraceSegment { - s.ErrorCode = &v - return s -} - -// SetId sets the Id field's value. -func (s *UnprocessedTraceSegment) SetId(v string) *UnprocessedTraceSegment { - s.Id = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *UnprocessedTraceSegment) SetMessage(v string) *UnprocessedTraceSegment { - s.Message = &v - return s -} - -type UpdateGroupInput struct { - _ struct{} `type:"structure"` - - // The updated filter expression defining criteria by which to group traces. - FilterExpression *string `min:"1" type:"string"` - - // The ARN that was generated upon creation. - GroupARN *string `min:"1" type:"string"` - - // The case-sensitive name of the group. - GroupName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGroupInput"} - if s.FilterExpression != nil && len(*s.FilterExpression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterExpression", 1)) - } - if s.GroupARN != nil && len(*s.GroupARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupARN", 1)) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterExpression sets the FilterExpression field's value. -func (s *UpdateGroupInput) SetFilterExpression(v string) *UpdateGroupInput { - s.FilterExpression = &v - return s -} - -// SetGroupARN sets the GroupARN field's value. -func (s *UpdateGroupInput) SetGroupARN(v string) *UpdateGroupInput { - s.GroupARN = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *UpdateGroupInput) SetGroupName(v string) *UpdateGroupInput { - s.GroupName = &v - return s -} - -type UpdateGroupOutput struct { - _ struct{} `type:"structure"` - - // The group that was updated. Contains the name of the group that was updated, - // the ARN of the group that was updated, and the updated filter expression - // assigned to the group. - Group *Group `type:"structure"` -} - -// String returns the string representation -func (s UpdateGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGroupOutput) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *UpdateGroupOutput) SetGroup(v *Group) *UpdateGroupOutput { - s.Group = v - return s -} - -type UpdateSamplingRuleInput struct { - _ struct{} `type:"structure"` - - // The rule and fields to change. - // - // SamplingRuleUpdate is a required field - SamplingRuleUpdate *SamplingRuleUpdate `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateSamplingRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSamplingRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSamplingRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSamplingRuleInput"} - if s.SamplingRuleUpdate == nil { - invalidParams.Add(request.NewErrParamRequired("SamplingRuleUpdate")) - } - if s.SamplingRuleUpdate != nil { - if err := s.SamplingRuleUpdate.Validate(); err != nil { - invalidParams.AddNested("SamplingRuleUpdate", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSamplingRuleUpdate sets the SamplingRuleUpdate field's value. -func (s *UpdateSamplingRuleInput) SetSamplingRuleUpdate(v *SamplingRuleUpdate) *UpdateSamplingRuleInput { - s.SamplingRuleUpdate = v - return s -} - -type UpdateSamplingRuleOutput struct { - _ struct{} `type:"structure"` - - // The updated rule definition and metadata. - SamplingRuleRecord *SamplingRuleRecord `type:"structure"` -} - -// String returns the string representation -func (s UpdateSamplingRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSamplingRuleOutput) GoString() string { - return s.String() -} - -// SetSamplingRuleRecord sets the SamplingRuleRecord field's value. -func (s *UpdateSamplingRuleOutput) SetSamplingRuleRecord(v *SamplingRuleRecord) *UpdateSamplingRuleOutput { - s.SamplingRuleRecord = v - return s -} - -// Information about a segment annotation. -type ValueWithServiceIds struct { - _ struct{} `type:"structure"` - - // Values of the annotation. - AnnotationValue *AnnotationValue `type:"structure"` - - // Services to which the annotation applies. - ServiceIds []*ServiceId `type:"list"` -} - -// String returns the string representation -func (s ValueWithServiceIds) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ValueWithServiceIds) GoString() string { - return s.String() -} - -// SetAnnotationValue sets the AnnotationValue field's value. -func (s *ValueWithServiceIds) SetAnnotationValue(v *AnnotationValue) *ValueWithServiceIds { - s.AnnotationValue = v - return s -} - -// SetServiceIds sets the ServiceIds field's value. -func (s *ValueWithServiceIds) SetServiceIds(v []*ServiceId) *ValueWithServiceIds { - s.ServiceIds = v - return s -} - -const ( - // EncryptionStatusUpdating is a EncryptionStatus enum value - EncryptionStatusUpdating = "UPDATING" - - // EncryptionStatusActive is a EncryptionStatus enum value - EncryptionStatusActive = "ACTIVE" -) - -const ( - // EncryptionTypeNone is a EncryptionType enum value - EncryptionTypeNone = "NONE" - - // EncryptionTypeKms is a EncryptionType enum value - EncryptionTypeKms = "KMS" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/doc.go b/vendor/github.com/aws/aws-sdk-go/service/xray/doc.go deleted file mode 100644 index a33a8cc95b5..00000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/xray/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package xray provides the client and types for making API -// requests to AWS X-Ray. -// -// AWS X-Ray provides APIs for managing debug traces and retrieving service -// maps and other data created by processing those traces. -// -// See https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12 for more information on this service. -// -// See xray package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/xray/ -// -// Using the Client -// -// To contact AWS X-Ray with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS X-Ray client XRay for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/xray/#New -package xray diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go b/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go deleted file mode 100644 index 7888dd20464..00000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package xray - -const ( - - // ErrCodeInvalidRequestException for service response error code - // "InvalidRequestException". - // - // The request is missing required parameters or has invalid parameters. - ErrCodeInvalidRequestException = "InvalidRequestException" - - // ErrCodeRuleLimitExceededException for service response error code - // "RuleLimitExceededException". - // - // You have reached the maximum number of sampling rules. - ErrCodeRuleLimitExceededException = "RuleLimitExceededException" - - // ErrCodeThrottledException for service response error code - // "ThrottledException". - // - // The request exceeds the maximum number of requests per second. - ErrCodeThrottledException = "ThrottledException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/service.go b/vendor/github.com/aws/aws-sdk-go/service/xray/service.go deleted file mode 100644 index fdc5ea32958..00000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/xray/service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package xray - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/private/protocol/restjson" -) - -// XRay provides the API operation methods for making requests to -// AWS X-Ray. See this package's package overview docs -// for details on the service. -// -// XRay methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type XRay struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "xray" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "XRay" // ServiceID is a unique identifer of a specific service. -) - -// New creates a new instance of the XRay client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// // Create a XRay client from just a session. -// svc := xray.New(mySession) -// -// // Create a XRay client with additional configuration -// svc := xray.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *XRay { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *XRay { - svc := &XRay{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2016-04-12", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a XRay operation and runs any -// custom request initialization. -func (c *XRay) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 75753d11463..610b94c7e5d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -137,7 +137,6 @@ github.com/aws/aws-sdk-go/service/waf github.com/aws/aws-sdk-go/service/wafregional github.com/aws/aws-sdk-go/service/worklink github.com/aws/aws-sdk-go/service/workspaces -github.com/aws/aws-sdk-go/service/xray github.com/aws/aws-sdk-go/aws/credentials github.com/aws/aws-sdk-go/internal/sdkio github.com/aws/aws-sdk-go/aws/client/metadata diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index a56c74686ef..eda8483e562 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -159,7 +159,6 @@ The Terraform AWS Provider allows the following endpoints to be customized: - `wafregional` - `worklink` - `workspaces` -- `xray` ## Connecting to Local AWS Compatible Solutions From 0d8dfead5a314d640c85da85cde3761f5b4b5543 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Mon, 6 May 2019 22:54:16 +0100 Subject: [PATCH 16/19] Uplifts XRay sampling rule schema --- aws/provider.go | 1 + aws/resource_aws_xray_sampling_rule.go | 61 ++++++++++--------- aws/resource_aws_xray_sampling_rule_test.go | 23 +++---- .../guides/custom-service-endpoints.html.md | 1 + 4 files changed, 41 insertions(+), 45 deletions(-) diff --git a/aws/provider.go b/aws/provider.go index 7de2ade6572..0807a007bac 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -962,6 +962,7 @@ func init() { "wafregional", "worklink", "workspaces", + "xray", } } diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index 469b119e418..bf1088dc018 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -33,54 +33,59 @@ func resourceAwsXraySamplingRule() *schema.Resource { Required: true, }, "priority": { - Type: schema.TypeInt, - Required: true, + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(1, 9999), }, "fixed_rate": { Type: schema.TypeFloat, Required: true, }, "reservoir_size": { - Type: schema.TypeInt, - Required: true, + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(0), }, "service_name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(0, 64), }, "service_type": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(0, 64), }, "host": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(0, 64), }, "http_method": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(0, 10), }, "url_path": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(0, 128), }, "version": { - Type: schema.TypeInt, - Required: true, + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntAtLeast(1), }, "attributes": { Type: schema.TypeMap, Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(1, 32), + }, }, - "created_at": { - Type: schema.TypeString, - Computed: true, - }, - "modified_at": { - Type: schema.TypeString, - Computed: true, - }, - "rule_arn": { + "arn": { Type: schema.TypeString, Computed: true, }, @@ -150,7 +155,7 @@ func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) e d.Set("attributes", aws.StringValueMap(samplingRule.Attributes)) d.Set("created_at", samplingRuleRecord.CreatedAt) d.Set("modified_at", samplingRuleRecord.ModifiedAt) - d.Set("rule_arn", samplingRule.RuleARN) + d.Set("arn", samplingRule.RuleARN) break } } @@ -176,10 +181,6 @@ func resourceAwsXraySamplingRuleUpdate(d *schema.ResourceData, meta interface{}) URLPath: aws.String(d.Get("url_path").(string)), } - if d.HasChange("version") { - return fmt.Errorf("Version cannot be modified") - } - if d.HasChange("attributes") { attributes := map[string]*string{} if v, ok := d.GetOk("attributes"); ok { diff --git a/aws/resource_aws_xray_sampling_rule_test.go b/aws/resource_aws_xray_sampling_rule_test.go index 693b4c0fd6c..5a39aaf9b60 100644 --- a/aws/resource_aws_xray_sampling_rule_test.go +++ b/aws/resource_aws_xray_sampling_rule_test.go @@ -2,7 +2,6 @@ package aws import ( "fmt" - "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -27,7 +26,7 @@ func TestAccAWSXraySamplingRule_basic(t *testing.T) { Config: testAccAWSXraySamplingRuleConfig_basic(ruleName), Check: resource.ComposeTestCheckFunc( testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), - testAccCheckResourceAttrRegionalARN(resourceName, "rule_arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), resource.TestCheckResourceAttrSet(resourceName, "priority"), resource.TestCheckResourceAttrSet(resourceName, "version"), resource.TestCheckResourceAttrSet(resourceName, "reservoir_size"), @@ -50,8 +49,6 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { resourceName := "aws_xray_sampling_rule.test" rString := acctest.RandString(8) ruleName := fmt.Sprintf("tf_acc_sampling_rule_%s", rString) - initialVersion := 1 - updatedVersion := initialVersion + 1 updatedPriority := acctest.RandIntRange(0, 9999) updatedReservoirSize := acctest.RandIntRange(0, 2147483647) @@ -61,27 +58,23 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSXraySamplingRuleConfig_update(ruleName, acctest.RandIntRange(0, 9999), acctest.RandIntRange(0, 2147483647), initialVersion), + Config: testAccAWSXraySamplingRuleConfig_update(ruleName, acctest.RandIntRange(0, 9999), acctest.RandIntRange(0, 2147483647)), Check: resource.ComposeTestCheckFunc( testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), - testAccCheckResourceAttrRegionalARN(resourceName, "rule_arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), resource.TestCheckResourceAttr(resourceName, "attributes.%", "0"), ), }, { // Update attributes - Config: testAccAWSXraySamplingRuleConfig_update(ruleName, updatedPriority, updatedReservoirSize, initialVersion), + Config: testAccAWSXraySamplingRuleConfig_update(ruleName, updatedPriority, updatedReservoirSize), Check: resource.ComposeTestCheckFunc( testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), - testAccCheckResourceAttrRegionalARN(resourceName, "rule_arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), resource.TestCheckResourceAttr(resourceName, "priority", fmt.Sprintf("%d", updatedPriority)), resource.TestCheckResourceAttr(resourceName, "reservoir_size", fmt.Sprintf("%d", updatedReservoirSize)), resource.TestCheckResourceAttr(resourceName, "attributes.%", "0"), ), }, - { // Increment version - Config: testAccAWSXraySamplingRuleConfig_update(ruleName, updatedPriority, updatedReservoirSize, updatedVersion), - ExpectError: regexp.MustCompile(`Version cannot be modified`), - }, }, }) } @@ -190,7 +183,7 @@ resource "aws_xray_sampling_rule" "test" { `, ruleName) } -func testAccAWSXraySamplingRuleConfig_update(ruleName string, priority int, reservoirSize int, version int) string { +func testAccAWSXraySamplingRuleConfig_update(ruleName string, priority int, reservoirSize int) string { return fmt.Sprintf(` resource "aws_xray_sampling_rule" "test" { rule_name = "%s" @@ -203,7 +196,7 @@ resource "aws_xray_sampling_rule" "test" { service_name = "*" fixed_rate = 0.3 resource_arn = "*" - version = %d + version = 1 } -`, ruleName, priority, reservoirSize, version) +`, ruleName, priority, reservoirSize) } diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index eda8483e562..a56c74686ef 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -159,6 +159,7 @@ The Terraform AWS Provider allows the following endpoints to be customized: - `wafregional` - `worklink` - `workspaces` +- `xray` ## Connecting to Local AWS Compatible Solutions From 6d49669e893c5dabd8315198c3d80110ee9a4633 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Tue, 7 May 2019 17:17:48 +0100 Subject: [PATCH 17/19] XraySamplingRule now uses a central getXraySamplingRule function that is also shared across its tests --- aws/resource_aws_xray_sampling_rule.go | 71 +++++++++++---------- aws/resource_aws_xray_sampling_rule_test.go | 38 ++++------- 2 files changed, 49 insertions(+), 60 deletions(-) diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index bf1088dc018..54a95bc640d 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -129,41 +129,26 @@ func resourceAwsXraySamplingRuleCreate(d *schema.ResourceData, meta interface{}) func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).xrayconn - params := &xray.GetSamplingRulesInput{} - for { - out, err := conn.GetSamplingRules(params) - log.Printf("[DEBUG] Retrieved Rules: %s", out.SamplingRuleRecords) - if err != nil { - d.SetId("") - return err - } - for _, samplingRuleRecord := range out.SamplingRuleRecords { - samplingRule := samplingRuleRecord.SamplingRule - if aws.StringValue(samplingRule.RuleName) == d.Id() { - d.Set("rule_name", samplingRule.RuleName) - d.Set("resource_arn", samplingRule.ResourceARN) - d.Set("priority", samplingRule.Priority) - d.Set("fixed_rate", samplingRule.FixedRate) - d.Set("reservoir_size", samplingRule.ReservoirSize) - d.Set("service_name", samplingRule.ServiceName) - d.Set("service_type", samplingRule.ServiceType) - d.Set("host", samplingRule.Host) - d.Set("http_method", samplingRule.HTTPMethod) - d.Set("url_path", samplingRule.URLPath) - d.Set("version", samplingRule.Version) - d.Set("attributes", aws.StringValueMap(samplingRule.Attributes)) - d.Set("created_at", samplingRuleRecord.CreatedAt) - d.Set("modified_at", samplingRuleRecord.ModifiedAt) - d.Set("arn", samplingRule.RuleARN) - break - } - } - if out.NextToken == nil { - break - } - params.NextToken = out.NextToken + samplingRule, err := getXraySamplingRule(conn, d.Id()) + + if err != nil { + return err } + + d.Set("rule_name", samplingRule.RuleName) + d.Set("resource_arn", samplingRule.ResourceARN) + d.Set("priority", samplingRule.Priority) + d.Set("fixed_rate", samplingRule.FixedRate) + d.Set("reservoir_size", samplingRule.ReservoirSize) + d.Set("service_name", samplingRule.ServiceName) + d.Set("service_type", samplingRule.ServiceType) + d.Set("host", samplingRule.Host) + d.Set("http_method", samplingRule.HTTPMethod) + d.Set("url_path", samplingRule.URLPath) + d.Set("version", samplingRule.Version) + d.Set("attributes", aws.StringValueMap(samplingRule.Attributes)) + d.Set("arn", samplingRule.RuleARN) return nil } @@ -217,5 +202,25 @@ func resourceAwsXraySamplingRuleDelete(d *schema.ResourceData, meta interface{}) } return nil +} +func getXraySamplingRule(conn *xray.XRay, ruleName string) (*xray.SamplingRule, error) { + params := &xray.GetSamplingRulesInput{} + for { + out, err := conn.GetSamplingRules(params) + if err != nil { + return nil, err + } + for _, samplingRuleRecord := range out.SamplingRuleRecords { + samplingRule := samplingRuleRecord.SamplingRule + if aws.StringValue(samplingRule.RuleName) == ruleName { + return samplingRule, nil + } + } + if aws.StringValue(out.NextToken) == "" { + break + } + params.NextToken = out.NextToken + } + return nil, nil } diff --git a/aws/resource_aws_xray_sampling_rule_test.go b/aws/resource_aws_xray_sampling_rule_test.go index 5a39aaf9b60..5545249c2a1 100644 --- a/aws/resource_aws_xray_sampling_rule_test.go +++ b/aws/resource_aws_xray_sampling_rule_test.go @@ -4,7 +4,6 @@ import ( "fmt" "testing" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/xray" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" @@ -87,7 +86,7 @@ func TestAccAWSXraySamplingRule_import(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckAWSIotThingTypeDestroy, + CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, Steps: []resource.TestStep{ { Config: testAccAWSXraySamplingRuleConfig_basic(ruleName), @@ -111,8 +110,9 @@ func testAccCheckXraySamplingRuleExists(n string, samplingRule *xray.SamplingRul if rs.Primary.ID == "" { return fmt.Errorf("No XRay Sampling Rule ID is set") } + conn := testAccProvider.Meta().(*AWSClient).xrayconn - rule, err := getSamplingRule(rs.Primary.ID) + rule, err := getXraySamplingRule(conn, rs.Primary.ID) if err != nil { return err @@ -130,36 +130,20 @@ func testAccCheckAWSXraySamplingRuleDestroy(s *terraform.State) error { continue } - _, err := getSamplingRule(rs.Primary.ID) + conn := testAccProvider.Meta().(*AWSClient).xrayconn - if err == nil { - return fmt.Errorf("Expected XRay Sampling Rule to be destroyed, %s found", rs.Primary.ID) - } - } - - return nil -} + rule, err := getXraySamplingRule(conn, rs.Primary.ID) -func getSamplingRule(ruleName string) (*xray.SamplingRule, error) { - conn := testAccProvider.Meta().(*AWSClient).xrayconn - params := &xray.GetSamplingRulesInput{} - for { - out, err := conn.GetSamplingRules(params) if err != nil { - return nil, err - } - for _, samplingRuleRecord := range out.SamplingRuleRecords { - samplingRule := samplingRuleRecord.SamplingRule - if aws.StringValue(samplingRule.RuleName) == ruleName { - return samplingRule, nil - } + return err } - if out.NextToken == nil { - break + + if rule != nil { + return fmt.Errorf("Expected XRay Sampling Rule to be destroyed, %s found", rs.Primary.ID) } - params.NextToken = out.NextToken } - return nil, fmt.Errorf("XRay Sampling Rule: %s not found found", ruleName) + + return nil } func testAccAWSXraySamplingRuleConfig_basic(ruleName string) string { From 75ba18a200ce7f1ada75af5c18b492b0201233a2 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Tue, 7 May 2019 17:30:16 +0100 Subject: [PATCH 18/19] Improves error handling in aws xray sampling rule resource --- aws/resource_aws_xray_sampling_rule.go | 15 ++++++++++---- aws/resource_aws_xray_sampling_rule_test.go | 22 +++++---------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/aws/resource_aws_xray_sampling_rule.go b/aws/resource_aws_xray_sampling_rule.go index 54a95bc640d..94f297ba472 100644 --- a/aws/resource_aws_xray_sampling_rule.go +++ b/aws/resource_aws_xray_sampling_rule.go @@ -119,7 +119,7 @@ func resourceAwsXraySamplingRuleCreate(d *schema.ResourceData, meta interface{}) out, err := conn.CreateSamplingRule(params) if err != nil { - return err + return fmt.Errorf("error creating XRay Sampling Rule: %s", err) } d.SetId(*out.SamplingRuleRecord.SamplingRule.RuleName) @@ -133,7 +133,13 @@ func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) e samplingRule, err := getXraySamplingRule(conn, d.Id()) if err != nil { - return err + return fmt.Errorf("error reading XRay Sampling Rule (%s): %s", d.Id(), err) + } + + if samplingRule == nil { + log.Printf("[WARN] XRay Sampling Rule (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil } d.Set("rule_name", samplingRule.RuleName) @@ -149,6 +155,7 @@ func resourceAwsXraySamplingRuleRead(d *schema.ResourceData, meta interface{}) e d.Set("version", samplingRule.Version) d.Set("attributes", aws.StringValueMap(samplingRule.Attributes)) d.Set("arn", samplingRule.RuleARN) + return nil } @@ -182,7 +189,7 @@ func resourceAwsXraySamplingRuleUpdate(d *schema.ResourceData, meta interface{}) _, err := conn.UpdateSamplingRule(params) if err != nil { - return err + return fmt.Errorf("error updating XRay Sampling Rule (%s): %s", d.Id(), err) } return resourceAwsXraySamplingRuleRead(d, meta) @@ -198,7 +205,7 @@ func resourceAwsXraySamplingRuleDelete(d *schema.ResourceData, meta interface{}) } _, err := conn.DeleteSamplingRule(params) if err != nil { - return fmt.Errorf("Error deleting XRay Sampling Rule: %s", d.Id()) + return fmt.Errorf("error deleting XRay Sampling Rule: %s", d.Id()) } return nil diff --git a/aws/resource_aws_xray_sampling_rule_test.go b/aws/resource_aws_xray_sampling_rule_test.go index 5545249c2a1..2dd363880b9 100644 --- a/aws/resource_aws_xray_sampling_rule_test.go +++ b/aws/resource_aws_xray_sampling_rule_test.go @@ -39,6 +39,11 @@ func TestAccAWSXraySamplingRule_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "attributes.%", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -74,23 +79,6 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "attributes.%", "0"), ), }, - }, - }) -} - -func TestAccAWSXraySamplingRule_import(t *testing.T) { - resourceName := "aws_xray_sampling_rule.test" - rString := acctest.RandString(8) - ruleName := fmt.Sprintf("tf_acc_sampling_rule_%s", rString) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSXraySamplingRuleConfig_basic(ruleName), - }, { ResourceName: resourceName, ImportState: true, From 78104704868e0bc50cd70ec433798c08680e55e0 Mon Sep 17 00:00:00 2001 From: Dimitrios Dedoussis Date: Tue, 7 May 2019 17:43:29 +0100 Subject: [PATCH 19/19] XraySamplingRule aceptance tests now check values of resource attributes --- aws/resource_aws_xray_sampling_rule_test.go | 38 ++++++++++++++----- .../docs/r/xray_sampling_rule.html.markdown | 3 +- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/aws/resource_aws_xray_sampling_rule_test.go b/aws/resource_aws_xray_sampling_rule_test.go index 2dd363880b9..5ac78d441c3 100644 --- a/aws/resource_aws_xray_sampling_rule_test.go +++ b/aws/resource_aws_xray_sampling_rule_test.go @@ -26,16 +26,16 @@ func TestAccAWSXraySamplingRule_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), testAccCheckResourceAttrRegionalARN(resourceName, "arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), - resource.TestCheckResourceAttrSet(resourceName, "priority"), - resource.TestCheckResourceAttrSet(resourceName, "version"), - resource.TestCheckResourceAttrSet(resourceName, "reservoir_size"), - resource.TestCheckResourceAttrSet(resourceName, "url_path"), - resource.TestCheckResourceAttrSet(resourceName, "host"), - resource.TestCheckResourceAttrSet(resourceName, "http_method"), - resource.TestCheckResourceAttrSet(resourceName, "fixed_rate"), - resource.TestCheckResourceAttrSet(resourceName, "resource_arn"), - resource.TestCheckResourceAttrSet(resourceName, "service_name"), - resource.TestCheckResourceAttrSet(resourceName, "service_type"), + resource.TestCheckResourceAttr(resourceName, "priority", "5"), + resource.TestCheckResourceAttr(resourceName, "version", "1"), + resource.TestCheckResourceAttr(resourceName, "reservoir_size", "10"), + resource.TestCheckResourceAttr(resourceName, "url_path", "*"), + resource.TestCheckResourceAttr(resourceName, "host", "*"), + resource.TestCheckResourceAttr(resourceName, "http_method", "GET"), + resource.TestCheckResourceAttr(resourceName, "fixed_rate", "0.3"), + resource.TestCheckResourceAttr(resourceName, "resource_arn", "*"), + resource.TestCheckResourceAttr(resourceName, "service_name", "*"), + resource.TestCheckResourceAttr(resourceName, "service_type", "*"), resource.TestCheckResourceAttr(resourceName, "attributes.%", "1"), ), }, @@ -66,6 +66,16 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckXraySamplingRuleExists(resourceName, &samplingRule), testAccCheckResourceAttrRegionalARN(resourceName, "arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), + resource.TestCheckResourceAttrSet(resourceName, "priority"), + resource.TestCheckResourceAttrSet(resourceName, "reservoir_size"), + resource.TestCheckResourceAttr(resourceName, "version", "1"), + resource.TestCheckResourceAttr(resourceName, "url_path", "*"), + resource.TestCheckResourceAttr(resourceName, "host", "*"), + resource.TestCheckResourceAttr(resourceName, "http_method", "GET"), + resource.TestCheckResourceAttr(resourceName, "fixed_rate", "0.3"), + resource.TestCheckResourceAttr(resourceName, "resource_arn", "*"), + resource.TestCheckResourceAttr(resourceName, "service_name", "*"), + resource.TestCheckResourceAttr(resourceName, "service_type", "*"), resource.TestCheckResourceAttr(resourceName, "attributes.%", "0"), ), }, @@ -76,6 +86,14 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { testAccCheckResourceAttrRegionalARN(resourceName, "arn", "xray", fmt.Sprintf("sampling-rule/%s", ruleName)), resource.TestCheckResourceAttr(resourceName, "priority", fmt.Sprintf("%d", updatedPriority)), resource.TestCheckResourceAttr(resourceName, "reservoir_size", fmt.Sprintf("%d", updatedReservoirSize)), + resource.TestCheckResourceAttr(resourceName, "version", "1"), + resource.TestCheckResourceAttr(resourceName, "url_path", "*"), + resource.TestCheckResourceAttr(resourceName, "host", "*"), + resource.TestCheckResourceAttr(resourceName, "http_method", "GET"), + resource.TestCheckResourceAttr(resourceName, "fixed_rate", "0.3"), + resource.TestCheckResourceAttr(resourceName, "resource_arn", "*"), + resource.TestCheckResourceAttr(resourceName, "service_name", "*"), + resource.TestCheckResourceAttr(resourceName, "service_type", "*"), resource.TestCheckResourceAttr(resourceName, "attributes.%", "0"), ), }, diff --git a/website/docs/r/xray_sampling_rule.html.markdown b/website/docs/r/xray_sampling_rule.html.markdown index a88f133afcc..9fc2a798a6b 100644 --- a/website/docs/r/xray_sampling_rule.html.markdown +++ b/website/docs/r/xray_sampling_rule.html.markdown @@ -50,7 +50,8 @@ resource "aws_xray_sampling_rule" "example" { In addition to the arguments above, the following attributes are exported: -* `rule_arn` - The ARN of the sampling rule. +* `id` - The name of the sampling rule. +* `arn` - The ARN of the sampling rule. ## Import