override def writes()

in client-play-json-v30/src/main/scala/com/gu/targeting/client/Fields.scala [50:61]


    override def writes(field: Fields): JsValue = {
      field match {
        case f: EmailFields => emailFormat.writes(f) + (reservedTypeField, JsString(emailType))
        case f: BadgeFields => badgeFormat.writes(f) + (reservedTypeField, JsString(badgeType))
        case f: EpicFields => epicFormat.writes(f) + (reservedTypeField, JsString(epicType))
        case f: ReportFields => reportFormat.writes(f) + (reservedTypeField, JsString(reportType))
        case f: SurveyFields => surveyFormat.writes(f) + (reservedTypeField, JsString(surveyType))
        case f: ParticipationFields => participationFormat.writes(f) + (reservedTypeField, JsString(participationType))
        case other =>
          throw new UnsupportedOperationException(s"Unable to serialize field of type ${other.getClass}")
      }
    }