/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-dev * User agent: apibuilder app.apibuilder.io/sullis/email-markup/0.0.1-dev/flow_erm_schema */ package com.github.sullis.email.markup.v0.erm import io.flow.event.relation.mapper.schema.ErmSpec import io.apibuilder.spec.v0.models.{Enum, EnumValue, Field, Model, Union, UnionType} import com.github.sullis.email.markup.v0.models.ActionHandler import com.github.sullis.email.markup.v0.models.ActionTypes import com.github.sullis.email.markup.v0.models.Address import com.github.sullis.email.markup.v0.models.Customer import com.github.sullis.email.markup.v0.models.GotoAction import com.github.sullis.email.markup.v0.models.Merchant import com.github.sullis.email.markup.v0.models.Offer import com.github.sullis.email.markup.v0.models.OneClickAction import com.github.sullis.email.markup.v0.models.Order import com.github.sullis.email.markup.v0.models.Organization import com.github.sullis.email.markup.v0.models.PaymentMethod import com.github.sullis.email.markup.v0.models.Place import com.github.sullis.email.markup.v0.models.PotentialAction import com.github.sullis.email.markup.v0.models.PriceSpecification import com.github.sullis.email.markup.v0.models.Product object GeneratedErmSchema { implicit lazy val ermSpecActionHandler: ErmSpec[ActionHandler] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.action_handler", spec = Model(name = "action_handler", plural = "action_handlers", fields = Seq( Field(name = "at_type", `type` = "string", required = true), Field(name = "url", `type` = "string", required = true), )), ) implicit lazy val ermSpecAddress: ErmSpec[Address] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.address", spec = Model(name = "address", plural = "addresses", fields = Seq( Field(name = "addressCountry", `type` = "string", required = true), Field(name = "addressLocality", `type` = "string", required = true), Field(name = "addressRegion", `type` = "string", required = true), Field(name = "postalCode", `type` = "string", required = true), Field(name = "postOfficeBoxNumber", `type` = "string", required = true), Field(name = "streetAddress", `type` = "string", required = true), )), ) implicit lazy val ermSpecCustomer: ErmSpec[Customer] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.customer", spec = Model(name = "customer", plural = "customers", fields = Seq( Field(name = "name", `type` = "string", required = true), )), ) implicit lazy val ermSpecPotentialAction: ErmSpec[PotentialAction] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.potential_action", spec = Model(name = "potential_action", plural = "potential_actions", fields = Seq( Field(name = "at_type", `type` = "action_types", required = true), Field(name = "handler", `type` = "action_handler", required = false), Field(name = "name", `type` = "string", required = true), Field(name = "target", `type` = "string", required = true), )), resolved = Map[String, ErmSpec[_]]( "com.github.sullis.email.markup.v0.enums.action_types" -> ermSpecActionTypes, "com.github.sullis.email.markup.v0.models.action_handler" -> ermSpecActionHandler, ), ) implicit lazy val ermSpecGotoAction: ErmSpec[GotoAction] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.goto_action", spec = Model(name = "goto_action", plural = "goto_actions", fields = Seq( Field(name = "at_context", `type` = "string", required = true), Field(name = "at_type", `type` = "string", required = true), Field(name = "potentialAction", `type` = "potential_action", required = true), Field(name = "description", `type` = "string", required = true), )), resolved = Map[String, ErmSpec[_]]( "com.github.sullis.email.markup.v0.models.potential_action" -> ermSpecPotentialAction, ), ) implicit lazy val ermSpecMerchant: ErmSpec[Merchant] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.merchant", spec = Model(name = "merchant", plural = "merchants", fields = Seq( Field(name = "name", `type` = "string", required = true), )), ) implicit lazy val ermSpecPaymentMethod: ErmSpec[PaymentMethod] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.payment_method", spec = Model(name = "payment_method", plural = "payment_methods", fields = Seq( Field(name = "name", `type` = "string", required = true), )), ) implicit lazy val ermSpecPlace: ErmSpec[Place] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.place", spec = Model(name = "place", plural = "places", fields = Seq( Field(name = "address", `type` = "address", required = true), Field(name = "logo", `type` = "string", required = true), Field(name = "map", `type` = "string", required = true), Field(name = "telephone", `type` = "string", required = true), )), resolved = Map[String, ErmSpec[_]]( "com.github.sullis.email.markup.v0.models.address" -> ermSpecAddress, ), ) implicit lazy val ermSpecOrganization: ErmSpec[Organization] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.organization", spec = Model(name = "organization", plural = "organizations", fields = Seq( Field(name = "address", `type` = "address", required = true), Field(name = "legal_name", `type` = "string", required = true), )), resolved = Map[String, ErmSpec[_]]( "com.github.sullis.email.markup.v0.models.address" -> ermSpecAddress, ), ) implicit lazy val ermSpecProduct: ErmSpec[Product] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.product", spec = Model(name = "product", plural = "products", fields = Seq( Field(name = "productID", `type` = "string", required = true), Field(name = "sku", `type` = "string", required = true), Field(name = "brand", `type` = "organization", required = false), Field(name = "manufacturer", `type` = "organization", required = false), Field(name = "color", `type` = "string", required = false), )), resolved = Map[String, ErmSpec[_]]( "com.github.sullis.email.markup.v0.models.organization" -> ermSpecOrganization, ), ) implicit lazy val ermSpecPriceSpecification: ErmSpec[PriceSpecification] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.price_specification", spec = Model(name = "price_specification", plural = "price_specifications", fields = Seq( Field(name = "eligibleQuantity", `type` = "string", required = true), Field(name = "eligibleTransactionVolume", `type` = "string", required = true), Field(name = "maxPrice", `type` = "decimal", required = true), Field(name = "minPrice", `type` = "decimal", required = true), Field(name = "price", `type` = "decimal", required = true), Field(name = "priceCurrency", `type` = "string", required = true), Field(name = "validFrom", `type` = "date-time-iso8601", required = true), Field(name = "validThrough", `type` = "date-time-iso8601", required = true), Field(name = "valueAddedTaxIncluded", `type` = "boolean", required = true), )), ) implicit lazy val ermSpecOffer: ErmSpec[Offer] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.offer", spec = Model(name = "offer", plural = "offers", fields = Seq( Field(name = "acceptedPaymentMethod", `type` = "payment_method", required = false), Field(name = "addOn", `type` = "offer", required = false), Field(name = "advanceBookingRequirement", `type` = "string", required = false), Field(name = "aggregateRating", `type` = "string", required = false), Field(name = "availability", `type` = "string", required = false), Field(name = "availabilityEnds", `type` = "date-time-iso8601", required = false), Field(name = "availabilityStarts", `type` = "date-time-iso8601", required = false), Field(name = "availableAtOrFrom", `type` = "place", required = false), Field(name = "availableDeliveryMethod", `type` = "string", required = false), Field(name = "businessFunction", `type` = "string", required = false), Field(name = "category", `type` = "string", required = false), Field(name = "deliveryLeadTime", `type` = "string", required = false), Field(name = "eligibleCustomerType", `type` = "string", required = false), Field(name = "eligibleDuration", `type` = "string", required = false), Field(name = "eligibleQuantity", `type` = "string", required = false), Field(name = "eligibleRegion", `type` = "string", required = false), Field(name = "eligibleTransactionVolume", `type` = "string", required = false), Field(name = "gtin13", `type` = "string", required = false), Field(name = "gtin14", `type` = "string", required = false), Field(name = "gtin8", `type` = "string", required = false), Field(name = "includesObject", `type` = "string", required = false), Field(name = "ineligibleRegion", `type` = "string", required = false), Field(name = "inventoryLevel", `type` = "string", required = false), Field(name = "itemCondition", `type` = "string", required = false), Field(name = "itemOffered", `type` = "product", required = true), Field(name = "mpn", `type` = "string", required = false), Field(name = "name", `type` = "string", required = true), Field(name = "price", `type` = "decimal", required = true), Field(name = "priceCurrency", `type` = "string", required = true), Field(name = "priceSpecification", `type` = "price_specification", required = false), Field(name = "priceValidUntil", `type` = "string", required = false), Field(name = "seller", `type` = "organization", required = false), Field(name = "serialNumber", `type` = "string", required = false), Field(name = "sku", `type` = "string", required = false), Field(name = "validFrom", `type` = "date-time-iso8601", required = false), Field(name = "validThrough", `type` = "date-time-iso8601", required = false), )), resolved = Map[String, ErmSpec[_]]( "com.github.sullis.email.markup.v0.models.payment_method" -> ermSpecPaymentMethod, "com.github.sullis.email.markup.v0.models.offer" -> ermSpecOffer, "com.github.sullis.email.markup.v0.models.place" -> ermSpecPlace, "com.github.sullis.email.markup.v0.models.product" -> ermSpecProduct, "com.github.sullis.email.markup.v0.models.price_specification" -> ermSpecPriceSpecification, "com.github.sullis.email.markup.v0.models.organization" -> ermSpecOrganization, ), ) implicit lazy val ermSpecOneClickAction: ErmSpec[OneClickAction] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.one_click_action", spec = Model(name = "one_click_action", plural = "one_click_actions", fields = Seq( Field(name = "at_context", `type` = "string", required = true), Field(name = "at_type", `type` = "string", required = true), Field(name = "potentialAction", `type` = "potential_action", required = true), Field(name = "description", `type` = "string", required = true), )), resolved = Map[String, ErmSpec[_]]( "com.github.sullis.email.markup.v0.models.potential_action" -> ermSpecPotentialAction, ), ) implicit lazy val ermSpecOrder: ErmSpec[Order] = ErmSpec.model( qualifiedName = "com.github.sullis.email.markup.v0.models.order", spec = Model(name = "order", plural = "orders", fields = Seq( Field(name = "billingAddress", `type` = "address", required = false), Field(name = "customer", `type` = "customer", required = true), Field(name = "discount", `type` = "decimal", required = false), Field(name = "discountCurrency", `type` = "string", required = false), Field(name = "isGift", `type` = "boolean", required = true), Field(name = "merchant", `type` = "merchant", required = true), Field(name = "orderNumber", `type` = "string", required = true), Field(name = "priceCurrency", `type` = "string", required = true), Field(name = "priceSpecification", `type` = "price_specification", required = false), Field(name = "price", `type` = "decimal", required = true), Field(name = "acceptedOffer", `type` = "[offer]", required = true), Field(name = "url", `type` = "string", required = true), Field(name = "orderStatus", `type` = "string", required = true), Field(name = "paymentMethod", `type` = "payment_method", required = true), Field(name = "paymentMethodId", `type` = "string", required = true), Field(name = "orderDate", `type` = "date-time-iso8601", required = true), )), resolved = Map[String, ErmSpec[_]]( "com.github.sullis.email.markup.v0.models.address" -> ermSpecAddress, "com.github.sullis.email.markup.v0.models.customer" -> ermSpecCustomer, "com.github.sullis.email.markup.v0.models.merchant" -> ermSpecMerchant, "com.github.sullis.email.markup.v0.models.price_specification" -> ermSpecPriceSpecification, "com.github.sullis.email.markup.v0.models.offer" -> ermSpecOffer, "com.github.sullis.email.markup.v0.models.payment_method" -> ermSpecPaymentMethod, ), ) implicit lazy val ermSpecActionTypes: ErmSpec[ActionTypes] = ErmSpec.`enum`( qualifiedName = "com.github.sullis.email.markup.v0.enums.action_types", spec = Enum(name = "action_types", plural = "action_types", values = Seq( EnumValue(name = "ConfirmAction"), EnumValue(name = "SaveAction"), EnumValue(name = "TrackAction"), EnumValue(name = "ViewAction"), )), ) val all: Seq[ErmSpec[_]] = Seq( ermSpecActionHandler, ermSpecAddress, ermSpecCustomer, ermSpecPotentialAction, ermSpecGotoAction, ermSpecMerchant, ermSpecPaymentMethod, ermSpecPlace, ermSpecOrganization, ermSpecProduct, ermSpecPriceSpecification, ermSpecOffer, ermSpecOneClickAction, ermSpecOrder, ermSpecActionTypes, ) }