AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: Seahorse::Client::Plugins::Endpoint

Inherits:
Seahorse::Client::Plugin show all
Defined in:
gems/aws-sdk-core/lib/seahorse/client/plugins/endpoint.rb

Defined Under Namespace

Classes: Handler

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Plugin

#add_options, after_initialize, #before_initialize, before_initialize, option

Methods included from HandlerBuilder

#handle, #handle_request, #handle_response

Instance Method Details

#add_handlers(handlers, config) ⇒ Object



23
24
25
# File 'gems/aws-sdk-core/lib/seahorse/client/plugins/endpoint.rb', line 23

def add_handlers(handlers, config)
  handlers.add(Handler, priority: 90)
end

#after_initialize(client) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'gems/aws-sdk-core/lib/seahorse/client/plugins/endpoint.rb', line 27

def after_initialize(client)
  endpoint = client.config.endpoint
  if endpoint.nil?
    msg = "missing required option `:endpoint'"
    raise ArgumentError, msg
  end

  endpoint = URI.parse(endpoint.to_s)
  if URI::HTTPS === endpoint or URI::HTTP === endpoint
    client.config.endpoint = endpoint
  else
    msg = 'expected :endpoint to be a HTTP or HTTPS endpoint'
    raise ArgumentError, msg
  end
end