Skip to content

Commit

Permalink
delete more
Browse files Browse the repository at this point in the history
  • Loading branch information
davidangb committed Nov 30, 2023
1 parent c302a0a commit b70aef3
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 386 deletions.
119 changes: 0 additions & 119 deletions src/main/scala/org/broadinstitute/dsde/firecloud/model/DUOS.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import akka.http.scaladsl.model.StatusCode
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.{MalformedRequestContentRejection, RejectionHandler}
import org.broadinstitute.dsde.firecloud.model.DUOS._
import org.broadinstitute.dsde.firecloud.model.DataUse._
import org.broadinstitute.dsde.firecloud.model.ManagedGroupRoles.ManagedGroupRole
import org.broadinstitute.dsde.firecloud.model.OrchMethodRepository._
Expand All @@ -20,7 +19,7 @@ import org.broadinstitute.dsde.rawls.model._
import org.broadinstitute.dsde.workbench.model.ValueObjectFormat
import org.broadinstitute.dsde.workbench.model.WorkbenchIdentityJsonSupport._
import org.broadinstitute.dsde.workbench.model.google.GoogleModelJsonSupport.InstantFormat
import spray.json.{JsString, _}
import spray.json._

import scala.util.{Failure, Success, Try}

Expand Down Expand Up @@ -279,38 +278,11 @@ object ModelJsonProtocol extends WorkspaceJsonSupport with SprayJsonSupport {
implicit val impStructuredDataRequest: RootJsonFormat[StructuredDataRequest] = jsonFormat12(StructuredDataRequest)
implicit val impStructuredDataResponse: RootJsonFormat[StructuredDataResponse] = jsonFormat4(StructuredDataResponse)

implicit object impDuosDataUse extends RootJsonFormat[DuosDataUse] {
override def write(ddu: DuosDataUse): JsValue = {
val existingProps: Seq[(String, JsValue)] = Try(ddu.getClass.getDeclaredFields.map { f =>
f.setAccessible(true)
f.get(ddu) match {
case Some(x: Boolean) => f.getName -> x.toJson
case Some(y: String) => f.getName -> y.toJson
case Some((h: String) :: tail) => f.getName -> (h +: tail.collect { case z: String => z }).toJson
case _ => f.getName -> JsNull
}
}) match {
case Success(props) => props.toIndexedSeq.filterNot(_._2 == JsNull)
case Failure(ex) => serializationError(ex.getMessage)
}
JsObject(existingProps.toMap)
}
override def read(json: JsValue): DuosDataUse = {
Try(DuosDataUse.apply(json.asJsObject.fields)) match {
case Success(ddu) => ddu
case Failure(ex) => deserializationError(s"Could not read DuosDataUse value: $json", ex)
}
}
}
implicit val impDuosConsent: RootJsonFormat[Consent] = jsonFormat11(Consent)
implicit val impDuosConsentError: RootJsonFormat[ConsentError] = jsonFormat2(ConsentError)
implicit val impOntologyTermParent: RootJsonFormat[TermParent] = jsonFormat5(TermParent)
implicit val impOntologyTermResource: RootJsonFormat[TermResource] = jsonFormat7(TermResource)
implicit val impOntologyESTermParent: RootJsonFormat[ESTermParent] = jsonFormat2(ESTermParent)

implicit val impThurloeStatus: RootJsonFormat[ThurloeStatus] = jsonFormat2(ThurloeStatus)
implicit val impDropwizardHealth: RootJsonFormat[DropwizardHealth] = jsonFormat2(DropwizardHealth)
implicit val impDuosConsentStatus: RootJsonFormat[ConsentStatus] = jsonFormat3(ConsentStatus)

// don't make this implicit! It would be pulled in by anything including ModelJsonProtocol._
val entityExtractionRejectionHandler = RejectionHandler.newBuilder().handle {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ package org.broadinstitute.dsde.firecloud.model
* Created by anichols on 4/7/17.
*/
case class ThurloeStatus(status: String, error: Option[String])
case class DropwizardHealth(healthy: Boolean, message: Option[String])
Loading

0 comments on commit b70aef3

Please sign in to comment.