in.erail.amazon.lambda.eventsource.DefaultEventSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-framework-amazon-lambda Show documentation
Show all versions of api-framework-amazon-lambda Show documentation
Lib to run API Framework code on Amazon Lambda
package in.erail.amazon.lambda.eventsource;
import com.google.common.net.HttpHeaders;
import com.google.common.net.MediaType;
import in.erail.amazon.lambda.EventSource;
import io.vertx.core.json.JsonObject;
/**
*
* @author vinay
*/
public class DefaultEventSource implements EventSource {
@Override
public boolean check(JsonObject pEvent) {
return true;
}
@Override
public JsonObject transform(JsonObject pEvent) {
JsonObject newRequest = new JsonObject()
.put("body", pEvent.toString().getBytes())
.put("headers", new JsonObject()
.put(HttpHeaders.CONTENT_TYPE, MediaType.JSON_UTF_8.toString())
.put("aws-event-source", getEventSourceName().toString()));;
return newRequest;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy