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(<<-METRICS)
  {
    "RESOURCE_MODEL": "A",
    "WAITER": "B",
    "PAGINATOR": "C",
    "RETRY_MODE_LEGACY": "D",
    "RETRY_MODE_STANDARD": "E",
    "RETRY_MODE_ADAPTIVE": "F",
    "S3_TRANSFER": "G",
    "S3_CRYPTO_V1N": "H",
    "S3_CRYPTO_V2": "I",
    "S3_EXPRESS_BUCKET": "J",
    "S3_ACCESS_GRANTS": "K",
    "GZIP_REQUEST_COMPRESSION": "L",
    "PROTOCOL_RPC_V2_CBOR": "M",
    "ENDPOINT_OVERRIDE": "N",
    "ACCOUNT_ID_ENDPOINT": "O",
    "ACCOUNT_ID_MODE_PREFERRED": "P",
    "ACCOUNT_ID_MODE_DISABLED": "Q",
    "ACCOUNT_ID_MODE_REQUIRED": "R",
    "SIGV4A_SIGNING": "S",
    "RESOLVED_ACCOUNT_ID": "T",
    "FLEXIBLE_CHECKSUMS_REQ_CRC32" : "U",
    "FLEXIBLE_CHECKSUMS_REQ_CRC32C" : "V",
    "FLEXIBLE_CHECKSUMS_REQ_CRC64" : "W",
    "FLEXIBLE_CHECKSUMS_REQ_SHA1" : "X",
    "FLEXIBLE_CHECKSUMS_REQ_SHA256" : "Y",
    "FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED" : "Z",
    "FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED" : "a",
    "FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED" : "b",
    "FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED" : "c",
    "DDB_MAPPER": "d",
    "CREDENTIALS_CODE" : "e",
    "CREDENTIALS_ENV_VARS" : "g",
    "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN" : "h",
    "CREDENTIALS_STS_ASSUME_ROLE" : "i",
    "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID" : "k",
    "CREDENTIALS_PROFILE" : "n",
    "CREDENTIALS_PROFILE_SOURCE_PROFILE" : "o",
    "CREDENTIALS_PROFILE_NAMED_PROVIDER" : "p",
    "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN" : "q",
    "CREDENTIALS_PROFILE_SSO" : "r",
    "CREDENTIALS_SSO" : "s",
    "CREDENTIALS_PROFILE_SSO_LEGACY" : "t",
    "CREDENTIALS_SSO_LEGACY" : "u",
    "CREDENTIALS_PROFILE_PROCESS" : "v",
    "CREDENTIALS_PROCESS" : "w",
    "CREDENTIALS_HTTP" : "z",
    "CREDENTIALS_IMDS" : "0",
    "SSO_LOGIN_DEVICE" : "1",
    "SSO_LOGIN_AUTH" : "2"
  }
METRICS

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



81
82
83
# File 'lib/aws-sdk-core/plugins/user_agent.rb', line 81

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.



85
86
87
88
89
90
91
92
# File 'lib/aws-sdk-core/plugins/user_agent.rb', line 85

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