Class: Aws::Sigv4::Request

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sigv4/lib/aws-sigv4/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Request

Returns a new instance of Request.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :http_method (required, String)
  • :endpoint (required, HTTP::URI, HTTPS::URI, String)
  • :headers (Hash<String,String>) — default: {}
  • :body (String, IO) — default: ''


13
14
15
16
17
18
19
20
21
# File 'gems/aws-sigv4/lib/aws-sigv4/request.rb', line 13

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

Instance Method Details

#bodyString, IO

Returns:

  • (String, IO)


59
60
61
# File 'gems/aws-sigv4/lib/aws-sigv4/request.rb', line 59

def body
  @body
end

#body=(body) ⇒ Object

Parameters:

  • body (String, IO)


54
55
56
# File 'gems/aws-sigv4/lib/aws-sigv4/request.rb', line 54

def body=(body)
  @body = body
end

#endpointHTTP::URI, HTTPS::URI

Returns:

  • (HTTP::URI, HTTPS::URI)


39
40
41
# File 'gems/aws-sigv4/lib/aws-sigv4/request.rb', line 39

def endpoint
  @endpoint
end

#endpoint=(endpoint) ⇒ Object

Parameters:

  • endpoint (String, HTTP::URI, HTTPS::URI)


34
35
36
# File 'gems/aws-sigv4/lib/aws-sigv4/request.rb', line 34

def endpoint=(endpoint)
  @endpoint = URI.parse(endpoint.to_s)
end

#headersHash<String,String>

Returns:

  • (Hash<String,String>)


49
50
51
# File 'gems/aws-sigv4/lib/aws-sigv4/request.rb', line 49

def headers
  @headers
end

#headers=(headers) ⇒ Object

Parameters:

  • headers (Hash)


44
45
46
# File 'gems/aws-sigv4/lib/aws-sigv4/request.rb', line 44

def headers=(headers)
  @headers = headers
end

#http_methodString

Returns One of 'GET', 'PUT', 'POST', 'DELETE', 'HEAD', or 'PATCH'.

Returns:

  • (String)

    One of 'GET', 'PUT', 'POST', 'DELETE', 'HEAD', or 'PATCH'



29
30
31
# File 'gems/aws-sigv4/lib/aws-sigv4/request.rb', line 29

def http_method
  @http_method
end

#http_method=(http_method) ⇒ Object

Parameters:

  • http_method (String)

    One of 'GET', 'PUT', 'POST', 'DELETE', 'HEAD', or 'PATCH'



24
25
26
# File 'gems/aws-sigv4/lib/aws-sigv4/request.rb', line 24

def http_method=(http_method)
  @http_method = http_method
end