/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-dev * User agent: apibuilder app.apibuilder.io/nicolai-moraru/joglog-api/0.0.1-dev/http4s_0_17 */ package nm.joglog.api.v0.models { /** * Time entry * * @param id Unique time id * @param distance Distance in meters * @param time Time in seconds * @param createdAt Creation date-time * @param updatedAt Last update date-time */ final case class Time( id: Int, distance: Int, time: Int, createdAt: _root_.java.time.Instant, updatedAt: _root_.java.time.Instant ) /** * Time entry * * @param distance Distance in meters * @param time Time in seconds */ final case class TimeMinimal( distance: Int, time: Int ) /** * Time patch entry */ final case class TimePatchEntry( op: .models.Operation, path: time.models.Path, value: Int ) /** * User * * @param id Unique user id * @param username Username * @param role User Role * @param createdAt Creation date-time * @param updatedAt Last update date-time */ final case class User( id: Int, username: String, role: .models.Role, createdAt: _root_.java.time.Instant, updatedAt: _root_.java.time.Instant ) /** * User * * @param username Username * @param password Password */ final case class UserMinimal( username: String, password: String ) /** * User patch entry */ final case class UserPatchEntry( op: .models.Operation, path: user.models.Path, value: nm.joglog.api.v0.models.StringOrInteger ) /** * Patch operation */ sealed trait PatchOperation extends _root_.scala.Product with _root_.scala.Serializable object PatchOperation { case object Test extends PatchOperation { override def toString = "test" } case object Replace extends PatchOperation { override def toString = "replace" } /** * 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 PatchOperation /** * 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[PatchOperation] = scala.List(Test, Replace) private val byName: Map[String, PatchOperation] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): PatchOperation = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[PatchOperation] = byName.get(value.toLowerCase) } /** * Integer for ID or string for any other */ sealed trait StringOrInteger extends _root_.scala.Product with _root_.scala.Serializable object StringOrInteger { case object String extends StringOrInteger { override def toString = "string" } case object Integer extends StringOrInteger { override def toString = "integer" } /** * 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 StringOrInteger /** * 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[StringOrInteger] = scala.List(String, Integer) private val byName: Map[String, StringOrInteger] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): StringOrInteger = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[StringOrInteger] = byName.get(value.toLowerCase) } /** * Time patch field path (id only for test) */ sealed trait TimePatchPath extends _root_.scala.Product with _root_.scala.Serializable object TimePatchPath { case object Distance extends TimePatchPath { override def toString = "distance" } case object Time extends TimePatchPath { override def toString = "time" } case object Id extends TimePatchPath { override def toString = "id" } /** * 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 TimePatchPath /** * 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[TimePatchPath] = scala.List(Distance, Time, Id) private val byName: Map[String, TimePatchPath] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): TimePatchPath = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[TimePatchPath] = byName.get(value.toLowerCase) } /** * User patch field path (id only for test) */ sealed trait UserPatchPath extends _root_.scala.Product with _root_.scala.Serializable object UserPatchPath { case object Username extends UserPatchPath { override def toString = "username" } case object Password extends UserPatchPath { override def toString = "password" } case object Role extends UserPatchPath { override def toString = "role" } case object Id extends UserPatchPath { override def toString = "id" } /** * 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 UserPatchPath /** * 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[UserPatchPath] = scala.List(Username, Password, Role, Id) private val byName: Map[String, UserPatchPath] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): UserPatchPath = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[UserPatchPath] = byName.get(value.toLowerCase) } /** * User Role */ sealed trait UserRole extends _root_.scala.Product with _root_.scala.Serializable object UserRole { /** * Regular user */ case object User extends UserRole { override def toString = "user" } /** * User manager */ case object Manager extends UserRole { override def toString = "manager" } /** * The God himself */ case object Admin extends UserRole { override def toString = "admin" } /** * 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 UserRole /** * 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[UserRole] = scala.List(User, Manager, Admin) private val byName: Map[String, UserRole] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): UserRole = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[UserRole] = byName.get(value.toLowerCase) } }