@staticmethod<EOL><INDENT>def _construct_event(flask_request, port, binary_types):<DEDENT>
identity = ContextIdentity(source_ip=flask_request.remote_addr)<EOL>endpoint = PathConverter.convert_path_to_api_gateway(flask_request.endpoint)<EOL>method = flask_request.method<EOL>request_data = flask_request.get_data()<EOL>request_mimetype = flask_request.mimetype<EOL>is_base_64 = LocalApigwService._should_base64_encode(binary_types, request_mimetype)<EOL>if is_base_64:<EOL><INDENT>LOG.debug("<STR_LIT>")<EOL>request_data = base64.b64encode(request_data)<EOL><DEDENT>if request_data:<EOL><INDENT>request_data = request_data.decode('<STR_LIT:utf-8>')<EOL><DEDENT>context = RequestContext(resource_path=endpoint,<EOL>http_method=method,<EOL>stage="<STR_LIT>",<EOL>identity=identity,<EOL>path=endpoint)<EOL>event_headers = dict(flask_request.headers)<EOL>event_headers["<STR_LIT>"] = flask_request.scheme<EOL>event_headers["<STR_LIT>"] = str(port)<EOL>query_string_dict = LocalApigwService._query_string_params(flask_request)<EOL>event = ApiGatewayLambdaEvent(http_method=method,<EOL>body=request_data,<EOL>resource=endpoint,<EOL>request_context=context,<EOL>query_string_params=query_string_dict,<EOL>headers=event_headers,<EOL>path_parameters=flask_request.view_args,<EOL>path=flask_request.path,<EOL>is_base_64_encoded=is_base_64)<EOL>event_str = json.dumps(event.to_dict())<EOL>LOG.debug("<STR_LIT>", event_str)<EOL>return event_str<EOL>
Helper method that constructs the Event to be passed to Lambda

:param request flask_request: Flask Request
:return: String representing the event