in src/main/scala/com/gu/mobile/content/notifications/lib/NotificationsApiClient.scala [58:69]
def parse(response: String): Option[UUID] = {
def toUUID(idAttribute: JsValue): Option[UUID] = idAttribute match {
case JsString(id) => Some(UUID.fromString(id))
case _ => None
}
val parsed = Json.parse(response)
parsed match {
case JsObject(attributes) => attributes.get("id").flatMap(toUUID)
case _ => None
}
}