Class: Seahorse::Client::Plugin

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

Direct Known Subclasses

Aws::Plugins::APIGatewayHeader, Aws::Plugins::CSDConditionalSigning, Aws::Plugins::CSDSwitchToPost, Aws::Plugins::DynamoDBCRC32Validation, Aws::Plugins::DynamoDBExtendedRetries, Aws::Plugins::DynamoDBSimpleAttributes, Aws::Plugins::EC2CopyEncryptedSnapshot, Aws::Plugins::EC2RegionValidation, Aws::Plugins::EndpointDiscovery, Aws::Plugins::EndpointPattern, Aws::Plugins::GlacierAccountId, Aws::Plugins::GlacierApiVersion, Aws::Plugins::GlacierChecksums, Aws::Plugins::GlobalConfiguration, Aws::Plugins::HelpfulSocketErrors, Aws::Plugins::IdempotencyToken, Aws::Plugins::JsonvalueConverter, Aws::Plugins::Logging, Aws::Plugins::MachineLearningPredictEndpoint, 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::S3BucketNameRestrictions, Aws::Plugins::S3ControlDns, Aws::Plugins::S3ControlDualstack, Aws::Plugins::S3ControlSigner, Aws::Plugins::S3Dualstack, Aws::Plugins::S3Expect100Continue, Aws::Plugins::S3GetBucketLocationFix, Aws::Plugins::S3HostId, Aws::Plugins::S3Http200Errors, Aws::Plugins::S3LocationConstraint, Aws::Plugins::S3Md5s, Aws::Plugins::S3Redirects, Aws::Plugins::S3RequestSigner, Aws::Plugins::S3SseCpk, Aws::Plugins::S3UrlEncodedKeys, Aws::Plugins::SQSMd5s, Aws::Plugins::SQSQueueUrls, 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, Seahorse::Client::Plugins::ResponseTarget, Seahorse::Client::Plugins::RestfulBindings

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HandlerBuilder

handle, handle_request, handle_response, handler_for, new_handler

Class Method Details

.after_initialize(&block) ⇒ Object



53
54
55
# File 'lib/seahorse/client/plugin.rb', line 53

def after_initialize(&block)
  after_initialize_hooks << block
end

.after_initialize_hooksObject

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.



73
74
75
# File 'lib/seahorse/client/plugin.rb', line 73

def after_initialize_hooks
  @after_initialize_hooks ||= []
end

.before_initialize(&block) ⇒ Object



49
50
51
# File 'lib/seahorse/client/plugin.rb', line 49

def before_initialize(&block)
  before_initialize_hooks << block
end

.before_initialize_hooksObject

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.



68
69
70
# File 'lib/seahorse/client/plugin.rb', line 68

def before_initialize_hooks
  @before_initialize_hooks ||= []
end

.handlersObject

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.



63
64
65
# File 'lib/seahorse/client/plugin.rb', line 63

def handlers
  @handlers ||= HandlerList.new
end

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



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

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

.optionsObject

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.



58
59
60
# File 'lib/seahorse/client/plugin.rb', line 58

def options
  @options ||= []
end

Instance Method Details

#add_handlers(handlers, config) ⇒ void

This method returns an undefined value.

Parameters:



18
19
20
# File '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 '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 '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 '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