Skip to content

Commit

Permalink
scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cjllanwarne committed Dec 12, 2023
1 parent b934a63 commit b232209
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import org.broadinstitute.dsde.rawls.RawlsExceptionWithErrorReport
import org.broadinstitute.dsde.rawls.billing.BillingProfileManagerDAO.ProfilePolicy.ProfilePolicy
import org.broadinstitute.dsde.rawls.config.MultiCloudWorkspaceConfig
import org.broadinstitute.dsde.rawls.model.ProjectRoles.ProjectRole
import org.broadinstitute.dsde.rawls.model.{AzureManagedAppCoordinates, ErrorReport, ProjectRoles, RawlsBillingAccountName, RawlsRequestContext}
import org.broadinstitute.dsde.rawls.model.{
AzureManagedAppCoordinates,
ErrorReport,
ProjectRoles,
RawlsBillingAccountName,
RawlsRequestContext
}
import spray.json.{DefaultJsonProtocol, RootJsonFormat}

import java.util.{Date, UUID}
Expand All @@ -20,7 +26,9 @@ import scala.util.{Failure, Success, Try}
case class BpmAzureReportErrorMessage(message: String, statusCode: Int)

object BpmAzureReportErrorMessageJsonProtocol extends DefaultJsonProtocol {
implicit val bpmAzureReportErrorMessageFormat: RootJsonFormat[BpmAzureReportErrorMessage] = jsonFormat2(BpmAzureReportErrorMessage.apply)
implicit val bpmAzureReportErrorMessageFormat: RootJsonFormat[BpmAzureReportErrorMessage] = jsonFormat2(
BpmAzureReportErrorMessage.apply
)
}

import spray.json._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ case class Providers(providers: List[String])
object BondJsonSupport {
import spray.json.DefaultJsonProtocol._

implicit val BondServiceAccountEmailFormat: RootJsonFormat[BondServiceAccountEmail] = jsonFormat1(BondServiceAccountEmail)
implicit val BondServiceAccountEmailFormat: RootJsonFormat[BondServiceAccountEmail] = jsonFormat1(
BondServiceAccountEmail
)
implicit val BondResponseDataFormat: RootJsonFormat[BondResponseData] = jsonFormat1(BondResponseData)

implicit val providersFormat: RootJsonFormat[Providers] = jsonFormat1(Providers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ import com.google.api.client.googleapis.json.GoogleJsonResponseException
import com.google.api.client.http.{HttpRequest, HttpRequestInitializer, HttpResponseException, InputStreamContent}
import com.google.api.client.json.gson.GsonFactory
import com.google.api.services.cloudbilling.Cloudbilling
import com.google.api.services.cloudbilling.model.{BillingAccount, ListBillingAccountsResponse, ProjectBillingInfo, TestIamPermissionsRequest}
import com.google.api.services.cloudbilling.model.{
BillingAccount,
ListBillingAccountsResponse,
ProjectBillingInfo,
TestIamPermissionsRequest
}
import com.google.api.services.cloudresourcemanager.CloudResourceManager
import com.google.api.services.cloudresourcemanager.model._
import com.google.api.services.compute.{Compute, ComputeScopes}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ trait RawSqlQuery {
import driver.api._

implicit val GetUUIDResult: GetResult[UUID] = GetResult(r => uuidColumnType.fromBytes(r.nextBytes()))
implicit val GetUUIDOptionResult: GetResult[Option[UUID]] = GetResult(r => Option(uuidColumnType.fromBytes(r.nextBytes())))
implicit val GetUUIDOptionResult: GetResult[Option[UUID]] =
GetResult(r => Option(uuidColumnType.fromBytes(r.nextBytes())))
implicit object SetUUIDParameter extends SetParameter[UUID] {
def apply(v: UUID, pp: PositionedParameters) { pp.setBytes(uuidColumnType.toBytes(v)) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ trait EntityComponent {
// noinspection SqlDialectInspection,DuplicatedCode
private object EntityRecordRawSqlQuery extends RawSqlQuery {
val driver: JdbcProfile = EntityComponent.this.driver
implicit val getEntityRecord: GetResult[EntityRecord] = GetResult(r => EntityRecord(r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<))
implicit val getEntityRecord: GetResult[EntityRecord] =
GetResult(r => EntityRecord(r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<))

def action(workspaceId: UUID, entities: Set[AttributeEntityReference]): ReadAction[Seq[EntityRecord]] =
if (entities.isEmpty) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,18 @@ trait RawlsBillingProjectComponent {

// these 2 implicits are lazy because there is a timing problem initializing MappedColumnType, if they are not lazy
// we get null pointer exceptions
implicit lazy val googleApiTypeColumnType: JdbcType[GoogleApiType] with BaseTypedType[GoogleApiType] = MappedColumnType.base[GoogleApiType, String](
apiType => apiType.toString,
stringValue => GoogleApiTypes.withName(stringValue)
)

implicit lazy val googleOperationNameColumnType: JdbcType[GoogleOperationName] with BaseTypedType[GoogleOperationName] = MappedColumnType.base[GoogleOperationName, String](
operationName => operationName.toString,
stringValue => GoogleOperationNames.withName(stringValue)
)
implicit lazy val googleApiTypeColumnType: JdbcType[GoogleApiType] with BaseTypedType[GoogleApiType] =
MappedColumnType.base[GoogleApiType, String](
apiType => apiType.toString,
stringValue => GoogleApiTypes.withName(stringValue)
)

implicit lazy val googleOperationNameColumnType
: JdbcType[GoogleOperationName] with BaseTypedType[GoogleOperationName] =
MappedColumnType.base[GoogleOperationName, String](
operationName => operationName.toString,
stringValue => GoogleOperationNames.withName(stringValue)
)

class RawlsBillingProjectOperationTable(tag: Tag)
extends Table[RawlsBillingProjectOperationRecord](tag, "BILLING_PROJECT_OPERATION") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,35 @@ case class SamUserResource(resourceId: String,
case class SamUserStatusResponse(userSubjectId: String, userEmail: String, enabled: Boolean)

object SamModelJsonSupport extends JsonSupport {
implicit val SamFullyQualifiesResourceIdFormat: RootJsonFormat[SamFullyQualifiedResourceId] = jsonFormat2(SamFullyQualifiedResourceId)
implicit val SamResourcePolicyNameFormat: ValueObjectFormat[SamResourcePolicyName] = ValueObjectFormat(SamResourcePolicyName)
implicit val SamFullyQualifiesResourceIdFormat: RootJsonFormat[SamFullyQualifiedResourceId] = jsonFormat2(
SamFullyQualifiedResourceId
)
implicit val SamResourcePolicyNameFormat: ValueObjectFormat[SamResourcePolicyName] = ValueObjectFormat(
SamResourcePolicyName
)
implicit val SamResourceActionFormat: ValueObjectFormat[SamResourceAction] = ValueObjectFormat(SamResourceAction)
implicit val SamResourceRoleFormat: ValueObjectFormat[SamResourceRole] = ValueObjectFormat(SamResourceRole)

implicit val SamPolicyFormat: RootJsonFormat[SamPolicy] = jsonFormat3(SamPolicy)
implicit val SamPolicyWithNameAndEmailFormat: RootJsonFormat[SamPolicyWithNameAndEmail] = jsonFormat3(SamPolicyWithNameAndEmail)
implicit val SamResourceWithPoliciesFormat: RootJsonFormat[SamResourceWithPolicies] = jsonFormat5(SamResourceWithPolicies)
implicit val SamResourceIdWithPolicyNameFormat: RootJsonFormat[SamResourceIdWithPolicyName] = jsonFormat5(SamResourceIdWithPolicyName)
implicit val SamPolicyWithNameAndEmailFormat: RootJsonFormat[SamPolicyWithNameAndEmail] = jsonFormat3(
SamPolicyWithNameAndEmail
)
implicit val SamResourceWithPoliciesFormat: RootJsonFormat[SamResourceWithPolicies] = jsonFormat5(
SamResourceWithPolicies
)
implicit val SamResourceIdWithPolicyNameFormat: RootJsonFormat[SamResourceIdWithPolicyName] = jsonFormat5(
SamResourceIdWithPolicyName
)
implicit val SamPolicySyncStatusFormat: RootJsonFormat[SamPolicySyncStatus] = jsonFormat2(SamPolicySyncStatus)

implicit val SamCreateResourceAccessPolicyIdResponseFormat: RootJsonFormat[SamCreateResourceAccessPolicyIdResponse] = jsonFormat2(SamCreateResourceAccessPolicyIdResponse)
implicit val samCreateResourcePolicyResponseFormat: RootJsonFormat[SamCreateResourcePolicyResponse] = jsonFormat2(SamCreateResourcePolicyResponse)
implicit val SamCreateResourceResponseFormat: RootJsonFormat[SamCreateResourceResponse] = jsonFormat4(SamCreateResourceResponse)
implicit val SamCreateResourceAccessPolicyIdResponseFormat: RootJsonFormat[SamCreateResourceAccessPolicyIdResponse] =
jsonFormat2(SamCreateResourceAccessPolicyIdResponse)
implicit val samCreateResourcePolicyResponseFormat: RootJsonFormat[SamCreateResourcePolicyResponse] = jsonFormat2(
SamCreateResourcePolicyResponse
)
implicit val SamCreateResourceResponseFormat: RootJsonFormat[SamCreateResourceResponse] = jsonFormat4(
SamCreateResourceResponse
)

implicit val SamRolesAndActionsFormat: RootJsonFormat[SamRolesAndActions] = jsonFormat2(SamRolesAndActions)
implicit val SamUserResourceFormat: RootJsonFormat[SamUserResource] = jsonFormat6(SamUserResource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ class SpendReportingJsonSupport extends JsonSupport {
}
}

implicit val SpendReportingAggregationKeyParameterFormat: RootJsonFormat[SpendReportingAggregationKeyWithSub] = jsonFormat2(SpendReportingAggregationKeyWithSub)
implicit val SpendReportingAggregationKeyParameterFormat: RootJsonFormat[SpendReportingAggregationKeyWithSub] =
jsonFormat2(SpendReportingAggregationKeyWithSub)

implicit val BillingProjectSpendConfigurationFormat: RootJsonFormat[BillingProjectSpendConfiguration] = jsonFormat2(BillingProjectSpendConfiguration)
implicit val BillingProjectSpendConfigurationFormat: RootJsonFormat[BillingProjectSpendConfiguration] = jsonFormat2(
BillingProjectSpendConfiguration
)

implicit val SpendReportingAggregationFormat: JsonFormat[SpendReportingAggregation] = lazyFormat(
jsonFormat2(SpendReportingAggregation.apply)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ final case class MultiregionalBucketMigrationProgress(
object MultiregionalBucketMigrationJsonSupport {
import spray.json.DefaultJsonProtocol._

implicit val MultiregionalBucketMigrationDetailsJsonFormat: RootJsonFormat[MultiregionalBucketMigrationMetadata] = jsonFormat6(MultiregionalBucketMigrationMetadata.apply)
implicit val MultiregionalBucketMigrationDetailsJsonFormat: RootJsonFormat[MultiregionalBucketMigrationMetadata] =
jsonFormat6(MultiregionalBucketMigrationMetadata.apply)

implicit val STSJobProgressJsonFormat: RootJsonFormat[STSJobProgress] = jsonFormat4(STSJobProgress.apply)
implicit object MultiregionalBucketMigrationStepJsonFormat extends RootJsonFormat[MultiregionalBucketMigrationStep] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,7 @@ object AttributeUpdateOperations {
operations: Seq[AttributeUpdateOperation]
)

implicit val entityUpdateDefinitionFormat: RootJsonFormat[EntityUpdateDefinition] = jsonFormat3(EntityUpdateDefinition)
implicit val entityUpdateDefinitionFormat: RootJsonFormat[EntityUpdateDefinition] = jsonFormat3(
EntityUpdateDefinition
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ object DataReferenceModelJsonSupport extends JsonSupport {
}

implicit val DataReferenceNameFormat: ValueObjectFormat[DataReferenceName] = ValueObjectFormat(DataReferenceName)
implicit val dataReferenceDescriptionFieldFormat: ValueObjectFormat[DataReferenceDescriptionField] = ValueObjectFormat(DataReferenceDescriptionField)
implicit val dataReferenceDescriptionFieldFormat: ValueObjectFormat[DataReferenceDescriptionField] =
ValueObjectFormat(DataReferenceDescriptionField)
implicit val NamedDataRepoSnapshotFormat: RootJsonFormat[NamedDataRepoSnapshot] = jsonFormat3(NamedDataRepoSnapshot)
implicit val SnapshotListResponseFormat: RootJsonFormat[SnapshotListResponse] = jsonFormat1(SnapshotListResponse)
}
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,17 @@ trait ExecutionJsonSupport extends JsonSupport {

implicit val WorkflowStatusFormat: RootJsonFormat[WorkflowStatus] = rawlsEnumerationFormat(WorkflowStatuses.withName)

implicit val SubmissionStatusFormat: RootJsonFormat[SubmissionStatus] = rawlsEnumerationFormat(SubmissionStatuses.withName)
implicit val SubmissionStatusFormat: RootJsonFormat[SubmissionStatus] = rawlsEnumerationFormat(
SubmissionStatuses.withName
)

implicit val SubmissionRetryStatusesFormat: RootJsonFormat[RetryStatus] = rawlsEnumerationFormat(SubmissionRetryStatuses.withName)
implicit val SubmissionRetryStatusesFormat: RootJsonFormat[RetryStatus] = rawlsEnumerationFormat(
SubmissionRetryStatuses.withName
)

implicit val WorkflowFailureModeFormat: RootJsonFormat[WorkflowFailureMode] = rawlsEnumerationFormat(WorkflowFailureModes.withName)
implicit val WorkflowFailureModeFormat: RootJsonFormat[WorkflowFailureMode] = rawlsEnumerationFormat(
WorkflowFailureModes.withName
)

implicit val CromwellBackendFormat: ValueObjectFormat[CromwellBackend] = ValueObjectFormat(CromwellBackend)

Expand Down Expand Up @@ -416,39 +422,65 @@ trait ExecutionJsonSupport extends JsonSupport {

implicit val ExecutionEventFormat: RootJsonFormat[ExecutionEvent] = jsonFormat3(ExecutionEvent)

implicit val ExecutionServiceStatusFormat: RootJsonFormat[ExecutionServiceStatus] = jsonFormat2(ExecutionServiceStatus)
implicit val ExecutionServiceStatusFormat: RootJsonFormat[ExecutionServiceStatus] = jsonFormat2(
ExecutionServiceStatus
)

implicit val ExecutionServiceFailureFormat: RootJsonFormat[ExecutionServiceFailure] = jsonFormat3(ExecutionServiceFailure)
implicit val ExecutionServiceFailureFormat: RootJsonFormat[ExecutionServiceFailure] = jsonFormat3(
ExecutionServiceFailure
)

implicit val ExecutionServiceVersionFormat: RootJsonFormat[ExecutionServiceVersion] = jsonFormat1(ExecutionServiceVersion)
implicit val ExecutionServiceVersionFormat: RootJsonFormat[ExecutionServiceVersion] = jsonFormat1(
ExecutionServiceVersion
)

implicit val ExecutionServiceValidationFormat: RootJsonFormat[ExecutionServiceValidation] = jsonFormat2(ExecutionServiceValidation)
implicit val ExecutionServiceValidationFormat: RootJsonFormat[ExecutionServiceValidation] = jsonFormat2(
ExecutionServiceValidation
)

implicit val ExecutionServiceOutputsFormat: RootJsonFormat[ExecutionServiceOutputs] = jsonFormat2(ExecutionServiceOutputs)
implicit val ExecutionServiceOutputsFormat: RootJsonFormat[ExecutionServiceOutputs] = jsonFormat2(
ExecutionServiceOutputs
)

implicit val ExecutionServiceCallLogsFormat: RootJsonFormat[ExecutionServiceCallLogs] = jsonFormat3(ExecutionServiceCallLogs)
implicit val ExecutionServiceCallLogsFormat: RootJsonFormat[ExecutionServiceCallLogs] = jsonFormat3(
ExecutionServiceCallLogs
)

implicit val ExecutionServiceLogsFormat: RootJsonFormat[ExecutionServiceLogs] = jsonFormat2(ExecutionServiceLogs)

implicit val ExecutionServiceWorkflowOptionsFormat: RootJsonFormat[ExecutionServiceWorkflowOptions] = jsonFormat18(ExecutionServiceWorkflowOptions)
implicit val ExecutionServiceWorkflowOptionsFormat: RootJsonFormat[ExecutionServiceWorkflowOptions] = jsonFormat18(
ExecutionServiceWorkflowOptions
)

implicit val ExecutionServiceLabelResponseFormat: RootJsonFormat[ExecutionServiceLabelResponse] = jsonFormat2(ExecutionServiceLabelResponse)
implicit val ExecutionServiceLabelResponseFormat: RootJsonFormat[ExecutionServiceLabelResponse] = jsonFormat2(
ExecutionServiceLabelResponse
)

implicit val TaskOutputFormat: RootJsonFormat[TaskOutput] = jsonFormat2(TaskOutput)

implicit val WorkflowOutputsFormat: RootJsonFormat[WorkflowOutputs] = jsonFormat2(WorkflowOutputs)

implicit val WorkflowCostFormat: RootJsonFormat[WorkflowCost] = jsonFormat2(WorkflowCost)

implicit val SubmissionValidationInputFormat: RootJsonFormat[SubmissionValidationInput] = jsonFormat2(SubmissionValidationInput)
implicit val SubmissionValidationInputFormat: RootJsonFormat[SubmissionValidationInput] = jsonFormat2(
SubmissionValidationInput
)

implicit val SubmissionValidationHeaderFormat: RootJsonFormat[SubmissionValidationHeader] = jsonFormat3(SubmissionValidationHeader)
implicit val SubmissionValidationHeaderFormat: RootJsonFormat[SubmissionValidationHeader] = jsonFormat3(
SubmissionValidationHeader
)

implicit val SubmissionValidationValueFormat: RootJsonFormat[SubmissionValidationValue] = jsonFormat3(SubmissionValidationValue)
implicit val SubmissionValidationValueFormat: RootJsonFormat[SubmissionValidationValue] = jsonFormat3(
SubmissionValidationValue
)

implicit val SubmissionValidationEntityInputsFormat: RootJsonFormat[SubmissionValidationEntityInputs] = jsonFormat2(SubmissionValidationEntityInputs)
implicit val SubmissionValidationEntityInputsFormat: RootJsonFormat[SubmissionValidationEntityInputs] = jsonFormat2(
SubmissionValidationEntityInputs
)

implicit val SubmissionValidationReportFormat: RootJsonFormat[SubmissionValidationReport] = jsonFormat4(SubmissionValidationReport)
implicit val SubmissionValidationReportFormat: RootJsonFormat[SubmissionValidationReport] = jsonFormat4(
SubmissionValidationReport
)

implicit val WorkflowFormat: RootJsonFormat[Workflow] = jsonFormat7(Workflow)

Expand All @@ -460,19 +492,27 @@ trait ExecutionJsonSupport extends JsonSupport {

implicit val SubmissionReportFormat: RootJsonFormat[SubmissionReport] = jsonFormat7(SubmissionReport)

implicit val RetriedSubmissionReportFormat: RootJsonFormat[RetriedSubmissionReport] = jsonFormat7(RetriedSubmissionReport)
implicit val RetriedSubmissionReportFormat: RootJsonFormat[RetriedSubmissionReport] = jsonFormat7(
RetriedSubmissionReport
)

implicit val SubmissionListResponseFormat: RootJsonFormat[SubmissionListResponse] = jsonFormat17(SubmissionListResponse.apply)
implicit val SubmissionListResponseFormat: RootJsonFormat[SubmissionListResponse] = jsonFormat17(
SubmissionListResponse.apply
)

implicit val MetadataParamsFormat: RootJsonFormat[MetadataParams] = jsonFormat3(MetadataParams)

implicit val CallMetadataFormat: RootJsonFormat[CallMetadata] = jsonFormat14(CallMetadata)

implicit val ActiveSubmissionFormat: RootJsonFormat[ActiveSubmission] = jsonFormat3(ActiveSubmission)

implicit val WorkflowQueueStatusResponseFormat: RootJsonFormat[WorkflowQueueStatusResponse] = jsonFormat3(WorkflowQueueStatusResponse)
implicit val WorkflowQueueStatusResponseFormat: RootJsonFormat[WorkflowQueueStatusResponse] = jsonFormat3(
WorkflowQueueStatusResponse
)

implicit val UserCommentUpdateOperationFormat: RootJsonFormat[UserCommentUpdateOperation] = jsonFormat1(UserCommentUpdateOperation)
implicit val UserCommentUpdateOperationFormat: RootJsonFormat[UserCommentUpdateOperation] = jsonFormat1(
UserCommentUpdateOperation
)

implicit object WorkflowQueueStatusByUserResponseFormat extends RootJsonFormat[WorkflowQueueStatusByUserResponse] {
def write(r: WorkflowQueueStatusByUserResponse) = JsObject(
Expand Down
Loading

0 comments on commit b232209

Please sign in to comment.