title: What interface should a Serverless scheduled java function implement?
body: <p>I'm trying out writing a Java AWS Lambda using Serverless. While my Lambdas triggered by HTTP endpoints deploy and work correctly, my attempt at at scheduled one fails:</p>
  
  <p>The config looks like:</p>
  
  <p>from serverless.yml</p>
  
  <pre><code>functions:
    timedHandler:
      handler: com.serverless.TimedHandler
      events:
       - schedule:
          rate(1 minute)
  </code></pre>
  
  <p>If I try to implement RequestHandler like:</p>
  
  <pre><code>public class TimedHandler implements RequestHandler&lt;Request, Response&gt; {
  private static final Logger LOG = LogManager.getLogger(Handler.class);
  
  @Override
  public Response handleRequest(Request request, Context context) {
      LOG.info("Started up");
      return null;
  }
  </code></pre>
  
  <p>The logs complain that:</p>
  
  <blockquote>
    <p>An error occurred during JSON parsing: java.lang.RuntimeException java.lang.RuntimeException: An error occurred during JSON parsing<br>
    Caused by: java.io.UncheckedIOException: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.amazonaws.Request</p>
  </blockquote>
  
  <p>I assume because the scheduled event is not passing in a <code>Request</code> object but something specific to a scheduled trigger. But if I don't implement an interface (which the AWS docs suggest is fine) the AWS logs complain </p>
  
  <blockquote>
    <p>Class does not implement an appropriate handler interface: com.serverless.TimedHandler</p>
  </blockquote>
  
  <p>Is there a specific AWS interface I need to implement for a scheduled lambda that passes in appropriate arguments?</p>