module Aws

Constants

API_DIR

@api private

SERVICE_MODULE_NAMES

@api private services

VERSION

Attributes

config[R]

@return [Hash] Returns a hash of default configuration options shared

by all constructed clients.

Public Class Methods

add_service(svc_name, options = {}) click to toggle source

Registers a new service.

Aws.add_service('SvcName',
  api: '/path/to/svc.api.json',
  paginators: '/path/to/svc.paginators.json',
  waiters: '/path/to/svc.waiters.json',
  resources: '/path/to/svc.resources.json')

Aws::SvcName::Client.new
#=> #<Aws::SvcName::Client>

@param [String] svc_name The name of the service. This will also be

the namespace under {Aws}. This must be a valid constant name.

@option options :api @option options :paginators @option options :waiters @option options :resources @return [Module<Service>] Returns the new service module.

# File lib/aws-sdk-core.rb, line 251
def add_service(svc_name, options = {})
  svc_module = Module.new { extend Service }
  const_set(svc_name, svc_module)
  @services[svc_name] = [svc_module, options]
  @service_added_callbacks.each do |callback|
    callback.call(svc_name.to_s, *@services[svc_name])
  end
  svc_module
end
config=(config) click to toggle source

@param [Hash] config

# File lib/aws-sdk-core.rb, line 208
def config=(config)
  if Hash === config
    @config = config
  else
    raise ArgumentError, 'configuration object must be a hash'
  end
end
load_all_services() click to toggle source

@api private

# File lib/aws-sdk-core.rb, line 262
def load_all_services
  SERVICE_MODULE_NAMES.each do |const_name|
    const_get(const_name)
  end
end
load_json(path) click to toggle source

@api private

# File lib/aws-sdk-core.rb, line 229
def load_json(path)
  Seahorse::Util.load_json(path)
end
service_added() { |svc_name, svc_module, options| ... } click to toggle source

Yields to the given block for each service that has already been defined via {add_service}. Also yields to the given block for each new service added after the callback is registered. @api private

# File lib/aws-sdk-core.rb, line 220
def service_added(&block)
  callback = Proc.new
  @services.each do |svc_name, (svc_module, options)|
    yield(svc_name, svc_module, options)
  end
  @service_added_callbacks << callback
end