/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-dev * User agent: apibuilder app.apibuilder.io/secret/apibuilder-api/0.0.1-dev/http4s_0_15 */ package com.afrosoft.apibuilder.api.v0.models { /** * Represents a single diff in an application */ sealed trait Diff extends _root_.scala.Product with _root_.scala.Serializable { def diffType: DiffType } /** * Defines the valid type values for the type Diff */ sealed trait DiffType extends _root_.scala.Product with _root_.scala.Serializable object DiffType { case object DiffBreaking extends DiffType { override def toString = "diff_breaking" } case object DiffNonBreaking extends DiffType { override def toString = "diff_non_breaking" } final case class UNDEFINED(override val toString: String) extends DiffType val all: scala.List[DiffType] = scala.List(DiffBreaking, DiffNonBreaking) private val byName: Map[String, DiffType] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): DiffType = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[DiffType] = byName.get(value.toLowerCase) } /** * Identifies the specific type of item that was indexed by search */ sealed trait ItemDetail extends _root_.scala.Product with _root_.scala.Serializable { def itemDetailType: ItemDetailType } /** * Defines the valid type values for the type ItemDetail */ sealed trait ItemDetailType extends _root_.scala.Product with _root_.scala.Serializable object ItemDetailType { /** * Represents that the item indexed was an application */ case object ApplicationSummary extends ItemDetailType { override def toString = "application_summary" } final case class UNDEFINED(override val toString: String) extends ItemDetailType val all: scala.List[ItemDetailType] = scala.List(ApplicationSummary) private val byName: Map[String, ItemDetailType] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): ItemDetailType = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[ItemDetailType] = byName.get(value.toLowerCase) } /** * An application has a name and multiple versions of its API. * * @param guid Internal unique identifier for this application. * @param name The unique name for this application. * @param key Used as a unique key in the URL path. Key is automatically derived from the * application name. * @param visibility Controls who is able to view this application * @param lastUpdatedAt The updated_at of this application or created_at of it's latest version */ final case class Application( guid: _root_.java.util.UUID, organization: io.apibuilder.common.v0.models.Reference, name: String, key: String, visibility: com.afrosoft.apibuilder.api.v0.models.Visibility, description: _root_.scala.Option[String] = None, lastUpdatedAt: _root_.java.time.Instant, audit: io.apibuilder.common.v0.models.Audit ) /** * @param key Defaults to a key generated from the application name */ final case class ApplicationForm( name: String, key: _root_.scala.Option[String] = None, description: _root_.scala.Option[String] = None, visibility: com.afrosoft.apibuilder.api.v0.models.Visibility ) /** * @param guid Internal unique identifier for this application. * @param key Used as a unique key in the URL path. Key is automatically derived from the * application name. */ final case class ApplicationMetadata( guid: _root_.java.util.UUID, key: String ) /** * Describes the versions associated with a given application */ final case class ApplicationMetadataVersion( version: String ) /** * Summary of an application sufficient for display and links */ final case class ApplicationSummary( guid: _root_.java.util.UUID, organization: io.apibuilder.common.v0.models.Reference, key: String ) extends ItemDetail { override val itemDetailType: ItemDetailType = ItemDetailType.ApplicationSummary } /** * Attributes are globally unique key which allow users to specify additional * content to pass in to the code generators. * * @param guid Internal unique identifier for this attribute. * @param name The name of the attribute. Globally unique and an 'identifier' (lower case, url * safe, etc.) * @param description Optional description - a good description here will indicate which code * generators it applies to and what effect it will have on those code generators. */ final case class Attribute( guid: _root_.java.util.UUID, name: String, description: _root_.scala.Option[String] = None, audit: io.apibuilder.common.v0.models.Audit ) final case class AttributeForm( name: String, description: _root_.scala.Option[String] = None ) /** * @param guid Internal unique identifier for this attribute. * @param name The name of the attribute. Globally unique and an 'identifier' (lower case, url * safe, etc.) */ final case class AttributeSummary( guid: _root_.java.util.UUID, name: String ) /** * Attribute values can be set at different levels. Initially we support setting * organization wide attributes, but in the future plan to support setting * attribute values with each version of the application. * * @param guid Internal unique identifier for this attribute value. */ final case class AttributeValue( guid: _root_.java.util.UUID, attribute: com.afrosoft.apibuilder.api.v0.models.AttributeSummary, value: String, audit: io.apibuilder.common.v0.models.Audit ) final case class AttributeValueForm( value: String ) /** * Represents the result of a successful authorization */ final case class Authentication( user: com.afrosoft.apibuilder.api.v0.models.User, session: com.afrosoft.apibuilder.api.v0.models.Session ) /** * Represents a single change from one version of a service to another * * @param changedAt Records the timestamp of when the actual change occurred (vs. when we created * the changed record) * @param changedBy Records who made the actual change */ final case class Change( guid: _root_.java.util.UUID, organization: io.apibuilder.common.v0.models.Reference, application: io.apibuilder.common.v0.models.Reference, fromVersion: com.afrosoft.apibuilder.api.v0.models.ChangeVersion, toVersion: com.afrosoft.apibuilder.api.v0.models.ChangeVersion, diff: com.afrosoft.apibuilder.api.v0.models.Diff, changedAt: _root_.java.time.Instant, changedBy: com.afrosoft.apibuilder.api.v0.models.UserSummary, audit: io.apibuilder.common.v0.models.Audit ) /** * Represents a simpler model of a version specifically for the use case of * displaying changes */ final case class ChangeVersion( guid: _root_.java.util.UUID, version: String ) /** * Separate resource used only for the few actions that require the full token. * * @param token The actual token. Guaranteed to be globally unique. */ final case class CleartextToken( token: String ) /** * Generated source code. * * @param source The actual source code. * @param files A collection of source files */ final case class Code( generator: com.afrosoft.apibuilder.api.v0.models.GeneratorWithService, @deprecated("Use files instead") source: String, files: Seq[io.apibuilder.generator.v0.models.File] = Nil ) final case class CodeForm( attributes: Seq[io.apibuilder.generator.v0.models.Attribute] ) /** * Represents a single breaking diff of an application version. A breaking diff * indicates that it is possible for an existing client to now experience an error * or invalid data due to the diff. */ final case class DiffBreaking( description: String ) extends Diff { override val diffType: DiffType = DiffType.DiffBreaking } /** * Represents a single NON breaking diff of an application version. */ final case class DiffNonBreaking( description: String ) extends Diff { override val diffType: DiffType = DiffType.DiffNonBreaking } /** * Represents a single domain name (e.g. www.apibuilder.io). When a new user * registers and confirms their email, we automatically associate that user with a * member of the organization associated with their domain. For example, if you * confirm your account with an email address of example@somedomain.com, we will * automatically create a membership request on your behalf to join the * organization with domain somedomain.com. * * @param name The domain name */ final case class Domain( name: String ) /** * Data used to confirm an email address. The token is an internal unique * identifier used to lookup the specific email address and user account for which * we sent an email verification email. */ final case class EmailVerificationConfirmationForm( token: String ) /** * @param code Machine readable code for this specific error message * @param message Description of the error */ final case class Error( code: String, message: String ) final case class GeneratorForm( serviceGuid: _root_.java.util.UUID, generator: io.apibuilder.generator.v0.models.Generator ) /** * Defines a service that provides one or more code generators */ final case class GeneratorService( guid: _root_.java.util.UUID, uri: String, audit: io.apibuilder.common.v0.models.Audit ) final case class GeneratorServiceForm( uri: String ) /** * Wraps a service and a generator providing easier access for applications. */ final case class GeneratorWithService( service: com.afrosoft.apibuilder.api.v0.models.GeneratorService, generator: io.apibuilder.generator.v0.models.Generator ) /** * When searching for content, the results of the search will be a list of items. * Each item will have enough information to render for the user, including a type * and item_guid to enable creating the appropriate link. * * @param guid Unique identifer for this item. By using a UUID, you can combine with the type * to figure out the URI for the resource */ final case class Item( guid: _root_.java.util.UUID, detail: com.afrosoft.apibuilder.api.v0.models.ItemDetail, label: String, description: _root_.scala.Option[String] = None ) /** * A membership represents a user in a specific role to an organization. * Memberships cannot be created directly. Instead you first create a membership * request, then that request is either accepted or declined. * * @param guid Internal unique identifier for this membership. * @param role The role this user plays for this organization. Typically member or admin. */ final case class Membership( guid: _root_.java.util.UUID, user: com.afrosoft.apibuilder.api.v0.models.User, organization: com.afrosoft.apibuilder.api.v0.models.Organization, role: String, audit: io.apibuilder.common.v0.models.Audit ) /** * A membership request represents a user requesting to join an organization with a * specific role (e.g. as a member or an admin). Membership requests can be * reviewed by any current admin of the organization who can either accept or * decline the request. * * @param guid Internal unique identifier for this membership request. * @param role The requested role for membership to this organization. Typically member or * admin. */ final case class MembershipRequest( guid: _root_.java.util.UUID, user: com.afrosoft.apibuilder.api.v0.models.User, organization: com.afrosoft.apibuilder.api.v0.models.Organization, role: String, audit: io.apibuilder.common.v0.models.Audit ) /** * @param orgKey The key of the organization to which we are moving this item */ final case class MoveForm( orgKey: String ) /** * An organization is used to group a set of applications together. * * @param guid Internal unique identifier for this organization. * @param key Used as a unique key in the URL path. Key is automatically derived from the * organization name. * @param name The name of this organization. * @param namespace Global namespace for this organization. */ final case class Organization( guid: _root_.java.util.UUID, key: String, name: String, namespace: String, visibility: com.afrosoft.apibuilder.api.v0.models.Visibility, domains: Seq[com.afrosoft.apibuilder.api.v0.models.Domain] = Nil, audit: io.apibuilder.common.v0.models.Audit ) /** * @param key Defaults to a url friendy version of the name * @param namespace Global namespace for this organization. * @param visibility Public organizations will be listed in apibuilder directory. Organizations with * visibility organization will only be visible to members of that org. */ final case class OrganizationForm( name: String, key: _root_.scala.Option[String] = None, namespace: String, visibility: com.afrosoft.apibuilder.api.v0.models.Visibility = com.afrosoft.apibuilder.api.v0.models.Visibility.Organization, domains: _root_.scala.Option[Seq[String]] = None ) /** * Represents the original input used to create an application version */ final case class Original( `type`: com.afrosoft.apibuilder.api.v0.models.OriginalType, data: String ) /** * @param `type` If not specified, we set the type by inspecting the data */ final case class OriginalForm( `type`: _root_.scala.Option[com.afrosoft.apibuilder.api.v0.models.OriginalType] = None, data: String ) /** * Allows a user to change their password with authentication from a token. * * @param token Unique one time use token to change a password */ final case class PasswordReset( token: String, password: String ) /** * Create a password reset request - e.g. an email containing a one time URL to * change a password * * @param email The email address for which we generate the password reset. */ final case class PasswordResetRequest( email: String ) /** * Represents a user sessions (e.g. user logged into site) * * @param id Cryptographically secure session id */ final case class Session( id: String, expiresAt: _root_.java.time.Instant ) /** * Represents a user that is currently subscribed to a publication * * @param guid Internal unique identifier for this subscription record */ final case class Subscription( guid: _root_.java.util.UUID, organization: com.afrosoft.apibuilder.api.v0.models.Organization, user: com.afrosoft.apibuilder.api.v0.models.User, publication: com.afrosoft.apibuilder.api.v0.models.Publication, audit: io.apibuilder.common.v0.models.Audit ) final case class SubscriptionForm( organizationKey: String, userGuid: _root_.java.util.UUID, publication: com.afrosoft.apibuilder.api.v0.models.Publication ) /** * A token gives a user access to the API. * * @param guid Internal unique identifier for this token. * @param user The user to which this token belongs. * @param maskedToken The masked from of the token. * @param description optional description to help the user manage the token. */ final case class Token( guid: _root_.java.util.UUID, user: com.afrosoft.apibuilder.api.v0.models.User, maskedToken: String, description: _root_.scala.Option[String] = None, audit: io.apibuilder.common.v0.models.Audit ) /** * @param userGuid The user for which we are creating the token. */ final case class TokenForm( userGuid: _root_.java.util.UUID, description: _root_.scala.Option[String] = None ) /** * A user is a top level person interacting with the api doc server. * * @param guid Internal unique identifier for this user. * @param nickname Public unique identifier for this user. */ final case class User( guid: _root_.java.util.UUID, email: String, nickname: String, name: _root_.scala.Option[String] = None, audit: io.apibuilder.common.v0.models.Audit ) /** * @param nickname Defaults to a unique identifier based on email address */ final case class UserForm( email: String, password: String, nickname: _root_.scala.Option[String] = None, name: _root_.scala.Option[String] = None ) /** * Summary of a user sufficient for display */ final case class UserSummary( guid: _root_.java.util.UUID, nickname: String ) final case class UserUpdateForm( email: String, nickname: String, name: _root_.scala.Option[String] = None ) /** * Used only to validate json files - used as a resource where http status code * defines success * * @param valid If true, the json schema is valid. If false, there is at least one validation * error. * @param errors Contains any validation errors that result from parsing the json document. If * empty, the document is valid. */ final case class Validation( valid: Boolean, errors: Seq[String] = Nil ) /** * Represents a unique version of the application. * * @param guid Internal unique identifier for this version. * @param version The tag for this version. Can be anything, but if semver style version number is * used, we automatically correctly sort by version number to find latest. * Otherwise latest version is considered to be the most recently created. * @param original The original uploaded file describing this version, if available * @param service spec/spec.json description of this API */ final case class Version( guid: _root_.java.util.UUID, organization: io.apibuilder.common.v0.models.Reference, application: io.apibuilder.common.v0.models.Reference, version: String, original: _root_.scala.Option[com.afrosoft.apibuilder.api.v0.models.Original] = None, service: io.apibuilder.spec.v0.models.Service, audit: io.apibuilder.common.v0.models.Audit ) /** * @param visibility If provided, updates the visibility for all versions of this application */ final case class VersionForm( originalForm: com.afrosoft.apibuilder.api.v0.models.OriginalForm, visibility: _root_.scala.Option[com.afrosoft.apibuilder.api.v0.models.Visibility] = None ) /** * Users can watch individual applications which enables features like receiving an * email notification when there is a new version of an application. * * @param guid Internal unique identifier for this watch */ final case class Watch( guid: _root_.java.util.UUID, user: com.afrosoft.apibuilder.api.v0.models.User, organization: com.afrosoft.apibuilder.api.v0.models.Organization, application: com.afrosoft.apibuilder.api.v0.models.Application, audit: io.apibuilder.common.v0.models.Audit ) final case class WatchForm( userGuid: _root_.java.util.UUID, organizationKey: String, applicationKey: String ) /** * Provides future compatibility in clients - in the future, when a type is added * to the union Diff, 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 DiffUndefinedType( description: String ) extends Diff { override val diffType: DiffType = DiffType.UNDEFINED(description) } /** * Provides future compatibility in clients - in the future, when a type is added * to the union ItemDetail, 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 ItemDetailUndefinedType( description: String ) extends ItemDetail { override val itemDetailType: ItemDetailType = ItemDetailType.UNDEFINED(description) } sealed trait AppSortBy extends _root_.scala.Product with _root_.scala.Serializable object AppSortBy { case object Name extends AppSortBy { override def toString = "name" } case object CreatedAt extends AppSortBy { override def toString = "created_at" } case object UpdatedAt extends AppSortBy { override def toString = "updated_at" } case object Visibility extends AppSortBy { override def toString = "visibility" } /** * 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 AppSortBy /** * 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[AppSortBy] = scala.List(Name, CreatedAt, UpdatedAt, Visibility) private val byName: Map[String, AppSortBy] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): AppSortBy = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[AppSortBy] = byName.get(value.toLowerCase) } sealed trait OriginalType extends _root_.scala.Product with _root_.scala.Serializable object OriginalType { /** * The original is in the api.json format */ case object ApiJson extends OriginalType { override def toString = "api_json" } /** * The original is in Avro Idl format */ case object AvroIdl extends OriginalType { override def toString = "avro_idl" } /** * This is the canonical service spec for apibuilder itself. See * https://www.apibuilder.io/apicollective/apibuilder-spec/latest#model-service */ case object ServiceJson extends OriginalType { override def toString = "service_json" } /** * The original in the Swagger JSON or YAML format */ case object Swagger extends OriginalType { override def toString = "swagger" } /** * 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 OriginalType /** * 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[OriginalType] = scala.List(ApiJson, AvroIdl, ServiceJson, Swagger) private val byName: Map[String, OriginalType] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): OriginalType = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[OriginalType] = byName.get(value.toLowerCase) } /** * A publication represents something that a user can subscribe to. An example * would be subscribing to an email alert whenever a new version of an application * is created. */ sealed trait Publication extends _root_.scala.Product with _root_.scala.Serializable object Publication { /** * For organizations for which I am an administrator, email me whenever a user * applies to join the org. */ case object MembershipRequestsCreate extends Publication { override def toString = "membership_requests.create" } /** * For organizations for which I am a member, email me whenever a user joins the * org. */ case object MembershipsCreate extends Publication { override def toString = "memberships.create" } /** * For organizations for which I am a member, email me whenever an application is * created. */ case object ApplicationsCreate extends Publication { override def toString = "applications.create" } /** * For applications that I watch, email me whenever a version is created. */ case object VersionsCreate extends Publication { override def toString = "versions.create" } /** * 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 Publication /** * 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[Publication] = scala.List(MembershipRequestsCreate, MembershipsCreate, ApplicationsCreate, VersionsCreate) private val byName: Map[String, Publication] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): Publication = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[Publication] = byName.get(value.toLowerCase) } sealed trait SortOrder extends _root_.scala.Product with _root_.scala.Serializable object SortOrder { case object Asc extends SortOrder { override def toString = "asc" } case object Desc extends SortOrder { 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 SortOrder /** * 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[SortOrder] = scala.List(Asc, Desc) private val byName: Map[String, SortOrder] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): SortOrder = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[SortOrder] = byName.get(value.toLowerCase) } /** * Controls who is able to view this version */ sealed trait Visibility extends _root_.scala.Product with _root_.scala.Serializable object Visibility { /** * Only the creator can view this application */ case object User extends Visibility { override def toString = "user" } /** * Any member of the organization can view this application */ case object Organization extends Visibility { override def toString = "organization" } /** * Anybody, including non logged in users, can view this application */ case object Public extends Visibility { override def toString = "public" } /** * 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 Visibility /** * 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[Visibility] = scala.List(User, Organization, Public) private val byName: Map[String, Visibility] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): Visibility = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[Visibility] = byName.get(value.toLowerCase) } }