in src/main/scala/com/gu/fastly/Lambda.scala [261:272]
private def extractUpdateContentType(event: Event): Option[ContentType] = {
// An Update event should contain a Content payload with a content type.
// A RetrievableContent event contains a content type hint and a link to the full content
event.payload.flatMap { payload =>
payload match {
case EventPayload.Content(content) => Some(content.`type`)
case EventPayload.RetrievableContent(retrievableContent) =>
retrievableContent.contentType
case _ => None
}
}
}