override def handleRequest()

in src/main/scala/com/gu/contentapi/Lambda.scala [15:28]


  override def handleRequest(event: JMap[String, Object], context: Context): Unit = {

    for {
      front <- Facia.fronts
      collections <- Facia.collections(front)
      notification = Notification.create(EditorsPick(front, collections))
    } yield {
      SNS.publish(Config.aws.topicArn, Json.stringify(Json.toJson(notification))) match {
        case Success(_) => println(s"Successfully published editors picks for front: ${notification.body.id}")
        case Failure(e) => println(s"Could not publish editors picks for front: ${notification.body.id}, $e")
      }
    }

  }