/** * Generated by API Builder - https://www.apibuilder.io * Service version: 1.1.0 * User agent: apibuilder app.apibuilder.io/paintbatch-com/paint-batch-optimizer/1.1.0/http4s_0_20 */ package com.paintbatch.models { /** * range of customers preferences to choose from * * @param paints paints the customer would be satisfied with */ final case class Demand( paints: Seq[com.paintbatch.models.Paint] ) /** * health of the service * * @param status the health status of the service */ final case class Healthcheck( status: com.paintbatch.models.Status ) /** * paint batch optimizer request * * @param colors number of different colours demanded by paint factory * @param customers number of customers * @param demands customers paint demands */ final case class OptimizeRequest( colors: Int, customers: Int, demands: Seq[com.paintbatch.models.Demand] ) /** * paint and its sheen * * @param id paint identifier * @param sheen sheen of the paint */ final case class Paint( id: Int, sheen: com.paintbatch.models.Sheen ) /** * A simple human-readable error */ final case class ReadableError( text: String ) /** * available paint sheens */ sealed trait Sheen extends _root_.scala.Product with _root_.scala.Serializable object Sheen { /** * matte sheen costs more than gloss */ case object Matte extends Sheen { override def toString = "M" } /** * gloss sheen costs less than matte */ case object Gloss extends Sheen { override def toString = "G" } /** * UNDEFINED captures values that are sent either in error or * that were added by the server after this library was * generated. We want to make it easy and obvious to users of * this library to handle this case gracefully. * * We use all CAPS for the variable name to avoid collisions * with the camel cased values above. */ final case class UNDEFINED(override val toString: String) extends Sheen /** * all returns a list of all the valid, known values. We use * lower case to avoid collisions with the camel cased values * above. */ val all: scala.List[Sheen] = scala.List(Matte, Gloss) private val byName: Map[String, Sheen] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): Sheen = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[Sheen] = byName.get(value.toLowerCase) } /** * health of the service */ sealed trait Status extends _root_.scala.Product with _root_.scala.Serializable object Status { /** * represents the service is live and accepting traffic */ case object Ok extends Status { override def toString = "ok" } /** * UNDEFINED captures values that are sent either in error or * that were added by the server after this library was * generated. We want to make it easy and obvious to users of * this library to handle this case gracefully. * * We use all CAPS for the variable name to avoid collisions * with the camel cased values above. */ final case class UNDEFINED(override val toString: String) extends Status /** * all returns a list of all the valid, known values. We use * lower case to avoid collisions with the camel cased values * above. */ val all: scala.List[Status] = scala.List(Ok) private val byName: Map[String, Status] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): Status = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[Status] = byName.get(value.toLowerCase) } }