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

Class: Seahorse::Client::Plugin

Inherits:
Object
  • Object
show all
Extended by:
HandlerBuilder
Defined in:
aws-sdk-core/lib/seahorse/client/plugin.rb

Direct Known Subclasses

Aws::Plugins::CSDConditionalSigning, Aws::Plugins::CSDSwitchToPost, Aws::Plugins::DynamoDBCRC32Validation, Aws::Plugins::DynamoDBExtendedRetries, Aws::Plugins::DynamoDBSimpleAttributes, Aws::Plugins::EC2CopyEncryptedSnapshot, Aws::Plugins::EndpointDiscovery, Aws::Plugins::EndpointPattern, Aws::Plugins::GlacierAccountId, Aws::Plugins::GlacierApiVersion, Aws::Plugins::GlacierChecksums, Aws::Plugins::GlobalConfiguration, Aws::Plugins::IdempotencyToken, Aws::Plugins::JsonvalueConverter, Aws::Plugins::Logging, Aws::Plugins::ParamConverter, Aws::Plugins::ParamValidator, Aws::Plugins::Protocols::EC2, Aws::Plugins::Protocols::JsonRpc, Aws::Plugins::Protocols::Query, Aws::Plugins::Protocols::RestJson, Aws::Plugins::Protocols::RestXml, Aws::Plugins::RDSCrossRegionCopying, Aws::Plugins::RegionalEndpoint, Aws::Plugins::RequestSigner, Aws::Plugins::ResponsePaging, Aws::Plugins::RetryErrors, Aws::Plugins::Route53IdFix, Aws::Plugins::S3Accelerate, Aws::Plugins::S3BucketDns, Aws::Plugins::S3ControlDns, Aws::Plugins::S3Expect100Continue, Aws::Plugins::S3GetBucketLocationFix, Aws::Plugins::S3IADRegionalEndpoint, Aws::Plugins::S3LocationConstraint, Aws::Plugins::S3Md5s, Aws::Plugins::S3Redirects, Aws::Plugins::S3SseCpk, Aws::Plugins::S3UrlEncodedKeys, Aws::Plugins::SQSMd5s, Aws::Plugins::STSRegionalEndpoints, Aws::Plugins::SWFReadTimeouts, Aws::Plugins::StubResponses, Aws::Plugins::UserAgent, Seahorse::Client::Plugins::ContentLength, Seahorse::Client::Plugins::Endpoint, Seahorse::Client::Plugins::Logging, Seahorse::Client::Plugins::NetHttp, Seahorse::Client::Plugins::OperationMethods, Seahorse::Client::Plugins::RaiseResponseErrors

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HandlerBuilder

handle, handle_request, handle_response

Class Method Details

.after_initialize(&block) ⇒ Object



53
54
55
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 53

def after_initialize(&block)
  after_initialize_hooks << block
end

.before_initialize(&block) ⇒ Object



49
50
51
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 49

def before_initialize(&block)
  before_initialize_hooks << block
end

.option(name, default = nil, &block) ⇒ Object



41
42
43
44
45
46
47
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 41

def option(name, default = nil, &block)
  if block_given?
    options << [[name], block]
  else
    options << [[name, default]]
  end
end

Instance Method Details

#add_handlers(handlers, config) ⇒ void

This method returns an undefined value.

Parameters:



18
19
20
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 18

def add_handlers(handlers, config)
  handlers.copy_from(self.class.handlers)
end

#add_options(config) ⇒ void

This method returns an undefined value.

Parameters:



9
10
11
12
13
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 9

def add_options(config)
  self.class.options.each do |args, block|
    config.add_option(*args, &block)
  end
end

#after_initialize(client) ⇒ void

This method returns an undefined value.

Parameters:



33
34
35
36
37
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 33

def after_initialize(client)
  self.class.after_initialize_hooks.each do |block|
    block.call(client)
  end
end

#before_initialize(client_class, options) ⇒ void

This method returns an undefined value.

Parameters:



25
26
27
28
29
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 25

def before_initialize(client_class, options)
  self.class.before_initialize_hooks.each do |block|
    block.call(client_class, options)
  end
end