Sha256: 8a723ae783f039baadd8541e210165d67f1ca42c8d2f2346580ca6b167e4333e

Contents?: true

Size: 1.44 KB

Versions: 17

Compression:

Stored size: 1.44 KB

Contents

# frozen_string_literal: true

require 'uri'

module Aws
  module Sigv4
    class Request

      # @option options [required, String] :http_method
      # @option options [required, HTTP::URI, HTTPS::URI, String] :endpoint
      # @option options [Hash<String,String>] :headers ({})
      # @option options [String, IO] :body ('')
      def initialize(options = {})
        @http_method = nil
        @endpoint = nil
        @headers = {}
        @body = ''
        options.each_pair do |attr_name, attr_value|
          send("#{attr_name}=", attr_value)
        end
      end

      # @param [String] http_method One of 'GET', 'PUT', 'POST', 'DELETE', 'HEAD', or 'PATCH'
      def http_method=(http_method)
        @http_method = http_method
      end

      # @return [String] One of 'GET', 'PUT', 'POST', 'DELETE', 'HEAD', or 'PATCH'
      def http_method
        @http_method
      end

      # @param [String, HTTP::URI, HTTPS::URI] endpoint
      def endpoint=(endpoint)
        @endpoint = URI.parse(endpoint.to_s)
      end

      # @return [HTTP::URI, HTTPS::URI]
      def endpoint
        @endpoint
      end

      # @param [Hash] headers
      def headers=(headers)
        @headers = headers
      end

      # @return [Hash<String,String>]
      def headers
        @headers
      end

      # @param [String, IO] body
      def body=(body)
        @body = body
      end

      # @return [String, IO]
      def body
        @body
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
aws-sigv4-1.10.1 lib/aws-sigv4/request.rb
aws-sigv4-1.10.0 lib/aws-sigv4/request.rb
aws-sigv4-1.9.1 lib/aws-sigv4/request.rb
aws-sigv4-1.9.0 lib/aws-sigv4/request.rb
aws-sigv4-1.8.0 lib/aws-sigv4/request.rb
aws-sigv4-1.7.0 lib/aws-sigv4/request.rb
aws-sigv4-1.6.1 lib/aws-sigv4/request.rb
aws-sigv4-1.6.0 lib/aws-sigv4/request.rb
aws-sigv4-1.5.2 lib/aws-sigv4/request.rb
aws-sigv4-1.5.1 lib/aws-sigv4/request.rb
aws-sigv4-1.5.0 lib/aws-sigv4/request.rb
aws-sigv4-1.4.0 lib/aws-sigv4/request.rb
aws-sigv4-1.3.0 lib/aws-sigv4/request.rb
aws-sigv4-1.2.4 lib/aws-sigv4/request.rb
aws-sigv4-1.2.3 lib/aws-sigv4/request.rb
aws-sigv4-1.2.2 lib/aws-sigv4/request.rb
aws-sigv4-1.2.1 lib/aws-sigv4/request.rb