Class: Aws::SQS::Plugins::QueueUrls::Handler Private

Inherits:
Seahorse::Client::Handler
  • Object
show all
Defined in:
lib/aws-sdk-sqs/plugins/queue_urls.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Extract region from a provided queue_url

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


10
11
12
13
14
15
16
# File 'lib/aws-sdk-sqs/plugins/queue_urls.rb', line 10

def call(context)
  if (queue_url = context.params[:queue_url])
    update_endpoint(context, queue_url)
    update_region(context, queue_url)
  end
  @handler.call(context)
end

#update_endpoint(context, url) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


18
19
20
# File 'lib/aws-sdk-sqs/plugins/queue_urls.rb', line 18

def update_endpoint(context, url)
  context.http_request.endpoint = url
end

#update_region(context, queue_url) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

If the region in the queue url is not the configured region, then we will modify the request to have a sigv4 signer for the proper region.


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/aws-sdk-sqs/plugins/queue_urls.rb', line 25

def update_region(context, queue_url)
  if (queue_region = parse_region(queue_url))
    if queue_region != context.config.region
      config = context.config.dup
      config.region = queue_region
      config.sigv4_region = queue_region
      config.sigv4_signer = Aws::Plugins::SignatureV4.build_signer(config)
      context.config = config
    end
  end
end