def initialize(options={})
require_mime_types
@use_iam_profile = options[:use_iam_profile]
@instrumentor = options[:instrumentor]
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.storage'
@connection_options = options[:connection_options] || {}
@persistent = options.fetch(:persistent, false)
@signature_version = options.fetch(:aws_signature_version, 4)
validate_signature_version!
@path_style = options[:path_style] || false
@region = options[:region] || DEFAULT_REGION
if @endpoint = options[:endpoint]
endpoint = URI.parse(@endpoint)
@host = endpoint.host
@scheme = endpoint.scheme
@port = endpoint.port
else
@host = options[:host] || region_to_host(@region)
@scheme = options[:scheme] || DEFAULT_SCHEME
@port = options[:port] || DEFAULT_SCHEME_PORT[@scheme]
end
setup_credentials(options)
end