module Aws::Api::ServiceCustomizations
Public Instance Methods
apply(client_class)
click to toggle source
Applies customizations registered for the service client. Customizations are registered by the service endpoint prefix. @param [Class<Seahorse::Client::Base>] client_class @return [void] @see {#customize} @see {Customizer}
# File lib/aws-sdk-core/api/service_customizations.rb, line 29 def apply(client_class) apply_protocol_plugin(client_class) endpoint_prefix = client_class.api.metadata('endpointPrefix') @customizations[endpoint_prefix].each do |customization| Customizer.new(client_class).apply(&customization) end end
customize(endpoint_prefix, &block)
click to toggle source
Registers a list of customizations to apply during API translation.
ServiceCustomizations.customize('s3') do plugin 'MyCustomPlugin' end
The block is evaluated by an instance of {Customizer}. @param [String] endpoint_prefix @return [void] @see {Customizer}
# File lib/aws-sdk-core/api/service_customizations.rb, line 19 def customize(endpoint_prefix, &block) @customizations[endpoint_prefix] << block end
Private Instance Methods
apply_protocol_plugin(client_class)
click to toggle source
# File lib/aws-sdk-core/api/service_customizations.rb, line 39 def apply_protocol_plugin(client_class) protocol = client_class.api.metadata('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 end