/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.6 * User agent: apibuilder app.apibuilder.io/flow/postman-generator-attributes/0.0.6/http4s_0_17 */ package io.flow.postman.generator.attributes.v0.models { /** * Attribute instructs the generator to add Basic Auth info to the whole Postman * collection. Attribute should be defined on the root level of the ApiBuilder * specification * * @param username Specifies the username to be used in Postman Collection auth definition. It may * be also a variable reference. * @param password Specified the password to be used in Postman Collection auth definition. It may * be also a variable reference. Leave this string empty, when only a username is * needed. */ final case class BasicAuth( username: String, password: String ) /** * Attribute instructs the generator to add a setup step with the referenced entity * creation. This attribute should be attached to the field (that holds an * identifier) inside model or to the resource path (that holds one path param). * * @param relatedServiceNamespace ApiBuilder service's namespace, in which a target operation is specified. * @param resourceType Resource type, that holds a referenced operation. * @param operationMethod Referenced operation method. * @param operationPath Operation path corresponding with the selected {{operation_method}}. * @param identifierField A field name. When the referenced operation is called, identifier_field is used * to extract the corresponding field from the response JSON. If the response JSON * is an array, then a value is extracted from the first object. * @param queryParams Optionally, the specified query params will be used to execute a referenced * operation. * @param deleteOperationPath Optionally, the referenced entity's DELETE operation path can be put here. If * specified, the generator will add a cleanup step for the referenced object. */ final case class ObjectReference( relatedServiceNamespace: String, resourceType: String, operationMethod: io.apibuilder.spec.v0.models.Method, operationPath: String, identifierField: String, queryParams: _root_.scala.Option[Map[String, String]] = None, deleteOperationPath: _root_.scala.Option[String] = None ) /** * Attribute instructs the generator to substitute a field value (when generating * examples) with specified value or variable reference. Attribute should be * attached to a field inside model. * * @param substitute Value, which will be put into the field marked by this attribute. It may be also * a variable reference. */ final case class ValueSubstitute( substitute: String ) /** * A set of attribute names, that are recognized by Postman Generator */ sealed trait AttributeName extends _root_.scala.Product with _root_.scala.Serializable object AttributeName { case object PostmanBasicAuth extends AttributeName { override def toString = "postman-basic-auth" } case object ObjectReference extends AttributeName { override def toString = "object-reference" } case object ValueSubstitute extends AttributeName { override def toString = "value-substitute" } /** * 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 AttributeName /** * 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[AttributeName] = scala.List(PostmanBasicAuth, ObjectReference, ValueSubstitute) private val byName: Map[String, AttributeName] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): AttributeName = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[AttributeName] = byName.get(value.toLowerCase) } }