// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.

package sqs

import (
	"context"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)

// 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)
}

// 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"`

	// 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)
}

const opListDeadLetterSourceQueues = "ListDeadLetterSourceQueues"

// 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 ListDeadLetterSourceQueuesRequest.
//    req := client.ListDeadLetterSourceQueuesRequest(params)
//    resp, err := req.Send(context.TODO())
//    if err == nil {
//        fmt.Println(resp)
//    }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueues
func (c *Client) ListDeadLetterSourceQueuesRequest(input *ListDeadLetterSourceQueuesInput) ListDeadLetterSourceQueuesRequest {
	op := &aws.Operation{
		Name:       opListDeadLetterSourceQueues,
		HTTPMethod: "POST",
		HTTPPath:   "/",
	}

	if input == nil {
		input = &ListDeadLetterSourceQueuesInput{}
	}

	req := c.newRequest(op, input, &ListDeadLetterSourceQueuesOutput{})
	return ListDeadLetterSourceQueuesRequest{Request: req, Input: input, Copy: c.ListDeadLetterSourceQueuesRequest}
}

// ListDeadLetterSourceQueuesRequest is the 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(ctx context.Context) (*ListDeadLetterSourceQueuesResponse, error) {
	r.Request.SetContext(ctx)
	err := r.Request.Send()
	if err != nil {
		return nil, err
	}

	resp := &ListDeadLetterSourceQueuesResponse{
		ListDeadLetterSourceQueuesOutput: r.Request.Data.(*ListDeadLetterSourceQueuesOutput),
		response:                         &aws.Response{Request: r.Request},
	}

	return resp, nil
}

// ListDeadLetterSourceQueuesResponse is the response type for the
// ListDeadLetterSourceQueues API operation.
type ListDeadLetterSourceQueuesResponse struct {
	*ListDeadLetterSourceQueuesOutput

	response *aws.Response
}

// SDKResponseMetdata returns the response metadata for the
// ListDeadLetterSourceQueues request.
func (r *ListDeadLetterSourceQueuesResponse) SDKResponseMetdata() *aws.Response {
	return r.response
}
