/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1 * User agent: apibuilder app.apibuilder.io/nccloud/common/0.0.1/scala_models */ package de.nccloud.common.v0.models { /** * Represents a link to a resource. */ sealed trait Link extends _root_.scala.Product with _root_.scala.Serializable /** * Basic audit information for a resource. */ final case class Audit( createdAt: _root_.org.joda.time.DateTime, createdBy: _root_.java.util.UUID, updatedAt: _root_.org.joda.time.DateTime, updatedBy: _root_.java.util.UUID ) /** * Links to further information about the occurred error. * * @param about A link that leads to further details about this particular occurrence of the * problem. * @param `type` A link that identifies the type of the error that this particular error is an * instance of. */ final case class ErrorLinks( about: _root_.scala.Option[de.nccloud.common.v0.models.Link] = None, `type`: _root_.scala.Option[de.nccloud.common.v0.models.Link] = None ) /** * Reference to the primary source of an error. * * @param source The source of the problem in the form specified by `type`. */ final case class ErrorSource( `type`: de.nccloud.common.v0.models.ErrorSourceType, source: String ) /** * An error returned on failed API requests. * * @param code An app specific error code. * @param title A short human readable summary of the problem. * @param detail A human readable explanation of the problem. * @param meta Non-standard meta-information about the error. */ final case class GenericError( links: _root_.scala.Option[de.nccloud.common.v0.models.ErrorLinks] = None, code: String, title: String, detail: String, source: _root_.scala.Option[de.nccloud.common.v0.models.ErrorSource] = None, meta: _root_.scala.Option[_root_.play.api.libs.json.JsObject] = None ) /** * Indicating the health of a service. * * @param message An optional message giving more detailed information about the current health. */ final case class HealthCheck( status: de.nccloud.common.v0.models.HealthStatus, message: _root_.scala.Option[String] = None ) /** * Represents a link with some meta information. * * @param href An URI-reference pointing to the links target. * @param title A human-readable label for the link. * @param `type` Optional media type of the link's target. */ final case class LinkObject( href: String, title: _root_.scala.Option[String] = None, `type`: _root_.scala.Option[String] = None ) extends Link /** * Paging information returned from a paged request. * * @param totalResults Total number of results that can potentially be returned. * @param totalPages Total number of pages that can potentially be returned. */ final case class PageResponse( offset: Int, limit: Int, sort: Seq[de.nccloud.common.v0.models.Sort], totalResults: Long, totalPages: Long ) /** * Form containing paging information. * * @param offset Offset of the current page. The pages are 0-indexed, meaning the first page * starts at 0. * @param limit The number of results to be returned by the api. * @param sort Defines multiple properties for the results to be sorted by. The order of the * definition defines the priority. If omitted, the service will use an * implementation dependent default sort. */ final case class PagingForm( offset: Int = 0, limit: Int = 25, sort: _root_.scala.Option[Seq[de.nccloud.common.v0.models.Sort]] = None ) /** * Information about a deployed service. * * @param uri URI under which this service is deployed. * @param title A human-readable title of the service. * @param description A human-readable description of the service. */ final case class ServiceInfo( name: String, version: String, uri: String, title: _root_.scala.Option[String] = None, description: _root_.scala.Option[String] = None ) /** * Single property to sort by. * * @param property The property by which the results should be sorted. * @param direction The direction in which the results should be sorted. */ final case class Sort( property: String, direction: de.nccloud.common.v0.models.SortDirection ) /** * Provides future compatibility in clients - in the future, when a type is added * to the union Link, it will need to be handled in the client code. This * implementation will deserialize these future types as an instance of this class. * * @param description Information about the type that we received that is undefined in this version of * the client. */ final case class LinkUndefinedType( description: String ) extends Link /** * Wrapper class to support the union types containing the datatype[string] */ final case class LinkString( value: String ) extends Link /** * Type of an error source. */ sealed trait ErrorSourceType extends _root_.scala.Product with _root_.scala.Serializable object ErrorSourceType { /** * Indicating a [JSON pointer](https://tools.ietf.org/html/rfc6901) to the value * that has caused the error. */ case object Pointer extends ErrorSourceType { override def toString = "pointer" } /** * Indicating an URI query parameter causing the error. */ case object Parameter extends ErrorSourceType { override def toString = "parameter" } /** * Indicating a request header causing the error. */ case object Header extends ErrorSourceType { override def toString = "header" } /** * 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 ErrorSourceType /** * 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[ErrorSourceType] = scala.List(Pointer, Parameter, Header) private val byName: Map[String, ErrorSourceType] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): ErrorSourceType = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[ErrorSourceType] = byName.get(value.toLowerCase) } /** * The status of a service. */ sealed trait HealthStatus extends _root_.scala.Product with _root_.scala.Serializable object HealthStatus { /** * The service is running and healthy. */ case object Running extends HealthStatus { override def toString = "running" } /** * The service is not yet running. */ case object Starting extends HealthStatus { override def toString = "starting" } /** * The service has encountered errors and is not running property. */ case object Unhealthy extends HealthStatus { override def toString = "unhealthy" } /** * 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 HealthStatus /** * 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[HealthStatus] = scala.List(Running, Starting, Unhealthy) private val byName: Map[String, HealthStatus] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): HealthStatus = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[HealthStatus] = byName.get(value.toLowerCase) } /** * The direction in which to sort by a property. */ sealed trait SortDirection extends _root_.scala.Product with _root_.scala.Serializable object SortDirection { /** * Sort ascending. */ case object Asc extends SortDirection { override def toString = "asc" } /** * Sort descending. */ case object Desc extends SortDirection { override def toString = "desc" } /** * 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 SortDirection /** * 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[SortDirection] = scala.List(Asc, Desc) private val byName: Map[String, SortDirection] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): SortDirection = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[SortDirection] = byName.get(value.toLowerCase) } }