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

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

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.

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.



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

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.



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

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.



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

def update_region(context, queue_url)
  if queue_region = queue_url.to_s.split('.')[1]
    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