<commit_before>package org.broadinstitute.dsde.rawls.model

import org.broadinstitute.dsde.rawls.model.WorkspaceJsonSupport._
import spray.json._

/**
 * Created by mbemis on 7/23/15.
 */
object AttributeUpdateOperations {
  sealed trait AttributeUpdateOperation {
    def name: AttributeName = this match {
      case AddUpdateAttribute(attributeName, _) => attributeName
      case RemoveAttribute(attributeName) => attributeName
      case AddListMember(attributeListName, _) => attributeListName
      case RemoveListMember(attributeListName, _) => attributeListName
      case CreateAttributeEntityReferenceList(attributeListName) => attributeListName
      case CreateAttributeValueList(attributeListName) => attributeListName
    }
  }

  case class AddUpdateAttribute(attributeName: AttributeName, addUpdateAttribute: Attribute) extends AttributeUpdateOperation
  case class RemoveAttribute(attributeName: AttributeName) extends AttributeUpdateOperation
  case class CreateAttributeEntityReferenceList(attributeName: AttributeName) extends AttributeUpdateOperation
  case class CreateAttributeValueList(attributeName: AttributeName) extends AttributeUpdateOperation
  case class AddListMember(attributeListName: AttributeName, newMember: Attribute) extends AttributeUpdateOperation
  case class RemoveListMember(attributeListName: AttributeName, removeMember: Attribute) extends AttributeUpdateOperation

  private val AddUpdateAttributeFormat = jsonFormat2(AddUpdateAttribute)<commit_msg>attributeName -> attributeListName (#600)<commit_after>package org.broadinstitute.dsde.rawls.model

import org.broadinstitute.dsde.rawls.model.WorkspaceJsonSupport._
import spray.json._

/**
 * Created by mbemis on 7/23/15.
 */
object AttributeUpdateOperations {
  sealed trait AttributeUpdateOperation {
    def name: AttributeName = this match {
      case AddUpdateAttribute(attributeName, _) => attributeName
      case RemoveAttribute(attributeName) => attributeName
      case AddListMember(attributeListName, _) => attributeListName
      case RemoveListMember(attributeListName, _) => attributeListName
      case CreateAttributeEntityReferenceList(attributeListName) => attributeListName
      case CreateAttributeValueList(attributeListName) => attributeListName
    }
  }

  case class AddUpdateAttribute(attributeName: AttributeName, addUpdateAttribute: Attribute) extends AttributeUpdateOperation
  case class RemoveAttribute(attributeName: AttributeName) extends AttributeUpdateOperation
  case class CreateAttributeEntityReferenceList(attributeListName: AttributeName) extends AttributeUpdateOperation
  case class CreateAttributeValueList(attributeName: AttributeName) extends AttributeUpdateOperation
  case class AddListMember(attributeListName: AttributeName, newMember: Attribute) extends AttributeUpdateOperation
  case class RemoveListMember(attributeListName: AttributeName, removeMember: Attribute) extends AttributeUpdateOperation

  private val AddUpdateAttributeFormat = jsonFormat2(AddUpdateAttribute)
{'fraction_non_alphanumeric': 0.05783212161269002, 'fraction_numerical': 0.00495703899537343, 'mean_word_length': 6.94488188976378, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '423529', 'n_tokens_mistral': 699, 'n_tokens_neox': 687, 'n_words': 171}