in src/main/scala/com/gu/invoicing/pdf/Lambda.scala [16:28]
def handleRequest(input: APIGatewayProxyRequestEvent, context: Context): APIGatewayProxyResponseEvent = {
PdfInput(input)
.tap { info[PdfInput] }
.pipe { program }
.pipe { pdfOut =>
val response = new APIGatewayProxyResponseEvent
response.setStatusCode(200)
response.setHeaders((Map("Content-Type" -> "application/pdf;charset=UTF-8") ++ noCache).asJava)
response.setBody(pdfOut)
response.setIsBase64Encoded(true)
response
}
}