Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::Plugins::EndpointDiscovery::Handler

Inherits:
Seahorse::Client::Handler show all
Defined in:
aws-sdk-core/lib/aws-sdk-core/plugins/endpoint_discovery.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Handler

#handler

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Handler

#initialize, #inspect

Constructor Details

This class inherits a constructor from Seahorse::Client::Handler

Instance Method Details

#call(context) ⇒ Object

[View source]

53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'aws-sdk-core/lib/aws-sdk-core/plugins/endpoint_discovery.rb', line 53

def call(context)
  if context.operation.endpoint_operation
    context.http_request.headers['x-amz-api-version'] = context.config.api.version
    _apply_endpoint_discovery_user_agent(context)
  elsif discovery_cfg = context.operation.endpoint_discovery
    endpoint = _discover_endpoint(
      context,
      str_2_bool(discovery_cfg["required"])
    )
    context.http_request.endpoint = _valid_uri(endpoint.address) if endpoint
    if endpoint || context.config.endpoint_discovery
      _apply_endpoint_discovery_user_agent(context)
    end
  end
  @handler.call(context)
end