Module: Aws::Api::Customizations Private

Defined in:
lib/aws-sdk-core/api/customizations.rb

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

Class Method Summary collapse

Class Method Details

.api(prefix, &block) ⇒ 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
# File 'lib/aws-sdk-core/api/customizations.rb', line 10

def api(prefix, &block)
  @apis[prefix] = block
end

.apply_api_customizations(api) ⇒ 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.



21
22
23
24
25
# File 'lib/aws-sdk-core/api/customizations.rb', line 21

def apply_api_customizations(api)
   = api['metadata'] || {}
  prefix = ['endpointPrefix']
  @apis[prefix].call(api) if @apis[prefix]
end

.apply_plugins(client_class) ⇒ 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.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/aws-sdk-core/api/customizations.rb', line 27

def apply_plugins(client_class)
  protocol = client_class.api.['protocol']
  plugin = case protocol
    when 'ec2'       then Aws::Plugins::Protocols::EC2
    when 'query'     then Aws::Plugins::Protocols::Query
    when 'json'      then Aws::Plugins::Protocols::JsonRpc
    when 'rest-json' then Aws::Plugins::Protocols::RestJson
    when 'rest-xml'  then Aws::Plugins::Protocols::RestXml
  end
  client_class.add_plugin(plugin) if plugin
  prefix = client_class.api.['endpointPrefix']
  if @plugins[prefix]
    @plugins[prefix][:add].each { |p| client_class.add_plugin(p) }
    @plugins[prefix][:remove].each { |p| client_class.remove_plugin(p) }
  end
end

.plugins(prefix, options) ⇒ 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.



14
15
16
17
18
19
# File 'lib/aws-sdk-core/api/customizations.rb', line 14

def plugins(prefix, options)
  @plugins[prefix] = {
    add: options[:add] || [],
    remove: options[:remove] || [],
  }
end