Class: LambdaOpenApi::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/lambda_open_api/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEvent

Returns a new instance of Event.



16
17
18
# File 'lib/lambda_open_api/event.rb', line 16

def initialize
  @body = "{}"
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def body
  @body
end

#headersObject

Returns the value of attribute headers.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def headers
  @headers
end

#http_methodObject

Returns the value of attribute http_method.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def http_method
  @http_method
end

#is_base64_encodedObject

Returns the value of attribute is_base64_encoded.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def is_base64_encoded
  @is_base64_encoded
end

#multi_value_headersObject

Returns the value of attribute multi_value_headers.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def multi_value_headers
  @multi_value_headers
end

#multi_value_query_string_parametersObject

Returns the value of attribute multi_value_query_string_parameters.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def multi_value_query_string_parameters
  @multi_value_query_string_parameters
end

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def path
  @path
end

#path_parametersObject

Returns the value of attribute path_parameters.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def path_parameters
  @path_parameters
end

#query_string_parametersObject

Returns the value of attribute query_string_parameters.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def query_string_parameters
  @query_string_parameters
end

#request_contextObject

Returns the value of attribute request_context.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def request_context
  @request_context
end

#resourceObject

Returns the value of attribute resource.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def resource
  @resource
end

#stage_variablesObject

Returns the value of attribute stage_variables.



3
4
5
# File 'lib/lambda_open_api/event.rb', line 3

def stage_variables
  @stage_variables
end

Instance Method Details

#jsonObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/lambda_open_api/event.rb', line 20

def json
  {
    "resource" => resource,
    "path" => path,
    "httpMethod" => http_method,
    "requestContext" => request_context,
    "headers" => headers,
    "multiValueHeaders" => multi_value_headers,
    "queryStringParameters" => query_string_parameters,
    "multiValueQueryStringParameters" => multi_value_query_string_parameters,
    "pathParameters" => path_parameters,
    "stageVariables" => stage_variables,
    "body" => body,
    "isBase64Encoded" => is_base64_encoded,
    "rawPath" => path
  }
end