From 9868a01f782397cfea18eaa89ad70607526564e7 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Thu, 7 Mar 2019 23:15:03 -0700 Subject: [PATCH 01/17] Fix s3 metricset timestamp and sqs queue name --- metricbeat/docs/fields.asciidoc | 10 ++++++++++ .../aws/s3_daily_storage/_meta/data.json | 4 ---- .../aws/s3_daily_storage/s3_daily_storage.go | 14 +++++++++++-- .../module/aws/s3_request/_meta/data.json | 15 +++++--------- .../module/aws/s3_request/s3_request.go | 20 ++++++++++++++++--- .../metricbeat/module/aws/sqs/_meta/data.json | 9 +++------ .../module/aws/sqs/_meta/fields.yml | 4 ++++ x-pack/metricbeat/module/aws/sqs/data.go | 1 + x-pack/metricbeat/module/aws/sqs/sqs.go | 2 +- .../module/aws/sqs/sqs_integration_test.go | 1 + 10 files changed, 54 insertions(+), 26 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index b75801a5f0bd..08d67cceeed2 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -1406,6 +1406,16 @@ format: bytes The size of messages added to a queue. +-- + +*`aws.sqs.queue.name`*:: ++ +-- +type: keyword + +SQS queue name + + -- [[exported-fields-beat]] diff --git a/x-pack/metricbeat/module/aws/s3_daily_storage/_meta/data.json b/x-pack/metricbeat/module/aws/s3_daily_storage/_meta/data.json index 0cdfffa3aab2..a8d34d27bfa8 100644 --- a/x-pack/metricbeat/module/aws/s3_daily_storage/_meta/data.json +++ b/x-pack/metricbeat/module/aws/s3_daily_storage/_meta/data.json @@ -1,9 +1,5 @@ { "@timestamp": "2017-10-12T08:05:34.853Z", - "agent": { - "hostname": "host.example.com", - "name": "host.example.com" - }, "aws": { "s3_daily_storage": { "bucket": { diff --git a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go index 7110018bbf04..9d20cbeb4f97 100644 --- a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go +++ b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "strings" + "time" "github.com/aws/aws-sdk-go-v2/service/cloudwatch" "github.com/pkg/errors" @@ -83,7 +84,8 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { func (m *MetricSet) Fetch(report mb.ReporterV2) { namespace := "AWS/S3" // Get startTime and endTime - startTime, endTime, err := aws.GetStartTimeEndTime(m.DurationString) + // Duration should always be "-172800s" for s3_daily_storage metrics. Otherwise the query will not return any results + startTime, endTime, err := aws.GetStartTimeEndTime("-172800s") if err != nil { err = errors.Wrap(err, "Error ParseDuration") m.logger.Error(err.Error()) @@ -205,7 +207,15 @@ func createCloudWatchEvents(outputs []cloudwatch.MetricDataResult, regionName st // AWS s3_daily_storage metrics mapOfMetricSetFieldResults := make(map[string]interface{}) // Find a timestamp for all metrics in output - if len(outputs) > 0 && len(outputs[0].Timestamps) > 0 { + timestamp := time.Time{} + for _, output := range outputs { + if output.Timestamps != nil { + timestamp = output.Timestamps[0] + break + } + } + + if !timestamp.IsZero() { timestamp := outputs[0].Timestamps[0] for _, output := range outputs { labels := strings.Split(*output.Label, " ") diff --git a/x-pack/metricbeat/module/aws/s3_request/_meta/data.json b/x-pack/metricbeat/module/aws/s3_request/_meta/data.json index 22306231c82a..6b98c713d5cb 100644 --- a/x-pack/metricbeat/module/aws/s3_request/_meta/data.json +++ b/x-pack/metricbeat/module/aws/s3_request/_meta/data.json @@ -1,28 +1,23 @@ { "@timestamp": "2017-10-12T08:05:34.853Z", - "agent": { - "hostname": "host.example.com", - "name": "host.example.com" - }, "aws": { "s3_request": { "bucket": { "name": "test-s3-ks" }, "downloaded": { - "bytes": 1303 + "bytes": 2606 }, "errors": { "4xx": 0, "5xx": 0 }, "latency": { - "first_byte.ms": 544, - "total_request.ms": 545 + "first_byte.ms": 1032, + "total_request.ms": 1032 }, "requests": { - "head": 1, - "list": 1, + "list": 2, "total": 2 }, "uploaded": {} @@ -44,4 +39,4 @@ "name": "s3_request", "type": "s3_request" } -} +} \ No newline at end of file diff --git a/x-pack/metricbeat/module/aws/s3_request/s3_request.go b/x-pack/metricbeat/module/aws/s3_request/s3_request.go index 67f2cd32425c..316e028651cc 100644 --- a/x-pack/metricbeat/module/aws/s3_request/s3_request.go +++ b/x-pack/metricbeat/module/aws/s3_request/s3_request.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "strings" + "time" "github.com/aws/aws-sdk-go-v2/service/cloudwatch" "github.com/pkg/errors" @@ -82,7 +83,8 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { func (m *MetricSet) Fetch(report mb.ReporterV2) { namespace := "AWS/S3" // Get startTime and endTime - startTime, endTime, err := aws.GetStartTimeEndTime(m.DurationString) + // Duration should always be "-172800s" for s3_request metrics. Otherwise the query might not return any results + startTime, endTime, err := aws.GetStartTimeEndTime("-172800s") if err != nil { logp.Error(errors.Wrap(err, "Error ParseDuration")) m.logger.Error(err.Error()) @@ -119,6 +121,10 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) { continue } + if regionName == "ap-southeast-1" { + fmt.Println("metricDataOutputs2 = ", metricDataOutputs) + } + // Create Cloudwatch Events for s3_request bucketNames := getBucketNames(listMetricsOutputs) for _, bucketName := range bucketNames { @@ -205,9 +211,17 @@ func createS3RequestEvents(outputs []cloudwatch.MetricDataResult, regionName str // AWS s3_request metrics mapOfMetricSetFieldResults := make(map[string]interface{}) + // Find a timestamp for all metrics in output - if len(outputs) > 0 && len(outputs[0].Timestamps) > 0 { - timestamp := outputs[0].Timestamps[0] + timestamp := time.Time{} + for _, output := range outputs { + if output.Timestamps != nil { + timestamp = output.Timestamps[0] + break + } + } + + if !timestamp.IsZero() { for _, output := range outputs { labels := strings.Split(*output.Label, " ") // check timestamp to make sure metrics come from the same timestamp diff --git a/x-pack/metricbeat/module/aws/sqs/_meta/data.json b/x-pack/metricbeat/module/aws/sqs/_meta/data.json index afec23f860d0..7d3f1d6d6a68 100644 --- a/x-pack/metricbeat/module/aws/sqs/_meta/data.json +++ b/x-pack/metricbeat/module/aws/sqs/_meta/data.json @@ -1,9 +1,5 @@ { "@timestamp": "2017-10-12T08:05:34.853Z", - "agent": { - "hostname": "host.example.com", - "name": "host.example.com" - }, "aws": { "sqs": { "empty_receives": 0, @@ -13,11 +9,12 @@ "not_visible": 0, "received": 0, "sent": 0, - "visible": 91 + "visible": 45 }, "oldest_message_age": { - "sec": 86404 + "sec": 82247 }, + "queue.name": "elb-log-queue-20171218185917658900000001", "sent_message_size": {} } }, diff --git a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml index 9893f0af8a9b..1e36b2465741 100644 --- a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml +++ b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml @@ -41,3 +41,7 @@ format: bytes description: > The size of messages added to a queue. + - name: queue.name + type: keyword + description: > + SQS queue name diff --git a/x-pack/metricbeat/module/aws/sqs/data.go b/x-pack/metricbeat/module/aws/sqs/data.go index 9c45715b0812..f76810cf9256 100644 --- a/x-pack/metricbeat/module/aws/sqs/data.go +++ b/x-pack/metricbeat/module/aws/sqs/data.go @@ -26,5 +26,6 @@ var ( "sent_message_size": s.Object{ "bytes": c.Float("SentMessageSize"), }, + "queue.name": c.Str("QueueName"), } ) diff --git a/x-pack/metricbeat/module/aws/sqs/sqs.go b/x-pack/metricbeat/module/aws/sqs/sqs.go index 764d3898b7c8..e20485536fd4 100644 --- a/x-pack/metricbeat/module/aws/sqs/sqs.go +++ b/x-pack/metricbeat/module/aws/sqs/sqs.go @@ -165,7 +165,7 @@ func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, metrics continue } labels := strings.Split(*output.Label, " ") - mapOfMetricSetFieldResults["queue.name"] = labels[0] + mapOfMetricSetFieldResults["QueueName"] = labels[0] mapOfMetricSetFieldResults[labels[1]] = fmt.Sprint(output.Values[0]) } diff --git a/x-pack/metricbeat/module/aws/sqs/sqs_integration_test.go b/x-pack/metricbeat/module/aws/sqs/sqs_integration_test.go index c3d758c82d57..3ca4874f6eb5 100644 --- a/x-pack/metricbeat/module/aws/sqs/sqs_integration_test.go +++ b/x-pack/metricbeat/module/aws/sqs/sqs_integration_test.go @@ -48,6 +48,7 @@ func TestFetch(t *testing.T) { mtest.CheckEventField("messages.visible", "float", event, t) mtest.CheckEventField("oldest_message_age.sec", "float", event, t) mtest.CheckEventField("sent_message_size", "float", event, t) + mtest.CheckEventField("queue.name", "string", event, t) } } From 75bff6b95c3cc0324168db02816dd0a7d7d21373 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Fri, 8 Mar 2019 07:49:36 -0700 Subject: [PATCH 02/17] Remove debug code --- x-pack/metricbeat/module/aws/s3_request/s3_request.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x-pack/metricbeat/module/aws/s3_request/s3_request.go b/x-pack/metricbeat/module/aws/s3_request/s3_request.go index 316e028651cc..14846b604466 100644 --- a/x-pack/metricbeat/module/aws/s3_request/s3_request.go +++ b/x-pack/metricbeat/module/aws/s3_request/s3_request.go @@ -121,10 +121,6 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) { continue } - if regionName == "ap-southeast-1" { - fmt.Println("metricDataOutputs2 = ", metricDataOutputs) - } - // Create Cloudwatch Events for s3_request bucketNames := getBucketNames(listMetricsOutputs) for _, bucketName := range bucketNames { From 7610b5f9574b19ff1831235f682fa70acd57b19d Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Fri, 8 Mar 2019 13:04:12 -0700 Subject: [PATCH 03/17] Change back to use duration instead of hardcoded string --- .../module/aws/s3_daily_storage/s3_daily_storage.go | 5 ++--- x-pack/metricbeat/module/aws/s3_request/s3_request.go | 5 ++--- x-pack/metricbeat/module/aws/sqs/sqs.go | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go index 9d20cbeb4f97..c24b221e8d7c 100644 --- a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go +++ b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go @@ -84,8 +84,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { func (m *MetricSet) Fetch(report mb.ReporterV2) { namespace := "AWS/S3" // Get startTime and endTime - // Duration should always be "-172800s" for s3_daily_storage metrics. Otherwise the query will not return any results - startTime, endTime, err := aws.GetStartTimeEndTime("-172800s") + startTime, endTime, err := aws.GetStartTimeEndTime(m.DurationString) if err != nil { err = errors.Wrap(err, "Error ParseDuration") m.logger.Error(err.Error()) @@ -221,7 +220,7 @@ func createCloudWatchEvents(outputs []cloudwatch.MetricDataResult, regionName st labels := strings.Split(*output.Label, " ") // check timestamp to make sure metrics come from the same timestamp if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > 0 && output.Timestamps[0] == timestamp { - mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[0]) + mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[len(output.Values)-1]) } } } diff --git a/x-pack/metricbeat/module/aws/s3_request/s3_request.go b/x-pack/metricbeat/module/aws/s3_request/s3_request.go index 14846b604466..a0203f82d9b5 100644 --- a/x-pack/metricbeat/module/aws/s3_request/s3_request.go +++ b/x-pack/metricbeat/module/aws/s3_request/s3_request.go @@ -83,8 +83,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { func (m *MetricSet) Fetch(report mb.ReporterV2) { namespace := "AWS/S3" // Get startTime and endTime - // Duration should always be "-172800s" for s3_request metrics. Otherwise the query might not return any results - startTime, endTime, err := aws.GetStartTimeEndTime("-172800s") + startTime, endTime, err := aws.GetStartTimeEndTime(m.DurationString) if err != nil { logp.Error(errors.Wrap(err, "Error ParseDuration")) m.logger.Error(err.Error()) @@ -222,7 +221,7 @@ func createS3RequestEvents(outputs []cloudwatch.MetricDataResult, regionName str labels := strings.Split(*output.Label, " ") // check timestamp to make sure metrics come from the same timestamp if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > 0 && output.Timestamps[0] == timestamp { - mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[0]) + mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[len(output.Values)-1]) } } } diff --git a/x-pack/metricbeat/module/aws/sqs/sqs.go b/x-pack/metricbeat/module/aws/sqs/sqs.go index e20485536fd4..0c7b92f17d92 100644 --- a/x-pack/metricbeat/module/aws/sqs/sqs.go +++ b/x-pack/metricbeat/module/aws/sqs/sqs.go @@ -166,7 +166,7 @@ func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, metrics } labels := strings.Split(*output.Label, " ") mapOfMetricSetFieldResults["QueueName"] = labels[0] - mapOfMetricSetFieldResults[labels[1]] = fmt.Sprint(output.Values[0]) + mapOfMetricSetFieldResults[labels[1]] = fmt.Sprint(output.Values[len(output.Values)-1]) } resultMetricSetFields, err := aws.EventMapping(mapOfMetricSetFieldResults, schemaMetricFields) From 3c15094e98d93c3f43fc53f83cf129f84b5793d1 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Sat, 9 Mar 2019 23:27:59 -0700 Subject: [PATCH 04/17] Add function to get queueUrls --- .../aws/aws-sdk-go-v2/service/sqs/api.go | 3915 +++++++++++++++++ .../aws-sdk-go-v2/service/sqs/checksums.go | 110 + .../service/sqs/customizations.go | 11 + .../aws/aws-sdk-go-v2/service/sqs/doc.go | 67 + .../aws/aws-sdk-go-v2/service/sqs/errors.go | 110 + .../aws/aws-sdk-go-v2/service/sqs/service.go | 85 + .../service/sqs/sqsiface/interface.go | 106 + vendor/vendor.json | 16 + .../module/aws/sqs/_meta/docs.asciidoc | 1 + x-pack/metricbeat/module/aws/sqs/sqs.go | 50 +- x-pack/metricbeat/module/aws/sqs/sqs_test.go | 38 + 11 files changed, 4501 insertions(+), 8 deletions(-) create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sqs/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sqs/checksums.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sqs/customizations.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sqs/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sqs/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sqs/service.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sqs/sqsiface/interface.go create mode 100644 x-pack/metricbeat/module/aws/sqs/sqs_test.go diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/api.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/api.go new file mode 100644 index 000000000000..72857889cfdc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/api.go @@ -0,0 +1,3915 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package sqs + +import ( + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" + "github.com/aws/aws-sdk-go-v2/private/protocol" + "github.com/aws/aws-sdk-go-v2/private/protocol/query" +) + +const opAddPermission = "AddPermission" + +// AddPermissionRequest is a API request type for the AddPermission API operation. +type AddPermissionRequest struct { + *aws.Request + Input *AddPermissionInput + Copy func(*AddPermissionInput) AddPermissionRequest +} + +// Send marshals and sends the AddPermission API request. +func (r AddPermissionRequest) Send() (*AddPermissionOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*AddPermissionOutput), nil +} + +// AddPermissionRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Adds a permission to a queue for a specific principal (http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P). +// This allows sharing access to the queue. +// +// When you create a queue, you have full control access rights for the queue. +// Only you, the owner of the queue, can grant or deny permissions to the queue. +// For more information about these permissions, see Allow Developers to Write +// Messages to a Shared Queue (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue) +// in the Amazon Simple Queue Service Developer Guide. +// +// AddPermission writes an Amazon-SQS-generated policy. If you want to write +// your own policy, use SetQueueAttributes to upload your policy. For more information +// about writing your own policy, see Using Custom Policies with the Amazon +// SQS Access Policy Language (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-creating-custom-policies.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// An Amazon SQS policy can have a maximum of 7 actions. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &Attribute.1=first +// +// &Attribute.2=second +// +// Cross-account permissions don't apply to this action. For more information, +// see see Grant Cross-Account Permissions to a Role and a User Name (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the AddPermissionRequest method. +// req := client.AddPermissionRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermission +func (c *SQS) AddPermissionRequest(input *AddPermissionInput) AddPermissionRequest { + op := &aws.Operation{ + Name: opAddPermission, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddPermissionInput{} + } + + output := &AddPermissionOutput{} + req := c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output.responseMetadata = aws.Response{Request: req} + + return AddPermissionRequest{Request: req, Input: input, Copy: c.AddPermissionRequest} +} + +const opChangeMessageVisibility = "ChangeMessageVisibility" + +// ChangeMessageVisibilityRequest is a API request type for the ChangeMessageVisibility API operation. +type ChangeMessageVisibilityRequest struct { + *aws.Request + Input *ChangeMessageVisibilityInput + Copy func(*ChangeMessageVisibilityInput) ChangeMessageVisibilityRequest +} + +// Send marshals and sends the ChangeMessageVisibility API request. +func (r ChangeMessageVisibilityRequest) Send() (*ChangeMessageVisibilityOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*ChangeMessageVisibilityOutput), nil +} + +// ChangeMessageVisibilityRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Changes the visibility timeout of a specified message in a queue to a new +// value. The maximum allowed timeout value is 12 hours. For more information, +// see Visibility Timeout (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// For example, you have a message with a visibility timeout of 5 minutes. After +// 3 minutes, you call ChangeMessageVisibility with a timeout of 10 minutes. +// You can continue to call ChangeMessageVisibility to extend the visibility +// timeout to a maximum of 12 hours. If you try to extend the visibility timeout +// beyond 12 hours, your request is rejected. +// +// A message is considered to be in flight after it's received from a queue +// by a consumer, but not yet deleted from the queue. +// +// For standard queues, there can be a maximum of 120,000 inflight messages +// per queue. If you reach this limit, Amazon SQS returns the OverLimit error +// message. To avoid reaching the limit, you should delete messages from the +// queue after they're processed. You can also increase the number of queues +// you use to process your messages. +// +// For FIFO queues, there can be a maximum of 20,000 inflight messages per queue. +// If you reach this limit, Amazon SQS returns no error messages. +// +// If you attempt to set the VisibilityTimeout to a value greater than the maximum +// time left, Amazon SQS returns an error. Amazon SQS doesn't automatically +// recalculate and increase the timeout to the maximum remaining time. +// +// Unlike with a queue, when you change the visibility timeout for a specific +// message the timeout value is applied immediately but isn't saved in memory +// for that message. If you don't delete a message after it is received, the +// visibility timeout for the message reverts to the original timeout value +// (not to the value you set using the ChangeMessageVisibility action) the next +// time the message is received. +// +// // Example sending a request using the ChangeMessageVisibilityRequest method. +// req := client.ChangeMessageVisibilityRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibility +func (c *SQS) ChangeMessageVisibilityRequest(input *ChangeMessageVisibilityInput) ChangeMessageVisibilityRequest { + op := &aws.Operation{ + Name: opChangeMessageVisibility, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ChangeMessageVisibilityInput{} + } + + output := &ChangeMessageVisibilityOutput{} + req := c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output.responseMetadata = aws.Response{Request: req} + + return ChangeMessageVisibilityRequest{Request: req, Input: input, Copy: c.ChangeMessageVisibilityRequest} +} + +const opChangeMessageVisibilityBatch = "ChangeMessageVisibilityBatch" + +// ChangeMessageVisibilityBatchRequest is a API request type for the ChangeMessageVisibilityBatch API operation. +type ChangeMessageVisibilityBatchRequest struct { + *aws.Request + Input *ChangeMessageVisibilityBatchInput + Copy func(*ChangeMessageVisibilityBatchInput) ChangeMessageVisibilityBatchRequest +} + +// Send marshals and sends the ChangeMessageVisibilityBatch API request. +func (r ChangeMessageVisibilityBatchRequest) Send() (*ChangeMessageVisibilityBatchOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*ChangeMessageVisibilityBatchOutput), nil +} + +// ChangeMessageVisibilityBatchRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Changes the visibility timeout of multiple messages. This is a batch version +// of ChangeMessageVisibility. The result of the action on each message is reported +// individually in the response. You can send up to 10 ChangeMessageVisibility +// requests with each ChangeMessageVisibilityBatch action. +// +// Because the batch request can result in a combination of successful and unsuccessful +// actions, you should check for batch errors even when the call returns an +// HTTP status code of 200. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &Attribute.1=first +// +// &Attribute.2=second +// +// // Example sending a request using the ChangeMessageVisibilityBatchRequest method. +// req := client.ChangeMessageVisibilityBatchRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatch +func (c *SQS) ChangeMessageVisibilityBatchRequest(input *ChangeMessageVisibilityBatchInput) ChangeMessageVisibilityBatchRequest { + op := &aws.Operation{ + Name: opChangeMessageVisibilityBatch, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ChangeMessageVisibilityBatchInput{} + } + + output := &ChangeMessageVisibilityBatchOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return ChangeMessageVisibilityBatchRequest{Request: req, Input: input, Copy: c.ChangeMessageVisibilityBatchRequest} +} + +const opCreateQueue = "CreateQueue" + +// CreateQueueRequest is a API request type for the CreateQueue API operation. +type CreateQueueRequest struct { + *aws.Request + Input *CreateQueueInput + Copy func(*CreateQueueInput) CreateQueueRequest +} + +// Send marshals and sends the CreateQueue API request. +func (r CreateQueueRequest) Send() (*CreateQueueOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*CreateQueueOutput), nil +} + +// CreateQueueRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Creates a new standard or FIFO queue. You can pass one or more attributes +// in the request. Keep the following caveats in mind: +// +// * If you don't specify the FifoQueue attribute, Amazon SQS creates a standard +// queue. +// +// You can't change the queue type after you create it and you can't convert +// an existing standard queue into a FIFO queue. You must either create a +// new FIFO queue for your application or delete your existing standard queue +// and recreate it as a FIFO queue. For more information, see Moving From +// a Standard Queue to a FIFO Queue (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-moving) +// in the Amazon Simple Queue Service Developer Guide. +// +// * If you don't provide a value for an attribute, the queue is created +// with the default value for the attribute. +// +// * If you delete a queue, you must wait at least 60 seconds before creating +// a queue with the same name. +// +// To successfully create a new queue, you must provide a queue name that adheres +// to the limits related to queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-queues.html) +// and is unique within the scope of your queues. +// +// To get the queue URL, use the GetQueueUrl action. GetQueueUrl requires only +// the QueueName parameter. be aware of existing queue names: +// +// * If you provide the name of an existing queue along with the exact names +// and values of all the queue's attributes, CreateQueue returns the queue +// URL for the existing queue. +// +// * If the queue name, attribute names, or attribute values don't match +// an existing queue, CreateQueue returns an error. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &Attribute.1=first +// +// &Attribute.2=second +// +// Cross-account permissions don't apply to this action. For more information, +// see see Grant Cross-Account Permissions to a Role and a User Name (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the CreateQueueRequest method. +// req := client.CreateQueueRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueue +func (c *SQS) CreateQueueRequest(input *CreateQueueInput) CreateQueueRequest { + op := &aws.Operation{ + Name: opCreateQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateQueueInput{} + } + + output := &CreateQueueOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return CreateQueueRequest{Request: req, Input: input, Copy: c.CreateQueueRequest} +} + +const opDeleteMessage = "DeleteMessage" + +// DeleteMessageRequest is a API request type for the DeleteMessage API operation. +type DeleteMessageRequest struct { + *aws.Request + Input *DeleteMessageInput + Copy func(*DeleteMessageInput) DeleteMessageRequest +} + +// Send marshals and sends the DeleteMessage API request. +func (r DeleteMessageRequest) Send() (*DeleteMessageOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*DeleteMessageOutput), nil +} + +// DeleteMessageRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Deletes the specified message from the specified queue. To select the message +// to delete, use the ReceiptHandle of the message (not the MessageId which +// you receive when you send the message). Amazon SQS can delete a message from +// a queue even if a visibility timeout setting causes the message to be locked +// by another consumer. Amazon SQS automatically deletes messages left in a +// queue longer than the retention period configured for the queue. +// +// The ReceiptHandle is associated with a specific instance of receiving a message. +// If you receive a message more than once, the ReceiptHandle is different each +// time you receive a message. When you use the DeleteMessage action, you must +// provide the most recently received ReceiptHandle for the message (otherwise, +// the request succeeds, but the message might not be deleted). +// +// For standard queues, it is possible to receive a message even after you delete +// it. This might happen on rare occasions if one of the servers which stores +// a copy of the message is unavailable when you send the request to delete +// the message. The copy remains on the server and might be returned to you +// during a subsequent receive request. You should ensure that your application +// is idempotent, so that receiving a message more than once does not cause +// issues. +// +// // Example sending a request using the DeleteMessageRequest method. +// req := client.DeleteMessageRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessage +func (c *SQS) DeleteMessageRequest(input *DeleteMessageInput) DeleteMessageRequest { + op := &aws.Operation{ + Name: opDeleteMessage, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteMessageInput{} + } + + output := &DeleteMessageOutput{} + req := c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output.responseMetadata = aws.Response{Request: req} + + return DeleteMessageRequest{Request: req, Input: input, Copy: c.DeleteMessageRequest} +} + +const opDeleteMessageBatch = "DeleteMessageBatch" + +// DeleteMessageBatchRequest is a API request type for the DeleteMessageBatch API operation. +type DeleteMessageBatchRequest struct { + *aws.Request + Input *DeleteMessageBatchInput + Copy func(*DeleteMessageBatchInput) DeleteMessageBatchRequest +} + +// Send marshals and sends the DeleteMessageBatch API request. +func (r DeleteMessageBatchRequest) Send() (*DeleteMessageBatchOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*DeleteMessageBatchOutput), nil +} + +// DeleteMessageBatchRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Deletes up to ten messages from the specified queue. This is a batch version +// of DeleteMessage. The result of the action on each message is reported individually +// in the response. +// +// Because the batch request can result in a combination of successful and unsuccessful +// actions, you should check for batch errors even when the call returns an +// HTTP status code of 200. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &Attribute.1=first +// +// &Attribute.2=second +// +// // Example sending a request using the DeleteMessageBatchRequest method. +// req := client.DeleteMessageBatchRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatch +func (c *SQS) DeleteMessageBatchRequest(input *DeleteMessageBatchInput) DeleteMessageBatchRequest { + op := &aws.Operation{ + Name: opDeleteMessageBatch, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteMessageBatchInput{} + } + + output := &DeleteMessageBatchOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return DeleteMessageBatchRequest{Request: req, Input: input, Copy: c.DeleteMessageBatchRequest} +} + +const opDeleteQueue = "DeleteQueue" + +// DeleteQueueRequest is a API request type for the DeleteQueue API operation. +type DeleteQueueRequest struct { + *aws.Request + Input *DeleteQueueInput + Copy func(*DeleteQueueInput) DeleteQueueRequest +} + +// Send marshals and sends the DeleteQueue API request. +func (r DeleteQueueRequest) Send() (*DeleteQueueOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*DeleteQueueOutput), nil +} + +// DeleteQueueRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Deletes the queue specified by the QueueUrl, regardless of the queue's contents. +// If the specified queue doesn't exist, Amazon SQS returns a successful response. +// +// Be careful with the DeleteQueue action: When you delete a queue, any messages +// in the queue are no longer available. +// +// When you delete a queue, the deletion process takes up to 60 seconds. Requests +// you send involving that queue during the 60 seconds might succeed. For example, +// a SendMessage request might succeed, but after 60 seconds the queue and the +// message you sent no longer exist. +// +// When you delete a queue, you must wait at least 60 seconds before creating +// a queue with the same name. +// +// Cross-account permissions don't apply to this action. For more information, +// see see Grant Cross-Account Permissions to a Role and a User Name (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the DeleteQueueRequest method. +// req := client.DeleteQueueRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueue +func (c *SQS) DeleteQueueRequest(input *DeleteQueueInput) DeleteQueueRequest { + op := &aws.Operation{ + Name: opDeleteQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteQueueInput{} + } + + output := &DeleteQueueOutput{} + req := c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output.responseMetadata = aws.Response{Request: req} + + return DeleteQueueRequest{Request: req, Input: input, Copy: c.DeleteQueueRequest} +} + +const opGetQueueAttributes = "GetQueueAttributes" + +// GetQueueAttributesRequest is a API request type for the GetQueueAttributes API operation. +type GetQueueAttributesRequest struct { + *aws.Request + Input *GetQueueAttributesInput + Copy func(*GetQueueAttributesInput) GetQueueAttributesRequest +} + +// Send marshals and sends the GetQueueAttributes API request. +func (r GetQueueAttributesRequest) Send() (*GetQueueAttributesOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*GetQueueAttributesOutput), nil +} + +// GetQueueAttributesRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Gets attributes for the specified queue. +// +// To determine whether a queue is FIFO (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html), +// you can check whether QueueName ends with the .fifo suffix. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &Attribute.1=first +// +// &Attribute.2=second +// +// // Example sending a request using the GetQueueAttributesRequest method. +// req := client.GetQueueAttributesRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributes +func (c *SQS) GetQueueAttributesRequest(input *GetQueueAttributesInput) GetQueueAttributesRequest { + op := &aws.Operation{ + Name: opGetQueueAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetQueueAttributesInput{} + } + + output := &GetQueueAttributesOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return GetQueueAttributesRequest{Request: req, Input: input, Copy: c.GetQueueAttributesRequest} +} + +const opGetQueueUrl = "GetQueueUrl" + +// GetQueueUrlRequest is a API request type for the GetQueueUrl API operation. +type GetQueueUrlRequest struct { + *aws.Request + Input *GetQueueUrlInput + Copy func(*GetQueueUrlInput) GetQueueUrlRequest +} + +// Send marshals and sends the GetQueueUrl API request. +func (r GetQueueUrlRequest) Send() (*GetQueueUrlOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*GetQueueUrlOutput), nil +} + +// GetQueueUrlRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Returns the URL of an existing Amazon SQS queue. +// +// To access a queue that belongs to another AWS account, use the QueueOwnerAWSAccountId +// parameter to specify the account ID of the queue's owner. The queue's owner +// must grant you permission to access the queue. For more information about +// shared queue access, see AddPermission or see Allow Developers to Write Messages +// to a Shared Queue (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the GetQueueUrlRequest method. +// req := client.GetQueueUrlRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrl +func (c *SQS) GetQueueUrlRequest(input *GetQueueUrlInput) GetQueueUrlRequest { + op := &aws.Operation{ + Name: opGetQueueUrl, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetQueueUrlInput{} + } + + output := &GetQueueUrlOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return GetQueueUrlRequest{Request: req, Input: input, Copy: c.GetQueueUrlRequest} +} + +const opListDeadLetterSourceQueues = "ListDeadLetterSourceQueues" + +// ListDeadLetterSourceQueuesRequest is a API request type for the ListDeadLetterSourceQueues API operation. +type ListDeadLetterSourceQueuesRequest struct { + *aws.Request + Input *ListDeadLetterSourceQueuesInput + Copy func(*ListDeadLetterSourceQueuesInput) ListDeadLetterSourceQueuesRequest +} + +// Send marshals and sends the ListDeadLetterSourceQueues API request. +func (r ListDeadLetterSourceQueuesRequest) Send() (*ListDeadLetterSourceQueuesOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*ListDeadLetterSourceQueuesOutput), nil +} + +// ListDeadLetterSourceQueuesRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Returns a list of your queues that have the RedrivePolicy queue attribute +// configured with a dead-letter queue. +// +// For more information about using dead-letter queues, see Using Amazon SQS +// Dead-Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the ListDeadLetterSourceQueuesRequest method. +// req := client.ListDeadLetterSourceQueuesRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueues +func (c *SQS) ListDeadLetterSourceQueuesRequest(input *ListDeadLetterSourceQueuesInput) ListDeadLetterSourceQueuesRequest { + op := &aws.Operation{ + Name: opListDeadLetterSourceQueues, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListDeadLetterSourceQueuesInput{} + } + + output := &ListDeadLetterSourceQueuesOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return ListDeadLetterSourceQueuesRequest{Request: req, Input: input, Copy: c.ListDeadLetterSourceQueuesRequest} +} + +const opListQueueTags = "ListQueueTags" + +// ListQueueTagsRequest is a API request type for the ListQueueTags API operation. +type ListQueueTagsRequest struct { + *aws.Request + Input *ListQueueTagsInput + Copy func(*ListQueueTagsInput) ListQueueTagsRequest +} + +// Send marshals and sends the ListQueueTags API request. +func (r ListQueueTagsRequest) Send() (*ListQueueTagsOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*ListQueueTagsOutput), nil +} + +// ListQueueTagsRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// List all cost allocation tags added to the specified Amazon SQS queue. For +// an overview, see Tagging Your Amazon SQS Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// When you use queue tags, keep the following guidelines in mind: +// +// * Adding more than 50 tags to a queue isn't recommended. +// +// * Tags don't have any semantic meaning. Amazon SQS interprets tags as +// character strings. +// +// * Tags are case-sensitive. +// +// * A new tag with a key identical to that of an existing tag overwrites +// the existing tag. +// +// * Tagging actions are limited to 5 TPS per AWS account. If your application +// requires a higher throughput, file a technical support request (https://console.aws.amazon.com/support/home#/case/create?issueType=technical). +// +// For a full list of tag restrictions, see Limits Related to Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) +// in the Amazon Simple Queue Service Developer Guide. +// +// Cross-account permissions don't apply to this action. For more information, +// see see Grant Cross-Account Permissions to a Role and a User Name (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the ListQueueTagsRequest method. +// req := client.ListQueueTagsRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueueTags +func (c *SQS) ListQueueTagsRequest(input *ListQueueTagsInput) ListQueueTagsRequest { + op := &aws.Operation{ + Name: opListQueueTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListQueueTagsInput{} + } + + output := &ListQueueTagsOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return ListQueueTagsRequest{Request: req, Input: input, Copy: c.ListQueueTagsRequest} +} + +const opListQueues = "ListQueues" + +// ListQueuesRequest is a API request type for the ListQueues API operation. +type ListQueuesRequest struct { + *aws.Request + Input *ListQueuesInput + Copy func(*ListQueuesInput) ListQueuesRequest +} + +// Send marshals and sends the ListQueues API request. +func (r ListQueuesRequest) Send() (*ListQueuesOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*ListQueuesOutput), nil +} + +// ListQueuesRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Returns a list of your queues. The maximum number of queues that can be returned +// is 1,000. If you specify a value for the optional QueueNamePrefix parameter, +// only queues with a name that begins with the specified value are returned. +// +// Cross-account permissions don't apply to this action. For more information, +// see see Grant Cross-Account Permissions to a Role and a User Name (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the ListQueuesRequest method. +// req := client.ListQueuesRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueues +func (c *SQS) ListQueuesRequest(input *ListQueuesInput) ListQueuesRequest { + op := &aws.Operation{ + Name: opListQueues, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListQueuesInput{} + } + + output := &ListQueuesOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return ListQueuesRequest{Request: req, Input: input, Copy: c.ListQueuesRequest} +} + +const opPurgeQueue = "PurgeQueue" + +// PurgeQueueRequest is a API request type for the PurgeQueue API operation. +type PurgeQueueRequest struct { + *aws.Request + Input *PurgeQueueInput + Copy func(*PurgeQueueInput) PurgeQueueRequest +} + +// Send marshals and sends the PurgeQueue API request. +func (r PurgeQueueRequest) Send() (*PurgeQueueOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*PurgeQueueOutput), nil +} + +// PurgeQueueRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Deletes the messages in a queue specified by the QueueURL parameter. +// +// When you use the PurgeQueue action, you can't retrieve any messages deleted +// from a queue. +// +// The message deletion process takes up to 60 seconds. We recommend waiting +// for 60 seconds regardless of your queue's size. +// +// Messages sent to the queue before you call PurgeQueue might be received but +// are deleted within the next minute. +// +// Messages sent to the queue after you call PurgeQueue might be deleted while +// the queue is being purged. +// +// // Example sending a request using the PurgeQueueRequest method. +// req := client.PurgeQueueRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueue +func (c *SQS) PurgeQueueRequest(input *PurgeQueueInput) PurgeQueueRequest { + op := &aws.Operation{ + Name: opPurgeQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PurgeQueueInput{} + } + + output := &PurgeQueueOutput{} + req := c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output.responseMetadata = aws.Response{Request: req} + + return PurgeQueueRequest{Request: req, Input: input, Copy: c.PurgeQueueRequest} +} + +const opReceiveMessage = "ReceiveMessage" + +// ReceiveMessageRequest is a API request type for the ReceiveMessage API operation. +type ReceiveMessageRequest struct { + *aws.Request + Input *ReceiveMessageInput + Copy func(*ReceiveMessageInput) ReceiveMessageRequest +} + +// Send marshals and sends the ReceiveMessage API request. +func (r ReceiveMessageRequest) Send() (*ReceiveMessageOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*ReceiveMessageOutput), nil +} + +// ReceiveMessageRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Retrieves one or more messages (up to 10), from the specified queue. Using +// the WaitTimeSeconds parameter enables long-poll support. For more information, +// see Amazon SQS Long Polling (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// Short poll is the default behavior where a weighted random set of machines +// is sampled on a ReceiveMessage call. Thus, only the messages on the sampled +// machines are returned. If the number of messages in the queue is small (fewer +// than 1,000), you most likely get fewer messages than you requested per ReceiveMessage +// call. If the number of messages in the queue is extremely small, you might +// not receive any messages in a particular ReceiveMessage response. If this +// happens, repeat the request. +// +// For each message returned, the response includes the following: +// +// * The message body. +// +// * An MD5 digest of the message body. For information about MD5, see RFC1321 +// (https://www.ietf.org/rfc/rfc1321.txt). +// +// * The MessageId you received when you sent the message to the queue. +// +// * The receipt handle. +// +// * The message attributes. +// +// * An MD5 digest of the message attributes. +// +// The receipt handle is the identifier you must provide when deleting the message. +// For more information, see Queue and Message Identifiers (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// You can provide the VisibilityTimeout parameter in your request. The parameter +// is applied to the messages that Amazon SQS returns in the response. If you +// don't include the parameter, the overall visibility timeout for the queue +// is used for the returned messages. For more information, see Visibility Timeout +// (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// A message that isn't deleted or a message whose visibility isn't extended +// before the visibility timeout expires counts as a failed receive. Depending +// on the configuration of the queue, the message might be sent to the dead-letter +// queue. +// +// In the future, new attributes might be added. If you write code that calls +// this action, we recommend that you structure your code so that it can handle +// new attributes gracefully. +// +// // Example sending a request using the ReceiveMessageRequest method. +// req := client.ReceiveMessageRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessage +func (c *SQS) ReceiveMessageRequest(input *ReceiveMessageInput) ReceiveMessageRequest { + op := &aws.Operation{ + Name: opReceiveMessage, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ReceiveMessageInput{} + } + + output := &ReceiveMessageOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return ReceiveMessageRequest{Request: req, Input: input, Copy: c.ReceiveMessageRequest} +} + +const opRemovePermission = "RemovePermission" + +// RemovePermissionRequest is a API request type for the RemovePermission API operation. +type RemovePermissionRequest struct { + *aws.Request + Input *RemovePermissionInput + Copy func(*RemovePermissionInput) RemovePermissionRequest +} + +// Send marshals and sends the RemovePermission API request. +func (r RemovePermissionRequest) Send() (*RemovePermissionOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*RemovePermissionOutput), nil +} + +// RemovePermissionRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Revokes any permissions in the queue policy that matches the specified Label +// parameter. +// +// Only the owner of a queue can remove permissions from it. +// +// Cross-account permissions don't apply to this action. For more information, +// see see Grant Cross-Account Permissions to a Role and a User Name (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the RemovePermissionRequest method. +// req := client.RemovePermissionRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermission +func (c *SQS) RemovePermissionRequest(input *RemovePermissionInput) RemovePermissionRequest { + op := &aws.Operation{ + Name: opRemovePermission, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemovePermissionInput{} + } + + output := &RemovePermissionOutput{} + req := c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output.responseMetadata = aws.Response{Request: req} + + return RemovePermissionRequest{Request: req, Input: input, Copy: c.RemovePermissionRequest} +} + +const opSendMessage = "SendMessage" + +// SendMessageRequest is a API request type for the SendMessage API operation. +type SendMessageRequest struct { + *aws.Request + Input *SendMessageInput + Copy func(*SendMessageInput) SendMessageRequest +} + +// Send marshals and sends the SendMessage API request. +func (r SendMessageRequest) Send() (*SendMessageOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*SendMessageOutput), nil +} + +// SendMessageRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Delivers a message to the specified queue. +// +// A message can include only XML, JSON, and unformatted text. The following +// Unicode characters are allowed: +// +// #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF +// +// Any characters not included in this list will be rejected. For more information, +// see the W3C specification for characters (http://www.w3.org/TR/REC-xml/#charsets). +// +// // Example sending a request using the SendMessageRequest method. +// req := client.SendMessageRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessage +func (c *SQS) SendMessageRequest(input *SendMessageInput) SendMessageRequest { + op := &aws.Operation{ + Name: opSendMessage, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SendMessageInput{} + } + + output := &SendMessageOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return SendMessageRequest{Request: req, Input: input, Copy: c.SendMessageRequest} +} + +const opSendMessageBatch = "SendMessageBatch" + +// SendMessageBatchRequest is a API request type for the SendMessageBatch API operation. +type SendMessageBatchRequest struct { + *aws.Request + Input *SendMessageBatchInput + Copy func(*SendMessageBatchInput) SendMessageBatchRequest +} + +// Send marshals and sends the SendMessageBatch API request. +func (r SendMessageBatchRequest) Send() (*SendMessageBatchOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*SendMessageBatchOutput), nil +} + +// SendMessageBatchRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Delivers up to ten messages to the specified queue. This is a batch version +// of SendMessage. For a FIFO queue, multiple messages within a single batch +// are enqueued in the order they are sent. +// +// The result of sending each message is reported individually in the response. +// Because the batch request can result in a combination of successful and unsuccessful +// actions, you should check for batch errors even when the call returns an +// HTTP status code of 200. +// +// The maximum allowed individual message size and the maximum total payload +// size (the sum of the individual lengths of all of the batched messages) are +// both 256 KB (262,144 bytes). +// +// A message can include only XML, JSON, and unformatted text. The following +// Unicode characters are allowed: +// +// #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF +// +// Any characters not included in this list will be rejected. For more information, +// see the W3C specification for characters (http://www.w3.org/TR/REC-xml/#charsets). +// +// If you don't specify the DelaySeconds parameter for an entry, Amazon SQS +// uses the default value for the queue. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &Attribute.1=first +// +// &Attribute.2=second +// +// // Example sending a request using the SendMessageBatchRequest method. +// req := client.SendMessageBatchRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatch +func (c *SQS) SendMessageBatchRequest(input *SendMessageBatchInput) SendMessageBatchRequest { + op := &aws.Operation{ + Name: opSendMessageBatch, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SendMessageBatchInput{} + } + + output := &SendMessageBatchOutput{} + req := c.newRequest(op, input, output) + output.responseMetadata = aws.Response{Request: req} + + return SendMessageBatchRequest{Request: req, Input: input, Copy: c.SendMessageBatchRequest} +} + +const opSetQueueAttributes = "SetQueueAttributes" + +// SetQueueAttributesRequest is a API request type for the SetQueueAttributes API operation. +type SetQueueAttributesRequest struct { + *aws.Request + Input *SetQueueAttributesInput + Copy func(*SetQueueAttributesInput) SetQueueAttributesRequest +} + +// Send marshals and sends the SetQueueAttributes API request. +func (r SetQueueAttributesRequest) Send() (*SetQueueAttributesOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*SetQueueAttributesOutput), nil +} + +// SetQueueAttributesRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Sets the value of one or more queue attributes. When you change a queue's +// attributes, the change can take up to 60 seconds for most of the attributes +// to propagate throughout the Amazon SQS system. Changes made to the MessageRetentionPeriod +// attribute can take up to 15 minutes. +// +// In the future, new attributes might be added. If you write code that calls +// this action, we recommend that you structure your code so that it can handle +// new attributes gracefully. +// +// Cross-account permissions don't apply to this action. For more information, +// see see Grant Cross-Account Permissions to a Role and a User Name (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the SetQueueAttributesRequest method. +// req := client.SetQueueAttributesRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributes +func (c *SQS) SetQueueAttributesRequest(input *SetQueueAttributesInput) SetQueueAttributesRequest { + op := &aws.Operation{ + Name: opSetQueueAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetQueueAttributesInput{} + } + + output := &SetQueueAttributesOutput{} + req := c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output.responseMetadata = aws.Response{Request: req} + + return SetQueueAttributesRequest{Request: req, Input: input, Copy: c.SetQueueAttributesRequest} +} + +const opTagQueue = "TagQueue" + +// TagQueueRequest is a API request type for the TagQueue API operation. +type TagQueueRequest struct { + *aws.Request + Input *TagQueueInput + Copy func(*TagQueueInput) TagQueueRequest +} + +// Send marshals and sends the TagQueue API request. +func (r TagQueueRequest) Send() (*TagQueueOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*TagQueueOutput), nil +} + +// TagQueueRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Add cost allocation tags to the specified Amazon SQS queue. For an overview, +// see Tagging Your Amazon SQS Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// When you use queue tags, keep the following guidelines in mind: +// +// * Adding more than 50 tags to a queue isn't recommended. +// +// * Tags don't have any semantic meaning. Amazon SQS interprets tags as +// character strings. +// +// * Tags are case-sensitive. +// +// * A new tag with a key identical to that of an existing tag overwrites +// the existing tag. +// +// * Tagging actions are limited to 5 TPS per AWS account. If your application +// requires a higher throughput, file a technical support request (https://console.aws.amazon.com/support/home#/case/create?issueType=technical). +// +// For a full list of tag restrictions, see Limits Related to Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) +// in the Amazon Simple Queue Service Developer Guide. +// +// Cross-account permissions don't apply to this action. For more information, +// see see Grant Cross-Account Permissions to a Role and a User Name (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the TagQueueRequest method. +// req := client.TagQueueRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/TagQueue +func (c *SQS) TagQueueRequest(input *TagQueueInput) TagQueueRequest { + op := &aws.Operation{ + Name: opTagQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &TagQueueInput{} + } + + output := &TagQueueOutput{} + req := c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output.responseMetadata = aws.Response{Request: req} + + return TagQueueRequest{Request: req, Input: input, Copy: c.TagQueueRequest} +} + +const opUntagQueue = "UntagQueue" + +// UntagQueueRequest is a API request type for the UntagQueue API operation. +type UntagQueueRequest struct { + *aws.Request + Input *UntagQueueInput + Copy func(*UntagQueueInput) UntagQueueRequest +} + +// Send marshals and sends the UntagQueue API request. +func (r UntagQueueRequest) Send() (*UntagQueueOutput, error) { + err := r.Request.Send() + if err != nil { + return nil, err + } + + return r.Request.Data.(*UntagQueueOutput), nil +} + +// UntagQueueRequest returns a request value for making API operation for +// Amazon Simple Queue Service. +// +// Remove cost allocation tags from the specified Amazon SQS queue. For an overview, +// see Tagging Your Amazon SQS Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// When you use queue tags, keep the following guidelines in mind: +// +// * Adding more than 50 tags to a queue isn't recommended. +// +// * Tags don't have any semantic meaning. Amazon SQS interprets tags as +// character strings. +// +// * Tags are case-sensitive. +// +// * A new tag with a key identical to that of an existing tag overwrites +// the existing tag. +// +// * Tagging actions are limited to 5 TPS per AWS account. If your application +// requires a higher throughput, file a technical support request (https://console.aws.amazon.com/support/home#/case/create?issueType=technical). +// +// For a full list of tag restrictions, see Limits Related to Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) +// in the Amazon Simple Queue Service Developer Guide. +// +// Cross-account permissions don't apply to this action. For more information, +// see see Grant Cross-Account Permissions to a Role and a User Name (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// // Example sending a request using the UntagQueueRequest method. +// req := client.UntagQueueRequest(params) +// resp, err := req.Send() +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/UntagQueue +func (c *SQS) UntagQueueRequest(input *UntagQueueInput) UntagQueueRequest { + op := &aws.Operation{ + Name: opUntagQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UntagQueueInput{} + } + + output := &UntagQueueOutput{} + req := c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output.responseMetadata = aws.Response{Request: req} + + return UntagQueueRequest{Request: req, Input: input, Copy: c.UntagQueueRequest} +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermissionRequest +type AddPermissionInput struct { + _ struct{} `type:"structure"` + + // The AWS account number of the principal (http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P) + // who is given permission. The principal must have an AWS account, but does + // not need to be signed up for Amazon SQS. For information about locating the + // AWS account identification, see Your AWS Identifiers (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication) + // in the Amazon Simple Queue Service Developer Guide. + // + // AWSAccountIds is a required field + AWSAccountIds []string `locationNameList:"AWSAccountId" type:"list" flattened:"true" required:"true"` + + // The action the client wants to allow for the specified principal. Valid values: + // the name of any action or *. + // + // For more information about these actions, see Overview of Managing Access + // Permissions to Your Amazon Simple Queue Service Resource (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for ActionName.n + // also grants permissions for the corresponding batch versions of those actions: + // SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch. + // + // Actions is a required field + Actions []string `locationNameList:"ActionName" type:"list" flattened:"true" required:"true"` + + // The unique identification of the permission you're setting (for example, + // AliceSendMessage). Maximum 80 characters. Allowed characters include alphanumeric + // characters, hyphens (-), and underscores (_). + // + // Label is a required field + Label *string `type:"string" required:"true"` + + // The URL of the Amazon SQS queue to which permissions are added. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AddPermissionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddPermissionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddPermissionInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "AddPermissionInput"} + + if s.AWSAccountIds == nil { + invalidParams.Add(aws.NewErrParamRequired("AWSAccountIds")) + } + + if s.Actions == nil { + invalidParams.Add(aws.NewErrParamRequired("Actions")) + } + + if s.Label == nil { + invalidParams.Add(aws.NewErrParamRequired("Label")) + } + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermissionOutput +type AddPermissionOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response +} + +// String returns the string representation +func (s AddPermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddPermissionOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s AddPermissionOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Gives a detailed description of the result of an action on each entry in +// the request. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/BatchResultErrorEntry +type BatchResultErrorEntry struct { + _ struct{} `type:"structure"` + + // An error code representing why the action failed on this entry. + // + // Code is a required field + Code *string `type:"string" required:"true"` + + // The Id of an entry in a batch request. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // A message explaining why the action failed on this entry. + Message *string `type:"string"` + + // Specifies whether the error happened due to the producer. + // + // SenderFault is a required field + SenderFault *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s BatchResultErrorEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchResultErrorEntry) GoString() string { + return s.String() +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatchRequest +type ChangeMessageVisibilityBatchInput struct { + _ struct{} `type:"structure"` + + // A list of receipt handles of the messages for which the visibility timeout + // must be changed. + // + // Entries is a required field + Entries []ChangeMessageVisibilityBatchRequestEntry `locationNameList:"ChangeMessageVisibilityBatchRequestEntry" type:"list" flattened:"true" required:"true"` + + // The URL of the Amazon SQS queue whose messages' visibility is changed. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityBatchInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityBatchInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangeMessageVisibilityBatchInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchInput"} + + if s.Entries == nil { + invalidParams.Add(aws.NewErrParamRequired("Entries")) + } + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + if s.Entries != nil { + for i, v := range s.Entries { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// For each message in the batch, the response contains a ChangeMessageVisibilityBatchResultEntry +// tag if the message succeeds or a BatchResultErrorEntry tag if the message +// fails. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatchResult +type ChangeMessageVisibilityBatchOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // A list of BatchResultErrorEntry items. + // + // Failed is a required field + Failed []BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"` + + // A list of ChangeMessageVisibilityBatchResultEntry items. + // + // Successful is a required field + Successful []ChangeMessageVisibilityBatchResultEntry `locationNameList:"ChangeMessageVisibilityBatchResultEntry" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityBatchOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityBatchOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s ChangeMessageVisibilityBatchOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Encloses a receipt handle and an entry id for each message in ChangeMessageVisibilityBatch. +// +// All of the following list parameters must be prefixed with ChangeMessageVisibilityBatchRequestEntry.n, +// where n is an integer value starting with 1. For example, a parameter list +// for this action might look like this: +// +// &ChangeMessageVisibilityBatchRequestEntry.1.Id=change_visibility_msg_2 +// +// &ChangeMessageVisibilityBatchRequestEntry.1.ReceiptHandle=your_receipt_handle +// +// &ChangeMessageVisibilityBatchRequestEntry.1.VisibilityTimeout=45 +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatchRequestEntry +type ChangeMessageVisibilityBatchRequestEntry struct { + _ struct{} `type:"structure"` + + // An identifier for this particular receipt handle used to communicate the + // result. + // + // The Ids of a batch request need to be unique within a request + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // A receipt handle. + // + // ReceiptHandle is a required field + ReceiptHandle *string `type:"string" required:"true"` + + // The new value (in seconds) for the message's visibility timeout. + VisibilityTimeout *int64 `type:"integer"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityBatchRequestEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityBatchRequestEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangeMessageVisibilityBatchRequestEntry) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchRequestEntry"} + + if s.Id == nil { + invalidParams.Add(aws.NewErrParamRequired("Id")) + } + + if s.ReceiptHandle == nil { + invalidParams.Add(aws.NewErrParamRequired("ReceiptHandle")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Encloses the Id of an entry in ChangeMessageVisibilityBatch. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatchResultEntry +type ChangeMessageVisibilityBatchResultEntry struct { + _ struct{} `type:"structure"` + + // Represents a message whose visibility timeout has been changed successfully. + // + // Id is a required field + Id *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityBatchResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityBatchResultEntry) GoString() string { + return s.String() +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityRequest +type ChangeMessageVisibilityInput struct { + _ struct{} `type:"structure"` + + // The URL of the Amazon SQS queue whose message's visibility is changed. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // The receipt handle associated with the message whose visibility timeout is + // changed. This parameter is returned by the ReceiveMessage action. + // + // ReceiptHandle is a required field + ReceiptHandle *string `type:"string" required:"true"` + + // The new value for the message's visibility timeout (in seconds). Values values: + // 0 to 43200. Maximum: 12 hours. + // + // VisibilityTimeout is a required field + VisibilityTimeout *int64 `type:"integer" required:"true"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangeMessageVisibilityInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ChangeMessageVisibilityInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if s.ReceiptHandle == nil { + invalidParams.Add(aws.NewErrParamRequired("ReceiptHandle")) + } + + if s.VisibilityTimeout == nil { + invalidParams.Add(aws.NewErrParamRequired("VisibilityTimeout")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityOutput +type ChangeMessageVisibilityOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response +} + +// String returns the string representation +func (s ChangeMessageVisibilityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s ChangeMessageVisibilityOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueueRequest +type CreateQueueInput struct { + _ struct{} `type:"structure"` + + // A map of attributes with their corresponding values. + // + // The following lists the names, descriptions, and values of the special request + // parameters that the CreateQueue action uses: + // + // * DelaySeconds - The length of time, in seconds, for which the delivery + // of all messages in the queue is delayed. Valid values: An integer from + // 0 to 900 seconds (15 minutes). Default: 0. + // + // * MaximumMessageSize - The limit of how many bytes a message can contain + // before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes + // (1 KiB) to 262,144 bytes (256 KiB). Default: 262,144 (256 KiB). + // + // * MessageRetentionPeriod - The length of time, in seconds, for which Amazon + // SQS retains a message. Valid values: An integer from 60 seconds (1 minute) + // to 1,209,600 seconds (14 days). Default: 345,600 (4 days). + // + // * Policy - The queue's policy. A valid AWS policy. For more information + // about policy structure, see Overview of AWS IAM Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) + // in the Amazon IAM User Guide. + // + // * ReceiveMessageWaitTimeSeconds - The length of time, in seconds, for + // which a ReceiveMessage action waits for a message to arrive. Valid values: + // An integer from 0 to 20 (seconds). Default: 0. + // + // * RedrivePolicy - The string that includes the parameters for the dead-letter + // queue functionality of the source queue. For more information about the + // redrive policy and dead-letter queues, see Using Amazon SQS Dead-Letter + // Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // deadLetterTargetArn - The Amazon Resource Name (ARN) of the dead-letter queue + // to which Amazon SQS moves messages after the value of maxReceiveCount + // is exceeded. + // + // maxReceiveCount - The number of times a message is delivered to the source + // queue before being moved to the dead-letter queue. When the ReceiveCount + // for a message exceeds the maxReceiveCount for a queue, Amazon SQS moves + // the message to the dead-letter-queue. + // + // The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, + // the dead-letter queue of a standard queue must also be a standard queue. + // + // * VisibilityTimeout - The visibility timeout for the queue, in seconds. + // Valid values: An integer from 0 to 43,200 (12 hours). Default: 30. For + // more information about the visibility timeout, see Visibility Timeout + // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // The following attributes apply only to server-side-encryption (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): + // + // * KmsMasterKeyId - The ID of an AWS-managed customer master key (CMK) + // for Amazon SQS or a custom CMK. For more information, see Key Terms (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). + // While the alias of the AWS-managed CMK for Amazon SQS is always alias/aws/sqs, + // the alias of a custom CMK can, for example, be alias/MyAlias. For more + // examples, see KeyId (http://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + // in the AWS Key Management Service API Reference. + // + // * KmsDataKeyReusePeriodSeconds - The length of time, in seconds, for which + // Amazon SQS can reuse a data key (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) + // to encrypt or decrypt messages before calling AWS KMS again. An integer + // representing seconds, between 60 seconds (1 minute) and 86,400 seconds + // (24 hours). Default: 300 (5 minutes). A shorter time period provides better + // security but results in more calls to KMS which might incur charges after + // Free Tier. For more information, see How Does the Data Key Reuse Period + // Work? (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). + // + // + // The following attributes apply only to FIFO (first-in-first-out) queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): + // + // * FifoQueue - Designates a queue as FIFO. Valid values: true, false. You + // can provide this attribute only during queue creation. You can't change + // it for an existing queue. When you set this attribute, you must also provide + // the MessageGroupId for your messages explicitly. + // + // For more information, see FIFO Queue Logic (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic) + // in the Amazon Simple Queue Service Developer Guide. + // + // * ContentBasedDeduplication - Enables content-based deduplication. Valid + // values: true, false. For more information, see Exactly-Once Processing + // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. + // + // Every message must have a unique MessageDeduplicationId, + // + // You may provide a MessageDeduplicationId explicitly. + // + // If you aren't able to provide a MessageDeduplicationId and you enable ContentBasedDeduplication + // for your queue, Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId + // using the body of the message (but not the attributes of the message). + // + // + // If you don't provide a MessageDeduplicationId and the queue doesn't have + // ContentBasedDeduplication set, the action fails with an error. + // + // If the queue has ContentBasedDeduplication set, your MessageDeduplicationId + // overrides the generated one. + // + // When ContentBasedDeduplication is in effect, messages with identical content + // sent within the deduplication interval are treated as duplicates and only + // one copy of the message is delivered. + // + // If you send one message with ContentBasedDeduplication enabled and then another + // message with a MessageDeduplicationId that is the same as the one generated + // for the first MessageDeduplicationId, the two messages are treated as + // duplicates and only one copy of the message is delivered. + Attributes map[string]string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // The name of the new queue. The following limits apply to this name: + // + // * A queue name can have up to 80 characters. + // + // * Valid values: alphanumeric characters, hyphens (-), and underscores + // (_). + // + // * A FIFO queue name must end with the .fifo suffix. + // + // Queue URLs and names are case-sensitive. + // + // QueueName is a required field + QueueName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateQueueInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "CreateQueueInput"} + + if s.QueueName == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Returns the QueueUrl attribute of the created queue. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueueResult +type CreateQueueOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // The URL of the created Amazon SQS queue. + QueueUrl *string `type:"string"` +} + +// String returns the string representation +func (s CreateQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateQueueOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s CreateQueueOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatchRequest +type DeleteMessageBatchInput struct { + _ struct{} `type:"structure"` + + // A list of receipt handles for the messages to be deleted. + // + // Entries is a required field + Entries []DeleteMessageBatchRequestEntry `locationNameList:"DeleteMessageBatchRequestEntry" type:"list" flattened:"true" required:"true"` + + // The URL of the Amazon SQS queue from which messages are deleted. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageBatchInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageBatchInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteMessageBatchInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DeleteMessageBatchInput"} + + if s.Entries == nil { + invalidParams.Add(aws.NewErrParamRequired("Entries")) + } + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + if s.Entries != nil { + for i, v := range s.Entries { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// For each message in the batch, the response contains a DeleteMessageBatchResultEntry +// tag if the message is deleted or a BatchResultErrorEntry tag if the message +// can't be deleted. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatchResult +type DeleteMessageBatchOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // A list of BatchResultErrorEntry items. + // + // Failed is a required field + Failed []BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"` + + // A list of DeleteMessageBatchResultEntry items. + // + // Successful is a required field + Successful []DeleteMessageBatchResultEntry `locationNameList:"DeleteMessageBatchResultEntry" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageBatchOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageBatchOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s DeleteMessageBatchOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Encloses a receipt handle and an identifier for it. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatchRequestEntry +type DeleteMessageBatchRequestEntry struct { + _ struct{} `type:"structure"` + + // An identifier for this particular receipt handle. This is used to communicate + // the result. + // + // The Ids of a batch request need to be unique within a request + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // A receipt handle. + // + // ReceiptHandle is a required field + ReceiptHandle *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageBatchRequestEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageBatchRequestEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteMessageBatchRequestEntry) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DeleteMessageBatchRequestEntry"} + + if s.Id == nil { + invalidParams.Add(aws.NewErrParamRequired("Id")) + } + + if s.ReceiptHandle == nil { + invalidParams.Add(aws.NewErrParamRequired("ReceiptHandle")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Encloses the Id of an entry in DeleteMessageBatch. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatchResultEntry +type DeleteMessageBatchResultEntry struct { + _ struct{} `type:"structure"` + + // Represents a successfully deleted message. + // + // Id is a required field + Id *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageBatchResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageBatchResultEntry) GoString() string { + return s.String() +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageRequest +type DeleteMessageInput struct { + _ struct{} `type:"structure"` + + // The URL of the Amazon SQS queue from which messages are deleted. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // The receipt handle associated with the message to delete. + // + // ReceiptHandle is a required field + ReceiptHandle *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteMessageInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DeleteMessageInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if s.ReceiptHandle == nil { + invalidParams.Add(aws.NewErrParamRequired("ReceiptHandle")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageOutput +type DeleteMessageOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response +} + +// String returns the string representation +func (s DeleteMessageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s DeleteMessageOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueueRequest +type DeleteQueueInput struct { + _ struct{} `type:"structure"` + + // The URL of the Amazon SQS queue to delete. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteQueueInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DeleteQueueInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueueOutput +type DeleteQueueOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response +} + +// String returns the string representation +func (s DeleteQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteQueueOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s DeleteQueueOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributesRequest +type GetQueueAttributesInput struct { + _ struct{} `type:"structure"` + + // A list of attributes for which to retrieve information. + // + // In the future, new attributes might be added. If you write code that calls + // this action, we recommend that you structure your code so that it can handle + // new attributes gracefully. + // + // The following attributes are supported: + // + // * All - Returns all values. + // + // * ApproximateNumberOfMessages - Returns the approximate number of messages + // available for retrieval from the queue. + // + // * ApproximateNumberOfMessagesDelayed - Returns the approximate number + // of messages in the queue that are delayed and not available for reading + // immediately. This can happen when the queue is configured as a delay queue + // or when a message has been sent with a delay parameter. + // + // * ApproximateNumberOfMessagesNotVisible - Returns the approximate number + // of messages that are in flight. Messages are considered to be in flight + // if they have been sent to a client but have not yet been deleted or have + // not yet reached the end of their visibility window. + // + // * CreatedTimestamp - Returns the time when the queue was created in seconds + // (epoch time (http://en.wikipedia.org/wiki/Unix_time)). + // + // * DelaySeconds - Returns the default delay on the queue in seconds. + // + // * LastModifiedTimestamp - Returns the time when the queue was last changed + // in seconds (epoch time (http://en.wikipedia.org/wiki/Unix_time)). + // + // * MaximumMessageSize - Returns the limit of how many bytes a message can + // contain before Amazon SQS rejects it. + // + // * MessageRetentionPeriod - Returns the length of time, in seconds, for + // which Amazon SQS retains a message. + // + // * Policy - Returns the policy of the queue. + // + // * QueueArn - Returns the Amazon resource name (ARN) of the queue. + // + // * ReceiveMessageWaitTimeSeconds - Returns the length of time, in seconds, + // for which the ReceiveMessage action waits for a message to arrive. + // + // * RedrivePolicy - Returns the string that includes the parameters for + // dead-letter queue functionality of the source queue. For more information + // about the redrive policy and dead-letter queues, see Using Amazon SQS + // Dead-Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // deadLetterTargetArn - The Amazon Resource Name (ARN) of the dead-letter queue + // to which Amazon SQS moves messages after the value of maxReceiveCount + // is exceeded. + // + // maxReceiveCount - The number of times a message is delivered to the source + // queue before being moved to the dead-letter queue. When the ReceiveCount + // for a message exceeds the maxReceiveCount for a queue, Amazon SQS moves + // the message to the dead-letter-queue. + // + // * VisibilityTimeout - Returns the visibility timeout for the queue. For + // more information about the visibility timeout, see Visibility Timeout + // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // The following attributes apply only to server-side-encryption (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): + // + // * KmsMasterKeyId - Returns the ID of an AWS-managed customer master key + // (CMK) for Amazon SQS or a custom CMK. For more information, see Key Terms + // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). + // + // + // * KmsDataKeyReusePeriodSeconds - Returns the length of time, in seconds, + // for which Amazon SQS can reuse a data key to encrypt or decrypt messages + // before calling AWS KMS again. For more information, see How Does the Data + // Key Reuse Period Work? (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). + // + // + // The following attributes apply only to FIFO (first-in-first-out) queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): + // + // * FifoQueue - Returns whether the queue is FIFO. For more information, + // see FIFO Queue Logic (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic) + // in the Amazon Simple Queue Service Developer Guide. + // + // To determine whether a queue is FIFO (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html), + // you can check whether QueueName ends with the .fifo suffix. + // + // * ContentBasedDeduplication - Returns whether content-based deduplication + // is enabled for the queue. For more information, see Exactly-Once Processing + // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. + AttributeNames []QueueAttributeName `locationNameList:"AttributeName" type:"list" flattened:"true"` + + // The URL of the Amazon SQS queue whose attribute information is retrieved. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetQueueAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueueAttributesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetQueueAttributesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "GetQueueAttributesInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// A list of returned queue attributes. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributesResult +type GetQueueAttributesOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // A map of attributes to their respective values. + Attributes map[string]string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` +} + +// String returns the string representation +func (s GetQueueAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueueAttributesOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s GetQueueAttributesOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrlRequest +type GetQueueUrlInput struct { + _ struct{} `type:"structure"` + + // The name of the queue whose URL must be fetched. Maximum 80 characters. Valid + // values: alphanumeric characters, hyphens (-), and underscores (_). + // + // Queue URLs and names are case-sensitive. + // + // QueueName is a required field + QueueName *string `type:"string" required:"true"` + + // The AWS account ID of the account that created the queue. + QueueOwnerAWSAccountId *string `type:"string"` +} + +// String returns the string representation +func (s GetQueueUrlInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueueUrlInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetQueueUrlInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "GetQueueUrlInput"} + + if s.QueueName == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// For more information, see Interpreting Responses (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-api-responses.html) +// in the Amazon Simple Queue Service Developer Guide. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrlResult +type GetQueueUrlOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // The URL of the queue. + QueueUrl *string `type:"string"` +} + +// String returns the string representation +func (s GetQueueUrlOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueueUrlOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s GetQueueUrlOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueuesRequest +type ListDeadLetterSourceQueuesInput struct { + _ struct{} `type:"structure"` + + // The URL of a dead-letter queue. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListDeadLetterSourceQueuesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDeadLetterSourceQueuesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDeadLetterSourceQueuesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ListDeadLetterSourceQueuesInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// A list of your dead letter source queues. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueuesResult +type ListDeadLetterSourceQueuesOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // A list of source queue URLs that have the RedrivePolicy queue attribute configured + // with a dead-letter queue. + // + // QueueUrls is a required field + QueueUrls []string `locationName:"queueUrls" locationNameList:"QueueUrl" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s ListDeadLetterSourceQueuesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDeadLetterSourceQueuesOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s ListDeadLetterSourceQueuesOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueueTagsRequest +type ListQueueTagsInput struct { + _ struct{} `type:"structure"` + + // The URL of the queue. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListQueueTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueueTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListQueueTagsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ListQueueTagsInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueueTagsResult +type ListQueueTagsOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // The list of all tags added to the specified queue. + Tags map[string]string `locationName:"Tag" locationNameKey:"Key" locationNameValue:"Value" type:"map" flattened:"true"` +} + +// String returns the string representation +func (s ListQueueTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueueTagsOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s ListQueueTagsOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueuesRequest +type ListQueuesInput struct { + _ struct{} `type:"structure"` + + // A string to use for filtering the list results. Only those queues whose name + // begins with the specified string are returned. + // + // Queue URLs and names are case-sensitive. + QueueNamePrefix *string `type:"string"` +} + +// String returns the string representation +func (s ListQueuesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueuesInput) GoString() string { + return s.String() +} + +// A list of your queues. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueuesResult +type ListQueuesOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // A list of queue URLs, up to 1,000 entries. + QueueUrls []string `locationNameList:"QueueUrl" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s ListQueuesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueuesOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s ListQueuesOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// An Amazon SQS message. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/Message +type Message struct { + _ struct{} `type:"structure"` + + // A map of the attributes requested in ReceiveMessage to their respective values. + // Supported attributes: + // + // * ApproximateReceiveCount + // + // * ApproximateFirstReceiveTimestamp + // + // * MessageDeduplicationId + // + // * MessageGroupId + // + // * SenderId + // + // * SentTimestamp + // + // * SequenceNumber + // + // ApproximateFirstReceiveTimestamp and SentTimestamp are each returned as an + // integer representing the epoch time (http://en.wikipedia.org/wiki/Unix_time) + // in milliseconds. + Attributes map[string]string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // The message's contents (not URL-encoded). + Body *string `type:"string"` + + // An MD5 digest of the non-URL-encoded message body string. + MD5OfBody *string `type:"string"` + + // An MD5 digest of the non-URL-encoded message attribute string. You can use + // this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + MD5OfMessageAttributes *string `type:"string"` + + // Each message attribute consists of a Name, Type, and Value. For more information, + // see Amazon SQS Message Attributes (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html) + // in the Amazon Simple Queue Service Developer Guide. + MessageAttributes map[string]MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // A unique identifier for the message. A MessageIdis considered unique across + // all AWS accounts for an extended period of time. + MessageId *string `type:"string"` + + // An identifier associated with the act of receiving the message. A new receipt + // handle is returned every time you receive a message. When deleting a message, + // you provide the last received receipt handle to delete the message. + ReceiptHandle *string `type:"string"` +} + +// String returns the string representation +func (s Message) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Message) GoString() string { + return s.String() +} + +// The user-specified message attribute value. For string data types, the Value +// attribute has the same restrictions on the content as the message body. For +// more information, see SendMessage. +// +// Name, type, value and the message body must not be empty or null. All parts +// of the message attribute, including Name, Type, and Value, are part of the +// message size restriction (256 KB or 262,144 bytes). +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/MessageAttributeValue +type MessageAttributeValue struct { + _ struct{} `type:"structure"` + + // Not implemented. Reserved for future use. + BinaryListValues [][]byte `locationName:"BinaryListValue" locationNameList:"BinaryListValue" type:"list" flattened:"true"` + + // Binary type attributes can store any binary data, such as compressed data, + // encrypted data, or images. + // + // BinaryValue is automatically base64 encoded/decoded by the SDK. + BinaryValue []byte `type:"blob"` + + // Amazon SQS supports the following logical data types: String, Number, and + // Binary. For the Number data type, you must use StringValue. + // + // You can also append custom labels. For more information, see Amazon SQS Message + // Attributes (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // DataType is a required field + DataType *string `type:"string" required:"true"` + + // Not implemented. Reserved for future use. + StringListValues []string `locationName:"StringListValue" locationNameList:"StringListValue" type:"list" flattened:"true"` + + // Strings are Unicode with UTF-8 binary encoding. For a list of code values, + // see ASCII Printable Characters (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). + StringValue *string `type:"string"` +} + +// String returns the string representation +func (s MessageAttributeValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MessageAttributeValue) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MessageAttributeValue) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "MessageAttributeValue"} + + if s.DataType == nil { + invalidParams.Add(aws.NewErrParamRequired("DataType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueueRequest +type PurgeQueueInput struct { + _ struct{} `type:"structure"` + + // The URL of the queue from which the PurgeQueue action deletes messages. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s PurgeQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PurgeQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PurgeQueueInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "PurgeQueueInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueueOutput +type PurgeQueueOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response +} + +// String returns the string representation +func (s PurgeQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PurgeQueueOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s PurgeQueueOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessageRequest +type ReceiveMessageInput struct { + _ struct{} `type:"structure"` + + // A list of s that need to be returned along with each message. These attributes + // include: + // + // * All - Returns all values. + // + // * ApproximateFirstReceiveTimestamp - Returns the time the message was + // first received from the queue (epoch time (http://en.wikipedia.org/wiki/Unix_time) + // in milliseconds). + // + // * ApproximateReceiveCount - Returns the number of times a message has + // been received from the queue but not deleted. + // + // * SenderId + // + // For an IAM user, returns the IAM user ID, for example ABCDEFGHI1JKLMNOPQ23R. + // + // For an IAM role, returns the IAM role ID, for example ABCDE1F2GH3I4JK5LMNOP:i-a123b456. + // + // * SentTimestamp - Returns the time the message was sent to the queue (epoch + // time (http://en.wikipedia.org/wiki/Unix_time) in milliseconds). + // + // * MessageDeduplicationId - Returns the value provided by the producer + // that calls the SendMessage action. + // + // * MessageGroupId - Returns the value provided by the producer that calls + // the SendMessage action. Messages with the same MessageGroupId are returned + // in sequence. + // + // * SequenceNumber - Returns the value provided by Amazon SQS. + AttributeNames []QueueAttributeName `locationNameList:"AttributeName" type:"list" flattened:"true"` + + // The maximum number of messages to return. Amazon SQS never returns more messages + // than this value (however, fewer messages might be returned). Valid values: + // 1 to 10. Default: 1. + MaxNumberOfMessages *int64 `type:"integer"` + + // The name of the message attribute, where N is the index. + // + // * The name can contain alphanumeric characters and the underscore (_), + // hyphen (-), and period (.). + // + // * The name is case-sensitive and must be unique among all attribute names + // for the message. + // + // * The name must not start with AWS-reserved prefixes such as AWS. or Amazon. + // (or any casing variants). + // + // * The name must not start or end with a period (.), and it should not + // have periods in succession (..). + // + // * The name can be up to 256 characters long. + // + // When using ReceiveMessage, you can send a list of attribute names to receive, + // or you can return all of the attributes by specifying All or .* in your request. + // You can also use all message attributes starting with a prefix, for example + // bar.*. + MessageAttributeNames []string `locationNameList:"MessageAttributeName" type:"list" flattened:"true"` + + // The URL of the Amazon SQS queue from which messages are received. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The token used for deduplication of ReceiveMessage calls. If a networking + // issue occurs after a ReceiveMessage action, and instead of a response you + // receive a generic error, you can retry the same action with an identical + // ReceiveRequestAttemptId to retrieve the same set of messages, even if their + // visibility timeout has not yet expired. + // + // * You can use ReceiveRequestAttemptId only for 5 minutes after a ReceiveMessage + // action. + // + // * When you set FifoQueue, a caller of the ReceiveMessage action can provide + // a ReceiveRequestAttemptId explicitly. + // + // * If a caller of the ReceiveMessage action doesn't provide a ReceiveRequestAttemptId, + // Amazon SQS generates a ReceiveRequestAttemptId. + // + // * You can retry the ReceiveMessage action with the same ReceiveRequestAttemptId + // if none of the messages have been modified (deleted or had their visibility + // changes). + // + // * During a visibility timeout, subsequent calls with the same ReceiveRequestAttemptId + // return the same messages and receipt handles. If a retry occurs within + // the deduplication interval, it resets the visibility timeout. For more + // information, see Visibility Timeout (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // If a caller of the ReceiveMessage action still processes messages when the + // visibility timeout expires and messages become visible, another worker + // consuming from the same queue can receive the same messages and therefore + // process duplicates. Also, if a consumer whose message processing time + // is longer than the visibility timeout tries to delete the processed messages, + // the action fails with an error. + // + // To mitigate this effect, ensure that your application observes a safe threshold + // before the visibility timeout expires and extend the visibility timeout + // as necessary. + // + // * While messages with a particular MessageGroupId are invisible, no more + // messages belonging to the same MessageGroupId are returned until the visibility + // timeout expires. You can still receive messages with another MessageGroupId + // as long as it is also visible. + // + // * If a caller of ReceiveMessage can't track the ReceiveRequestAttemptId, + // no retries work until the original visibility timeout expires. As a result, + // delays might occur but the messages in the queue remain in a strict order. + // + // The length of ReceiveRequestAttemptId is 128 characters. ReceiveRequestAttemptId + // can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using ReceiveRequestAttemptId, see Using the ReceiveRequestAttemptId + // Request Parameter (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html) + // in the Amazon Simple Queue Service Developer Guide. + ReceiveRequestAttemptId *string `type:"string"` + + // The duration (in seconds) that the received messages are hidden from subsequent + // retrieve requests after being retrieved by a ReceiveMessage request. + VisibilityTimeout *int64 `type:"integer"` + + // The duration (in seconds) for which the call waits for a message to arrive + // in the queue before returning. If a message is available, the call returns + // sooner than WaitTimeSeconds. If no messages are available and the wait time + // expires, the call returns successfully with an empty list of messages. + WaitTimeSeconds *int64 `type:"integer"` +} + +// String returns the string representation +func (s ReceiveMessageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReceiveMessageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReceiveMessageInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ReceiveMessageInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// A list of received messages. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessageResult +type ReceiveMessageOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // A list of messages. + Messages []Message `locationNameList:"Message" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s ReceiveMessageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReceiveMessageOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s ReceiveMessageOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermissionRequest +type RemovePermissionInput struct { + _ struct{} `type:"structure"` + + // The identification of the permission to remove. This is the label added using + // the AddPermission action. + // + // Label is a required field + Label *string `type:"string" required:"true"` + + // The URL of the Amazon SQS queue from which permissions are removed. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s RemovePermissionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemovePermissionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemovePermissionInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "RemovePermissionInput"} + + if s.Label == nil { + invalidParams.Add(aws.NewErrParamRequired("Label")) + } + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermissionOutput +type RemovePermissionOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response +} + +// String returns the string representation +func (s RemovePermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemovePermissionOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s RemovePermissionOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatchRequest +type SendMessageBatchInput struct { + _ struct{} `type:"structure"` + + // A list of SendMessageBatchRequestEntry items. + // + // Entries is a required field + Entries []SendMessageBatchRequestEntry `locationNameList:"SendMessageBatchRequestEntry" type:"list" flattened:"true" required:"true"` + + // The URL of the Amazon SQS queue to which batched messages are sent. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SendMessageBatchInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageBatchInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SendMessageBatchInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "SendMessageBatchInput"} + + if s.Entries == nil { + invalidParams.Add(aws.NewErrParamRequired("Entries")) + } + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + if s.Entries != nil { + for i, v := range s.Entries { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// For each message in the batch, the response contains a SendMessageBatchResultEntry +// tag if the message succeeds or a BatchResultErrorEntry tag if the message +// fails. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatchResult +type SendMessageBatchOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // A list of BatchResultErrorEntry items with error details about each message + // that can't be enqueued. + // + // Failed is a required field + Failed []BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"` + + // A list of SendMessageBatchResultEntry items. + // + // Successful is a required field + Successful []SendMessageBatchResultEntry `locationNameList:"SendMessageBatchResultEntry" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s SendMessageBatchOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageBatchOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s SendMessageBatchOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Contains the details of a single Amazon SQS message along with an Id. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatchRequestEntry +type SendMessageBatchRequestEntry struct { + _ struct{} `type:"structure"` + + // The length of time, in seconds, for which a specific message is delayed. + // Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds + // value become available for processing after the delay period is finished. + // If you don't specify a value, the default value for the queue is applied. + // + // When you set FifoQueue, you can't set DelaySeconds per message. You can set + // this parameter only on a queue level. + DelaySeconds *int64 `type:"integer"` + + // An identifier for a message in this batch used to communicate the result. + // + // The Ids of a batch request need to be unique within a request + // + // This identifier can have up to 80 characters. The following characters are + // accepted: alphanumeric characters, hyphens(-), and underscores (_). + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // Each message attribute consists of a Name, Type, and Value. For more information, + // see Amazon SQS Message Attributes (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html) + // in the Amazon Simple Queue Service Developer Guide. + MessageAttributes map[string]MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // The body of the message. + // + // MessageBody is a required field + MessageBody *string `type:"string" required:"true"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The token used for deduplication of messages within a 5-minute minimum deduplication + // interval. If a message with a particular MessageDeduplicationId is sent successfully, + // subsequent messages with the same MessageDeduplicationId are accepted successfully + // but aren't delivered. For more information, see Exactly-Once Processing + // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. + // + // * Every message must have a unique MessageDeduplicationId, + // + // You may provide a MessageDeduplicationId explicitly. + // + // If you aren't able to provide a MessageDeduplicationId and you enable ContentBasedDeduplication + // for your queue, Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId + // using the body of the message (but not the attributes of the message). + // + // + // If you don't provide a MessageDeduplicationId and the queue doesn't have + // ContentBasedDeduplication set, the action fails with an error. + // + // If the queue has ContentBasedDeduplication set, your MessageDeduplicationId + // overrides the generated one. + // + // * When ContentBasedDeduplication is in effect, messages with identical + // content sent within the deduplication interval are treated as duplicates + // and only one copy of the message is delivered. + // + // * If you send one message with ContentBasedDeduplication enabled and then + // another message with a MessageDeduplicationId that is the same as the + // one generated for the first MessageDeduplicationId, the two messages are + // treated as duplicates and only one copy of the message is delivered. + // + // The MessageDeduplicationId is available to the consumer of the message (this + // can be useful for troubleshooting delivery issues). + // + // If a message is sent successfully but the acknowledgement is lost and the + // message is resent with the same MessageDeduplicationId after the deduplication + // interval, Amazon SQS can't detect duplicate messages. + // + // Amazon SQS continues to keep track of the message deduplication ID even after + // the message is received and deleted. + // + // The length of MessageDeduplicationId is 128 characters. MessageDeduplicationId + // can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId + // Property (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) + // in the Amazon Simple Queue Service Developer Guide. + MessageDeduplicationId *string `type:"string"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The tag that specifies that a message belongs to a specific message group. + // Messages that belong to the same message group are processed in a FIFO manner + // (however, messages in different message groups might be processed out of + // order). To interleave multiple ordered streams within a single queue, use + // MessageGroupId values (for example, session data for multiple users). In + // this scenario, multiple consumers can process the queue, but the session + // data of each user is processed in a FIFO fashion. + // + // * You must associate a non-empty MessageGroupId with a message. If you + // don't provide a MessageGroupId, the action fails. + // + // * ReceiveMessage might return messages with multiple MessageGroupId values. + // For each MessageGroupId, the messages are sorted by time sent. The caller + // can't specify a MessageGroupId. + // + // The length of MessageGroupId is 128 characters. Valid values: alphanumeric + // characters and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using MessageGroupId, see Using the MessageGroupId + // Property (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // MessageGroupId is required for FIFO queues. You can't use it for Standard + // queues. + MessageGroupId *string `type:"string"` +} + +// String returns the string representation +func (s SendMessageBatchRequestEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageBatchRequestEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SendMessageBatchRequestEntry) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "SendMessageBatchRequestEntry"} + + if s.Id == nil { + invalidParams.Add(aws.NewErrParamRequired("Id")) + } + + if s.MessageBody == nil { + invalidParams.Add(aws.NewErrParamRequired("MessageBody")) + } + if s.MessageAttributes != nil { + for i, v := range s.MessageAttributes { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Encloses a MessageId for a successfully-enqueued message in a SendMessageBatch. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatchResultEntry +type SendMessageBatchResultEntry struct { + _ struct{} `type:"structure"` + + // An identifier for the message in this batch. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // An MD5 digest of the non-URL-encoded message attribute string. You can use + // this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + MD5OfMessageAttributes *string `type:"string"` + + // An MD5 digest of the non-URL-encoded message attribute string. You can use + // this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + // + // MD5OfMessageBody is a required field + MD5OfMessageBody *string `type:"string" required:"true"` + + // An identifier for the message. + // + // MessageId is a required field + MessageId *string `type:"string" required:"true"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The large, non-consecutive number that Amazon SQS assigns to each message. + // + // The length of SequenceNumber is 128 bits. As SequenceNumber continues to + // increase for a particular MessageGroupId. + SequenceNumber *string `type:"string"` +} + +// String returns the string representation +func (s SendMessageBatchResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageBatchResultEntry) GoString() string { + return s.String() +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageRequest +type SendMessageInput struct { + _ struct{} `type:"structure"` + + // The length of time, in seconds, for which to delay a specific message. Valid + // values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds + // value become available for processing after the delay period is finished. + // If you don't specify a value, the default value for the queue applies. + // + // When you set FifoQueue, you can't set DelaySeconds per message. You can set + // this parameter only on a queue level. + DelaySeconds *int64 `type:"integer"` + + // Each message attribute consists of a Name, Type, and Value. For more information, + // see Amazon SQS Message Attributes (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html) + // in the Amazon Simple Queue Service Developer Guide. + MessageAttributes map[string]MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // The message to send. The maximum string size is 256 KB. + // + // A message can include only XML, JSON, and unformatted text. The following + // Unicode characters are allowed: + // + // #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF + // + // Any characters not included in this list will be rejected. For more information, + // see the W3C specification for characters (http://www.w3.org/TR/REC-xml/#charsets). + // + // MessageBody is a required field + MessageBody *string `type:"string" required:"true"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The token used for deduplication of sent messages. If a message with a particular + // MessageDeduplicationId is sent successfully, any messages sent with the same + // MessageDeduplicationId are accepted successfully but aren't delivered during + // the 5-minute deduplication interval. For more information, see Exactly-Once + // Processing (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. + // + // * Every message must have a unique MessageDeduplicationId, + // + // You may provide a MessageDeduplicationId explicitly. + // + // If you aren't able to provide a MessageDeduplicationId and you enable ContentBasedDeduplication + // for your queue, Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId + // using the body of the message (but not the attributes of the message). + // + // + // If you don't provide a MessageDeduplicationId and the queue doesn't have + // ContentBasedDeduplication set, the action fails with an error. + // + // If the queue has ContentBasedDeduplication set, your MessageDeduplicationId + // overrides the generated one. + // + // * When ContentBasedDeduplication is in effect, messages with identical + // content sent within the deduplication interval are treated as duplicates + // and only one copy of the message is delivered. + // + // * If you send one message with ContentBasedDeduplication enabled and then + // another message with a MessageDeduplicationId that is the same as the + // one generated for the first MessageDeduplicationId, the two messages are + // treated as duplicates and only one copy of the message is delivered. + // + // The MessageDeduplicationId is available to the consumer of the message (this + // can be useful for troubleshooting delivery issues). + // + // If a message is sent successfully but the acknowledgement is lost and the + // message is resent with the same MessageDeduplicationId after the deduplication + // interval, Amazon SQS can't detect duplicate messages. + // + // Amazon SQS continues to keep track of the message deduplication ID even after + // the message is received and deleted. + // + // The length of MessageDeduplicationId is 128 characters. MessageDeduplicationId + // can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId + // Property (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) + // in the Amazon Simple Queue Service Developer Guide. + MessageDeduplicationId *string `type:"string"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The tag that specifies that a message belongs to a specific message group. + // Messages that belong to the same message group are processed in a FIFO manner + // (however, messages in different message groups might be processed out of + // order). To interleave multiple ordered streams within a single queue, use + // MessageGroupId values (for example, session data for multiple users). In + // this scenario, multiple consumers can process the queue, but the session + // data of each user is processed in a FIFO fashion. + // + // * You must associate a non-empty MessageGroupId with a message. If you + // don't provide a MessageGroupId, the action fails. + // + // * ReceiveMessage might return messages with multiple MessageGroupId values. + // For each MessageGroupId, the messages are sorted by time sent. The caller + // can't specify a MessageGroupId. + // + // The length of MessageGroupId is 128 characters. Valid values: alphanumeric + // characters and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using MessageGroupId, see Using the MessageGroupId + // Property (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // MessageGroupId is required for FIFO queues. You can't use it for Standard + // queues. + MessageGroupId *string `type:"string"` + + // The URL of the Amazon SQS queue to which a message is sent. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SendMessageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SendMessageInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "SendMessageInput"} + + if s.MessageBody == nil { + invalidParams.Add(aws.NewErrParamRequired("MessageBody")) + } + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + if s.MessageAttributes != nil { + for i, v := range s.MessageAttributes { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The MD5OfMessageBody and MessageId elements. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageResult +type SendMessageOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response + + // An MD5 digest of the non-URL-encoded message attribute string. You can use + // this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + MD5OfMessageAttributes *string `type:"string"` + + // An MD5 digest of the non-URL-encoded message attribute string. You can use + // this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + MD5OfMessageBody *string `type:"string"` + + // An attribute containing the MessageId of the message sent to the queue. For + // more information, see Queue and Message Identifiers (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) + // in the Amazon Simple Queue Service Developer Guide. + MessageId *string `type:"string"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The large, non-consecutive number that Amazon SQS assigns to each message. + // + // The length of SequenceNumber is 128 bits. SequenceNumber continues to increase + // for a particular MessageGroupId. + SequenceNumber *string `type:"string"` +} + +// String returns the string representation +func (s SendMessageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s SendMessageOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributesRequest +type SetQueueAttributesInput struct { + _ struct{} `type:"structure"` + + // A map of attributes to set. + // + // The following lists the names, descriptions, and values of the special request + // parameters that the SetQueueAttributes action uses: + // + // * DelaySeconds - The length of time, in seconds, for which the delivery + // of all messages in the queue is delayed. Valid values: An integer from + // 0 to 900 (15 minutes). Default: 0. + // + // * MaximumMessageSize - The limit of how many bytes a message can contain + // before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes + // (1 KiB) up to 262,144 bytes (256 KiB). Default: 262,144 (256 KiB). + // + // * MessageRetentionPeriod - The length of time, in seconds, for which Amazon + // SQS retains a message. Valid values: An integer representing seconds, + // from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600 (4 days). + // + // + // * Policy - The queue's policy. A valid AWS policy. For more information + // about policy structure, see Overview of AWS IAM Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) + // in the Amazon IAM User Guide. + // + // * ReceiveMessageWaitTimeSeconds - The length of time, in seconds, for + // which a ReceiveMessage action waits for a message to arrive. Valid values: + // an integer from 0 to 20 (seconds). Default: 0. + // + // * RedrivePolicy - The string that includes the parameters for the dead-letter + // queue functionality of the source queue. For more information about the + // redrive policy and dead-letter queues, see Using Amazon SQS Dead-Letter + // Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // deadLetterTargetArn - The Amazon Resource Name (ARN) of the dead-letter queue + // to which Amazon SQS moves messages after the value of maxReceiveCount + // is exceeded. + // + // maxReceiveCount - The number of times a message is delivered to the source + // queue before being moved to the dead-letter queue. When the ReceiveCount + // for a message exceeds the maxReceiveCount for a queue, Amazon SQS moves + // the message to the dead-letter-queue. + // + // The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, + // the dead-letter queue of a standard queue must also be a standard queue. + // + // * VisibilityTimeout - The visibility timeout for the queue, in seconds. + // Valid values: an integer from 0 to 43,200 (12 hours). Default: 30. For + // more information about the visibility timeout, see Visibility Timeout + // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // The following attributes apply only to server-side-encryption (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): + // + // * KmsMasterKeyId - The ID of an AWS-managed customer master key (CMK) + // for Amazon SQS or a custom CMK. For more information, see Key Terms (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). + // While the alias of the AWS-managed CMK for Amazon SQS is always alias/aws/sqs, + // the alias of a custom CMK can, for example, be alias/MyAlias. For more + // examples, see KeyId (http://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + // in the AWS Key Management Service API Reference. + // + // * KmsDataKeyReusePeriodSeconds - The length of time, in seconds, for which + // Amazon SQS can reuse a data key (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) + // to encrypt or decrypt messages before calling AWS KMS again. An integer + // representing seconds, between 60 seconds (1 minute) and 86,400 seconds + // (24 hours). Default: 300 (5 minutes). A shorter time period provides better + // security but results in more calls to KMS which might incur charges after + // Free Tier. For more information, see How Does the Data Key Reuse Period + // Work? (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). + // + // + // The following attribute applies only to FIFO (first-in-first-out) queues + // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): + // + // * ContentBasedDeduplication - Enables content-based deduplication. For + // more information, see Exactly-Once Processing (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. + // + // Every message must have a unique MessageDeduplicationId, + // + // You may provide a MessageDeduplicationId explicitly. + // + // If you aren't able to provide a MessageDeduplicationId and you enable ContentBasedDeduplication + // for your queue, Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId + // using the body of the message (but not the attributes of the message). + // + // + // If you don't provide a MessageDeduplicationId and the queue doesn't have + // ContentBasedDeduplication set, the action fails with an error. + // + // If the queue has ContentBasedDeduplication set, your MessageDeduplicationId + // overrides the generated one. + // + // When ContentBasedDeduplication is in effect, messages with identical content + // sent within the deduplication interval are treated as duplicates and only + // one copy of the message is delivered. + // + // If you send one message with ContentBasedDeduplication enabled and then another + // message with a MessageDeduplicationId that is the same as the one generated + // for the first MessageDeduplicationId, the two messages are treated as + // duplicates and only one copy of the message is delivered. + // + // Attributes is a required field + Attributes map[string]string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true" required:"true"` + + // The URL of the Amazon SQS queue whose attributes are set. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SetQueueAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetQueueAttributesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetQueueAttributesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "SetQueueAttributesInput"} + + if s.Attributes == nil { + invalidParams.Add(aws.NewErrParamRequired("Attributes")) + } + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributesOutput +type SetQueueAttributesOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response +} + +// String returns the string representation +func (s SetQueueAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetQueueAttributesOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s SetQueueAttributesOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/TagQueueRequest +type TagQueueInput struct { + _ struct{} `type:"structure"` + + // The URL of the queue. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // The list of tags to be added to the specified queue. + // + // Tags is a required field + Tags map[string]string `locationName:"Tag" locationNameKey:"Key" locationNameValue:"Value" type:"map" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s TagQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TagQueueInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "TagQueueInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if s.Tags == nil { + invalidParams.Add(aws.NewErrParamRequired("Tags")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/TagQueueOutput +type TagQueueOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response +} + +// String returns the string representation +func (s TagQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagQueueOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s TagQueueOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/UntagQueueRequest +type UntagQueueInput struct { + _ struct{} `type:"structure"` + + // The URL of the queue. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // The list of tags to be removed from the specified queue. + // + // TagKeys is a required field + TagKeys []string `locationNameList:"TagKey" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s UntagQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UntagQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UntagQueueInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "UntagQueueInput"} + + if s.QueueUrl == nil { + invalidParams.Add(aws.NewErrParamRequired("QueueUrl")) + } + + if s.TagKeys == nil { + invalidParams.Add(aws.NewErrParamRequired("TagKeys")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/UntagQueueOutput +type UntagQueueOutput struct { + _ struct{} `type:"structure"` + + responseMetadata aws.Response +} + +// String returns the string representation +func (s UntagQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UntagQueueOutput) GoString() string { + return s.String() +} + +// SDKResponseMetdata return sthe response metadata for the API. +func (s UntagQueueOutput) SDKResponseMetadata() aws.Response { + return s.responseMetadata +} + +type MessageSystemAttributeName string + +// Enum values for MessageSystemAttributeName +const ( + MessageSystemAttributeNameSenderId MessageSystemAttributeName = "SenderId" + MessageSystemAttributeNameSentTimestamp MessageSystemAttributeName = "SentTimestamp" + MessageSystemAttributeNameApproximateReceiveCount MessageSystemAttributeName = "ApproximateReceiveCount" + MessageSystemAttributeNameApproximateFirstReceiveTimestamp MessageSystemAttributeName = "ApproximateFirstReceiveTimestamp" + MessageSystemAttributeNameSequenceNumber MessageSystemAttributeName = "SequenceNumber" + MessageSystemAttributeNameMessageDeduplicationId MessageSystemAttributeName = "MessageDeduplicationId" + MessageSystemAttributeNameMessageGroupId MessageSystemAttributeName = "MessageGroupId" +) + +func (enum MessageSystemAttributeName) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum MessageSystemAttributeName) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type QueueAttributeName string + +// Enum values for QueueAttributeName +const ( + QueueAttributeNameAll QueueAttributeName = "All" + QueueAttributeNamePolicy QueueAttributeName = "Policy" + QueueAttributeNameVisibilityTimeout QueueAttributeName = "VisibilityTimeout" + QueueAttributeNameMaximumMessageSize QueueAttributeName = "MaximumMessageSize" + QueueAttributeNameMessageRetentionPeriod QueueAttributeName = "MessageRetentionPeriod" + QueueAttributeNameApproximateNumberOfMessages QueueAttributeName = "ApproximateNumberOfMessages" + QueueAttributeNameApproximateNumberOfMessagesNotVisible QueueAttributeName = "ApproximateNumberOfMessagesNotVisible" + QueueAttributeNameCreatedTimestamp QueueAttributeName = "CreatedTimestamp" + QueueAttributeNameLastModifiedTimestamp QueueAttributeName = "LastModifiedTimestamp" + QueueAttributeNameQueueArn QueueAttributeName = "QueueArn" + QueueAttributeNameApproximateNumberOfMessagesDelayed QueueAttributeName = "ApproximateNumberOfMessagesDelayed" + QueueAttributeNameDelaySeconds QueueAttributeName = "DelaySeconds" + QueueAttributeNameReceiveMessageWaitTimeSeconds QueueAttributeName = "ReceiveMessageWaitTimeSeconds" + QueueAttributeNameRedrivePolicy QueueAttributeName = "RedrivePolicy" + QueueAttributeNameFifoQueue QueueAttributeName = "FifoQueue" + QueueAttributeNameContentBasedDeduplication QueueAttributeName = "ContentBasedDeduplication" + QueueAttributeNameKmsMasterKeyId QueueAttributeName = "KmsMasterKeyId" + QueueAttributeNameKmsDataKeyReusePeriodSeconds QueueAttributeName = "KmsDataKeyReusePeriodSeconds" +) + +func (enum QueueAttributeName) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum QueueAttributeName) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/checksums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/checksums.go new file mode 100644 index 000000000000..87c8222da388 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/checksums.go @@ -0,0 +1,110 @@ +package sqs + +import ( + "crypto/md5" + "encoding/hex" + "fmt" + "strings" + + "github.com/aws/aws-sdk-go-v2/aws" + request "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/awserr" +) + +var ( + errChecksumMissingBody = fmt.Errorf("cannot compute checksum. missing body") + errChecksumMissingMD5 = fmt.Errorf("cannot verify checksum. missing response MD5") +) + +func setupChecksumValidation(r *request.Request) { + switch r.Operation.Name { + case opSendMessage: + r.Handlers.Unmarshal.PushBack(verifySendMessage) + case opSendMessageBatch: + r.Handlers.Unmarshal.PushBack(verifySendMessageBatch) + case opReceiveMessage: + r.Handlers.Unmarshal.PushBack(verifyReceiveMessage) + } +} + +func verifySendMessage(r *request.Request) { + if r.ParamsFilled() { + in := r.Params.(*SendMessageInput) + out := r.Data.(*SendMessageOutput) + err := checksumsMatch(in.MessageBody, out.MD5OfMessageBody) + if err != nil { + setChecksumError(r, err.Error()) + } + } +} + +func verifySendMessageBatch(r *request.Request) { + if r.ParamsFilled() { + entries := map[string]SendMessageBatchResultEntry{} + ids := []string{} + + out := r.Data.(*SendMessageBatchOutput) + for _, entry := range out.Successful { + entries[*entry.Id] = entry + } + + in := r.Params.(*SendMessageBatchInput) + for _, entry := range in.Entries { + e := entries[*entry.Id] + err := checksumsMatch(entry.MessageBody, e.MD5OfMessageBody) + if err != nil { + ids = append(ids, *e.MessageId) + } + } + if len(ids) > 0 { + setChecksumError(r, "invalid messages: %s", strings.Join(ids, ", ")) + } + } +} + +func verifyReceiveMessage(r *request.Request) { + if r.ParamsFilled() { + ids := []string{} + out := r.Data.(*ReceiveMessageOutput) + for i, msg := range out.Messages { + err := checksumsMatch(msg.Body, msg.MD5OfBody) + if err != nil { + if msg.MessageId == nil { + if r.Config.Logger != nil { + r.Config.Logger.Log(fmt.Sprintf( + "WARN: SQS.ReceiveMessage failed checksum request id: %s, message %d has no message ID.", + r.RequestID, i, + )) + } + continue + } + + ids = append(ids, *msg.MessageId) + } + } + if len(ids) > 0 { + setChecksumError(r, "invalid messages: %s", strings.Join(ids, ", ")) + } + } +} + +func checksumsMatch(body, expectedMD5 *string) error { + if body == nil { + return errChecksumMissingBody + } else if expectedMD5 == nil { + return errChecksumMissingMD5 + } + + msum := md5.Sum([]byte(*body)) + sum := hex.EncodeToString(msum[:]) + if sum != *expectedMD5 { + return fmt.Errorf("expected MD5 checksum '%s', got '%s'", *expectedMD5, sum) + } + + return nil +} + +func setChecksumError(r *request.Request, format string, args ...interface{}) { + r.Retryable = aws.Bool(true) + r.Error = awserr.New("InvalidChecksum", fmt.Sprintf(format, args...), nil) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/customizations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/customizations.go new file mode 100644 index 000000000000..b92cc17b5121 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/customizations.go @@ -0,0 +1,11 @@ +package sqs + +import request "github.com/aws/aws-sdk-go-v2/aws" + +func init() { + initRequest = func(c *SQS, r *request.Request) { + if !c.DisableComputeChecksums { + setupChecksumValidation(r) + } + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/doc.go new file mode 100644 index 000000000000..dd650c4e6ebc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/doc.go @@ -0,0 +1,67 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package sqs provides the client and types for making API +// requests to Amazon Simple Queue Service. +// +// Welcome to the Amazon Simple Queue Service API Reference. +// +// Amazon Simple Queue Service (Amazon SQS) is a reliable, highly-scalable hosted +// queue for storing messages as they travel between applications or microservices. +// Amazon SQS moves data between distributed application components and helps +// you decouple these components. +// +// Standard queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) +// are available in all regions. FIFO queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) +// are available in the US East (N. Virginia), US East (Ohio), US West (Oregon), +// and EU (Ireland) regions. +// +// You can use AWS SDKs (http://aws.amazon.com/tools/#sdk) to access Amazon +// SQS using your favorite programming language. The SDKs perform tasks such +// as the following automatically: +// +// * Cryptographically sign your service requests +// +// * Retry requests +// +// * Handle error responses +// +// Additional Information +// +// * Amazon SQS Product Page (http://aws.amazon.com/sqs/) +// +// * Amazon Simple Queue Service Developer Guide +// +// Making API Requests (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html) +// +// Amazon SQS Message Attributes (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html) +// +// Amazon SQS Dead-Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) +// +// * Amazon SQS in the (http://docs.aws.amazon.com/cli/latest/reference/sqs/index.html)AWS +// CLI Command Reference +// +// * Amazon Web Services General Reference +// +// Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sqs_region) +// +// See https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05 for more information on this service. +// +// See sqs package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/sqs/ +// +// Using the Client +// +// To Amazon Simple Queue Service 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 Amazon Simple Queue Service client SQS for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/sqs/#New +package sqs diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/errors.go new file mode 100644 index 000000000000..89eb40d7fd2f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/errors.go @@ -0,0 +1,110 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package sqs + +const ( + + // ErrCodeBatchEntryIdsNotDistinct for service response error code + // "AWS.SimpleQueueService.BatchEntryIdsNotDistinct". + // + // Two or more batch entries in the request have the same Id. + ErrCodeBatchEntryIdsNotDistinct = "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" + + // ErrCodeBatchRequestTooLong for service response error code + // "AWS.SimpleQueueService.BatchRequestTooLong". + // + // The length of all the messages put together is more than the limit. + ErrCodeBatchRequestTooLong = "AWS.SimpleQueueService.BatchRequestTooLong" + + // ErrCodeEmptyBatchRequest for service response error code + // "AWS.SimpleQueueService.EmptyBatchRequest". + // + // The batch request doesn't contain any entries. + ErrCodeEmptyBatchRequest = "AWS.SimpleQueueService.EmptyBatchRequest" + + // ErrCodeInvalidAttributeName for service response error code + // "InvalidAttributeName". + // + // The specified attribute doesn't exist. + ErrCodeInvalidAttributeName = "InvalidAttributeName" + + // ErrCodeInvalidBatchEntryId for service response error code + // "AWS.SimpleQueueService.InvalidBatchEntryId". + // + // The Id of a batch entry in a batch request doesn't abide by the specification. + ErrCodeInvalidBatchEntryId = "AWS.SimpleQueueService.InvalidBatchEntryId" + + // ErrCodeInvalidIdFormat for service response error code + // "InvalidIdFormat". + // + // The specified receipt handle isn't valid for the current version. + ErrCodeInvalidIdFormat = "InvalidIdFormat" + + // ErrCodeInvalidMessageContents for service response error code + // "InvalidMessageContents". + // + // The message contains characters outside the allowed set. + ErrCodeInvalidMessageContents = "InvalidMessageContents" + + // ErrCodeMessageNotInflight for service response error code + // "AWS.SimpleQueueService.MessageNotInflight". + // + // The specified message isn't in flight. + ErrCodeMessageNotInflight = "AWS.SimpleQueueService.MessageNotInflight" + + // ErrCodeOverLimit for service response error code + // "OverLimit". + // + // The specified action violates a limit. For example, ReceiveMessage returns + // this error if the maximum number of inflight messages is reached and AddPermission + // returns this error if the maximum number of permissions for the queue is + // reached. + ErrCodeOverLimit = "OverLimit" + + // ErrCodePurgeQueueInProgress for service response error code + // "AWS.SimpleQueueService.PurgeQueueInProgress". + // + // Indicates that the specified queue previously received a PurgeQueue request + // within the last 60 seconds (the time it can take to delete the messages in + // the queue). + ErrCodePurgeQueueInProgress = "AWS.SimpleQueueService.PurgeQueueInProgress" + + // ErrCodeQueueDeletedRecently for service response error code + // "AWS.SimpleQueueService.QueueDeletedRecently". + // + // You must wait 60 seconds after deleting a queue before you can create another + // queue with the same name. + ErrCodeQueueDeletedRecently = "AWS.SimpleQueueService.QueueDeletedRecently" + + // ErrCodeQueueDoesNotExist for service response error code + // "AWS.SimpleQueueService.NonExistentQueue". + // + // The specified queue doesn't exist. + ErrCodeQueueDoesNotExist = "AWS.SimpleQueueService.NonExistentQueue" + + // ErrCodeQueueNameExists for service response error code + // "QueueAlreadyExists". + // + // A queue with this name already exists. Amazon SQS returns this error only + // if the request includes attributes whose values differ from those of the + // existing queue. + ErrCodeQueueNameExists = "QueueAlreadyExists" + + // ErrCodeReceiptHandleIsInvalid for service response error code + // "ReceiptHandleIsInvalid". + // + // The specified receipt handle isn't valid. + ErrCodeReceiptHandleIsInvalid = "ReceiptHandleIsInvalid" + + // ErrCodeTooManyEntriesInBatchRequest for service response error code + // "AWS.SimpleQueueService.TooManyEntriesInBatchRequest". + // + // The batch request contains more entries than permissible. + ErrCodeTooManyEntriesInBatchRequest = "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" + + // ErrCodeUnsupportedOperation for service response error code + // "AWS.SimpleQueueService.UnsupportedOperation". + // + // Error code 400. Unsupported operation. + ErrCodeUnsupportedOperation = "AWS.SimpleQueueService.UnsupportedOperation" +) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/service.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/service.go new file mode 100644 index 000000000000..cc01150237ca --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/service.go @@ -0,0 +1,85 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package sqs + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/private/protocol/query" +) + +// SQS provides the API operation methods for making requests to +// Amazon Simple Queue Service. See this package's package overview docs +// for details on the service. +// +// SQS methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type SQS struct { + *aws.Client + + // Service specific configurations. (codegen: service_specific_config.go) + + // Disables the computation and validation of request and response checksums. + DisableComputeChecksums bool +} + +// Used for custom client initialization logic +var initClient func(*SQS) + +// Used for custom request initialization logic +var initRequest func(*SQS, *aws.Request) + +// Service information constants +const ( + ServiceName = "sqs" // Service endpoint prefix API calls made to. + EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. +) + +// New creates a new instance of the SQS client with a config. +// +// Example: +// // Create a SQS client from just a config. +// svc := sqs.New(myConfig) +func New(config aws.Config) *SQS { + var signingName string + signingRegion := config.Region + + svc := &SQS{ + Client: aws.NewClient( + config, + aws.Metadata{ + ServiceName: ServiceName, + SigningName: signingName, + SigningRegion: signingRegion, + APIVersion: "2012-11-05", + }, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(query.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc) + } + + return svc +} + +// newRequest creates a new request for a SQS operation and runs any +// custom request initialization. +func (c *SQS) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(c, req) + } + + return req +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/sqsiface/interface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/sqsiface/interface.go new file mode 100644 index 000000000000..2432c78cd626 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/sqsiface/interface.go @@ -0,0 +1,106 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package sqsiface provides an interface to enable mocking the Amazon Simple Queue Service service client +// for testing your code. +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. +package sqsiface + +import ( + "github.com/aws/aws-sdk-go-v2/service/sqs" +) + +// SQSAPI provides an interface to enable mocking the +// sqs.SQS service client's API operation, +// paginators, and waiters. This make unit testing your code that calls out +// to the SDK's service client's calls easier. +// +// The best way to use this interface is so the SDK's service client's calls +// can be stubbed out for unit testing your code with the SDK without needing +// to inject custom request handlers into the SDK's request pipeline. +// +// // myFunc uses an SDK service client to make a request to +// // Amazon Simple Queue Service. +// func myFunc(svc sqsiface.SQSAPI) bool { +// // Make svc.AddPermission request +// } +// +// func main() { +// cfg, err := external.LoadDefaultAWSConfig() +// if err != nil { +// panic("failed to load config, " + err.Error()) +// } +// +// svc := sqs.New(cfg) +// +// myFunc(svc) +// } +// +// In your _test.go file: +// +// // Define a mock struct to be used in your unit tests of myFunc. +// type mockSQSClient struct { +// sqsiface.SQSAPI +// } +// func (m *mockSQSClient) AddPermission(input *sqs.AddPermissionInput) (*sqs.AddPermissionOutput, error) { +// // mock response/functionality +// } +// +// func TestMyFunc(t *testing.T) { +// // Setup Test +// mockSvc := &mockSQSClient{} +// +// myfunc(mockSvc) +// +// // Verify myFunc's functionality +// } +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. Its suggested to use the pattern above for testing, or using +// tooling to generate mocks to satisfy the interfaces. +type SQSAPI interface { + AddPermissionRequest(*sqs.AddPermissionInput) sqs.AddPermissionRequest + + ChangeMessageVisibilityRequest(*sqs.ChangeMessageVisibilityInput) sqs.ChangeMessageVisibilityRequest + + ChangeMessageVisibilityBatchRequest(*sqs.ChangeMessageVisibilityBatchInput) sqs.ChangeMessageVisibilityBatchRequest + + CreateQueueRequest(*sqs.CreateQueueInput) sqs.CreateQueueRequest + + DeleteMessageRequest(*sqs.DeleteMessageInput) sqs.DeleteMessageRequest + + DeleteMessageBatchRequest(*sqs.DeleteMessageBatchInput) sqs.DeleteMessageBatchRequest + + DeleteQueueRequest(*sqs.DeleteQueueInput) sqs.DeleteQueueRequest + + GetQueueAttributesRequest(*sqs.GetQueueAttributesInput) sqs.GetQueueAttributesRequest + + GetQueueUrlRequest(*sqs.GetQueueUrlInput) sqs.GetQueueUrlRequest + + ListDeadLetterSourceQueuesRequest(*sqs.ListDeadLetterSourceQueuesInput) sqs.ListDeadLetterSourceQueuesRequest + + ListQueueTagsRequest(*sqs.ListQueueTagsInput) sqs.ListQueueTagsRequest + + ListQueuesRequest(*sqs.ListQueuesInput) sqs.ListQueuesRequest + + PurgeQueueRequest(*sqs.PurgeQueueInput) sqs.PurgeQueueRequest + + ReceiveMessageRequest(*sqs.ReceiveMessageInput) sqs.ReceiveMessageRequest + + RemovePermissionRequest(*sqs.RemovePermissionInput) sqs.RemovePermissionRequest + + SendMessageRequest(*sqs.SendMessageInput) sqs.SendMessageRequest + + SendMessageBatchRequest(*sqs.SendMessageBatchInput) sqs.SendMessageBatchRequest + + SetQueueAttributesRequest(*sqs.SetQueueAttributesInput) sqs.SetQueueAttributesRequest + + TagQueueRequest(*sqs.TagQueueInput) sqs.TagQueueRequest + + UntagQueueRequest(*sqs.UntagQueueInput) sqs.UntagQueueRequest +} + +var _ SQSAPI = (*sqs.SQS)(nil) diff --git a/vendor/vendor.json b/vendor/vendor.json index d4bcd302afc4..e9de96985560 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -445,6 +445,22 @@ "version": "v2.0.0-preview.5", "versionExact": "v2.0.0-preview.5" }, + { + "checksumSHA1": "Y+mpKnu57hYbC4z3nrSFR9BkAec=", + "path": "github.com/aws/aws-sdk-go-v2/service/sqs", + "revision": "d52522b5f4b95591ff6528d7c54923951aadf099", + "revisionTime": "2018-09-27T22:51:20Z", + "version": "v2.0.0-preview.5", + "versionExact": "v2.0.0-preview.5" + }, + { + "checksumSHA1": "zydzuI+ekstlWNf6kXnMKDy/pfM=", + "path": "github.com/aws/aws-sdk-go-v2/service/sqs/sqsiface", + "revision": "d52522b5f4b95591ff6528d7c54923951aadf099", + "revisionTime": "2018-09-27T22:51:20Z", + "version": "v2.0.0-preview.5", + "versionExact": "v2.0.0-preview.5" + }, { "checksumSHA1": "KxyCqGCS+HriTN14zW1NKyXDCT4=", "path": "github.com/aws/aws-sdk-go-v2/service/sts", diff --git a/x-pack/metricbeat/module/aws/sqs/_meta/docs.asciidoc b/x-pack/metricbeat/module/aws/sqs/_meta/docs.asciidoc index 9db9912db6e5..709674047cf1 100644 --- a/x-pack/metricbeat/module/aws/sqs/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/aws/sqs/_meta/docs.asciidoc @@ -8,4 +8,5 @@ Some specific AWS permissions are required for IAM user to collect AWS SQS metri ---- cloudwatch:GetMetricData ec2:DescribeRegions +sqs:ListQueues ---- diff --git a/x-pack/metricbeat/module/aws/sqs/sqs.go b/x-pack/metricbeat/module/aws/sqs/sqs.go index 0c7b92f17d92..39eace8de1f6 100644 --- a/x-pack/metricbeat/module/aws/sqs/sqs.go +++ b/x-pack/metricbeat/module/aws/sqs/sqs.go @@ -9,6 +9,9 @@ import ( "strconv" "strings" + "github.com/aws/aws-sdk-go-v2/service/sqs" + "github.com/aws/aws-sdk-go-v2/service/sqs/sqsiface" + "github.com/aws/aws-sdk-go-v2/service/cloudwatch" "github.com/pkg/errors" @@ -79,6 +82,18 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) { for _, regionName := range m.MetricSet.RegionsList { m.MetricSet.AwsConfig.Region = regionName svcCloudwatch := cloudwatch.New(*m.MetricSet.AwsConfig) + svcSQS := sqs.New(*m.MetricSet.AwsConfig) + + // Get queueUrls for each region + queueUrls, err := getQueueUrls(svcSQS) + if err != nil { + m.logger.Error(err.Error()) + report.Error(err) + continue + } + if len(queueUrls) == 0 { + continue + } // Get listMetrics output listMetricsOutput, err := aws.GetListMetricsOutput(namespace, regionName, svcCloudwatch) @@ -107,16 +122,31 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) { } // Create Cloudwatch Events for SQS - event, err := createSQSEvents(metricDataResults, metricsetName, regionName, schemaRequestFields) - if err != nil { - m.logger.Error(err.Error()) - event.Error = err + for _, queueUrl := range queueUrls { + queueUrlParsed := strings.Split(queueUrl, "/") + queueName := queueUrlParsed[len(queueUrlParsed)-1] + event, err := createSQSEvents(metricDataResults, queueName, metricsetName, regionName, schemaRequestFields) + if err != nil { + m.logger.Error(err.Error()) + event.Error = err + report.Event(event) + continue + } report.Event(event) - continue } + } +} - report.Event(event) +func getQueueUrls(svc sqsiface.SQSAPI) ([]string, error) { + // ListQueues + listQueuesInput := &sqs.ListQueuesInput{} + req := svc.ListQueuesRequest(listQueuesInput) + output, err := req.Send() + if err != nil { + err = errors.Wrap(err, "Error DescribeInstances") + return []string{}, err } + return output.QueueUrls, nil } func constructMetricQueries(listMetricsOutput []cloudwatch.Metric, period int64) []cloudwatch.MetricDataQuery { @@ -153,7 +183,7 @@ func createMetricDataQuery(metric cloudwatch.Metric, index int, period int64) (m return } -func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, metricsetName string, regionName string, schemaMetricFields s.Schema) (event mb.Event, err error) { +func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, queueName string, metricsetName string, regionName string, schemaMetricFields s.Schema) (event mb.Event, err error) { event.Service = metricsetName event.RootFields = common.MapStr{} event.RootFields.Put("service.name", metricsetName) @@ -165,7 +195,9 @@ func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, metrics continue } labels := strings.Split(*output.Label, " ") - mapOfMetricSetFieldResults["QueueName"] = labels[0] + if queueName != labels[0] { + continue + } mapOfMetricSetFieldResults[labels[1]] = fmt.Sprint(output.Values[len(output.Values)-1]) } @@ -174,6 +206,8 @@ func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, metrics err = errors.Wrap(err, "Error trying to apply schemaMetricSetFields in AWS SQS metricbeat module.") return } + event.MetricSetFields = resultMetricSetFields + event.MetricSetFields.Put("queue.name", queueName) return } diff --git a/x-pack/metricbeat/module/aws/sqs/sqs_test.go b/x-pack/metricbeat/module/aws/sqs/sqs_test.go new file mode 100644 index 000000000000..83cd0abd5b2b --- /dev/null +++ b/x-pack/metricbeat/module/aws/sqs/sqs_test.go @@ -0,0 +1,38 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build !integration + +package sqs + +import ( + "testing" + + awssdk "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/sqs" + "github.com/aws/aws-sdk-go-v2/service/sqs/sqsiface" + "github.com/stretchr/testify/assert" +) + +// MockSQSClient struct is used for unit tests. +type MockSQSClient struct { + sqsiface.SQSAPI +} + +func (m *MockSQSClient) ListQueuesRequest(input *sqs.ListQueuesInput) sqs.ListQueuesRequest { + return sqs.ListQueuesRequest{ + Request: &awssdk.Request{ + Data: &sqs.ListQueuesOutput{ + QueueUrls: []string{"https://sqs.us-east-1.amazonaws.com/123/sqs1", "https://sqs.us-east-1.amazonaws.com/123/sqs2"}, + }, + }, + } +} + +func TestGetQueueUrls(t *testing.T) { + mockSvc := &MockSQSClient{} + queueUrls, err := getQueueUrls(mockSvc) + assert.NoError(t, err) + assert.Equal(t, []string{"https://sqs.us-east-1.amazonaws.com/123/sqs1", "https://sqs.us-east-1.amazonaws.com/123/sqs2"}, queueUrls) +} From fc362db93484574b2d5eaadd15f9857baf7a6e08 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Sun, 10 Mar 2019 15:41:16 -0600 Subject: [PATCH 05/17] Change sqs metric fields to scaled_float --- x-pack/metricbeat/module/aws/sqs/_meta/fields.yml | 4 ++-- x-pack/metricbeat/module/aws/sqs/sqs.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml index 1e36b2465741..6e8db2af4b9f 100644 --- a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml +++ b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml @@ -5,7 +5,7 @@ release: beta fields: - name: oldest_message_age.sec - type: long + type: scaled_float description: > The approximate age of the oldest non-deleted message in the queue. - name: messages.delayed @@ -33,7 +33,7 @@ description: > The number of messages added to a queue. - name: empty_receives - type: long + type: scaled_float description: > The number of ReceiveMessage API calls that did not return a message. - name: sent_message_size.bytes diff --git a/x-pack/metricbeat/module/aws/sqs/sqs.go b/x-pack/metricbeat/module/aws/sqs/sqs.go index 39eace8de1f6..3dac370f8777 100644 --- a/x-pack/metricbeat/module/aws/sqs/sqs.go +++ b/x-pack/metricbeat/module/aws/sqs/sqs.go @@ -85,13 +85,13 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) { svcSQS := sqs.New(*m.MetricSet.AwsConfig) // Get queueUrls for each region - queueUrls, err := getQueueUrls(svcSQS) + queueURLs, err := getQueueUrls(svcSQS) if err != nil { m.logger.Error(err.Error()) report.Error(err) continue } - if len(queueUrls) == 0 { + if len(queueURLs) == 0 { continue } @@ -122,9 +122,9 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) { } // Create Cloudwatch Events for SQS - for _, queueUrl := range queueUrls { - queueUrlParsed := strings.Split(queueUrl, "/") - queueName := queueUrlParsed[len(queueUrlParsed)-1] + for _, queueURL := range queueURLs { + queueURLParsed := strings.Split(queueURL, "/") + queueName := queueURLParsed[len(queueURLParsed)-1] event, err := createSQSEvents(metricDataResults, queueName, metricsetName, regionName, schemaRequestFields) if err != nil { m.logger.Error(err.Error()) From de33594b64ccf8510e4a5329aa77f358d6ecf895 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Sun, 10 Mar 2019 22:58:36 -0600 Subject: [PATCH 06/17] Fix field names from message to messages --- metricbeat/docs/fields.asciidoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 08d67cceeed2..a8442371e7eb 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -1319,7 +1319,7 @@ The elapsed per-request time from the first byte received to the last byte sent *`aws.sqs.oldest_message_age.sec`*:: + -- -type: long +type: scaled_float The approximate age of the oldest non-deleted message in the queue. @@ -1329,7 +1329,7 @@ The approximate age of the oldest non-deleted message in the queue. *`aws.sqs.messages.delayed`*:: + -- -type: long +type: scaled_float TThe number of messages in the queue that are delayed and not available for reading immediately. @@ -1339,7 +1339,7 @@ TThe number of messages in the queue that are delayed and not available for read *`aws.sqs.messages.not_visible`*:: + -- -type: long +type: scaled_float The number of messages that are in flight. @@ -1349,7 +1349,7 @@ The number of messages that are in flight. *`aws.sqs.messages.visible`*:: + -- -type: long +type: scaled_float The number of messages available for retrieval from the queue. @@ -1359,7 +1359,7 @@ The number of messages available for retrieval from the queue. *`aws.sqs.messages.deleted`*:: + -- -type: long +type: scaled_float The number of messages deleted from the queue. @@ -1369,7 +1369,7 @@ The number of messages deleted from the queue. *`aws.sqs.messages.received`*:: + -- -type: long +type: scaled_float The number of messages returned by calls to the ReceiveMessage action. @@ -1379,7 +1379,7 @@ The number of messages returned by calls to the ReceiveMessage action. *`aws.sqs.messages.sent`*:: + -- -type: long +type: scaled_float The number of messages added to a queue. @@ -1389,7 +1389,7 @@ The number of messages added to a queue. *`aws.sqs.empty_receives`*:: + -- -type: long +type: scaled_float The number of ReceiveMessage API calls that did not return a message. From 8fd524946455a0b841f232112a43a52c6c7e9675 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 11 Mar 2019 10:15:08 -0600 Subject: [PATCH 07/17] Move fields.yml change to a separate PR --- metricbeat/docs/fields.asciidoc | 26 +++++++++---------- .../module/aws/sqs/_meta/fields.yml | 4 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index a8442371e7eb..713e9981d6a6 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -1319,17 +1319,17 @@ The elapsed per-request time from the first byte received to the last byte sent *`aws.sqs.oldest_message_age.sec`*:: + -- -type: scaled_float +type: long The approximate age of the oldest non-deleted message in the queue. -- -*`aws.sqs.messages.delayed`*:: +*`aws.sqs.message.delayed`*:: + -- -type: scaled_float +type: long TThe number of messages in the queue that are delayed and not available for reading immediately. @@ -1339,47 +1339,47 @@ TThe number of messages in the queue that are delayed and not available for read *`aws.sqs.messages.not_visible`*:: + -- -type: scaled_float +type: long The number of messages that are in flight. -- -*`aws.sqs.messages.visible`*:: +*`aws.sqs.message.visible`*:: + -- -type: scaled_float +type: long The number of messages available for retrieval from the queue. -- -*`aws.sqs.messages.deleted`*:: +*`aws.sqs.message.deleted`*:: + -- -type: scaled_float +type: long The number of messages deleted from the queue. -- -*`aws.sqs.messages.received`*:: +*`aws.sqs.message.received`*:: + -- -type: scaled_float +type: long The number of messages returned by calls to the ReceiveMessage action. -- -*`aws.sqs.messages.sent`*:: +*`aws.sqs.message.sent`*:: + -- -type: scaled_float +type: long The number of messages added to a queue. @@ -1389,7 +1389,7 @@ The number of messages added to a queue. *`aws.sqs.empty_receives`*:: + -- -type: scaled_float +type: long The number of ReceiveMessage API calls that did not return a message. diff --git a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml index 6e8db2af4b9f..1e36b2465741 100644 --- a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml +++ b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml @@ -5,7 +5,7 @@ release: beta fields: - name: oldest_message_age.sec - type: scaled_float + type: long description: > The approximate age of the oldest non-deleted message in the queue. - name: messages.delayed @@ -33,7 +33,7 @@ description: > The number of messages added to a queue. - name: empty_receives - type: scaled_float + type: long description: > The number of ReceiveMessage API calls that did not return a message. - name: sent_message_size.bytes From 480a3ca20a9fba5aedf1b34798d5da7c35f331d7 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 11 Mar 2019 12:20:56 -0600 Subject: [PATCH 08/17] Add FindTimestamp function and check every value is from the same timestamp --- .../aws/s3_daily_storage/s3_daily_storage.go | 23 ++++----- .../module/aws/s3_request/s3_request.go | 21 ++++----- x-pack/metricbeat/module/aws/sqs/sqs.go | 26 ++++++---- x-pack/metricbeat/module/aws/utils.go | 47 +++++++++++++++++++ 4 files changed, 82 insertions(+), 35 deletions(-) diff --git a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go index c24b221e8d7c..4e2ed224b9b2 100644 --- a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go +++ b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go @@ -8,7 +8,6 @@ import ( "fmt" "strconv" "strings" - "time" "github.com/aws/aws-sdk-go-v2/service/cloudwatch" "github.com/pkg/errors" @@ -205,22 +204,18 @@ func createCloudWatchEvents(outputs []cloudwatch.MetricDataResult, regionName st // AWS s3_daily_storage metrics mapOfMetricSetFieldResults := make(map[string]interface{}) - // Find a timestamp for all metrics in output - timestamp := time.Time{} - for _, output := range outputs { - if output.Timestamps != nil { - timestamp = output.Timestamps[0] - break - } - } + // Find a timestamp for all metrics in output + timestamp := aws.FindTimestamp(outputs) if !timestamp.IsZero() { - timestamp := outputs[0].Timestamps[0] for _, output := range outputs { - labels := strings.Split(*output.Label, " ") - // check timestamp to make sure metrics come from the same timestamp - if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > 0 && output.Timestamps[0] == timestamp { - mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[len(output.Values)-1]) + exists, timestampIdx := aws.InArray(timestamp, output.Timestamps) + if exists { + labels := strings.Split(*output.Label, " ") + // check timestamp to make sure metrics come from the same timestamp + if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > timestampIdx { + mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[timestampIdx]) + } } } } diff --git a/x-pack/metricbeat/module/aws/s3_request/s3_request.go b/x-pack/metricbeat/module/aws/s3_request/s3_request.go index a0203f82d9b5..07c094f9aac6 100644 --- a/x-pack/metricbeat/module/aws/s3_request/s3_request.go +++ b/x-pack/metricbeat/module/aws/s3_request/s3_request.go @@ -8,7 +8,6 @@ import ( "fmt" "strconv" "strings" - "time" "github.com/aws/aws-sdk-go-v2/service/cloudwatch" "github.com/pkg/errors" @@ -208,20 +207,16 @@ func createS3RequestEvents(outputs []cloudwatch.MetricDataResult, regionName str mapOfMetricSetFieldResults := make(map[string]interface{}) // Find a timestamp for all metrics in output - timestamp := time.Time{} - for _, output := range outputs { - if output.Timestamps != nil { - timestamp = output.Timestamps[0] - break - } - } - + timestamp := aws.FindTimestamp(outputs) if !timestamp.IsZero() { for _, output := range outputs { - labels := strings.Split(*output.Label, " ") - // check timestamp to make sure metrics come from the same timestamp - if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > 0 && output.Timestamps[0] == timestamp { - mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[len(output.Values)-1]) + exists, timestampIdx := aws.InArray(timestamp, output.Timestamps) + if exists { + labels := strings.Split(*output.Label, " ") + // check timestamp to make sure metrics come from the same timestamp + if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > timestampIdx { + mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[timestampIdx]) + } } } } diff --git a/x-pack/metricbeat/module/aws/sqs/sqs.go b/x-pack/metricbeat/module/aws/sqs/sqs.go index 3dac370f8777..230e7f48e635 100644 --- a/x-pack/metricbeat/module/aws/sqs/sqs.go +++ b/x-pack/metricbeat/module/aws/sqs/sqs.go @@ -189,16 +189,26 @@ func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, queueNa event.RootFields.Put("service.name", metricsetName) event.RootFields.Put("cloud.region", regionName) + // AWS sqs metrics mapOfMetricSetFieldResults := make(map[string]interface{}) - for _, output := range getMetricDataResults { - if len(output.Values) == 0 { - continue - } - labels := strings.Split(*output.Label, " ") - if queueName != labels[0] { - continue + + // Find a timestamp for all metrics in output + timestamp := aws.FindTimestamp(getMetricDataResults) + if !timestamp.IsZero() { + for _, output := range getMetricDataResults { + if len(output.Values) == 0 { + continue + } + + exists, timestampIdx := aws.InArray(timestamp, output.Timestamps) + if exists { + labels := strings.Split(*output.Label, " ") + // check timestamp to make sure metrics come from the same timestamp + if len(labels) == 2 && labels[0] == queueName && len(output.Values) > timestampIdx { + mapOfMetricSetFieldResults[labels[1]] = fmt.Sprint(output.Values[timestampIdx]) + } + } } - mapOfMetricSetFieldResults[labels[1]] = fmt.Sprint(output.Values[len(output.Values)-1]) } resultMetricSetFields, err := aws.EventMapping(mapOfMetricSetFieldResults, schemaMetricFields) diff --git a/x-pack/metricbeat/module/aws/utils.go b/x-pack/metricbeat/module/aws/utils.go index e66ad82d6057..97bff9fdf5c0 100644 --- a/x-pack/metricbeat/module/aws/utils.go +++ b/x-pack/metricbeat/module/aws/utils.go @@ -5,6 +5,7 @@ package aws import ( + "reflect" "time" "github.com/aws/aws-sdk-go-v2/service/cloudwatch" @@ -84,3 +85,49 @@ func GetMetricDataResults(metricDataQueries []cloudwatch.MetricDataQuery, svc cl func EventMapping(input map[string]interface{}, schema s.Schema) (common.MapStr, error) { return schema.Apply(input, s.FailOnRequired) } + +// InArray checks if input val exists in array and if it exists, return the position. +func InArray(val interface{}, array interface{}) (exists bool, index int) { + exists = false + index = -1 + + switch reflect.TypeOf(array).Kind() { + case reflect.Slice: + s := reflect.ValueOf(array) + + for i := 0; i < s.Len(); i++ { + if reflect.DeepEqual(val, s.Index(i).Interface()) == true { + index = i + exists = true + return + } + } + } + return +} + +func FindTimestamp(getMetricDataResults []cloudwatch.MetricDataResult) time.Time { + timestamp := time.Time{} + for _, output := range getMetricDataResults { + // When there are outputs with one timestamp, use this timestamp. + if output.Timestamps != nil && len(output.Timestamps) == 1 { + // Use the first timestamp from Timestamps field to collect the latest data. + timestamp = output.Timestamps[0] + break + } + } + + // When there is no output with one timestamp, use the latest timestamp from timestamp list. + if timestamp.IsZero() { + for _, output := range getMetricDataResults { + // When there are outputs with one timestamp, use this timestamp + if output.Timestamps != nil && len(output.Timestamps) > 1 { + // Example Timestamps: [2019-03-11 17:36:00 +0000 UTC,2019-03-11 17:31:00 +0000 UTC] + timestamp = output.Timestamps[0] + break + } + } + } + + return timestamp +} From a9e19530b2b5b3d7808ac3345afce7a93551bb6f Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 11 Mar 2019 12:28:31 -0600 Subject: [PATCH 09/17] Remove changes to sqs fields into a different pr --- metricbeat/docs/fields.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 713e9981d6a6..07fac3e6b0d9 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -1336,7 +1336,7 @@ TThe number of messages in the queue that are delayed and not available for read -- -*`aws.sqs.messages.not_visible`*:: +*`aws.sqs.message.not_visible`*:: + -- type: long From 41b822f437197eb0f34ce78f113ba9fb4a25482f Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 11 Mar 2019 12:29:28 -0600 Subject: [PATCH 10/17] Remove messages.* changes in fields.yml --- x-pack/metricbeat/module/aws/sqs/_meta/fields.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml index 1e36b2465741..b579faf80522 100644 --- a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml +++ b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml @@ -12,7 +12,7 @@ type: long description: > TThe number of messages in the queue that are delayed and not available for reading immediately. - - name: messages.not_visible + - name: message.not_visible type: long description: > The number of messages that are in flight. From c85e2b3e3657f26f34673d13534c71104337f97b Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 11 Mar 2019 16:51:05 -0600 Subject: [PATCH 11/17] Undo changes about timestamp --- .../aws/s3_daily_storage/s3_daily_storage.go | 15 +++--- .../module/aws/s3_request/s3_request.go | 15 +++--- x-pack/metricbeat/module/aws/utils.go | 47 ------------------- 3 files changed, 12 insertions(+), 65 deletions(-) diff --git a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go index 4e2ed224b9b2..f0c576c346da 100644 --- a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go +++ b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go @@ -206,16 +206,13 @@ func createCloudWatchEvents(outputs []cloudwatch.MetricDataResult, regionName st mapOfMetricSetFieldResults := make(map[string]interface{}) // Find a timestamp for all metrics in output - timestamp := aws.FindTimestamp(outputs) - if !timestamp.IsZero() { + if len(outputs) > 0 && len(outputs[0].Timestamps) > 0 { + timestamp := outputs[0].Timestamps[0] for _, output := range outputs { - exists, timestampIdx := aws.InArray(timestamp, output.Timestamps) - if exists { - labels := strings.Split(*output.Label, " ") - // check timestamp to make sure metrics come from the same timestamp - if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > timestampIdx { - mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[timestampIdx]) - } + labels := strings.Split(*output.Label, " ") + // check timestamp to make sure metrics come from the same timestamp + if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > 0 && output.Timestamps[0] == timestamp { + mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[0]) } } } diff --git a/x-pack/metricbeat/module/aws/s3_request/s3_request.go b/x-pack/metricbeat/module/aws/s3_request/s3_request.go index 07c094f9aac6..dec90d7709c1 100644 --- a/x-pack/metricbeat/module/aws/s3_request/s3_request.go +++ b/x-pack/metricbeat/module/aws/s3_request/s3_request.go @@ -207,16 +207,13 @@ func createS3RequestEvents(outputs []cloudwatch.MetricDataResult, regionName str mapOfMetricSetFieldResults := make(map[string]interface{}) // Find a timestamp for all metrics in output - timestamp := aws.FindTimestamp(outputs) - if !timestamp.IsZero() { + if len(outputs) > 0 && len(outputs[0].Timestamps) > 0 { + timestamp := outputs[0].Timestamps[0] for _, output := range outputs { - exists, timestampIdx := aws.InArray(timestamp, output.Timestamps) - if exists { - labels := strings.Split(*output.Label, " ") - // check timestamp to make sure metrics come from the same timestamp - if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > timestampIdx { - mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[timestampIdx]) - } + labels := strings.Split(*output.Label, " ") + // check timestamp to make sure metrics come from the same timestamp + if len(labels) == 3 && labels[0] == bucketName && len(output.Values) > 0 && output.Timestamps[0] == timestamp { + mapOfMetricSetFieldResults[labels[2]] = fmt.Sprint(output.Values[0]) } } } diff --git a/x-pack/metricbeat/module/aws/utils.go b/x-pack/metricbeat/module/aws/utils.go index 97bff9fdf5c0..e66ad82d6057 100644 --- a/x-pack/metricbeat/module/aws/utils.go +++ b/x-pack/metricbeat/module/aws/utils.go @@ -5,7 +5,6 @@ package aws import ( - "reflect" "time" "github.com/aws/aws-sdk-go-v2/service/cloudwatch" @@ -85,49 +84,3 @@ func GetMetricDataResults(metricDataQueries []cloudwatch.MetricDataQuery, svc cl func EventMapping(input map[string]interface{}, schema s.Schema) (common.MapStr, error) { return schema.Apply(input, s.FailOnRequired) } - -// InArray checks if input val exists in array and if it exists, return the position. -func InArray(val interface{}, array interface{}) (exists bool, index int) { - exists = false - index = -1 - - switch reflect.TypeOf(array).Kind() { - case reflect.Slice: - s := reflect.ValueOf(array) - - for i := 0; i < s.Len(); i++ { - if reflect.DeepEqual(val, s.Index(i).Interface()) == true { - index = i - exists = true - return - } - } - } - return -} - -func FindTimestamp(getMetricDataResults []cloudwatch.MetricDataResult) time.Time { - timestamp := time.Time{} - for _, output := range getMetricDataResults { - // When there are outputs with one timestamp, use this timestamp. - if output.Timestamps != nil && len(output.Timestamps) == 1 { - // Use the first timestamp from Timestamps field to collect the latest data. - timestamp = output.Timestamps[0] - break - } - } - - // When there is no output with one timestamp, use the latest timestamp from timestamp list. - if timestamp.IsZero() { - for _, output := range getMetricDataResults { - // When there are outputs with one timestamp, use this timestamp - if output.Timestamps != nil && len(output.Timestamps) > 1 { - // Example Timestamps: [2019-03-11 17:36:00 +0000 UTC,2019-03-11 17:31:00 +0000 UTC] - timestamp = output.Timestamps[0] - break - } - } - } - - return timestamp -} From 61bcd9e9455cfa3ae2dfdb0afbf73dc2fe72bccf Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 11 Mar 2019 16:52:14 -0600 Subject: [PATCH 12/17] Remove extra line --- .../metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go | 1 - x-pack/metricbeat/module/aws/s3_request/s3_request.go | 1 - 2 files changed, 2 deletions(-) diff --git a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go index f0c576c346da..7110018bbf04 100644 --- a/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go +++ b/x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage.go @@ -204,7 +204,6 @@ func createCloudWatchEvents(outputs []cloudwatch.MetricDataResult, regionName st // AWS s3_daily_storage metrics mapOfMetricSetFieldResults := make(map[string]interface{}) - // Find a timestamp for all metrics in output if len(outputs) > 0 && len(outputs[0].Timestamps) > 0 { timestamp := outputs[0].Timestamps[0] diff --git a/x-pack/metricbeat/module/aws/s3_request/s3_request.go b/x-pack/metricbeat/module/aws/s3_request/s3_request.go index dec90d7709c1..67f2cd32425c 100644 --- a/x-pack/metricbeat/module/aws/s3_request/s3_request.go +++ b/x-pack/metricbeat/module/aws/s3_request/s3_request.go @@ -205,7 +205,6 @@ func createS3RequestEvents(outputs []cloudwatch.MetricDataResult, regionName str // AWS s3_request metrics mapOfMetricSetFieldResults := make(map[string]interface{}) - // Find a timestamp for all metrics in output if len(outputs) > 0 && len(outputs[0].Timestamps) > 0 { timestamp := outputs[0].Timestamps[0] From 0db0c1371e7e3bfae1f1c7d0146c76052997554b Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 11 Mar 2019 17:15:29 -0600 Subject: [PATCH 13/17] Change sqs timestamp code back --- .../metricbeat/module/aws/sqs/_meta/data.json | 12 ++++++--- x-pack/metricbeat/module/aws/sqs/sqs.go | 25 ++++++------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/x-pack/metricbeat/module/aws/sqs/_meta/data.json b/x-pack/metricbeat/module/aws/sqs/_meta/data.json index 7d3f1d6d6a68..8611c17c945f 100644 --- a/x-pack/metricbeat/module/aws/sqs/_meta/data.json +++ b/x-pack/metricbeat/module/aws/sqs/_meta/data.json @@ -9,13 +9,17 @@ "not_visible": 0, "received": 0, "sent": 0, - "visible": 45 + "visible": 80 }, "oldest_message_age": { - "sec": 82247 + "sec": 83991 }, - "queue.name": "elb-log-queue-20171218185917658900000001", - "sent_message_size": {} + "queue": { + "name": "elb-log-queue-20171218185917658900000001" + }, + "sent_message_size": { + "bytes": 976 + } } }, "cloud": { diff --git a/x-pack/metricbeat/module/aws/sqs/sqs.go b/x-pack/metricbeat/module/aws/sqs/sqs.go index 230e7f48e635..90bb52a929ae 100644 --- a/x-pack/metricbeat/module/aws/sqs/sqs.go +++ b/x-pack/metricbeat/module/aws/sqs/sqs.go @@ -191,24 +191,15 @@ func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, queueNa // AWS sqs metrics mapOfMetricSetFieldResults := make(map[string]interface{}) - - // Find a timestamp for all metrics in output - timestamp := aws.FindTimestamp(getMetricDataResults) - if !timestamp.IsZero() { - for _, output := range getMetricDataResults { - if len(output.Values) == 0 { - continue - } - - exists, timestampIdx := aws.InArray(timestamp, output.Timestamps) - if exists { - labels := strings.Split(*output.Label, " ") - // check timestamp to make sure metrics come from the same timestamp - if len(labels) == 2 && labels[0] == queueName && len(output.Values) > timestampIdx { - mapOfMetricSetFieldResults[labels[1]] = fmt.Sprint(output.Values[timestampIdx]) - } - } + for _, output := range getMetricDataResults { + if len(output.Values) == 0 { + continue + } + labels := strings.Split(*output.Label, " ") + if labels[0] != queueName { + continue } + mapOfMetricSetFieldResults[labels[1]] = fmt.Sprint(output.Values[0]) } resultMetricSetFields, err := aws.EventMapping(mapOfMetricSetFieldResults, schemaMetricFields) From 6a603f7a5342fa8f573ce8ce1fff06d5e33ca088 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Tue, 12 Mar 2019 11:37:01 -0600 Subject: [PATCH 14/17] Move looping through each queueURL into a separate function --- x-pack/metricbeat/module/aws/sqs/sqs.go | 31 ++++++++++++++----------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/x-pack/metricbeat/module/aws/sqs/sqs.go b/x-pack/metricbeat/module/aws/sqs/sqs.go index 90bb52a929ae..49f7f280750f 100644 --- a/x-pack/metricbeat/module/aws/sqs/sqs.go +++ b/x-pack/metricbeat/module/aws/sqs/sqs.go @@ -122,18 +122,7 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) { } // Create Cloudwatch Events for SQS - for _, queueURL := range queueURLs { - queueURLParsed := strings.Split(queueURL, "/") - queueName := queueURLParsed[len(queueURLParsed)-1] - event, err := createSQSEvents(metricDataResults, queueName, metricsetName, regionName, schemaRequestFields) - if err != nil { - m.logger.Error(err.Error()) - event.Error = err - report.Event(event) - continue - } - report.Event(event) - } + createSQSEvents(queueURLs, metricDataResults, regionName, report) } } @@ -144,7 +133,7 @@ func getQueueUrls(svc sqsiface.SQSAPI) ([]string, error) { output, err := req.Send() if err != nil { err = errors.Wrap(err, "Error DescribeInstances") - return []string{}, err + return nil, err } return output.QueueUrls, nil } @@ -183,7 +172,7 @@ func createMetricDataQuery(metric cloudwatch.Metric, index int, period int64) (m return } -func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, queueName string, metricsetName string, regionName string, schemaMetricFields s.Schema) (event mb.Event, err error) { +func createEventPerQueue(getMetricDataResults []cloudwatch.MetricDataResult, queueName string, metricsetName string, regionName string, schemaMetricFields s.Schema) (event mb.Event, err error) { event.Service = metricsetName event.RootFields = common.MapStr{} event.RootFields.Put("service.name", metricsetName) @@ -212,3 +201,17 @@ func createSQSEvents(getMetricDataResults []cloudwatch.MetricDataResult, queueNa event.MetricSetFields.Put("queue.name", queueName) return } + +func createSQSEvents(queueURLs []string, metricDataResults []cloudwatch.MetricDataResult, regionName string, report mb.ReporterV2) { + for _, queueURL := range queueURLs { + queueURLParsed := strings.Split(queueURL, "/") + queueName := queueURLParsed[len(queueURLParsed)-1] + event, err := createEventPerQueue(metricDataResults, queueName, metricsetName, regionName, schemaRequestFields) + if err != nil { + event.Error = err + report.Event(event) + continue + } + report.Event(event) + } +} From c3f75a50da8595eaa235029c004256d491f6ff03 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Wed, 13 Mar 2019 07:32:11 -0600 Subject: [PATCH 15/17] Rebase and rerun mage update --- x-pack/metricbeat/module/aws/fields.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/metricbeat/module/aws/fields.go b/x-pack/metricbeat/module/aws/fields.go index 90d188ed156f..290afe60557a 100644 --- a/x-pack/metricbeat/module/aws/fields.go +++ b/x-pack/metricbeat/module/aws/fields.go @@ -19,5 +19,5 @@ func init() { // AssetAws returns asset data. // This is the base64 encoded gzipped contents of module/aws. func AssetAws() string { - return "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" + return "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" } From ac1d771c855c53c40a9151bac8d38e77182f98c6 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Wed, 13 Mar 2019 07:47:42 -0600 Subject: [PATCH 16/17] Rerun make collect-docs --- metricbeat/docs/fields.asciidoc | 10 +++++----- x-pack/metricbeat/module/aws/fields.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 07fac3e6b0d9..ae54bcd978bf 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -1326,7 +1326,7 @@ The approximate age of the oldest non-deleted message in the queue. -- -*`aws.sqs.message.delayed`*:: +*`aws.sqs.messages.delayed`*:: + -- type: long @@ -1346,7 +1346,7 @@ The number of messages that are in flight. -- -*`aws.sqs.message.visible`*:: +*`aws.sqs.messages.visible`*:: + -- type: long @@ -1356,7 +1356,7 @@ The number of messages available for retrieval from the queue. -- -*`aws.sqs.message.deleted`*:: +*`aws.sqs.messages.deleted`*:: + -- type: long @@ -1366,7 +1366,7 @@ The number of messages deleted from the queue. -- -*`aws.sqs.message.received`*:: +*`aws.sqs.messages.received`*:: + -- type: long @@ -1376,7 +1376,7 @@ The number of messages returned by calls to the ReceiveMessage action. -- -*`aws.sqs.message.sent`*:: +*`aws.sqs.messages.sent`*:: + -- type: long diff --git a/x-pack/metricbeat/module/aws/fields.go b/x-pack/metricbeat/module/aws/fields.go index 290afe60557a..5c516f850f4f 100644 --- a/x-pack/metricbeat/module/aws/fields.go +++ b/x-pack/metricbeat/module/aws/fields.go @@ -19,5 +19,5 @@ func init() { // AssetAws returns asset data. // This is the base64 encoded gzipped contents of module/aws. func AssetAws() string { - return "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" + return "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" } From f2c3a137d70cffe0fe6f4884438d7c1cb694e631 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Wed, 13 Mar 2019 08:12:24 -0600 Subject: [PATCH 17/17] Rerun make collect-docs --- metricbeat/docs/fields.asciidoc | 2 +- x-pack/metricbeat/module/aws/fields.go | 2 +- x-pack/metricbeat/module/aws/sqs/_meta/fields.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index ae54bcd978bf..08d67cceeed2 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -1336,7 +1336,7 @@ TThe number of messages in the queue that are delayed and not available for read -- -*`aws.sqs.message.not_visible`*:: +*`aws.sqs.messages.not_visible`*:: + -- type: long diff --git a/x-pack/metricbeat/module/aws/fields.go b/x-pack/metricbeat/module/aws/fields.go index 5c516f850f4f..5d5ff0faf277 100644 --- a/x-pack/metricbeat/module/aws/fields.go +++ b/x-pack/metricbeat/module/aws/fields.go @@ -19,5 +19,5 @@ func init() { // AssetAws returns asset data. // This is the base64 encoded gzipped contents of module/aws. func AssetAws() string { - return "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" + return "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" } diff --git a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml index b579faf80522..1e36b2465741 100644 --- a/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml +++ b/x-pack/metricbeat/module/aws/sqs/_meta/fields.yml @@ -12,7 +12,7 @@ type: long description: > TThe number of messages in the queue that are delayed and not available for reading immediately. - - name: message.not_visible + - name: messages.not_visible type: long description: > The number of messages that are in flight.