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

Inherits:
Seahorse::Client::Handler show all
Defined in:
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



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File '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