Class: Aws::Plugins::UserAgent Private

Inherits:
Seahorse::Client::Plugin show all
Defined in:
lib/aws-sdk-core/plugins/user_agent.rb

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

Defined Under Namespace

Classes: Handler

Constant Summary collapse

METRICS =

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

Aws::Json.load("  {\n    \"RESOURCE_MODEL\": \"A\",\n    \"WAITER\": \"B\",\n    \"PAGINATOR\": \"C\",\n    \"RETRY_MODE_LEGACY\": \"D\",\n    \"RETRY_MODE_STANDARD\": \"E\",\n    \"RETRY_MODE_ADAPTIVE\": \"F\",\n    \"S3_TRANSFER\": \"G\",\n    \"S3_CRYPTO_V1N\": \"H\",\n    \"S3_CRYPTO_V2\": \"I\",\n    \"S3_EXPRESS_BUCKET\": \"J\",\n    \"S3_ACCESS_GRANTS\": \"K\",\n    \"GZIP_REQUEST_COMPRESSION\": \"L\",\n    \"PROTOCOL_RPC_V2_CBOR\": \"M\",\n    \"ENDPOINT_OVERRIDE\": \"N\",\n    \"ACCOUNT_ID_ENDPOINT\": \"O\",\n    \"ACCOUNT_ID_MODE_PREFERRED\": \"P\",\n    \"ACCOUNT_ID_MODE_DISABLED\": \"Q\",\n    \"ACCOUNT_ID_MODE_REQUIRED\": \"R\",\n    \"SIGV4A_SIGNING\": \"S\",\n    \"RESOLVED_ACCOUNT_ID\": \"T\"\n  }\n")

Class Method Summary collapse

Methods inherited from Seahorse::Client::Plugin

#add_handlers, #add_options, after_initialize, #after_initialize, after_initialize_hooks, #before_initialize, before_initialize, before_initialize_hooks, handlers, literal, option, options

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response, #handler_for, #new_handler

Class Method Details

.feature(_feature, &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.

Deprecated - must exist for old service gems



52
53
54
# File 'lib/aws-sdk-core/plugins/user_agent.rb', line 52

def self.feature(_feature, &block)
  block.call
end

.metric(*metrics, &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.



56
57
58
59
60
61
62
63
# File 'lib/aws-sdk-core/plugins/user_agent.rb', line 56

def self.metric(*metrics, &block)
  Thread.current[:aws_sdk_core_user_agent_metric] ||= []
  metrics = metrics.map { |metric| METRICS[metric] }.compact
  Thread.current[:aws_sdk_core_user_agent_metric].concat(metrics)
  block.call
ensure
  Thread.current[:aws_sdk_core_user_agent_metric].pop(metrics.size)
end