Sha256: c3f8b17ba9d6b5f662c004ae8489e5a2414db5125014f7fcd0970836c6650b97

Contents?: true

Size: 1003 Bytes

Versions: 152

Compression:

Stored size: 1003 Bytes

Contents

# frozen_string_literal: true

module Aws
  # @api private
  module Plugins
    # @api private
    class DefaultsMode < Seahorse::Client::Plugin

      option(:defaults_mode,
             default: 'legacy',
             doc_type: String,
             docstring: <<-DOCS
See {Aws::DefaultsModeConfiguration} for a list of the 
accepted modes and the configuration defaults that are included.
      DOCS
      ) do |cfg|
        resolve_defaults_mode(cfg)
      end

      option(:defaults_mode_config_resolver,
             doc_type: 'Aws::DefaultsModeConfigResolver') do |cfg|
        Aws::DefaultsModeConfigResolver.new(
          Aws::DefaultsModeConfiguration::SDK_DEFAULT_CONFIGURATION, cfg)
      end

      class << self
        private

        def resolve_defaults_mode(cfg)
          value = ENV['AWS_DEFAULTS_MODE']
          value ||= Aws.shared_config.defaults_mode(
            profile: cfg.profile
          )
          value&.downcase || "legacy"
        end
      end

    end
  end
end

Version data entries

152 entries across 152 versions & 1 rubygems

Version Path
aws-sdk-core-3.128.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.127.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.126.2 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.126.1 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.126.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.125.6 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.125.5 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.125.4 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.125.3 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.125.2 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.125.1 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.125.0 lib/aws-sdk-core/plugins/defaults_mode.rb