Newer
Older
GitBucket / src / main / scala / gitbucket / core / api / CreateALabel.scala
@Naoki Takezoe Naoki Takezoe on 1 Apr 2018 353 bytes Apply scalafmt
package gitbucket.core.api

/**
 * https://developer.github.com/v3/issues/labels/#create-a-label
 * api form
 */
case class CreateALabel(
  name: String,
  color: String
) {
  def isValid: Boolean = {
    name.length <= 100 &&
    !name.startsWith("_") &&
    !name.startsWith("-") &&
    color.length == 6 &&
    color.matches("[a-fA-F0-9+_.]+")
  }
}