/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.16.53 * User agent: apibuilder app.apibuilder.io/apicollective/apibuilder-spec/0.16.53/http4s_0_22 */ package io.apibuilder.spec.v0.models { sealed trait ResponseCode extends _root_.scala.Product with _root_.scala.Serializable /** * Used to indicate an API concern for a field that is specific to the field's * usage but not necessarily its data type. For example, you might use annotations * to mark that certain fields contain PII or PCI data and thus should not be * stored once processing is complete. Annotations communicate meaning to consumers * of an API and may also be used within an implementation or tooling; for example, * using static analysis tools to detect logging of sensitive data. */ final case class Annotation( name: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None ) final case class Apidoc( version: String ) /** * @param key Unique key identifying this application */ final case class Application( key: String ) /** * Represents an additional attribute that is attached to one of the objects in * apibuilder. The main use case is to capture additional metadata that doesn't * necessarily define the API but aids in code generation. Examples would be hints * for certain code generators about classes to extend, interfaces to implement, * annotations to add, names to assign to certain methods, etc. The specific * attributes will be applicable only in the context of the specific code * generators usings them. */ final case class Attribute( name: String, value: Map[String, _root_.io.circe.Json], description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None ) final case class Body( `type`: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil ) /** * Describes the primary contact for this service */ final case class Contact( name: _root_.scala.Option[String] = None, url: _root_.scala.Option[String] = None, email: _root_.scala.Option[String] = None ) /** * Indicates that this particular element is considered deprecated in the API. See * the description for details */ final case class Deprecation( description: _root_.scala.Option[String] = None ) final case class Enum( name: String, plural: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, values: Seq[io.apibuilder.spec.v0.models.EnumValue], attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil ) /** * @param value The actual string representation of this value. If not specified, defaults to * 'name' */ final case class EnumValue( name: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil, value: _root_.scala.Option[String] = None ) final case class Field( name: String, `type`: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, default: _root_.scala.Option[String] = None, required: Boolean, minimum: _root_.scala.Option[Long] = None, maximum: _root_.scala.Option[Long] = None, example: _root_.scala.Option[String] = None, attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil, annotations: Seq[String] = Nil ) final case class Header( name: String, `type`: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, required: Boolean, default: _root_.scala.Option[String] = None, attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil ) /** * An import is used to declare a dependency on another application. This allows * you to reference the models and or enums from that application in your own app. * * @param uri Full URI to the service.json file of the service we are importing * @param namespace the fully qualified namespace that we have imported * @param version The version of the service that we are importing * @param enums Enums made available by this import * @param interfaces Interfaces made available by this import * @param unions Unions made available by this import * @param models Models made available by this import * @param annotations Annotations made available by this import */ final case class Import( uri: String, namespace: String, organization: io.apibuilder.spec.v0.models.Organization, application: io.apibuilder.spec.v0.models.Application, version: String, enums: Seq[String] = Nil, interfaces: Seq[String] = Nil, unions: Seq[String] = Nil, models: Seq[String] = Nil, annotations: Seq[io.apibuilder.spec.v0.models.Annotation] = Nil ) /** * General metadata about this service */ final case class Info( license: _root_.scala.Option[io.apibuilder.spec.v0.models.License] = None, contact: _root_.scala.Option[io.apibuilder.spec.v0.models.Contact] = None ) final case class Interface( name: String, plural: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, fields: Seq[io.apibuilder.spec.v0.models.Field], attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil ) /** * Describes the software license contact for this service */ final case class License( name: String, url: _root_.scala.Option[String] = None ) final case class Model( name: String, plural: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, fields: Seq[io.apibuilder.spec.v0.models.Field], attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil, interfaces: Seq[String] = Nil ) /** * @param path The full path to this operation, relative to the service's base url. */ final case class Operation( method: io.apibuilder.spec.v0.models.Method, path: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, body: _root_.scala.Option[io.apibuilder.spec.v0.models.Body] = None, parameters: Seq[io.apibuilder.spec.v0.models.Parameter] = Nil, responses: Seq[io.apibuilder.spec.v0.models.Response] = Nil, attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil ) /** * @param key Unique key identifying the organization that owns this service */ final case class Organization( key: String ) final case class Parameter( name: String, `type`: String, location: io.apibuilder.spec.v0.models.ParameterLocation, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, required: Boolean, default: _root_.scala.Option[String] = None, minimum: _root_.scala.Option[Long] = None, maximum: _root_.scala.Option[Long] = None, example: _root_.scala.Option[String] = None, attributes: _root_.scala.Option[Seq[io.apibuilder.spec.v0.models.Attribute]] = None ) /** * @param `type` The type of this resource will map to a defined model, enum, or union type * @param path The path to this specific resource. This was added in 2016 to help us * differentiate between the resource path and the operation path which can be * helpful when, for example, generating method names for operations. This field is * optional as some of our input formats (e.g. swagger) do not explicitly * differentiate resoure paths. */ final case class Resource( `type`: String, plural: String, path: _root_.scala.Option[String] = None, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, operations: Seq[io.apibuilder.spec.v0.models.Operation], attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil ) final case class Response( code: io.apibuilder.spec.v0.models.ResponseCode, `type`: String, headers: _root_.scala.Option[Seq[io.apibuilder.spec.v0.models.Header]] = None, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, attributes: _root_.scala.Option[Seq[io.apibuilder.spec.v0.models.Attribute]] = None ) /** * @param apidoc Documents that this is an apibuilder document, noting the specific version used. * Internally the version is then used for backwards compatibility when applicable * as new features are added to apibuilder. Note naming refers to the original name * of this project, 'apidoc', and is left here to avoid a breaking change for * preexisting services. * @param namespace Fully qualified namespace for this service */ final case class Service( @deprecated("This field is no longer used in API Builder and may be removed in the future.") apidoc: _root_.scala.Option[io.apibuilder.spec.v0.models.Apidoc] = None, name: String, organization: io.apibuilder.spec.v0.models.Organization, application: io.apibuilder.spec.v0.models.Application, namespace: String, version: String, baseUrl: _root_.scala.Option[String] = None, description: _root_.scala.Option[String] = None, info: io.apibuilder.spec.v0.models.Info, headers: Seq[io.apibuilder.spec.v0.models.Header] = Nil, imports: Seq[io.apibuilder.spec.v0.models.Import] = Nil, enums: Seq[io.apibuilder.spec.v0.models.Enum] = Nil, interfaces: Seq[io.apibuilder.spec.v0.models.Interface] = Nil, unions: Seq[io.apibuilder.spec.v0.models.Union] = Nil, models: Seq[io.apibuilder.spec.v0.models.Model] = Nil, resources: Seq[io.apibuilder.spec.v0.models.Resource] = Nil, attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil, annotations: Seq[io.apibuilder.spec.v0.models.Annotation] = Nil ) /** * @param discriminator If a type discriminator is provided, serialization of these union types will * always contain a field named with the value of the discriminator that will * contain the name of the type. This provides a simpler (for many use cases) JSON * serialization/deserialization mechanism. When specified, apibuilder itself will * verify that none of the types in the union type itself contain a field with the * same name as the discriminator * @param types The names of the types that make up this union type */ final case class Union( name: String, plural: String, discriminator: _root_.scala.Option[String] = None, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, types: Seq[io.apibuilder.spec.v0.models.UnionType], attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil, interfaces: Seq[String] = Nil ) /** * Metadata about one of the types that is part of a union type * * @param `type` The name of a type (a primitive, model name, or enum name) that makes up this * union type * @param default If true, indicates that this type should be used as the default when * deserializing union types. This field is only used by union types that require a * discriminator and sets the default value for that discriminator during * deserialization. * @param discriminatorValue The discriminator value defines the string to use in the discriminator field to * identify this type. If not specified, the discriminator value will default to * the name of the type itself. */ final case class UnionType( `type`: String, description: _root_.scala.Option[String] = None, deprecation: _root_.scala.Option[io.apibuilder.spec.v0.models.Deprecation] = None, attributes: Seq[io.apibuilder.spec.v0.models.Attribute] = Nil, default: _root_.scala.Option[Boolean] = None, discriminatorValue: _root_.scala.Option[String] = None ) /** * Provides future compatibility in clients - in the future, when a type is added * to the union ResponseCode, 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 ResponseCodeUndefinedType( description: String ) extends ResponseCode /** * Wrapper class to support the union types containing the datatype[integer] */ final case class ResponseCodeInt( value: Int ) extends ResponseCode sealed trait Method extends _root_.scala.Product with _root_.scala.Serializable object Method { case object Get extends Method { override def toString = "GET" } case object Post extends Method { override def toString = "POST" } case object Put extends Method { override def toString = "PUT" } case object Patch extends Method { override def toString = "PATCH" } case object Delete extends Method { override def toString = "DELETE" } case object Head extends Method { override def toString = "HEAD" } case object Connect extends Method { override def toString = "CONNECT" } case object Options extends Method { override def toString = "OPTIONS" } case object Trace extends Method { override def toString = "TRACE" } /** * 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 for 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 Method /** * 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[Method] = scala.List(Get, Post, Put, Patch, Delete, Head, Connect, Options, Trace) private val byName: Map[String, Method] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): Method = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[Method] = byName.get(value.toLowerCase) } sealed trait ParameterLocation extends _root_.scala.Product with _root_.scala.Serializable object ParameterLocation { case object Path extends ParameterLocation { override def toString = "Path" } case object Query extends ParameterLocation { override def toString = "Query" } case object Form extends ParameterLocation { override def toString = "Form" } case object Header extends ParameterLocation { 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 for 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 ParameterLocation /** * 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[ParameterLocation] = scala.List(Path, Query, Form, Header) private val byName: Map[String, ParameterLocation] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): ParameterLocation = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[ParameterLocation] = byName.get(value.toLowerCase) } sealed trait ResponseCodeOption extends ResponseCode object ResponseCodeOption { case object Default extends ResponseCodeOption { override def toString = "Default" } /** * 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 for 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 ResponseCodeOption /** * 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[ResponseCodeOption] = scala.List(Default) private val byName: Map[String, ResponseCodeOption] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): ResponseCodeOption = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[ResponseCodeOption] = byName.get(value.toLowerCase) } }