Sha256: f182ef537879b83d2a046760ae5c692e37f5ec46ec8416b9615a5f715b97eb55

Contents?: true

Size: 1.2 KB

Versions: 34

Compression:

Stored size: 1.2 KB

Contents

module Fog
  module AWS
    module S3
      class Real

        # Get configured payer for an S3 bucket
        #
        # ==== Parameters
        # * bucket_name<~String> - name of bucket to get payer for
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'Payer'<~String> - Specifies who pays for download and requests
        def get_request_payment(bucket_name)
          request({
            :expects  => 200,
            :headers  => {},
            :host     => "#{bucket_name}.#{@host}",
            :idempotent => true,
            :method   => 'GET',
            :parser   => Fog::Parsers::AWS::S3::GetRequestPayment.new,
            :query    => 'requestPayment'
          })
        end

      end

      class Mock

        def get_request_payment(bucket_name)
          response = Excon::Response.new
          if bucket = @data[:buckets][bucket_name]
            response.status = 200
            response.body = { 'Payer' => bucket['Payer'] }
          else
            response.status = 404
            raise(Excon::Errors.status_error({:expects => 200}, response))
          end
          response
        end

      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
fog-0.1.5 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.1.4 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.1.3 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.1.2 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.1.1 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.1.0 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.100 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.99 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.98 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.97 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.96 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.95 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.94 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.93 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.92 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.91 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.90 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.89 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.88 lib/fog/aws/requests/s3/get_request_payment.rb
fog-0.0.87 lib/fog/aws/requests/s3/get_request_payment.rb