Sha256: 68f141de645802b7e63bc7b0a3ac2644433222adcc09e7adfffc29c6e934efe2

Contents?: true

Size: 836 Bytes

Versions: 16

Compression:

Stored size: 836 Bytes

Contents

module Aws
  module Plugins
    class S3GetBucketLocationFix < Seahorse::Client::Plugin

      class Handler < Seahorse::Client::Handler

        def call(context)
          @handler.call(context).on(200) do |response|
            response.data = Structure.new([:location_constraint])
            xml = MultiXml.parse(context.http_response.body_contents)
            if constraint = xml['LocationConstraint']
              response.data[:location_constraint] =
                case constraint
                when String then constraint
                when Hash then constraint['__content__'].to_s
                end
            else
              response.data[:location_constraint] = ''
            end
          end
        end
      end

      handler(Handler, priority: 60, operations: [:get_bucket_location])

    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
aws-sdk-core-2.0.33 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.32 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.31 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.30 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.29 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.28 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.27 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.26 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.25 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.24 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.23 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.22 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.21 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.20 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.19 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
aws-sdk-core-2.0.18 lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb