Creating the POJOs for requests and response.

  1. Create a request POJO for accepting requests:
import lombok.Data;@Datapublic class IAMOperationRequest { private String operation; private String userName;}
  1. Create a POJO for sending back the response from the handler:
import lombok.AllArgsConstructor;import lombok.Data;@AllArgsConstructor@Datapublic class IAMOperationResponse { private String message; private String errorMessage;}
For our POJOs, we use project lombok (@Data) to auto-generate getters, setters, and so on. Project lombok dependency is added to the parent project simple-starter-parent-java. If you are using an IDE for development, you will have to install a plugin for your IDE to recognize project lombok annotations.

Creating ...

Get Serverless Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.