/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-dev * User agent: apibuilder app.apibuilder.io/shopr/clickouts-api/0.0.1-dev/http4s_0_20 */ package com.shopr.api.clickouts.api.v0.models { /** * Represents an Offer click-out. It contains all the information needed to * properly identify the offer, trace it ot the user navigating from search page, * and relevant information about the offer at the click-out moment (e.g.: price, * lowest price among other offers, etc.) * * @param productId Product identifier * @param seller Seller/Retailer unique identifier * @param sellerProductId Product as identifier given by the seller/retailer * @param price Offer price at the moment of the click-out * @param deepUrl Full product URL at the retailer side * @param lowestPrice Lowest price among all offers * @param highestPrice Seller/Retailer unique identifier * @param offerCount Number of offers * @param offerPosition Offer position among other offers (e.g.: first, second, etc.) * @param categoryId Category where the product was put into * @param tracking Tracking information * @param creationTime When this click-out happened */ final case class Clickout( productId: String, seller: String, sellerProductId: String, price: BigDecimal, deepUrl: String, lowestPrice: BigDecimal, highestPrice: BigDecimal, offerCount: Int = 1, offerPosition: Int, categoryId: String, tracking: com.shopr.api.clickouts.api.v0.models.Tracking, creationTime: _root_.java.time.Instant ) /** * @param code Machine readable code for this specific error message * @param localizedStringCode A localized description of the error code */ final case class ErrorCode( code: String, localizedStringCode: String ) /** * @param message User-friendly message. * @param errorCodes List of errors that may happened all together. * @param fingerprint The request fingerprint associated with this error. */ final case class ErrorResponse( message: _root_.scala.Option[String] = None, errorCodes: Seq[com.shopr.api.clickouts.api.v0.models.ErrorCode], fingerprint: _root_.scala.Option[String] = None ) /** * Response for ping, health check and version */ final case class Status( response: String ) /** * Series of attributes for tracking purposes * * @param origin Client originating the order request essentially any of the values of the * client_origin enum. * @param referrer Optional page referrer. */ final case class Tracking( ipAddress: String, origin: com.shopr.api.clickouts.api.v0.models.ClientOrigin, userAgent: _root_.scala.Option[String] = None, referrer: _root_.scala.Option[String] = None ) /** * Describes the client where the request for a clickout has originated. */ sealed trait ClientOrigin extends _root_.scala.Product with _root_.scala.Serializable object ClientOrigin { /** * The Shopr website */ case object ShoprWebsite extends ClientOrigin { override def toString = "shopr_website" } /** * The Shopr website, but from a mobile. */ case object ShoprMobileWeb extends ClientOrigin { override def toString = "shopr_mobile_web" } /** * IPhone native application. */ case object ShoprIphone extends ClientOrigin { override def toString = "shopr_iphone" } /** * Native application running on an IPad. */ case object ShoprIpad extends ClientOrigin { override def toString = "shopr_ipad" } /** * Android native application. */ case object ShoprAndroid extends ClientOrigin { override def toString = "shopr_android" } /** * 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 ClientOrigin /** * 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[ClientOrigin] = scala.List(ShoprWebsite, ShoprMobileWeb, ShoprIphone, ShoprIpad, ShoprAndroid) private val byName: Map[String, ClientOrigin] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): ClientOrigin = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[ClientOrigin] = byName.get(value.toLowerCase) } }